Repository navigation
chore: declare one Node.js range on every Prisma 8 package #30669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wmadden-electric
wants to merge
6
commits into
main
Choose a base branch
from
chore/node-range
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+421
−133
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8bc624a
chore: declare one Node.js range on every Prisma 8 package
wmadden-electric fcca796
chore: declare no upgrade action for the Node.js range change
wmadden-electric a4776e9
fix: narrow the React Router example's Node.js range and address review
wmadden-electric 20ab754
docs(adr): ADR 269 records that CI stays on one Node.js version
wmadden-electric 1ee9328
docs(adr): ADR 269 states that it overrides ADR 222's test-coverage r…
wmadden-electric b83ca1a
docs(adr): keep ADR 269's consequences as one list
wmadden-electric File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
docs/architecture docs/adrs/ADR 269 - One Node.js range for every Prisma 8 tool.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # ADR 269 — One Node.js range for every Prisma 8 tool | ||
|
|
||
| **Status:** Accepted | ||
| **Date:** 2026-10-09 | ||
| **Amends:** [ADR 222 — Version support policy](ADR%20222%20-%20Version%20support%20policy.md) | ||
|
|
||
| --- | ||
|
|
||
| ## Decision | ||
|
|
||
| Every Prisma 8 package declares this `engines.node` range: | ||
|
|
||
| ```json | ||
| "engines": { "node": "^22.18.0 || ^24.11.0 || >=26.0.0" } | ||
| ``` | ||
|
|
||
| In prose: Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 or newer, each with the npm that ships with that Node.js release (npm 10 on Node.js 22). | ||
|
|
||
| The same range applies to every Prisma 8 tool: the `@prisma/orm-*` packages in this repository, the `prisma` CLI, Composer, `create-prisma`, and the projects `create-prisma` generates. A user who meets the requirement of one tool meets the requirement of all of them. | ||
|
|
||
| ## Why one range | ||
|
|
||
| A user meets the Prisma 8 tools one after another: `create-prisma` scaffolds a project, the project installs `@prisma/orm-postgres`, and the user runs the `prisma` CLI. When each tool states a different Node.js requirement, the user finds out which one is strictest only when an install warns or a command fails. One range removes that. | ||
|
|
||
| ## Why these versions | ||
|
|
||
| - **22.18** is the first Node.js 22 release that runs `.ts` files without a flag. Users run `node migration.ts` to emit a migration, so a Node.js version that cannot run `.ts` files cannot use Prisma 8 migrations. | ||
| - **24.11** is the first Long Term Support release of Node.js 24. | ||
| - **26 or newer** covers current and future releases. | ||
|
|
||
| ## Enforcement | ||
|
|
||
| - `NODE_ENGINES_RANGE` in `scripts/validate-node-engines.mjs` is the source of truth. `pnpm lint:manifests` fails when a publishable package lacks `engines.node`, or when any package under `packages/` declares a different range. The check covers only `packages/`. | ||
| - `tsdown` derives each package's build target from `engines.node`, so every package builds for `node22.18.0`, the lowest version in the range. | ||
| - The examples under `examples/` are applications. They declare the same range unless a framework they use needs a narrower one; `examples/react-router-demo` declares `^22.22.0 || ^24.11.0 || >=26.0.0` because React Router needs Node.js 22.22 or newer. | ||
| - The scaffold READMEs that `prisma orm init` writes, the repository README, and [Supported Versions](../../Supported%20Versions.md) state the range in prose. | ||
|
|
||
| The repository's own development toolchain is separate: the root `package.json` and `.tool-versions` choose the Node.js version contributors and CI use, and this ADR does not change them. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - Node.js 22.18 and newer 22.x releases become supported. | ||
| - This ADR overrides ADR 222's rule that a declared floor must never claim more than this repository's test infrastructure exercises, for Node.js only. The Node.js range is a product decision shared by every Prisma 8 tool, and the team decided not to add CI jobs for it. This repository's CI runs the test suites on the Node.js version in `.tool-versions` (a 24.x release) only. What exercises the rest of the range today: | ||
| - Node.js 22.18.0: `pnpm build` and `pnpm test:packages` passed on it when this ADR was written. The nightly getting-started check in prisma/getting-started-eval runs on Node.js 22.18.0 with its own npm, and installs and runs Prisma ORM through `create-prisma` every night. | ||
| - Node.js 26: nothing tests it yet. A change that breaks it would go unnoticed until a user reports it. | ||
| - `tsdown` lowers syntax to Node.js 22.18. It does not check built-in APIs: code must not call an API newer than Node.js 22.18, and only a test run on Node.js 22.18 catches one that does. | ||
|
|
||
| ## Alternatives considered | ||
|
|
||
| - **Keep `>=24`.** This excludes users on Node.js 22, which is still a supported Long Term Support line, and it differs from the range `create-prisma` already declares. | ||
| - **A range per tool.** Each tool could state only what it needs. Users would then have to meet the strictest requirement across several tools without being told which one it is. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.