Lines 142-182javascript
142 await fs2.rm(destDir, { recursive: true, force: true });
143 await fs2.mkdir(destDir, { recursive: true });
144 await fs2.cp(docsSourceDir, destDir, { recursive: true });
145 await fs2.writeFile(path3.join(destDir, "index.mdx"), generateIndexMdx(config));
147function watchContent(cacheRoot, docsSourceDir) {
148 const destDir = contentDocsDir(cacheRoot);
149 const destPathFor = (sourcePath) => path3.join(destDir, path3.relative(docsSourceDir, sourcePath));
150 const watcher = chokidar.watch(docsSourceDir, { ignoreInitial: true });
151 watcher.on("add", (sourcePath) => fs2.cp(sourcePath, destPathFor(sourcePath)));
152 watcher.on("change", (sourcePath) => fs2.cp(sourcePath, destPathFor(sourcePath)));
153 watcher.on("unlink", (sourcePath) => fs2.rm(destPathFor(sourcePath), { force: true }));
154 return () => watcher.close();
157// framework/config/load.ts
158import { createJiti } from "jiti";
159import path4 from "path";
160async function loadDocsConfig(projectRoot2) {
161 const configPath = path4.join(projectRoot2, "docs.config.ts");
162 const jiti = createJiti(import.meta.url);
163 return jiti.import(configPath, { default: true });
164}
MediumDynamic Require
Package source references dynamic require/import behavior.
dist-cli/cli.jsView on unpkg · L162 166// framework/config/resolve.ts
167import fs3 from "fs/promises";
168import path5 from "path";
169var SITE_DOMAIN = "https://docs.trickfirerobotics.com";
170var GITHUB_ORG = "TrickfireRobotics";
175 href: "https://www.notion.so/trickfire/invite/7f153eec8ed8ebe4608dc95892fce859540f8640"
177 { icon: "external", label: "TrickFire Robotics", href: SITE_DOMAIN }
179async function readProjectName(projectRoot2) {
180 const pkgPath = path5.join(projectRoot2, "package.json");
181 const raw = await fs3.readFile(pkgPath, "utf-8");
182 const pkg = JSON.parse(raw);