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: merge from dev #1205

Merged
merged 1 commit into from
Apr 2, 2024
Merged

chore: merge from dev #1205

merged 1 commit into from
Apr 2, 2024

Conversation

ymc9
Copy link
Member

@ymc9 ymc9 commented Apr 1, 2024

Summary by CodeRabbit

  • New Features
    • Expanded the automated update workflow to include additional repositories.
  • Enhancements
    • Improved query hook input type generation for better integration with Vue.
    • Enhanced Vue query and mutation options to support dynamic and computed references.
  • Refactor
    • Updated import statements for better compatibility and code clarity in plugins.

Copy link
Contributor

coderabbitai bot commented Apr 1, 2024

Walkthrough

Walkthrough

These updates introduce enhancements and adjustments across various components of a project, focusing on improving Vue integration with the Tanstack Query plugin and refining workflow configurations. Key changes include the addition of a new repository to a GitHub workflow, the introduction of a function to streamline query hook input type generation, and significant refactoring to support Vue-specific types and functionalities in the Tanstack Query plugin. Additionally, a minor adjustment in the TRPC plugin improves the handling of schema imports.

Changes

File(s) Change Summary
.github/workflows/update-samples.yml Added 'zenstackhq/sample-todo-nuxt' to the workflow configuration.
packages/plugins/tanstack-query/src/.../generator.ts Introduced makeQueryArgsType function; added new imports; modified query and mutation options logic.
packages/plugins/tanstack-query/src/.../vue.ts Enhanced Vue integration with new imports, refactored functions, and adjusted signatures.
packages/plugins/trpc/src/helpers.ts Modified $Schema import to use import * as $Schema.

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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

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

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e3209c7 and 626ba09.
Files ignored due to path filters (3)
  • packages/plugins/trpc/tests/projects/t3-trpc-v10/src/server/api/routers/generated/routers/Post.router.ts is excluded by !**/generated/**
  • packages/plugins/trpc/tests/projects/t3-trpc-v10/src/server/api/routers/generated/routers/User.router.ts is excluded by !**/generated/**
  • pnpm-lock.yaml is excluded by !pnpm-lock.yaml, !**/*.yaml
Files selected for processing (4)
  • .github/workflows/update-samples.yml (1 hunks)
  • packages/plugins/tanstack-query/src/generator.ts (5 hunks)
  • packages/plugins/tanstack-query/src/runtime/vue.ts (7 hunks)
  • packages/plugins/trpc/src/helpers.ts (1 hunks)
Additional Context Used
Additional comments not posted (12)
.github/workflows/update-samples.yml (1)

19-19: The addition of 'zenstackhq/sample-todo-nuxt' to the list of repositories in the GitHub Actions workflow configuration looks good and follows the existing pattern.

packages/plugins/tanstack-query/src/runtime/vue.ts (5)

8-8: Added imports for QueryKey, UseInfiniteQueryOptions, UseMutationOptions, and UseQueryOptions are appropriate for the enhancements made to the plugin.


14-14: The addition of ComputedRef, MaybeRefOrGetter, and toValue imports from vue aligns with the goal of deeper integration with Vue's reactivity system. This is a positive change for Vue developers using the plugin.


65-88: Refactoring of useModelQuery to use computed options and adjustments in function signatures to accept MaybeRefOrGetter or ComputedRef for arguments and options is a significant improvement. It leverages Vue's reactivity system more effectively. Ensure that all calls to this function are updated to match the new signature.


104-121: The handling of queryKey and pageParam in useInfiniteModelQuery through the use of MaybeRefOrGetter or ComputedRef for arguments and options is a thoughtful addition. It enhances the plugin's flexibility and usability within Vue applications.


167-180: > 📝 NOTE

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

Utilization of toValue for options handling in useModelMutation and the adjustments in function signatures to accept Vue-specific types is a commendable improvement. It simplifies the usage of mutation options within Vue applications. However, ensure that the typing problem mentioned in the TODO comment is addressed to avoid potential issues.

Would you like me to help address the typing problem mentioned in the TODO comment?

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

240-240: Modifying the import statement for $Schema to use import * as $Schema is a best practice for handling modules that export multiple members or to address TypeScript module resolution quirks. This change is likely to improve the reliability of schema imports for the trpc plugin.

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

97-97: The introduction of the makeQueryArgsType function to refine the logic for generating query hook input types is a positive change. It enhances the flexibility and usability of the plugin within Vue applications by allowing for Vue-specific types.


570-570: Adding imports for MaybeRefOrGetter and ComputedRef in the makeBaseImports function is necessary for the enhancements made to the plugin. This change supports the integration with Vue.js by allowing the plugin to handle Vue-specific types more effectively.


590-597: The makeQueryArgsType function's implementation to handle Vue-specific types (MaybeRefOrGetter and ComputedRef) is a thoughtful addition. It ensures that the plugin can leverage Vue's reactivity system more effectively.


617-622: The adjustments in the makeQueryOptions function to return Vue-specific types (MaybeRefOrGetter or ComputedRef) for query options is a significant improvement. It enhances the plugin's integration with Vue.js by allowing for more flexible and reactive query options.


647-650: The modifications in the makeMutationOptions function to handle Vue-specific types for mutation options is a commendable improvement. It simplifies the usage of mutation options within Vue applications and aligns with the goal of deeper integration with Vue's reactivity system.

@ymc9 ymc9 merged commit ef4d5e1 into v2 Apr 2, 2024
12 checks passed
@ymc9 ymc9 deleted the chore/merge-dev-0401 branch April 2, 2024 00:01
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