-
-
Notifications
You must be signed in to change notification settings - Fork 12
merge dev to main (v3.0.0-beta.26) #445
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
* fix: ts schema generation for ignored models and fields * Update tests/e2e/orm/client-api/ignore.test.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/e2e/orm/client-api/ignore.test.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix test --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
* feat: implement field omission * Update tests/e2e/orm/client-api/omit.test.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix build * fix build * fix build * update sample * fix tests * update --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* feat(orm): add settings to disallow query-time omit override * Update packages/orm/src/client/options.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix(orm): typing issue when auth type is a typedef * update
WalkthroughThread ClientOptions and omit settings through the ORM and query clients, add Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas to focus review on:
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧠 Learnings (4)📚 Learning: 2025-11-26T01:55:04.540ZApplied to files:
📚 Learning: 2025-11-26T01:55:04.540ZApplied to files:
📚 Learning: 2025-11-26T01:55:04.540ZApplied to files:
📚 Learning: 2025-11-26T01:55:04.540ZApplied to files:
🧬 Code graph analysis (2)packages/orm/src/utils/schema-utils.ts (1)
packages/orm/src/client/contract.ts (3)
⏰ 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). (3)
🔇 Additional comments (16)
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 Pull Request ReviewI've completed a comprehensive review of this large PR merging dev to main for v3.0.0-beta.26. Here are my findings: ✅ Overall AssessmentThis is a well-structured release that introduces significant new features while maintaining code quality. The changes primarily focus on:
🚀 Key Features & ImprovementsField Omission System (
|
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 merges development changes to main for version 3.0.0-beta.26, introducing significant new features and improvements to the ZenStack ORM framework.
Purpose: Version bump and feature release including field omission support, custom auth type definitions, enhanced collection predicate handling, and improved type safety throughout the client API.
Key Changes:
- Added
@omitattribute for fields with three-level omission control (schema, options, query-level) - Introduced support for custom auth types (not just models) via
@@authattribute on type definitions - Enhanced collection predicate expressions with support for value-based auth data
- Improved type safety by threading
ClientOptionsgeneric parameter through the entire type system - Added
$setOptionsmethod for creating clients with modified options
Reviewed changes
Copilot reviewed 76 out of 77 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Multiple package.json files | Version bump to 3.0.0-beta.26 across all packages |
| tests/e2e/orm/validation/custom-validation.test.ts | Refactored to use $setOptions instead of deprecated $setInputValidation |
| tests/e2e/orm/schemas/omit/* | New schema files for testing field omission feature |
| tests/e2e/orm/schemas/auth-type/* | New schema files for testing custom auth type feature |
| tests/e2e/orm/schemas/basic/schema.zmodel | Added @ignore field and model for testing |
| tests/e2e/orm/client-api/*.test.ts | New tests for omit, ignore, and auth-typing features |
| tests/e2e/orm/policy/auth-access.test.ts | Comprehensive tests for auth access with types and models |
| tests/e2e/apps/rally/rally.test.ts | Removed debug flag |
| Multiple input.ts files | Added ClientOptions import and Options parameter to GetPayload types |
| packages/orm/src/client/* | Enhanced with Options generic parameter threading and $setOptions method |
| packages/orm/src/client/crud/* | Added omit field handling logic across dialects |
| packages/plugins/policy/src/* | Significant refactoring for auth type support and collection predicates |
| packages/schema/src/schema.ts | Added authType union with GetTypeDefs, omit field property |
| packages/sdk/src/* | Enhanced type generation with ClientOptions support |
| packages/language/* | Added @omit attribute, improved auth validation and scoping |
| packages/testtools/src/client.ts | Enhanced createTestClient with better type inference |
| packages/clients/tanstack-query/src/* | Updated all hooks with ClientOptions in type signatures |
| pnpm-workspace.yaml | TypeScript version update from ^5.8.0 to ^5.9.3 |
| pnpm-lock.yaml | Extensive dependency updates reflecting TypeScript version change |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
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.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/orm/src/client/crud/validator/index.ts (1)
237-243: Schema caching doesn't account forallowQueryTimeOmitOverride, causing cross-client cache pollution.
makeOmitSchemanow branches onthis.options.allowQueryTimeOmitOverride, but the cache key invalidate()doesn't include this option. SinceschemaCacheis module-level and keyed only bySchemaDef, clients with differentallowQueryTimeOmitOverridevalues will share cached schemas incorrectly.Include
allowQueryTimeOmitOverridein the cache key:const cacheKey = stableStringify({ type: 'model', model, operation, options, extraValidationsEnabled: this.extraValidationsEnabled, + allowQueryTimeOmitOverride: this.options.allowQueryTimeOmitOverride, });Also applies to: 790-796
🧹 Nitpick comments (4)
packages/testtools/src/client.ts (1)
154-157: Consider filtering out test-specific options before constructing_options.The
restspread includesExtraTestClientOptionsproperties (provider,dbName,dbFile, etc.) that aren't part ofClientOptions. While harmless at runtime (they're ignored byZenStackClient), explicitly filtering them would be cleaner:- const { plugins, ...rest } = options ?? {}; - const _options = { - ...rest, - } as ClientOptions<SchemaDef>; + const { plugins, provider: _, dbName: _d, dbFile: _f, schemaFile: _s, + usePrismaPush: _p, extraSourceFiles: _e, workDir: _w, + dataSourceExtensions: _x, copyFiles: _c, ...clientOptions } = options ?? {}; + const _options = { + ...clientOptions, + } as ClientOptions<SchemaDef>;Alternatively, you could extract the
ClientOptionskeys programmatically if the list becomes unwieldy.TODO.md (1)
6-12: Checklist updates match implemented features; consider fixing list indentation for markdownlint.Marking
db,seed,format, andGlobal omitas complete is consistent with the new CLI/ORM functionality added in this PR. Separately,markdownlint(MD007) is flagging the indentation of these nested bullets; if you care about a clean doc lint run, adjust the sub-list indentation (e.g., 2 spaces for the first nested level, 4 for the next).Also applies to: 88-88
tests/e2e/orm/client-api/omit.test.ts (1)
39-65: Consider documenting thedialect: {} as anyworkaround.The empty dialect object is a workaround since
createTestClientinternally sets up the proper dialect based on the provider. While functional, this pattern might confuse future maintainers.Consider extracting a helper or adding a brief inline comment:
it('respects client omit options', async () => { + // dialect is overwritten by createTestClient; placeholder satisfies type requirements const options = { omit: { User: { name: true } }, dialect: {} as any } as const;tests/e2e/orm/client-api/auth-typing.test.ts (1)
5-17: Consider adding runtime assertions to strengthen the test.While the test validates type compatibility at compile time, adding runtime assertions would ensure the auth data flows correctly through the system.
describe('Custom auth typing tests', () => { it('works with custom auth typing', async () => { const db = await createTestClient(schema); - db.$setAuth({ + const authData = { id: 1, role: 'ADMIN', permissions: [ { actionCode: 'MANAGE', }, ], - }); + }; + const clientWithAuth = db.$setAuth(authData); + expect(clientWithAuth.$auth).toEqual(authData); }); });
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (76)
TODO.md(2 hunks)package.json(2 hunks)packages/auth-adapters/better-auth/package.json(1 hunks)packages/cli/package.json(1 hunks)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/common-helpers/package.json(1 hunks)packages/config/eslint-config/package.json(1 hunks)packages/config/typescript-config/package.json(1 hunks)packages/config/vitest-config/package.json(1 hunks)packages/create-zenstack/package.json(1 hunks)packages/language/package.json(1 hunks)packages/language/res/stdlib.zmodel(1 hunks)packages/language/src/validators/function-invocation-validator.ts(1 hunks)packages/language/src/zmodel-scope.ts(3 hunks)packages/orm/package.json(1 hunks)packages/orm/src/client/client-impl.ts(26 hunks)packages/orm/src/client/contract.ts(22 hunks)packages/orm/src/client/crud-types.ts(6 hunks)packages/orm/src/client/crud/dialects/base-dialect.ts(2 hunks)packages/orm/src/client/crud/dialects/postgresql.ts(2 hunks)packages/orm/src/client/crud/dialects/sqlite.ts(1 hunks)packages/orm/src/client/crud/operations/base.ts(1 hunks)packages/orm/src/client/crud/validator/index.ts(3 hunks)packages/orm/src/client/executor/zenstack-query-executor.ts(11 hunks)packages/orm/src/client/options.ts(3 hunks)packages/orm/src/client/promise.ts(1 hunks)packages/orm/src/utils/schema-utils.ts(2 hunks)packages/orm/src/utils/type-utils.ts(1 hunks)packages/plugins/policy/package.json(1 hunks)packages/plugins/policy/src/expression-evaluator.ts(2 hunks)packages/plugins/policy/src/expression-transformer.ts(19 hunks)packages/plugins/policy/src/policy-handler.ts(1 hunks)packages/plugins/policy/src/types.ts(1 hunks)packages/schema/package.json(1 hunks)packages/schema/src/schema.ts(3 hunks)packages/sdk/package.json(1 hunks)packages/sdk/src/model-utils.ts(1 hunks)packages/sdk/src/ts-schema-generator.ts(8 hunks)packages/server/package.json(1 hunks)packages/testtools/package.json(1 hunks)packages/testtools/src/client.ts(4 hunks)packages/zod/package.json(1 hunks)pnpm-workspace.yaml(1 hunks)samples/next.js/package.json(2 hunks)samples/next.js/zenstack/input.ts(3 hunks)samples/orm/package.json(1 hunks)samples/orm/zenstack/input.ts(4 hunks)tests/e2e/apps/rally/rally.test.ts(0 hunks)tests/e2e/apps/rally/zenstack/input.ts(28 hunks)tests/e2e/orm/client-api/auth-typing.test.ts(1 hunks)tests/e2e/orm/client-api/ignore.test.ts(1 hunks)tests/e2e/orm/client-api/omit.test.ts(1 hunks)tests/e2e/orm/policy/auth-access.test.ts(1 hunks)tests/e2e/orm/schemas/auth-type/input.ts(1 hunks)tests/e2e/orm/schemas/auth-type/models.ts(1 hunks)tests/e2e/orm/schemas/auth-type/schema.ts(1 hunks)tests/e2e/orm/schemas/auth-type/schema.zmodel(1 hunks)tests/e2e/orm/schemas/basic/input.ts(5 hunks)tests/e2e/orm/schemas/basic/schema.zmodel(3 hunks)tests/e2e/orm/schemas/default-auth/input.ts(4 hunks)tests/e2e/orm/schemas/delegate/input.ts(8 hunks)tests/e2e/orm/schemas/name-mapping/input.ts(3 hunks)tests/e2e/orm/schemas/omit/input.ts(1 hunks)tests/e2e/orm/schemas/omit/models.ts(1 hunks)tests/e2e/orm/schemas/omit/schema.ts(1 hunks)tests/e2e/orm/schemas/omit/schema.zmodel(1 hunks)tests/e2e/orm/schemas/petstore/input.ts(4 hunks)tests/e2e/orm/schemas/todo/input.ts(6 hunks)tests/e2e/orm/schemas/typing/input.ts(7 hunks)tests/e2e/orm/validation/custom-validation.test.ts(2 hunks)tests/e2e/package.json(1 hunks)tests/regression/package.json(1 hunks)
💤 Files with no reviewable changes (1)
- tests/e2e/apps/rally/rally.test.ts
🧰 Additional context used
📓 Path-based instructions (2)
tests/e2e/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
E2E tests should validate real-world schema compatibility with established projects
Files:
tests/e2e/orm/client-api/ignore.test.tstests/e2e/orm/schemas/auth-type/models.tstests/e2e/orm/schemas/omit/models.tstests/e2e/orm/schemas/omit/schema.tstests/e2e/orm/client-api/omit.test.tstests/e2e/orm/schemas/auth-type/schema.tstests/e2e/orm/policy/auth-access.test.tstests/e2e/orm/schemas/default-auth/input.tstests/e2e/orm/schemas/auth-type/input.tstests/e2e/orm/client-api/auth-typing.test.tstests/e2e/orm/validation/custom-validation.test.tstests/e2e/orm/schemas/delegate/input.tstests/e2e/orm/schemas/todo/input.tstests/e2e/orm/schemas/basic/input.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/name-mapping/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/apps/rally/zenstack/input.tstests/e2e/orm/schemas/omit/input.ts
**/*.zmodel
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.zmodel: Always runzenstack generateafter modifying ZModel schemas
ZModel schema files should define database structure and policies that compile to TypeScript viazenstack generate
Files:
packages/language/res/stdlib.zmodeltests/e2e/orm/schemas/omit/schema.zmodeltests/e2e/orm/schemas/auth-type/schema.zmodeltests/e2e/orm/schemas/basic/schema.zmodel
🧠 Learnings (11)
📚 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/package.jsonpackages/orm/src/client/options.tstests/e2e/orm/schemas/auth-type/models.tstests/e2e/orm/schemas/omit/models.tspackages/orm/src/client/crud/dialects/base-dialect.tstests/e2e/orm/schemas/omit/schema.tstests/e2e/orm/schemas/auth-type/schema.tstests/e2e/orm/schemas/default-auth/input.tspackages/orm/src/client/crud/validator/index.tspackages/clients/tanstack-query/test/schemas/basic/input.tstests/e2e/orm/schemas/auth-type/input.tspackages/clients/tanstack-query/src/svelte.tspackages/orm/src/client/promise.tssamples/orm/zenstack/input.tssamples/next.js/zenstack/input.tspackages/clients/tanstack-query/src/vue.tspackages/orm/package.jsonpackages/plugins/policy/src/expression-transformer.tspackages/orm/src/client/crud/operations/base.tstests/e2e/orm/schemas/delegate/input.tstests/e2e/orm/schemas/todo/input.tstests/e2e/orm/schemas/basic/input.tspackages/orm/src/client/executor/zenstack-query-executor.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/name-mapping/input.tspackages/orm/src/client/contract.tspackages/clients/tanstack-query/src/react.tstests/e2e/orm/schemas/petstore/input.tspackages/orm/src/client/crud-types.tspackages/orm/src/client/client-impl.tstests/e2e/apps/rally/zenstack/input.tstests/e2e/orm/schemas/omit/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/schema/src/schema.tstests/e2e/orm/client-api/ignore.test.tstests/e2e/orm/schemas/omit/schema.tstests/e2e/orm/schemas/auth-type/schema.tspackages/sdk/src/ts-schema-generator.tspackages/orm/src/client/executor/zenstack-query-executor.tspackages/orm/src/client/crud-types.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 : ZModel schema files should define database structure and policies that compile to TypeScript via `zenstack generate`
Applied to files:
packages/schema/src/schema.tspackages/schema/package.jsonpackages/zod/package.jsontests/e2e/orm/client-api/ignore.test.tstests/e2e/orm/schemas/auth-type/models.tstests/e2e/orm/schemas/omit/models.tstests/e2e/orm/schemas/omit/schema.tstests/e2e/orm/schemas/auth-type/schema.tspackages/orm/src/client/crud/validator/index.tstests/e2e/orm/schemas/omit/schema.zmodeltests/e2e/orm/schemas/auth-type/schema.zmodeltests/e2e/orm/schemas/auth-type/input.tspackages/orm/src/client/promise.tspackages/sdk/src/ts-schema-generator.tssamples/orm/zenstack/input.tssamples/next.js/zenstack/input.tspackages/language/package.jsonpackages/orm/src/client/executor/zenstack-query-executor.tspackages/orm/src/client/contract.tspackages/orm/src/client/client-impl.tstests/e2e/orm/schemas/basic/schema.zmodeltests/e2e/orm/schemas/omit/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: Database migrations should use Prisma CLI under the hood via ZenStack commands
Applied to files:
TODO.md
📚 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/orm/src/client/options.tstests/e2e/orm/client-api/ignore.test.tstests/e2e/orm/schemas/auth-type/models.tstests/e2e/orm/schemas/omit/models.tspackages/orm/src/client/crud/dialects/base-dialect.tstests/e2e/orm/schemas/omit/schema.tstests/e2e/orm/client-api/omit.test.tstests/e2e/orm/schemas/auth-type/schema.tstests/e2e/orm/policy/auth-access.test.tstests/e2e/orm/schemas/default-auth/input.tspackages/orm/src/client/crud/validator/index.tspackages/clients/tanstack-query/test/schemas/basic/input.tstests/e2e/orm/schemas/auth-type/input.tspackages/clients/tanstack-query/src/svelte.tspackages/orm/src/client/promise.tssamples/orm/zenstack/input.tssamples/next.js/zenstack/input.tspackages/clients/tanstack-query/src/vue.tspackages/orm/package.jsonpackages/plugins/policy/src/expression-transformer.tspackages/orm/src/client/crud/operations/base.tstests/e2e/orm/schemas/delegate/input.tstests/e2e/orm/schemas/todo/input.tstests/e2e/orm/schemas/basic/input.tspackages/orm/src/client/executor/zenstack-query-executor.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/name-mapping/input.tspackages/orm/src/client/contract.tspackages/clients/tanstack-query/src/react.tstests/e2e/orm/schemas/petstore/input.tspackages/orm/src/client/crud-types.tspackages/orm/src/client/client-impl.tstests/e2e/apps/rally/zenstack/input.tstests/e2e/orm/schemas/omit/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:
packages/orm/src/client/options.tstests/e2e/orm/client-api/ignore.test.tstests/e2e/orm/schemas/omit/models.tstests/e2e/orm/schemas/omit/schema.tstests/e2e/orm/client-api/omit.test.tstests/e2e/orm/schemas/auth-type/schema.tstests/e2e/orm/policy/auth-access.test.tstests/e2e/orm/schemas/default-auth/input.tspackages/orm/src/client/crud/validator/index.tspackages/clients/tanstack-query/test/schemas/basic/input.tstests/e2e/orm/schemas/auth-type/input.tspackages/clients/tanstack-query/src/svelte.tspackages/orm/src/client/promise.tssamples/orm/zenstack/input.tssamples/next.js/zenstack/input.tspackages/clients/tanstack-query/src/vue.tspackages/testtools/src/client.tspackages/orm/package.jsonpackages/plugins/policy/src/expression-transformer.tspackages/orm/src/client/crud/operations/base.tstests/e2e/orm/client-api/auth-typing.test.tstests/e2e/orm/validation/custom-validation.test.tstests/e2e/orm/schemas/delegate/input.tstests/e2e/orm/schemas/todo/input.tstests/e2e/orm/schemas/basic/input.tspackages/orm/src/client/executor/zenstack-query-executor.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/name-mapping/input.tspackages/orm/src/client/contract.tstests/e2e/orm/schemas/petstore/input.tspackages/orm/src/client/crud-types.tspackages/orm/src/client/client-impl.tstests/e2e/apps/rally/zenstack/input.tstests/e2e/orm/schemas/omit/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 tests/e2e/**/*.{ts,tsx} : E2E tests should validate real-world schema compatibility with established projects
Applied to files:
tests/e2e/orm/client-api/ignore.test.tstests/e2e/orm/schemas/auth-type/models.tstests/e2e/orm/schemas/omit/models.tstests/e2e/package.jsontests/e2e/orm/schemas/omit/schema.tstests/e2e/orm/client-api/omit.test.tstests/e2e/orm/schemas/auth-type/schema.tstests/e2e/orm/policy/auth-access.test.tstests/e2e/orm/schemas/default-auth/input.tspackages/clients/tanstack-query/test/schemas/basic/input.tstests/e2e/orm/schemas/auth-type/input.tspackages/testtools/src/client.tstests/e2e/orm/client-api/auth-typing.test.tstests/e2e/orm/validation/custom-validation.test.tstests/e2e/orm/schemas/delegate/input.tstests/e2e/orm/schemas/todo/input.tstests/e2e/orm/schemas/basic/input.tstests/e2e/orm/schemas/name-mapping/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/omit/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 tests/**/type*.{ts,tsx} : Ensure TypeScript inference and type coverage are validated through type coverage tests
Applied to files:
tests/e2e/orm/client-api/ignore.test.tstests/e2e/orm/schemas/auth-type/models.tstests/e2e/orm/client-api/omit.test.tspackages/testtools/src/client.tstests/e2e/orm/client-api/auth-typing.test.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/dialects/postgresql.tspackages/orm/src/client/crud/dialects/base-dialect.tspackages/orm/src/client/crud/operations/base.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 `pnpm` with workspaces for package management, pinned to version `pnpm10.12.1`
Applied to files:
pnpm-workspace.yamlpackage.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: Use Turbo for build orchestration and run `pnpm build`, `pnpm watch`, `pnpm lint`, and `pnpm test` for development tasks
Applied to files:
package.json
🧬 Code graph analysis (20)
tests/e2e/orm/client-api/ignore.test.ts (2)
packages/testtools/src/client.ts (1)
createTestClient(99-248)packages/orm/src/client/crud-types.ts (1)
DefaultModelResult(52-76)
tests/e2e/orm/client-api/omit.test.ts (4)
packages/orm/src/client/crud/validator/index.ts (2)
schema(60-62)options(64-66)packages/orm/src/client/crud/operations/base.ts (3)
schema(98-100)options(102-104)read(148-187)tests/e2e/orm/schemas/omit/schema.ts (1)
schema(141-141)packages/orm/src/client/executor/zenstack-query-executor.ts (1)
options(81-83)
packages/language/src/zmodel-scope.ts (2)
packages/language/src/utils.ts (1)
isAuthOrAuthMemberAccess(133-135)packages/language/src/generated/ast.ts (1)
isTypeDef(737-739)
packages/sdk/src/model-utils.ts (1)
packages/language/src/generated/ast.ts (2)
isDataModel(391-393)isTypeDef(737-739)
tests/e2e/orm/schemas/auth-type/schema.ts (1)
packages/schema/src/schema.ts (1)
SchemaDef(11-19)
tests/e2e/orm/policy/auth-access.test.ts (2)
packages/testtools/src/client.ts (1)
createPolicyTestClient(258-269)packages/plugins/policy/src/expression-transformer.ts (1)
schema(126-128)
packages/clients/tanstack-query/test/schemas/basic/input.ts (11)
samples/next.js/zenstack/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)samples/orm/zenstack/input.ts (2)
UserGetPayload(30-30)PostGetPayload(70-70)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/delegate/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/name-mapping/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)tests/e2e/orm/schemas/omit/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)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 (2)
UserGetPayload(30-30)PostGetPayload(50-50)
packages/language/src/validators/function-invocation-validator.ts (1)
packages/language/src/generated/ast.ts (2)
InvocationExpr(533-538)InvocationExpr(540-540)
packages/sdk/src/ts-schema-generator.ts (3)
packages/language/src/ast.ts (1)
DataModel(49-54)packages/sdk/src/model-utils.ts (1)
hasAttribute(59-64)packages/language/src/utils.ts (1)
hasAttribute(55-57)
samples/orm/zenstack/input.ts (5)
samples/next.js/zenstack/input.ts (1)
UserGetPayload(30-30)tests/e2e/apps/rally/zenstack/input.ts (1)
UserGetPayload(50-50)tests/e2e/orm/schemas/delegate/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)
packages/clients/tanstack-query/src/vue.ts (3)
packages/clients/tanstack-query/src/react.ts (7)
ModelMutationResult(125-125)ModelMutationOptions(122-123)ModelQueryOptions(95-95)ModelQueryResult(97-97)ModelInfiniteQueryOptions(106-109)ModelInfiniteQueryResult(111-111)ModelMutationModelResult(127-140)packages/orm/src/client/crud-types.ts (1)
SimplifiedModelResult(241-248)packages/orm/src/client/options.ts (1)
ClientOptions(45-108)
packages/testtools/src/client.ts (3)
packages/schema/src/schema.ts (1)
SchemaDef(11-19)packages/orm/src/client/options.ts (1)
ClientOptions(45-108)packages/orm/src/client/contract.ts (1)
ClientContract(63-194)
tests/e2e/orm/client-api/auth-typing.test.ts (2)
packages/testtools/src/client.ts (1)
createTestClient(99-248)tests/e2e/orm/schemas/auth-type/schema.ts (1)
schema(73-73)
tests/e2e/orm/schemas/delegate/input.ts (11)
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/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/typing/input.ts (1)
UserGetPayload(30-30)
tests/e2e/orm/schemas/todo/input.ts (11)
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/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/typing/input.ts (1)
UserGetPayload(30-30)
tests/e2e/orm/schemas/basic/input.ts (11)
packages/clients/tanstack-query/test/schemas/basic/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)samples/next.js/zenstack/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)samples/orm/zenstack/input.ts (3)
UserGetPayload(30-30)PostGetPayload(70-70)ProfileGetPayload(50-50)tests/e2e/apps/rally/zenstack/input.ts (2)
UserGetPayload(50-50)CommentGetPayload(230-230)tests/e2e/orm/schemas/default-auth/input.ts (2)
UserGetPayload(30-30)ProfileGetPayload(50-50)tests/e2e/orm/schemas/delegate/input.ts (2)
UserGetPayload(30-30)CommentGetPayload(50-50)tests/e2e/orm/schemas/name-mapping/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)tests/e2e/orm/schemas/omit/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)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 (3)
UserGetPayload(30-30)PostGetPayload(50-50)ProfileGetPayload(70-70)
tests/e2e/orm/schemas/name-mapping/input.ts (7)
samples/next.js/zenstack/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)samples/orm/zenstack/input.ts (2)
UserGetPayload(30-30)PostGetPayload(70-70)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)
packages/orm/src/client/contract.ts (4)
packages/schema/src/schema.ts (4)
SchemaDef(11-19)GetModels(121-121)RelationFields(211-215)GetTypeDefs(142-142)packages/orm/src/client/options.ts (1)
ClientOptions(45-108)packages/orm/src/client/promise.ts (1)
ZenStackPromise(7-13)packages/orm/src/client/crud-types.ts (3)
SimplifiedModelResult(241-248)DefaultModelResult(52-76)TypeDefResult(250-274)
packages/clients/tanstack-query/src/react.ts (3)
packages/clients/tanstack-query/src/vue.ts (6)
ModelMutationResult(102-102)ModelMutationOptions(98-100)ModelQueryOptions(86-88)ModelQueryResult(90-90)ModelInfiniteQueryOptions(92-94)ModelMutationModelResult(104-117)packages/orm/src/client/crud-types.ts (1)
SimplifiedModelResult(241-248)packages/orm/src/client/options.ts (1)
ClientOptions(45-108)
packages/orm/src/client/crud-types.ts (2)
packages/orm/src/client/options.ts (1)
ClientOptions(45-108)packages/orm/src/utils/type-utils.ts (4)
Optional(3-3)WrapType(25-31)Simplify(15-21)PartialIf(5-5)
🪛 markdownlint-cli2 (0.18.1)
TODO.md
6-6: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
7-7: Unordered list indentation
Expected: 4; Actual: 8
(MD007, ul-indent)
8-8: Unordered list indentation
Expected: 4; Actual: 8
(MD007, ul-indent)
9-9: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
10-10: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
11-11: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
12-12: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
88-88: Unordered list indentation
Expected: 4; Actual: 8
(MD007, ul-indent)
⏰ 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). (4)
- GitHub Check: Upload results
- GitHub Check: build-test (20.x, sqlite)
- GitHub Check: build-test (20.x, postgresql)
- GitHub Check: claude-review
|
Claude finished @ymc9's task —— View job Pull Request Review - v3.0.0-beta.26I've completed a comprehensive review of this large PR that introduces field omission, custom auth types, and significant type system enhancements. Review Tasks
✅ Overall AssessmentThis is a well-structured release that introduces significant new features while maintaining code quality. The changes primarily focus on:
🚀 Key Features & ImprovementsField Omission System (
|
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.