diff --git a/.changeset/node-24-minimum.md b/.changeset/node-24-minimum.md new file mode 100644 index 0000000000..774abc63e8 --- /dev/null +++ b/.changeset/node-24-minimum.md @@ -0,0 +1,18 @@ +--- +"@cipherstash/stack": minor +"@cipherstash/stack-drizzle": minor +"@cipherstash/stack-supabase": minor +"@cipherstash/wizard": minor +"@cipherstash/migrate": minor +"stash": minor +--- + +Node.js 24 is now the minimum supported version. `engines.node` is `>=24` in +every package that declares one. `stash doctor` fails on an earlier Node, and +the wizard refuses to start on one. CI now tests Node 24 and 26. + +Node 22 reaches end of life on 30 April 2027, and Node 24 is supported until +April 2028. + +If your application runs on Node 22, move it to Node 24 before you take this +release. AWS Lambda (`nodejs24.x`) and Vercel both offer Node 24. diff --git a/.cursor/commands/create-example-app.md b/.cursor/commands/create-example-app.md index d9afd10487..ea5edbf9c5 100644 --- a/.cursor/commands/create-example-app.md +++ b/.cursor/commands/create-example-app.md @@ -53,7 +53,7 @@ CODE STYLE - Prisma/Drizzle/Raw SQL: choose CJS or ESM for least friction; document choice in one sentence. REQUIRED DX & SCRIPTS (per example) -- Node ≥ 22. Use local binaries (no global installs). +- Node ≥ 24. Use local binaries (no global installs). - Docker Compose for Postgres (shared at root or per example). - Scripts: - `dev:db` → `docker compose up -d db` @@ -97,7 +97,7 @@ ACCEPTANCE TESTS (per example) → creates rows with encrypted fields; readback shows decrypted values; a query returns expected rows. 2) Re-running `demo` is idempotent (or intentionally reseeds) without unhandled errors. 3) `npm run typecheck` passes. -4) No ESM/CJS mismatch under Node 22. +4) No ESM/CJS mismatch under Node 24. 5) Minimality: respects Simplicity Budget; ≤ 1 non-essential dependency. 6) Directness: demo code calls the ORM/client directly. 7) README: no banned words/emojis; Quickstart works verbatim on a clean machine. diff --git a/.github/actions/integration-setup/action.yml b/.github/actions/integration-setup/action.yml index e248356bd0..d7e9a52d83 100644 --- a/.github/actions/integration-setup/action.yml +++ b/.github/actions/integration-setup/action.yml @@ -10,8 +10,8 @@ inputs: node-version: description: Node major to run the suites on. required: false - # The newest major `tests.yml` exercises, and what the repo develops on. - # `engines` is `>=22`; the unit job still covers 22 in its matrix. + # `engines`' floor (`>=24`), and what the repo develops on. The unit job + # in `tests.yml` also covers 26 in its matrix. default: '24' runs: diff --git a/.github/workflows/_build-auth-artifacts.yml b/.github/workflows/_build-auth-artifacts.yml index efa6f64560..7b88595229 100644 --- a/.github/workflows/_build-auth-artifacts.yml +++ b/.github/workflows/_build-auth-artifacts.yml @@ -91,7 +91,7 @@ jobs: - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false - name: Install node-gyp @@ -249,7 +249,7 @@ jobs: - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false - name: Install node-gyp diff --git a/.github/workflows/_build-ffi-artifacts.yml b/.github/workflows/_build-ffi-artifacts.yml index 7ad7813853..d3326b215c 100644 --- a/.github/workflows/_build-ffi-artifacts.yml +++ b/.github/workflows/_build-ffi-artifacts.yml @@ -65,7 +65,7 @@ jobs: - uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false # No pnpm and no install: the script reads `neon.rust` out of the six @@ -162,7 +162,7 @@ jobs: - uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false - name: Install node-gyp @@ -416,7 +416,7 @@ jobs: - uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false - name: Install node-gyp diff --git a/.github/workflows/auth-preflight.yml b/.github/workflows/auth-preflight.yml index 124814b9e8..f8a0f76cfa 100644 --- a/.github/workflows/auth-preflight.yml +++ b/.github/workflows/auth-preflight.yml @@ -59,7 +59,7 @@ jobs: - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false # npm refuses to install a platform package whose os/cpu does not match diff --git a/.github/workflows/ffi-preflight.yml b/.github/workflows/ffi-preflight.yml index 96986d3486..b9e13ff594 100644 --- a/.github/workflows/ffi-preflight.yml +++ b/.github/workflows/ffi-preflight.yml @@ -68,7 +68,7 @@ jobs: - uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false # The five non-host platform tarballs cannot be installed here — npm diff --git a/.github/workflows/fta-v3.yml b/.github/workflows/fta-v3.yml index 7e03f8deb1..32554b7ff7 100644 --- a/.github/workflows/fta-v3.yml +++ b/.github/workflows/fta-v3.yml @@ -53,7 +53,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 cache: 'pnpm' # node-pty's install hook falls back to `node-gyp rebuild` when no diff --git a/.github/workflows/integration-protect-ffi.yml b/.github/workflows/integration-protect-ffi.yml index 70ed1cbbb3..ee89cb13dd 100644 --- a/.github/workflows/integration-protect-ffi.yml +++ b/.github/workflows/integration-protect-ffi.yml @@ -232,17 +232,13 @@ jobs: with: run_install: false - # Node 22, not the 24 `.github/actions/integration-setup` defaults to. - # This used to be an npm-version argument — the suite installed with - # `npm ci` against a lockfile npm 11 reads more strictly than npm 10 — and - # that argument died with the lockfile. What is left is the plainer one: - # 22 is `engines`' floor and what every other workflow in this repo pins, - # so it is the version this job's Rust binding and WASM artifacts are - # built and cached against everywhere else. 24 is covered for the JS + # Node 24: `engines`' floor and what every other workflow in this repo + # pins, so it is the version this job's Rust binding and WASM artifacts + # are built and cached against everywhere else. 26 is covered for the JS # surface by `tests.yml`'s matrix. - uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 cache: 'pnpm' # node-pty's install hook falls back to `node-gyp rebuild` when no diff --git a/.github/workflows/migration-harness.yml b/.github/workflows/migration-harness.yml index c74035267a..d0e96f0ab9 100644 --- a/.github/workflows/migration-harness.yml +++ b/.github/workflows/migration-harness.yml @@ -47,7 +47,7 @@ jobs: run_install: false - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: 22 + node-version: 24 cache: pnpm - run: npm install -g node-gyp - run: pnpm install --frozen-lockfile diff --git a/.github/workflows/prisma-example-readme-e2e.yml b/.github/workflows/prisma-example-readme-e2e.yml index 12f6d103e9..67f42ec58d 100644 --- a/.github/workflows/prisma-example-readme-e2e.yml +++ b/.github/workflows/prisma-example-readme-e2e.yml @@ -113,7 +113,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 cache: 'pnpm' # node-pty's install hook falls back to `node-gyp rebuild` when no diff --git a/.github/workflows/prisma-next-e2e.yml b/.github/workflows/prisma-next-e2e.yml index ea5e0f36bb..ddc3ec58bc 100644 --- a/.github/workflows/prisma-next-e2e.yml +++ b/.github/workflows/prisma-next-e2e.yml @@ -114,7 +114,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 cache: 'pnpm' # node-pty's install hook falls back to `node-gyp rebuild` when no diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index 3e65aee137..417fda54a6 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -76,7 +76,7 @@ jobs: - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false # No pnpm install: the script imports node builtins only. @@ -218,7 +218,7 @@ jobs: - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false - name: Read the publisher switch diff --git a/.github/workflows/release-postgres-eql-image.yml b/.github/workflows/release-postgres-eql-image.yml index 7a106ca715..539f9d1e39 100644 --- a/.github/workflows/release-postgres-eql-image.yml +++ b/.github/workflows/release-postgres-eql-image.yml @@ -47,7 +47,7 @@ jobs: - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false - name: Read the publisher switch diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8fe0acfb32..612bd4de9b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -147,7 +147,7 @@ jobs: - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false # No pnpm install: the script imports node builtins only, as `gate` does. @@ -185,7 +185,7 @@ jobs: - uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false # No pnpm, no install. scripts/release-gate.mjs imports node builtins @@ -240,7 +240,7 @@ jobs: # and fails every publish with E404. - uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false - name: Upgrade npm for OIDC trusted publishing @@ -393,7 +393,7 @@ jobs: # No `registry-url:`: it writes an `_authToken` line that shadows OIDC. - uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false - name: Upgrade npm for OIDC trusted publishing @@ -528,7 +528,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 # No `cache:`, and package-manager-cache disabled. release.yml # publishes to npm (OIDC trusted publishing) and must not restore the # GitHub Actions cache — a cache-poisoning / supply-chain vector. @@ -541,8 +541,9 @@ jobs: - name: Install node-gyp run: npm install -g node-gyp - # npm OIDC trusted publishing requires npm >= 11.5.1; Node 22 ships - # npm 10.x. `changeset publish` shells out to this npm to publish. + # npm OIDC trusted publishing requires npm >= 11.5.1, and the npm bundled + # with early Node 24 releases is older. `changeset publish` shells out to + # this npm to publish. - name: Upgrade npm for OIDC trusted publishing run: npm install -g npm@^11.5.1 @@ -584,10 +585,10 @@ jobs: # # `add_shims_to_path: false` IS LOAD-BEARING, and it is the input a # copy-paste from test-eql.yml would not carry. `packages/eql/mise.toml` - # pins `node = "22"` under `[tools]`, and mise's shim directory is + # pins `node = "24"` under `[tools]`, and mise's shim directory is # PREPENDED to PATH for every later step — so with the default `true`, # mise's own Node would shadow the one `actions/setup-node` installed, and - # `changeset publish` would shell out to that Node's bundled npm 10.x + # `changeset publish` would shell out to that Node's bundled npm # instead of the `npm@^11.5.1` installed above. OIDC trusted publishing # requires >= 11.5.1 and fails with E404 below it, which is the exact # failure the two comments above this step exist to prevent. `mise run` @@ -696,7 +697,7 @@ jobs: - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false # No pnpm install: the script imports node builtins only, as `gate` does. @@ -845,7 +846,7 @@ jobs: - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false # `add_shims_to_path: false` and `env: false` are load-bearing — see the diff --git a/.github/workflows/require-auth-npm-changeset.yml b/.github/workflows/require-auth-npm-changeset.yml index d71644af04..d04f549d1f 100644 --- a/.github/workflows/require-auth-npm-changeset.yml +++ b/.github/workflows/require-auth-npm-changeset.yml @@ -56,7 +56,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 package-manager-cache: false # The root alone declares `@changesets/parse`, and nothing here builds. diff --git a/.github/workflows/tests-bench.yml b/.github/workflows/tests-bench.yml index f470d05375..a1b2e0a107 100644 --- a/.github/workflows/tests-bench.yml +++ b/.github/workflows/tests-bench.yml @@ -57,10 +57,6 @@ jobs: # incidental here: the bench `globalSetup` installs EQL v3 by shelling out # to the real `stash eql install --eql-version 3`. - uses: ./.github/actions/integration-setup - with: - # This job's existing Node; the composite defaults to 24 for the - # integration suites. - node-version: 22 # The bench unit checks import @cipherstash/stack, and the `stash eql # install` in the bench `globalSetup` runs the CLI; both load diff --git a/.github/workflows/tests-crates.yml b/.github/workflows/tests-crates.yml index c36ba2c75b..1e9bd665fe 100644 --- a/.github/workflows/tests-crates.yml +++ b/.github/workflows/tests-crates.yml @@ -183,7 +183,7 @@ jobs: - uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 cache: 'pnpm' # node-pty falls back to `node-gyp rebuild` on Linux during any diff --git a/.github/workflows/tests-rust.yml b/.github/workflows/tests-rust.yml index 3d05d70ecc..33246f0f91 100644 --- a/.github/workflows/tests-rust.yml +++ b/.github/workflows/tests-rust.yml @@ -101,7 +101,7 @@ jobs: - uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 cache: 'pnpm' # node-pty's install hook falls back to `node-gyp rebuild` when no diff --git a/.github/workflows/tests-supply-chain.yml b/.github/workflows/tests-supply-chain.yml index 589d241596..46a78462d2 100644 --- a/.github/workflows/tests-supply-chain.yml +++ b/.github/workflows/tests-supply-chain.yml @@ -73,7 +73,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 # Do not use caching in this cache-testing workflow package-manager-cache: false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 554e71f6d5..82f14c2eb0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,10 +35,10 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6.5.0 with: - # Node 22 is the supply-chain hardening baseline every pnpm-using job + # Node 24 is the supply-chain hardening baseline every pnpm-using job # must pin (enforced by e2e/tests/supply-chain.e2e.test.ts). Lint is # runtime-agnostic, so a single pinned version is fine. - node-version: 22 + node-version: 24 cache: 'pnpm' # node-pty's install hook falls back to `node-gyp rebuild` when no @@ -58,12 +58,12 @@ jobs: timeout-minutes: 25 strategy: matrix: - node-version: [22, 24] + node-version: [24, 26] postgres-version: [16, 17] exclude: - - node-version: 22 - postgres-version: 17 - node-version: 24 + postgres-version: 17 + - node-version: 26 postgres-version: 16 # Postgres + EQL for the integration tests. Official EQL image — @@ -428,7 +428,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 cache: 'pnpm' # node-pty's install hook falls back to `node-gyp rebuild` when no @@ -618,7 +618,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 cache: 'pnpm' # node-pty (a dev-dep of @cipherstash/cli used by its E2E PTY @@ -766,7 +766,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v6.5.0 with: - node-version: 22 + node-version: 24 cache: 'pnpm' - name: Install node-gyp diff --git a/AGENTS.md b/AGENTS.md index 6252615a79..54d4728a61 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,7 @@ This is the CipherStash Stack repository (`cipherstash/stack`) - End-to-end, per ## Prerequisites -- **Node.js**: >= 22 (enforced in `package.json` engines) +- **Node.js**: >= 24 (enforced in `package.json` engines) - **pnpm**: 10.33.2 (this repo uses pnpm workspaces and catalogs) - Internet access to install the prebuilt native module `@cipherstash/protect-ffi` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ec96903942..43ec9a3c7b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,7 +41,7 @@ The `languages/typescript/examples/` directory contains applications demonstrati ### Prerequisites -- **Node.js** >= 22 +- **Node.js** >= 24 - **pnpm** (the version pinned in `package.json`'s `packageManager` field) - CipherStash credentials if you want to run integration tests or examples (see [AGENTS.md](./AGENTS.md) for the required environment variables) diff --git a/README.md b/README.md index 973fd6086a..eda196b03a 100644 --- a/README.md +++ b/README.md @@ -352,7 +352,7 @@ npm install @cipherstash/stack # or: yarn / pnpm / bun add @cipherstash/stack > native `require`. For edge and serverless runtimes (Cloudflare Workers, Deno, Bun), use the bundler-friendly > `@cipherstash/stack/wasm-inline` entry instead. [Bundling guide →][bundling] -**Requirements:** Node.js ≥ 22. +**Requirements:** Node.js ≥ 24. ## Documentation & community diff --git a/e2e/migration-harness/isolation/Dockerfile b/e2e/migration-harness/isolation/Dockerfile index 61e9a0b60e..4f8cc51a8d 100644 --- a/e2e/migration-harness/isolation/Dockerfile +++ b/e2e/migration-harness/isolation/Dockerfile @@ -1,4 +1,4 @@ -FROM node:22-bookworm-slim +FROM node:24-bookworm-slim RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates strace socat python3 util-linux git && rm -rf /var/lib/apt/lists/* # A bind mount's root can appear root-owned (Colima virtiofs on macOS) while the # actor runs as the host uid; Git would then refuse /workspace as dubious ownership. diff --git a/e2e/migration-harness/run/real-stores.mjs b/e2e/migration-harness/run/real-stores.mjs index 7e48b1425b..cf5963aa57 100644 --- a/e2e/migration-harness/run/real-stores.mjs +++ b/e2e/migration-harness/run/real-stores.mjs @@ -45,7 +45,7 @@ async function publishAdminPort(target, port, network, resources) { '64m', '-p', `127.0.0.1::${port}`, - 'node:22-bookworm-slim', + 'node:24-bookworm-slim', 'node', '-e', `const net = require('node:net'); diff --git a/e2e/tests/supply-chain.e2e.test.ts b/e2e/tests/supply-chain.e2e.test.ts index 73e3768cef..19b0b169d9 100644 --- a/e2e/tests/supply-chain.e2e.test.ts +++ b/e2e/tests/supply-chain.e2e.test.ts @@ -514,7 +514,7 @@ describe('supply chain — CI hardening (.github/workflows/tests.yml)', () => { // redundant, because it PASSES on inputs the broader one fails, so a reader // who found it first would get a wrong answer about what this repo enforces. - it('every pnpm-using job runs on Node 22 (literal or matrix incl. 22)', () => { + it('every pnpm-using job runs on Node 24 (literal or matrix incl. 24)', () => { for (const [jobName, job] of Object.entries(workflow.jobs)) { const usesPnpm = job.steps.some( (s) => @@ -532,14 +532,14 @@ describe('supply chain — CI hardening (.github/workflows/tests.yml)', () => { `${jobName} uses pnpm but lacks actions/setup-node`, ).toBeTruthy() const nv = String(setup?.with?.['node-version']) - if (nv === '22') continue + if (nv === '24') continue // Allow `${{ matrix. }}` only when that matrix key resolves to - // an array of versions that includes 22 — so the matrix can broaden - // coverage without ever dropping the Node 22 hardening baseline. + // an array of versions that includes 24 — so the matrix can broaden + // coverage without ever dropping the Node 24 hardening baseline. const matrixRef = nv.match(/^\$\{\{\s*matrix\.([\w-]+)\s*\}\}$/) expect( matrixRef, - `${jobName} node version: expected '22' or matrix expression, got '${nv}'`, + `${jobName} node version: expected '24' or matrix expression, got '${nv}'`, ).toBeTruthy() const matrixKey = matrixRef![1] const versions = job.strategy?.matrix?.[matrixKey] @@ -550,8 +550,8 @@ describe('supply chain — CI hardening (.github/workflows/tests.yml)', () => { const versionStrings = (versions as unknown[]).map((v) => String(v)) expect( versionStrings, - `${jobName} matrix.${matrixKey} must include 22`, - ).toContain('22') + `${jobName} matrix.${matrixKey} must include 24`, + ).toContain('24') } }) }) @@ -685,8 +685,8 @@ const ignoresAllSemverMajor = (entry: DependabotUpdate): boolean => // languages/typescript/packages/utils/ holds only config/ and logger/, with no // package.json of its own. // -// Expanded with node:fs `globSync` (Node 22, which package.json engines already -// require) rather than a glob library — this package has none, and a check on +// Expanded with node:fs `globSync` (Node 22 and later; package.json engines +// require 24) rather than a glob library — this package has none, and a check on // dependency policy is a poor place to add a dependency. const unmonitoredDirectories = ( entry: Pick, diff --git a/languages/typescript/examples/basic/README.md b/languages/typescript/examples/basic/README.md index 48a8a9940a..846abbd7e4 100644 --- a/languages/typescript/examples/basic/README.md +++ b/languages/typescript/examples/basic/README.md @@ -5,7 +5,7 @@ This basic example demonstrates how to use the `@cipherstash/stack` package and ## Installing the basic example > [!IMPORTANT] -> You need Node.js 22+ and npm (or [pnpm](https://pnpm.io/installation)). +> You need Node.js 24+ and npm (or [pnpm](https://pnpm.io/installation)). Create a new project or use an existing one, then install the package: diff --git a/languages/typescript/examples/supabase-worker/README.md b/languages/typescript/examples/supabase-worker/README.md index c19a040f28..b5cead7d84 100644 --- a/languages/typescript/examples/supabase-worker/README.md +++ b/languages/typescript/examples/supabase-worker/README.md @@ -8,7 +8,7 @@ The function imports from the `@cipherstash/stack/wasm-inline` subpath — the W ## Prerequisites -- Node ≥ 22 and pnpm 10 (matches the repo root); only needed for the local install step. +- Node ≥ 24 and pnpm 10 (matches the repo root); only needed for the local install step. - A CipherStash workspace + service-to-service credentials (client ID, client key, access key) — see the [CipherStash docs](https://cipherstash.com/docs). - [Supabase CLI](https://supabase.com/docs/guides/cli) installed locally. diff --git a/languages/typescript/examples/supabase-worker/package.json b/languages/typescript/examples/supabase-worker/package.json index d15c3e7629..fd89999a28 100644 --- a/languages/typescript/examples/supabase-worker/package.json +++ b/languages/typescript/examples/supabase-worker/package.json @@ -6,7 +6,7 @@ "type": "module", "packageManager": "pnpm@10.33.2", "engines": { - "node": ">=22" + "node": ">=24" }, "scripts": { "//": "Run via the Supabase CLI; the function imports stack/wasm-inline (and its transitive npm: deps) at runtime, so there is no build step here.", diff --git a/languages/typescript/packages/cli/package.json b/languages/typescript/packages/cli/package.json index 8d9e9e0b58..6442f4cf95 100644 --- a/languages/typescript/packages/cli/package.json +++ b/languages/typescript/packages/cli/package.json @@ -90,6 +90,6 @@ "access": "public" }, "engines": { - "node": ">=22" + "node": ">=24" } } diff --git a/languages/typescript/packages/cli/src/__tests__/doctor-node-version.test.ts b/languages/typescript/packages/cli/src/__tests__/doctor-node-version.test.ts new file mode 100644 index 0000000000..f6763724e1 --- /dev/null +++ b/languages/typescript/packages/cli/src/__tests__/doctor-node-version.test.ts @@ -0,0 +1,33 @@ +import { readFileSync } from 'node:fs' +import { describe, expect, it } from 'vitest' +import { + MIN_NODE_MAJOR, + meetsMinimumNode, +} from '../commands/doctor/node-version.js' + +describe('stash doctor — Node.js version', () => { + it('accepts the minimum major and later ones', () => { + expect(meetsMinimumNode('24.0.0')).toBe(true) + expect(meetsMinimumNode('24.11.1')).toBe(true) + expect(meetsMinimumNode('26.1.0')).toBe(true) + }) + + it('refuses an earlier major', () => { + expect(meetsMinimumNode('22.21.1')).toBe(false) + expect(meetsMinimumNode('20.19.0')).toBe(false) + }) + + it('refuses a version it cannot read', () => { + expect(meetsMinimumNode('')).toBe(false) + expect(meetsMinimumNode('not-a-version')).toBe(false) + }) + + it('matches the engines floor in package.json', () => { + const pkg = JSON.parse( + readFileSync(new URL('../../package.json', import.meta.url), 'utf8'), + ) as { engines: { node: string } } + expect(pkg.engines.node, 'engines.node and MIN_NODE_MAJOR differ').toBe( + `>=${MIN_NODE_MAJOR}`, + ) + }) +}) diff --git a/languages/typescript/packages/cli/src/commands/doctor/index.ts b/languages/typescript/packages/cli/src/commands/doctor/index.ts index 89efa585e4..405b4a29ef 100644 --- a/languages/typescript/packages/cli/src/commands/doctor/index.ts +++ b/languages/typescript/packages/cli/src/commands/doctor/index.ts @@ -6,6 +6,7 @@ import { isNativeBinaryMissing, reportNativeBinaryMissing, } from '../../native.js' +import { MIN_NODE_MAJOR, meetsMinimumNode } from './node-version.js' // Native-bearing packages the CLI loads at runtime, and — per package — the // operation that forces its platform binary to resolve. @@ -83,12 +84,11 @@ export async function doctorCommand(): Promise { let incomplete = false let nativeError: unknown - const nodeMajor = Number(process.versions.node.split('.')[0]) - const nodeOk = Number.isFinite(nodeMajor) && nodeMajor >= 22 + const nodeOk = meetsMinimumNode(process.versions.node) report( nodeOk ? 'ok' : 'fail', `Node.js ${process.versions.node}`, - nodeOk ? '' : 'requires >= 22', + nodeOk ? '' : `requires >= ${MIN_NODE_MAJOR}`, ) if (!nodeOk) failed = true diff --git a/languages/typescript/packages/cli/src/commands/doctor/node-version.ts b/languages/typescript/packages/cli/src/commands/doctor/node-version.ts new file mode 100644 index 0000000000..7437323ad7 --- /dev/null +++ b/languages/typescript/packages/cli/src/commands/doctor/node-version.ts @@ -0,0 +1,11 @@ +/** + * The oldest Node.js major `stash` supports. Keep it equal to the `engines` + * floor in this package's `package.json`. + */ +export const MIN_NODE_MAJOR = 24 + +/** Whether a `process.versions.node` string meets {@link MIN_NODE_MAJOR}. */ +export function meetsMinimumNode(version: string): boolean { + const major = Number(version.split('.')[0]) + return Number.isFinite(major) && major >= MIN_NODE_MAJOR +} diff --git a/languages/typescript/packages/cli/tests/e2e/doctor-probe-classification.e2e.test.ts b/languages/typescript/packages/cli/tests/e2e/doctor-probe-classification.e2e.test.ts index a0b6fdc06d..980bc9e04e 100644 --- a/languages/typescript/packages/cli/tests/e2e/doctor-probe-classification.e2e.test.ts +++ b/languages/typescript/packages/cli/tests/e2e/doctor-probe-classification.e2e.test.ts @@ -98,10 +98,10 @@ registerHooks({ .join(' ') } -// `module.registerHooks` landed in Node 22.15, and `engines` only asks for -// `>=22`. Skipped rather than failed on an older runtime: the child would die -// in the preload with a TypeError that reads as a broken CLI. CI runs 22 and 24 -// at their latest patch, so this never skips there. +// `module.registerHooks` landed in Node 22.15, so every Node `engines` +// allows (`>=24`) has it. Skipped rather than failed on an older runtime: the +// child would die in the preload with a TypeError that reads as a broken CLI. +// CI runs 24 and 26, so this never skips there. const hooksAvailable = typeof registerHooks === 'function' describe.skipIf(!hooksAvailable)('stash doctor — probe classification', () => { diff --git a/languages/typescript/packages/migrate/package.json b/languages/typescript/packages/migrate/package.json index 3ac85ed58d..59d4dc3701 100644 --- a/languages/typescript/packages/migrate/package.json +++ b/languages/typescript/packages/migrate/package.json @@ -67,6 +67,6 @@ "access": "public" }, "engines": { - "node": ">=18" + "node": ">=24" } } diff --git a/languages/typescript/packages/protect-ffi/mise.toml b/languages/typescript/packages/protect-ffi/mise.toml index d775021fac..22ac1f829d 100644 --- a/languages/typescript/packages/protect-ffi/mise.toml +++ b/languages/typescript/packages/protect-ffi/mise.toml @@ -1,12 +1,16 @@ [tools] # No `node` entry. This file used to carry `node = "latest"`, which resolved to # 25.x and meant `cd languages/typescript/packages/protect-ffi` silently switched Node version -# relative to the rest of the monorepo — whose lockfile, `@types/node` and -# `@tsconfig/node22` are all resolved for 22, and whose only Node requirement -# is the root `engines: { node: ">=22" }`. Leaving Node to the workspace keeps +# relative to the rest of the monorepo, whose only Node requirement is the +# root `engines: { node: ">=24" }`. Leaving Node to the workspace keeps # one runtime across every package; this file keeps what is genuinely # package-local, which is the Rust toolchain. # +# Not yet moved to 24: this package's three tsconfigs still extend +# `@tsconfig/node22`, and `@types/node` is still `^22` (root `package.json`, +# the `pnpm-workspace.yaml` catalog, bench and the prisma example). Moving +# them is a separate follow-up to the Node 24 minimum. +# # zig + cargo-zigbuild are pinned to the versions proven by the successful # v0.27.0 release (run 28709228045). `latest` is how cargo-zigbuild 0.23.0 # silently broke the Release workflow (its cargo-options bump dropped the diff --git a/languages/typescript/packages/stack-drizzle/package.json b/languages/typescript/packages/stack-drizzle/package.json index 224fbb4df7..85dc2d3024 100644 --- a/languages/typescript/packages/stack-drizzle/package.json +++ b/languages/typescript/packages/stack-drizzle/package.json @@ -77,6 +77,6 @@ "access": "public" }, "engines": { - "node": ">=22" + "node": ">=24" } } diff --git a/languages/typescript/packages/stack-supabase/package.json b/languages/typescript/packages/stack-supabase/package.json index 1dfefab88f..d38d8db7eb 100644 --- a/languages/typescript/packages/stack-supabase/package.json +++ b/languages/typescript/packages/stack-supabase/package.json @@ -94,6 +94,6 @@ "access": "public" }, "engines": { - "node": ">=22" + "node": ">=24" } } diff --git a/languages/typescript/packages/stack/README.md b/languages/typescript/packages/stack/README.md index 973fd6086a..eda196b03a 100644 --- a/languages/typescript/packages/stack/README.md +++ b/languages/typescript/packages/stack/README.md @@ -352,7 +352,7 @@ npm install @cipherstash/stack # or: yarn / pnpm / bun add @cipherstash/stack > native `require`. For edge and serverless runtimes (Cloudflare Workers, Deno, Bun), use the bundler-friendly > `@cipherstash/stack/wasm-inline` entry instead. [Bundling guide →][bundling] -**Requirements:** Node.js ≥ 22. +**Requirements:** Node.js ≥ 24. ## Documentation & community diff --git a/languages/typescript/packages/stack/package.json b/languages/typescript/packages/stack/package.json index b75e579ff1..446e569b54 100644 --- a/languages/typescript/packages/stack/package.json +++ b/languages/typescript/packages/stack/package.json @@ -245,6 +245,6 @@ "@cipherstash/auth-win32-x64-msvc": "workspace:*" }, "engines": { - "node": ">=22" + "node": ">=24" } } diff --git a/languages/typescript/packages/wizard/package.json b/languages/typescript/packages/wizard/package.json index 66cfc9ebc4..e4b0b6945a 100644 --- a/languages/typescript/packages/wizard/package.json +++ b/languages/typescript/packages/wizard/package.json @@ -61,6 +61,6 @@ "access": "public" }, "engines": { - "node": ">=22" + "node": ">=24" } } diff --git a/languages/typescript/packages/wizard/src/__tests__/node-version.test.ts b/languages/typescript/packages/wizard/src/__tests__/node-version.test.ts new file mode 100644 index 0000000000..d0dafac911 --- /dev/null +++ b/languages/typescript/packages/wizard/src/__tests__/node-version.test.ts @@ -0,0 +1,41 @@ +import { readFileSync } from 'node:fs' +import { describe, expect, it } from 'vitest' +import { + MIN_NODE_MAJOR, + meetsMinimumNode, + nodeVersionError, +} from '../lib/node-version.js' + +describe('wizard — Node.js version', () => { + it('accepts the minimum major and later ones', () => { + expect(meetsMinimumNode('24.0.0')).toBe(true) + expect(meetsMinimumNode('24.11.1')).toBe(true) + expect(meetsMinimumNode('26.1.0')).toBe(true) + }) + + it('refuses an earlier major', () => { + expect(meetsMinimumNode('22.21.1')).toBe(false) + expect(meetsMinimumNode('20.19.0')).toBe(false) + }) + + it('refuses a version it cannot read', () => { + expect(meetsMinimumNode('')).toBe(false) + expect(meetsMinimumNode('not-a-version')).toBe(false) + }) + + it('names the running version and the minimum when refusing', () => { + expect(nodeVersionError('22.21.1')).toBe( + `The CipherStash Wizard needs Node.js ${MIN_NODE_MAJOR} or later. This is Node.js 22.21.1.`, + ) + expect(nodeVersionError('24.0.0')).toBeUndefined() + }) + + it('matches the engines floor in package.json', () => { + const pkg = JSON.parse( + readFileSync(new URL('../../package.json', import.meta.url), 'utf8'), + ) as { engines: { node: string } } + expect(pkg.engines.node, 'engines.node and MIN_NODE_MAJOR differ').toBe( + `>=${MIN_NODE_MAJOR}`, + ) + }) +}) diff --git a/languages/typescript/packages/wizard/src/bin/wizard.ts b/languages/typescript/packages/wizard/src/bin/wizard.ts index b33cd3019a..48baff6fde 100644 --- a/languages/typescript/packages/wizard/src/bin/wizard.ts +++ b/languages/typescript/packages/wizard/src/bin/wizard.ts @@ -4,6 +4,7 @@ import { fileURLToPath } from 'node:url' import * as p from '@clack/prompts' import { config } from 'dotenv' import { detectPackageManager } from '../lib/detect.js' +import { nodeVersionError } from '../lib/node-version.js' import { run } from '../run.js' import { parseArgs } from './parse-args.js' @@ -65,6 +66,12 @@ async function main() { process.exit(1) } + const nodeError = nodeVersionError(process.versions.node) + if (nodeError) { + p.log.error(nodeError) + process.exit(1) + } + // Defer env loading until we're actually running — `--help` / `--version` // shouldn't pay for it, and a malformed `--mode` should exit before it // touches disk. diff --git a/languages/typescript/packages/wizard/src/lib/constants.ts b/languages/typescript/packages/wizard/src/lib/constants.ts index d0c8633ad9..1c141057a9 100644 --- a/languages/typescript/packages/wizard/src/lib/constants.ts +++ b/languages/typescript/packages/wizard/src/lib/constants.ts @@ -36,8 +36,5 @@ export const DETECTION_TIMEOUT_MS = 10_000 /** Health check timeout (ms). */ export const HEALTH_CHECK_TIMEOUT_MS = 10_000 -/** Minimum Node.js version. */ -export const MIN_NODE_VERSION = '22.0.0' - /** GitHub issues URL. */ export const ISSUES_URL = 'https://github.com/cipherstash/stack/issues' diff --git a/languages/typescript/packages/wizard/src/lib/node-version.ts b/languages/typescript/packages/wizard/src/lib/node-version.ts new file mode 100644 index 0000000000..8528d467e3 --- /dev/null +++ b/languages/typescript/packages/wizard/src/lib/node-version.ts @@ -0,0 +1,19 @@ +/** + * The oldest Node.js major the wizard supports. Keep it equal to the + * `engines` floor in this package's `package.json`; a test checks that. + * npm and pnpm only warn on an `engines` mismatch, so the wizard checks for + * itself before it starts. + */ +export const MIN_NODE_MAJOR = 24 + +/** Whether a `process.versions.node` string meets {@link MIN_NODE_MAJOR}. */ +export function meetsMinimumNode(version: string): boolean { + const major = Number(version.split('.')[0]) + return Number.isFinite(major) && major >= MIN_NODE_MAJOR +} + +/** The message to show when `version` is too old, or `undefined` if it is not. */ +export function nodeVersionError(version: string): string | undefined { + if (meetsMinimumNode(version)) return undefined + return `The CipherStash Wizard needs Node.js ${MIN_NODE_MAJOR} or later. This is Node.js ${version}.` +} diff --git a/package.json b/package.json index 2b8d5f9c7a..2c4c23b5c5 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ }, "packageManager": "pnpm@10.33.2", "engines": { - "node": ">=22" + "node": ">=24" }, "pnpm": { "peerDependencyRules": { diff --git a/packages/eql/mise.toml b/packages/eql/mise.toml index 64fc8a8519..43e82b21eb 100644 --- a/packages/eql/mise.toml +++ b/packages/eql/mise.toml @@ -19,7 +19,7 @@ # Node drives the @cipherstash/eql generated-output gates (types:check / # typescript:check invoke packages/eql/scripts/sync-generated.mjs directly — # node builtins only, no pnpm/node_modules needed at gate time). -"node" = "22" +"node" = "24" "cargo-binstall" = "latest" "cargo:sqlx-cli" = "latest" # Installed via the already-present cargo-binstall (fast in CI). Drives the diff --git a/scripts/__tests__/cli-live-postgres-ci.test.mjs b/scripts/__tests__/cli-live-postgres-ci.test.mjs index 01abae5812..e3435631e1 100644 --- a/scripts/__tests__/cli-live-postgres-ci.test.mjs +++ b/scripts/__tests__/cli-live-postgres-ci.test.mjs @@ -54,10 +54,10 @@ describe('CLI live-Postgres CI contract', () => { const versions = runTests.strategy.matrix['postgres-version'] expect(versions).toEqual([16, 17]) - expect(runTests.strategy.matrix['node-version']).toEqual([22, 24]) + expect(runTests.strategy.matrix['node-version']).toEqual([24, 26]) expect(runTests.strategy.matrix.exclude).toEqual([ - { 'node-version': 22, 'postgres-version': 17 }, - { 'node-version': 24, 'postgres-version': 16 }, + { 'node-version': 24, 'postgres-version': 17 }, + { 'node-version': 26, 'postgres-version': 16 }, ]) expect(runTests.services.postgres.image).toContain( '$' + '{{ matrix.postgres-version }}', diff --git a/scripts/__tests__/workflow-docker-hub-login.test.mjs b/scripts/__tests__/workflow-docker-hub-login.test.mjs index bbe976c63e..c15dc2f148 100644 --- a/scripts/__tests__/workflow-docker-hub-login.test.mjs +++ b/scripts/__tests__/workflow-docker-hub-login.test.mjs @@ -219,7 +219,7 @@ export const HIDDEN_PULLS = { { step: 'Run the credentialed Migration Harness self-test', reason: - 'With HARNESS_LIVE=1, e2e/migration-harness runs postgres:17-alpine and node:22-bookworm-slim, and builds an image from node:22-bookworm-slim.', + 'With HARNESS_LIVE=1, e2e/migration-harness runs postgres:17-alpine and node:24-bookworm-slim, and builds an image from node:24-bookworm-slim.', }, ], } diff --git a/scripts/__tests__/workflow-mise-setup.test.mjs b/scripts/__tests__/workflow-mise-setup.test.mjs index 2f42e8dd3f..c4e38848ad 100644 --- a/scripts/__tests__/workflow-mise-setup.test.mjs +++ b/scripts/__tests__/workflow-mise-setup.test.mjs @@ -374,9 +374,9 @@ describe('the mise setup step carries the inputs it depends on', () => { it('keeps mise shims off PATH in a publishing job', () => { // `add_shims_to_path` DEFAULTS TO TRUE, and the shim directory is PREPENDED // to PATH for every later step. `packages/eql/mise.toml` pins - // `node = "22"`, so with the default, mise's Node shadows the one + // `node = "24"`, so with the default, mise's Node shadows the one // `actions/setup-node` installed — and `changeset publish` shells out to - // that Node's bundled npm 10.x instead of the `npm@^11.5.1` the job + // that Node's bundled npm instead of the `npm@^11.5.1` the job // installed. OIDC trusted publishing requires >= 11.5.1 and returns E404 // below it, so the release fails at the publish call, after // `changeset version` has already rewritten every manifest. @@ -390,7 +390,7 @@ describe('the mise setup step carries the inputs it depends on', () => { expect( offenders, - "A job that publishes to npm over OIDC installs mise with its shims on PATH. mise prepends them, so its pinned `node` shadows `actions/setup-node`, `changeset publish` gets that Node's npm 10.x, and OIDC trusted publishing fails with E404 (it needs npm >= 11.5.1). Set `add_shims_to_path: false` — a copy-paste of the `test-eql.yml` step will not carry it, because there the default is harmless.", + "A job that publishes to npm over OIDC installs mise with its shims on PATH. mise prepends them, so its pinned `node` shadows `actions/setup-node`, `changeset publish` gets that Node's bundled npm, and OIDC trusted publishing fails with E404 (it needs npm >= 11.5.1). Set `add_shims_to_path: false` — a copy-paste of the `test-eql.yml` step will not carry it, because there the default is harmless.", ).toEqual([]) }) diff --git a/skills/stash-cli/SKILL.md b/skills/stash-cli/SKILL.md index 4ea65c39ca..63653670ba 100644 --- a/skills/stash-cli/SKILL.md +++ b/skills/stash-cli/SKILL.md @@ -877,7 +877,7 @@ Required: `SUPERUSER`, **or** `CREATE` on the database *and* on the `public` sch ## Requirements -- Node.js >= 22 +- Node.js >= 24 - PostgreSQL with sufficient permissions (check with `stash eql preflight`) - `stash.config.ts` with a valid `databaseUrl` — or run `stash init` / `stash eql install` to scaffold it - Optional peer dependency: `@cipherstash/stack` >= 0.6.0 (required for the commands that load your encryption client) diff --git a/skills/stash-supply-chain-security/SKILL.md b/skills/stash-supply-chain-security/SKILL.md index c7060aa63e..8913c744d9 100644 --- a/skills/stash-supply-chain-security/SKILL.md +++ b/skills/stash-supply-chain-security/SKILL.md @@ -120,7 +120,7 @@ and `npm dist-tag` changes. Before adding a new direct dep, ask: -- Does Node ≥ 22 (our minimum) already provide this? +- Does Node ≥ 24 (our minimum) already provide this? - Is the package actively maintained? Check Snyk's database (security.snyk.io) — practice #14 - What does `npm pack ` show in the actual tarball? (npmjs.org's web view can lie — practice #15) @@ -160,7 +160,7 @@ Constraints baked into that workflow — don't undo them: - **`permissions: id-token: write`** is what mints the OIDC token. Without it every publish fails — but it belongs on the **publishing jobs**, never at the workflow level. A trusted publisher is registered against a repository *and a workflow filename*, so once `release.yml` is the registered publisher, npm accepts a token minted by **any** job in that file: the registry cannot tell the cheap every-push gate apart from the publish job. Declared at the top, it reaches every job that does not override it, including the one added next month by someone who never read this page. `release.yml` therefore grants `contents: read` at the workflow level and escalates per job, so a new job has to *ask* for the credential in its own diff. Enforced by `scripts/__tests__/workflow-publish-permissions.test.mjs`, which also holds the list of jobs allowed to hold it. - **`runs-on: ubuntu-latest`, not a self-hosted/Blacksmith runner.** npm rejects provenance from non-GitHub-hosted runners with E422. - **Never set `NPM_TOKEN`.** `changesets/action` writes a token `.npmrc` when it sees one, which shadows OIDC and fails every publish with E404 (npm/cli#8976). -- **npm ≥ 11.5.1 and Node ≥ 22.14.** Node 22 ships npm 10.x, so the workflow installs `npm@^11.5.1` explicitly before publishing. +- **npm ≥ 11.5.1 and Node ≥ 24.** The npm bundled with early Node 24 releases is older than 11.5.1, so the workflow installs `npm@^11.5.1` explicitly before publishing. - **No Actions cache in this workflow** (no `cache:`, `package-manager-cache: false`, `pnpm/action-setup` with `cache: false`). A poisoned cache entry would execute in a credential-bearing job. Enforced by `scripts/lint-no-workflow-caching.mjs`, which also follows any local composite action or reusable workflow the job reaches — the rule is about the whole call tree, not the one file. - **Every published `uses:` must be in that script's `AUDITED_ACTIONS` allowlist.** The gate cannot open a published action to check whether it caches, and the ones that do are not all named "cache" — a `setup-` action that caches by default has no `cache:` input and no telling name. So the list is what is *permitted*, and an action it has never met fails by default. Adding a step to `release.yml`, `_build-ffi-artifacts.yml` or `tests-supply-chain.yml` means auditing the action and adding it there with the reason, in the same PR. - **Three actions must disable caching *explicitly*, and the input differs for each.** Allowlisting an action is not the same as it being safe by default: