Update to prisma-next@0.17.0 - #749
Conversation
🦋 Changeset detectedLatest commit: af34d02 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughChangesPrisma Next 0.17 support updates package dependencies and imports, configuration, generated contracts, migration hashes and layouts, codec descriptors, CLI detection, tests, examples, and documentation. Prisma Next 0.17 upgrade
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant PrismaConfig
participant PrismaGenerator
participant ContractSnapshot
participant CipherstashDescriptors
PrismaConfig->>PrismaGenerator: defineConfig with contract, output, and extensions
PrismaGenerator->>CipherstashDescriptors: load codecDescriptors
PrismaGenerator->>ContractSnapshot: generate contract.json and contract.d.ts
ContractSnapshot->>ContractSnapshot: store hashes and metadata under snapshots/<hex>
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
|
Thanks for this @wmadden! I see that Prisma Next 0.16 has just been published - should we update that in this PR, or would you suggest doing it separately? |
…sh surface)
Prisma Next 0.17 retires the @prisma-next/* scope: the framework now
publishes as consolidated @prisma/orm-* shells plus the prisma-next bin
shim, and an application depends on exactly one database facade. This
upgrades the extension, the example app, and the CLI's project detection
to that surface, following the upstream 0.16-to-0.17 extension-author
recipe.
- Depend on @prisma/orm-{framework,family-sql,toolchain} 0.17.0, with
@prisma/orm-target-postgres as a peer; rewrite every import to the
shell subpaths (one-hop mapping from shells.ts).
- Strip the sha256: prefix from all committed hashes (upstream codemod)
and move migration contract snapshots into the content-addressed
migrations/snapshots/ store (upstream one-shot migrator) — this
supersedes the hand-built layout from PR cipherstash#749; the 0.17 migrator
converts the tree cleanly and re-verifies every migrationHash.
- Rename extensionPacks -> extensions, re-emit src/contract.{json,d.ts},
and re-anchor the migration set (from/to hashes + recomputed
migrationHash; the frozen 3.0.2 upgrade edge keeps its baked 3.0.2
ops bytes).
- Declare the emitted type imports under the package's real published
name (@cipherstash/stack-prisma/*) instead of the stale
@prisma-next/extension-cipherstash/* names, which 0.17 emits verbatim
into consumer contract.d.ts files.
- Publish the v3 codecs as Postgres target descriptors (postgresCodec
with nativeType + identity jsonProjection) through
types.codecTypes.codecDescriptors, replacing the deleted meta channel
and codecInstances slot.
- Example app: single-facade install (@prisma/orm-postgres), facade
defineConfig, converted migrations tree, refreshed vendored
cipherstash space, deleteCount -> deleteAndCount.
- stash CLI: detect 0.17 projects (prisma-next / @prisma/orm-*).
- Cooldown exclusions, supply-chain test, stash-prisma skill, and docs
updated; changeset included (major for @cipherstash/stack-prisma).
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>
1a40257 to
af34d02
Compare
|
@coderdan I updated this to 0.17.0, that should be everything you need :) |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/stack-prisma/package.json (1)
26-58: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winAdd CommonJS targets to every public export.
This package uses
"type": "module"and the public subpaths underexportsexpose onlytypesandimport. Add matching CJS build outputs withrequireentries so CommonJS consumers can import these subpaths.🤖 Prompt for 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. In `@packages/stack-prisma/package.json` around lines 26 - 58, Update every public subpath in the package.json exports map—including codec-types, column-types, control, operation-types, pack, runtime, stack, and v3—to include its corresponding CommonJS build output via a require entry alongside the existing types and import entries. Use the matching dist filename and preserve the current ESM and type targets.Source: Coding guidelines
🤖 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 `@examples/prisma/src/prisma/contract.d.ts`:
- Around line 4-14: Update the `@cipherstash/stack-prisma` package exports for the
codec-types and operation-types subpaths to include matching CommonJS require
entries alongside import, and add both subpaths to the package subpath
documentation table if they are public. Preserve the existing types and import
mappings.
In `@packages/stack-prisma/CHANGELOG.md`:
- Line 105: Restore the historical `@prisma-next/`* package names in the affected
pre-0.17 changelog entries, including the entries near d6d23be and the
additionally referenced lines, while preserving their original version guidance.
Update the Prisma ORM 0.17 release entry separately to document the new
`@prisma/orm-`* namespace.
In `@packages/stack-prisma/test/psl-interpretation.test.ts`:
- Around line 81-87: Update the composedExtensionContracts initialization in the
test to remove the type-erasing as unknown as Contract assertion by using
validation or a typed conversion; if the cast is necessary, add the
project-approved Biome suppression with a concise reason that contract JSON
cannot be typed at this boundary.
---
Outside diff comments:
In `@packages/stack-prisma/package.json`:
- Around line 26-58: Update every public subpath in the package.json exports
map—including codec-types, column-types, control, operation-types, pack,
runtime, stack, and v3—to include its corresponding CommonJS build output via a
require entry alongside the existing types and import entries. Use the matching
dist filename and preserve the current ESM and type targets.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e0d253a8-0d5a-4f51-a26b-18e8d084101e
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (78)
.changeset/prisma-next-0-17.mde2e/tests/supply-chain.e2e.test.tsexamples/prisma/README.mdexamples/prisma/migrations/app/20260714T2142_initial/end-contract.d.tsexamples/prisma/migrations/app/20260714T2142_initial/end-contract.jsonexamples/prisma/migrations/app/20260714T2142_initial/migration.jsonexamples/prisma/migrations/app/20260714T2142_initial/migration.tsexamples/prisma/migrations/cipherstash/20260601T0100_install_eql_v3_bundle/migration.jsonexamples/prisma/migrations/cipherstash/20260720T0000_upgrade_eql_v3_3_0_2/migration.jsonexamples/prisma/migrations/cipherstash/20260728T0000_upgrade_eql_v3_3_0_4/migration.jsonexamples/prisma/migrations/cipherstash/contract.d.tsexamples/prisma/migrations/cipherstash/refs/head.jsonexamples/prisma/migrations/snapshots/0c0734babd6eeb868fee1f281ca96963022475611560e9f170f465daa35f8599/contract.d.tsexamples/prisma/migrations/snapshots/0c0734babd6eeb868fee1f281ca96963022475611560e9f170f465daa35f8599/contract.jsonexamples/prisma/migrations/snapshots/f1cd58a4c67d07d7c45d05b6d11a5629e063848d9597a17af2311542622cd8d7/contract.d.tsexamples/prisma/migrations/snapshots/f1cd58a4c67d07d7c45d05b6d11a5629e063848d9597a17af2311542622cd8d7/contract.jsonexamples/prisma/package.jsonexamples/prisma/prisma-next.config.tsexamples/prisma/src/db.tsexamples/prisma/src/index.tsexamples/prisma/src/prisma/contract.d.tsexamples/prisma/src/prisma/contract.jsonexamples/prisma/test/e2e/mixed.e2e.test.tspackages/cli/src/commands/db/detect.tspackages/stack-prisma/CHANGELOG.mdpackages/stack-prisma/DEVELOPING.mdpackages/stack-prisma/README.mdpackages/stack-prisma/integration/adapter.tspackages/stack-prisma/integration/json-adapter.tspackages/stack-prisma/migrations/20260601T0100_install_eql_v3_bundle/migration.jsonpackages/stack-prisma/migrations/20260601T0100_install_eql_v3_bundle/migration.tspackages/stack-prisma/migrations/20260720T0000_upgrade_eql_v3_3_0_2/migration.jsonpackages/stack-prisma/migrations/20260720T0000_upgrade_eql_v3_3_0_2/migration.tspackages/stack-prisma/migrations/20260728T0000_upgrade_eql_v3_3_0_4/migration.jsonpackages/stack-prisma/migrations/20260728T0000_upgrade_eql_v3_3_0_4/migration.tspackages/stack-prisma/migrations/refs/head.jsonpackages/stack-prisma/migrations/snapshots/0c0734babd6eeb868fee1f281ca96963022475611560e9f170f465daa35f8599/contract.d.tspackages/stack-prisma/migrations/snapshots/0c0734babd6eeb868fee1f281ca96963022475611560e9f170f465daa35f8599/contract.jsonpackages/stack-prisma/package.jsonpackages/stack-prisma/prisma-next.config.tspackages/stack-prisma/src/contract-authoring.tspackages/stack-prisma/src/contract.d.tspackages/stack-prisma/src/contract.jsonpackages/stack-prisma/src/contract.prismapackages/stack-prisma/src/execution/abort.tspackages/stack-prisma/src/execution/decrypt-all.tspackages/stack-prisma/src/execution/envelope-base.tspackages/stack-prisma/src/execution/routing.tspackages/stack-prisma/src/exports/codec-types.tspackages/stack-prisma/src/exports/contract-space-typing.tspackages/stack-prisma/src/exports/control.tspackages/stack-prisma/src/exports/operation-types.tspackages/stack-prisma/src/exports/pack.tspackages/stack-prisma/src/extension-metadata/codec-metadata.tspackages/stack-prisma/src/extension-metadata/descriptor-meta.tspackages/stack-prisma/src/migration/cipherstash-codec-v3.tspackages/stack-prisma/src/stack/from-stack-v3.tspackages/stack-prisma/src/types/operation-types.tspackages/stack-prisma/src/v3/bulk-encrypt-v3.tspackages/stack-prisma/src/v3/codec-runtime-v3.tspackages/stack-prisma/src/v3/derive-schemas-v3.tspackages/stack-prisma/src/v3/operators-v3.tspackages/stack-prisma/src/v3/query-term.tspackages/stack-prisma/src/v3/runtime-v3.tspackages/stack-prisma/test/abort.test.tspackages/stack-prisma/test/bulk-encrypt-middleware.helpers.tspackages/stack-prisma/test/descriptor.test.tspackages/stack-prisma/test/live/helpers/harness.tspackages/stack-prisma/test/psl-interpretation.test.tspackages/stack-prisma/test/v3/bulk-encrypt-v3.test.tspackages/stack-prisma/test/v3/codec-runtime-v3.test.tspackages/stack-prisma/test/v3/migration-v3.test.tspackages/stack-prisma/test/v3/operator-lowering-v3.helpers.tspackages/stack-prisma/test/v3/properties.test.tspackages/stack-prisma/test/v3/runtime-v3.test.tspackages/stack-prisma/test/v3/vendored-space-parity.test.tspnpm-workspace.yamlskills/stash-prisma/SKILL.md
💤 Files with no reviewable changes (3)
- examples/prisma/migrations/cipherstash/contract.d.ts
- examples/prisma/migrations/app/20260714T2142_initial/end-contract.d.ts
- examples/prisma/migrations/app/20260714T2142_initial/end-contract.json
| import type { CodecTypes as CipherstashTypes } from '@cipherstash/stack-prisma/codec-types'; | ||
| import type { QueryOperationTypes as CipherstashQueryOperationTypes } from '@cipherstash/stack-prisma/operation-types'; | ||
| import type { | ||
| EncryptedBigInt, | ||
| EncryptedBoolean, | ||
| EncryptedDate, | ||
| EncryptedJson, | ||
| EncryptedNumber, | ||
| EncryptedString, | ||
| } from '@prisma-next/extension-cipherstash/runtime'; | ||
| } from '@cipherstash/stack-prisma/runtime'; | ||
| import type { QueryOperationTypes as PgAdapterQueryOps } from '@prisma/orm-postgres/adapter/operation-types'; |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify stack-prisma exports the subpaths that generated contracts import.
set -euo pipefail
echo "== exports map"
fd -t f 'package.json' packages/stack-prisma --max-depth 1 --exec jq '{name, version, exports}'
echo "== subpaths referenced by generated contracts and metadata"
rg -n --no-heading "`@cipherstash/stack-prisma/`[a-z-]+" -o \
-g '!**/node_modules/**' -g '!pnpm-lock.yaml' \
examples packages/stack-prisma | sort -u -t: -k3 | head -50Repository: cipherstash/stack
Length of output: 1695
🏁 Script executed:
#!/bin/bash
# Check whether codec-types and operation-types exports have both ESM and CommonJS paths,
# and inspect the README subpath table for these exports.
set -euo pipefail
echo "== package.json exports for target subpaths"
jq '.exports["./codec-types"], .exports["./operation-types"]' packages/stack-prisma/package.json
echo
echo "== README stack-prisma subpath table context"
nl -ba packages/stack-prisma/README.md | sed -n '35,60p'Repository: cipherstash/stack
Length of output: 450
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== package.json exports for target subpaths"
jq '.exports["./codec-types"], .exports["./operation-types"]' packages/stack-prisma/package.json
echo
echo "== README stack-prisma subpath table context"
nl -ba packages/stack-prisma/README.md | sed -n '35,60p'Repository: cipherstash/stack
Length of output: 449
Add CommonJS entries for generated contract subpath exports.
./codec-types and ./operation-types are used by generated contracts, but the package exports only types plus import; they miss the required require entry for CommonJS consumers. Add matching require paths and document both subpaths in the @cipherstash/stack-prisma subpath table if they are public.
🤖 Prompt for 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.
In `@examples/prisma/src/prisma/contract.d.ts` around lines 4 - 14, Update the
`@cipherstash/stack-prisma` package exports for the codec-types and
operation-types subpaths to include matching CommonJS require entries alongside
import, and add both subpaths to the package subpath documentation table if they
are public. Preserve the existing types and import mappings.
Source: Coding guidelines
| - The v3 bundle baseline migration op is reclassified `data` (it is a contract-shape-neutral self-edge; the aggregate integrity checker rejects self-edges without a data-class op), unblocking `prisma-next migration plan` / `migrate` in consuming apps. | ||
|
|
||
| - d6d23be: Upgrade to Prisma Next 0.14.0 (from 0.8.0). Every `@prisma-next/*` dependency is now pinned at 0.14.0; consuming apps must run Prisma Next 0.14 to use this release. | ||
| - d6d23be: Upgrade to Prisma Next 0.14.0 (from 0.8.0). Every `@prisma/orm-*` dependency is now pinned at 0.14.0; consuming apps must run Prisma Next 0.14 to use this release. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep historical package names in released changelog entries.
These entries describe releases before this Prisma ORM 0.17 namespace migration. Replacing @prisma-next/* with @prisma/orm-* makes the historical dependency guidance inaccurate. Line 790 also conflicts with the unchanged @prisma-next/sql-runtime@0.8 reference on Line 792. Restore the original names in historical entries. Document the new namespace in the 0.17 release entry.
Also applies to: 116-116, 285-285, 706-706, 790-790
🤖 Prompt for 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.
In `@packages/stack-prisma/CHANGELOG.md` at line 105, Restore the historical
`@prisma-next/`* package names in the affected pre-0.17 changelog entries,
including the entries near d6d23be and the additionally referenced lines, while
preserving their original version guidance. Update the Prisma ORM 0.17 release
entry separately to document the new `@prisma/orm-`* namespace.
| composedExtensionContracts: new Map([ | ||
| [ | ||
| cipherstashControl.id, | ||
| cipherstashControl.contractSpace!.contractJson as unknown as Contract, | ||
| ], | ||
| ]), | ||
| authoringContributions: { type: cipherstashPack.authoring.type, field: {} }, | ||
| authoringContributions: { type: authoringTypes, field: {} }, |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Document or remove the type-erasing assertion.
Line 84 uses as unknown as Contract without the required documented Biome suppression. Add the project-approved suppression with the reason that this contract JSON cannot be typed at this boundary, or replace the cast with validation or a typed conversion.
As per coding guidelines, source code must not use type-erasing assertions unless a deliberate case is documented with a Biome suppression.
🤖 Prompt for 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.
In `@packages/stack-prisma/test/psl-interpretation.test.ts` around lines 81 - 87,
Update the composedExtensionContracts initialization in the test to remove the
type-erasing as unknown as Contract assertion by using validation or a typed
conversion; if the cast is necessary, add the project-approved Biome suppression
with a concise reason that contract JSON cannot be typed at this boundary.
Source: Coding guidelines
Upgrades the CipherStash Prisma Next extension to Prisma Next 0.17.0 — the release where the framework moved into
prisma/prisma("Prisma 8") and re-published as the consolidated@prisma/orm-*shells.Follows the upstream 0.16→0.17 extension-author recipe.
packages/stack-prisma
@prisma-next/*(retired scope) →@prisma/orm-framework/@prisma/orm-family-sql/@prisma/orm-toolchainat 0.17.0, with@prisma/orm-target-postgresas a peer dependency per the recipe (prevents two copies of the target and split codec registries).@prisma-next/extension-author-toolsdropped (now@internal, unpublished).shells.tsin prisma/prisma).strip-sha256-hash-prefixescodemod); contract snapshots moved into the content-addressedmigrations/snapshots/<hex>/store;extensionPacks→extensionsre-emitted the contract (storage hashefd408cf…→0c0734ba…) and re-anchored all three migrations. The frozen 3.0.2 upgrade edge keeps its baked 3.0.2 SQL bytes — only its manifest (from/to/migrationHash) moved.@prisma-next/extension-cipherstash/*— a stale name 0.17 emits verbatim into consumercontract.d.ts, where it cannot resolve. Now declares the real published subpaths@cipherstash/stack-prisma/{codec-types,operation-types,runtime}(verified end-to-end via the example's regenerated contract).postgresCodecwithnativeType+ identityjsonProjection— a v3 column is a domain overjsonb, so the stored EQL payload document is its own canonical JSON). Published throughtypes.codecTypes.codecDescriptorson both the pack meta and the runtime descriptor (0.17 removed themetachannel andcodecInstancesslot).scalarColumnDescriptors,composedExtensions,readMigrationPackageoptions, re-pinned frozen migration hashes).examples/prisma
Single-facade install: the only framework dependency is
@prisma/orm-postgres@0.17.0, config uses the facade'sdefineConfig, migrations tree converted (rootmigrations/snapshots/store shared by the app space and the vendored cipherstash space), vendored cipherstash artefacts refreshed, app contract re-emitted and its migration re-anchored,deleteCount→deleteAndCount.Repo plumbing
stashCLI now detects 0.17 projects (prisma-next/ any@prisma/orm-*dependency) alongside the legacy signals.@prisma/orm-*+prisma-next(first-party), with the supply-chain e2e test updated to match.skills/stash-prismadocuments the 0.17 surface; changeset included (major for@cipherstash/stack-prisma, patch forstash).Verification
pnpm --filter @cipherstash/stack-prisma test— 345 passed (incl. frozen-migration, vendored-parity, PSL-interpretation suites)pnpm --filter stash test— 1070 passedcode:checkclean; supply-chain e2e passed🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Chores