(sourceDir: string, outDir: string)
| 80 | } |
| 81 | |
| 82 | function buildDocs(sourceDir: string, outDir: string) { |
| 83 | if (!existsSync(sourceDir)) throw new Error(`Docs workspace not found: ${sourceDir}`); |
| 84 | |
| 85 | const docsContentDir = resolve(sourceDir, contentDir); |
| 86 | if (!existsSync(docsContentDir)) { |
| 87 | throw new Error(`Docs content directory "${contentDir}" not found at ${docsContentDir}`); |
| 88 | } |
| 89 | |
| 90 | resetDir(outDir); |
| 91 | run("pnpm run content-collections:build", { cwd: sourceDir, inherit: true }); |
| 92 | |
| 93 | const ccSrc = resolve(sourceDir, ".content-collections"); |
| 94 | const ccDest = join(outDir, ".content-collections"); |
| 95 | if (!existsSync(ccSrc)) throw new Error(`Build output missing at ${ccSrc}`); |
| 96 | |
| 97 | resetDir(ccDest); |
| 98 | cpSync(ccSrc, ccDest, { recursive: true }); |
| 99 | |
| 100 | console.log(chalk.green(`✔ Built docs → ${ccDest}`)); |
| 101 | } |
| 102 | |
| 103 | function buildRef(ref: string, labelForOutDir: string) { |
| 104 | const tmpBase = mkdtempSync(resolve(os.tmpdir(), "docs-wt-")); |
no test coverage detected
searching dependent graphs…