Skip to content

Migrate docs to VitePress, add Bun/TypeScript book pipeline, harden CI - #1134

Merged
audreyt merged 2 commits into
mainfrom
migrate/vitepress-bun-vivliostyle-pipeline
Jul 12, 2026
Merged

Migrate docs to VitePress, add Bun/TypeScript book pipeline, harden CI#1134
audreyt merged 2 commits into
mainfrom
migrate/vitepress-bun-vivliostyle-pipeline

Conversation

@audreyt

@audreyt audreyt commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Replace MkDocs with VitePress for docs.plurality.net (docs/.vitepress/,
docs/public/ including CNAME, corrected contributor-guide asset paths).
Delete mkdocs.yml and the old docs-ci.yml workflow.

Add a Bun/TypeScript manuscript compiler (scripts/book/) with typed
publication-manifest generation and PDF/EPUB validation, alongside the
existing Docker/Pandoc/XeLaTeX legacy renderer, which remains the
production PDF/EPUB baseline. Add a non-public Vivliostyle candidate
renderer/pilot (publication/) that does not gate release.

Consolidate CI into a single .github/workflows/main.yml job graph:
verify -> {docs, manifest}; manifest -> {legacy, candidate};
legacy -> legacy-validation; candidate -> candidate-validation;
docs -> deploy-pages; legacy-validation + docs -> release;
release + deploy-pages -> webhook. Release, Pages deploy, and the
rebuild webhook only fire on push to pluralitybook/main; candidate
render/validation never gates them. Actions pinned to commit SHAs.

Fix false-green test gate: package.json check ran Bun's built-in
bun test instead of the Vitest suite; now bun run typecheck && bun run test. Bump vitest to 4.1.10 to match vite-plus's runtime API.

Replace a nonfunctional filesystem-mtime freshness check (artifact
extraction always sets download-time mtimes, making it a permanent
no-op) with an explicit manifest.sourceRevision == EXPECTED_SOURCE_REVISION
guard, set from ${{ github.sha }} in both validation jobs.

Fix XeLaTeX Unicode ellipsis handling in scripts/xelatex-preamble.tex.

Remove two stale 2023 editorial *.backup files superseded by their
current contents/english/ chapters; git history retains their content.

29/29 tests pass; bun run check, bun run docs:build, and a full
Vivliostyle candidate render+validate (both locales) were exercised
locally with a fixed BOOK_DATE. Real Docker/Pandoc/XeLaTeX legacy
render was not run locally (heavy/networked); its orchestration is
covered by unit tests and will run in CI.

GitHub Pages source must be switched from the gh-pages branch to
"GitHub Actions" only after this workflow is green on main.

audreyt added 2 commits July 12, 2026 13:14
Replace MkDocs with VitePress for docs.plurality.net (docs/.vitepress/,
docs/public/ including CNAME, corrected contributor-guide asset paths).
Delete mkdocs.yml and the old docs-ci.yml workflow.

Add a Bun/TypeScript manuscript compiler (scripts/book/) with typed
publication-manifest generation and PDF/EPUB validation, alongside the
existing Docker/Pandoc/XeLaTeX legacy renderer, which remains the
production PDF/EPUB baseline. Add a non-public Vivliostyle candidate
renderer/pilot (publication/) that does not gate release.

Consolidate CI into a single .github/workflows/main.yml job graph:
verify -> {docs, manifest}; manifest -> {legacy, candidate};
legacy -> legacy-validation; candidate -> candidate-validation;
docs -> deploy-pages; legacy-validation + docs -> release;
release + deploy-pages -> webhook. Release, Pages deploy, and the
rebuild webhook only fire on push to pluralitybook/main; candidate
render/validation never gates them. Actions pinned to commit SHAs.

Fix false-green test gate: package.json `check` ran Bun's built-in
`bun test` instead of the Vitest suite; now `bun run typecheck &&
bun run test`. Bump vitest to 4.1.10 to match vite-plus's runtime API.

Replace a nonfunctional filesystem-mtime freshness check (artifact
extraction always sets download-time mtimes, making it a permanent
no-op) with an explicit manifest.sourceRevision == EXPECTED_SOURCE_REVISION
guard, set from ${{ github.sha }} in both validation jobs.

Fix XeLaTeX Unicode ellipsis handling in scripts/xelatex-preamble.tex.

Remove two stale 2023 editorial *.backup files superseded by their
current contents/english/ chapters; git history retains their content.

29/29 tests pass; bun run check, bun run docs:build, and a full
Vivliostyle candidate render+validate (both locales) were exercised
locally with a fixed BOOK_DATE. Real Docker/Pandoc/XeLaTeX legacy
render was not run locally (heavy/networked); its orchestration is
covered by unit tests and will run in CI.

GitHub Pages source must be switched from the gh-pages branch to
"GitHub Actions" only after this workflow is green on main.
…o vp run tasks

Task 1: vp install --frozen-lockfile failed in CI with
"error: Package manager bun@1.4.0 not found on
https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.4.0.tgz".
package.json's packageManager field pinned bun@1.4.0, a version that
does not exist on the npm registry mirror vp uses to fetch a pinned
package manager (latest published there is 1.3.14). The bun.lock
lockfileVersion (1) only requires bun >= 1.2, so pin packageManager to
bun@1.3.14 instead. Reproduced the exact failure locally with the same
vp 0.2.4 binary and confirmed the fix resolves it.

Task 2: collapse the two parallel invocation paths (package.json
scripts run via `bun run`, and a handful of vite.config.ts `tasks` that
just re-wrapped those scripts via `bun run`) into one entrypoint.
vite.config.ts `run.tasks` is now the single source of truth for all
17 project commands (typecheck, test, check, docs:dev/build/preview,
book:assemble, book:manifest, book:candidate:prepare/en/zh-TW/all/validate,
book:legacy:en/zh-TW/all/validate), each command copied verbatim from
the former package.json scripts. package.json's `scripts` block is
removed entirely (vp itself now rejects a task/script name collision,
confirming vp run tasks alone are sufficient in this pinned CI
environment). .github/workflows/main.yml now invokes every task
exclusively via `vp run <task>` (including bare `bun scripts/book/*.ts
<locale>` calls, replaced with matrix-driven `vp run
book:candidate:${{ matrix.locale }}` / `book:legacy:${{ matrix.locale
}}`). Task caching is disabled at the run level since these commands
depend on untracked env vars (BOOK_DATE, OUTPUT_ROOT, SOURCE_REVISION,
etc.) and must always execute, matching prior behavior exactly.

No changes to Docker/Pandoc/XeLaTeX legacy renderer internals, the
release-gating graph, or the EXPECTED_SOURCE_REVISION guard.
@audreyt
audreyt merged commit 09e9146 into main Jul 12, 2026
12 checks passed
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