Conversation
📝 WalkthroughWalkthroughAdded a runtime Prisma version check to the generate command that emits a yellow warning if the detected Prisma version is 7.0.0 or higher, before plugin execution begins. No public API changes were made. Changes
Sequence Diagram(s)sequenceDiagram
participant CLI
participant Generate
participant Version
participant Plugins
CLI->>Generate: generate()
activate Generate
rect rgb(255, 250, 200)
Note over Generate,Version: New Version Check
Generate->>Version: getPrismaVersion()
Version-->>Generate: version (or undefined)
alt version >= 7.0.0
Generate->>Generate: Emit yellow warning
end
end
Generate->>Plugins: runPlugins()
Plugins-->>Generate: complete
deactivate Generate
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/schema/src/cli/actions/generate.ts (1)
53-56: Prisma ≥7 warning behavior matches the PR objective; consider minor UX polishThe runtime check against
7.0.0usingsemver.gteis clear and does exactly what the PR states. Two optional tweaks you might consider:
- Include the detected version in the warning for clarity, e.g.,
Detected Prisma ${prismaVersion}. Prisma 7 support ....- If you expect pre-release 7 builds (e.g.,
7.0.0-beta.1) to also trigger the warning,semver.gtealready covers valid7.xreleases, but you could switch tosemver.satisfies(prismaVersion, '>=7.0.0-0')if you ever need stricter handling of pre-release semantics.Otherwise this looks good and is low-risk since it’s a pure warning-side-effect before plugin execution.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/schema/src/cli/actions/generate.ts(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/schema/src/cli/actions/generate.ts (1)
packages/sdk/src/prisma.ts (1)
getPrismaVersion(60-79)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: build-test (20.x)
- GitHub Check: build-test (20.x)
- GitHub Check: dependency-review
- GitHub Check: build-test (20.x)
🔇 Additional comments (1)
packages/schema/src/cli/actions/generate.ts (1)
3-6: Imports for Prisma version detection and semver look appropriateThe new imports are used correctly later in the file, and the separation of version detection into
@zenstackhq/sdk/prismakeeps the CLI logic lean. Just make suresemveris declared as a dependency of this package and that its import style (defaultimport) matches how it’s used elsewhere in the repo / your tsconfig settings (e.g.,esModuleInterop).
No description provided.