From 3cffcf69a76d700e97bbbb5378eec89269c657ad Mon Sep 17 00:00:00 2001 From: joshchen-dev Date: Sat, 24 Oct 2026 03:18:58 +0000 Subject: [PATCH] chore(web): add scripts to run the product page and demo locally `npm run dev` starts the full app, which needs the Go backend, so it looked broken when only the product page or demo was wanted. Adds dev:product, dev:demo and preview:pages, and documents them. --- README.md | 12 +++++++++++- web/package.json | 5 ++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8420e21..e3f9cbf 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,17 @@ The Go process applies pinned, embedded Goose migrations before opening the appl ## Product page and demo -`web/product/` is the public product page, and `npm run build:demo` builds the real app against in-browser sample data. `npm run screenshots` captures the app screenshots the page shows, and `npm run build:pages` builds both into `web/dist-pages`. The Pages workflow deploys that on every merge to `main`. +`web/product/` is the public product page, and the demo is the real app running against in-browser sample data. Neither needs the Go backend. From `web/`: + +```sh +npm run dev:product # product page with live reload +npm run dev:demo # demo at /demo/ with live reload +npm run screenshots # capture the app screenshots the page shows +npm run build:pages # build both into dist-pages/ +npm run preview:pages # serve dist-pages/ as GitHub Pages does +``` + +The Pages workflow deploys `dist-pages` on every merge to `main`. `npm run dev` is the full app and needs the Go process from the steps above. ## Run on local Kubernetes diff --git a/web/package.json b/web/package.json index 076c6f8..7c29a90 100644 --- a/web/package.json +++ b/web/package.json @@ -5,6 +5,8 @@ "type": "module", "scripts": { "dev": "vite", + "dev:product": "vite --config vite.product.config.ts", + "dev:demo": "vite --mode demo --base /demo/", "build": "tsc -b && vite build", "check": "tsc -b --pretty false", "format": "prettier --write .", @@ -12,7 +14,8 @@ "test:e2e": "playwright test", "build:demo": "tsc -b && vite build --mode demo --base /demo/ --outDir dist-demo", "screenshots": "playwright test --config playwright.screenshots.config.ts", - "build:pages": "rm -rf dist-pages && tsc -b && vite build --config vite.product.config.ts && vite build --mode demo --base /demo/ --outDir dist-pages/demo" + "build:pages": "rm -rf dist-pages && tsc -b && vite build --config vite.product.config.ts && vite build --mode demo --base /demo/ --outDir dist-pages/demo", + "preview:pages": "vite preview --config vite.product.config.ts" }, "dependencies": { "@fontsource-variable/geist": "^5.3.0",