Skip to content

docs(site): migrate doc site to VitePress with guides and bespoke landing#4

Merged
enixCode merged 3 commits intomainfrom
refactor/docs-vitepress
Apr 27, 2026
Merged

docs(site): migrate doc site to VitePress with guides and bespoke landing#4
enixCode merged 3 commits intomainfrom
refactor/docs-vitepress

Conversation

@enixCode
Copy link
Copy Markdown
Owner

Summary

  • Switch the doc site to VitePress while preserving the bespoke landing aesthetic (Fraunces / IBM Plex / dark grid + noise GPU layer). The HTML+CSS lives unchanged in docs/public/index.html and is served verbatim at /. VitePress takes over /guides/* and /api/* with its standard chrome (sidebar, dark mode, local search, edit-this-page links, last-updated stamps).
  • Add 5 user-facing guides under docs/guides/: quickstart (recap of the README quick start), extract (folder-vs-file semantics, traversal rules, 1 GiB cap, common patterns), detached (run + attach + state files + cross-host resume + reaping + gotchas), security (threat model, defaults, what is and is not covered, hardening recipes), gvisor-kata (when to use a stronger runtime, install steps for runsc on Linux/WSL2, Kata caveat).
  • Switch TypeDoc to markdown emission via typedoc-plugin-markdown@4.11.0. The API reference is regenerated under docs/api/*.md and consumed by VitePress as regular markdown routes. entryFileName: "index" so /api/ resolves cleanly.
  • Add .github/workflows/docs.yml that rebuilds and deploys to GitHub Pages on every push to main touching docs/, src/, or relevant config files. Uses actions/upload-pages-artifact + actions/deploy-pages with concurrency-guarded deploys.
  • Restructure npm scripts: docs:typedoc regenerates the markdown API ref (fast, ~1s), docs:build runs vitepress build (~8s), docs chains both, docs:dev serves locally with live reload. The pre-commit hook now calls docs:typedoc only (no dist artefact churn) so the API reference still auto-syncs when src/ is staged.
  • Add devDeps: vitepress@1.6.4, typedoc-plugin-markdown@4.11.0. No runtime deps changed (still tar + dockerode).

One-time manual step required

After merge, in repo Settings -> Pages, flip the source from "Branch / docs folder" to "GitHub Actions". The workflow runs but cannot publish without that. I cannot toggle this via API.

Test plan

  • npm run docs:build completes locally in 7.6s, no dead links, no warnings beyond TypeDoc's existing one about the private LightRunnerErrorOptions interface
  • docs/.vitepress/dist/index.html serves the bespoke landing verbatim (CSS + noise + grid intact)
  • docs/.vitepress/dist/guides/* pages render with VitePress chrome (sidebar, search, dark mode toggle)
  • docs/.vitepress/dist/api/index.html serves the TypeDoc-generated markdown rendered through VitePress
  • Pre-commit hook regenerates docs/api/ only (no full VitePress build) when src/ is staged
  • docs/.vitepress/cache/ and docs/.vitepress/dist/ gitignored
  • After merge + Pages source flip: verify https://enixcode.github.io/light-runner/ updates within ~3 min

Notes

  • The bespoke landing already had updated v0.10 metadata (license MIT, version, deps, tests) from the previous PR. It now lives under docs/public/ to integrate with VitePress' static asset pipeline. The README image link was bumped to docs/public/banner.webp.
  • Rollback is clean: git revert <squash-sha>, npm uninstall -D vitepress typedoc-plugin-markdown, restore the old typedoc.json and the workflow.
  • Auto-sync story for future contributors: any push to main that touches src/ will trigger both the pre-commit hook (auto-stages docs/api markdown) and the docs.yml workflow on push (rebuilds + redeploys). No manual intervention needed.

build with cc

…ding

- Replace the raw TypeDoc HTML + standalone index.html setup with a VitePress build that orchestrates: a bespoke landing kept in docs/public/index.html (served verbatim at /), 5 user-facing guides under docs/guides/ (quickstart, extract, detached, security, gvisor-kata), and a markdown API reference under docs/api/ generated by typedoc-plugin-markdown.
- Add devDeps: vitepress 1.6.4 and typedoc-plugin-markdown 4.11.0. No runtime deps changed (still tar + dockerode).
- Restructure npm scripts: docs = docs:typedoc + docs:build (full pipeline), docs:typedoc regenerates the markdown API ref, docs:build runs vitepress build, docs:dev serves locally with live reload. The pre-commit hook now calls docs:typedoc only (faster, no dist artefact churn) so the API reference still auto-syncs when src/ is staged.
- Add .github/workflows/docs.yml that rebuilds and deploys to GitHub Pages on every push to main touching docs/, src/, package.json, or typedoc.json. Concurrency-guarded, uses actions/upload-pages-artifact + actions/deploy-pages.
- Move docs/banner.webp -> docs/public/banner.webp (still referenced by README, path updated). Add docs/.vitepress/cache and dist to .gitignore.
- One-time manual step required: flip GitHub Pages source from "Branch / docs folder" to "GitHub Actions" in repo settings before the next push to main, otherwise the workflow runs but does not publish.

build with cc
- Bespoke landing port refactored: HTML body now lives in docs/index.md (was docs/public/index.html); 600+ lines of inline CSS extracted to docs/.vitepress/theme/landing.css with .bespoke-landing scope so .hero / .prim / etc. only apply on the landing route. Removed the duplicate inline <script>; the copy-button + GitHub-version listeners are wired from a single <script setup> + onMounted hook so SSR has no document/window references.
- Custom VitePress theme (docs/.vitepress/theme/custom.css) maps the laboratory palette onto every guide and API page: ink/paper/halo tokens, Fraunces italic h1/h2 with `// ` mono prefix, IBM Plex body, JetBrains Mono labels in nav/sidebar/aside/footer, code blocks with the macOS-style traffic-light bar from the landing, blockquotes in serif italic, table headers in mono uppercase, persistent fixed-position grid + noise background composited on the GPU.
- Reduced-motion fallback added in landing.css so users with prefers-reduced-motion: reduce see the hero elements (eyebrow, h1, lede, meta, banner) at opacity:1 immediately - the animation suppression in custom.css would otherwise leave them invisible.
- API sidebar enumerated by hand from the typedoc-plugin-markdown output: Overview, Classes, Interfaces, Functions, Type aliases. Each section collapsed:false so the tree is fully visible. Adding a new public export now requires adding the matching entry; comment in config.ts flags the maintenance.
- appearance: 'force-dark' on the site - the bespoke landing has no light variant, the toggle is gone, html.dark always applies.
- Tightened API page rhythm: h3 size 18-21px (was 20-24px), code block margins 12px/18px (was 22px each side), `Defined in: src/...:NN` rendered as 11px mono caption via p:has(> a[href*="src/"]), hr at 6px margin instead of 18px.
- Dividers (hr) restyled as a fading cyan filament with subtle glow - reads as a laboratory readout rather than a generic gray rule.
- Background grid lines and noise opacity dropped (rgba(255,255,255,0.018) for grid, 0.025 for noise) and grid spacing widened to 96px so the texture stays atmospheric instead of competing with content.
- Ecosystem cards now show live per-repo release status via data-eco-status / data-gh-repo. Single fetch per unique repo (Set + Promise.all + Map dispatch) so light-runner is queried once even though the header em + hero eyebrow + this-card all consume it. Repos without a published release fall back to data-fallback ("In development"); released repos show "Stable - vX.Y.Z" or "Pre-release - vX.Y.Z".
- Fixed the dev-mode 404 root cause: VitePress did not auto-serve docs/public/index.html when there was no docs/index.md, so the dev server returned a directory listing. Replacing the public file with a real markdown route fixes both dev and build.

build with cc
Resolves conflicts with the v0.10.1 hotfix landed on main while this
branch was open:

- package.json: keep main's v0.10.1 + recursive files glob (`dist/**/*.js`),
  layer the branch's vitepress / typedoc-plugin-markdown devDeps and the
  docs:typedoc / docs:dev / docs:build scripts on top.
- package-lock.json: auto-merged, then will be reconciled on next install.
- docs/api/*.html: main regenerated the legacy HTML output; the branch
  ships markdown via typedoc-plugin-markdown. Deleted the HTML side so
  only the .md tree survives.
- typedoc.json: keep the branch's markdown plugin config.

build with cc
@enixCode enixCode merged commit eaf4c39 into main Apr 27, 2026
4 checks passed
@enixCode enixCode deleted the refactor/docs-vitepress branch April 27, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant