Compile public docs as locked Fumadocs workspaces - #489
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| if (project.mode === 'workspace') { | ||
| const checkoutDir = getWorkspaceProjectDir(project.repo, project.sourceRef); | ||
| const repoUrl = `https://github.com/${getProjectRepo(project.repo)}.git`; | ||
|
|
There was a problem hiding this comment.
🟡 Local edits to sibling documentation repos never show up in the watch workflow
The watch command points documentation compilation at the pinned downloaded copy of each external repository (getWorkspaceProjectCheckoutDir(...) at source.config.ts:33-36) even when it was told to use the developer's local copy, so edits made locally never appear.
Impact: Someone editing docs in a sibling checkout sees no change in the running site, and newly added local pages show up in the sidebar as links to missing pages.
Only the sync step honors DOCS_USE_LOCAL_WORKSPACES; the MDX compile step does not
scripts/docs-watch.mjs:55-59 runs scripts/docs-sync.mjs with DOCS_USE_LOCAL_WORKSPACES=1, which makes syncProject read from ../<repo> (scripts/docs-sync.mjs:1254-1258, scripts/docs-sync.mjs:1261-1309) and therefore generate lib/external-docs-nav.generated.ts from the local working tree. Immediately afterwards it runs pnpm exec fumadocs-mdx (scripts/docs-watch.mjs:60), which reads source.config.ts. There, workspace sources unconditionally resolve dir to .cache/docs-sources/<repo>/<locked commit>; no code path consults DOCS_USE_LOCAL_WORKSPACES (grep shows only scripts/docs-sync.mjs:1256 and scripts/docs-watch.mjs:57).
Result: navigation is derived from the local clone while page content is compiled from the locked commit. This contradicts README.md:177-178 ("pnpm docs:watch explicitly uses available sibling clones instead, so local workspace documentation edits appear immediately during development"), and any page that exists only locally yields a sidebar entry whose route has no compiled page.
Was this helpful? React with 👍 or 👎 to provide feedback.
Moves public Agent, Graph, and XState v6 alpha documentation from committed or central content to direct Fumadocs workspaces backed by immutable GitHub checkouts.
statelyai/agentnextstatelyai/graphmainstatelyai/xstatenext/docs/xstate/v6/..., separate from stable v5/docs/*docs-sources.lock.jsondocs:watchopt into available sibling workspaces for immediate local editsmeta.jsonnavigation is absentstatelyai/vizsources (SDK, CLI, MCP)Companion Graph navigation metadata: statelyai/graph#30
Validation:
node --test scripts/docs-sync.test.mjs(8/8, including offline cached sync, watcher paths, and mounted navigation fallback)The local pnpm wrapper encounters this machine's ignored-build policy gate; running the same installed stage binaries directly passes.