Releases: mogzol/prisma-generator-typescript-interfaces
Releases · mogzol/prisma-generator-typescript-interfaces
3.1.0
3.0.0
BREAKING CHANGES:
- The
omitRelationsandoptionalRelationsoptions have been replaced with justrelations, which can be set to eitherrequired,optional, ornone. - The
BufferObjectandArrayObjectbuilt-in types have been removed from thebytesTypeoption. Their behavior can be replicated using custom types:generator typescriptInterfaces { provider = "prisma-generator-typescript-interfaces" // To get the old 'BufferObject' behavior: bytesType = "BufferObject:{ type: \"Buffer\"; data: number[] }" // To get the old 'ArrayObject' behavior: bytesType = "ArrayObject:{ [index: number]: number } & { length?: never }" }
- The
resolvePrettierConfigoption has been replaced withprettierConfigPath, which allows you to specify a specific Prettier config file. If this option is empty (the default), then the behavior will be the same as before, where the Prettier config file will be resolved relative to the output location. Set the option tonullto disable using Prettier config files altogether. - The new per-field types feature is enabled by default. If your Prisma schema contains compatible type annotations in your field documentation, they will be used and the output will be different from previous releases. If you don't want this behavior, set the
perFieldTypesconfig option tofalse.
New Features:
- Allow full control over the types used during generation, including allowing per-field types. See Custom Types for details.
- Thanks @helmturner for the initial per-field types work
- Add the
includeCommentsoption to include documentation from the schema in the generated output (thanks @samelie) - Add the
countsoption to include the_countfield on models with relations. It can be set to eitherrequired,optional, ornone. - Improve config validation and generator error messages. The generator name is now included in all errors since Prisma doesn't make it clear which generator an error is coming from.
Full Changelog: 2.1.0...3.0.0
3.0.0-beta.2
Changes (since v2.1.0)
BREAKING CHANGES:
omitRelationsandoptionalRelationshave been replaced with justrelations, which can be set to eitherrequired,optional, ornone.- The
BufferObjectandArrayObjectbuilt-in types have been removed frombytesType. Their behavior can be replicated using custom types:generator typescriptInterfaces { provider = "prisma-generator-typescript-interfaces" // To get the old 'BufferObject' behavior: bytesType = "BufferObject:{ type: \"Buffer\"; data: number[] }" // To get the old 'ArrayObject' behavior: bytesType = "ArrayObject:{ [index: number]: number } & { length?: never }" }
- The
resolvePrettierConfigoption has been replaced withprettierConfigPath, which allows you to specify a specific Prettier config file. If this option is empty (the default), then the behavior will be the same as before, where the Prettier config file will be resolved relative to the output location. Set the option tonullto disable using Prettier config files altogether. - The new per-field types feature is enabled by default. If your Prisma schema contains compatible type annotations in your field documentation, they will be used and the output will be different from previous releases. If you don't want this behavior, set the
perFieldTypesconfig option tofalse.
New Features:
- Allow full control over the types used during generation, including allowing per-field types. See Custom Types for details.
- Thanks @helmturner for the initial per-field types work
- Add the
includeCommentsoption to include documentation from the schema in the generated output (thanks @samelie) - Add the
countsoption to include the_countfield on models with relations. It can be set to eitherrequired,optional, ornone. - Improve config validation and generator error messages. The generator name is now included in all errors since Prisma doesn't make it clear which generator an error is coming from.
Full Changelog: 2.1.0...3.0.0-beta.2
3.0.0-beta.1
Changes:
- Allow full control of the types used during generation, including allowing per-field types. See Custom Types for details.
- BREAKING CHANGE: The
BufferObjectandArrayObjectbuilt-in types forBytesfields have been removed. Their behavior can be replicated using custom types:generator typescriptInterfaces { provider = "prisma-generator-typescript-interfaces" // To get the old 'BufferObject' behavior: bytesType = "BufferObject:{ type: \"Buffer\"; data: number[] }" // To get the old 'ArrayObject' behavior: bytesType = "ArrayObject:{ [index: number]: number } & { length?: never }" }
Full Changelog: 2.1.0...3.0.0-beta.1
2.1.0
Changes:
- Stop enum fields from being marked
readonlywhen usingenumType = "object"- #14- Note that this is a breaking change if you are using TypeScript < 4.9, as it uses the
satisfieskeyword. Either upgrade TypeScript or use a differentenumType.
- Note that this is a breaking change if you are using TypeScript < 4.9, as it uses the
- Add
enumObjectSuffixandenumObjectPrefixoptions - #14 - Add
exportEnumsoption - #15 - Thanks @helmturner for these changes!
Full Changelog: 2.0.1...2.1.0
2.0.1
2.0.0
Changes:
- BREAKING: Add
Uint8Arrayoption forbytesType, and make it the default. This is to match the changes made in Prisma v6. If you are still using Prisma v5 and want the generated types to be type-compatible with the Prisma client, you will now need to explicitly setbytesTypetoBuffer. - Add
ArrayObjectoption forbytesType, which matches the output of runningJSON.stringifyon aUint8Array. - Update dependency declaration for
@prisma/generator-helperto allow either v5 or v6 of the library, as either will work.
Full Changelog: 1.7.0...2.0.0
1.7.0
1.6.1
No code changes since 1.6.0, this is just a documentation update.
Full Changelog: 1.6.0...1.6.1