-
-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for Prisma 6 #2924
support for Prisma 6 #2924
Conversation
WalkthroughThe changes in this pull request involve updates to the Changes
Sequence Diagram(s)sequenceDiagram
participant A as User
participant B as Generator
participant C as Prisma Helper
A->>B: Request generation
B->>C: Call onManifest
C-->>B: Return manifest
B->>C: Call onGenerate
C-->>B: Return generated output
B-->>A: Return generation result
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (2)
packages/orm/prisma/package.json
(2 hunks)packages/orm/prisma/src/generator.ts
(1 hunks)
🔇 Additional comments (3)
packages/orm/prisma/src/generator.ts (2)
2-2
: Verify Prisma 6 generator helper compatibility
The import style change from namespace to default import suggests an API change in @prisma/[email protected]
. Let's verify this change doesn't break functionality.
✅ Verification successful
Let me gather more information about the generator implementation to verify the import change compatibility.
Import change is safe and follows Prisma 6 patterns
The verification shows that:
- The generator correctly uses
generatorHandler
from the importedhelpers
object - The codebase consistently uses DMMF types from
@prisma/generator-helper
across multiple files - The generator implementation follows the standard Prisma generator pattern with
onManifest
andonGenerate
handlers
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the new import style is documented/required for Prisma 6
# Search for similar import patterns in the codebase
rg --type typescript "import.*@prisma/generator-helper"
# Check package.json files for other Prisma generators in the codebase
fd "package.json" | xargs rg "@prisma/generator-helper"
Length of output: 221
Script:
#!/bin/bash
# Search for the generator implementation to understand the usage
rg -t ts "import.*@prisma/generator-helper" -A 5
# Look for any generator handler implementation
ast-grep --pattern 'generatorHandler($_)'
# Check the actual file content
cat packages/orm/prisma/src/generator.ts
Length of output: 6774
Line range hint 11-17
: Verify generator handler API compatibility
The generator handler implementation looks correct, but let's verify the API hasn't changed in Prisma 6.
✅ Verification successful
Let me gather more information about the generator handler API by checking the imports and dependencies.
Let me check the actual implementation and imports in the generator file to verify the API usage.
Generator handler implementation is compatible with Prisma 6
The implementation is correct and compatible with Prisma 6 based on the following evidence:
- Package.json shows
@prisma/generator-helper
dependency is properly versioned to^6.0.1
- The generator handler implementation follows the correct API structure with required
onManifest
andonGenerate
handlers - The manifest includes all required fields:
defaultOutput
,prettyName
, andrequiresGenerators
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any breaking changes in the generator handler API
# Search for any generator examples or tests
rg -A 5 "generatorHandler\("
# Look for migration guides or breaking changes
fd "CHANGELOG.md|BREAKING_CHANGES.md|MIGRATION.md"
Length of output: 462
Script:
#!/bin/bash
# Check imports and package.json for Prisma dependencies
rg -l "@prisma/generator-helper"
cat packages/orm/prisma/package.json
# Look for generator handler usage patterns
ast-grep --pattern 'generatorHandler($$$)'
# Check for any test files that might show usage
fd -e test.ts -e spec.ts -X rg -l "generatorHandler"
Length of output: 2990
Script:
#!/bin/bash
# Check the generator implementation
cat packages/orm/prisma/src/generator.ts
# Look for any test files specifically in the prisma package
fd -e test.ts -e spec.ts -p "packages/orm/prisma"
Length of output: 1476
🧰 Tools
🪛 Biome (1.9.4)
[error] 3-3: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.
(lint/style/useNodejsImportProtocol)
packages/orm/prisma/package.json (1)
Line range hint 24-31
: Verify build scripts compatibility
The build scripts involve Prisma CLI commands. Let's verify they work with Prisma 6.
✅ Verification successful
Based on the shell script results, I can now generate the final response:
Build scripts are compatible with Prisma v6
The package.json shows that all Prisma dependencies are already aligned with v6:
- @prisma/client: ^6.0.1
- @prisma/generator-helper: ^6.0.1
- @prisma/internals: ^6.0.1
- prisma: ^6.0.1
The build and generate scripts use standard Prisma CLI commands that remain unchanged in v6:
- prisma -v
- prisma generate
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any Prisma CLI command changes in v6
# Search for Prisma CLI usage in scripts
rg "prisma" $(fd "package.json")
# Look for any Prisma-specific build or test scripts
fd "package.json" | xargs rg "\"(pre)?build\":|\"test\":|\"generate:.*\":"
Length of output: 15707
"@prisma/generator-helper": "^6.0.1", | ||
"@prisma/internals": "^6.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Consider using stricter version ranges
Given this is a major version upgrade (Prisma 6), consider using stricter version ranges to prevent unexpected breaking changes.
- "@prisma/generator-helper": "^6.0.1",
- "@prisma/internals": "^6.0.1",
+ "@prisma/generator-helper": "~6.0.1",
+ "@prisma/internals": "~6.0.1",
- "@prisma/client": "^6.0.1",
+ "@prisma/client": "~6.0.1",
- "prisma": "^6.0.1",
+ "prisma": "~6.0.1",
Also applies to: 42-42, 53-53
💡 Codebase verification
Prisma dependencies are correctly updated, but test packages need attention
The main package has been properly updated to Prisma 6, but test packages are still using Prisma 4:
packages/orm/prisma/test/postgres-esm/package.json
: prisma@^4.0.0, @prisma/client@^4.0.0packages/orm/prisma/test/postgres/package.json
: prisma@^4.0.0, @prisma/client@^4.0.0packages/orm/prisma/test/mongo-esm/package.json
: prisma@^4.0.0, @prisma/client@^4.0.0packages/orm/prisma/test/mongo/package.json
: prisma@^4.0.0, @prisma/client@^4.0.0packages/orm/prisma/test/circular-ref/package.json
: prisma@^4.0.0, @prisma/client@^4.0.0
These test packages should also be updated to Prisma 6 to ensure consistent testing environment.
🔗 Analysis chain
Verify Prisma 6 dependency compatibility
The Prisma dependencies have been consistently updated to version 6.0.1. However, let's verify:
- If all necessary Prisma-related dependencies are updated
- If the version ranges are appropriate
- If there are any known compatibility issues
Also applies to: 42-42, 53-53, 58-58
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for Prisma-related dependencies and version compatibility
# Search for any missed Prisma dependencies
rg "@prisma/" $(fd "package.json")
# Check for any transitive Prisma dependencies
rg "\"prisma\":" $(fd "package.json")
# Look for version constraints in other packages
fd "package.json" | xargs rg "@prisma|prisma"
Length of output: 10257
🎉 This PR is included in version 8.3.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
@vangie thanks for the PR ;) See you |
OK |
Information
Todos
Summary by CodeRabbit
New Features
Refactor
@prisma/generator-helper
module to improve code clarity while maintaining existing functionality.