Skip to content

Releases: mogzol/prisma-generator-typescript-interfaces

3.1.0

04 Sep 23:17
c383434

Choose a tag to compare

Changes:

  • Add optionalDefaults option to control whether fields with a default value are generated as optional or not (defaults to false).

Full Changelog: 3.0.0...3.1.0

3.0.0

28 Aug 22:59
8e79d64

Choose a tag to compare

BREAKING CHANGES:

  • The omitRelations and optionalRelations options have been replaced with just relations, which can be set to either required, optional, or none.
  • The BufferObject and ArrayObject built-in types have been removed from the bytesType option. 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 resolvePrettierConfig option has been replaced with prettierConfigPath, 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 to null to 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 perFieldTypes config option to false.

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 includeComments option to include documentation from the schema in the generated output (thanks @samelie)
  • Add the counts option to include the _count field on models with relations. It can be set to either required, optional, or none.
  • 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

22 Aug 05:37
18e3455

Choose a tag to compare

3.0.0-beta.2 Pre-release
Pre-release

Changes (since v2.1.0)

BREAKING CHANGES:

  • omitRelations and optionalRelations have been replaced with just relations, which can be set to either required, optional, or none.
  • The BufferObject and ArrayObject built-in types have been removed from bytesType. 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 resolvePrettierConfig option has been replaced with prettierConfigPath, 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 to null to 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 perFieldTypes config option to false.

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 includeComments option to include documentation from the schema in the generated output (thanks @samelie)
  • Add the counts option to include the _count field on models with relations. It can be set to either required, optional, or none.
  • 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

01 Apr 23:54
b15e9d1

Choose a tag to compare

3.0.0-beta.1 Pre-release
Pre-release

Changes:

  • Allow full control of the types used during generation, including allowing per-field types. See Custom Types for details.
  • BREAKING CHANGE: The BufferObject and ArrayObject built-in types for Bytes fields 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

19 Mar 05:25
9f47ac3

Choose a tag to compare

Changes:

  • Stop enum fields from being marked readonly when using enumType = "object" - #14
    • Note that this is a breaking change if you are using TypeScript < 4.9, as it uses the satisfies keyword. Either upgrade TypeScript or use a different enumType.
  • Add enumObjectSuffix and enumObjectPrefix options - #14
  • Add exportEnums option - #15
  • Thanks @helmturner for these changes!

Full Changelog: 2.0.1...2.1.0

2.0.1

17 Mar 22:34
6abaf69

Choose a tag to compare

Changes:

  • Fix README.md example, and re-order the README.md sections.

Full Changelog: 2.0.0...2.0.1

2.0.0

17 Mar 06:24
9066afe

Choose a tag to compare

Changes:

  • BREAKING: Add Uint8Array option for bytesType, 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 set bytesType to Buffer.
  • Add ArrayObject option for bytesType, which matches the output of running JSON.stringify on a Uint8Array.
  • Update dependency declaration for @prisma/generator-helper to allow either v5 or v6 of the library, as either will work.

Full Changelog: 1.7.0...2.0.0

1.7.0

29 Nov 18:31

Choose a tag to compare

Changes:

Full Changelog: 1.6.1...1.7.0

1.6.1

01 Nov 18:51

Choose a tag to compare

No code changes since 1.6.0, this is just a documentation update.

Full Changelog: 1.6.0...1.6.1

1.6.0

30 Oct 19:32

Choose a tag to compare

Changes:

  • Add optionalNullables option

Full Changelog: 1.5.0...1.6.0