Configuration for type suffixes and prettier config + other breaking changes #13
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.
Type suffix is now configurable, but omitted by default
This fixes #11 by omitting the typeSuffix in outputted code by default which is a breaking change.
If a type suffix is still desired it can now be configured in the
schema.prisma
file as follows:Customize code style of outputted code by specifying a prettier config
This PR adds a configuration option letting you link to a prettier config as follows:
This allows users to more easily make the generated code match the code style of their codebase. Under the hood this feature uses c12, which allows us to support json, typescript, and javascript configuration files. (The c12 library was created by the nuxtjs and unjs team so I think it's safe to add it as a dependency as it's very likely to remain well maintained.)
Automatically add the $id property to generated models.
Given the following prisma schema
The generator will now output
I'm on the fence as to whether this should be the default behavior or whether this is something that should be toggleable through the configuration in the
schema.prisma
. I guess regardless it would be good to have it be configurable somehow. If we do add another configuration field I wonder what we should call it...Dependency Updates and Other Changes
@prisma/sdk
dependency and replace it with@prisma/internals
@prisma/generator-helper
to v5.2.0core-js
to v3.32.1prettier
to v3.0.3c12
as a dependency to supportjson
,ts
, andjs
prettier config files