-
-
Notifications
You must be signed in to change notification settings - Fork 17
feat: delegate client typing #117
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
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
Documentation and Community
|
|
Claude finished @ymc9's task —— View job PR Review: Delegate Client TypingThis PR implements delegate model typing with discriminated unions - a sophisticated feature that allows model inheritance with proper TypeScript type safety. Review Progress
✅ Strengths1. Excellent Type Safety Implementation
2. Comprehensive Test Coverage
3. Well-Architected Design
|
There was a problem hiding this 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 implements delegate client typing functionality, extending the ZenStack framework to support delegate model patterns with proper TypeScript typing and runtime behavior.
- Adds schema generation support for delegate models with discriminator fields and sub-models
- Implements TypeScript type system support for delegate unions and discriminated types
- Restricts operations on delegate models to prevent invalid creation/update patterns
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| turbo.json | Adds "watch" task configuration for development workflow |
| packages/sdk/src/ts-schema-generator.ts | Implements core schema generation logic for delegate models, discriminator fields, and sub-model tracking |
| packages/sdk/src/schema/schema.ts | Extends schema type definitions with delegate model metadata and discriminator field support |
| packages/runtime/test/schemas/delegate/* | Adds comprehensive test schema and type checking for delegate model functionality |
| packages/runtime/src/client/query-builder.ts | Filters out inherited fields from delegate base models in query builder |
| packages/runtime/src/client/plugin.ts | Updates plugin hook interface to include client reference |
| packages/runtime/src/client/crud-types.ts | Implements delegate union result types and restricts operations on discriminator fields |
| packages/runtime/src/client/contract.ts | Excludes unsupported operations from delegate model interfaces |
| packages/runtime/src/client/client-impl.ts | Updates operation hook implementation for proper typing |
| .vscode/tasks.json | Updates build tasks and adds PR submission task |
Comments suppressed due to low confidence (1)
packages/runtime/src/client/plugin.ts:198
- This commented-out parameter should be removed rather than left as a comment. Dead code comments reduce code readability and should be cleaned up.
args: Parameters<ModelOperations<Schema, Model>[Operation]>[0],
|
Claude finished @ymc9's task —— View job PR Review: Delegate Client Typing This PR implements delegate model typing with discriminated unions - a sophisticated feature that allows model inheritance with proper TypeScript type safety. Review Progress
✅ Strengths1. Excellent Type Safety Implementation
2. Comprehensive Test Coverage
3. Well-Architected Design
|
No description provided.