MCPcopy Index your code
hub / github.com/code-forge-io/react-router-devtools / buildDocs

Function buildDocs

docs/scripts/generate-docs.ts:82–101  ·  view source on GitHub ↗
(sourceDir: string, outDir: string)

Source from the content-addressed store, hash-verified

80}
81
82function 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
103function buildRef(ref: string, labelForOutDir: string) {
104 const tmpBase = mkdtempSync(resolve(os.tmpdir(), "docs-wt-"));

Callers 2

buildRefFunction · 0.85
generate-docs.tsFile · 0.85

Calls 2

resetDirFunction · 0.85
runFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…