Skip to content

chore(cli-engine): the Management API SDK becomes a peer dependency - #236

Merged
wmadden merged 1 commit into
mainfrom
chore/engine-peers-management-api-sdk
Aug 26, 2026
Merged

chore(cli-engine): the Management API SDK becomes a peer dependency#236
wmadden merged 1 commit into
mainfrom
chore/engine-peers-management-api-sdk

Conversation

@wmadden-electric

Copy link
Copy Markdown
Contributor

Purpose of change

@prisma/cli-engine hands the shell a Management API client through ctx.api, and re-exports the SDK's type for it:

// packages/cli-engine/src/management-api.ts
/** The SDK's typed client, re-exported so consumers never import
 *  @prisma/management-api-sdk directly. */
export type ManagementApiClient = SdkClient;

That type belongs to @prisma/management-api-sdk, and until now the engine held that package as an ordinary dependency at an exact version — as did packages/cli and packages/prisma, each independently:

cli-engine  dependencies: @prisma/management-api-sdk = 1.55.0
cli         dependencies: @prisma/management-api-sdk = 1.55.0
prisma      dependencies: @prisma/management-api-sdk = 1.55.0

A package whose public API carries another package's types has a shared type surface. Held as three private copies, the three pins can disagree — and when they disagree, the types stop being the same type. Moving only the shell to a newer SDK produces this, roughly fifteen times over:

src/commands/branch/list.ts(80,9): error TS2345:
  Argument of type 'Client<paths@1.55.0>' is not assignable to
  parameter of type 'Client<paths@1.69.0>'

So the SDK version could only ever move in all three manifests at once. One of the three is the engine, and a changed engine needs a new engine version, and both @prisma/composer-cli and @prisma/orm-toolchain peer-pin the engine exactly — so an SDK bump, a routine act, cost a three-repo release sequence every time. That is what blocked #235 from taking @prisma/management-api-sdk@1.69.0, the version @prisma/compute-sdk@0.42.0 asks for.

What's changed

The engine now declares the SDK the way a shared type surface should be declared:

  • cli-engine: @prisma/management-api-sdk moves from dependencies to peerDependencies at ^1.55.0 — a range, not a pin, because the consumer chooses. It stays in devDependencies at the version the workspace supplies so the package still builds and tests standalone.
  • cli and prisma keep it as a real dependency and move to 1.69.0. They are the binaries; they install the one copy everyone binds to. All three packages now resolve @prisma+management-api-sdk@1.69.0, and pnpm peers check no longer reports compute-sdk's unmet peer.
  • Engine 0.2.30.3.0, the pre-1.0 breaking slot: consumers of the published engine must now supply the SDK themselves.

After this, moving the SDK touches the two app manifests and nothing else — no engine version, no family republish.

The transition this starts

The engine must publish before a family can peer it, so both families still declare 0.2.3 and conformance reports six pin mismatches. packages/cli/scripts/conformance.ts has a place for exactly this, and its comment prescribes the sequence; both entries are filled in with a removeWhen:

0 failing, 6 allowed, 5 subject(s) checked

Every one prints in full with its reason, including the two copies of the engine that resolve in the sandbox install — the expected shape of a transition rather than a defect. The remaining steps, recorded in the deferred ledger: engine 0.3.0 publishes → both families republish peering 0.3.0 → a release PR here pins them and deletes the two exceptions, restoring the empty list.

Verified: pnpm typecheck, pnpm --filter @prisma/cli test (958 passed), pnpm check:conformance (0 failing), node scripts/check-engine-version.mjs.

Alternatives considered

  • Relax @prisma/compute-sdk's peer floor back to ^1.44.0. This was my first proposal and it was wrong. That floor is the one peer dependency in the picture that already works: it correctly reported that this repo was pinned behind. Widening it would have silenced an accurate warning and left the actual cause — three private copies of a shared type — in place.
  • Bump all three manifests to 1.69.0 and take the release chain. Fixes today's mismatch and leaves the next one to cost exactly the same. The same engine bump buys the structural fix instead.
  • A pnpm override forcing one SDK version. Makes the workspace green while the published engine still declares a version it does not get, so anyone installing @prisma/cli-engine alongside @prisma/compute-sdk reproduces the two-copy break. It hides the problem precisely where it would be felt.
  • An exact peer (1.69.0) rather than a range. Recreates the lockstep-bump problem one layer up: every SDK release would force an engine release again.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 3 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2beeb9af-d5e4-4569-8841-8d1c075914cd

📥 Commits

Reviewing files that changed from the base of the PR and between bc502d1 and 3beadca.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • .drive/projects/prisma-cli-v8/deferred.md
  • packages/cli-engine/package.json
  • packages/cli/package.json
  • packages/cli/scripts/conformance.ts
  • packages/prisma/package.json

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Aug 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/@prisma/cli@236
npx https://pkg.pr.new/@prisma/cli-engine@236

commit: 3beadca

@wmadden
wmadden merged commit 1dd27c6 into main Aug 26, 2026
14 checks passed
@wmadden
wmadden deleted the chore/engine-peers-management-api-sdk branch August 26, 2026 07:09
wmadden pushed a commit to prisma/orm that referenced this pull request Aug 26, 2026
…ne@0.3.0 (#30137)

## Release: 8.0.0-rc.7 → 8.0.0-rc.8

This is the routine release PR per
[docs/oss/versioning.md](https://github.com/prisma/prisma/blob/main/docs/oss/versioning.md).
It bumps every workspace package to 8.0.0-rc.8 and moves every
`@prisma/cli-engine` pin from 0.2.3 to 0.3.0.

The engine change: `@prisma/cli-engine@0.3.0` declares
`@prisma/management-api-sdk` as a peer dependency (`^1.55.0`) instead of
a regular dependency
([prisma/prisma-cli#236](prisma/prisma-cli#236)).
The `prisma` CLI shell supplies the SDK at runtime. In this repo pnpm
resolves the peer to 1.61.0 in the lockfile.

Review surface:
[docs/releases/v8.0.0-rc.8.md](https://github.com/prisma/prisma/blob/release/8.0.0-rc.8/docs/releases/v8.0.0-rc.8.md)
is the release notes file that becomes the GitHub Release body. The
matching `CHANGELOG.md` entry and the `8.0.0-rc.7-to-8.0.0-rc.8` upgrade
recipes are included.

**Merging this PR ships the release**: the push to `main` carries the
bumped root `version`, the `Publish to npm` workflow detects the change
and publishes 8.0.0-rc.8 under `latest`, creates a pre-release GitHub
Release from the notes file, then publishes `8.0.0-rc.8-dev.1` under
`dev`.

Local verification: `check:release-notes` (PR mode),
`check:upgrade-coverage`, and `test:scripts` pass; the CLI tooling
package's typecheck and its 1436 tests pass against the new engine.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added migration-model guidance and an upgrade recipe for Prisma
8.0.0-rc.8.
* Added safeguards for planning migrations against existing migrations
on empty databases.
* **Bug Fixes**
* Improved migration planning and corrected structured error links,
Windows file URIs, and development release tags.
* **Documentation**
* Updated Prisma 8 release and upgrade guidance, including CLI tooling
requirements.
* **Chores**
  * Published the 8.0.0-rc.8 release across packages and examples.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
wmadden pushed a commit that referenced this pull request Aug 26, 2026
8.0.0-rc.10 → 8.0.0-rc.11. This is the final step of the engine-0.3.0
release chain (see
[docs/oss/versioning.md](../blob/main/docs/oss/versioning.md) and
[release automation](../blob/main/docs/oss/release-automation.md)).

What this release ships:

- **@prisma/cli-engine 0.3.0** (already published by #236's merge):
`@prisma/management-api-sdk` becomes a peer dependency, so one copy of
the SDK's client type serves the engine and the shell, and future SDK
bumps no longer force a three-repo release chain.
- **Product pins move to the versions released against engine 0.3.0**:
`@prisma/orm-toolchain` 8.0.0-rc.7 → 8.0.0-rc.8 (prisma/orm#30137)
and `@prisma/composer-cli` 0.14.0 → 0.15.0 (prisma/composer#263, which
also lifts the ORM family from rc.4 to rc.8 and unblocks `create-prisma`
scaffolds).
- **The conformance exception list is empty again.** #236 recorded two
transition exceptions (families still peering engine 0.2.3); both
families have republished peering 0.3.0, so this PR deletes them.
`PUBLISH_CHANNEL=release pnpm check:conformance` reports: 5 subjects
checked, nothing to report.

Local verification: build, typecheck (9/9), `@prisma/cli` tests (960
passed, 1 skipped), `check:grammar`, and release-channel conformance all
green.

Merging this PR publishes `prisma@8.0.0-rc.11` and
`@prisma/cli@8.0.0-rc.11` under `latest` and creates the matching
pre-release GitHub Release.

Post-merge follow-up (operator): `npm dist-tag add
@prisma/cli-engine@0.3.0 latest` — the engine published under `dev` (its
version landed via a routine main push), and the release run treats an
already-published engine version as done, so the tag does not move on
its own.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
wmadden-electric added a commit that referenced this pull request Aug 26, 2026
Main released engine 0.3.0 today carrying the SDK-peer change (#236),
with composer-cli 0.15.0 and orm-toolchain 8.0.0-rc.8 peering it and
the conformance exceptions emptied (#239). This branch's engine work —
the config chain and the defineConfig alias removal — therefore ships
as 0.4.0. The conformance transition exceptions return, naming the
pins the transition actually has: families peer 0.3.0, shell 0.4.0.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants