From 1ff83ce891eeaffe2f73a3616e1bb3cb0fa0ab80 Mon Sep 17 00:00:00 2001 From: Dorell James Date: Wed, 28 Oct 2026 13:46:19 +0800 Subject: [PATCH 1/2] fix(website): add the previews block for branch builds Workers Builds runs `npx wrangler preview` for non-production branches, and wrangler refuses without a `previews` block. An empty block is enough: previews reuse the top-level assets and compatibility settings, and production deploys are unchanged. --- CONTRIBUTING.md | 2 +- apps/website/wrangler.jsonc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5493447..adc2236 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ Every change, from a person or an AI agent, follows the same path: | Root directory | repo root | | Build command | `pnpm install --frozen-lockfile && pnpm test && pnpm --filter website build` | | Deploy command | `pnpm --filter website exec wrangler deploy` | -| Other branches | `pnpm --filter website exec wrangler versions upload` (a preview URL per branch) | +| Other branches | `npx wrangler preview` (Cloudflare's default; gives each branch a preview URL, and needs the `previews` block in `wrangler.jsonc`) | Node comes from `.nvmrc` and pnpm from `packageManager` in `package.json`. A failing test or post-build check stops the deploy. diff --git a/apps/website/wrangler.jsonc b/apps/website/wrangler.jsonc index 4ccf7b0..986b0cf 100644 --- a/apps/website/wrangler.jsonc +++ b/apps/website/wrangler.jsonc @@ -12,5 +12,8 @@ }, // www.jscebu.org is attached as a Workers Custom Domain (Cloudflare manages its DNS // record and certificate). The apex jscebu.org still redirects to www via Vercel. - "routes": [{ "pattern": "www.jscebu.org", "custom_domain": true }] + "routes": [{ "pattern": "www.jscebu.org", "custom_domain": true }], + // Required by `wrangler preview`, which Workers Builds runs for non-production branches. + // Empty: previews reuse the top-level assets and compatibility settings, and get no routes. + "previews": {} } From 377c8f5dd7909c568b8397131e6eced5e4d46f2a Mon Sep 17 00:00:00 2001 From: Dorell James Date: Wed, 28 Oct 2026 13:48:45 +0800 Subject: [PATCH 2/2] fix(website): let wrangler build the site before deploying Branch builds failed because apps/website/dist did not exist when wrangler ran: the dashboard build step wasn't producing it. wrangler.jsonc now has a build.command (install, build, post-build checks), so every deploy and preview builds itself regardless of dashboard settings. Verified locally from a deleted dist/ with wrangler preview. --- CONTRIBUTING.md | 2 +- apps/website/wrangler.jsonc | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index adc2236..e9026bf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ Every change, from a person or an AI agent, follows the same path: | Setting | Value | |---|---| | Root directory | repo root | -| Build command | `pnpm install --frozen-lockfile && pnpm test && pnpm --filter website build` | +| Build command | optional: `apps/website/wrangler.jsonc` has a `build.command` that installs, builds the site and runs the post-build checks before every deploy and preview | | Deploy command | `pnpm --filter website exec wrangler deploy` | | Other branches | `npx wrangler preview` (Cloudflare's default; gives each branch a preview URL, and needs the `previews` block in `wrangler.jsonc`) | diff --git a/apps/website/wrangler.jsonc b/apps/website/wrangler.jsonc index 986b0cf..055043f 100644 --- a/apps/website/wrangler.jsonc +++ b/apps/website/wrangler.jsonc @@ -4,6 +4,11 @@ "main": "worker/index.ts", "compatibility_date": "2026-10-28", "workers_dev": true, + // Wrangler builds the site before every deploy and preview, so CI needs no separate build step. + // `pnpm install` is a no-op when dependencies are already installed. + "build": { + "command": "pnpm install --frozen-lockfile && pnpm run build" + }, // Static assets are served first; the Worker only runs when no asset matches. "assets": { "directory": "./dist",