Repository navigation
The engine becomes an exact peer of the toolchain, and a bin-less package smokes its cli entry - #30009
Conversation
A product CLI package is a plugin to the CLI engine, and a plugin declares its host as a peer: npm resolves a peer against the ancestor, so exactly one engine exists in any tree it can assemble, and a version conflict fails at install time instead of silently resolving a second copy. The strategy is recorded in prisma-cli as ADR 0004 (docs/architecture/adrs/0004-engine-version-pinning.md); this is the prisma/prisma share of it. The peer stays EXACT during the rc line — the engine breaks its consumers deliberately — with ranges recorded there as the post-GA destination. The route is the manifest generator's own: @internal/cli moves the engine from dependencies to peerDependencies (keeping a devDependency so the workspace resolves it), and shell-build's validator then expects exactly that peer on the published @prisma/orm-toolchain manifest, which changes the same way. No generator changes were needed. The conformance check follows the strategy: the source-of-truth pin is now @internal/cli's peer, an engine appearing in any packed dependencies field is a new wrong-field finding, and agreement checks work as before across whatever fields declare the engine. One discovery while verifying, fixed here because the publish gate was red without it: #30005 retired the prisma-next bin but left the conformance check requiring bin entries, so check:conformance failed on main. A bin-less package's sandbox smoke now imports its published /cli entry in a fresh node instead — the anti-vacuity guarantee survives without demanding an executable nobody ships. Co-Authored-By: Claude Opus 5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe package manifests move ChangesEngine dependency and conformance
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to The change updates engine dependency resolution and adjusts conformance smoke behavior for a package without a binary entry; the supplied checks pass, so no actionable merge-blocking risk remains beyond normal review. Sequence Diagram(s)sequenceDiagram
participant runCheck
participant SandboxProcess
participant ORMToolchainCLI
runCheck->>SandboxProcess: Import `@prisma/orm-toolchain/cli`
SandboxProcess->>ORMToolchainCLI: Load CLI entry
ORMToolchainCLI-->>SandboxProcess: Exit status and output
SandboxProcess-->>runCheck: Success or bin-failed diagnostics
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@prisma/orm-extension-arktype-json
@prisma/orm-extension-middleware-cache
@prisma/orm-extension-paradedb
@prisma/orm-extension-pgvector
@prisma/orm-extension-postgis
@prisma/orm-extension-supabase
@prisma/orm-family-mongo
@prisma/orm-family-sql
@prisma/orm-framework
@prisma/orm-mongo
@prisma/orm-postgres
@prisma/orm-sqlite
@prisma/orm-target-mongo
@prisma/orm-target-postgres
@prisma/orm-target-sqlite
@prisma/orm-toolchain
commit: |
size-limit report 📦
|
#30009 gave a bin-less package a sandbox smoke by importing one hardcoded entry, @prisma/orm-toolchain/cli. The other 34 subpaths in the exports map are equally published and equally reachable, and nothing checks them: the import-purity sweep reads the imports inside packed files, so it cannot see an exports subpath whose target file never made it into the tarball. Every exported subpath is smoked now. Proven by deleting dist/emitter.mjs and running both versions against the same tarball: the check on main exits 0, this one exits 1 naming @prisma/orm-toolchain/emitter. The bin loop is untouched — a package that ships a bin still starts it. Only the bin-less path widens. The anti-vacuity rule moves with the subjects: a manifest with neither a bin nor an importable export is a finding. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
Before and after
Before,
@prisma/orm-toolchaincarried@prisma/cli-engineas an ordinary dependency:After, the engine is an exact peerDependency: npm resolves a peer against the ancestor, so exactly one engine exists in any tree it can assemble, and a version conflict fails at install time instead of resolving a second copy.
The decision
This is the prisma/prisma share of ADR 0004 (prisma-cli,
docs/architecture/adrs/0004-engine-version-pinning.md, operator-settled 2026-08-13): product CLI packages declare the engine as an exact peer the consolidated CLI satisfies; product libraries carry no engine relationship; ranges are the post-GA destination behind a written compatibility contract, not now — during the rc line the engine breaks its consumers deliberately, so the peer stays exact. No package split is needed here: applications never installorm-toolchaindirectly (its vite plugin reaches them as a forwarded export of@prisma/orm-postgres), so the toolchain already is the ORM's CLI package.How the change is routed
Through the manifest generator's own rules, not around them:
@internal/climoves the engine fromdependenciestopeerDependencies(keeping adevDependencyso the workspace resolves it for builds and tests), and shell-build's validator then expects exactly that peer on the published@prisma/orm-toolchainmanifest, which changes the same way.pnpm build— where the validator runs — passes unchanged.scripts/check-conformance.mjsfollows the strategy: the source-of-truth pin is now@internal/cli's peer, and an engine appearing in any packeddependenciesfield is a newwrong-fieldfinding, so a regression to the old shape fails the publish.Found red on main, fixed here
#30005 retired the
prisma-nextbin but left the conformance check requiring bin entries, sopnpm check:conformance— a publish blocker — currently fails onmainwith "the packed manifest has no bin entries". A bin-less package's sandbox smoke now imports its published/clientry in a fresh node instead: the anti-vacuity guarantee survives (a package whose entry cannot import fails loudly) without demanding an executable nobody ships.Verification
node --test scripts/check-conformance.test.mjs— 43/43 (3 new: the wrong-field finding, the bin-less entry smoke, the failing-entry finding).pnpm check:conformanceend to end — exit 0: packs all publishable packages, sweeps packed imports, runs the shipped orm validator over the hostile corpus, installs the toolchain tarball into the sandbox (the exact peer resolves from the registry), imports@prisma/orm-toolchain/cliin a fresh node, and every engine reference agrees at0.0.9.pnpm check:publish-deps— exit 0.pnpm build— exit 0.pnpm test:scripts— 77 failures that reproduce identically on a cleanorigin/maincheckout (upgrade-coverage and worktree-hygiene scripts, unrelated); this change adds 3 passing tests and no failures.The follow-up this enables
In prisma-cli, once composer's split package also carries the peer: the shell's conformance check evolves from pin-equality to peer-satisfaction and deletes its recorded exception list — the moment mismatches become impossible to ship rather than merely detected.
Alternatives considered
Hand-editing only the published manifest. The validator would reject it: expected peers are derived from the bundled internals, so the internal package's manifest is the source of truth — changing it is the sanctioned route.
A version range now. Removes the repin train, but promises compatibility the rc-line engine deliberately does not offer. Recorded in ADR 0004 as the post-GA destination.
Keeping the bin requirement and exempting the toolchain. An exemption list for a package that will never have a bin again is a permanent exception; smoking the published entry asserts something real instead.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests