refactor(orm): simplify model results typing#485
Conversation
|
Warning Rate limit exceeded@ymc9 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 8 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (7)
WalkthroughRefactors type-level API: introduces QueryOptions/ToQueryOptions, renames SimplifiedModelResult → SimplifiedPlainResult/SimplifiedResult, and threads an Options generic through ORM core types and TanStack Query client hooks; updates generated payloads, sample schemas, and test-generation tooling. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Areas to focus during review:
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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 |
|
Claude finished @ymc9's task —— View job PR Review: Simplify Model Results Typing ✅I've completed a comprehensive review of this refactoring PR that simplifies model results typing across the ORM and client packages. Review Checklist
SummaryThis PR successfully refactors the TypeScript typing system for model results, making the type system cleaner and more consistent. The main changes involve:
Code Quality Assessment✅ Strengths
✅ Best Practices Followed
Technical AnalysisCore Changes in
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/clients/tanstack-query/src/vue.ts (1)
105-119: Inconsistent use ofQueryOptions<Schema>instead ofOptionsinModelMutationModelResult.On line 112,
ModelMutationResultuses hardcodedQueryOptions<Schema>instead of theOptionsgeneric parameter:ModelMutationResult<SimplifiedResult<Schema, Model, TArgs, QueryOptions<Schema>, false, Array>, TArgs>This should use
Optionsfor consistency with the rest of the type and withreact.ts(line 134) which correctly usesOptions:ModelMutationResult<SimplifiedResult<Schema, Model, TArgs, Options, false, Array>, TArgs>export type ModelMutationModelResult< Schema extends SchemaDef, Model extends GetModels<Schema>, TArgs, Array extends boolean = false, Options extends QueryOptions<Schema> = QueryOptions<Schema>, > = Omit< - ModelMutationResult<SimplifiedResult<Schema, Model, TArgs, QueryOptions<Schema>, false, Array>, TArgs>, + ModelMutationResult<SimplifiedResult<Schema, Model, TArgs, Options, false, Array>, TArgs>, 'mutateAsync' > & {
🧹 Nitpick comments (2)
tests/e2e/orm/schemas/auth-type/input.ts (1)
9-10: Ensure the generator doesn’t emit redundant@zenstackhq/ormimports (could be merged into one).Right now it imports from
@zenstackhq/ormtwice (Line 9-10). If the generator can consolidate to a singleimport type { ... } from "@zenstackhq/orm", it’ll reduce generated noise.tests/e2e/github-repos/trigger.dev/input.ts (1)
9-10: Consider merging the two@zenstackhq/ormtype-only imports (generator/template cleanup).This is generated, but the output can be simplified by emitting a single
import type { ... } from "@zenstackhq/orm"(smaller file, less duplication).-import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; -import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions, SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm";
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (31)
packages/clients/tanstack-query/package.json(1 hunks)packages/clients/tanstack-query/src/react.ts(3 hunks)packages/clients/tanstack-query/src/svelte.ts(3 hunks)packages/clients/tanstack-query/src/vue.ts(3 hunks)packages/clients/tanstack-query/test/schemas/basic/input.ts(6 hunks)packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts(2 hunks)packages/orm/src/client/contract.ts(16 hunks)packages/orm/src/client/crud-types.ts(8 hunks)packages/orm/src/client/options.ts(1 hunks)packages/sdk/src/ts-schema-generator.ts(4 hunks)samples/next.js/zenstack/input.ts(3 hunks)samples/orm/zenstack/input.ts(4 hunks)scripts/test-generate.ts(1 hunks)tests/e2e/apps/rally/zenstack/input.ts(28 hunks)tests/e2e/github-repos/formbricks/input.ts(36 hunks)tests/e2e/github-repos/trigger.dev/input.ts(52 hunks)tests/e2e/orm/schemas/auth-type/input.ts(2 hunks)tests/e2e/orm/schemas/basic/input.ts(5 hunks)tests/e2e/orm/schemas/default-auth/input.ts(4 hunks)tests/e2e/orm/schemas/delegate/input.ts(8 hunks)tests/e2e/orm/schemas/json/input.ts(2 hunks)tests/e2e/orm/schemas/name-mapping/input.ts(3 hunks)tests/e2e/orm/schemas/omit/input.ts(5 hunks)tests/e2e/orm/schemas/petstore/input.ts(4 hunks)tests/e2e/orm/schemas/todo/input.ts(6 hunks)tests/e2e/orm/schemas/todo/schema.ts(2 hunks)tests/e2e/orm/schemas/typed-json/input.ts(2 hunks)tests/e2e/orm/schemas/typing/input.ts(7 hunks)tests/e2e/package.json(1 hunks)tests/runtimes/bun/schemas/input.ts(3 hunks)tests/runtimes/edge-runtime/schemas/input.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
tests/e2e/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
E2E tests should validate real-world schema compatibility with established projects
Files:
tests/e2e/orm/schemas/default-auth/input.tstests/e2e/orm/schemas/todo/schema.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/json/input.tstests/e2e/orm/schemas/delegate/input.tstests/e2e/orm/schemas/basic/input.tstests/e2e/apps/rally/zenstack/input.tstests/e2e/orm/schemas/name-mapping/input.tstests/e2e/orm/schemas/omit/input.tstests/e2e/orm/schemas/auth-type/input.tstests/e2e/orm/schemas/todo/input.tstests/e2e/github-repos/trigger.dev/input.tstests/e2e/github-repos/formbricks/input.tstests/e2e/orm/schemas/typed-json/input.ts
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Use Kysely as the query builder interface for low-level database queries, avoiding raw SQL when possible
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Implement plugin hooks at ORM, Kysely, and entity mutation levels for query interception and customization
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to tests/e2e/**/*.{ts,tsx} : E2E tests should validate real-world schema compatibility with established projects
Applied to files:
scripts/test-generate.tstests/e2e/package.jsontests/e2e/orm/schemas/default-auth/input.tspackages/clients/tanstack-query/test/schemas/basic/schema-lite.tstests/e2e/orm/schemas/todo/schema.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/json/input.tstests/e2e/orm/schemas/basic/input.tspackages/clients/tanstack-query/test/schemas/basic/input.tstests/e2e/orm/schemas/name-mapping/input.tstests/runtimes/edge-runtime/schemas/input.tstests/e2e/orm/schemas/omit/input.tstests/e2e/orm/schemas/auth-type/input.tstests/e2e/orm/schemas/todo/input.tstests/e2e/github-repos/trigger.dev/input.tstests/e2e/orm/schemas/typed-json/input.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/cli/**/*.test.{ts,tsx} : CLI package tests should focus on action-specific tests for each command
Applied to files:
scripts/test-generate.tstests/e2e/package.jsonpackages/clients/tanstack-query/package.json
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to **/*.zmodel : ZModel schema files should define database structure and policies that compile to TypeScript via `zenstack generate`
Applied to files:
scripts/test-generate.tstests/e2e/orm/schemas/default-auth/input.tspackages/clients/tanstack-query/test/schemas/basic/schema-lite.tspackages/orm/src/client/contract.tstests/e2e/orm/schemas/todo/schema.tstests/runtimes/bun/schemas/input.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/json/input.tstests/e2e/orm/schemas/delegate/input.tstests/e2e/orm/schemas/basic/input.tspackages/clients/tanstack-query/test/schemas/basic/input.tstests/e2e/apps/rally/zenstack/input.tspackages/sdk/src/ts-schema-generator.tstests/e2e/orm/schemas/name-mapping/input.tstests/runtimes/edge-runtime/schemas/input.tstests/e2e/orm/schemas/omit/input.tstests/e2e/orm/schemas/auth-type/input.tstests/e2e/github-repos/trigger.dev/input.tssamples/next.js/zenstack/input.tstests/e2e/github-repos/formbricks/input.tstests/e2e/orm/schemas/typed-json/input.tssamples/orm/zenstack/input.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to **/*.zmodel : Always run `zenstack generate` after modifying ZModel schemas
Applied to files:
scripts/test-generate.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Use Turbo for build orchestration and run `pnpm build`, `pnpm watch`, `pnpm lint`, and `pnpm test` for development tasks
Applied to files:
tests/e2e/package.jsonpackages/clients/tanstack-query/package.json
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to tests/**/type*.{ts,tsx} : Ensure TypeScript inference and type coverage are validated through type coverage tests
Applied to files:
tests/e2e/package.jsonpackages/clients/tanstack-query/package.json
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Use Kysely as the query builder interface for low-level database queries, avoiding raw SQL when possible
Applied to files:
tests/e2e/orm/schemas/default-auth/input.tspackages/orm/src/client/options.tspackages/clients/tanstack-query/package.jsonpackages/orm/src/client/contract.tstests/runtimes/bun/schemas/input.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/json/input.tstests/e2e/orm/schemas/delegate/input.tspackages/clients/tanstack-query/src/svelte.tstests/e2e/orm/schemas/basic/input.tspackages/clients/tanstack-query/test/schemas/basic/input.tstests/e2e/apps/rally/zenstack/input.tspackages/sdk/src/ts-schema-generator.tstests/e2e/orm/schemas/name-mapping/input.tstests/runtimes/edge-runtime/schemas/input.tstests/e2e/orm/schemas/omit/input.tstests/e2e/orm/schemas/auth-type/input.tspackages/clients/tanstack-query/src/vue.tspackages/orm/src/client/crud-types.tstests/e2e/orm/schemas/todo/input.tstests/e2e/github-repos/trigger.dev/input.tspackages/clients/tanstack-query/src/react.tssamples/next.js/zenstack/input.tstests/e2e/github-repos/formbricks/input.tstests/e2e/orm/schemas/typed-json/input.tssamples/orm/zenstack/input.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Implement plugin hooks at ORM, Kysely, and entity mutation levels for query interception and customization
Applied to files:
tests/e2e/orm/schemas/default-auth/input.tspackages/orm/src/client/options.tspackages/orm/src/client/contract.tstests/runtimes/bun/schemas/input.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/json/input.tstests/e2e/orm/schemas/delegate/input.tspackages/clients/tanstack-query/src/svelte.tstests/e2e/orm/schemas/basic/input.tspackages/clients/tanstack-query/test/schemas/basic/input.tstests/e2e/apps/rally/zenstack/input.tspackages/sdk/src/ts-schema-generator.tstests/e2e/orm/schemas/name-mapping/input.tstests/runtimes/edge-runtime/schemas/input.tstests/e2e/orm/schemas/omit/input.tstests/e2e/orm/schemas/auth-type/input.tspackages/clients/tanstack-query/src/vue.tspackages/orm/src/client/crud-types.tstests/e2e/orm/schemas/todo/input.tstests/e2e/github-repos/trigger.dev/input.tspackages/clients/tanstack-query/src/react.tssamples/next.js/zenstack/input.tstests/e2e/github-repos/formbricks/input.tstests/e2e/orm/schemas/typed-json/input.tssamples/orm/zenstack/input.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.test.{ts,tsx} : ORM package tests should include comprehensive client API tests and policy tests
Applied to files:
tests/e2e/orm/schemas/default-auth/input.tspackages/orm/src/client/options.tspackages/clients/tanstack-query/package.jsonpackages/orm/src/client/contract.tstests/runtimes/bun/schemas/input.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/json/input.tstests/e2e/orm/schemas/delegate/input.tstests/e2e/orm/schemas/basic/input.tspackages/clients/tanstack-query/test/schemas/basic/input.tstests/e2e/apps/rally/zenstack/input.tspackages/sdk/src/ts-schema-generator.tstests/e2e/orm/schemas/name-mapping/input.tstests/runtimes/edge-runtime/schemas/input.tstests/e2e/orm/schemas/omit/input.tstests/e2e/orm/schemas/auth-type/input.tspackages/orm/src/client/crud-types.tstests/e2e/orm/schemas/todo/input.tstests/e2e/github-repos/trigger.dev/input.tspackages/clients/tanstack-query/src/react.tssamples/next.js/zenstack/input.tstests/e2e/github-repos/formbricks/input.tstests/e2e/orm/schemas/typed-json/input.tssamples/orm/zenstack/input.ts
📚 Learning: 2025-10-21T16:09:31.218Z
Learnt from: ymc9
Repo: zenstackhq/zenstack-v3 PR: 319
File: packages/runtime/src/client/executor/zenstack-query-executor.ts:63-72
Timestamp: 2025-10-21T16:09:31.218Z
Learning: In ZenStack, TypeDefs can be inherited by models. When a TypeDef contains fields with `map` attributes, those mapped field names need to be processed by the QueryNameMapper since they become part of the inheriting model's schema. Therefore, when checking if a schema has mapped names (e.g., in `schemaHasMappedNames`), both `schema.models` and `schema.typeDefs` must be inspected for `@map` and `map` attributes.
Applied to files:
packages/clients/tanstack-query/test/schemas/basic/schema-lite.tstests/e2e/orm/schemas/todo/schema.tstests/e2e/orm/schemas/name-mapping/input.ts
📚 Learning: 2025-10-21T16:04:56.292Z
Learnt from: ymc9
Repo: zenstackhq/zenstack-v3 PR: 319
File: packages/runtime/src/client/crud/dialects/base-dialect.ts:745-747
Timestamp: 2025-10-21T16:04:56.292Z
Learning: In packages/runtime/src/client/crud/dialects/base-dialect.ts, it's intentional that buildCursorFilter applies default ordering (via makeDefaultOrderBy fallback) while buildOrderBy does not. This ensures cursor-based pagination always has stable ordering for correctness, while regular queries remain unordered unless explicitly specified. This design is to be consistent with Prisma's pagination requirements.
Applied to files:
packages/orm/src/client/crud-types.ts
🧬 Code graph analysis (17)
scripts/test-generate.ts (2)
packages/sdk/src/ts-schema-generator.ts (1)
generate(64-78)packages/cli/src/utils/exec-utils.ts (1)
execSync(7-16)
tests/e2e/orm/schemas/default-auth/input.ts (13)
packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
UserGetPayload(30-30)samples/next.js/zenstack/input.ts (1)
UserGetPayload(30-30)tests/e2e/apps/rally/zenstack/input.ts (1)
UserGetPayload(50-50)tests/e2e/github-repos/formbricks/input.ts (1)
UserGetPayload(510-510)tests/e2e/github-repos/trigger.dev/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/delegate/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/name-mapping/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/omit/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/petstore/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/todo/input.ts (1)
UserGetPayload(70-70)tests/e2e/orm/schemas/typed-json/input.ts (1)
UserGetPayload(30-30)tests/runtimes/bun/schemas/input.ts (1)
UserGetPayload(30-30)tests/runtimes/edge-runtime/schemas/input.ts (1)
UserGetPayload(30-30)
packages/orm/src/client/options.ts (1)
packages/schema/src/schema.ts (1)
SchemaDef(11-19)
packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts (2)
samples/next.js/zenstack/schema-lite.ts (2)
SchemaType(9-105)schema(106-106)packages/schema/src/schema.ts (1)
SchemaDef(11-19)
packages/orm/src/client/contract.ts (3)
packages/schema/src/schema.ts (1)
GetModels(121-121)packages/orm/src/client/options.ts (2)
ToQueryOptions(156-156)QueryOptions(151-151)packages/orm/src/client/crud-types.ts (2)
SimplifiedPlainResult(256-261)DefaultModelResult(52-82)
tests/e2e/orm/schemas/todo/schema.ts (3)
samples/next.js/zenstack/schema-lite.ts (2)
SchemaType(9-105)schema(106-106)samples/orm/zenstack/schema.ts (2)
SchemaType(9-243)schema(244-244)tests/e2e/orm/schemas/default-auth/schema.ts (2)
SchemaType(9-121)schema(122-122)
tests/e2e/orm/schemas/petstore/input.ts (13)
packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
UserGetPayload(30-30)samples/next.js/zenstack/input.ts (1)
UserGetPayload(30-30)samples/orm/zenstack/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/basic/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/default-auth/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/delegate/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/name-mapping/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/omit/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/todo/input.ts (1)
UserGetPayload(70-70)tests/e2e/orm/schemas/typed-json/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/typing/input.ts (1)
UserGetPayload(30-30)tests/runtimes/bun/schemas/input.ts (1)
UserGetPayload(30-30)tests/runtimes/edge-runtime/schemas/input.ts (1)
UserGetPayload(30-30)
tests/e2e/orm/schemas/delegate/input.ts (16)
packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
UserGetPayload(30-30)samples/next.js/zenstack/input.ts (1)
UserGetPayload(30-30)samples/orm/zenstack/input.ts (1)
UserGetPayload(30-30)tests/e2e/apps/rally/zenstack/input.ts (2)
UserGetPayload(50-50)CommentGetPayload(230-230)tests/e2e/github-repos/formbricks/input.ts (1)
UserGetPayload(510-510)tests/e2e/github-repos/trigger.dev/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/basic/input.ts (2)
UserGetPayload(30-30)CommentGetPayload(70-70)tests/e2e/orm/schemas/default-auth/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/name-mapping/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/omit/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/petstore/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/todo/input.ts (1)
UserGetPayload(70-70)tests/e2e/orm/schemas/typed-json/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/typing/input.ts (1)
UserGetPayload(30-30)tests/runtimes/bun/schemas/input.ts (1)
UserGetPayload(30-30)tests/runtimes/edge-runtime/schemas/input.ts (1)
UserGetPayload(30-30)
tests/e2e/orm/schemas/name-mapping/input.ts (6)
packages/clients/tanstack-query/test/schemas/basic/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)tests/e2e/apps/rally/zenstack/input.ts (1)
UserGetPayload(50-50)tests/e2e/orm/schemas/basic/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)tests/e2e/orm/schemas/default-auth/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/omit/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)tests/e2e/orm/schemas/typing/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)
tests/runtimes/edge-runtime/schemas/input.ts (2)
tests/e2e/orm/schemas/basic/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)tests/e2e/orm/schemas/omit/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)
packages/orm/src/client/crud-types.ts (3)
packages/schema/src/schema.ts (5)
SchemaDef(11-19)GetModels(121-121)ModelFieldIsOptional(242-246)FieldIsArray(266-270)RelationFieldType(233-240)packages/orm/src/client/options.ts (1)
QueryOptions(151-151)packages/orm/src/utils/type-utils.ts (2)
Optional(4-4)WrapType(26-32)
tests/e2e/orm/schemas/todo/input.ts (16)
tests/e2e/apps/rally/zenstack/input.ts (2)
SpaceGetPayload(270-270)UserGetPayload(50-50)packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
UserGetPayload(30-30)samples/next.js/zenstack/input.ts (1)
UserGetPayload(30-30)samples/orm/zenstack/input.ts (1)
UserGetPayload(30-30)tests/e2e/github-repos/formbricks/input.ts (1)
UserGetPayload(510-510)tests/e2e/github-repos/trigger.dev/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/basic/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/default-auth/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/delegate/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/name-mapping/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/omit/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/petstore/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/typed-json/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/typing/input.ts (1)
UserGetPayload(30-30)tests/runtimes/bun/schemas/input.ts (1)
UserGetPayload(30-30)tests/runtimes/edge-runtime/schemas/input.ts (1)
UserGetPayload(30-30)
tests/e2e/github-repos/trigger.dev/input.ts (15)
packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
UserGetPayload(30-30)samples/next.js/zenstack/input.ts (1)
UserGetPayload(30-30)samples/orm/zenstack/input.ts (1)
UserGetPayload(30-30)tests/e2e/github-repos/formbricks/input.ts (4)
UserGetPayload(510-510)OrganizationGetPayload(390-390)ProjectGetPayload(370-370)DataMigrationGetPayload(330-330)tests/e2e/orm/schemas/basic/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/default-auth/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/delegate/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/name-mapping/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/omit/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/petstore/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/todo/input.ts (1)
UserGetPayload(70-70)tests/e2e/orm/schemas/typed-json/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/typing/input.ts (1)
UserGetPayload(30-30)tests/runtimes/bun/schemas/input.ts (1)
UserGetPayload(30-30)tests/e2e/github-repos/cal.com/input.ts (1)
UserGetPayload(170-170)
packages/clients/tanstack-query/src/react.ts (3)
packages/clients/tanstack-query/src/vue.ts (4)
ClientHooks(121-123)ModelQueryHooks(127-206)useClientQueries(211-221)useModelQueries(226-302)packages/orm/src/client/crud-types.ts (1)
SimplifiedPlainResult(256-261)packages/clients/tanstack-query/src/utils/types.ts (1)
TrimDelegateModelOperations(28-32)
tests/e2e/github-repos/formbricks/input.ts (7)
tests/e2e/github-repos/cal.com/input.ts (2)
WebhookGetPayload(610-610)UserGetPayload(170-170)tests/e2e/orm/schemas/typing/input.ts (2)
TagGetPayload(90-90)UserGetPayload(30-30)samples/orm/zenstack/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/petstore/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/todo/input.ts (1)
UserGetPayload(70-70)tests/e2e/orm/schemas/typed-json/input.ts (1)
UserGetPayload(30-30)tests/runtimes/bun/schemas/input.ts (1)
UserGetPayload(30-30)
tests/e2e/orm/schemas/typed-json/input.ts (16)
packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
UserGetPayload(30-30)samples/next.js/zenstack/input.ts (1)
UserGetPayload(30-30)samples/orm/zenstack/input.ts (1)
UserGetPayload(30-30)tests/e2e/apps/rally/zenstack/input.ts (1)
UserGetPayload(50-50)tests/e2e/github-repos/formbricks/input.ts (1)
UserGetPayload(510-510)tests/e2e/github-repos/trigger.dev/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/basic/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/default-auth/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/delegate/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/name-mapping/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/omit/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/petstore/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/todo/input.ts (1)
UserGetPayload(70-70)tests/e2e/orm/schemas/typing/input.ts (1)
UserGetPayload(30-30)tests/runtimes/bun/schemas/input.ts (1)
UserGetPayload(30-30)tests/e2e/github-repos/cal.com/input.ts (1)
UserGetPayload(170-170)
samples/orm/zenstack/input.ts (4)
samples/next.js/zenstack/input.ts (1)
UserGetPayload(30-30)tests/e2e/github-repos/formbricks/input.ts (1)
UserGetPayload(510-510)tests/e2e/orm/schemas/name-mapping/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/typing/input.ts (1)
UserGetPayload(30-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Agent
- GitHub Check: claude-review
🔇 Additional comments (52)
tests/e2e/orm/schemas/auth-type/input.ts (2)
30-30:FooGetPayloadnow threadsOptionsthrough to$Result—good, but confirm defaultOptions = $QueryOptions<$Schema>matches expected semantics.Please sanity-check that the default
QueryOptions(when callers omit it) preserves the previous behavior ofClientOptions-based typing for this e2e schema.
9-10: All imported types from@zenstackhq/ormare correctly exported.
QueryOptions,SimplifiedPlainResult, andSelectIncludeOmitare properly exported through the package's public API:
QueryOptionsfrompackages/orm/src/client/options.tsSimplifiedPlainResultandSelectIncludeOmitfrompackages/orm/src/client/crud-types.tsThe imports in this file will not cause TypeScript compilation failures.
tests/e2e/orm/schemas/todo/input.ts (2)
9-10: LGTM! Import changes align with the type system refactoring.The expanded imports provide complete CRUD operation types, and the rename from
SimplifiedModelResulttoSimplifiedPlainResult(aliased as$Result) along withQueryOptionsreplacement aligns with the PR objective to simplify model results typing.
30-30: LGTM! Consistent GetPayload type refactoring across all entities.The new type signature pattern adds an
Optionsgeneric parameter using$QueryOptions(with a sensible default), and threads it through to$Result. The pattern is applied uniformly across all five entities (Space, SpaceUser, User, List, Todo) and matches the same refactoring pattern seen in 16+ other schema files throughout the codebase.Also applies to: 50-50, 70-70, 90-90, 110-110
tests/e2e/orm/schemas/delegate/input.ts (3)
9-10: LGTM! Import updates align with the refactoring.The imports correctly reflect the transition from
ClientOptionstoQueryOptionsand fromSimplifiedModelResulttoSimplifiedPlainResult. Both imported types are consistently used throughout the file's GetPayload type definitions.
30-30: LGTM! Consistent GetPayload type refactoring across all entities.All seven GetPayload types (User, Comment, Asset, Video, RatedVideo, Image, Gallery) have been consistently updated to:
- Accept the new
Optionsgeneric parameter with proper default- Use
$Resultwith the threadedOptionsparameterThe pattern matches the refactoring applied across the entire codebase as shown in the relevant code snippets.
Also applies to: 50-50, 70-70, 90-90, 110-110, 130-130, 150-150
1-150: Overall assessment: Clean auto-generated refactoring.This auto-generated file correctly implements the type system refactoring for the delegate schema pattern. The changes are consistent, follow the established pattern across the codebase, and maintain proper type safety with the new
QueryOptionsandSimplifiedPlainResulttypes.As an E2E test schema, this validates that the generator correctly handles the delegate pattern with the new type system.
tests/e2e/github-repos/trigger.dev/input.ts (1)
30-1030: Payload typing migration is consistent with the new Options-based$Resultsurface.The file uses the
Options extends $QueryOptions<$Schema> = $QueryOptions<$Schema>+$Result<$Schema, Model, Args, Options>pattern consistently across all 1,020 type definitions. Old typing names are absent from exports, and new names ($QueryOptions,$Result,$SelectIncludeOmit) are properly imported and aliased from "@zenstackhq/orm". This generated fixture validates real-world schema compatibility as the upstream types evolve.tests/runtimes/edge-runtime/schemas/input.ts (3)
9-10: LGTM! Import changes align with the refactoring.The updated imports correctly reflect the PR's goal of replacing
ClientOptionswithQueryOptionsand renamingSimplifiedModelResulttoSimplifiedPlainResult. The aliasing pattern is consistent with the codebase style.
30-30: LGTM! UserGetPayload correctly implements the new typing pattern.The signature properly threads the
Optionsgeneric parameter with appropriate constraints and defaults, matching the pattern used in other generated schema files.
50-50: PostGetPayload correctly implements the new typing pattern.The signature matches
UserGetPayloadand is applied consistently across all generated schema files in the repository. The refactoring is uniform.packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts (1)
8-13: SchemaType class-based export looks consistent with SchemaDef + sample pattern.
No functional concerns;provider/models as constandschema = new SchemaType()should keep typing stable while enabling the new Options/result generics.Also applies to: 168-172
tests/e2e/orm/schemas/todo/schema.ts (1)
8-13: Generated e2e schema migration is fine; please ensure it still matches the intended real-world todo schema source.
This is a structural export change, but e2e value comes from schema fidelity. As per coding guidelines, double-check the generator is still using the same upstream schema inputs for this suite.Also applies to: 392-396
packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
9-10: Consistent migration to$QueryOptions+$Result; LGTM.
Only caveat is ensuring the generator’s target@zenstackhq/ormpublic API exports the referenced types.Also applies to: 30-110
tests/e2e/package.json (1)
7-12:test:generatepasses.to the script—verified safe.The
scripts/test-generate.tsscript correctly expects a path argument viaprocess.argv[2](line 8) and defaults to.if not provided. Passing.as the first argument is the intended usage and matches the script's interface.tests/e2e/orm/schemas/omit/input.ts (1)
9-10: Looks good; all generated@zenstackhq/ormimports are properly exported from the package.The file correctly imports
QueryOptionsandSimplifiedPlainResulttypes used throughout the GetPayload type definitions (lines 30, 50, 70, 90) for the User, Post, Base, and Sub entities. These types are properly exported frompackages/orm/src/client/options.tsandpackages/orm/src/client/crud-types.ts, validating real-world schema compatibility.packages/orm/src/client/options.ts (1)
148-156: No action needed on exports—QueryOptionsandToQueryOptionsare already re-exported from the public ORM barrel viapackages/orm/src/client/index.ts.The type definitions are correctly added and properly exposed through the package's public API.
packages/clients/tanstack-query/package.json (1)
8-15: No issues found. Thetestdirectory exists inpackages/clients/tanstack-query/test/and the generator script correctly resolves it. The naming convention matches other packages in the monorepo (cli, language, server all usetest/directories, nottests/).tests/e2e/orm/schemas/petstore/input.ts (1)
9-10: No action needed—types are properly exported.
QueryOptionsandSimplifiedPlainResultare correctly exported from@zenstackhq/orm. Both are re-exported through the barrel chain:options.tsandcrud-types.ts→client/index.ts→orm/src/index.ts. The imports in the generated file are valid and will not cause typecheck failures in consumers.scripts/test-generate.ts (1)
10-26: LGTM! CLI options passthrough looks correct.The implementation cleanly collects extra CLI arguments and forwards them to the generator. The
cwdis appropriately set to the schema's directory for proper path resolution.tests/e2e/orm/schemas/default-auth/input.ts (2)
9-10: Generated types updated consistently with the new typing pattern.The import changes from
ClientOptions/SimplifiedModelResulttoQueryOptions/SimplifiedPlainResultalign with the generator updates.
30-30: GetPayload signature follows the new convention.The updated signature
UserGetPayload<Args, Options extends $QueryOptions<$Schema>> = $Result<$Schema, "User", Args, Options>is consistent with all other generated schemas in the codebase.packages/sdk/src/ts-schema-generator.ts (3)
1584-1584: Import alias correctly updated toQueryOptions.This aligns with the broader refactoring from
ClientOptionstoQueryOptionsfor the public API surface.
1592-1614: Import and type alias changes are consistent.The switch from
SimplifiedModelResult as $SimplifiedModelResulttoSimplifiedPlainResult as $Resultprovides a cleaner, more concise alias for generated code.
1635-1668: GeneratedGetPayloadtype signature is correct.The updated signature properly:
- Constrains
Optionsto$QueryOptions<$Schema>with a default value- Returns
$Result<$Schema, Model, Args, Options>matching theSimplifiedPlainResulttype parameter orderThis is consistent with the type definition in
packages/orm/src/client/crud-types.ts(lines 255-260).tests/e2e/orm/schemas/json/input.ts (2)
9-10: Generated imports updated consistently.
30-30: FooGetPayload follows the updated typing pattern.tests/e2e/orm/schemas/typing/input.ts (2)
9-10: Generated imports updated consistently.
30-30: All model GetPayload types follow the updated pattern.The types for User, Post, Profile, Tag, Region, and Meta all consistently use the new
$QueryOptions/$Resultpattern.packages/orm/src/client/contract.ts (7)
34-34: Import change fromSimplifiedModelResulttoSimplifiedPlainResultis correct.This aligns with the renamed/simplified result type.
42-42: New imports forQueryOptionsandToQueryOptionsproperly support the refactored typing.
ToQueryOptionsis used to extract query-relevant options (likeomit) from the fullClientOptions.
196-196: Model operations correctly useToQueryOptions<Options>to narrow the options type.This ensures that model operations receive only the query-relevant subset of client options, which is a cleaner type boundary.
274-278:AllModelOperationsnow constrainsOptionstoQueryOptions<Schema>.This is the correct constraint since all CRUD methods only need query options, not the full client options.
360-363: Return types consistently updated toSimplifiedPlainResult.All find/create/update/delete operations now use
SimplifiedPlainResult<Schema, Model, T, Options>with the correct type parameter order matching the type definition.
835-843:ModelOperationstype correctly updated.The default for
Optionsis nowQueryOptions<Schema>, maintaining consistency withAllModelOperations.
853-859:AuthModelTypecorrectly usesDefaultModelResultwithout explicit Options.Per the updated
DefaultModelResultsignature incrud-types.ts, the Options parameter now has a default value ofQueryOptions<Schema>, so omitting it here is correct.tests/e2e/orm/schemas/basic/input.ts (1)
9-10: LGTM! Generated types align with the new QueryOptions-based pattern.The imports and
GetPayloadtype signatures correctly use the newQueryOptionsandSimplifiedPlainResult(aliased as$Result) types, consistent with the core type definitions incrud-types.ts.Also applies to: 30-30
tests/runtimes/bun/schemas/input.ts (1)
9-10: LGTM! Bun runtime test schema updated consistently.The generated types correctly use
QueryOptionsandSimplifiedPlainResult, matching the pattern across other test schemas.Also applies to: 30-30, 50-50
tests/e2e/orm/schemas/name-mapping/input.ts (1)
9-10: LGTM! Name-mapping test schema correctly updated.The generated types are consistent with the new
QueryOptions-based pattern. This E2E test schema validates real-world schema compatibility with field name mappings, which is important per coding guidelines.Also applies to: 30-30, 50-50
packages/orm/src/client/crud-types.ts (3)
247-261: LGTM! Clean introduction of SimplifiedPlainResult alias.The new
SimplifiedPlainResulttype alias provides a convenient shorthand for the common case whereOptional=falseandArray=false, reducing verbosity in generated payload types. This pairs well with the existingSimplifiedResultthat retains full flexibility.
162-186: LGTM! Options correctly propagated through nested relation results.The
Optionsparameter is consistently threaded through all nestedModelResultandDefaultModelResultinvocations inModelSelectResult, ensuring omit settings are properly applied to nested relations.
47-47: LGTM! Consistent migration from ClientOptions to QueryOptions.The import and all type signatures have been systematically updated to use
QueryOptions<Schema>instead ofClientOptions<Schema>. SinceQueryOptionsis defined asPick<ClientOptions<Schema>, 'omit'>(peroptions.ts), this narrowing appropriately constrains the options to only what's relevant for query results.Also applies to: 56-56, 88-88, 109-109, 202-202
tests/e2e/apps/rally/zenstack/input.ts (1)
9-10: LGTM! Rally E2E test schema validates real-world compatibility.This comprehensive schema with 27 entities demonstrates that the new
QueryOptions-based typing works correctly with a real-world application. AllGetPayloadtypes are consistently generated using the new pattern.Also applies to: 30-30, 50-50
tests/e2e/orm/schemas/typed-json/input.ts (1)
9-10: LGTM!The import updates (
QueryOptions,SimplifiedPlainResult) andUserGetPayloadtype signature changes are consistent with the broader refactoring pattern seen across all other auto-generatedinput.tsfiles in the codebase.Also applies to: 30-30
packages/clients/tanstack-query/src/svelte.ts (1)
35-38: LGTM!The type definitions for
ModelMutationModelResult,ClientHooks, andModelQueryHooksare correctly updated with theOptionsgeneric parameter. The hooks properly propagateSimplifiedPlainResultandSimplifiedResultwith theOptionstype throughout.Also applies to: 116-132, 134-143
samples/next.js/zenstack/input.ts (1)
9-10: LGTM!The import updates and
GetPayloadtype signatures for bothUserandPostmodels are consistent with the refactoring pattern across all other auto-generated schema files.Also applies to: 30-30, 50-50
packages/clients/tanstack-query/src/vue.ts (1)
33-36: LGTM!The import updates,
ClientHooks,ModelQueryHookstype definitions, anduseClientQueriesfunction are correctly updated with theOptionsgeneric parameter. The return typeClientHooks<Schema, Options>properly propagates the generic.Also applies to: 121-123, 127-206, 211-221
packages/clients/tanstack-query/src/react.ts (1)
39-42: LGTM!The import updates and type definitions are well-structured.
ModelMutationModelResultcorrectly uses theOptionsparameter throughout (unlike Vue's implementation). TheClientHooksandModelQueryHookstypes properly thread theOptionsgeneric through all hook signatures, including the React-specificuseSuspense*variants.Also applies to: 128-139, 141-143, 147-261
tests/e2e/github-repos/formbricks/input.ts (2)
9-10: LGTM! Import changes align with PR refactoring.The imports correctly reflect the type system changes:
SimplifiedModelResult→SimplifiedPlainResult(aliased as$Result) and introduction ofQueryOptions(aliased as$QueryOptions).
30-710: Validates refactoring with complex real-world schema.The updated
GetPayloadtypes across all 35+ Formbricks entities demonstrate that theClientOptions→QueryOptionsrefactoring works correctly with a complex, real-world schema. The consistent pattern ofOptions extends $QueryOptions<$Schema> = $QueryOptions<$Schema>>and$Result<$Schema, "Entity", Args, Options>confirms the code generator properly implements the new type system.As per coding guidelines, this E2E test validates real-world schema compatibility with the Formbricks project.
samples/orm/zenstack/input.ts (2)
9-10: LGTM! Import changes consistent with refactoring.The import statement changes match the pattern established across the codebase, replacing
SimplifiedModelResultwithSimplifiedPlainResultand introducingQueryOptions.
30-70: GetPayload types correctly updated.The
UserGetPayload,ProfileGetPayload, andPostGetPayloadtypes now use the newOptions extends $QueryOptions<$Schema>pattern with$Result, consistent with the PR's type system refactoring. This sample demonstrates the simplified API for users.
There was a problem hiding this comment.
Pull request overview
This PR refactors the ORM's model results typing system to simplify type definitions. The key changes include renaming SimplifiedModelResult to SimplifiedPlainResult, introducing QueryOptions as a subset of ClientOptions, and reordering type parameters for better consistency. The refactor also updates the schema generation to use a class-based pattern instead of object literals.
Key Changes:
- Renamed
SimplifiedModelResulttoSimplifiedPlainResultand introducedSimplifiedResultas a more general type - Created
QueryOptionstype as a subset ofClientOptionscontaining only query-relevant options (omit) - Reordered type parameters in
ModelResultand related types for consistency (Args before Options) - Updated all generated
input.tsfiles to use the new type names and parameter order - Modified schema generation to export class-based schemas instead of object literals
- Updated TanStack Query integrations (React, Vue, Svelte) to use new types
- Enhanced test generation script to support additional CLI options
Reviewed changes
Copilot reviewed 31 out of 33 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/orm/src/client/options.ts | Added QueryOptions and ToQueryOptions types |
| packages/orm/src/client/crud-types.ts | Refactored type parameters, renamed types, reordered parameters |
| packages/orm/src/client/contract.ts | Updated to use QueryOptions and SimplifiedPlainResult |
| packages/sdk/src/ts-schema-generator.ts | Updated code generation for new type names and parameter order |
| packages/clients/tanstack-query/src/*.ts | Updated React/Vue/Svelte hooks to use new types |
| tests/e2e/**/input.ts | Regenerated with new type signatures |
| scripts/test-generate.ts | Added support for passing CLI options to generator |
| tests/e2e/orm/schemas/todo/* | Added new test schema files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Claude finished @ymc9's task —— View job PR Review: Simplify Model Results Typing ✅I've completed a comprehensive review of this refactoring PR that simplifies model results typing across the ORM and client packages. Review Checklist
SummaryThis PR successfully refactors the TypeScript typing system for model results, making the type system cleaner and more consistent. The main changes involve:
Code Quality Assessment✅ Strengths
✅ Best Practices Followed
Technical AnalysisCore Changes in
|
|
Claude finished @ymc9's task —— View job PR Review: Simplify Model Results Typing ✅I've completed a comprehensive review of this refactoring PR that simplifies model results typing across the ORM and client packages. Review Checklist
SummaryThis PR successfully refactors the TypeScript typing system for model results, making the type system cleaner and more consistent. The main changes involve:
Code Quality Assessment✅ Strengths
✅ Best Practices Followed
Technical AnalysisCore Changes in
|
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/clients/tanstack-query/src/react.ts(3 hunks)packages/clients/tanstack-query/src/svelte.ts(3 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Use Kysely as the query builder interface for low-level database queries, avoiding raw SQL when possible
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Implement plugin hooks at ORM, Kysely, and entity mutation levels for query interception and customization
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Implement plugin hooks at ORM, Kysely, and entity mutation levels for query interception and customization
Applied to files:
packages/clients/tanstack-query/src/react.tspackages/clients/tanstack-query/src/svelte.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Use Kysely as the query builder interface for low-level database queries, avoiding raw SQL when possible
Applied to files:
packages/clients/tanstack-query/src/react.tspackages/clients/tanstack-query/src/svelte.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.test.{ts,tsx} : ORM package tests should include comprehensive client API tests and policy tests
Applied to files:
packages/clients/tanstack-query/src/react.ts
🧬 Code graph analysis (1)
packages/clients/tanstack-query/src/react.ts (3)
packages/orm/src/client/options.ts (1)
QueryOptions(151-151)packages/clients/tanstack-query/src/vue.ts (4)
ModelMutationResult(103-103)ModelMutationOptions(99-101)ModelQueryOptions(87-89)ModelMutationModelResult(105-119)packages/orm/src/client/crud-types.ts (11)
SimplifiedResult(247-254)FindUniqueArgs(1109-1111)SelectSubset(927-933)SimplifiedPlainResult(256-261)CreateArgs(1117-1119)CreateManyArgs(1121-1121)BatchResult(289-289)CreateManyAndReturnArgs(1123-1127)UpdateArgs(1301-1311)UpdateManyArgs(1313-1316)UpdateManyAndReturnArgs(1318-1322)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-test (20.x, sqlite)
- GitHub Check: build-test (20.x, postgresql)
|
Claude finished @ymc9's task —— View job PR Review: Simplify Model Results Typing ✅I've completed a comprehensive review of this refactoring PR that simplifies model results typing across the ORM and client packages. Review Checklist
SummaryThis PR successfully refactors the TypeScript typing system for model results, making the type system cleaner and more consistent. The main changes involve:
Code Quality Assessment✅ Strengths
✅ Best Practices Followed
Technical AnalysisCore Changes in
|
|
Claude finished @ymc9's task —— View job PR Review: Simplify Model Results Typing ✅I've completed a comprehensive review of this refactoring PR that simplifies model results typing across the ORM and client packages. Review Checklist
SummaryThis PR successfully refactors the TypeScript typing system for model results, making the type system cleaner and more consistent. The main changes involve:
Code Quality Assessment✅ Strengths
✅ Best Practices Followed
Technical AnalysisCore Changes in
|
Summary by CodeRabbit
Refactor
Chores
✏️ Tip: You can customize this high-level summary in your review settings.