Skip to content
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

chore: pin version of @prisma/internals and @prisma/generator-helper #1242

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

ymc9
Copy link
Member

@ymc9 ymc9 commented Apr 11, 2024

No description provided.

Copy link
Contributor

coderabbitai bot commented Apr 11, 2024

Walkthrough

Walkthrough

This update primarily involves version incrementation to "2.0.0-beta.10" across various packages and the removal of dependencies on "@prisma/generator-helper" in favor of "@zenstackhq/sdk". Significant changes include the reorganization of imports and updates to type declarations related to DMMF (Data Model Meta Format), enhancing compatibility and reducing external dependencies.

Changes

File Pattern Change Summary
**/package.json Updated version to "2.0.0-beta.10"; removed dependency on "@prisma/generator-helper" in some files.
packages/ide/jetbrains/** Updated JetBrains IDE plugin version to "2.0.0-beta.10".
packages/plugins/**/src/*.ts Reorganized imports; adjusted DMMF references from "@prisma/generator-helper" to "@zenstackhq/sdk".
packages/schema/** Updated imports and refactored logic related to DMMF handling.
packages/sdk/src/dmmf-helpers/*.ts Updated DMMF import paths and refactored type references.
packages/sdk/package.json Updated dependencies to newer versions.
**/build.gradle.kts Updated version to "2.0.0-beta.10" for JetBrains IDE plugin.

Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f3796a8 and 2ba6811.
Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !pnpm-lock.yaml
Files selected for processing (35)
  • package.json (1 hunks)
  • packages/ide/jetbrains/build.gradle.kts (1 hunks)
  • packages/ide/jetbrains/package.json (1 hunks)
  • packages/language/package.json (1 hunks)
  • packages/misc/redwood/package.json (1 hunks)
  • packages/plugins/openapi/package.json (2 hunks)
  • packages/plugins/openapi/src/generator-base.ts (1 hunks)
  • packages/plugins/openapi/src/rest-generator.ts (2 hunks)
  • packages/plugins/openapi/src/rpc-generator.ts (3 hunks)
  • packages/plugins/swr/package.json (2 hunks)
  • packages/plugins/swr/src/generator.ts (2 hunks)
  • packages/plugins/tanstack-query/package.json (2 hunks)
  • packages/plugins/tanstack-query/src/generator.ts (2 hunks)
  • packages/plugins/trpc/package.json (2 hunks)
  • packages/plugins/trpc/src/generator.ts (1 hunks)
  • packages/plugins/trpc/src/helpers.ts (1 hunks)
  • packages/runtime/package.json (1 hunks)
  • packages/schema/package.json (2 hunks)
  • packages/schema/src/cli/plugin-runner.ts (2 hunks)
  • packages/schema/src/plugins/enhancer/enhance/index.ts (1 hunks)
  • packages/schema/src/plugins/zod/generator.ts (3 hunks)
  • packages/schema/src/plugins/zod/transformer.ts (4 hunks)
  • packages/schema/src/plugins/zod/types.ts (2 hunks)
  • packages/sdk/package.json (2 hunks)
  • packages/sdk/src/dmmf-helpers/aggregate-helpers.ts (1 hunks)
  • packages/sdk/src/dmmf-helpers/include-helpers.ts (2 hunks)
  • packages/sdk/src/dmmf-helpers/missing-types-helper.ts (1 hunks)
  • packages/sdk/src/dmmf-helpers/model-helpers.ts (1 hunks)
  • packages/sdk/src/dmmf-helpers/modelArgs-helpers.ts (1 hunks)
  • packages/sdk/src/dmmf-helpers/select-helpers.ts (2 hunks)
  • packages/sdk/src/dmmf-helpers/types.ts (1 hunks)
  • packages/sdk/src/types.ts (1 hunks)
  • packages/server/package.json (1 hunks)
  • packages/testtools/package.json (2 hunks)
  • packages/testtools/src/schema.ts (2 hunks)
Files skipped from review due to trivial changes (7)
  • package.json
  • packages/ide/jetbrains/package.json
  • packages/language/package.json
  • packages/misc/redwood/package.json
  • packages/plugins/openapi/src/generator-base.ts
  • packages/runtime/package.json
  • packages/server/package.json
Additional comments not posted (44)
packages/sdk/src/dmmf-helpers/types.ts (2)

1-1: Updated import to use local DMMF type aligns with project's goal to reduce external dependencies.


4-8: Type definitions using the local DMMF types are correctly updated and consistent.

packages/schema/src/plugins/zod/types.ts (2)

1-1: Updated import to use DMMF from @zenstackhq/sdk supports centralization of dependencies.


14-14: Type definitions using DMMF from @zenstackhq/sdk are correctly updated and consistent.

packages/sdk/src/dmmf-helpers/missing-types-helper.ts (2)

1-1: Updated import to use local DMMF type aligns with project's goal to reduce external dependencies.


Line range hint 5-13: Functionality using the local DMMF types is correctly implemented and consistent.

packages/testtools/package.json (2)

3-3: Version update to "2.0.0-beta.10" aligns with the project's goal to standardize versions.


3-3: Removal of dependency on @prisma/generator-helper aligns with the project's goal to shift to local or alternative modules.

packages/sdk/package.json (2)

3-3: Version update to "2.0.0-beta.10" aligns with the project's goal to standardize versions.


21-22: Dependency updates to version "5.7.0" for @prisma/generator-helper and @prisma/internals align with the project's goal to pin versions.

packages/sdk/src/dmmf-helpers/model-helpers.ts (2)

1-1: Updated import to use local DMMF type aligns with project's goal to reduce external dependencies.


1-4: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [3-24]

Functionality using the local DMMF types is correctly implemented and consistent.

packages/plugins/trpc/package.json (2)

4-4: Version update to "2.0.0-beta.10" aligns with the project's goal to standardize versions.


4-4: Removal of dependency on @prisma/generator-helper aligns with the project's goal to shift to local or alternative modules.

packages/plugins/openapi/package.json (2)

4-4: Version update to "2.0.0-beta.10" aligns with the project's goal to standardize versions.


4-4: Removal of dependency on @prisma/generator-helper aligns with the project's goal to shift to local or alternative modules.

packages/sdk/src/types.ts (1)

97-97: Export of DMMF type aligns with project refactoring goals and improves modularity.

packages/plugins/swr/package.json (2)

4-4: Version update to "2.0.0-beta.10" is consistent with project-wide standardization.


4-4: Removal of dependency on @prisma/generator-helper aligns with the shift towards using local or alternative modules.

packages/sdk/src/dmmf-helpers/modelArgs-helpers.ts (1)

1-1: Updated import path for DMMF enhances maintainability and aligns with centralization efforts.

packages/ide/jetbrains/build.gradle.kts (1)

12-12: Version update in Gradle build file is consistent with project-wide version standardization.

packages/sdk/src/dmmf-helpers/aggregate-helpers.ts (1)

2-2: Updated import path for DMMF enhances maintainability and aligns with centralization efforts.

packages/sdk/src/dmmf-helpers/include-helpers.ts (2)

1-1: Updated import path for DMMF enhances maintainability and aligns with centralization efforts.


55-55: Updates to function signatures ensure consistency and correct functionality with the new DMMF type.

packages/plugins/tanstack-query/package.json (2)

4-4: Version update to "2.0.0-beta.10" is consistent with project-wide standardization.


4-4: Removal of dependency on @prisma/generator-helper aligns with the shift towards using local or alternative modules.

packages/schema/package.json (2)

6-6: Version update to "2.0.0-beta.10" is consistent with project-wide standardization.


6-6: Removal of dependency on @prisma/generator-helper aligns with the shift towards using local or alternative modules.

packages/sdk/src/dmmf-helpers/select-helpers.ts (2)

1-1: Updated import path for DMMF to use a relative path. Ensure that the new path correctly resolves to the intended module.


111-111: Replaced DMMF.SchemaArgInputType with DMMF.InputTypeRef. Verify that InputTypeRef correctly represents the intended type structure and that all usages are consistent with the new type definition.

packages/testtools/src/schema.ts (1)

11-11: Switched the import of DMMF to @zenstackhq/sdk from @prisma/generator-helper. Confirm that all properties and methods of DMMF used in this file are available in the new module.

Verification successful

The search results confirm that the DMMF type and the getDMMF function from @zenstackhq/sdk are indeed used in the schema.ts file and other parts of the codebase. The usage patterns in schema.ts and other files suggest that the properties and methods accessed are consistent with those provided by @zenstackhq/sdk, as no errors or mismatches in the usage of DMMF or getDMMF have been identified.

Given this information, it appears that the switch from @prisma/generator-helper to @zenstackhq/sdk for the DMMF import in schema.ts is correctly implemented across the codebase. The properties and methods of DMMF used in schema.ts and related files are available and correctly referenced from the new module.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for any missing or altered properties/methods in the new `DMMF` import.
ast-grep --lang typescript --pattern $'DMMF.$_'

Length of output: 48



Script:

#!/bin/bash
# Search for files that import 'schema.ts' to check if they use `DMMF` indirectly.
rg --files-with-matches "import .* from '.*schema.ts'" --glob '*.ts'

# Additionally, search for any pattern that might indirectly use `DMMF` such as method calls or property accesses that are not captured by the previous pattern.
ast-grep --lang typescript --pattern $'import { $_ } from "@zenstackhq/sdk"; $$$ .$_($_)' --glob '*.ts'

Length of output: 375



Script:

#!/bin/bash
# Correcting the previous ast-grep command to remove the unsupported '--glob' option and rerun the search for any pattern that might indirectly use `DMMF`.
ast-grep --lang typescript --pattern $'import { $_ } from "@zenstackhq/sdk"; $$$ .$_($_)'

Length of output: 562



Script:

#!/bin/bash
# Simplify the search to directly look for references to `DMMF` or the import statement from `@zenstackhq/sdk`.
rg 'DMMF' --type ts
rg '@zenstackhq/sdk' --type ts

Length of output: 24361

packages/plugins/trpc/src/helpers.ts (1)

1-1: Reordered imports and adjusted the import statement for DMMF and PluginOptions. Ensure that the new order of imports does not affect the resolution and that all used types are correctly imported.

packages/plugins/swr/src/generator.ts (1)

12-12: Updated the import for DMMF to use @zenstackhq/sdk instead of @prisma/generator-helper. Verify that the DMMF structure from the new source matches the expected usage in this file.

packages/schema/src/cli/plugin-runner.ts (1)

14-14: Added a type declaration for DMMF. Ensure that this type is correctly used throughout the file and matches the expected structure.

packages/plugins/trpc/src/generator.ts (1)

11-12: The import of DMMF and PluginOptions as types from @zenstackhq/sdk aligns with the PR's goal to centralize type definitions and reduce dependency on external packages. This change should help in maintaining consistency across the project.

packages/schema/src/plugins/enhancer/enhance/index.ts (1)

3-11: The reorganization of imports and the adjustment to import DMMF and PluginOptions as types from @zenstackhq/sdk are well-aligned with the PR's objectives to streamline dependencies and improve maintainability. This change should help in reducing coupling with external packages.

packages/schema/src/plugins/zod/generator.ts (1)

13-13: The adjustment to import DMMF as a type from @zenstackhq/sdk is consistent with the PR's objectives to centralize type definitions and reduce dependency on external packages. This change should help in maintaining consistency across the project.

packages/plugins/tanstack-query/src/generator.ts (1)

13-13: Change of import source for DMMF type aligns with project's dependency management strategy.

packages/plugins/openapi/src/rpc-generator.ts (2)

3-3: Reordering of imports and inclusion of DMMF improves clarity and consistency.


804-804: Modification of prismaTypeToOpenAPIType to accept a string type enhances flexibility and decouples the method from specific structures.

packages/schema/src/plugins/zod/transformer.ts (3)

2-7: The updated imports from @zenstackhq/sdk are correctly organized and include necessary types such as PluginOptions and DMMF. This aligns with the PR's objective to shift away from @prisma/generator-helper to @zenstackhq/sdk.


193-193: The method wrapWithZodValidators now correctly uses PrismaDMMF.InputTypeRef for the inputType parameter. This change is consistent with the PR's goal to use PrismaDMMF types across the project.


223-223: The method generatePrismaStringLine has been adjusted to use PrismaDMMF.InputTypeRef for the inputType parameter. This update is part of the broader refactoring to use PrismaDMMF consistently, which is a key objective of the PR.

packages/plugins/openapi/src/rest-generator.ts (1)

12-12: The import of DMMF has been correctly updated to come from @zenstackhq/sdk instead of @prisma/generator-helper. This change supports the PR's goal of removing dependencies on @prisma/generator-helper and using @zenstackhq/sdk for better integration and consistency across the project.


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

Note: Auto-reply has been disabled for this repository by the repository owner. 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@ymc9 ymc9 merged commit 81c7e87 into v2 Apr 11, 2024
12 checks passed
@ymc9 ymc9 deleted the chore/pin-prisma-internals branch April 11, 2024 07:41
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