Skip to content

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

Merged
merged 4 commits into from
Apr 7, 2025
Merged

merge dev to main (v2.13.2) #2072

merged 4 commits into from
Apr 7, 2025

Conversation

ymc9
Copy link
Member

@ymc9 ymc9 commented Apr 7, 2025

No description provided.

Copy link
Contributor

coderabbitai bot commented Apr 7, 2025

📝 Walkthrough

Walkthrough

This 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 Foo model. The changes involve renaming variables to clarify their purpose when handling Prisma types and re-exporting imports, along with ensuring the updated schema functionality behaves as expected.

Changes

File(s) Change Summary
packages/ide/jetbrains/build.gradle.kts Updated version from "2.13.1" to "2.13.2".
packages/schema/src/plugins/enhancer/enhance/index.ts Renamed resultPrismaImport to resultPrismaTypeImport; updated prismaDts to modelsDts and adjusted import/export logic to use fixed logical client paths when needsLogicalClient is true.
tests/regression/tests/issue-2065.test.ts, tests/regression/tests/issue-foo.test.ts Added new regression tests that load a schema incorporating enumeration and validation rules for the Foo model, verifying the generated Zod schema and safe parsing logic.

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
Loading
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
Loading

Possibly related PRs

  • chore: bump version #2071: Updates the version number in build.gradle.kts from "2.13.1" to "2.13.2", directly aligning with this change.
  • chore: bump version #2066: Adjusts the version in build.gradle.kts in a similar sequential update, serving as a direct precursor to this PR’s change.
  • chore: bump version #2031: Involves a version number update in the same build.gradle.kts file, indicating a strong code-level connection with the current modifications.
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 79197c6 and b7f04ef.

⛔ 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 to resultPrismaTypeImport 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 to modelsDts 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.

@ymc9 ymc9 merged commit c017a40 into main Apr 7, 2025
13 checks passed
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.

1 participant