Repository navigation
feat(packs): @prisma/client 6 to 7 migration pack - #269
Draft
lucasbraum wants to merge 9 commits into
Draft
lucasbraum wants to merge 9 commits into
lucasbraum wants to merge 9 commits into
Conversation
Source ledger (prisma/web 42f3146 guide, 7.0.0 to 7.10.1 release notes, 6.19.3 and 7.10.1 tarballs, a probe of both generators) and the classification of every breaking change, before any pack code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
Detect-based rules: check sees no usage of @prisma/client (its types are the generated client), so the pack reads schema.prisma, package.json, prisma.config.* and the workspace's TypeScript project. One rewrite (cli-skip-flags: 7 never generates or seeds where the flags skipped it); everything else is assisted. prisma and installed driver adapters are a release group. Scaffolded with uptide pack new. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
Committed before the first score. BearStudio/start-ui-web #781, jqlang/playground #344, openwallet-foundation-labs/ehr-wallet #114, bcgov/nr-permitconnect-navigator-service #574, basaltkit/basalt #188, AlexAgo83/cr-league #30, MarvinLeRouge/HexaRot #160: every site read by hand from each upgrade commit; the compiler draft against a client generated at 6 is never a site. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
Ground truth for an entry with `directory` names files relative to that directory (redis, sentry-browser, next, typescript do), not to the repository: bcgov (app) and HexaRot (backend). No site, rule or line changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
…nd mocks Linking @prisma/client 7 next to a client generated at 6 gives compile errors no real upgrade has: they fold into one generated-client finding at the schema's generator block, as its evidence. Files a generator writes (its output directory, Prisma's generated header) are not read, a client the file mocks with jest.mock/vi.mock is never a site, and tests are not where a connection pool is configured. prisma-client-js is a decision: 7 still supports it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
A workspace whose schema lives at the monorepo root (cr-league apps/api) has no schema of its own to anchor the generated-client finding: its package.json line that declares @prisma/client is where its client comes from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
cli-implicit-steps names the package.json scripts it found; the connection URL parameters are findings only, since the decision context holds no source strings. A jqlang smoke run listed both with nothing behind them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
uptide pack test @prisma/client --write: 7 public repositories, 29 of 29 breaking sites found, no breaking false positive (verified gate); cli-skip-flags exercised by basalt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
…d changeset RESEARCH.md records every repository screened, the measured pack test and what the engine cannot express. pnpm docs:packs adds the pack to the README and the compatibility matrix; the queue entry is verified. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
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.
Pack
@prisma/client>=6 <7→>=7 <8(queue entry@prisma/client, nowverified). Measures verified: 7 public repositories, 29 of 29 real breaking sites found, no breaking false positive.verification.jsonrecords it (pack test --write). Draft for review; see the open questions before trusting the label.Most of Prisma 7 is outside TypeScript (
schema.prisma,package.json,prisma.config.ts, the environment). The rest lives in the generated client, whichchecknever regenerates:@prisma/client's published types areexport * from '.prisma/client/default', so the type diff finds no usage at all. So every rule finds its sites withdetect. The pack reads the workspace's TypeScript project, and its inventory ispackage.json,**/*.prisma,prisma.config.*and.nvmrc. Evidence and the full classification:packages/core/src/packs/prisma-client/RESEARCH.md.prismaand every installed@prisma/adapter-*are areleaseGroup. An adapter the upgrade has to add is a new dependency: theclient-adapterguide names it and the decision says so, and Uptide adds nothing.Sources
All read 2026-10-20 and pinned (in
meta.sources):42f3146(file last changed866b345, 2026-10-12); also reachable with WebFetch at prisma.io@prisma/client6.19.3 / 7.10.1 andprisma6.19.3 / 7.10.1 (declarations,runtime/library.js, the CLI bundle and schema wasm), adapter declarations 6.19.3 / 7.10.1, registry manifestsprisma-client-jsandprisma-clientwith 7.10.1, compiled 6-style code against each with TypeScript 5.9.3, ranprisma validateon schema variants, and constructedPrismaClientwith no adapter on Node 22Classification summary
cli-skip-flags: drop--skip-generate/--skip-seedfrommigrate dev/db pushscripts. 7 never generates or seeds there, so the command does the same thing. Declines when a skip flag belongs to another command. Exercised by basaltclient-adapter(no adapter/accelerateUrl,datasources,datasourceUrl; alsorequireand dynamicimport()clients),schema-datasource-url(url/directUrl/shadowDatabaseUrl, P1012),package-json-prisma,cli-removed-flags,config-removed-options(engine/adapterinprisma.config.ts),mongodb-unsupported,client-middleware($use,Prisma.Middleware),metrics-removed,adapter-renames,removed-entrypoints(runtime/library,/wasm, …)engine-type(7.10.1 accepts and ignores it)env-not-loaded(finding and decision): neither the CLI nor the client loads.envany more. 6's client loaded it at construction (runtime/library.js), and the decision names the schema'senv("…")lines, where the app read its URL on 6.cli-implicit-steps(finding and decision):migrate dev/resetno longer seed or generate.connection-url-params(finding):connection_limit,pool_timeoutand the other v6 URL parameters the adapters don't read. Decisions:client-js-generator,ssl-validation,mapped-enum-values(only for targets below 7.3.0),runtime-minimums(Node ^20.19/^22.12/>=24, TypeScript >=5.4).generated-client: see belowclient-adapter's guide)outputrequired (6.19.3 already required it forprisma-client;prisma-client-jsstill generates intonode_modulesat 7.10.1); ESM required (the 7.10.1 manifest has notype: module, and the probe compiled it as CommonJS)generated-client: linking@prisma/client7 next to a client generated at 6 gives TS2305/TS7006/TS7031/TS2339 that a real upgrade never has.foldFindingsfolds every compile error no rule claims into one "needs a look" finding at the schema'sgeneratorblock, as its evidence. Without the fold, the first score had 176 breaking false positives.Ground-truth repositories
Every site was read by hand and committed (
cac9bca) before the first score. Licences are permissive, and no commit carries an agent co-author trailer.7a4e23648a8e19a574d2bapp(Apache-2.0)6d634852c255d367861c3backend(MIT,withoutGenerated: its config'senv()needs the database URL)117ef40About 50 PRs were screened. Those dropped are listed with reasons in RESEARCH.md: 25 with agent co-author trailers or agent bodies, 9 without a permissive licence, 3 not a 6 → 7 project upgrade, and 4 human and permissive but not drafted yet. All clones were read-only; no push, issue or comment on any of them.
uptide pack testoutputThe 9 false positives are all "needs a look" notes, never breaking. The 2 misses are
client-js-generatordecisions, which are never reported as sites.Smoke (no LLM spend)
uptide check @prisma/client --allow-candidateon jqlang at its base commit: the 2 breaking sites, 3 notes,prismamoving as a release-group member, and the stale-client error folded with its evidence.UPTIDE_INTERNAL=1 uptide fix @prisma/client --allow-candidate --no-llmon a clean jqlang clone: the 2 assisted sites stay manual, and 77 tests pass. Verification fails on one TS2305: the post-bumpprisma generatefails on the schemaurlthe run left manual, so the stale client stays.--skip-generateis dropped by the rewrite,prismaand@prisma/clientmove to 7.10.1 together, and 3 sites stay manual.fixstops before migrating: "Requested @prisma/client@7.10.1, but packages/prisma has 6.19.3 installed". Another workspace keeps 6. That isfix's monorepo handling, not the pack.Checks
pnpm test:uptide48 files, 538 tests passed;@uptide/core202 files passed (4 skipped), 2481 tests passed (37 skipped)pnpm typecheck: 3 tasks successfulpnpm lint: 952 files checked, no fixes applied. Its 2 warnings and 1 info are inbench/score.mjs,biome.jsonandnext/platform.test.ts, none touched herepnpm public:check: clean with a dummyUPTIDE_PRIVATE_DENYLIST, and clean with the local denylist. No.mdfile here is named plan, roadmap or auditpnpm docs:links: every relative link resolvesChangeset: minor. A new verified pack changes what
checkandfixdo for@prisma/clientby default, and recent verified packs used minor.Open questions
packs:truthdrafts only*.tsand tsconfig files (SOURCE_FILEinpacks/tooling/truth-diff.ts). 12 of the 29 breaking sites are inschema.prisma,package.jsonorprisma.config.ts, read by hand from the samegit diff -U0with the same rules. I did not change the engine. Accept this for the verified label, or add those files to the draft tool first? Until then, keep itcandidate?generated-clientfold drops a whole class of compile errors into one note. Each is a stale-client artifact (I checked every message shape in cr-league and bcgov), but it is a pack hiding compiler output. The real fix is an engine change: generate the target client in an isolated copy duringcheck.docs/packs.mdsays ground-truth files are repository-relative, but every pack names adirectoryentry's files from the directory. I followed the packs (04ac449, no site changed); the docs may want a line.driver-adapter-utilspins, and the 7.0.0 class renames.@prisma/instrumentationis left out (the docs install it@latest).extends PrismaClientwith no options tosuper(NestJSPrismaService; HexaRot added a constructor, which the truth rules count as no site).?schema=in a PostgreSQL URL (cr-league handled it, but no source this pack cites says so).db pushasking for consent under an AI agent (basalt; not in the sources read).cli-implicit-stepsflagsprisma migrate devscripts the repositories kept. The behavior did change for them, but the truth rule counts only what the upgrade changed. Keep it as a finding, or make it a decision only?Checklist
meta.sourceskeep)verifiedpnpm uptide pack test @prisma/clientpasses and its output is pasted above;verification.jsonwritten with--writepnpm lint && pnpm typecheck && pnpm testpass🤖 Generated with Claude Code