Skip to content

Commit d218da5

Browse files
committed
fix(docs): build workspace dependencies before static demo
1 parent 0b1e6aa commit d218da5

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

‎.github/workflows/test-docs.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
node-version: 24
2020
- uses: pnpm/action-setup@v4
2121
- run: pnpm install --frozen-lockfile
22-
- run: pnpm build
2322
- run: pnpm docs:build
2423
- run: pnpm --filter histoire-example-vue3 exec playwright install --with-deps chromium
2524
- run: pnpm docs:check

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,20 @@ pnpm run story:preview
8181

8282
### Documentation and demo
8383

84-
Use Node.js 22+ and the repository's pinned pnpm version. Build workspace packages before building docs:
84+
Use Node.js 22+ and the repository's pinned pnpm version:
8585

8686
```sh
8787
corepack enable
8888
pnpm install --frozen-lockfile
89-
pnpm build
9089
pnpm docs:build
9190
pnpm --filter histoire-example-vue3 exec playwright install chromium
9291
pnpm docs:check
9392
pnpm docs:serve
9493
```
9594

96-
`docs:build` builds a static Vue book into ignored `docs/public/demo/` before VitePress copies it into `docs/.vitepress/dist/demo/`. Publish the whole `docs/.vitepress/dist/` directory. The `/demo/` asset base and hash routing keep direct story links usable without host rewrite rules. Demo links perform a full navigation so VitePress does not treat the book as a Markdown page.
95+
`docs:build` first compiles the Vue demo's workspace dependencies in dependency order, so it works from a fresh checkout without a separate `pnpm build`. It then builds a static Vue book into ignored `docs/public/demo/` before VitePress copies it into `docs/.vitepress/dist/demo/`. Publish the whole `docs/.vitepress/dist/` directory. The `/demo/` asset base and hash routing keep direct story links usable without host rewrite rules. Demo links perform a full navigation so VitePress does not treat the book as a Markdown page.
9796

98-
`docs:dev` also builds this book before starting VitePress. After changing a demo story, run `pnpm docs:demo` to refresh it. `examples/vue3/histoire.docs.config.ts` selects existing interactive examples and omits stress and failure fixtures; the regular Vue test book remains unchanged.
97+
`docs:dev` also builds this book before starting VitePress; compile workspace packages first with `pnpm build` or `pnpm docs:build`. After changing a demo story, run `pnpm docs:demo` to refresh it. `examples/vue3/histoire.docs.config.ts` selects existing interactive examples and omits stress and failure fixtures; the regular Vue test book remains unchanged.
9998

10099
`docs:check` serves the production output using a plain static server and checks the actual browser: demo navigation, prop edits reaching the canvas, generated source, docs links surviving reload, narrow-screen rendering, and development actions staying hidden. It needs the Vue example's Playwright dependency and Chromium. It uses an ephemeral loopback port and closes both server and browser on failure.
101100

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"release": "pnpm run lint && pnpm run test && pnpm run build && sheep release -b main --force",
2323
"docs:demo": "pnpm --filter histoire-example-vue3 story:build:docs",
2424
"docs:dev": "pnpm docs:demo && vitepress dev docs",
25-
"docs:build": "pnpm docs:demo && vitepress build docs",
25+
"docs:build": "pnpm --recursive --filter \"histoire-example-vue3^...\" run build && pnpm docs:demo && vitepress build docs",
2626
"docs:check": "node scripts/check-docs-demo.mjs",
2727
"docs:screenshots": "node scripts/check-docs-demo.mjs --screenshots",
2828
"docs:serve": "vitepress serve docs",

0 commit comments

Comments
 (0)