Repository navigation
chore: upgrade Prisma Next to the @prisma/* 8.0.0-rc.1 packages - #212
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
Summary by CodeRabbit
WalkthroughThe pull request migrates examples and Prisma Cloud packages from 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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 |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/1-prisma-cloud/1-extensions/target/src/preflight.ts`:
- Around line 273-279: Update the extension-pack lookup in the preflight
validation around resolvePrismaNextConfig to require both requirement.packId and
requirement.headHash matching the pack’s contractSpace.headRef.hash. Preserve
the existing missing-pack error behavior for either an absent pack or a hash
mismatch, and add coverage for a pack ID whose configured head hash differs from
the required head.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 63030fc8-504f-45ed-ac5b-d8ab772df3af
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (92)
docs/design/90-decisions/ADR-0022-data-deps-carry-a-prisma-next-contract.mdexamples/auth/contract.d.tsexamples/auth/contract.jsonexamples/auth/migrations/app/20260723T0709_init/end-contract.jsonexamples/auth/migrations/app/20260723T0709_init/migration.jsonexamples/auth/migrations/app/20260723T0709_init/migration.tsexamples/auth/migrations/auth/0001_init/migration.jsonexamples/auth/migrations/auth/0001_init/ops.jsonexamples/auth/migrations/auth/refs/head.jsonexamples/auth/migrations/snapshots/0c0734babd6eeb868fee1f281ca96963022475611560e9f170f465daa35f8599/contract.d.tsexamples/auth/migrations/snapshots/0c0734babd6eeb868fee1f281ca96963022475611560e9f170f465daa35f8599/contract.jsonexamples/auth/migrations/snapshots/6bbd4dc1c19c8aa5e0d60c9755e0f8ea07ba1c01d20c48cf3aa7226e4ee7d33f/contract.d.tsexamples/auth/migrations/snapshots/6bbd4dc1c19c8aa5e0d60c9755e0f8ea07ba1c01d20c48cf3aa7226e4ee7d33f/contract.jsonexamples/auth/package.jsonexamples/auth/prisma-next.config.tsexamples/pn-widgets/contract.d.tsexamples/pn-widgets/contract.jsonexamples/pn-widgets/migrations/app/20260711T1921_init/end-contract.jsonexamples/pn-widgets/migrations/app/20260711T1921_init/migration.jsonexamples/pn-widgets/migrations/app/20260711T1921_init/migration.tsexamples/pn-widgets/migrations/app/20260711T1921_init/ops.jsonexamples/pn-widgets/migrations/snapshots/2c0c3445737906d85590514e3cec242919c12f8112346c2cebe74e681d65f0f0/contract.d.tsexamples/pn-widgets/migrations/snapshots/2c0c3445737906d85590514e3cec242919c12f8112346c2cebe74e681d65f0f0/contract.jsonexamples/pn-widgets/package.jsonexamples/pn-widgets/prisma-next.config.tsexamples/store/modules/catalog/contract.d.tsexamples/store/modules/catalog/contract.jsonexamples/store/modules/catalog/migrations/app/20260713T1212_init/end-contract.jsonexamples/store/modules/catalog/migrations/app/20260713T1212_init/migration.jsonexamples/store/modules/catalog/migrations/app/20260713T1212_init/migration.tsexamples/store/modules/catalog/migrations/app/20260713T1212_init/ops.jsonexamples/store/modules/catalog/migrations/snapshots/6e17ba1a02b94d229e945c92406158ed240eeb2afb84ab890413c4b0d1774a16/contract.d.tsexamples/store/modules/catalog/migrations/snapshots/6e17ba1a02b94d229e945c92406158ed240eeb2afb84ab890413c4b0d1774a16/contract.jsonexamples/store/modules/catalog/package.jsonexamples/store/modules/catalog/prisma-next.config.tsexamples/store/modules/orders/contract.d.tsexamples/store/modules/orders/contract.jsonexamples/store/modules/orders/migrations/app/20260713T1212_init/end-contract.jsonexamples/store/modules/orders/migrations/app/20260713T1212_init/migration.jsonexamples/store/modules/orders/migrations/app/20260713T1212_init/migration.tsexamples/store/modules/orders/migrations/app/20260713T1212_init/ops.jsonexamples/store/modules/orders/migrations/snapshots/eee8ad6db4dca6d22c79a724f3d2a6086ffe08fd32b8b778dd2d0d6c464b25b4/contract.d.tsexamples/store/modules/orders/migrations/snapshots/eee8ad6db4dca6d22c79a724f3d2a6086ffe08fd32b8b778dd2d0d6c464b25b4/contract.jsonexamples/store/modules/orders/package.jsonexamples/store/modules/orders/prisma-next.config.tspackages/1-prisma-cloud/1-extensions/target/package.jsonpackages/1-prisma-cloud/1-extensions/target/src/__tests__/fixtures/gadget-contract/emitted/contract.d.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/fixtures/gadget-contract/emitted/contract.jsonpackages/1-prisma-cloud/1-extensions/target/src/__tests__/fixtures/gadget-contract/source/prisma-next.config.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/fixtures/packed-contract/pack.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/fixtures/packed-contract/source/contract.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/fixtures/packed-contract/source/prisma-next.config.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/fixtures/widget-contract/emitted/contract.d.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/fixtures/widget-contract/emitted/contract.jsonpackages/1-prisma-cloud/1-extensions/target/src/__tests__/fixtures/widget-contract/source/contract.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/fixtures/widget-contract/source/prisma-next.config.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/invariants.test.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/pack-preflight.test.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/pn-config.test.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/pn-extension-packs.integration.test.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/pn-target-ref.test.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/prisma-next-migrate.integration.test.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/prisma-next.integration.test.tspackages/1-prisma-cloud/1-extensions/target/src/__tests__/prisma-next.test.tspackages/1-prisma-cloud/1-extensions/target/src/descriptors/prisma-next.tspackages/1-prisma-cloud/1-extensions/target/src/pn-config.tspackages/1-prisma-cloud/1-extensions/target/src/pn-migration-resource.tspackages/1-prisma-cloud/1-extensions/target/src/preflight.tspackages/1-prisma-cloud/1-extensions/target/src/prisma-next-migrate.tspackages/1-prisma-cloud/1-extensions/target/src/prisma-next.tspackages/1-prisma-cloud/1-extensions/target/src/required-pack-head.tspackages/1-prisma-cloud/2-shared-modules/auth/package.jsonpackages/1-prisma-cloud/2-shared-modules/auth/prisma-next.config.tspackages/1-prisma-cloud/2-shared-modules/auth/src/__tests__/barrel-invariants.test.tspackages/1-prisma-cloud/2-shared-modules/auth/src/__tests__/fixtures/empty-app/emitted/contract.d.tspackages/1-prisma-cloud/2-shared-modules/auth/src/__tests__/fixtures/empty-app/source/prisma-next.config.tspackages/1-prisma-cloud/2-shared-modules/auth/src/__tests__/pack-conformance.integration.test.tspackages/1-prisma-cloud/2-shared-modules/auth/src/execution/empty-app-contract.jsonpackages/1-prisma-cloud/2-shared-modules/auth/src/execution/local-schema.tspackages/1-prisma-cloud/2-shared-modules/auth/src/pack/contract.d.tspackages/1-prisma-cloud/2-shared-modules/auth/src/pack/contract.jsonpackages/1-prisma-cloud/2-shared-modules/auth/src/pack/contract.prismapackages/1-prisma-cloud/2-shared-modules/auth/src/pack/index.tspackages/1-prisma-cloud/2-shared-modules/auth/src/pack/migrations/0001_init/migration.jsonpackages/1-prisma-cloud/2-shared-modules/auth/src/pack/migrations/0001_init/ops.jsonpackages/1-prisma-cloud/2-shared-modules/auth/tsdown.config.tspackages/1-prisma-cloud/2-shared-modules/cron/tsdown.config.tspackages/1-prisma-cloud/2-shared-modules/email/tsdown.config.tspackages/1-prisma-cloud/2-shared-modules/storage/tsdown.config.tspackages/1-prisma-cloud/2-shared-modules/streams/tsdown.config.tspackages/9-public/composer-prisma-cloud/package.jsonscripts/publish-packages-utils.test.mjs
💤 Files with no reviewable changes (4)
- examples/auth/migrations/app/20260723T0709_init/end-contract.json
- examples/store/modules/orders/migrations/app/20260713T1212_init/end-contract.json
- examples/pn-widgets/migrations/app/20260711T1921_init/end-contract.json
- examples/store/modules/catalog/migrations/app/20260713T1212_init/end-contract.json
… just the pack id `runPackPreflight` looked the pack up by id and stopped there, so a database whose config listed the pack at a different `contractSpace.headRef.hash` passed. The migration step would then take the database to the configured head while the service is typed against a different one — the exact case the preflight exists to catch, since wireability deliberately says yes to every required head. Five places already described the behaviour the code did not have: the function doc, the auth README, the test file header, a test name, and the `RequiredPackHeadContract` doc comment. The test named for it passed vacuously. An absent pack keeps its existing error; a head mismatch gets its own, naming both hashes. Raised by CodeRabbit on #212; the gap predates that PR. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@packages/1-prisma-cloud/1-extensions/target/src/__tests__/pack-preflight.test.ts`:
- Around line 106-116: Add a test alongside the existing pack head-mismatch case
that configures the listed pack without a contractSpace, invokes
runPackPreflight, and asserts rejection includes the expected “(no contract
space)” text. Use the existing graphWith and pack identifiers/helpers, while
preserving the current coverage and behavior for packs with a contract space.
In `@scripts/lint-contract-snapshots.mjs`:
- Around line 54-61: Update the grouping logic in the contract snapshot scan so
a valid contract.json is recorded even when its sibling contract.d.ts is
missing, using an explicit absent-types marker rather than continuing. Extend
the group validation to fail when the same canonical contract group contains
both members with types and members without, while preserving existing handling
for invalid storageHash values.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 149116dd-3a47-4878-93d8-d975aa0f41ee
📒 Files selected for processing (10)
examples/auth/migrations/snapshots/0c0734babd6eeb868fee1f281ca96963022475611560e9f170f465daa35f8599/contract.d.tsexamples/auth/migrations/snapshots/6bbd4dc1c19c8aa5e0d60c9755e0f8ea07ba1c01d20c48cf3aa7226e4ee7d33f/contract.d.tsexamples/pn-widgets/migrations/snapshots/2c0c3445737906d85590514e3cec242919c12f8112346c2cebe74e681d65f0f0/contract.d.tsexamples/store/modules/catalog/migrations/snapshots/6e17ba1a02b94d229e945c92406158ed240eeb2afb84ab890413c4b0d1774a16/contract.d.tsexamples/store/modules/orders/migrations/snapshots/eee8ad6db4dca6d22c79a724f3d2a6086ffe08fd32b8b778dd2d0d6c464b25b4/contract.d.tspackage.jsonpackages/1-prisma-cloud/1-extensions/target/src/__tests__/pack-preflight.test.tspackages/1-prisma-cloud/1-extensions/target/src/preflight.tsscripts/lint-contract-snapshots.mjsscripts/lint-orm-pins.mjs
…dary
The 0.17 config key rename went past `resolvePrismaNextConfig` into Composer's
own types, which was a step too far. `extensions` is already Composer's word for
what a `prisma-composer.config.ts` lists (`prismaCloud()`, `nodeBuild()`), and
`1-extensions/` is a layer name — so the rename left one word meaning two
different things in one codebase, with the element type still `PnExtensionPack`
and every lambda parameter still `pack`.
Prisma Next's word now appears in exactly the two lines that talk to Prisma
Next: `config.extensions ?? []` where the config is read, and
`createPostgresControlClient({ extensions: extensionPacks })` where the client is
built. Everything Composer owns is `extensionPacks` again. Error text still says
`prisma-next.config.ts extensions`, because that is the key the user typed.
Also restores the fixture comment that recorded the translation — it had
degenerated to "`extensions` … lands in the loaded config as `extensions`" — and
replaces a `toThrow(/extensions/)` assertion with a phrase from the message it
means to match, since `extensions` on its own is a common word.
Raised by the architect pass on #212.
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
… peer dependency Composer's published package now requires the application to install `@prisma/orm-postgres` rather than installing it itself. That is a change to the install contract, so it is a decision, and it was recorded only as an edited bullet in ADR-0022's consequences list — the wrong place to look for it and the wrong weight. ADR-0046 states it with its reasoning: Composer registers an extension pack against the application's copy of the target, and two copies of a shell in one tree means two codec and operation registries and two class identities, so a value from one is rejected by the other with nothing to detect it. A peer turns that combination into an install failure. It also records what the earlier bullet understated — `/auth/pack` needs the peer at runtime too, not just `/prisma-next`, because the built pack verifies itself against its own contract through `@prisma/orm-postgres/family-contract/canonicalization-hooks`. ADR-0022's bullet now states the requirement and points here for how it is expressed. Raised by the architect pass on #212. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
`lint-contract-snapshots` skipped any `contract.json` with no emitted types beside it. So deleting a snapshot's `contract.d.ts` dropped it from its group, the group fell below the two members a comparison needs, and the check passed — silently missing the drift class it exists to catch. Copies with no types are now recorded rather than skipped, and a group that holds both a member with types and one without fails, naming the copy that lost them. Verified by deleting a snapshot's types file: the check now fails. Also covers the preflight's `(no contract space)` branch, which had no test. A pack declaring no `contractSpace` carries no head, so it can never satisfy a required one; the fixture gains a second pack and config for exactly that shape, and the test fails if the message degrades to printing `undefined`. Both raised by CodeRabbit on #212. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
The `@prisma-next/*` scope is retired. Every consuming package now names a published shell (ADR 242): the example apps take the single `@prisma/orm-postgres` facade, and the tooling/extension packages add `@prisma/orm-toolchain` for the config loader, CLI and migration tools. `@prisma/composer-prisma-cloud` declares the facade as a peer dependency so an app cannot end up with two copies of the ORM. Applied the 0.16 -> 0.17 upgrade instructions: bare-hex content hashes (the `sha256:` prefix is gone everywhere, including test literals), migration contract snapshots folded into the content-addressed `migrations/snapshots/<hex>/` store, `extensionPacks` -> `extensions`, `outputPath` -> `output`, and PostgreSQL native types authored in type position (`DateTime @db.Timestamptz` -> `Timestamptz`). Every contract space was re-emitted and its migrations re-anchored to the new hashes. The auth pack schema is unchanged; only its contract hash moved, so its shipped init migration was regenerated against the new head. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
Bumps every `@prisma/orm-*` pin from 0.17.0 to 8.0.0-rc.1 (npm `latest`). The one breaking change in this transition — aggregate results now decode through the codec their target declares, so `count()` is a `bigint` — needs no source edits here: nothing in this repo calls an aggregate, a groupBy, or an include reducer. Regenerating the contracts adds the `AggregateTypes` block the ORM and SQL builder resolve aggregate result types from. Every storage hash is unchanged, so no migration was re-anchored. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
… just the pack id `runPackPreflight` looked the pack up by id and stopped there, so a database whose config listed the pack at a different `contractSpace.headRef.hash` passed. The migration step would then take the database to the configured head while the service is typed against a different one — the exact case the preflight exists to catch, since wireability deliberately says yes to every required head. Five places already described the behaviour the code did not have: the function doc, the auth README, the test file header, a test name, and the `RequiredPackHeadContract` doc comment. The test named for it passed vacuously. An absent pack keeps its existing error; a head mismatch gets its own, naming both hashes. Raised by CodeRabbit on #212; the gap predates that PR. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…stay in step The 8.0.0-rc.1 re-emit added the `AggregateTypes` block to every emitted `contract.d.ts` without moving any storage hash. Nothing re-anchored, so all five `migrations/snapshots/<hex>/contract.d.ts` entries kept their 0.17-era types — and `migration plan` reads the store copy, so those stale types are what a regenerated migration would import. `migration check` does not look at them. Two checks so this cannot drift again, both wired into `lint:deps`: - `lint-contract-snapshots` requires every committed copy of one contract to carry the same emitted types. It groups by canonical contract content rather than by storage hash, because the hash covers the `storage` subtree alone and two genuinely different contracts can share one. - `lint-orm-pins` requires every `@prisma/orm-*` spec to be one exact version, and all of them the same version. `check-publish-deps` enforces exact pins only for packages this workspace publishes, so the shells went unchecked — and a range on the facade peer would reintroduce the two-copies split that peer exists to prevent. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
The Lint job checks formatting; my local run reported the error inside a truncated diagnostic list and I read only the summary line. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…dary
The 0.17 config key rename went past `resolvePrismaNextConfig` into Composer's
own types, which was a step too far. `extensions` is already Composer's word for
what a `prisma-composer.config.ts` lists (`prismaCloud()`, `nodeBuild()`), and
`1-extensions/` is a layer name — so the rename left one word meaning two
different things in one codebase, with the element type still `PnExtensionPack`
and every lambda parameter still `pack`.
Prisma Next's word now appears in exactly the two lines that talk to Prisma
Next: `config.extensions ?? []` where the config is read, and
`createPostgresControlClient({ extensions: extensionPacks })` where the client is
built. Everything Composer owns is `extensionPacks` again. Error text still says
`prisma-next.config.ts extensions`, because that is the key the user typed.
Also restores the fixture comment that recorded the translation — it had
degenerated to "`extensions` … lands in the loaded config as `extensions`" — and
replaces a `toThrow(/extensions/)` assertion with a phrase from the message it
means to match, since `extensions` on its own is a common word.
Raised by the architect pass on #212.
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
… peer dependency Composer's published package now requires the application to install `@prisma/orm-postgres` rather than installing it itself. That is a change to the install contract, so it is a decision, and it was recorded only as an edited bullet in ADR-0022's consequences list — the wrong place to look for it and the wrong weight. ADR-0046 states it with its reasoning: Composer registers an extension pack against the application's copy of the target, and two copies of a shell in one tree means two codec and operation registries and two class identities, so a value from one is rejected by the other with nothing to detect it. A peer turns that combination into an install failure. It also records what the earlier bullet understated — `/auth/pack` needs the peer at runtime too, not just `/prisma-next`, because the built pack verifies itself against its own contract through `@prisma/orm-postgres/family-contract/canonicalization-hooks`. ADR-0022's bullet now states the requirement and points here for how it is expressed. Raised by the architect pass on #212. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
`lint-contract-snapshots` skipped any `contract.json` with no emitted types beside it. So deleting a snapshot's `contract.d.ts` dropped it from its group, the group fell below the two members a comparison needs, and the check passed — silently missing the drift class it exists to catch. Copies with no types are now recorded rather than skipped, and a group that holds both a member with types and one without fails, naming the copy that lost them. Verified by deleting a snapshot's types file: the check now fails. Also covers the preflight's `(no contract space)` branch, which had no test. A pack declaring no `contractSpace` carries no head, so it can never satisfy a required one; the fixture gains a second pack and config for exactly that shape, and the test fails if the message degrades to printing `undefined`. Both raised by CodeRabbit on #212. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
0e55ecc to
6ce6339
Compare
Prisma Next moved into the
prisma/prismamonorepo and its npm packages were renamed and regrouped. This upgrades Composer from@prisma-next/*0.16.0 to@prisma/orm-*8.0.0-rc.1, following theprisma-next-upgradeandprisma-8-extension-upgradeskills from that repo. Two commits, one per release step: 0.16 → 0.17, then 0.17 → 8.0.0-rc.1.What the rename means for us
The old scope published one npm package per internal package. From 0.17 there are 16 published
@prisma/orm-*"shells", and each old package became a subpath of exactly one of them. An application depends on a single database facade; a package that extends the framework depends on the platform shells (ADR 242).Composer is both kinds of consumer, so the manifests split:
examples/*(apps)@prisma/orm-postgresonly — the facade carries the CLI bin and republishes every surface an app reaches@internal/prisma-cloud,@internal/auth@prisma/orm-postgres+@prisma/orm-toolchain(config loader, CLI, migration tools)@prisma/composer-prisma-cloud@prisma/orm-toolchainas a dependency;@prisma/orm-postgresas a peer dependencyThe peer dependency is the one deliberate change of shape.
@prisma/composer-prisma-cloudships an extension pack that consumers register in their ownprisma-next.config.ts, and the pack is registered against the app's copy of the target. A hard dependency would let an app upgrade the facade without upgrading Composer and end up with two copies of the ORM — the codec and operation registries silently diverge andinstanceofstops holding. As a peer, that combination fails to install instead. This is what the extension-author upgrade skill prescribes and what Prisma's own packs (@prisma/orm-extension-pgvectorand friends) do. ADR-0022's consequences section is updated to say so.Import specifiers follow the same split —
@prisma-next/sql-contract/typesbecomes@prisma/orm-postgres/family-contract/types,@prisma-next/config-loaderbecomes@prisma/orm-toolchain/config-loader, and so on. The emitter independently produced exactly the same facade specifiers when the contracts were regenerated, which is a good cross-check: emission reads each project's own manifest to decide which names generated code may carry.Breaking changes applied
Content hashes are bare hex. The
sha256:prefix is gone from every surface and loaders now reject the prefixed form. The skill's codemod handled the committed migration trees; test literals and one per-space contract snapshot the codemod does not reach were done by hand.migrationHashvalues change because the hashed bytes embed the now-barefrom/to.Migration contract snapshots moved into a content-addressed store. The per-package
end-contract.json/.d.tssiblings and the per-space head copy fold intomigrations/snapshots/<hex>/, one entry per distinct contract. Done withscripts/migrate-migrations-layout.mjsfrom theprisma/prismacheckout.extensionPacks→extensions, in the config, the control-client options, the TS builder'sdefineContract, and the emitted contract's top-level key. Composer's own field of the same name follows, so the vocabulary stays consistent end to end. AlsooutputPath→output.PostgreSQL native types are authored in type position. The auth pack's
Tstz = DateTime @db.TimestamptzbecomesTstz = Timestamptz. The stored column type does not change.Indexes are name-identified. Every index entry now carries
nameandunique. Our three index names are author-owned rather than toolchain-generated, so no physical name changed and no index is rebuilt.A generator default no longer picks a column's storage. Pre-0.17,
String @id @default(uuid(4))re-picked the column tocharacter(36); from 0.17 the type position is the only storage decider, so it emitstext. This changes the DDL forWidget.idinpn-widgetsandOrder.idinstore/orders:textis accepted rather than pinned back withChar(36) @default(uuid(4)), because these are example apps with no deployed database andtextis the better column for a UUID —character(n)blank-pads and compares with padding. An application that has this schema deployed must not take that silently: pin the old storage in the type position, or plan a real migration. Thestore/catalogtree is unaffected (its ids are author-supplied), and the auth pack is unaffected (its ids are plainString).Aggregate results carry their target's codec (the only 0.17 → rc.1 breaking change).
count()is abiginton PostgreSQL, integer averages are decimal strings. Nothing in this repo calls an aggregate, a groupBy, or an include reducer, so there was nothing to translate; regenerating the contracts adds theAggregateTypesblock the ORM and SQL builder now resolve result types from.Re-emission and re-anchoring
Every contract space was re-emitted. The
extensionskey and the index shape sit in the canonicalized bytes, so every storage hash moved at 0.17 and every migration tree had to be re-anchored — a re-baseline, since each is a singlefrom: nullinit migration.The regenerated DDL is not identical everywhere, and the differences are worth reading before merging:
examples/auth, auth packstore/catalogparams: []added toCREATE INDEX(a 0.17 normalisation), plus a leadingCREATE SCHEMA IF NOT EXISTS "public"pn-widgets,store/ordersidmoves fromcharacter(36)totext(see the generator-default entry above)Because these are re-baselines rather than hash-advances, a database already signed at an old head does not converge from the new tree: its marker matches neither the new ref nor
null, so planning fails withMIGRATION_PATH_NOT_FOUND. That is a loud failure rather than a silent one, but it is a dead end — anything deployed against the old heads needs a hand-authored advance. This matters most for the auth pack, whose migrations ship to downstream consumers we cannot see; its DDL is provably unchanged, so a no-op hash-advance edge would have been the cheaper option and is worth considering before this merges.At 8.0.0-rc.1 no storage hash moved, so nothing needed re-anchoring in the second commit — which is exactly how the snapshot type files went stale (see below).
Two small enabling changes came out of this:
prisma-next.config.tsnow namesmigrations: { dir: './src/pack/migrations' }, and the widget/gadget fixtures nameoutput: '../emitted'. Without those,prisma-next migration planandcontract emitwrote to the wrong place, so the documented regeneration procedure could not actually be run.packed-contracttest fixture carried a synthetic contract with a made-up head hash. 0.17 verifies a descriptor's head against its owncontractJsonat config load, so the fixture now borrows the gadget fixture's real emitted contract.Bundling
Several
tsdownconfigs list/^@prisma\//undernoExternal, meaning "inline Composer's own packages". After the rename that pattern would also swallow the whole ORM, so it is narrowed to/^@prisma\/(?!orm-)/everywhere the previous behaviour kept@prisma-next/*external. The one place that deliberately inlined the ORM — the authtestingbundle, whose local bootstrap runs the realdbInitpath — keeps doing so.Verification
pnpm build,pnpm typecheck,pnpm lint,pnpm lint:depsandpnpm testare all green — 63 of 63 test packages. That includes the real-Postgres integration suites that exercise Prisma Next end to end (@internal/prisma-cloud, 338 tests;@internal/auth, 106 tests), the local-dev emulator suites (@internal/dev-emulators,@internal/local-target,@prisma/integration-tests), andprisma-next migration checkon all four example migration trees.The emulator suites needed a machine-local cleanup first, unrelated to this change: a
postgres-maindaemon left running by another worktree was holding port 4303 and the@prisma/devlock files, and the shared registries still listed databases from runs whose worktrees no longer exist. Clearing the stale daemon and those records fixed all three.Review round 1
A local review (architect + principal-engineer passes) and CodeRabbit found four things worth acting on; all are fixed in the last three commits.
AggregateTypesto every emittedcontract.d.tswithout moving a storage hash, so nothing re-anchored and all fivemigrations/snapshots/<hex>/contract.d.tsentries kept their 0.17-era types.migration planreads the store copy, so those were the types a regenerated migration would import. Fixed, plus alint-contract-snapshotscheck that fails on the drift.check-publish-depsscopes its exact-pin rule to packages this workspace publishes, so all 11@prisma/orm-*specs were unchecked — including the facade peer whose whole job is to prevent two copies of the ORM. Addedlint-orm-pins.extensionsrename went too far. The 0.17 config key rename was propagated pastresolvePrismaNextConfiginto Composer's own types — butextensionsis already Composer's word for what aprisma-composer.config.tslists, and1-extensions/is a layer name, so one word ended up meaning two things. Prisma Next's word now appears only in the two lines that talk to Prisma Next; everything Composer owns isextensionPacksagain./auth/packneeds the peer at runtime too, not just/prisma-next.The review artefacts are local-only under
wip/review-code/pr-212/.Follow-ups
prisma-next contract emitwrites contract JSON without a trailing newline; biome wants one, and reformats some of the emitted files further. Committed artefacts are biome-formatted after each emit, as they were before this change. Worth settling one way or the other.packages/1-prisma-cloud/2-shared-modules/auth/src/execution/empty-app-contract.jsonis a hand-kept copy of the empty-app fixture's emitted contract. The fixture's owncontract.jsonis not committed, so the new snapshot check has nothing to compare it against — committing the fixture output would close that.@internal/lowering'sthe heartbeat extends the lease on scheduleis timing-dependent — it sleeps 100ms and asserts at least two PATCH requests at a 10ms interval — and failed once on a loaded CI runner. It comes from this branch's base commit, is untouched here, and passes locally on every run. Worth a tolerance or a fake clock.🤖 Generated with Claude Code