Repository navigation
feat: each package's version shows its maturity level (8.3.0, 8.3.0-ea.0), and release 8.0 is published as 8.0.1 - #31212
Merged
Merged
Conversation
…sions and dependencies Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
The shell build now expects each sibling package a shell reaches, through its bundled packages or a facade re-export, under peerDependencies, and refuses one under dependencies or optionalDependencies. The peerShells field of the shell map is removed. ParadeDB's internal package declares its optional peer on the Postgres target so the published package keeps it. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
Every example, app and test application that lists one of the published packages now also lists each sibling that package names as a peer, following peers of peers. test/prisma-bin lists the framework beside its toolchain. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
pnpm resolves a peer through the registry, not through the tarball overrides, so a scratch application that left a platform package out got the published copy of it: the facade-only install passed on registry copies, and the pgvector test failed on a second copy of the framework. installShells now fails when any @prisma/orm-* package came from the registry, and each packaging test lists the platform packages the way an application now does. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…es name each other as peers Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…mes as peers After installing the database package, init reads its installed manifest, collects every @prisma/orm-* peer and the peers those name, and installs each at the range the manifests declare, with the database package pinned to the version it resolved. It reads manifests a package manager that installs no peers puts on disk only after init's own install. A package the project already lists at another range is left alone and reported; --skip-install prints the same list. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
The project the init journey installs now lists every package its facade names as a peer, read from the workspace manifests, as init does. This replaces listing only the target package for migration.ts. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…fails to install The pgvector packaging test now checks that the application, the PostgreSQL package and the extension resolve the same folder for each of the four platform packages, and that each is installed once. A new case packs the SQL family one version ahead and requires the install to fail under strict peers, naming the mismatch. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…ed platform install says how to undo The printed Prisma 6 side-by-side install command now names the Prisma ORM packages the database package names as peers, read from the installed manifests and, for a package not installed, from the registry. It names the database package alone when neither can be read. When installing a platform package fails after init installed the database package, the failure carries the existing instruction to remove what init installed. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…facade The facade READMEs give the full install command, say once why the application lists the platform packages, and warn about two versions in one monorepo. The platform package READMEs say an application lists them beside its facade instead of receiving them as exact-pinned dependencies. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…ons name them as peers The quickstart, the build, contract and upgrade references, the target package guide, the naming conventions, the error reference and the rule on example timeouts now describe the application listing the platform packages beside its database package. The extension exact-pin rule makes every Prisma package a peer dependency and a development dependency, and its one-line check enforces that. Role detection no longer mistakes an application that lists the framework for an extension. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…isma packages peers Pending upgrade instructions for both audiences: an application adds every package its database package and extensions name as peers, at the database package's version; an extension moves every Prisma package from dependencies to peerDependencies and devDependencies. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…e glossary's word for the target package Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…ional sibling peer, and drop ParadeDB's peer on the target The shell build now refuses a manifest whose sibling peer is missing from devDependencies or is marked optional in peerDependenciesMeta. ParadeDB names only the platform packages it uses, so its peer on the PostgreSQL target, kept before through an optional internal peer, is removed. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
… ordinary dependency check-publish-deps now fails when a packed manifest holds another package this repository publishes under dependencies or optionalDependencies. It covers @prisma/orm-better-auth, which the shell build does not check. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…eer package, and reads the registry in parallel init's list of the @prisma/orm-* packages a target package names as peers, directly or through another, now has one name in the code: its Prisma ORM peer packages (init-orm-peer-packages.ts). - A listed package is a mismatch only when its installed copy is at another version, or, when none is installed, its line cannot stand for the version: a catalog:, workspace: or other protocol line, or a caret on the version, is not. A second run after a package manager wrote carets warns about nothing. - The --json document says, for each package, whether init installed it, found it already listed, left it at another version, or left it to install; deps no longer names a package init left alone. - The printed Prisma 6 setup reads the registry through an injected lookup, one level of peers at once under one time limit, and warns when it could not read a package's peers. - A test runs the collection against the manifests of the five target packages this repository publishes. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…eers pkg-pr-new rewrites sibling dependencies to preview addresses but not peer dependencies; with --peerDeps it sets them to a version, not an address. Say where previews are described that a preview of one package is installed together with the previews of the packages it names as peers. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…the stale statements of the old arrangement - Use the glossary's "target package" where this branch wrote "database package", "platform package" where it wrote "SPI package", and add a glossary entry for platform packages. - Reword the facade package descriptions, the publish-surface README and shells.ts comments, the facade READMEs' reason for forwarding namespaces, the PostgreSQL README's decomposing section, and the target-package-config README, which still described an application installing one package. - The facade README install commands write exact versions. - Say what init now installs, reports and reads from the registry in the CLI README and the CLI subsystem doc. - upgrade-app.md says a version mismatch is reported at install; build-a-target-package.md says exactly what init lists. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…ackage manager Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…ime limit and cancelling A package.json line that is a plain version or range now decides whether a listed Prisma ORM peer package is at the version asked for, whatever copy is installed; the installed copy decides only for a protocol line such as workspace: or catalog:. The registry time limit is a timer the tests can advance, and new tests show it is shared by every read and that cancelling the command is passed through. The test against the five target packages now reads their real manifests with init's own reader. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…ADME matches init - The facade READMEs no longer promise exact lines: init writes the list in the form the project's package manager writes a version, and the manual install commands give every @prisma/orm-* package the same <version>, with the driver on its own line. The Mongo source README does the same. - The CLI README's peer-packages paragraph sits above the failure list, says what the install trial showed each package manager writes, and describes the line-first check; its --json example shows ormPeerPackages. - The naming conventions say an extension names exactly the platform packages its code uses; ParadeDB and the cache middleware do not name the PostgreSQL target. - The pending app upgrade instructions ask for the same version on every line, written the way the target package's line is. - check-publish-deps numbers its checks in order. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
A caret line init wrote for one release candidate still admits the next one after an update, so judging it by its text warned falsely on a second run. An exact version line is still judged by its text; a range, a dist-tag or a protocol line is judged by the installed copy, and counts as listed when none is installed. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
The list is about to hold the target package's required peer dependencies that are not Prisma ORM packages too, so ormPeerPackages becomes requiredPeers (module init-required-peers.ts, the --json field packagesInstalled.requiredPeers). No behaviour changes. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…ops under --skip-install when one is missing Under a package manager that installs no peer dependencies, such as Yarn, an application made by init could not load: the target package names temporal-polyfill (and, for PostgreSQL, pg and @types/pg) as required peers, and init added only the driver. This gap is older than this branch. - The list init collects now holds, besides the @prisma/orm-* packages the target package names as peers, every other required peer those manifests name (not marked optional in peerDependenciesMeta), whose own peers are not followed. The engine, which init installs as a development dependency, is left out; a driver is installed once. A peer the project already lists is left. Type-only packages such as @types/pg are added as ordinary dependencies, since the manifest does not say otherwise. - Init works the list out before loading <package>/init. Under --skip-install, when a required peer is not installed, it stops with CLI.INIT_REQUIRED_PEERS_NOT_INSTALLED, naming the add command, instead of the module-resolution error. When the init entrypoint cannot load and a required peer is missing, the fix says so. - The printed Prisma 6 setup reads optional flags from the published manifests too. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…manager writes - The CLI README and subsystem doc describe the required peers init now adds and the --skip-install refusal, and say that init does not support Yarn Plug'n'Play (set nodeLinker: node-modules); the quickstart says so too. That limit is older than this branch: installedManifest looks only in node_modules folders on main as well. - The lines are written the way the package manager writes a version it is given; in testing, pnpm, Yarn and Bun wrote it exactly and the Node-bundled manager added a caret. - The app upgrade instructions add the other required peers, and their listing command prints them, exits with an error when it cannot find a package it was given, and says to run it with yarn node under Plug'n'Play. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…d specs, and say what to do under Yarn Plug'n'Play - A required peer counts as installed when it can be found from the project or from the target package's own real folder, where pnpm puts the peers it installs itself, so init --skip-install goes on under pnpm and prints the full list. When it does stop, the error says the packages cannot be found. - Every printed install command and the --skip-install list quote a spec that holds a character a shell would read, such as a caret or a range with a space, in double quotes; a plain name or version stays as it is. - In a Yarn project, CLI.INIT_TARGET_PACKAGE_NOT_INSTALLED's fix says that init does not support Plug'n'Play and that nodeLinker: node-modules makes it work. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…e engine left out of the upgrade listing - The CLI README lists CLI.INIT_REQUIRED_PEERS_NOT_INSTALLED among the exit 2 codes, says where a required peer is looked for and that printed specs are quoted, and its --json example shows third-party peers. - The requiredPeers schema comment, the Prisma 6 warning and two doc comments say required peers, not Prisma ORM peer packages. - The error-reference entry is in alphabetical order and says the packages cannot be found. - The upgrade listing command leaves out @prisma/cli-engine, as init does. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
….json already lists Under --skip-install, a missing required peer that package.json already lists, for example on a catalog: or workspace: line, is now put in place by running the package manager's install command, which leaves the line alone; the add command names only the missing peers the project does not list. Co-Authored-By: Claude Opus <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…roject's list Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…ve the reasons to the ADR Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
It compares the toolchain it carries with the application's ORM packages when it runs an ORM command, and stops when they are on different minors. Nothing follows from the tool's own version, so the prisma lines leave the examples. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
The prisma command-line tool keeps its own version numbers, so a tilde on its installed version no longer keeps it on the ORM's release. Init stops rewriting the prisma line beside a facade below GA, and the field that carried the facade's level to that code goes with it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…t as built Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
wmadden-electric
marked this pull request as ready for review
November 26, 2026 23:57
wmadden
approved these changes
Nov 27, 2026
wmadden-electric
enabled auto-merge
November 27, 2026 00:06
wmadden-electric
marked this pull request as draft
November 27, 2026 00:12
auto-merge was automatically disabled
November 27, 2026 00:12
Pull request was converted to draft
wmadden-electric
marked this pull request as ready for review
November 27, 2026 00:13
wmadden-electric
enabled auto-merge
November 27, 2026 00:14
…36-levels-versions-ranges
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 27, 2026
…36-levels-versions-ranges # Conflicts: # AGENTS.md # package.json # packages/9-public/@prisma/orm-postgres-contrib/README.md
wmadden-electric
enabled auto-merge
November 27, 2026 04:10
Thegreatsura
pushed a commit
to Thegreatsura/prisma
that referenced
this pull request
Nov 27, 2026
…on a broken link (prisma#31222) From this pull request on, an agent that writes or changes a doc does not judge it alone. Before it calls the change done, it starts two other agents that have not seen its session and hands each a written brief: ```text Cold reader, given only the file: "Read this as one of its intended readers, with none of the author's context. Quote every sentence you had to read twice. List every term used before it is explained..." Fact checker, given the file and the repository: "Check every name, code sample, command, number and link against the code. Report what the code actually does, with file and line..." ``` It fixes what they report and sends the doc round again until neither finds anything that would stop a reader understanding it or acting on it. For a small change it starts the fact checker only. For a change that states nothing, such as a typo or a moved file, it runs a new link check and no agent. That is the decision: **a doc is reviewed by readers who are not its author, and how much review depends on what the change says.** The link check is the bottom rung of the same ladder, which is why it is in this pull request. ## What is in the pull request 1. **The requirement,** in one line of `AGENTS.md` and in a rule for Cursor. 2. **A skill, `doc-review`,** with the two briefs in full and a table of which changes need which review. 3. **Instructions for the CodeRabbit review bot** for Markdown files. 4. **A link check in the Lint job,** and repairs for every broken link it found on `main`. 5. **One place for the rules on decision records.** `adr-writing.mdc` now states their order, what they may cite, and how to change a decision. The rule `adr-examples-must-match-code.mdc` is deleted, because the fact checker does what it asked, for every doc. The first three are guidance that agents follow. Nothing in CI checks that a review happened. The link check is the only part that CI enforces. That is deliberate: whether a sentence can be understood is not something a script can decide, and the review bot and the maintainer still read every pull request. ## What went wrong before On [prisma#31212](prisma#31212) an agent wrote two decision records and changed fifty other docs, read them itself, and reported them clear. One of its sentences: > The MySQL application has a tilde even on its GA lines, so that an update does not move them to `8.4` without the facade. A reader has to already know what "the facade" is, what a tilde does to a version range, which lines are "GA lines", and why an update would move some lines and not others. The author knew all four, so the sentence read as clear to them. The same docs said an error appears on the first query; it appears only when a default value is read. The maintainer could not follow the docs, and asked the agent, by hand and several times, to read each one again as a newcomer and rewrite it. What finally worked was giving each file to an agent with no context, and having another agent check each claim against the code. Two things explain the failure, and they are the reason for the two reviewers: - **An author cannot read their own text cold.** They know what every term means. Only a reader without the context finds a term used before it is defined, a mechanism explained before the problem it solves, or a rule stated with no example. - **Writing a doc compares nothing with the code.** Facts are written from memory, often of a plan whose names changed while the work was built. Only a check against the code finds a wrong fact. The repository already had guidance on what a good decision record looks like. It asked the author to apply it to their own text, it covered decision records only, and nothing in it checked a fact. ## How the review runs The agent that wrote the doc starts the reviewers as subagents and fills in the brief for each. The skill's table tells it which ones: | The change | Who reviews it | | --- | --- | | A new or rewritten explanation: a decision record, a policy page, a guide | A cold reader and a fact checker | | A small change that states something: a sentence, an example, a command, a number | A fact checker, who also quotes any sentence it could not follow | | A typo, a moved file, a link repointed to the same content | Nobody; the link check only | | A link whose target no longer exists | The sentence around it now sends the reader to something that is gone, so it is rewritten and reviewed as a small change | | A plan, spec or notes file under `projects/` | Nobody. Those are working files that are deleted when a project closes, not documentation | One pass by the reviewers, followed by the author's fixes, is a round. Each round uses a new cold reader, because the previous one now knows what the text means. The fact checker is the same agent across rounds; the author sends it the changed passages. A cold reader can always find something, so the skill gives the author the test for stopping: nothing left that would keep a reader from understanding the doc or acting on it correctly. The reviewers only read files and search the code. They run no builds or tests, which matters because many agent sessions share one machine. ## Where the requirement is written - **`AGENTS.md`,** in one line under the golden rules. It is the only file every agent harness loads. The repository's rule files are `.mdc` files that Cursor loads by file pattern, and Claude Code does not load them. - **`.agents/rules/doc-changes-get-two-independent-reviews.mdc`,** for Cursor. It matches every Markdown file and every rule file, gives the reason in two sentences, and points at the skill. The repository limits the total size of its rule files, in lines and bytes, so that agents are not loaded with more guidance than they can use. `main` is at that limit. So the new rule is short, and it takes the place of the deleted one. Consolidating the decision-record rules was needed for the same review to pass: before, the order of a decision record was stated two different ways, and whether one may cite a ticket number was stated in five places that did not agree. ## The review bot `.coderabbit.yml` gains instructions for Markdown and rule files. The bot comments only on text a pull request adds or changes, and flags a statement the code contradicts, a name that does not exist, a rule that another file states differently, and a broken link. In text that explains something, it also flags a term used before it is explained and a rule with no example. The bot is a backstop for docs that reach a pull request without the review above, including a contributor's. It does not replace that review: it comments on a diff, and it does not trace a claim through the code. ## The link check `scripts/check-doc-links.mjs` runs in the Lint job in about half a second, with no new dependency. For every Markdown file and rule file in the repository, it checks that each link's target exists and that each `#anchor` is a heading in the target. - **It reads** inline links, reference-style links, and `href` and `src` in HTML. - **It checks relative links, and full GitHub links into this repository's `main` branch.** The second form is how the package READMEs and the shipped skill link to decision records. Links to other repositories are not checked. - **A target counts only if git tracks it, or would track it once added.** A file that git ignores does not count, even when it is on disk. An install generates the ignored folder `.cursor/rules/`, and 13 links into it passed locally while being broken on GitHub. - **It leaves out** files under `projects/`, and templates that are written into other repositories, where their links resolve differently. It has tests for each link form and each rule above, and each behaviour was shown to fail a test when removed. **What it found on `main`, all fixed here:** 79 broken relative links, the 13 links into the ignored folder, and one full GitHub link in a published README that said ADR 312 and meant ADR 313. Most pointed at a file that had been renamed or moved, and now point at the new place. While repairing those, the implementer also checked by hand the links from this repository's `drive/` folder to prisma/ignite, where the team's delivery process ("Drive") and its agent skills live. About twenty pointed at pages that no longer exist there. Where the content moved into a skill, the link points at the skill. Where it is gone, the sentence that sent the reader there is rewritten or removed. ## How to review this - **Read first:** `skills-contrib/doc-review/SKILL.md` and the rule. They are the substance. - **The script:** `scripts/check-doc-links.mjs` and its test file. - **The link repairs are most of the diff** and can be skimmed: the commits whose messages start "repair" and "point" change a link target and nothing else. The commits that reword or remove a sentence say so in their message. ## How it was checked - **The guidance was reviewed the way it prescribes.** Two different cold readers read the rule, the skill and the bot instructions. A fact checker confirmed the commands, paths and checks they mention. A design reviewer then traced three cases through the files, twice: an agent writing a decision record, an agent changing two sentences of a README, and an agent reviewing a contributor's pull request. - **What that review changed.** The first draft required both reviewers for every change, however small, and never said when to stop. It would have had an agent start two reviewers for each of thirty files after renaming one term. - **The link check** was reviewed twice by a code reviewer, who wrote a fixture for each link form and broke the script on purpose to see which tests fail. - `pnpm lint:doc-links`, the rule and skill validators, and the check on the size of the rules pass. ## What this does not do - **It does not make Claude Code load the repository's other rule files.** That gap is older than this pull request and affects every rule. - **It does not change the Drive code review,** whose skills live in prisma/ignite. Having that review run these passes on doc changes is a change there. ## Alternatives considered - **Tell the author to re-read their own doc as a newcomer.** The repository already said this, in a rule and two skills. Self-review is the method that failed. - **A rule only, with no skill.** The briefs are what make the review work, and they are too long for a rule, given the limit on the rules' size. - **Both reviewers for every doc change.** A two-sentence change to a README would cost two agents and several rounds. A fact checker alone catches what a short change can get wrong. - **Have CI require a record that the review ran.** A script can check that a record exists, not that the doc is clear, and agents would learn to write the record. - **Leave it to the review bot.** It comments on a diff, does not trace a claim through the code, and is not a reader who has to act on the doc. - **An existing link checker, such as lychee or markdown-link-check.** Either is a new dependency or a binary in CI. Neither treats a git-ignored file as missing, or maps a GitHub link to `main` onto the local file, which were the two cases that mattered here. Agent: keithrichards-58 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Added automated checks for documentation links and heading anchors, including in CI. * Added a documentation review workflow with independent clarity and fact-checking reviews. * **Documentation** * Updated contributor guidance for documentation reviews and ADR writing, including guidance on superseding decisions. * Corrected and refreshed links across architecture, onboarding, migration, and reference materials. * Clarified architecture decision records and aligned their references with current guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> Co-authored-by: Claude Fable 5.2 <[email protected]>
This was referenced Nov 27, 2026
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-prisma__orm
that referenced
this pull request
Nov 27, 2026
…equire each pull request to name its public API changes (prisma#31217) A pull request can break our users in two ways without anyone noticing: it breaks an API users already have, or it exports something by accident, which from `8.0.0` we must keep until Prisma 9. This pull request adds two CI jobs, one for each, and they apply from now, on release candidates, so they are proven long before `8.0.0`. **A break.** Suppose a pull request makes the `options` parameter of `createCacheMiddleware` required. Every application that calls `createCacheMiddleware()` would stop compiling. The new `API compatibility` job compares the build with the last release and fails: ```text break @prisma/orm-extension-middleware-cache: createCacheMiddleware (value): Type 'undefined' is not assignable to type 'CacheMiddlewareOptions<TMeta>'. ``` If the break is deliberate, the author records it, with a reason, and the job passes (see "Accepting a break you mean"). **An accidental export.** Each published package commits an `api.txt`, a generated list of everything users can import from it, one line per export. Suppose a pull request exports an internal helper from `@prisma/orm-family-sql/relational-core/ast`. Nothing breaks, but the package's list gains a line, which starts with the import path: ```diff # packages/9-public/@prisma/orm-family-sql/api.txt +./relational-core/ast: function buildJoinPlan(query: SelectAst): JoinPlan ``` The new `API changes named` job posts a comment listing that line. The author either removes an export that was an accident, or names it in the description with a reason. The job fails until the description has that entry: ```markdown ## API changes - `@prisma/orm-family-sql/relational-core/ast: buildJoinPlan`: exported for the Mongo family, which plans joins the same way. ``` ## The decision | Job | What it compares | Fails | | --- | --- | --- | | `API compatibility` | Each export of the last release with the current build, through a generated TypeScript test per export. It also compiles the last release's example apps, with their type tests, against the current build, which catches a changed query result type that no declaration shows | On a break nobody has recorded as deliberate | | `API changes named` | The `api.txt` lists and break records before and after this pull request | Until the description names every change | Both apply from now, against any last release. Each part of the compatibility policy is in force from the first release candidate after its pull request merges. Until `8.0.0`, a break is still possible, but only as a deliberate decision with release notes, and a record is how that decision is written down. Failing from now on also proves the checks on real breaks before anyone relies on them. A job that could not compare at all, for example because the registry was unreachable, fails too. **Neither job blocks a merge yet.** That needs a repository admin to make it a required check in the branch rules, which live outside this repository. The recommendation: require both now. **One piece of work remains before `8.0.0`.** The compatibility job assumes every package is published at one version, as every release candidate is. prisma#31212, merged today, gives each package its own version from release 8.0, such as `8.3.1` for a generally available (GA) package and `8.3.0-ea.1` for an Early Access one. The job looks up one version for every package and applies one rule to all of them. So it would not find packages published at their own versions, and it could not treat an Early Access package differently from a GA one. Ticket TML-3977 makes it read each package's own version and level; release 8.0 waits for it. The design and its reasons are in the new decision record, `docs/architecture docs/adrs/ADR 336 - CI finds breaking and accidental API changes against the last release.md`. The contributor guide is `docs/Public API Compatibility.md`. ## What it finds today Over the 21 published packages that were in the last release, the type tests make 10,050 comparisons. (The 22nd, `@prisma/orm-better-auth`, has never been released, so there is nothing to compare it with.) - **35 breaks, all real.** They come from two pull requests merged since the last release, `8.0.0-rc.25`: one requires a column name shared by several joined tables to name its table (prisma#31150), and one refuses MongoDB names such as `__proto__` (prisma#31185). Both were deliberate breaking changes, so this pull request records all 35, with those two reasons. The records stop applying when the next release candidate is published, because it becomes the last release. - **123 undecided.** TypeScript cannot settle these, so they neither pass nor fail. They include the most used types: the SQL family's `orm` and `Collection`, and the Mongo query builder, which is too deep for the compiler (the job carries on). For those, the example apps' type tests are the check, as far as the apps use them. Nine of the 123 are in `@prisma/orm-family-sql` only because it declares two different symbols with the same name, `aggregateOperationsUnavailable`; TML-3973 renames one. - **171 not compared.** Almost all are generic types that evaluate to `never` when the check fills their type parameters, so a test of them would pass whatever they are. The check lists them and does not compare them. - **Manual QA on real packages:** with this pull request's rule, making `createCacheMiddleware`'s options required fails the job against `8.0.0-rc.25` (exit 1, `breaks 1 … — FAILS`), and the same package without the change passes. Earlier rounds showed that adding an optional parameter is not a break, and that changing a result type an example app asserts fails with the app, file and error. - **Cost.** The job takes 10 to 12 minutes. It runs beside the package tests, which take about as long, so the CI run is not noticeably longer. ## Accepting a break you mean Under each break, the job prints a record. The author pastes it into the package's `api-breaks.json` and replaces the `…` in `reason`: ```json {"path":".","export":"createCacheMiddleware","test":"value","kind":"break","lastRelease":"8.0.0-rc.25","fingerprint":"b0e322358c4a297e","reason":"A store must always be given."} ``` `test` is which of the export's comparisons failed, such as `value` for the function or constant itself and `type` for its type; the guide has a table of all seven. `kind` is `break` for a deliberate break, which the release's release notes must name, or `allowed` for a change the policy permits that is reported anyway (next section). The fingerprint covers the export's lines in `api.txt`, so a later change to the export makes the record stop applying. An example app's error has its own record in `examples/last-release-errors.json`, and a deleted package one in `packages/9-public/removed-packages.json`. Adding or removing a record is itself an API change, named in the description by the package (or `examples/<app>`), and the failure message says exactly what to write. ## How the type tests decide The method adapts the one used by Microsoft's Fluid Framework: one compile-time test per export of the previous release. The last release is installed from the registry beside the current build, and for each export a generated line asks TypeScript whether the current type can be assigned to the release's. Only that one direction is tested, and it tests each type in both of its roles. A type's own test treats it as something users receive and use. The test of each exported function that accepts the type treats it as something users supply. Suppose `CacheStore`, an interface users implement, gains a required `clear()`. `CacheStore`'s own test passes, because a type with more members fits where the old one did. But `createCacheMiddleware` accepts a `CacheStore`, and no longer accepts an old store without `clear()`, so the function's test fails. So nobody keeps a list of which interfaces users implement. The price is that the check cannot know which role a type really has. A change that is safe in its real role can fail the test for the other role: a wider return type on a method of an interface that users only implement fails the interface's own test. Someone records such a report with kind `allowed`. None of today's 35 breaks is of that kind. The declarations are rewritten as TypeScript reads them, so that private members and unique symbols, which TypeScript ties to one copy, compare across copies. A failure only counts once the release, compared with a second copy of itself, passes; otherwise TypeScript cannot relate the type across copies. **Names that carry a level.** An API that may still change has its maturity level at the start of its name: `ea_`, `preview_` or `rc_` (Early Access, Preview, Release Candidate), capitalised on a type or class, as in `Ea_Search`. A break in it is only reported. One exception: when an API is promoted, the release keeps the old name for the same thing, deprecated, until the next major version. So if release `8.2` exports `ea_foo` and release `8.3` adds `foo` with `export { foo as ea_foo }`, from `8.3` on `ea_foo` is held like `foo`, and removing it fails. A similar name alone does not count: an `ea_createClient` with its own declaration beside `createClient` stays Early Access. ## What the checks do not see Behaviour (runtime results, errors, command output), third-party types, the 123 undecided comparisons, the 171 exports that are not compared, result types the example apps do not use, and a few kinds of type change listed in the decision record, such as a property made `readonly`. Five further checks are their own tickets: TML-3965 (a GA package depends only on GA packages), TML-3966 (each package's committed `exports` field matches its build), TML-3967 (release notes name each recorded break), TML-3968 (dependency upgrades are named in the description), TML-3969 (a scheduled run comparing each package with itself, so false breaks stay visible). ## What is in the diff - `scripts/public-api/`: the test generator, the release lookup, the records, the example-app check, with tests and fixtures. - `.github/workflows/`: the `API compatibility` job in `ci.yml`, and the new `api-changes.yml` with its script. The description check writes to the job summary instead of commenting for a pull request from a fork, and passes in the merge queue. Only its job has `pull-requests: write`; there is no `pull_request_target`. - Review instructions for `api.txt` and the records, in `packages/9-public/AGENTS.md` and `.coderabbit.yml`; the decision record; the contributor guide. The project's planning folder, `projects/public-api-check/`, is deleted, since its lasting content is now in the decision record and the guide. ## API changes This pull request records the 35 breaks already on `main`, so these packages' `api-breaks.json` files are new. No `api.txt` changes. - `@prisma/orm-family-sql`, `@prisma/orm-postgres`, `@prisma/orm-mysql`, `@prisma/orm-mariadb`, `@prisma/orm-sqlite`, `@prisma/orm-extension-supabase`: records of the deliberate break in prisma#31150, where a column name that several joined tables share must name its table. - `@prisma/orm-family-mongo`: records of the deliberate break in prisma#31185, where a MongoDB contract refuses a field, relation or PSL enum named `__proto__`. ## Alternatives considered - **Comparing the text of the lists**, as Go does with its committed API files. A text diff shows what changed but not whether it is compatible: an added optional parameter and a removed one both change a line. Every changed line would need a person to judge it. - **API Extractor's reports as the committed lists**, as Angular does. For our packages they are about ten times the size of `api.txt`, and they too are compared as text. - **Fluid Framework's method unchanged.** Its helper erases function signatures, so in a test on our packages it missed every planted signature change. It also needs every interface tagged by hand. - **Type tests and example apps only, with no list**, as Drizzle, Kysely and Zod do. Nothing would notice an accidental export. - **A code owner reviewing every `api.txt` change** in place of the description check. It depends on one person noticing, and leaves no reason in the history. - **Compiling the example apps from this pull request's branch.** The pull request could change an app to fit its own break. Fixes TML-3933 Agent: hallandoates-87 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-prisma__orm
that referenced
this pull request
Nov 28, 2026
… that a fix ships in the next release, not as a patch to one package (prisma#31236) This pull request records two decisions about releasing Prisma 8. It changes documentation and one agent skill's instructions. It changes no code and releases nothing. **Decision 1: we do not publish a fix to one package alone.** A fix ships in the next release of all packages, cut early when the fix cannot wait. **Decision 2: cutting release 8.0 follows a written, nine-step procedure,** which is deleted once the release is out. ## At a glance: what release 8.0 looks like Today every Prisma 8 package is published as a release candidate, such as `8.0.0-rc.25`. At release 8.0 each package gets a version that shows how finished it is. The existing command already works this out: ```text $ node scripts/print-release-plan.ts 8.0.1 package level version npm tag @prisma/orm-postgres Generally Available 8.0.1 latest @prisma/orm-framework Generally Available 8.0.1 latest @prisma/orm-mysql Early Access 8.0.1-ea.0 latest ``` (Shortened; the real table has 22 rows and writes the levels as `ga` and `ea`.) Two things in that table need a word: - **Release 8.0 is published as `8.0.1`, never `8.0.0`.** A version such as `8.0.0-ea.0` would sort below the `8.0.0-rc.N` versions already on the registry, and package managers would keep installing an old release candidate. That was decided in prisma#31212. - **A package can be released before it is finished.** MySQL is at Early Access, which means it may still change in any release. A user then changes their `package.json` by hand, once: ```jsonc // before // after, with PostgreSQL "@prisma/orm-postgres": "8.0.0-rc.25" "@prisma/orm-postgres": "^8.0.1" // before // after, with MySQL "@prisma/orm-mysql": "8.0.0-rc.25" "@prisma/orm-mysql": "~8.0.1-ea.0" ``` ## Decision 1: a fix ships in the next release Suppose 8.3 is out and a bug is found in the PostgreSQL package. There are two ways to get the fix to users: - Publish `8.3.1` of that one package. - Cut the next release, 8.4, early. It contains the fix and everything else that has merged. We choose the second. We work on the expectation that anything on `main` can be released at any time, so cutting a release early is always possible. The first way needs machinery we would have to build and keep. `main` already holds work for 8.4, so `8.3.1` could not be published from `main`. It would need a branch per release, a way to copy fixes onto it, and a publish workflow that accepts other branches. **What it costs users.** A user of a finished package gets the fix by updating, as with any release, because their entries have a caret. A user of an unfinished package, such as MySQL, has entries that stay within one release. To get the fix they edit their entries to the next release, as they do for every release. If `main` ever stops being releasable at any time, the choice is revisited. The releasing page says so. This was already how the scripts behaved. What changes is that the releasing page states it as the policy, and the user page on versions no longer suggests that a fix arrives as `8.3.1`. ## Decision 2: the procedure for release 8.0 The releasing page had three sentences on cutting release 8.0. Checking them against the scripts turned up four ways the day would have gone wrong: - **The release skill could not do it.** The skill is the set of instructions an agent follows to prepare a release pull request. Asked for the version after `8.0.0-rc.25`, it answers `8.0.0-rc.26`. The procedure and the skill now say to set the target, `8.0.1`, by hand. - **Updating does not move users to release 8.0.** An exact entry such as `8.0.0-rc.25` never moves. An entry with a caret, `^8.0.0-rc.25`, is worse: it accepts `8.0.1` but not `8.0.1-ea.0`, because a version range matches a pre-release only of the same version number. That user's finished packages move and their MySQL package stays behind. So the release notes must give every user the entries shown above. - **A package published as Generally Available stays that way for all of Prisma 8.** That level is a promise not to break its users, and the release scripts refuse to lower it. The level of every package has to be right on the day. - **Dozens of pages say "Prisma 8 is a release candidate".** After the release each is wrong. The procedure, in `docs/oss/releasing.md`, has nine steps: 1. Print the table above and check it. 2. Be sure of every package's level. The step lists the six places a level is written. 3. Note what happens to the ParadeDB extension. It is the one package with version numbers of its own, `0.18.0` at release 8.0, so its users need their own line in the release notes. 4. Run the release skill with the target set to `8.0.1`. 5. Put the new `package.json` entries in the release notes. 6. Rewrite the pages that mention release candidates. The step gives the search and a table of the main pages. 7. Do a dry run of the publish workflow, compare it with the table, and merge. Merging publishes. 8. Mark the old `8.0.0-rc.N` versions as deprecated on the registry, with a message that points at the release notes. 9. Remove this procedure in the next pull request. A second, four-step procedure covers every release after 8.0. It is the same skill with nothing special. **The procedure has never been run.** Nobody has cut release 8.0. Step 7's dry run is its first real test. ## Three corrections in the same pull request They are here because each is a sentence or two about version ranges, found during the same work, and too small for a pull request of its own. - **The upgrade instructions for applications told an agent to write a caret at every step of an upgrade across several releases.** At the step to 8.1 it wrote `^8.1.0`, which also accepts 8.3, so the install could jump past the step. It now writes a caret only at the newest release, and `~8.1.0` otherwise, which stays within 8.1. - **The upgrade instructions for extension authors** had the same problem for the versions an extension is built and tested against. Those now always stay within the release of the step. - **The decision record on versions gains one rule.** A finished package can contain a function that is still marked unfinished by its name, such as `preview_search`. The rule is that no extension in this repository calls one. The release scripts already assumed this when they choose which versions an extension accepts. No such function exists today. The project plan is updated too. It now says what this work became and lists what was dropped: fix releases for one package, release branches, releases of an older major version, and a script that fetched upgrade instructions. ## How it was checked - **A separate agent checked every statement in the two procedures against the scripts, the workflow and the release skill, three times.** That is what found the four problems above. - **Three agents given only the releasing page read it as a maintainer cutting a release for the first time.** The first could not get through it. The third found small gaps, which are fixed. - The table is the real output of the command, and a test fixture pins it. - The link check passes. ## Alternatives considered - **Publish a fix as a patch of one package, from a branch per release.** This is the alternative to decision 1, and its cost is described there. It is the usual answer for a project that cannot release `main` at will. We can. - **Teach the release command to go from the release candidates to `8.0.1`.** It would save one hand-typed line, for a release that is cut once. - **A script that lists the versions to deprecate.** The registry's own command takes a version range, so one line per package does it. - **Stop requiring an upgrade guide for a release that has nothing to tell users.** The upgrade instructions that agents follow work out their steps from the guide folders, one per release, so a release without one would break that chain. The release skill already writes an empty guide in that case. Agent: keithrichards-58 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Clarified that in-repository extensions and integrations must use GA APIs from GA packages, while external extensions using below-GA APIs require same-minor version ranges. * Updated release guidance for 8.0 and later releases, including versioning, publishing, partial-publish retries, and release-specific steps. * Expanded versioning guidance for package-specific fixes and package versions within a release. * Updated upgrade instructions with release-specific version ranges and dependency guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> Co-authored-by: Claude Fable 5.2 <[email protected]>
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-prisma__orm
that referenced
this pull request
Nov 29, 2026
…sion, such as 8.0.1-ea.0, and a release stops if its committed versions are stale (prisma#31240) ## At a glance The `API compatibility` CI job installs the packages of our last release and checks that this pull request's build is still compatible with them. Today it installs every package at one version. After release 8.0 that breaks, because a release's packages no longer share a version: ```text Packages installed for the last release, tag v8.0.1 package today with this PR @prisma/orm-postgres 8.0.1 8.0.1 @prisma/orm-mysql 8.0.1 (none) 8.0.1-ea.0 @prisma/orm-extension-paradedb 8.0.1 (none) 0.18.0 (none): no such version on npm, so the install fails on every pull request. ``` **Decision:** the job reads each package's version from that package's own `package.json` at the last release's tag. To make that reliable, publishing a release now fails when the versions committed in the release differ from the ones the publish workflow is about to publish: ```text set-version.ts planned versions other than the committed ones for these packages: @prisma/orm-mysql: committed 8.0.0-rc.25, planned 8.0.1-ea.0 ``` ## Why versions differ from release 8.0 Every package is published today as the same release candidate, `8.0.0-rc.N`. From release 8.0 each package's version also shows how finished it is, its maturity level ([prisma#31212](prisma#31212), already on `main`). Release 8.0 is cut as `8.0.1`, not `8.0.0`, because `8.0.0-ea.0` would sort below the old release candidates. In it: - a finished (GA) package such as PostgreSQL is `8.0.1`; - an Early Access package such as MySQL is `8.0.1-ea.0`; - ParadeDB has a version line of its own and stays `0.18.0`. `packages/0-shared/publish-surface/src/levels.ts` declares each package's level, and `scripts/set-version.ts` turns the root version plus those levels into each package's version. Release candidates are unaffected, so nothing changes for users until release 8.0. Without this pull request, the first pull request after release 8.0 would look for `@prisma/[email protected]` and fail, and so would every pull request after it. The Prisma 8 GA release cannot ship with that. ## Where the job finds each version A release is made in two steps: 1. The release pull request runs `set-version.ts`, which writes each package's version into its `package.json`, and commits the files. 2. When it merges, the publish workflow runs `set-version.ts` again on that commit, publishes, and tags the commit `v<root version>`. So the `package.json` files at a release's tag hold the version each package was published at, and the job reads them there. Because the files come from the tag, a package that has since moved up a level is still compared at the version it had in that release. ## Why publishing now checks the versions Step 2 runs `set-version.ts` again, and it plans from the files and `levels.ts` as they are at that commit. On a correct release this changes nothing. It can change a version in two ways: - someone sets the root version by hand without running `set-version.ts`, so the committed files keep the old versions; - a change to `levels.ts` merges after the release pull request was prepared. Then the registry gets the new versions while the tag holds the old ones, and the job would compare against the wrong versions without failing. So the publish workflow gets one step after it sets the versions. On a publish to npm's `latest` tag, which every release uses, dry runs included, it fails if any published package's version changed. The message says what to do. Before the release pull request merges, commit the output of `set-version.ts` on its branch. After it merges, open a pull request that commits it, then run the publish workflow by hand from `main`. Development builds are not checked, because their versions differ from the committed ones on purpose. The same rules are written in `docs/oss/releasing.md`. ## Smaller changes in the job - **The install pins our own packages** to their versions at the tag. After release 8.0 our packages name each other by range (`~8.0.1`, `^8.0.1`), so without the pin one could resolve to a newer release than the one being compared. - **A package with no valid version at the tag fails the run.** Before, it was listed as "not checked" and the run passed, so a broken tag would hide every break in that package. - **The report shows a package's own version** next to its name where it differs from the release's. A deliberate break is still recorded in the package's `api-breaks.json` against the release, for example `"lastRelease": "8.0.1"`. `docs/Public API Compatibility.md` and the decision record on the API check describe the new lookup. The project's plan lists this work. It also says that a planned check in the `prisma` command-line tool is no longer needed: inside a project, the tool now runs the project's own copy of the ORM's toolchain, so the tool and the library cannot be on different releases. ## The risk to watch Today the job compares against a release candidate, where every package has the same version, so this pull request's own CI run does not exercise per-package versions or the new pins. Tests cover them with a real git repository and a stubbed registry, but no install of `8.0.1-ea.0` packages has run. The first real run is the first pull request after release 8.0. If it fails, the job fails loudly on that pull request with the package and version it could not install. The release procedure already asks for a dry run of the publish workflow before release 8.0 merges, and that dry run exercises the publish check. ## How it was checked - Tests were written first and failed on the old code. The touched test files pass. They cover: - a release-candidate tag; - a tag with GA, Early Access and own-version packages; - a package promoted between tags; - a missing version; - the install's pins; - the publish check, against a real git repository. - Three review agents with no part in writing the code read the branch: one for design, one for code, and one for the fixes. The third checked that running `set-version.ts` a second time on a release commit changes no version, for `8.0.0-rc.26`, `8.0.1`, `8.1.0` and `8.2.0`, ParadeDB included. So the publish check does not block a correct release. ## Not in this pull request All packages are released together, so the job compares them all at one tag. Work for packages released at different times is in [TML-3977](https://linear.app/prisma-company/issue/TML-3977), which can follow GA: - **Early Access breaks fail the job.** A break in an Early Access package such as MySQL still fails the job unless it is recorded as deliberate, as it does today. - **Records for a package with a version of its own.** ParadeDB is republished only when its own version changes. So at the next release a recorded break would be compared with the old release and look out of date. ParadeDB's team is taking it over, and it is planned to leave this repository before GA. ## Alternatives considered - **Work out each version from `levels.ts` at the tag.** This was the ticket's first proposal. Rejected because: - tags from before the levels have no `levels.ts`, so every old tag needs a fallback; - being exact would mean running each tag's own copy of `set-version.ts`'s rules; - it gives ParadeDB `0.18.0` even after a fix has made it `0.18.1`. - **Ask npm which candidate exists** (`8.0.1`, `8.0.1-ea.0`, …). Rejected: it depends on the registry at that moment and cannot find a package with a version of its own. - **Record the published versions in a separate file at release time.** Rejected: the committed `package.json` files at the tag are already that record. The publish check makes sure they match what was published. Closes [TML-3987](https://linear.app/prisma-company/issue/TML-3987). Agent: keithrichards-58 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Release Improvements** * Publishing a `latest` release now stops if committed package versions differ from the planned versions. * Public API compatibility checks use each package’s version at the selected release tag, including independently versioned packages. Reports identify package versions when they differ from the overall release version and check registry availability against each package’s released version. * **Documentation** * Updated release guidance with version-mismatch recovery steps and clarified checks for `latest` and `beta` publishes. * Clarified how release tags, package versions, and registry availability inform compatibility reports. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
From release 8.0, the version of each Prisma 8 package says how finished it is. This is what
prisma orm initwill write into an application'spackage.jsonon release 8.3. First for PostgreSQL, which will be Generally Available (GA):Then for MySQL, which will be at Early Access:
The suffix
-ea.0tells the user that the MySQL packages are at Early Access and may change in any release. A plain version tells them a package is GA and stays compatible until the next major version.This pull request makes the release scripts give every package its version, its ranges on our other packages and its npm dist-tag from its maturity level, and makes
initwrite the lines above. It also publishes release 8.0 as8.0.1, for a reason explained below. Nothing changes for users until release 8.0 is cut: until then every package is still published at the same8.0.0-rc.Nand names the others at that exact version.The packages in these examples
The first line of each example is the facade, the one package an application imports for its database. The next four are the platform packages the facade is built on: the framework, the family of databases (SQL), the database's own target package, and the toolchain the command-line commands come from.
initalso addsprisma, the command-line tool, which is published from another repository with its own copy of the toolchain. An extension, such as pgvector, is a package that adds to a database's features and is built on the same platform packages.Since #31204, the application lists the platform packages itself, and every one of our packages names the others as peer dependencies. That way the package manager installs one copy of each, and warns when the copies do not fit together.
How the ranges fit together
The packages of one release are tested together, so the facade accepts only its own minor of each platform package, as a peer:
@prisma/[email protected]asks for@prisma/orm-framework@~8.3.0.The PostgreSQL application writes a caret on every line, which accepts every later 8.x release. That does not contradict the facade's tilde. An update moves every line to 8.4 together, and the facade at 8.4 then asks for the platform packages at 8.4. If one line moved without the others, the facade's tilde would make the package manager warn.
The MySQL application writes a tilde on every line, even on the GA platform packages. A caret on
8.3.0-ea.0never selects8.4.0-ea.0, because a range only selects a pre-release of the version it names. So the facade stays in 8.3 on an update. If the platform lines had carets, they would move to 8.4 and leave the facade behind, which does not accept them.The cost falls on Early Access users: to move to the next minor, they edit every line by hand to
~8.4.0-ea.0and~8.4.0, then install.docs/oss/versioning.mdshows the edit. pnpm's and Yarn's update commands do not do it correctly.The decision
ADR 330 records it.
Four maturity levels, each defined by the least the maintainers do for a package at that level:
8.3.08.3.0-rc.08.3.0-preview.08.3.0-ea.0The Release Candidate level is new. It is not the same thing as today's release candidates,
8.0.0-rc.1to8.0.0-rc.N, which were numbers that every package shared before levels existed, whatever its state.The version carries the level. All our packages share the release number, which is the major and the minor, such as
8.3: release 8.3 publishes every package at8.3, changed or not. The rest of the version belongs to each package. A GA package has its own patch number, so a fix to it is8.3.1and no other package moves. A package below GA keeps its patch number and counts in its suffix, so a fix to it is8.3.0-ea.1, which a user's~8.3.0-ea.0still accepts. A level can go up at any release, and within a minor only up, because a version can only move forward.Each package declares its level in one place,
packages/0-shared/publish-surface/src/levels.ts. At release 8.0:ParadeDB is the one exception. It still lives in this repository, but another team will maintain it, so it has no level and its own version, starting at
0.18.0. It was published as0.16.0and0.17.0before, and a user's range on0.16or0.17must not pick up the new releases.A GA package may not depend on one of ours below GA, because its users would then get breaking changes through that dependency. The build fails if one does.
Release 8.0 is published as 8.0.1
If release 8.0 started at patch 0, every version below GA would sort below the old release candidates:
8.0.0-ea.0,8.0.0-preview.0and8.0.0-rc.0all come before8.0.0-rc.26. A user's~8.0.0-ea.0would then accept the old release candidates. In a trial on a local registry, Bun always installed an old one, and Yarn, npm and pnpm did in some cases.So release 8.0 starts every package at patch 1:
8.0.1,8.0.1-rc.0,8.0.1-preview.0or8.0.1-ea.0. GA packages start at8.0.1too, although they would not collide, so that one rule covers the whole release. The repository's version, the git tag and the GitHub release are8.0.1, so the number announced is the number installed. No package is ever8.0.0.This applies only to release 8.0, the one release that follows release candidates every package shared. From 8.1 on, every minor starts at
X.Y.0. The rule is in one function,rootVersionOfRelease, inrelease-plan.ts.Applications on a release candidate list our packages at an exact
8.0.0-rc.N, so nothing moves them to8.0.1by itself. Cutting release 8.0, with its upgrade instructions and the deprecation of the old release candidates, is the next pull request in this project.What the scripts compute
One function,
planReleaseinpackages/0-shared/publish-surface/src/release-plan.ts, gives every package its version, its range on each of our packages it names, and its dist-tag.scripts/set-version.tswrites them into the manifests, andscripts/check-publish-deps.mjsfails the build when a manifest's range differs from the plan.~8.3.0). An extension accepts any later release of a GA package (^8.3.0), so an extension built for 8.1 keeps working on 8.4. Nothing accepts more than one minor of a package below GA (~8.3.0-ea.0).latest. A release below GA also goes underlatestwhile the package has never been GA, so a plain install works. Otherwise it goes under a tag named after its level, such aspreview.Changes to
prisma orm initprismaline as the package manager writes it.--skip-install,initrefuses when an installed platform package is outside the range the facade requires. Its advice used to name a fix that did not work in some cases, for example "run install" when an override inpackage.jsonforced another version. It now gives a fix for each case: the package is not listed, listed but not installed, listed at another version or range, or listed through a reference such ascatalog:orworkspace:. Every advice ends by saying that an override, a resolution or the lockfile may be what pins the other version.--jsonoutput is unchanged. This project changes no JSON format.Docs
docs/oss/versioning.md) is rewritten as a page for users and extension authors: which versions are supported, the four levels by what a user can rely on, which packages are at which level, what stays compatible within a major and the four things that may still change, how to upgrade a GA application and one on a database below GA, the npm tags, and the ranges an extension lists.docs/oss/releasing.md) is new. It holds what the old page had for maintainers: who can publish, the root version, the release plan, the publish workflow and its checks, and the release procedures.levels.ts.ea_search,preview_searchorrc_search, orPreview_Searchfor a type and@preview_searchin PSL. A command-line flag, an environment variable and an error code carry no level.prismatool keeps its own version numbers. When it runs an ORM command it compares the toolchain it carries with the application's ORM packages, and stops when they are on different minors. That check is work for the tool and is not in this pull request.prisma-8skill's upgrade references and the extension docs tell an extension author how to number their package and which range to list.AGENTS.md.How it was checked
scripts/fixtures/release-plan/holds the plan the scripts print for the next release candidate, for8.0.1and for8.1.0: each package's level, version, tag and ranges.scripts/release-plan-workspace.test.tsfails when the scripts' output differs.planRelease, the version and tag scripts, the checks of upgrade instructions and release notes, and the linesinitwrites.8.0.1and8.1.0and served from a local registry, then tried under npm, pnpm, Yarn and Bun.initfor PostgreSQL wrote^8.0.1on every line, and for SQLite~8.0.1-ea.0on the facade and target and~8.0.1on the rest.8.0.1installed beside the8.1.0packages, and ParadeDB at0.18.0installed on both.init --skip-install's advice as written led to a passinginitunder every package manager.pnpm build, the typechecks and the public API check pass locally. CI runs the full test suites.Alternatives considered
unstable_, or an import path such as/preview, for an API that may change. Either is a second way to say a level, beside the version and the name.8.0.0-ea.0, with the old release candidates marked deprecated. Deprecation stops Yarn choosing an old release candidate, but not pnpm or Bun.8.0.0and Release Candidate packages carrying on the old8.0.0-rc.Ncounter. It keeps the number8.0.0, but needs a rule for each of the three groups, the last release candidate's counter as an input, and a special case for a package that moves up within the release.Agent: keithrichards-58
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
prisma orm initchecks installed peer packages against required versions or ranges and reports mismatches.Documentation