-
-
Notifications
You must be signed in to change notification settings - Fork 11
merge dev to main #96
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
* feat(cli): add --migrations option to migration commands * update * update
…ion (#90) * fix: make helpers package browser-compatible, fix update args validation * update
…92) * fix: nested select result typing, simplifying ORM query result types * Update packages/runtime/src/utils/type-utils.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * update --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* feat: generate input types * adopting cr comments
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
WalkthroughThis update introduces recursive type simplification, refines model result and input typings, and modularizes TypeScript schema generation into multiple files. It adds enum support, enhances CLI migration options, and moves the Changes
Possibly related PRs
Poem
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/cli/src/actions/migrate.tsOops! Something went wrong! :( ESLint: 9.29.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by packages/cli/src/actions/action-utils.tsOops! Something went wrong! :( ESLint: 9.29.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by packages/runtime/src/client/crud-types.tsOops! Something went wrong! :( ESLint: 9.29.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by
✨ Finishing Touches
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
|
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
Merge dev into main, bumping versions to 3.0.0-alpha.11 and refactoring core generators, CLI commands, and runtime type handling.
- Version bump to
3.0.0-alpha.11across all packages. - Refactor
TsSchemaGeneratorto write separateschema.ts,models.ts, andinput.tsfiles into an output directory, and update CLI and test tooling to match. - Add a
--migrationsoption to the CLI’smigratecommands and adjust Prisma schema generation; introduce a deepSimplifytype and refine argument normalization/validation in the runtime.
Reviewed Changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/package.json | E2E suite version bump |
| samples/blog/zenstack/schema.zmodel | Add documentation comments for Role enum and models |
| samples/blog/zenstack/models.ts | Update generated model types to include Role and docs |
| samples/blog/zenstack/input.ts | Update generated input type definitions |
| samples/blog/package.json | Sample app version bump |
| packages/zod/package.json | Zod adapter version bump |
| packages/typescript-config/package.json | TypeScript config version bump |
| packages/testtools/src/schema.ts | Update testtools generator call to accept outputDir |
| packages/testtools/package.json | Test tools version bump |
| packages/tanstack-query/package.json | TanStack Query adapter version bump |
| packages/sdk/src/ts-schema-generator.ts | Refactor generate to produce multiple files in a directory |
| packages/sdk/package.json | SDK version bump |
| packages/runtime/tsconfig.test.json | Add rootDir for test compilation |
| packages/runtime/test/typing/verify-typing.ts | Import Role and add enum‐related tests |
| packages/runtime/test/typing/typing-test.zmodel | Define Role enum and default role in test schema |
| packages/runtime/test/typing/schema.ts | Extend test schema object with Role enum metadata |
| packages/runtime/test/typing/models.ts | Update generated runtime test models to include Role |
| packages/runtime/test/typing/generate.ts | Adjust test generator call to use directory output |
| packages/runtime/test/client-api/update.test.ts | Add checked/unchecked typing tests |
| packages/runtime/src/utils/type-utils.ts | Introduce recursive Simplify and extend base type mapping |
| packages/runtime/src/index.ts | Export JSON utilities from type-utils |
| packages/runtime/src/client/crud/validator.ts | Split checked vs. unchecked update schemas |
| packages/runtime/src/client/crud/operations/find.ts | Rename normalizeArgs variable for clarity |
| packages/runtime/src/client/crud/operations/base.ts | Refine argument presence checks for select/include/omit |
| packages/runtime/src/client/crud-types.ts | Rename and export SelectInput/IncludeInput/OmitInput; add SimplifiedModelResult |
| packages/runtime/src/client/contract.ts | Update CRUD return types to use Simplify<> |
| packages/runtime/package.json | Runtime version bump |
| packages/language/package.json | Language spec version bump |
| packages/ide/vscode/package.json | VSCode extension version bump |
| packages/eslint-config/package.json | ESLint config version bump |
| packages/create-zenstack/package.json | Project scaffold version bump |
| packages/common-helpers/src/index.ts | Remove find-up export |
| packages/common-helpers/src/find-up.ts | Delete unused findUp implementation |
| packages/common-helpers/package.json | Common helpers version bump |
| packages/cli/src/index.ts | Add --migrations option to all migrate subcommands |
| packages/cli/src/actions/migrate.ts | Use migrations path when generating temporary Prisma schema |
| packages/cli/src/actions/generate.ts | Update generator invocation to use output directory |
| packages/cli/src/actions/action-utils.ts | Inline findUp and extend temp Prisma schema generator |
| packages/cli/package.json | CLI version bump |
| package.json | Root version bump |
| TODO.md | Add new checklist items for strict typing and DbNull handling |
Comments suppressed due to low confidence (2)
packages/runtime/test/typing/verify-typing.ts:188
- To correctly suppress the expected TypeScript error, replace
// TODO: @ts-expect-errorwith// @ts-expect-errordirectly above the statement.
console.log(u.posts[0]?.author?.email);
samples/blog/zenstack/models.ts:28
- [nitpick] The doc comment for the second
Roledeclaration duplicates the first. Consider updating it to clarify it documents the union type of role values (e.g.User role values).
/**
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: 2
🧹 Nitpick comments (3)
packages/runtime/src/utils/type-utils.ts (1)
9-9: Consider using a more specific function type.The static analysis tool correctly identifies that using the generic
Functiontype can be a source of bugs. Consider using a more specific function signature if possible.-type _Preserve = Date | Function | Decimal | Uint8Array | JsonObject | JsonValue; +type _Preserve = Date | ((...args: any[]) => any) | Decimal | Uint8Array | JsonObject | JsonValue;Alternatively, if you need to preserve all function-like objects including constructors:
-type _Preserve = Date | Function | Decimal | Uint8Array | JsonObject | JsonValue; +type _Preserve = Date | ((...args: any[]) => any) | (new (...args: any[]) => any) | Decimal | Uint8Array | JsonObject | JsonValue;TODO.md (2)
47-47: Fix markdown indentation and good addition to the roadmap.The TODO item for strict typing is relevant to the type safety improvements in this release. However, the indentation should be corrected.
Apply this diff to fix the markdown indentation:
- - [ ] Strict typing for checked/unchecked input + - [ ] Strict typing for checked/unchecked input
75-75: Fix markdown indentation and valuable addition for null handling.The TODO item for DbNull vs JsonNull distinction is important for proper null value handling. The indentation needs correction for consistency.
Apply this diff to fix the markdown indentation:
- - [ ] DbNull vs JsonNull + - [ ] DbNull vs JsonNull
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (41)
TODO.md(2 hunks)package.json(1 hunks)packages/cli/package.json(1 hunks)packages/cli/src/actions/action-utils.ts(2 hunks)packages/cli/src/actions/generate.ts(1 hunks)packages/cli/src/actions/migrate.ts(2 hunks)packages/cli/src/index.ts(1 hunks)packages/common-helpers/package.json(1 hunks)packages/common-helpers/src/find-up.ts(0 hunks)packages/common-helpers/src/index.ts(0 hunks)packages/create-zenstack/package.json(1 hunks)packages/eslint-config/package.json(1 hunks)packages/ide/vscode/package.json(1 hunks)packages/language/package.json(1 hunks)packages/runtime/package.json(1 hunks)packages/runtime/src/client/contract.ts(15 hunks)packages/runtime/src/client/crud-types.ts(22 hunks)packages/runtime/src/client/crud/operations/base.ts(3 hunks)packages/runtime/src/client/crud/operations/find.ts(1 hunks)packages/runtime/src/client/crud/validator.ts(3 hunks)packages/runtime/src/index.ts(1 hunks)packages/runtime/src/utils/type-utils.ts(2 hunks)packages/runtime/test/client-api/update.test.ts(1 hunks)packages/runtime/test/typing/generate.ts(1 hunks)packages/runtime/test/typing/models.ts(1 hunks)packages/runtime/test/typing/schema.ts(2 hunks)packages/runtime/test/typing/typing-test.zmodel(1 hunks)packages/runtime/test/typing/verify-typing.ts(4 hunks)packages/runtime/tsconfig.test.json(1 hunks)packages/sdk/package.json(1 hunks)packages/sdk/src/ts-schema-generator.ts(2 hunks)packages/tanstack-query/package.json(1 hunks)packages/testtools/package.json(1 hunks)packages/testtools/src/schema.ts(1 hunks)packages/typescript-config/package.json(1 hunks)packages/zod/package.json(1 hunks)samples/blog/package.json(1 hunks)samples/blog/zenstack/input.ts(1 hunks)samples/blog/zenstack/models.ts(1 hunks)samples/blog/zenstack/schema.zmodel(3 hunks)tests/e2e/package.json(1 hunks)
💤 Files with no reviewable changes (2)
- packages/common-helpers/src/index.ts
- packages/common-helpers/src/find-up.ts
🧰 Additional context used
🧬 Code Graph Analysis (6)
packages/cli/src/actions/generate.ts (1)
packages/sdk/src/ts-schema-generator.ts (1)
TsSchemaGenerator(44-1244)
packages/cli/src/actions/migrate.ts (1)
packages/cli/src/actions/action-utils.ts (1)
generateTempPrismaSchema(55-64)
packages/runtime/test/typing/schema.ts (1)
packages/runtime/src/schema/expression.ts (1)
ExpressionUtils(16-112)
packages/runtime/test/typing/verify-typing.ts (1)
packages/runtime/test/typing/models.ts (2)
Role(17-17)Role(18-18)
packages/runtime/src/client/crud-types.ts (3)
packages/runtime/test/typing/models.ts (1)
Schema(10-10)packages/sdk/src/schema/schema.ts (9)
RelationFieldType(155-159)FieldIsOptional(161-165)FieldIsArray(173-177)SchemaDef(10-17)GetModels(94-94)BuiltinType(76-86)NonRelationFields(141-143)GetFields(102-105)RelationInfo(45-52)packages/runtime/src/utils/type-utils.ts (4)
Optional(3-3)Simplify(11-17)OrArray(52-52)XOR(70-70)
packages/runtime/src/client/contract.ts (3)
packages/runtime/src/client/promise.ts (1)
ZenStackPromise(7-13)packages/runtime/src/utils/type-utils.ts (1)
Simplify(11-17)packages/runtime/src/client/crud-types.ts (1)
ModelResult(115-159)
🪛 markdownlint-cli2 (0.17.2)
TODO.md
47-47: Unordered list indentation
Expected: 4; Actual: 8
(MD007, ul-indent)
75-75: Unordered list indentation
Expected: 4; Actual: 8
(MD007, ul-indent)
🪛 Biome (1.9.4)
packages/runtime/src/utils/type-utils.ts
[error] 9-9: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
packages/runtime/src/client/crud-types.ts
[error] 361-361: Don't use '{}' as a type.
Prefer explicitly define the object shape. '{}' means "any non-nullable value".
(lint/complexity/noBannedTypes)
⏰ 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). (1)
- GitHub Check: build-test (20.x)
🔇 Additional comments (59)
package.json (1)
3-3: Version bump looks good and consistent with repo-wide update
No further action needed.tests/e2e/package.json (1)
3-3: E2E package version aligned with root – LGTM
Everything remains coherent across workspaces.packages/eslint-config/package.json (1)
3-3: eslint-config package version updated correctly
No additional changes required.packages/typescript-config/package.json (1)
3-3: typescript-config version bump verified
Change is straightforward and consistent.packages/runtime/package.json (1)
3-3: Runtime package version increment acknowledged
All good; make sure changelog/release notes reflect the coordinated release.packages/cli/package.json (1)
6-6: Version bump to 3.0.0-alpha.11 looks correct and consistent with the monorepo release cycle
No further action required.packages/testtools/package.json (1)
3-3: Version updated to 3.0.0-alpha.11 – change is straightforward
All good here.packages/tanstack-query/package.json (1)
3-3: Package version bump accepted
Matches the coordinated release.packages/create-zenstack/package.json (1)
3-3: create-zenstack version increment confirmed
Nothing else to note.packages/ide/vscode/package.json (1)
4-4: VSCode extension version aligns with other packages
Looks good.packages/runtime/tsconfig.test.json (1)
5-6: LGTM! Appropriate test configuration settings.The
noImplicitAny: falsesetting provides flexibility for test files, and explicitly settingrootDirimproves build consistency.packages/language/package.json (1)
4-4: LGTM! Standard version bump.Version increment aligns with the coordinated monorepo release.
packages/zod/package.json (1)
3-3: LGTM! Standard version bump.Version increment aligns with the coordinated monorepo release.
samples/blog/zenstack/schema.zmodel (1)
6-6: LGTM! Excellent documentation improvements.The added comments enhance schema readability and provide valuable context for the models and enum.
Also applies to: 12-14, 27-27, 36-36
packages/runtime/src/utils/type-utils.ts (2)
9-17: Excellent recursive type simplification implementation.The new recursive
Simplifytype with depth control is a significant improvement that will provide better type safety and performance. The depth limiting mechanism prevents infinite recursion while preserving important types.
37-41: LGTM! Consistent base type mapping extension.Adding
Bytesmapping toUint8Arrayproperly extends the supported base types.packages/sdk/package.json (1)
3-3: LGTM: Version bump aligns with coordinated monorepo release.The alpha version increment is consistent with the broader release updates across all packages.
samples/blog/package.json (1)
3-3: LGTM: Sample application version synchronized with core packages.The version update maintains consistency across the monorepo.
packages/common-helpers/package.json (1)
3-3: LGTM: Version update supports package restructuring.The version bump aligns with the removal of the
findUputility from this package, as mentioned in the AI summary.packages/runtime/test/typing/typing-test.zmodel (2)
6-9: LGTM: Well-structured enum definition.The
Roleenum withADMINandUSERvalues follows proper ZModel syntax and provides a clear role hierarchy.
17-17: LGTM: Sensible default role assignment.Adding the
rolefield with a default value ofUSERis a non-breaking change that provides a reasonable default for new users.packages/runtime/test/typing/generate.ts (1)
11-11: schema.ts is generated correctly; file operations are validThe
fdcheck confirms thatschema.tsis indeed created underpackages/runtime/test/typing/, so reading and writing it viatsPathcontinues to work as expected. No changes needed here.packages/runtime/src/client/crud/operations/find.ts (1)
8-13: LGTM: Improved variable naming.The variable renaming from
normalizeArgstonormalizedArgsbetter reflects that it contains the normalized arguments rather than the normalization function. This improves code readability and consistency.packages/runtime/src/index.ts (1)
2-2: LGTM: Enhanced public API with JSON types.Adding explicit exports for
JsonArray,JsonObject, andJsonValuetypes improves the public API by making these foundational JSON-related types available to consumers of the runtime package. This enhances type safety and developer experience.packages/cli/src/actions/generate.ts (1)
27-27: LGTM: Correctly aligns with updated TsSchemaGenerator API.The change from
tsSchemaFiletooutputPathcorrectly aligns with the updatedTsSchemaGenerator.generate()method signature, which now expects an output directory and generates multiple files (schema.ts,models.ts,input.ts) within that directory rather than a single output file.packages/runtime/test/typing/schema.ts (2)
40-44: LGTM: Well-formed enum field addition.The new
rolefield is correctly defined with proper type reference to theRoleenum, appropriate default value usingExpressionUtils.literal("USER"), and correct attribute structure.
249-254: LGTM: Properly structured enum definition.The
Roleenum is correctly defined with the expected structure, mapping enum values to their string representations. This aligns with the standard enum pattern used throughout the schema.packages/cli/src/index.ts (2)
63-63: LGTM: Well-structured reusable CLI option.The
migrationsOptionis properly defined as a reusableOptioninstance, following the existing pattern used forschemaOption.
70-70: LGTM: Consistent option addition across migrate subcommands.The
migrationsOptionis correctly added to all relevant migrate subcommands (dev,reset,deploy,status), ensuring consistent CLI interface.Also applies to: 78-78, 85-85, 92-92
packages/testtools/src/schema.ts (1)
47-47: LGTM: Correct adaptation to modularized schema generation.The change from passing a specific file path to a directory path aligns with the updated
TsSchemaGenerator.generatemethod that now outputs multiple files (schema.ts, models.ts, input.ts) instead of a single file.packages/cli/src/actions/migrate.ts (2)
2-2: LGTM: Proper imports and type extension.The
pathimport is correctly added for directory operations, and theCommonOptionstype is appropriately extended with the optionalmigrationsproperty.Also applies to: 8-8
29-30: LGTM: Correct implementation of migrations directory handling.The logic properly extracts the directory from the migrations path using
path.dirnameand passes it togenerateTempPrismaSchema. This aligns with the function signature shown in the relevant code snippets, where the folder parameter defaults to the schema file directory if not provided.packages/runtime/test/client-api/update.test.ts (1)
174-216: LGTM: Comprehensive test for Prisma typing constraints.This test case effectively validates the TypeScript typing system for mutually exclusive relation updates and foreign key usage. It correctly tests both the constraint violation (foreign key + owned relation) and the valid usage (foreign key + non-owned relation).
packages/runtime/test/typing/verify-typing.ts (4)
1-1: LGTM: Clean import organization and enum support.Moving the SQLite import to the top improves readability, and the Role import from the new models.ts file correctly supports the modularized type generation.
Also applies to: 3-3
37-37: LGTM: Proper enum usage in query filters.Using
Role.USERin the filter demonstrates correct enum integration with the query API.
151-188: LGTM: Comprehensive nested relation type testing.These complex nested queries thoroughly test the type system's handling of deep relation traversal, select/include/omit combinations, and proper TypeScript error detection for invalid field access.
607-613: LGTM: Thorough enum type validation.The
enums()function effectively tests enum type safety by validating string-to-enum assignments, enum member usage, and cross-assignments between enum types and string literals.samples/blog/zenstack/models.ts (1)
1-32: LGTM! Well-structured auto-generated file.The auto-generated models file follows good practices with:
- Clear warning headers about manual modification
- Proper ESLint disabling
- Clean type exports using generic
$ModelResulttype- Good documentation comments for each model
packages/runtime/src/client/crud/operations/base.ts (2)
184-196: Improved defensive programming with explicit property checks.The changes from optional chaining to explicit
'property' in objectchecks provide better runtime safety by ensuring properties exist before accessing their values. This is particularly important for CRUD operations where args structure may vary.
1882-1902: Consistent defensive programming pattern applied.The explicit property existence checks in
trimResultandneedReturnRelationsmethods follow the same defensive pattern as the earlier changes, improving runtime reliability.packages/cli/src/actions/action-utils.ts (2)
55-64: Good enhancement with proper parameter handling.The optional
folderparameter adds flexibility while maintaining backward compatibility by defaulting to thezmodelPathdirectory. The implementation correctly handles the parameter and constructs the output path.
89-112: Well-implemented localfindUputility.The local implementation correctly handles:
- Generic typing for single vs multiple results
- Proper recursion with termination conditions
- Multiple file name support
- Path resolution and existence checking
This replaces the external dependency appropriately.
packages/runtime/src/client/crud/validator.ts (1)
927-928: Excellent refactoring for checked/unchecked variant clarity!The renaming from
regularAndFkFields/regularAndRelationFieldstouncheckedVariantFields/checkedVariantFieldswith explicit typing significantly improves code readability. The logic now clearly distinguishes between:
- Unchecked variants: Can include foreign keys and non-owned relations
- Checked variants: Exclude foreign keys but include owned relations
This aligns well with Prisma's checked/unchecked input pattern for type safety.
Also applies to: 960-964, 1007-1011, 1016-1019
packages/runtime/test/typing/models.ts (1)
1-19: Well-structured auto-generated typing file!The file follows best practices for generated code:
- Clear header warning against manual modifications
- Proper ESLint disable directive
- Clean type exports for models and enums
- Appropriate use of
ModelResultgeneric typepackages/runtime/src/client/crud-types.ts (4)
161-167: Good addition ofSimplifiedModelResulttype!The new
SimplifiedModelResulttype provides a cleaner developer experience by recursively simplifying complex nested types, making them more readable in IDE tooltips and error messages.
81-95: Smart conditional type refinement for nested selections!The updated logic correctly handles the mutual exclusivity of
selectandincludeproperties by conditionally passing only the relevant properties to nestedModelResulttypes. This prevents type conflicts and improves type safety.
227-231: Complete implementation of Bytes filter support!Good addition of
BytesFilterto support filtering on byte array fields, maintaining consistency with other primitive filter types.Also applies to: 261-268
336-343: Consistent naming convention for input types!The renaming from
Select/Include/OmitFieldstoSelectInput/IncludeInput/OmitInputcreates a more consistent API surface. The addition of specializedFindManyArgsandFindFirstArgstype aliases improves usability.Also applies to: 354-354, 377-377, 536-538
packages/sdk/src/ts-schema-generator.ts (4)
45-63: Excellent modularization of TypeScript generation!The refactoring from single-file to multi-file generation is a significant architectural improvement that:
- Separates concerns into
schema.ts,models.ts, andinput.ts- Reduces file size for better IDE performance
- Makes generated code more navigable
- Maintains clean separation between runtime schema and type definitions
967-1066: Well-structured model and enum type generation!The
generateModelsmethod properly:
- Uses aliased imports to avoid naming conflicts
- Generates both const and type exports for enums
- Preserves JSDoc comments from the source schema
- Follows TypeScript best practices for type aliases
1110-1243: Comprehensive input type generation with good naming strategy!The
generateInputTypesmethod effectively:
- Generates all necessary CRUD operation input types
- Implements a naming fix mapping for better API consistency
- Includes the generic
GetPayloadtype for flexible result typing- Properly uses type-only imports where appropriate
1098-1108: Clean implementation of documentation preservation!The
generateDocshelper method correctly formats multi-line comments into proper JSDoc format, ensuring that schema documentation is preserved in the generated TypeScript code.packages/runtime/src/client/contract.ts (6)
4-4: LGTM: Proper import of the Simplify utility type.The import correctly brings in the
Simplifyutility type that will be used throughout the interface.
302-302: Excellent: Type simplification applied to find operations.The
Simplifywrapper will make the return types more readable and easier to work with in IDEs by flattening complex nested mapped types.Also applies to: 312-312, 322-322, 332-332, 342-342
398-398: LGTM: Consistent type simplification for create operations.The type simplification is consistently applied to both
createandcreateManyAndReturnmethods.Also applies to: 449-449
570-570: Approved: Type simplification for update and upsert operations.The systematic application of
Simplifyacross all update operations maintains consistency in the type experience.Also applies to: 620-620, 644-644
667-667: LGTM: Type simplification for delete operations.Note that the delete operation doesn't include the generic
Tparameter in theSimplifywrapper, which appears correct since it always returns the full model result.
712-712: Great: Type simplification for aggregation operations.The
Simplifywrapper is appropriately applied to count, aggregate, and groupBy operations, ensuring consistent type experience across all model operations.Also applies to: 733-733, 769-769
samples/blog/zenstack/input.ts (1)
1-71: LGTM: Well-structured auto-generated input types.This auto-generated file provides comprehensive type coverage for all CRUD operations across the three models. The use of
SimplifiedModelResultin theGetPayloadtypes (lines 30, 50, 70) aligns perfectly with the type simplification improvements introduced in the runtime contract. The consistent naming patterns and proper imports make this a solid foundation for type-safe database operations.
Summary by CodeRabbit
New Features
--migrations <path>option to specify a migrations path.Enhancements
Bytestype in filters and improved checked/unchecked input handling.Bug Fixes
Documentation
Chores
3.0.0-alpha.11across all packages.