projects/prisma7-compatibility-cli/spec.md
Let projects adopt Prisma 8 without losing direct, reproducible access to the Prisma 7 CLI in the same dependency graph. This gives users a supported side-by-side migration and compatibility path instead of forcing them to switch versions through transient npx invocations, global installs, or lockfile edits.
A project can install both major CLI lines under distinct package and executable names:
{
"devDependencies": {
"prisma": "8.0.0",
"prisma7": "7.5.0",
"@prisma/client": "7.5.0"
}
}
pnpm prisma ... # Prisma 8
pnpm prisma7 ... # Prisma 7
[email protected] is a small compatibility package with a prisma7 binary and an exact dependency on [email protected]. It selects a Prisma 7 CLI identity before executing that dependency, so Prisma 7 remains the single implementation while user-facing package references, executable examples, generated config imports, version checks, and update guidance say prisma7 or prisma7/config.
The package-manager topology has been probed with real packed mock packages and a local registry. With direct prisma@8 and prisma7@7 dependencies, npm, pnpm, Yarn (node-modules and PnP), and Bun all kept the top-level prisma command on v8 while the prisma7 wrapper resolved its exact v7 dependency. Both installation orders converged without stale binary links.
prisma7 as a second binary of the prisma package or relying on npm dependency-alias syntax.@prisma/cli-core package solely to support the compatibility wrapper.prisma@7 implementation from low-level stack traces or resolved filesystem paths; user-actionable diagnostics and version labels still use prisma7.@prisma/client.prisma@7 publication to prisma7.--config paths where needed.prisma7 alone never exposes a hoisted prisma binary. npm, Yarn's node-modules linker, and Bun may expose the transitive v7 binary when no direct prisma dependency occupies that name; the supported side-by-side topology includes direct prisma@8.schema.prisma, prisma.config.ts, .prisma, PRISMA_*, @prisma/client, or Prisma documentation URLs.packages/cli / npm prisma remains the complete Prisma 7 implementation and owns its existing dispatcher, completion entrypoint, config API, preinstall behavior, engine dependencies, Wasm assets, and command implementation. It gains only the distribution-identity seam needed for the normal prisma and wrapped prisma7 entrypoints to render different package and command names.packages/prisma7 workspace package owns the prisma7 binary and matching root and ./config forwarding exports. Its declared prisma dependency is exact-versioned when packed, and normal package resolution must be used so npm nesting, pnpm's virtual store, and Yarn PnP all resolve the dependency correctly.scripts/ci/publish.ts owns lockstep version rewriting and publish ordering. It currently discovers workspace packages automatically but only models @prisma/* dependencies in its graph and special-cases commit metadata for prisma; publishing prisma7 therefore requires an explicit unscoped dependency/order contract and appropriate metadata handling.[email protected] version is followed by the exact matching [email protected] version. The policy that decides when and through which channel Prisma 7 is published is external to this project.prisma resolves the project's direct Prisma 8 dependency, while prisma7 resolves its own declared Prisma 7 dependency.prisma7 release line, so update prompts are suppressed for prisma7 invocations rather than comparing them against or recommending Prisma 8.[email protected] has the same command set, arguments, defaults, exit behavior, engine/Wasm assets, and Prisma 7 semantics as invoking the exact matching [email protected].prisma7: command examples, install/update instructions, generated prisma7/config imports, version output labels, global/local mismatch checks, subcommand guidance, and completion-facing invocation text. Branding must be driven by one identity contract rather than independent string substitutions.prisma7@X always executes prisma@X. Floating ranges that could make an installed wrapper execute a different patch are not acceptable.node_modules/prisma7/node_modules/prisma path.prisma7 dependencies, installation and reinstallation must leave the root prisma command on Prisma 8 and prisma7 on Prisma 7 across supported npm, pnpm, Yarn, and Bun layouts.prisma@7 users.prisma@7 publication produces a same-version prisma7 publication afterward, regardless of the externally selected release channel. Publications outside the Prisma 7 line must not produce a prisma7 artifact.prisma identity and regression coverage before any published wrapper depends on it; no intermediate release may change existing Prisma 7 output accidentally.prisma7 is not published until its binary, forwarding exports, exact dependency, update behavior, and cross-package-manager installation topology work together end to end.[email protected] before [email protected]; a failed wrapper publication must be retryable without republishing the immutable [email protected] version.prisma7 from the fact that a Prisma 7 artifact is being published, not merely from workspace discovery, so non-v7 publication cannot create a same-version compatibility artifact.The team-DoD floor document is absent in this checkout; the standard repository floor applies. Project-specific conditions:
prisma@8, prisma7@7, and @prisma/client@7, then invoke both prisma and prisma7 and observe the intended major version from each.prisma7 command help, initialization output, generated config imports, version output, mismatch warnings, completion guidance, and update guidance consistently use prisma7, while corresponding prisma snapshots and behavior remain unchanged.prisma7/config and the package's supported root type/runtime exports resolve to the exact Prisma 7 implementation under npm, pnpm, Yarn PnP, and Bun.prisma7@X contains an exact dependency on prisma@X, and release automation proves prisma publishes first and can survive/recover from a later prisma7 publication failure.prisma@7 publication path, release automation publishes the exact matching prisma7 version afterward; an exercised non-v7 publication path produces no prisma7 artifact.prisma7, with coverage proving the compatibility invocation never consults or recommends the Prisma 8 prisma release line.None.
packages/cli/package.jsonpackages/cli/helpers/build.ts, packages/cli/src/bin-dispatcher.tsscripts/ci/publish.tspackages/cli/src/Version.ts, packages/cli/src/Init.ts, packages/cli/src/utils/global-local-version-mismatch.ts, packages/cli/src/utils/printUpdateMessage.ts