Skip to content

Documentation pipeline

How the public site at libs.heritiersdudonjon.com is built — no manual steps after merging to main.

Principles

LayerToolSource
GuidesVitePressMarkdown in docs/
API (./srd, ./character)TypeDocTypeScript + TSDoc comments
UI catalogStorybook*.stories.tsx

Do not maintain a hand-written API reference (the old srd-data-api.md was removed for this reason).

Adding a .md file under docs/ is enough — update .vitepress/config.ts sidebar only when creating a new section folder.

SPA vs static content (important)

VitePress is a single-page app: same-origin links like /api/... or /storybook/ are handled by the client router, which has no page for those paths (you get the doc site's own 404).

Fix: in Markdown and in themeConfig.nav / sidebar, use absolute URLs for TypeDoc and Storybook, for example https://libs.heritiersdudonjon.com/api/modules/srd.html and https://libs.heritiersdudonjon.com/storybook/. Internal doc pages keep paths like /project/documentation-pipeline.

Source → URL

SourceOutput pathPublic URL (production)
docs/**/*.mdVitePress HTMLSame host, path /guide/..., /srd/..., etc.
src/srd, src/characterdocs/public/api/https://libs.heritiersdudonjon.com/api/...
Storybook builddocs/public/storybook/https://libs.heritiersdudonjon.com/storybook/

Internal maintainer docs live in docs-internal/ (not published).

Commands

CommandPurpose
pnpm docs:devVitePress dev server (hot reload Markdown)
pnpm docs:apiRegenerate TypeDoc only
pnpm docs:buildFull site build (same as CI)
pnpm buildRequired before Storybook (library dist/)

Build order (scripts/build-docs.mjs)

  1. pnpm build — library dist/
  2. typedocdocs/public/api/
  3. storybook build -o docs/public/storybook
  4. vitepress build docsdocs/.vitepress/dist/

Common failures

FailureFix
Storybook cannot resolve packageRun pnpm build first
TypeDoc errorsFix TS exports or typedoc.json exclusions
VitePress broken linkFix Markdown links or sidebar paths

When to update what

ChangeAction
New public export in src/srd/index.tsAdd TSDoc on symbol; no manual API markdown
New tutorialAdd docs/.../*.md
Architecture diagramEdit docs/srd/architecture.md (Mermaid)
UI componentStorybook story + optional line in guide/ui.md
Breaking APIfeat! commit + guide/migration.md

CI

  • PR: docs job runs pnpm docs:build — must pass before merge.
  • main: deploy-docs uploads docs/.vitepress/dist/ to OVH FTP (OVH_FTP_* secrets).

Decoupled from npm release — doc-only merges still deploy the site.

Configuration index

FileRole
docs/.vitepress/config.tsNav, sidebar, Mermaid
typedoc.jsonAPI entry points
docs/public/.htaccessSPA + /storybook/, /api/ passthrough
.storybook/Storybook config

Agents

  • Edit Markdown or TSDoc, then run pnpm docs:build locally.
  • Do not recreate website/ or manual content/index.ts registries.
  • See Library contract and root AGENTS.md.