Skip to content

Rename prisma7 package to @prisma/prisma7 - #30002

Merged
SevInf merged 2 commits into
v7from
prisma7-scoped-package
Aug 13, 2026
Merged

Rename prisma7 package to @prisma/prisma7#30002
SevInf merged 2 commits into
v7from
prisma7-scoped-package

Conversation

@StevenMcClankerton

@StevenMcClankerton StevenMcClankerton commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Renames the compatibility npm package from the unavailable unscoped prisma7 name to @prisma/prisma7, while preserving prisma7 as the executable and CLI distribution identity.

Changes

  • Package and exports: Rename the published package and TypeScript aliases to @prisma/prisma7; preserve the prisma7 bin and root/./config forwarding exports.
  • Generated guidance: Generate @prisma/prisma7/config imports and scoped install instructions for compatibility invocations, while command examples, completion, and version labels remain prisma7.
  • Package-aware diagnostics: Resolve and label the scoped package in mismatch, bootstrap, and install guidance without changing executable guidance.
  • Packed E2E: Install and mount the scoped prisma-prisma7-0.0.0.tgz artifact through the standard scoped-package path, and update fixture imports and lockfile.
  • Publishing: Remove the obsolete unscoped prisma7 dependency exception; @prisma/prisma7 is covered by the existing @prisma/* dependency graph.

Why

npm will not allow publication under the intended unscoped name. Separating package identity (@prisma/prisma7) from executable identity (prisma7) preserves the user-facing migration command while making the wrapper publishable under Prisma's scope.

Verification

  • Focused Init, Bootstrap, mismatch, and path-resolution tests
  • @prisma/prisma7 build, typecheck, and packed manifest inspection
  • Workspace utility typecheck
  • Packed prisma7-compatibility E2E
  • Focused Prettier, ESLint, and git diff --check

Summary by CodeRabbit

  • New Features
    • Prisma 7 is now distributed under the scoped @prisma/prisma7 package name.
    • Initialization generates configuration files with the correct Prisma 7 package references.
    • CLI installation, retry, and dependency guidance now displays distribution-specific package names.
  • Bug Fixes
    • Updated version-mismatch warnings and generated imports to use accurate scoped package paths.
    • Improved Prisma 7 compatibility across configuration generation and end-to-end workflows.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR changes Prisma 7 from prisma7 to @prisma/prisma7. CLI-generated configuration, dependency guidance, build aliases, publishing logic, resolver tests, and compatibility fixtures now use the scoped package name.

Changes

Scoped Prisma 7 package identity

Layer / File(s) Summary
Package identity and build aliases
packages/cli/src/utils/cli-distribution-identity.ts, packages/prisma7/package.json, packages/prisma7/tsconfig.build.json, tsconfig.build.bundle.json, scripts/ci/publish.ts
Adds package-name helpers, publishes Prisma 7 as @prisma/prisma7, updates TypeScript aliases, and removes the old package name from dependency filtering.
CLI package resolution and guidance
packages/cli/src/Init.ts, packages/cli/src/Generate.ts, packages/cli/src/bootstrap/*, packages/cli/src/utils/global-local-version-mismatch.ts
CLI configuration, warnings, dependency checks, and rerun commands derive package names from the distribution identity.
Scoped alias and compatibility coverage
helpers/compile/plugins/resolvePathsPlugin.test.ts, packages/cli/src/__tests__/*, packages/client/tests/e2e/prisma7-compatibility/*, packages/client/tests/e2e/_utils/run.ts
Tests and fixtures use scoped imports, dependencies, generated configuration, node_modules paths, and metadata-based package discovery.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant DistributionIdentity
  participant GeneratedConfig
  participant PackageInstall
  CLI->>DistributionIdentity: resolve Prisma 7 package names
  DistributionIdentity-->>CLI: return `@prisma/prisma7` and `@prisma/prisma7/config`
  CLI->>GeneratedConfig: write scoped config imports
  CLI->>PackageInstall: generate scoped installation guidance
Loading

Possibly related PRs

Suggested reviewers: wmadden

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: renaming the package to the scoped @prisma/prisma7 name.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch prisma7-scoped-package

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/cli/src/bootstrap/Bootstrap.ts`:
- Line 324: Update the empty-project recovery hints in Bootstrap to use
getCliDistributionPackageName(this.identity) when constructing the npx bootstrap
command at the corresponding recovery paths, including the hints near lines 189
and 194, so prisma7 resolves to its scoped package `@prisma/prisma7`.

In `@packages/client/tests/e2e/_utils/run.ts`:
- Around line 125-127: Update the Docker volume construction around
allPackageFolderNames to derive entries from package metadata: exclude
non-package folders and cli, preserve the /tmp/prisma-0.0.0.tgz volume, and map
prisma7 to /tmp/prisma-prisma7-0.0.0.tgz.
🪄 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: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 24531f98-3dd8-44da-af80-c6b52be22e68

📥 Commits

Reviewing files that changed from the base of the PR and between e847c53 and 3a2f76c.

⛔ Files ignored due to path filters (1)
  • packages/client/tests/e2e/prisma7-compatibility/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (19)
  • helpers/compile/plugins/resolvePathsPlugin.test.ts
  • packages/cli/src/Generate.ts
  • packages/cli/src/Init.ts
  • packages/cli/src/__tests__/Init.vitest.ts
  • packages/cli/src/__tests__/globalLocalVersionMismatch.test.ts
  • packages/cli/src/bootstrap/Bootstrap.ts
  • packages/cli/src/bootstrap/__tests__/Bootstrap.vitest.ts
  • packages/cli/src/bootstrap/completion-output.ts
  • packages/cli/src/utils/cli-distribution-identity.ts
  • packages/cli/src/utils/global-local-version-mismatch.ts
  • packages/client/tests/e2e/_utils/run.ts
  • packages/client/tests/e2e/prisma7-compatibility/config-consumer.ts
  • packages/client/tests/e2e/prisma7-compatibility/package.json
  • packages/client/tests/e2e/prisma7-compatibility/prisma.config.ts
  • packages/client/tests/e2e/prisma7-compatibility/tests/main.test.ts
  • packages/prisma7/package.json
  • packages/prisma7/tsconfig.build.json
  • scripts/ci/publish.ts
  • tsconfig.build.bundle.json

Comment thread packages/cli/src/bootstrap/Bootstrap.ts
Comment thread packages/client/tests/e2e/_utils/run.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
packages/client/runtime/index-browser.js 2.29 KB (0%)
packages/client/runtime/index-browser.d.ts 3.37 KB (0%)
packages/cli/build/index.js 110 B (0%)
packages/client/prisma-client-0.0.0.tgz 25.59 MB (-0.01% 🔽)
packages/cli/prisma-0.0.0.tgz 13.52 MB (+0.01% 🔺)
packages/bundle-size/da-workers-libsql/output.tgz 1.28 MB (0%)
packages/bundle-size/da-workers-neon/output.tgz 1.35 MB (0%)
packages/bundle-size/da-workers-pg/output.tgz 1.34 MB (0%)
packages/bundle-size/da-workers-planetscale/output.tgz 1.28 MB (0%)
packages/bundle-size/da-workers-d1/output.tgz 1.26 MB (0%)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/client/tests/e2e/_utils/run.ts`:
- Around line 69-74: Update the package metadata handling around allPkgJson so
the optional dependencies property is narrowed before any assignment or
mutation. Guard each package’s dependencies or assign a narrowed local within
the relevant loop, while preserving the existing dependency updates for packages
that declare dependencies.
🪄 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: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7af44f8a-fa1c-4eab-9ccc-8fc436f0a0d9

📥 Commits

Reviewing files that changed from the base of the PR and between 3a2f76c and 234db11.

⛔ Files ignored due to path filters (1)
  • packages/client/tests/e2e/prisma7-compatibility/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • packages/cli/src/bootstrap/Bootstrap.ts
  • packages/cli/src/bootstrap/__tests__/Bootstrap.vitest.ts
  • packages/client/tests/e2e/_utils/run.ts

Comment on lines +69 to +74
const allPkgJson = allPkgJsonPaths.map(
(packageJsonPath) =>
require(packageJsonPath) as {
name: string
dependencies?: Record<string, string>
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

pnpm typecheck

Repository: prisma/prisma

Length of output: 13232


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- target file ---'
sed -n '1,115p' packages/client/tests/e2e/_utils/run.ts

printf '%s\n' '--- package and compiler configuration ---'
cat package.json
find . -maxdepth 3 \( -name 'tsconfig*.json' -o -name 'package.json' \) -print | sort | head -80
rg -n '"typecheck"|strictNullChecks|strict" packages/client package.json tsconfig*.json . --glob 'tsconfig*.json' --glob 'package.json' --glob '!node_modules' | head -120

Repository: prisma/prisma

Length of output: 12866


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- client package scripts ---'
cat packages/client/package.json

printf '%s\n' '--- client compiler settings ---'
cat packages/client/tsconfig.json
cat packages/client/tsconfig.build.json 2>/dev/null || true

printf '%s\n' '--- workspace typecheck scripts ---'
rg -n '"typecheck"|strictNullChecks|strict' --glob 'package.json' --glob 'tsconfig*.json' packages pnpm-workspace.yaml turbo.json

printf '%s\n' '--- available TypeScript compiler ---'
command -v tsc || true
test -x node_modules/.bin/tsc && node_modules/.bin/tsc --version || true

Repository: prisma/prisma

Length of output: 13559


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- inherited workspace compiler settings ---'
cat tsconfig.json

printf '%s\n' '--- exact-expression compiler probe ---'
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
cat >"$tmpdir/probe.ts" <<'TS'
declare const allPkgJson: Array<{
  name: string
  dependencies?: Record<string, string>
}>

declare const i: number
declare const key: string

for (const key of Object.keys(allPkgJson[i].dependencies ?? {})) {
  allPkgJson[i].dependencies[key] = `/tmp/${key}`
}
TS

tsc --noEmit --strictNullChecks --skipLibCheck "$tmpdir/probe.ts" 2>&1 || true

printf '%s\n' '--- narrowed-expression compiler probe ---'
cat >"$tmpdir/probe-fixed.ts" <<'TS'
declare const allPkgJson: Array<{
  name: string
  dependencies?: Record<string, string>
}>

declare const i: number

const packageJson = allPkgJson[i]
const dependencies = packageJson.dependencies
if (dependencies !== undefined) {
  for (const key of Object.keys(dependencies)) {
    dependencies[key] = `/tmp/${key}`
  }
}
TS

tsc --noEmit --strictNullChecks --skipLibCheck "$tmpdir/probe-fixed.ts"

Repository: prisma/prisma

Length of output: 1036


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- inherited strictness ---'
cat tsconfig.utils.typecheck.json

printf '%s\n' '--- exact-expression compiler probe ---'
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
cat >"$tmpdir/probe.ts" <<'TS'
declare const allPkgJson: Array<{
  name: string
  dependencies?: Record<string, string>
}>

declare const i: number

for (const key of Object.keys(allPkgJson[i].dependencies ?? {})) {
  allPkgJson[i].dependencies[key] = `/tmp/${key}`
}
TS

tsc --ignoreConfig --noEmit --strictNullChecks --skipLibCheck "$tmpdir/probe.ts" 2>&1 || true

printf '%s\n' '--- narrowed-expression compiler probe ---'
cat >"$tmpdir/probe-fixed.ts" <<'TS'
declare const allPkgJson: Array<{
  name: string
  dependencies?: Record<string, string>
}>

declare const i: number

const packageJson = allPkgJson[i]
const dependencies = packageJson.dependencies
if (dependencies !== undefined) {
  for (const key of Object.keys(dependencies)) {
    dependencies[key] = `/tmp/${key}`
  }
}
TS

tsc --ignoreConfig --noEmit --strictNullChecks --skipLibCheck "$tmpdir/probe-fixed.ts"

Repository: prisma/prisma

Length of output: 481


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

cat tsconfig.build.bundle.json

Repository: prisma/prisma

Length of output: 2925


Narrow dependencies before assigning to it.

dependencies is optional. The current assignment produces TS2532: Object is possibly 'undefined'. Guard dependencies or store it in a narrowed local before the loop.

🤖 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/client/tests/e2e/_utils/run.ts` around lines 69 - 74, Update the
package metadata handling around allPkgJson so the optional dependencies
property is narrowed before any assignment or mutation. Guard each package’s
dependencies or assign a narrowed local within the relevant loop, while
preserving the existing dependency updates for packages that declare
dependencies.

Source: Coding guidelines

@SevInf
SevInf merged commit cf2bc1f into v7 Aug 13, 2026
504 of 507 checks passed
@SevInf
SevInf deleted the prisma7-scoped-package branch August 13, 2026 08:15
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