Skip to content

feat: support prisma format indentation #1256

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 5 commits into from
Apr 15, 2024
Merged

feat: support prisma format indentation #1256

merged 5 commits into from
Apr 15, 2024

Conversation

jiashengguo
Copy link
Member

@jiashengguo jiashengguo commented Apr 14, 2024

#885

Summary by CodeRabbit

  • New Features

    • Introduced a new model for a collaborative Todo app, including data sources, enums, and models.
    • Added a new --no-prisma-style option to the formatting command.
  • Refactor

    • Streamlined import statements across multiple files for better maintainability and performance.
  • Bug Fixes

    • Adjusted spacing in the User model declaration for improved readability.
  • Tests

    • Added test cases to verify new formatting options in CLI integration tests.

ymc9 and others added 2 commits April 14, 2024 22:17
…ng of prisma packages

- Solves the problem that launching language server triggers loading "@prisma/internals"
- Removes several old logic for detecting Prisma versions
Copy link
Contributor

coderabbitai bot commented Apr 14, 2024

Walkthrough

Walkthrough

The update focuses on reorganizing import statements within the ZenStack SDK, particularly shifting the DMMF import paths from @zenstackhq/sdk to @zenstackhq/sdk/prisma. It also introduces a new model for a collaborative Todo app and adjusts CLI options related to formatting styles.

Changes

Files Change Summary
.../openapi/src/*, .../trpc/src/* Updated DMMF import paths and reorganized related imports.
.../swr/src/generator.ts, .../tanstack-query/src/generator.ts Removed unused imports and simplified logic for prismaVersion.
.../schema/src/cli/* Added new CLI options and updated DMMF import paths.
.../schema/src/plugins/* Reorganized and updated import paths for DMMF and related imports.
.../sdk/src/dmmf-helpers/*, .../sdk/src/* Updated DMMF import paths and adjusted export mappings.
.../testtools/src/schema.ts, .../tests/integration/tests/cli/format.test.ts Updated import paths and added new test cases.

Possibly related issues

  • Issue [Feature Request] ZenStack for API integration #563: The changes in this PR could potentially support enhancing the Prisma Schema Language and unified CRUD API style by updating import paths and dependencies, aligning with objectives to improve developer experience and system consistency.
  • Issue Is prettier required in zenstadk sdk ? #1079: While this PR doesn't directly address prettier, the focus on dependency management and code organization could indirectly relate to discussions about code formatting practices within the SDK.

Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between eb75ac5 and 6a9937f.
Files selected for processing (2)
  • packages/schema/src/cli/actions/format.ts (2 hunks)
  • packages/schema/src/language-server/zmodel-formatter.ts (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • packages/schema/src/cli/actions/format.ts
  • packages/schema/src/language-server/zmodel-formatter.ts

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.

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: 3

@ymc9
Copy link
Member

ymc9 commented Apr 15, 2024

Fixes  #885 #1092

@ymc9 ymc9 merged commit b0f5d3b into v2 Apr 15, 2024
11 checks passed
@ymc9 ymc9 deleted the jiasheng-v2-format branch April 15, 2024 01:26
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.

2 participants