Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Validate development and Cloudflare build toolchains
run: pnpm test:toolchain

- name: Audit runtime and development dependencies
run: pnpm security:audit

Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24
26.13.1
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,22 @@ The [service catalog](https://commercekit.tools/sandbox),

## Requirements

- Node.js 24 LTS
- Node.js 26.13.1 LTS, pinned in both repository and CCv2 build roots
- pnpm 12.11.2 through Corepack

```bash
npm install --global corepack@0.36.0
corepack enable
pnpm install
pnpm install --frozen-lockfile
```

Node 26 does not bundle Corepack. Install the pinned Corepack bootstrap above
before enabling pnpm. CI uses the existing pnpm setup action. Cloudflare Workers
Builds reads `apps/ccv2/.node-version`; keep it aligned with the repository pin
and remove or update any dashboard `NODE_VERSION` override that still selects
Node 24. This changes the build host; production continues to run on workerd
with the existing compatibility date, bindings and runtime secrets.

## Development

Start the CCv2 Worker on `http://localhost:8787`:
Expand Down Expand Up @@ -95,6 +103,10 @@ require Cloudflare credentials.
advisories. It runs in both `pnpm run ci` and GitHub CI. Development tooling is part of this
check even when it is absent from the deployed Worker.

Worker tests retain per-file isolation and their existing timeouts while bounding
concurrent workerd startup to two workers. This avoids resource-contention
timeouts during local and CI builds without skipping scenarios.

GitHub Actions runs validation only. Production deployment uses Cloudflare Workers Builds, with
`apps/ccv2` as the root directory. Required runtime secrets and the pre-merge checklist are in
[`apps/ccv2/docs/cloudflare-deployment.md`](apps/ccv2/docs/cloudflare-deployment.md).
Expand Down
1 change: 1 addition & 0 deletions apps/ccv2/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
26.13.1
8 changes: 8 additions & 0 deletions apps/ccv2/docs/cloudflare-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
- Preview URLs disabled
- Observability and sampled traces enabled

## Build toolchain

Use Node.js 26.13.1 and the pinned pnpm 12.11.2. The repository and configured
Workers Builds root (`apps/ccv2`) each include an aligned `.node-version` file.
Update or remove a dashboard `NODE_VERSION` override if it still selects Node 24.
This host-tooling migration does not change the Worker compatibility date,
Durable Object bindings, signing material or production execution runtime.

## Introduced by this change

- `workers_dev = false` and a declarative custom-domain route
Expand Down
2 changes: 1 addition & 1 deletion apps/ccv2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"packageManager": "pnpm@12.11.2",
"engines": {
"node": "24.x",
"node": ">=26.13.1 <27",
"pnpm": "12.11.2"
},
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions apps/ccv2/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ process.env.MOCK_JWT_KID = "ccv2-test-key";
process.env.RUN_TOKEN_SIGNING_KEY = "test-only-run-token-signing-key-with-32-bytes-minimum";

export default defineConfig({
test: {
// Each isolated file starts workerd; bound parallel startup without relaxing test timeouts.
maxWorkers: 2,
},
plugins: [
cloudflareTest({
wrangler: {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"packageManager": "pnpm@12.11.2",
"engines": {
"node": "24.x",
"node": ">=26.13.1 <27",
"pnpm": "12.11.2"
},
"scripts": {
Expand All @@ -18,9 +18,10 @@
"format:check": "prettier --check .",
"typecheck": "pnpm --filter @commercekit/sandbox-ccv2 typecheck",
"test": "pnpm --filter @commercekit/sandbox-ccv2 test",
"test:toolchain": "node --test scripts/*.test.mjs",
"build:check": "pnpm --filter @commercekit/sandbox-ccv2 build:check",
"security:audit": "pnpm audit --audit-level=moderate",
"ci": "pnpm security:audit && pnpm --filter @commercekit/sandbox-ccv2 types:check && pnpm format:check && pnpm lint && pnpm typecheck && pnpm --filter @commercekit/sandbox-ccv2 openapi:check && pnpm test && pnpm build:check"
"ci": "pnpm test:toolchain && pnpm security:audit && pnpm --filter @commercekit/sandbox-ccv2 types:check && pnpm format:check && pnpm lint && pnpm typecheck && pnpm --filter @commercekit/sandbox-ccv2 openapi:check && pnpm test && pnpm build:check"
},
"devDependencies": {
"@eslint/js": "10.0.1",
Expand Down
23 changes: 23 additions & 0 deletions scripts/toolchain.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import process from "node:process";
import { test } from "node:test";
import { URL } from "node:url";

const root = new URL("../", import.meta.url);
const read = (path) => readFileSync(new URL(path, root), "utf8");

test("repository and Cloudflare build roots select the same Node 26 toolchain", () => {
const version = read(".node-version").trim();
assert.match(version, /^26\.\d+\.\d+$/);
assert.equal(read("apps/ccv2/.node-version").trim(), version);
for (const path of ["package.json", "apps/ccv2/package.json"]) {
const manifest = JSON.parse(read(path));
assert.equal(manifest.engines.node, `>=${version} <27`);
assert.equal(manifest.packageManager, "pnpm@12.11.2");
}
});

test("validation executes on the pinned development runtime", () => {
assert.equal(process.versions.node, read(".node-version").trim());
});