-
-
Notifications
You must be signed in to change notification settings - Fork 105
merge dev to main (v2.13.2) #2072
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
Conversation
📝 WalkthroughWalkthroughThis pull request updates the project’s version number in the Gradle build file and refactors portions of the Prisma client handling logic within the enhancer module. It also adds two new regression test files for validating schema definitions related to the Changes
Sequence Diagram(s)sequenceDiagram
participant EG as EnhancerGenerator
participant FS as File System
EG->>EG: Check if needsLogicalClient is true
alt needsLogicalClient true
EG->>EG: Set resultPrismaTypeImport to fixed logical client path
EG->>FS: Create modelsDts file using the new Prisma type import
EG->>FS: Re-export original Prisma client to models.js
else needsLogicalClient false
EG->>EG: Proceed with default Prisma import handling
end
sequenceDiagram
participant T as Test Suite
participant LS as loadSchema
participant ZS as ZodSchemas Validator
T->>LS: Call loadSchema with schema definition
LS-->>T: Return generated schema
T->>ZS: Invoke safeParse on Foo model
ZS-->>T: Return parsing result (success/failure)
T->>T: Assert parsing result is valid
Possibly related PRs
✨ Finishing Touches
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. 🪧 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: 0
🧹 Nitpick comments (2)
tests/regression/tests/issue-2065.test.ts (1)
1-31
: Good regression test for issue #2065.This test effectively validates that a schema with an enum (
FooType
), type (Meta
), and model (Foo
) with validation rules generates the expected Zod schema. It's a well-structured regression test that ensures the functionality works as expected.Consider adding a more descriptive test name instead of
'issue [...]'
to better document what specific issue this test is addressing.tests/regression/tests/issue-foo.test.ts (1)
1-36
: Good schema validation test.This test effectively validates that the Zod schema correctly parses a valid
Foo
model instance. It extends beyond the previous test by actually validating data against the schema.Similar to the previous test file, consider using a more descriptive test name rather than
'issue [...]'
to better document the purpose of this test.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (14)
package.json
is excluded by!**/*.json
packages/ide/jetbrains/package.json
is excluded by!**/*.json
packages/language/package.json
is excluded by!**/*.json
packages/misc/redwood/package.json
is excluded by!**/*.json
packages/plugins/openapi/package.json
is excluded by!**/*.json
packages/plugins/swr/package.json
is excluded by!**/*.json
packages/plugins/tanstack-query/package.json
is excluded by!**/*.json
packages/plugins/trpc/package.json
is excluded by!**/*.json
packages/plugins/trpc/tests/projects/t3-trpc-v11/package-lock.json
is excluded by!**/package-lock.json
,!**/*.json
packages/runtime/package.json
is excluded by!**/*.json
packages/schema/package.json
is excluded by!**/*.json
packages/sdk/package.json
is excluded by!**/*.json
packages/server/package.json
is excluded by!**/*.json
packages/testtools/package.json
is excluded by!**/*.json
📒 Files selected for processing (4)
packages/ide/jetbrains/build.gradle.kts
(1 hunks)packages/schema/src/plugins/enhancer/enhance/index.ts
(2 hunks)tests/regression/tests/issue-2065.test.ts
(1 hunks)tests/regression/tests/issue-foo.test.ts
(1 hunks)
🧰 Additional context used
🧬 Code Definitions (3)
tests/regression/tests/issue-2065.test.ts (1)
packages/testtools/src/schema.ts (1)
loadSchema
(163-369)
tests/regression/tests/issue-foo.test.ts (1)
packages/testtools/src/schema.ts (1)
loadSchema
(163-369)
packages/schema/src/plugins/enhancer/enhance/index.ts (1)
packages/schema/build/bundle.js (1)
fs
(4-4)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: build-test (20.x)
- GitHub Check: build-test (20.x)
- GitHub Check: OSSAR-Scan
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: build-test (20.x)
- GitHub Check: OSSAR-Scan
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
packages/ide/jetbrains/build.gradle.kts (1)
12-12
: Version updated to 2.13.2.The version number has been incremented from 2.13.1 to 2.13.2, which aligns with the PR title indicating this is a version update merge from dev to main.
packages/schema/src/plugins/enhancer/enhance/index.ts (5)
113-113
: Improved variable naming for clarity.Renaming from
resultPrismaImport
toresultPrismaTypeImport
better reflects that this variable is specifically for Prisma type imports, making the code more maintainable.
117-117
: Updated assignment for the renamed variable.The assignment now correctly uses the renamed variable
resultPrismaTypeImport
.
123-125
: Renamed source file variable for better semantics.Changing from
prismaDts
tomodelsDts
makes the variable name more consistent with its purpose - creating a type definition file for models rather than just Prisma types.
128-131
: Added reexport of Prisma client values.This new code properly reexports values from the original Prisma client, improving the separation between type imports and value imports. This is a good practice for maintaining a clean module structure.
157-157
: Updated function parameter to use the renamed variable.The function call now correctly uses the renamed variable
resultPrismaTypeImport
.
No description provided.