Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ pnpm dev:website
# Build the public website
pnpm build:website

# Build the public website and serve the real static output (what CI deploys,
# prerendered HTML included) - no hot reload, refresh manually after a change
pnpm preview:website

# Pull a @codehacks/virtual-console release into the website (see Releasing below)
pnpm bump:website:latest
```
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
"build:published": "pnpm run build:import:published && pnpm run build:vite-plugin:published",
"build:website": "pnpm run install:website && pnpm --dir website build",

"preview:website": "pnpm run build:website && pnpm --dir website preview",

"install:import:published": "pnpm --dir examples/published/react-vite-import install",
"install:vite-plugin:published": "pnpm --dir examples/published/react-vite-plugin install",
"install:published": "pnpm run install:import:published && pnpm run install:vite-plugin:published",
Expand Down
12 changes: 12 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,25 @@ Standalone project (own `pnpm-workspace.yaml`), same reasoning as `examples/publ
# from the repo root
pnpm dev:website
pnpm build:website
pnpm preview:website # build + serve the real static output (dist/), prerendered HTML included

# or directly
cd website
pnpm install
pnpm dev
pnpm build && pnpm preview
```

`pnpm dev` (Vite's dev server) never runs the prerender step - `index.html`'s `#root` starts empty
there and `main.tsx` client-renders into it (see [DECISIONS.md](../DECISIONS.md)). To see and debug
the actual prerendered HTML a no-JS client or crawler would get - or to check something that only
happens in the production build - use `preview:website` (or `pnpm build && pnpm preview` from
`website/`) instead. It's a plain build-then-serve, not a dev server: no hot reload or watch mode,
so re-run it after each change. That's a deliberate simplicity trade, not a limitation to fix -
wiring up a watcher for a full rebuild (`tsc` + two `vite build` passes + the prerender script) on
every change would add real complexity for a workflow that's normally reached for occasionally, not
kept running all day like `pnpm dev`.

## Deployment

Deployed to GitHub Pages by `.github/workflows/release-website.yml`, independently of the package's own release line - a `website-v{version}` tag deploys the website; a plain `v{version}` tag (the package release) does not. This is its own [vump](https://github.com/okcodes/vump) project (`website` in the root `vump.toml`, tracking this directory's `package.json`), so a site-only change ships with `vump patch --project website --tag --push` and never touches the package's version or npm. See [DECISIONS.md](../DECISIONS.md) for the full reasoning.
Expand Down
Loading