Repository navigation
ci(publish): dev builds publish as 8.0.1-dev.N, so ranges like ^8.0.0-rc.38 stop installing them - #429
Closed
wmadden-electric wants to merge 2 commits into
Closed
ci(publish): dev builds publish as 8.0.1-dev.N, so ranges like ^8.0.0-rc.38 stop installing them#429wmadden-electric wants to merge 2 commits into
wmadden-electric wants to merge 2 commits into
Conversation
…o release range picks them A dev build was <base>-dev.<run>, for example 8.0.0-rc.36-dev.202. Semver ranks the identifier 36-dev above any number, so that version sorts above 8.0.0-rc.38 and ranges such as ^8.0.0-rc.37 resolved to dev builds. Dev builds now publish as <major>.<minor>.<patch+1>-dev.<run> (8.0.0-rc.38 -> 8.0.1-dev.<run>), the scheme Prisma ORM uses. A range matches a prerelease only on the patch it names, so no release range matches them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
|
Caution Review failedThe pull request is closed. Summary by CodeRabbit
WalkthroughThe
|
commit: |
…cost Peer ranges written for releases no longer accept a dev build, a dev build made before 8.0.0 gets no update notice until 8.1.0, and the action's argument rule covers dev builds only on the RC line. README and CONTRIBUTING no longer describe <base>-dev.N. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
wmadden-electric
marked this pull request as ready for review
December 2, 2026 22:16
Contributor
Author
|
Closing: not pursuing changes to the dev-build versions. |
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.
Dev builds of
prismaand@prisma/clinow publish as a prerelease of the next patch, for example8.0.1-dev.203, instead of<last release>-dev.<run>, for example8.0.0-rc.36-dev.202. No version range a user writes for a release can match the new versions.What a user sees today
npm has
lateston8.0.0-rc.36andnexton8.0.0-rc.38. Someone who rannpm install prisma@nexthas"prisma": "^8.0.0-rc.38"inpackage.json. A freshnpm installof that range (no lockfile) installs8.0.0-rc.9-dev.79, a dev build from months ago, not8.0.0-rc.38.The cause is semver's ordering of prerelease parts. In
8.0.0-rc.36-dev.202the parts arerc,36-devand202.36-devcontains letters, so it is compared as text, and text always ranks above a number. So every8.0.0-rc.N-dev.Msorts above every8.0.0-rc.N, and among themselves they sort as text (9-devabove36-dev). npm takes thelatestversion when the range allows it, and otherwise the highest version in the range, so the problem shows wheneverlatestis older than the user's range. Appending.dev.Ninstead does not help:8.0.0-rc.38.dev.203still sorts above8.0.0-rc.38.What changes
devVersioninscripts/determine-version-utils.tsreturns<major>.<minor>.<patch + 1>-dev.<run>:8.0.0-rc.388.0.0-rc.38-dev.2038.0.1-dev.2038.0.08.0.0-dev.2038.0.1-dev.2038.1.08.1.0-dev.2038.1.1-dev.203This is the scheme Prisma ORM already uses (its dev builds are
8.0.1-dev.Nwhile its releases are8.0.0-rc.N). A semver range matches a prerelease only when the range itself names a prerelease of the samemajor.minor.patch. No release range names8.0.1-…, so^8.0.0-rc.15,^8.0.0,>=8.0.0and*never match a dev build. The dev builds still sort below the next real release after 8.0.0 (8.0.1-dev.N<8.1.0, which is whatpnpm bump-versiongives after8.0.0).The docs (
docs/oss/versioning.md,docs/oss/release-automation.md,README.md,CONTRIBUTING.md) describe the new scheme and why the old one was wrong. The promotion test that checks a dev build onlatestis not counted as a move back now covers both shapes.What this costs
@alchemy.run/prisma@2.0.0-beta.87, which@prisma/composer-prisma-clouddepends on, declares an optional peerprisma: ^8.0.0-rc.15. A reviewer repacked rc.38 as8.0.1-dev.1and installed it with npm 11: npm put a second, releasedprisma@8.0.0-rc.36, with@prisma/composer-cli@0.40.0and ORM rc.25 packages, undernode_modules/@prisma/composer-prisma-cloud/node_modules/, with no warning. Nothing loads that copy today. Alchemy's code does not importprisma, so the peer could be dropped there.8.0.1-dev.Nsorts above8.0.0.How it was checked
semverandnpm-pick-manifestand the real list ofprismaversions on npm, for the ranges^8.0.0-rc.15,~8.0.0-rc.15,>=8.0.0-rc.15,^8.0.0,~8.0.0,>=8.0.0,8,*,^8.0.0-0and>=8.0.0-0: no range picks8.0.1-dev.203, with or without alatesttag, and after a hypothetical8.0.0every range picks8.0.0.prisma@devresolves to8.0.1-dev.203, because a dist-tag names a version directly and ignores ordering.prismaor@prisma/cliversion8.0.1-*exists on npm, so the first dev publish cannot collide with an existing version.isAtLeastRcin itscli.mjscounts8.0.1-dev.Nas newer than every RC, so on the RC line it sends a dev build the newest arguments (after 8.0.0 that no longer holds;docs/oss/release-automation.mdsays so).-dev.<n>at the end) matches the new shape.node --test scripts/determine-version-utils.test.ts scripts/promote-release-utils.test.ts, and Biome on the changed files.pnpm typecheckdoes not coverscripts/.Not in this change
^8.0.0-rc.37resolves to8.0.0-rc.9-dev.79whilelatestis older than the range, because the existing8.0.0-rc.N-dev.Mversions still sort above every RC. npm skips deprecated versions when it can: with those versions deprecated, the same range resolves to8.0.0-rc.38. Deprecating the old dev builds, 133 versions ofprismaand 136 of@prisma/cli(onenpm deprecateper version: a range cannot select them cleanly, because they interleave with the RCs in semver order) is a registry action for a maintainer, not part of this pull request. Promoting8.0.0-rc.38tolatestalso hides the problem for npm users of^8.0.0-rc.38and older ranges.@prisma/computehas the same flaw.scripts/resolve-package-version.mjspublishes its dev builds as0.1.0-dev.<run>.<attempt>beside releases0.1.0-beta.N, anddevsorts abovebeta. It is versioned separately, has its own workflow and is due to move to another repository, so it is left out. The engine has no dev builds.Alternatives
<base>.dev.<run>(8.0.0-rc.38.dev.203): still sorts above8.0.0-rc.38and matches^8.0.0-rc.15.8.0.0-rc.39-dev.0.203or similar): any8.0.0-prerelease is matched by^8.0.0-rc.N, so this keeps the problem.8.1.0-dev.N): works equally for ranges, but differs from the ORM's scheme for no gain.Agent: cobain-55
🤖 Generated with Claude Code