feat(build): aggregate docs from source repos (pilot: spectrum-ts)#103
Conversation
Make the docs repo an aggregator. `scripts/sync-docs` assembles a single template tree (.vellum-src/) from local docs-src/ plus per-source docs pulled from their SDK repo's docs-site/ at the git tag matching the installed package version, with a `local` fallback during migration. `scripts/build-nav` generates docs.json from docs.base.json (committed skeleton) + each source's nav.json fragment. The spectrum-ts pilot runs via the local fallback, so rendered .mdx, llms*.txt, and docs.json are byte-identical to before. docs.json is now generated (untracked); deploy-dist force-adds it and derives the mdx list from .vellum-src. ENG-1742
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
Disabled knowledge base sources:
📝 WalkthroughWalkthroughAdds a docs synchronization script that stages local and source-repo content into ChangesDocs build pipeline
Sequence Diagram(s)sequenceDiagram
participant DeployWorkflow as "deploy-dist.yml"
participant DocsGenerate as "docs:generate"
participant SyncDocs as "scripts/sync-docs/index.ts"
participant BuildNav as "scripts/build-nav/index.ts"
participant VellumBuild as "vellum build"
participant LLMsGenerator as "scripts/llms-generator/index.ts"
DeployWorkflow->>DocsGenerate: sets GITHUB_TOKEN and runs docs generation
DocsGenerate->>SyncDocs: pnpm docs:sync
SyncDocs-->>DocsGenerate: writes .vellum-src and .nav fragments
DocsGenerate->>BuildNav: tsx scripts/build-nav/index.ts
BuildNav-->>DocsGenerate: writes docs.json
DocsGenerate->>VellumBuild: vellum build from .vellum-src
DocsGenerate->>LLMsGenerator: tsx scripts/llms-generator/index.ts
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: private package registry requires authentication. Disable ESLint in CodeRabbit settings or use public packages. Comment |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Closes ENG-1742 · part of ENG-1741.
What & why
Boss wants docs authored in each SDK repo, next to the code, instead of all in this repo. This makes the docs repo an aggregator: it pulls each repo's docs, renders with vellum, merges nav, and ships to Mintlify via the existing
distflow. Pilot scope: spectrum-ts.How
scripts/sync-docsassembles.vellum-src/(gitignored) from localdocs-src/(areas not yet migrated) + each source inscripts/sources.json. Dual-mode per source: git sparse-checkout ofdocs-site/at the tag matching the installed package version (so prose stays aligned with the types vellum extracts), with alocalfallback so the build stays offline/working until a repo actually has its docs.scripts/build-navgeneratesdocs.jsonfromdocs.base.json(committed site skeleton) + each source'snav.jsonfragment, replacing{$source, group}markers in place (order-preserving).vellum.config.ts→templates: '.vellum-src';docs:generate= sync → build-nav → vellum → llms;docs.jsonis now generated (untracked);deploy-dist.ymlforce-addsdocs.jsonand derives the mdx list from.vellum-src.Verification
spectrum-ts/**/*.mdxrender byte-identical to before; all 7llms*.txtidentical;docs.jsonsemantically identical (only diff: generator normalized a pre-existing indentation glitch incontextual.options).pnpm lint+pnpm typecheck:docspass (also via the pre-commit hook).v5.2.0, cloned, sparse-checked-out, fell back to local.Note / decision
docs/is already used inspectrum-tsfor internal dev notes, so the source-repo templates dir isdocs-site/(configurable per-source viadocsDir).Follow-up (ENG-1743, after this merges)
Add
docs-site/+nav.jsonto the spectrum-ts repo, then flip the manifest to git-only (droplocal, deletedocs-src/spectrum-ts/) and widen the deploy-dist app token to readspectrum-ts. The token is already wired through asGITHUB_TOKEN.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
Bug Fixes
Documentation