-
Notifications
You must be signed in to change notification settings - Fork 27
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
Configuration for type suffixes and prettier config + other breaking changes #13
Open
joshmossas
wants to merge
19
commits into
adeyahya:master
Choose a base branch
from
joshmossas:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autogenerate $id option
@adeyahya I know there's alot here so lemme know if anything needs to be reverted or changed. For example I imagine the yarn > pnpm change might break some CI stuff along with potentially the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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