Skip to content

Conversation

@ymc9
Copy link
Member

@ymc9 ymc9 commented Jul 17, 2025

Summary by CodeRabbit

  • Chores

    • Updated package versions across multiple modules to 3.0.0-alpha.12.
  • Refactor

    • Improved internal type mapping logic for better maintainability and clarity.
    • Enhanced type parameter usage in operation handlers for improved TypeScript support.
  • Tests

    • Added explicit typing in computed field test cases for clarity.

ymc9 and others added 2 commits July 17, 2025 10:33
Copilot AI review requested due to automatic review settings July 17, 2025 08:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR merges development changes to main, primarily involving a version bump from 3.0.0-alpha.11 to 3.0.0-alpha.12 across all packages in the monorepo. The key changes include version updates and some TypeScript improvements for better type safety and compiler performance.

  • Version bump across all packages from 3.0.0-alpha.11 to 3.0.0-alpha.12
  • Improved TypeScript type definitions and explicit type parameters for better performance
  • Enhanced type safety in test files and runtime utilities

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Root package version update
packages/*/package.json Version updates for all package dependencies
packages/runtime/src/utils/type-utils.ts Refactored type mapping from conditional types to indexed access types
packages/runtime/src/client/client-impl.ts Added explicit type parameters to operation handlers for improved TypeScript performance
packages/runtime/test/client-api/computed-fields.test.ts Added explicit any type annotations to callback parameters

@coderabbitai
Copy link

coderabbitai bot commented Jul 17, 2025

Walkthrough

This update increments the version number from 3.0.0-alpha.11 to 3.0.0-alpha.12 across multiple package.json files in the repository. Additionally, there are minor internal TypeScript improvements: explicit generic parameters are added to handler instantiations, a type alias is refactored for clarity, and explicit typings are added in test files.

Changes

Files/Groups Change Summary
All package.json files across packages and samples Version updated from 3.0.0-alpha.11 to 3.0.0-alpha.12. No other changes.
packages/runtime/src/client/client-impl.ts Explicitly adds <Schema> generic type to all operation handler instantiations in createModelCrudHandler.
packages/runtime/src/utils/type-utils.ts Refactors MapBaseType<T> type alias to use a mapped object type TypeMap for improved clarity.
packages/runtime/test/client-api/computed-fields.test.ts Adds explicit typing (eb: any) to parameters in computed field functions in two test cases.

Poem

🐇
A hop, a skip, a version jump anew,
From alpha.11 to twelve, we flew!
Types are clearer, handlers neat,
Type maps tidy, tests complete.
With every hop, our code grows bright—
Release by release, it feels just right!

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/runtime/src/client/client-impl.ts

Oops! Something went wrong! :(

ESLint: 9.29.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

packages/runtime/test/client-api/computed-fields.test.ts

Oops! Something went wrong! :(

ESLint: 9.29.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

packages/runtime/src/utils/type-utils.ts

Oops! Something went wrong! :(

ESLint: 9.29.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f8d6de and 32936db.

📒 Files selected for processing (18)
  • package.json (1 hunks)
  • packages/cli/package.json (1 hunks)
  • packages/common-helpers/package.json (1 hunks)
  • packages/create-zenstack/package.json (1 hunks)
  • packages/eslint-config/package.json (1 hunks)
  • packages/ide/vscode/package.json (1 hunks)
  • packages/language/package.json (1 hunks)
  • packages/runtime/package.json (1 hunks)
  • packages/runtime/src/client/client-impl.ts (1 hunks)
  • packages/runtime/src/utils/type-utils.ts (1 hunks)
  • packages/runtime/test/client-api/computed-fields.test.ts (2 hunks)
  • packages/sdk/package.json (1 hunks)
  • packages/tanstack-query/package.json (1 hunks)
  • packages/testtools/package.json (1 hunks)
  • packages/typescript-config/package.json (1 hunks)
  • packages/zod/package.json (1 hunks)
  • samples/blog/package.json (1 hunks)
  • tests/e2e/package.json (1 hunks)
🔇 Additional comments (19)
samples/blog/package.json (1)

3-3: Version bump looks correct, no further changes required
The sample’s version has been aligned with the repo-wide release tag; nothing else was touched.

tests/e2e/package.json (1)

3-3: E2E package version updated consistently – all good
Version synchronisation only; CI pipelines depending on the tag should keep working.

packages/zod/package.json (1)

3-3: Scoped package version bump verified
Change is isolated to the version field; peer / workspace ranges remain intact.

packages/typescript-config/package.json (1)

3-3: TS config package version bump LGTM
No side-effects detected.

packages/runtime/package.json (1)

3-3: Runtime package version increment confirmed
Everything else (exports, deps, scripts) unchanged.

packages/tanstack-query/package.json (1)

3-3: Version bump looks good
The package now targets 3.0.0-alpha.12, aligning with the rest of the workspace.

packages/eslint-config/package.json (1)

3-3: Consistent version update
Nothing else changed – LGTM.

packages/cli/package.json (1)

6-6: CLI package version synced
Bump to alpha.12 matches the coordinated release.

packages/language/package.json (1)

4-4: Language package in lock-step
No additional changes; the new pre-release tag is correct.

package.json (2)

3-3: Root version updated correctly
Monorepo root now reflects 3.0.0-alpha.12.


1-42: Version consistency check passed

No occurrences of "version": "3.0.0-alpha.11" were found in any package.json (confirmed via ripgrep), so all packages are correctly updated.

packages/common-helpers/package.json (1)

3-3: Version bump looks good
3.0.0-alpha.12 matches the coordinated release notes and no collateral fields were changed.

packages/testtools/package.json (1)

3-3: Consistent version update
The package follows the workspace-wide bump to 3.0.0-alpha.12. No issues spotted.

packages/sdk/package.json (1)

3-3: SDK version increment verified
Change is limited to the version field and aligns with other packages.

packages/create-zenstack/package.json (1)

3-3: Create-script version updated correctly
Nothing else modified; version bump is safe to merge.

packages/ide/vscode/package.json (1)

4-4: VSCode extension version bump acknowledged
3.0.0-alpha.12 keeps the extension in sync with the core packages.

packages/runtime/src/utils/type-utils.ts (1)

25-37: Excellent refactoring that improves type mapping clarity.

The refactoring from nested conditional types to a mapped object approach with TypeMap significantly improves readability and should enhance TypeScript compiler performance. The explicit type mappings are clear and maintainable, while preserving the same semantic behavior with the unknown fallback.

packages/runtime/src/client/client-impl.ts (2)

414-414: Good documentation explaining the purpose of explicit typing.

The comment clearly explains that the explicit type parameters are added to improve TypeScript compiler performance, which helps future maintainers understand the reasoning behind this pattern.


420-563: Excellent improvement to TypeScript compiler performance.

The explicit addition of <Schema> generic type parameters to all operation handler instantiations is a great enhancement that:

  • Improves TypeScript compiler performance by eliminating type inference overhead
  • Makes the code more self-documenting and explicit about type constraints
  • Maintains consistency across all CRUD operations

The pattern is applied consistently across all operation handlers (Find, Create, Update, Delete, Count, Aggregate, GroupBy) without changing runtime behavior.

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

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

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 added this pull request to the merge queue Jul 17, 2025
Merged via the queue into main with commit ed6cfe6 Jul 17, 2025
6 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.

2 participants