You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce build:retry (enables --retry flag on the crawler) and
matching deploy:fast / deploy:retry shortcuts. Update README to
replace stale CRA/react-snap references with the Vite + Vike + crawler
pipeline and document the three build variants. Accept --retry as a
CLI flag in addition to PRERENDER_RETRY=1.
Copy file name to clipboardExpand all lines: README.md
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Imagine you have a giant digital toy box. Inside, you keep the cool things you'v
21
21
-**Frontend**: React 19, Tailwind CSS, and Framer Motion for smooth animations.
22
22
-**3D & Graphics**: Three.js and react-force-graph-3d for the knowledge graph.
23
23
-**Content**: Markdown and **PIML** (Plain Old Markup Language) for structured content.
24
-
-**Build Tools**: Craco (CRA Configuration Override) for custom build pipelines.
24
+
-**Build Tools**: Vite + Vike for the SPA build and shell generation; a Puppeteer-based crawler hydrates dynamic routes into static HTML for GitHub Pages.
25
25
-**Persistence**: Local Storage for settings, achievements, and persistent state.
26
26
-**AI Tooling**: **Model Context Protocol (MCP)** server for automated content management.
27
27
@@ -76,13 +76,27 @@ This will open the site at http://localhost:3000.
76
76
---
77
77
78
78
## Routing and SEO
79
-
This project uses `BrowserRouter` for clean URLs. To support this on static hosts like GitHub Pages, we use `react-snap` to pre-render routes into static HTML files during the build process.
79
+
This project uses `BrowserRouter` for clean URLs. To support this on static hosts like GitHub Pages, the build runs in two passes:
80
+
81
+
1.**Vite + Vike** produces the JS bundles and writes one empty-shell `index.html` per route listed in `pages/routes.js` plus every dynamic route discovered by `pages/discoverRoutes.js` (blog posts, series episodes, log entries, story book pages — ~460 routes total).
82
+
2.**`scripts/prerender-crawl.mjs`** spins up a Vite preview server, loads each shell in headless Chromium, and replaces the empty `#react-root` with the hydrated HTML. Skipped routes fall back to SPA rendering at runtime — not a build failure.
83
+
84
+
### Build variants
85
+
| Command | What it does | When to use |
86
+
| --- | --- | --- |
87
+
|`npm run build`| Vite build + post-build + full prerender crawl | Default. Produces a fully SSG'd `dist/client/`. |
88
+
|`npm run build:fast`| Vite build + post-build only (no crawl) | Fast iteration on components; skip the ~2–5 min crawler. |
89
+
|`npm run build:retry`| Full crawl, then re-attempts any routes that missed the render gate | Use when the default build reports many skipped routes (flaky JS/fetch under load). |
90
+
91
+
Tune the crawler via env vars: `PRERENDER_CONCURRENCY=6` (default `6`), `PRERENDER_RETRY=1` (same as `--retry`).
80
92
81
93
### Deployment
82
-
The standard `npm run deploy` command handles the build, pre-rendering, and deployment to GitHub Pages automatically.
83
94
```bash
84
-
npm run deploy
95
+
npm run deploy # build (full crawl) + push dist/client to gh-pages
96
+
npm run deploy:fast # shell-only build + push (skipped routes become SPA-only)
97
+
npm run deploy:retry # full crawl with retry pass + push
85
98
```
99
+
`gh-pages` publishes the contents of `dist/client/` to the `gh-pages` branch of the repo.
86
100
87
101
### Content Syncing
88
102
Stories are managed via git subtrees. Because subtree remotes are not tracked by git, you must initialize the remote once after cloning:
0 commit comments