chore(deps): Major overhaul for Prisma v6 support and resolve breakin… #490
+18,160
−129,253
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…g changes
🚀 Major Features & Breaking Changes
Bytes Type Migration to Uint8Array
To align with Prisma v6, the Bytes scalar type is now mapped to Uint8Array instead of Buffer. A custom GraphQL BytesScalar has been introduced to handle serialization and is now conditionally generated and imported only when a schema utilizes the Bytes type.
Updated fullTextSearch Preview Feature
The preview feature flag for full-text search on PostgreSQL has been updated from fullTextSearch to the new provider-specific fullTextSearchPostgres.
Consistent find...OrThrow API
The generator now maps findFirstOrThrow to findFirstOrThrow{ModelName}, creating a more consistent and predictable API for throw-on-not-found queries.
Reserved Model Name Prevention
New Types and Arguments
Support has been added for the new ScalarRelationFilter input type.
Generated types now include the limit argument for applicable find queries.
New output types have been added for updateMany operations.
🛠️ Fixes & Refinements
The FieldDefault arguments type has been refined to Array<string | number> to match Prisma's updated type definitions.
Corrected the parsing of input type names that include ScalarRelationFilter.
Removed unnecessary type assertions and unused imports to improve code quality.
Othe BREAKING CHANGE: This fix alters the code generator's output, introducing the following breaking changes.
Removal of Generated Files: The generator no longer creates obsolete filter files (e.g.,
FirstModelRelationFilter.ts
). Any code that imports these files will now fail.ScalarRelationFilter
structure, making the old files redundant.New Filter Type API: The old filter types are replaced by the new
ScalarRelationFilter
types. This changes the names, structure, and available properties of the filter objects.⚙️ Dependencies & Tooling
Prisma dependencies have been updated to v6.16.2.
Jest and TypeScript configurations were updated to use CommonJS and support NodeNext module resolution for better compatibility.
The pre-commit hook was fixed to correctly run tests using npx lint-staged.
✅ Testing
Added new regression tests to verify the correct handling of the Bytes scalar and the new error-throwing behavior in Prisma v6.
Updated numerous tests and Jest snapshots to align with the extensive changes in the generated code, including new arguments, updated import paths, and revised type structures.