Repository navigation
fix: define the supported Node.js range once, so the startup check matches engines - #129
Open
wmadden-electric wants to merge 2 commits into
Open
wmadden-electric wants to merge 2 commits into
wmadden-electric wants to merge 2 commits into
Conversation
The supported Node.js lines now produce the range string, the refusal message and the check, so they cannot drift apart. The check refuses prerelease versions such as 24.11.0-rc.1, as semver does for `engines.node`. A test compares the check with semver across a table of versions. The README limits Deno to local minimal PostgreSQL apps, points the package manager list to Supported versions, and says which templates declare no `engines` field. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
PR preview published
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In create-prisma 0.14.2, the startup check and
engines.nodedisagree about Node.js prereleases:engines.node, by semver?24.11.024.11.0-rc.1EBADENGINEwarning)26.0.0-nightly20260901EBADENGINEwarning)This PR makes create-prisma's startup check agree with
engines.nodeexactly, by defining the supported range in one place. It also tidies the README's support statement.The decision: one definition of the supported range
create-prisma supports what Prisma ORM supports: Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 or newer. That is the range
^22.18.0 || ^24.11.0 || >=26.0.0(#128).In 0.14.2 that range is written four times: in
engines.node, in the startup check, in the refusal message and in a test. The check also compares versions by hand, and it treats a prerelease such as24.11.0-rc.1as 24.11.0. npm follows semver, which puts those prereleases outside this range.Now
src/utils/node-version.tslists the supported Node.js lines once. The range string, the check and the refusal message are all built from that list. The check refuses prereleases, as semver does.How we know they agree
A new test runs the check and
Bun.semver.satisfies(version, SUPPORTED_NODE_RANGE)on the same 17 versions, 4 of them prereleases, and expects the same answer from both. The existing test still checks thatengines.nodeequals the range string. If someone changes one definition and not the other, a test fails.README
enginesfield. Only minimal, hono, elysia, nest and turborepo declare the range.Testing
bun run typecheck,bun run checkandbun run test:unitpass: 107 tests, in each of three runs.Alternatives considered
semveras a dependency and use it in the check. It is only an indirect dependency today, and the check needs just the range's three lines. The test uses Bun's built-in semver to compare against.Agent: maui-32