diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d98e10e5..3fee1be2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,13 +10,10 @@ is unclear, update the relevant product doc before changing the command surface. Requirements: -- Node.js 24 or newer +- Node.js 24.11 or newer on the 24 line, or 26 or newer - pnpm 10 -Published `@prisma/cli` declares a lower floor (Node 22.18, matching -`@prisma/composer`), and composer runs fine there. The repo develops and tests -on 24 because the startup-isolation probe cannot run on Node 22; the reason is -recorded in `packages/cli/tests/composer-isolation.test.ts`. +Published packages support Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 or newer (`engines.node` is `^22.18.0 || ^24.11.0 || >=26.0.0`, the same range as create-prisma and the projects it generates). The exception is `@prisma/cli-engine`, which keeps its own wider range until its next version; users never install it on its own. The repo develops and tests on 24 because the startup-isolation probe cannot run on Node 22; the reason is recorded in `packages/cli/tests/composer-isolation.test.ts`. Install dependencies: diff --git a/README.md b/README.md index 0e121237..e1b110ae 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Deployments start from pushing the connected repository, the Console, or `prisma Requirements: -- Node.js 24 or newer +- Node.js 24.11 or newer on the 24 line, or 26 or newer - pnpm 10+ Install dependencies: diff --git a/docs/onboarding/getting-started.md b/docs/onboarding/getting-started.md index d135f13d..edcba4ab 100644 --- a/docs/onboarding/getting-started.md +++ b/docs/onboarding/getting-started.md @@ -4,7 +4,7 @@ This guide gets a local checkout ready for CLI development. ## Requirements -- Node.js 24 or newer +- Node.js 24.11 or newer on the 24 line, or 26 or newer - pnpm 10 ## Install diff --git a/package.json b/package.json index d23210fb..aa7555b0 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "8.0.0-rc.22", "private": true, "engines": { - "node": ">=24" + "node": "^24.11.0 || >=26.0.0" }, "packageManager": "pnpm@11.6.0", "scripts": { @@ -18,7 +18,7 @@ "lint:fix": "biome check . --write", "bump-version": "node scripts/bump-version.ts", "test": "turbo run test", - "test:scripts": "node --test scripts/determine-version-utils.test.ts scripts/set-version-utils.test.ts scripts/bump-cli-engine-version-utils.test.ts scripts/resolve-package-version.test.mjs scripts/update-product-versions.test.mjs scripts/verify-published.test.mjs", + "test:scripts": "node --test scripts/determine-version-utils.test.ts scripts/set-version-utils.test.ts scripts/bump-cli-engine-version-utils.test.ts scripts/resolve-package-version.test.mjs scripts/update-product-versions.test.mjs scripts/verify-published.test.mjs scripts/node-engines.test.mjs", "typecheck": "turbo run typecheck", "prisma-cli": "tsx packages/cli/src/bin.ts", "prisma": "tsx packages/cli/src/bin.ts", diff --git a/packages/cli-conformance/package.json b/packages/cli-conformance/package.json index dbfe2094..8f0889bf 100644 --- a/packages/cli-conformance/package.json +++ b/packages/cli-conformance/package.json @@ -16,7 +16,7 @@ "./tarball-io": "./src/tarball-io.ts" }, "engines": { - "node": ">=22.12.0" + "node": "^22.18.0 || ^24.11.0 || >=26.0.0" }, "license": "Apache-2.0", "scripts": { diff --git a/packages/cli-telemetry/package.json b/packages/cli-telemetry/package.json index f8c90e3f..a75c9ace 100644 --- a/packages/cli-telemetry/package.json +++ b/packages/cli-telemetry/package.json @@ -23,7 +23,7 @@ "dist" ], "engines": { - "node": ">=22.12.0" + "node": "^22.18.0 || ^24.11.0 || >=26.0.0" }, "license": "Apache-2.0", "scripts": { diff --git a/packages/cli/README.md b/packages/cli/README.md index 10810fb7..50301f8b 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -102,7 +102,7 @@ npx prisma-cli service version promote VERSION_ID ## Beta notes -- Requires Node.js 22.18 or newer. +- Requires Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 or newer. - This is a release-candidate package and may change quickly. - The 8.0.0 release candidates publish as `@prisma/cli` on the `next` dist-tag. - The package binary is `prisma-cli`; the sibling `prisma` package ships the same CLI under the `prisma` binary. diff --git a/packages/cli/package.json b/packages/cli/package.json index f6266766..6a88750b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -19,7 +19,7 @@ "access": "public" }, "engines": { - "node": ">=22.18.0" + "node": "^22.18.0 || ^24.11.0 || >=26.0.0" }, "keywords": [ "prisma", diff --git a/packages/compute/package.json b/packages/compute/package.json index a4e984f0..3bdd130d 100644 --- a/packages/compute/package.json +++ b/packages/compute/package.json @@ -18,7 +18,7 @@ "access": "public" }, "engines": { - "node": ">=22.12.0" + "node": "^22.18.0 || ^24.11.0 || >=26.0.0" }, "keywords": [ "prisma", diff --git a/packages/prisma/README.md b/packages/prisma/README.md index 82760de7..415525e5 100644 --- a/packages/prisma/README.md +++ b/packages/prisma/README.md @@ -99,7 +99,7 @@ npx prisma service version promote VERSION_ID ## Beta notes -- Requires Node.js 22.18 or newer. +- Requires Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 or newer. - This is a release-candidate package and may change quickly. - The 8.0.0 release candidates publish as `prisma` on the `next` dist-tag. - The package binary is `prisma`. diff --git a/packages/prisma/package.json b/packages/prisma/package.json index 71151f63..e9298dba 100644 --- a/packages/prisma/package.json +++ b/packages/prisma/package.json @@ -23,7 +23,7 @@ "access": "public" }, "engines": { - "node": ">=22.18.0" + "node": "^22.18.0 || ^24.11.0 || >=26.0.0" }, "keywords": [ "prisma", diff --git a/scripts/node-engines.test.mjs b/scripts/node-engines.test.mjs new file mode 100644 index 00000000..c804622a --- /dev/null +++ b/scripts/node-engines.test.mjs @@ -0,0 +1,42 @@ +import assert from "node:assert/strict"; +import { existsSync, readdirSync, readFileSync } from "node:fs"; +import { join } from "node:path"; +import { describe, it } from "node:test"; + +const SUPPORTED_NODE_RANGE = "^22.18.0 || ^24.11.0 || >=26.0.0"; +// Changing the engine's manifest requires a new engine version, which the +// product CLIs then have to peer before the shell can ship it. The engine +// takes the range with its next real change; delete this entry then. +const RANGE_BEFORE_NEXT_ENGINE_RELEASE = { + "@prisma/cli-engine": ">=22.12.0", +}; +const packagesDir = join(import.meta.dirname, "..", "packages"); + +const runtimePackages = readdirSync(packagesDir, { withFileTypes: true }) + .filter((entry) => entry.isDirectory()) + .map((entry) => join(packagesDir, entry.name, "package.json")) + .filter((manifestPath) => existsSync(manifestPath)) + .map((manifestPath) => JSON.parse(readFileSync(manifestPath, "utf8"))) + .filter((manifest) => manifest.engines !== undefined); + +describe("engines.node", () => { + it("covers every package that ships runtime code", () => { + assert.deepEqual(runtimePackages.map((manifest) => manifest.name).sort(), [ + "@prisma/cli", + "@prisma/cli-engine", + "@prisma/compute", + "@repo/cli-conformance", + "@repo/cli-telemetry", + "prisma", + ]); + }); + + for (const manifest of runtimePackages) { + it(`is the supported range in ${manifest.name}`, () => { + assert.equal( + manifest.engines.node, + RANGE_BEFORE_NEXT_ENGINE_RELEASE[manifest.name] ?? SUPPORTED_NODE_RANGE, + ); + }); + } +});