Documentation site: migrate from VitePress to Fumadocs#116
Documentation site: migrate from VitePress to Fumadocs#116scottmessinger wants to merge 7 commits into
Conversation
Scaffold a real documentation site using Fumadocs on React Router 8 + Vite 8 + MDX, replacing the hand-rolled approach with a maintained framework. - packages/docs: isolated sub-project (own lockfile, excluded from the pnpm workspace via `!packages/docs`) so its bleeding-edge toolchain (Vite 8 / React Router 8 / TypeScript 6) never perturbs the core library's resolution. Install with `pnpm install --ignore-workspace`. - Branded as Supergrain (landing page, nav, GitHub links) and seeded with real content: the kernel/husk/silo/queries/mill READMEs and the comparison guide are ported into content/docs as CommonMark pages, plus an Introduction page. - Configured for the GitHub Pages project path (/supergrain/) via Vite `base` + React Router `basename`; `build:pages` flattens the prerendered output into a single deployable artifact (build/client/supergrain). - Point the Pages deploy workflow at the isolated docs build, and add a Docs CI workflow to typecheck + build on PRs touching packages/docs. - Re-include packages/docs/app/lib (swallowed by the root .gitignore `lib/` rule) and exclude packages/docs from the root oxfmt run. Verified locally: typecheck, production build, and static prerender of all pages all pass; the Pages artifact resolves every asset reference. Follow-ups (tracked in packages/docs/README.md): live interactive supergrain demos, twoslash code blocks, static search, and retiring the old VitePress site. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017MdgYubmaK8jxkc1SiiNzq
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #116 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 41 41
Lines 1735 1735
Branches 391 391
=========================================
Hits 1735 1735 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- home.tsx: derive the GitHub link from gitConfig instead of hardcoding it, matching the other call sites so a repo rename can't break only the landing page button. - og.ts: build the image path from the shared docsImageRoute constant, giving the /og/docs prefix a single home (and using the previously dead export). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017MdgYubmaK8jxkc1SiiNzq
Remove the old VitePress site entirely; Fumadocs (packages/docs) is now the single documentation site. No more duplicate docs. - Delete the docs/ VitePress site (config, theme, hero/mascot assets, the @include shim pages, and the duplicate comparison.md). - Drop the VitePress root scripts (dev, docs:dev, docs:build, docs:preview). - Repoint inbound comparison-guide links: the root README and kernel README now point at the live docs site; the docs-site kernel page uses the internal /docs/comparison route. - doc-tests validation: the comparison guide's tested examples (DOC_TEST_52..56) moved with it into packages/docs/content/docs/comparison.md, so the validator now reads them from there instead of the deleted docs/ dir. The package reference pages mirror their READMEs (the canonical, scanned source) and are intentionally not re-scanned. Verified all five validation checks still pass. - Drop the dead VitePress .gitignore entries. The unused `vitepress` devDependency is left in place for now: removing it requires regenerating the root lockfile, which a cold `pnpm install` can't do because packages/js-krauset-main pins unpublished @supergrain/core / @supergrain/react packages. Tracked as a follow-up in packages/docs/README.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017MdgYubmaK8jxkc1SiiNzq
Merge main (which repointed packages/js-krauset-main to the published @supergrain/kernel@6.2.0, replacing the unpublished @supergrain/core / @supergrain/react packages). With that pre-existing cold-install landmine gone, the root lockfile can be regenerated again, so the now-unused `vitepress` devDependency is dropped (pruning ~1.2k lines from pnpm-lock.yaml) and the related follow-up note is removed from the docs README. With the landmine cleared, the full check suite now runs locally and passes: test (784), test:validate (5), typecheck, lint, and format:check. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017MdgYubmaK8jxkc1SiiNzq
There was a problem hiding this comment.
Pull request overview
This PR replaces the previous VitePress docs setup with a new Fumadocs-based documentation site (React Router + Vite + MDX), intended for GitHub Pages deployment under /supergrain/, and updates CI/workspace config to treat docs as an isolated sub-project.
Changes:
- Add a new isolated docs site at
packages/docs(Fumadocs + React Router + Vite) with ported content pages. - Update GitHub Pages workflow and add a Docs CI workflow to build/typecheck the isolated docs package.
- Remove the old VitePress-based
docs/site and update links + doc-test validation inputs.
Reviewed changes
Copilot reviewed 50 out of 58 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates the comparison link to point at the new published docs route. |
| pnpm-workspace.yaml | Excludes packages/docs from the workspace to keep its toolchain isolated. |
| packages/kernel/README.md | Updates comparison guide links to the new docs site URL. |
| packages/docs/vite.config.ts | Configures Vite base path + plugins for the Fumadocs site. |
| packages/docs/tsconfig.json | Adds a TypeScript config for the isolated docs project. |
| packages/docs/source.config.ts | Configures fumadocs-mdx source processing. |
| packages/docs/scripts/prepare-pages.mjs | Flattens build output for GitHub Pages artifact layout. |
| packages/docs/README.md | Documents docs-site workflow, commands, and deployment assumptions. |
| packages/docs/react-router.config.ts | Sets basename + prerender list for the docs site. |
| packages/docs/package.json | Adds isolated docs dependencies/scripts (React Router build/dev/typecheck). |
| packages/docs/content/docs/silo.md | Adds the Silo docs page content. |
| packages/docs/content/docs/queries.md | Adds the Queries docs page content. |
| packages/docs/content/docs/mill.md | Adds the Mill docs page content. |
| packages/docs/content/docs/meta.json | Defines docs sidebar/page ordering. |
| packages/docs/content/docs/kernel.md | Adds the Kernel docs page content. |
| packages/docs/content/docs/index.mdx | Adds the new Introduction page content. |
| packages/docs/content/docs/husk.md | Adds the Husk docs page content. |
| packages/docs/content/docs/comparison.md | Ports the comparison guide into the new docs content tree. |
| packages/docs/app/routes/search.ts | Adds the server search route implementation. |
| packages/docs/app/routes/og.docs.tsx | Adds OG image generation route for docs pages. |
| packages/docs/app/routes/not-found.tsx | Adds a Not Found route/layout for the docs site. |
| packages/docs/app/routes/home.tsx | Adds a branded landing page route. |
| packages/docs/app/routes/docs.tsx | Adds the main docs route wiring + layout integration. |
| packages/docs/app/routes.ts | Registers app routes (home/docs/search/og/llms/fallback). |
| packages/docs/app/root.tsx | Adds app root layout + middleware for markdown negotiation/redirects. |
| packages/docs/app/llms/mdx.ts | Adds per-page markdown output route for LLM integrations. |
| packages/docs/app/llms/index.ts | Adds llms.txt route. |
| packages/docs/app/llms/full.ts | Adds llms-full.txt route. |
| packages/docs/app/lib/source.ts | Adds Fumadocs source loader + markdown/LLM helpers. |
| packages/docs/app/lib/shared.ts | Centralizes site constants (name/routes/repo). |
| packages/docs/app/lib/og.ts | Adds helper for OG image path generation. |
| packages/docs/app/lib/layout.shared.tsx | Adds shared layout options (nav/github URL). |
| packages/docs/app/lib/cn.ts | Adds Tailwind class merge helper. |
| packages/docs/app/components/mdx.tsx | Adds MDX component mapping/overrides. |
| packages/docs/app/app.css | Adds Tailwind + Fumadocs UI styling imports. |
| packages/docs/.gitignore | Adds docs-package ignores + re-includes app/lib/. |
| packages/doc-tests/tests/readme-validation.test.ts | Updates doc validation to include the new comparison guide path. |
| package.json | Removes VitePress scripts/dependency from the root package. |
| docs/silo.md | Removes old VitePress include stub. |
| docs/README.md | Removes old VitePress docs README. |
| docs/queries.md | Removes old VitePress include stub. |
| docs/public/mascot.svg | Removes old VitePress public asset. |
| docs/public/hero-grain.svg | Removes old VitePress public asset. |
| docs/mill.md | Removes old VitePress include stub. |
| docs/index.md | Removes old VitePress index page. |
| docs/husk.md | Removes old VitePress include stub. |
| docs/.vitepress/theme/index.js | Removes old VitePress theme entry. |
| docs/.vitepress/theme/custom.css | Removes old VitePress theme CSS. |
| docs/.vitepress/config.mts | Removes old VitePress site config. |
| .oxfmtrc.json | Ignores formatting for packages/docs/**. |
| .gitignore | Removes VitePress-specific cache/dist ignores. |
| .github/workflows/docs.yml | Updates Pages deployment to build/upload the new docs artifact. |
| .github/workflows/docs-ci.yml | Adds a PR workflow to typecheck/build the isolated docs package. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Twoslash: - Register the fumadocs-twoslash Shiki transformer in source.config.ts (with pre-declared langs, required for twoslash popups) and the Twoslash UI components in the MDX map; import twoslash.css. - Add @supergrain/kernel so `ts twoslash` blocks type-check against the real library, and demonstrate it with a type-on-hover example on the intro page. Static search (server search can't work on static GitHub Pages): - Switch the /api/search route from server GET to staticGET — the Orama index is prerendered to a static file and downloaded by the client. - Add a static SearchDialog (orama-static client) and wire it into RootProvider. - Prerender /api/search so the index file actually exists on Pages. Subpath correctness (flagged in review — site is served under /supergrain/): - Add withBase() and prefix the search index URL, OG image meta, and per-page markdown URLs so they resolve under the Pages subpath instead of 404ing. - Fix the "view source" GitHub link to point at packages/docs/content/docs/... - Prerender the per-page markdown (content.md) endpoints so the copy/view buttons work on a static deploy. Verified via build: twoslash popups render, the 1MB static search index and all content.md/OG files are emitted, and docs HTML references base-prefixed URLs. typecheck and build both pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017MdgYubmaK8jxkc1SiiNzq
|
@copilot Could you please attach screenshots of the new documentation site and resolve the merge conflicts? |
Addressed in Merge conflicts are resolved, and I added two docs screenshots to the branch so they can be viewed directly here: |


What & why
Replaces the hand-rolled VitePress docs with a maintained Fumadocs site (React Router 8 + Vite 8 + MDX), deployed to GitHub Pages under
/supergrain/. After comparing VitePress, Starlight, Docusaurus, and Vocs, Fumadocs won on Vite + native React + MDX with first-class twoslash/type-table tooling.What's in this PR
Docs site (
packages/docs)base/basenameconfigured for/supergrain/, andbuild:pagesflattens the prerendered output into a single deployable artifact.Twoslash ✅ — type-on-hover code blocks (
ts twoslash), compiled against the real@supergrain/kerneltypes, demonstrated on the intro page. A great fit for a type-inference-focused library.Static search ✅ — the example shipped server-route search, which can't work on static GitHub Pages (no server). Swapped for Fumadocs' build-time static index: the Orama index is prerendered to a static file (
/api/search, ~1 MB) and searched client-side in the browser.VitePress fully retired ✅ — deleted the old
docs/site, root scripts,.gitignoreentries, and (after merging main'sjs-krausetfix unblocked the lockfile) thevitepressdevDependency itself.Review fixes (Copilot) — under the
/supergrain/subpath, the OG-image meta, per-page markdown URLs, and the static search index URL are now base-prefixed (they were domain-root absolute → 404); the per-pagecontent.mdendpoints are prerendered; the "view source" link points atpackages/docs/content/docs/....Architecture: isolated sub-project
packages/docsis excluded from the pnpm workspace (!packages/docs) with its own lockfile (pnpm install --ignore-workspace), so its bleeding-edge toolchain (Vite 8 / RR 8 / TS 6) never perturbs the core library's resolution. CI builds it via a dedicateddocs-ci.yml; the Pages deploy (docs.yml) builds and uploads it.Verification
content.md/OG files emitted, and docs HTML references base-prefixed/supergrain/...URLs.test(784 passed),test:validate(5),typecheck,lint,format:check— all green.Follow-up
@supergrain/kernelcomponents in.mdxto show fine-grained re-rendering (tracked inpackages/docs/README.md).🤖 Generated with Claude Code