Update build scripts and enhance development workflow: Revise package.json to streamline build commands, replacing deprecated scripts with new chapter-specific build commands. Update CONTRIBUTING.md to clarify local development instructions and improve chapter sync processes. Enhance README.md with updated serving and build commands for better user guidance. Add new types for Bun in devDependencies and update the feed and sitemap to reflect recent content changes.

This commit is contained in:
Hananoshika Yomaru 2026-05-22 11:42:00 -07:00
parent 61963350e7
commit 5ac8e330ca
19 changed files with 501 additions and 125 deletions

View file

@ -28,23 +28,22 @@ See [reference.md](reference.md) for Tera pitfalls and build checks.
## Commands
```bash
bun run build:js # sync chapters + Vite build (JS/CSS bundle outputs)
bun run build # smart local build (incremental; uses build cache)
bun run build:full # full deterministic rebuild (use in CI / clean validation)
bun run dev # smart local dev startup (incremental chapter sync + watch + zola serve)
bun run dev:full # force full chapter sync before starting dev server
zola build # required before indexing
bun run index:search # pagefind on public/ → copies to static/pagefind/ for zola serve
zola serve # dev at http://127.0.0.1:1111
bun run dev # instant serve (zola only)
bun run build:chapter math/loci math/measures-dispersion
bun run build:chapter math/* # wildcard chapter builds
bun run build:chapter # auto-detect changed chapters (interactive confirm)
bun run build:site # full site rebuild (includes sponsor sync when token exists)
bun run build # alias of build:site
bun test
```
After Sass or template changes, run `zola build` (or `zola serve`). Do **not** copy `public/` into `themes/openfreebooks/static/`.
### Build mode behavior
- **First clone / cold start:** `bun run build` behaves like a full pipeline because caches are absent.
- **Continuous local development:** `bun run build` reuses caches and skips unchanged steps where possible.
- **CI:** prefer `bun run build:full` for deterministic, correctness-first builds.
- **Chapter workflow:** prefer `build:chapter` for normal content work; it rebuilds chapter assets and only runs Vite when frontend/site-shell code changes.
- **Site workflow:** use `build:site`/`build` for full rebuilds and release verification.
- **CI:** use `bun run build:site` and `bun test`.
**Search (Pagefind):** read [zola-pagefind.md](zola-pagefind.md) before changing search UI, indexing, or `data-pagefind-*` attributes.