Rename prisma7 package to @prisma/prisma7 - #30002
Conversation
📝 WalkthroughWalkthroughThe PR changes Prisma 7 from ChangesScoped Prisma 7 package identity
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
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
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/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
⛔ Files ignored due to path filters (1)
packages/client/tests/e2e/prisma7-compatibility/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (19)
helpers/compile/plugins/resolvePathsPlugin.test.tspackages/cli/src/Generate.tspackages/cli/src/Init.tspackages/cli/src/__tests__/Init.vitest.tspackages/cli/src/__tests__/globalLocalVersionMismatch.test.tspackages/cli/src/bootstrap/Bootstrap.tspackages/cli/src/bootstrap/__tests__/Bootstrap.vitest.tspackages/cli/src/bootstrap/completion-output.tspackages/cli/src/utils/cli-distribution-identity.tspackages/cli/src/utils/global-local-version-mismatch.tspackages/client/tests/e2e/_utils/run.tspackages/client/tests/e2e/prisma7-compatibility/config-consumer.tspackages/client/tests/e2e/prisma7-compatibility/package.jsonpackages/client/tests/e2e/prisma7-compatibility/prisma.config.tspackages/client/tests/e2e/prisma7-compatibility/tests/main.test.tspackages/prisma7/package.jsonpackages/prisma7/tsconfig.build.jsonscripts/ci/publish.tstsconfig.build.bundle.json
size-limit report 📦
|
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/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
⛔ Files ignored due to path filters (1)
packages/client/tests/e2e/prisma7-compatibility/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
packages/cli/src/bootstrap/Bootstrap.tspackages/cli/src/bootstrap/__tests__/Bootstrap.vitest.tspackages/client/tests/e2e/_utils/run.ts
| const allPkgJson = allPkgJsonPaths.map( | ||
| (packageJsonPath) => | ||
| require(packageJsonPath) as { | ||
| name: string | ||
| dependencies?: Record<string, string> | ||
| }, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
pnpm typecheckRepository: 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 -120Repository: 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 || trueRepository: 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.jsonRepository: 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
Renames the compatibility npm package from the unavailable unscoped
prisma7name to@prisma/prisma7, while preservingprisma7as the executable and CLI distribution identity.Changes
@prisma/prisma7; preserve theprisma7bin and root/./configforwarding exports.@prisma/prisma7/configimports and scoped install instructions for compatibility invocations, while command examples, completion, and version labels remainprisma7.prisma-prisma7-0.0.0.tgzartifact through the standard scoped-package path, and update fixture imports and lockfile.prisma7dependency exception;@prisma/prisma7is 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
@prisma/prisma7build, typecheck, and packed manifest inspectionprisma7-compatibilityE2Egit diff --checkSummary by CodeRabbit
@prisma/prisma7package name.