1. docs Sub-Package Setup
- [x] 1.1 Create
docs/directory and createdocs/package.jsonmanually (bun init or by hand) - [x] 1.2 Add
vitepressas a dev dependency indocs/package.json(bun add -d vitepressinsidedocs/) - [x] 1.3 Add
vitepress-plugin-openspecas a dependency indocs/package.jsonusingfile:../local reference (bun add ../) - [x] 1.4 Add
docs:devanddocs:buildscripts to rootpackage.json(delegating tobun --cwd docs run dev/bun --cwd docs run build) - [x] 1.5 Add
docs/node_modules/anddocs/.vitepress/dist/to.gitignore
2. VitePress Configuration
- [x] 2.1 Create
docs/.vitepress/config.tswithdefineConfig, registeringopenspec()as a Vite plugin pointing atdocs/petstore.yamlwithoutDir: 'api' - [x] 2.2 Configure
themeConfig.navto include an "API Reference" entry linking to/api/ - [x] 2.3 Configure
themeConfig.sidebarusinggenerateSidebarFromSpec()for the/api/prefix - [x] 2.4 Set
basein VitePress config to match the GitHub Pages URL path (e.g./vitepress-plugin-openspec/)
3. Demo Content
- [x] 3.1 Copy
src/__tests__/petstore.yamltodocs/petstore.yaml - [x] 3.2 Create
docs/index.mdwith VitePress hero layout (layout: home) — title, tagline, and a "Get Started" action linking to/api/ - [x] 3.3 Run
bun run docs:buildlocally and verifydocs/.vitepress/dist/api/contains generated endpoint pages
4. GitHub Actions Workflow
- [x] 4.1 Create
.github/workflows/deploy-docs.ymlwith trigger onpushtomain - [x] 4.2 Add install step:
oven-sh/setup-bun@v2+bun install --frozen-lockfileat repo root - [x] 4.3 Add install step:
bun install --frozen-lockfileinsidedocs/(bun --cwd docs install) - [x] 4.4 Add build step:
bun run build(plugin) - [x] 4.5 Add build step:
bun run docs:build - [x] 4.6 Add
actions/configure-pagesstep - [x] 4.7 Add
actions/upload-pages-artifactstep pointing atdocs/.vitepress/dist/ - [x] 4.8 Add
actions/deploy-pagesstep in a separate deploy job - [x] 4.9 Declare
permissions: { pages: write, id-token: write }on the deploy job
5. Validation
- [x] 5.1 Run
bun run docs:buildlocally and confirm zero errors - [x] 5.2 Verify built
dist/containsindex.htmlandapi/subdirectory - [x] 5.3 Validate workflow YAML syntax (
act --listor GitHub's YAML linter) - [x] 5.4 Enable GitHub Pages on the repository (Settings → Pages → Source: GitHub Actions) — one-time manual step
- [x] 5.5 Push to
mainand confirm workflow completes successfully and site is live