From baab3f7f06b0fda4aa16d92f507f538d418daa4e Mon Sep 17 00:00:00 2001 From: Destan Sarpkaya Date: Wed, 4 Nov 2026 18:19:53 +0100 Subject: [PATCH] build: use Node 22 and add Wrangler config for SPA routing (#1) * build: use Node 22 and add Wrangler config for SPA routing Wrangler 4.157.0 requires Node 22, and the Cloudflare build read Node 18.18.2 from .nvmrc, so the deploy step failed. - Pin Node 22 in .nvmrc and in the GitHub workflows. - Add wrangler.jsonc to serve dist as static assets, with single-page-application fallback so deep links load index.html. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01PEUYi3wRPPWqzZDKJpt17C * build: add previews block to Wrangler config Workers Builds runs `npx wrangler preview` for non-production branches. Wrangler 4.157.0 refuses to run that command without a `previews` block in the configuration, so the preview deploy for this branch failed: Your Wrangler configuration is missing a `previews` block to run this command. An empty block is enough. Assets and compatibility settings stay at the top level. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01PEUYi3wRPPWqzZDKJpt17C --------- Co-authored-by: Claude --- .github/workflows/ci.yml | 2 +- .github/workflows/docker-nightly-release.yml | 2 +- .github/workflows/e2e-tests.yml | 2 +- .github/workflows/releases.yml | 2 +- .nvmrc | 2 +- wrangler.jsonc | 9 +++++++++ 6 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 wrangler.jsonc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dd9ffb7..14576ee4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: - run: corepack enable - uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 22 cache: 'pnpm' - name: Install dependencies diff --git a/.github/workflows/docker-nightly-release.yml b/.github/workflows/docker-nightly-release.yml index 41dbb155..1b32de6f 100644 --- a/.github/workflows/docker-nightly-release.yml +++ b/.github/workflows/docker-nightly-release.yml @@ -32,7 +32,7 @@ jobs: - run: corepack enable - uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 22 cache: 'pnpm' - name: Install dependencies diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 13b787ef..7bfc46e5 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 22 cache: 'pnpm' - name: Get Playwright version diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index d0d3febd..7d96a6dd 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -61,7 +61,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 22 cache: 'pnpm' - name: Install dependencies diff --git a/.nvmrc b/.nvmrc index 87ec8842..2bd5a0a9 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.18.2 +22 diff --git a/wrangler.jsonc b/wrangler.jsonc new file mode 100644 index 00000000..0a90c327 --- /dev/null +++ b/wrangler.jsonc @@ -0,0 +1,9 @@ +{ + "name": "toolbox", + "compatibility_date": "2026-11-01", + "assets": { + "directory": "./dist", + "not_found_handling": "single-page-application" + }, + "previews": {} +}