feat: strict types - #2792
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds ChangesStrict type definition support
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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
packages/clients/tanstack-query/test/react/react-typing.test-d.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. packages/clients/tanstack-query/test/svelte/svelte-typing-test.tsESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. packages/clients/tanstack-query/test/vue/vue-typing-test.tsESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/orm/src/client/zod/factory.ts`:
- Around line 465-467: Update the strictness selection in the schema factory
around isStrict to use typeDef.strict === true instead of scanning
typeDef.attributes for @@strict. Preserve the existing z.strictObject and
z.looseObject selection so runtime validation matches the shared TypeDefDef
strictness contract.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6bdf47c3-47d3-460c-8073-cbee101456f1
📒 Files selected for processing (12)
packages/cli/test/ts-schema-gen.test.tspackages/language/res/stdlib.zmodelpackages/language/src/validators/attribute-application-validator.tspackages/language/test/attribute-application.test.tspackages/orm/src/client/crud-types.tspackages/orm/src/client/zod/factory.tspackages/schema/src/schema.tspackages/sdk/src/ts-schema-generator.tstests/e2e/orm/client-api/procedures.test.tstests/e2e/orm/client-api/typed-json-fields.test.tstests/e2e/orm/schemas/procedures/schema.tstests/e2e/orm/schemas/procedures/schema.zmodel
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/clients/tanstack-query/test/schemas/basic/schema.zmodel`:
- Around line 38-41: Make Profile.bio optional by changing its ZModel
declaration to use the optional string type in
packages/clients/tanstack-query/test/schemas/basic/schema.zmodel:38-41. Then run
zenstack generate to regenerate
packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts:174-188,
ensuring Profile.fields.bio.optional is true.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ac00b7a9-3be4-49b9-91af-1461a683f680
📒 Files selected for processing (10)
packages/clients/fetch-client/test/fetch-client.test.tspackages/clients/fetch-client/test/schemas/basic/schema-lite.tspackages/clients/fetch-client/test/schemas/basic/schema.zmodelpackages/clients/fetch-client/test/schemas/no-procs/schema.tspackages/clients/fetch-client/test/typing.test-d.tspackages/clients/tanstack-query/test/react/react-typing.test-d.tspackages/clients/tanstack-query/test/schemas/basic/schema-lite.tspackages/clients/tanstack-query/test/schemas/basic/schema.zmodelpackages/clients/tanstack-query/test/svelte/svelte-typing-test.tspackages/clients/tanstack-query/test/vue/vue-typing-test.ts
Adds support for specifying custom type definitions should reject unknown fields via a new
@@strictattribute. This is reflected in both intellisense and runtime input validation.Sample Usage
Summary by CodeRabbit
New Features
@@strictattribute for type definitions.updateProfileoperation in the example API.Bug Fixes
@@stricton models or enums now reports a validation error.