-
Notifications
You must be signed in to change notification settings - Fork 209
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
feat: initial support for case type selection #1501
base: master
Are you sure you want to change the base?
Conversation
); | ||
|
||
target.caseNaming = !!target.caseNaming ? target.caseNaming : 'snake'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, maybe i missed something, but this shouldn't be pascal
by default ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the original implementation a case named kebab-or-snake
is used, which is the snake
you see referred here. I kept the original default to avoid unintended side effects, for example other piece of the nestjs codebase default to and expect snake
as input, or they will complain
Summary
This is the first of a multi PR effort aiming at supporting custom name casing conventions, as detailed here.
@nestjs/schematics
to accept acaseType
option when generating a controller.caseNaming
field toGenerateOptions
For now I decided to support only controllers, to reduce the changes size and make reviewing easier. If the approach will be approved I will make sure to extend it to other objects and to add more tests. For the reviewer please check this in particular.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently
@nestjs/cli
useskebab-or-snake
case, as mentioned in this issue.What is the new behavior?
The goal is to add a
caseNaming
option tonest-cli.json
so that generated files will follow the desired name casing convention.Does this PR introduce a breaking change?
Other informations