{"version":3,"file":"get-markdown.cjs","sources":["../../../../../src/v4/server/utils/template/get-markdown.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport { getStatus } from './get-status.js';\n\nexport const getMarkdown = async (\n  projectDirRoot: string,\n  templateId: string,\n  locale: string,\n): Promise<string> => {\n  const tplDir = path.resolve(projectDirRoot, 'dist', templateId, locale);\n\n  const { isTemplateExists } = await getStatus(tplDir);\n\n  if (!isTemplateExists) throw new Error(\"'template.md does not exist.\");\n\n  const markdownPath = path.resolve(tplDir, 'template.md');\n  return fs.readFileSync(markdownPath, { encoding: 'utf-8' });\n};\n"],"names":["getMarkdown","projectDirRoot","templateId","locale","tplDir","path","isTemplateExists","getStatus","markdownPath","fs"],"mappings":"gKAKaA,EAAc,MACzBC,EACAC,EACAC,IACoB,CACpB,MAAMC,EAASC,EAAK,QAAQJ,EAAgB,OAAQC,EAAYC,CAAM,EAEhE,CAAE,iBAAAG,CAAA,EAAqB,MAAMC,EAAAA,UAAUH,CAAM,EAEnD,GAAI,CAACE,EAAkB,MAAM,IAAI,MAAM,8BAA8B,EAErE,MAAME,EAAeH,EAAK,QAAQD,EAAQ,aAAa,EACvD,OAAOK,EAAG,aAAaD,EAAc,CAAE,SAAU,QAAS,CAC5D"}