feat: initial support for case type selection#1501
Open
espoal wants to merge 23 commits intonestjs:masterfrom
Open
feat: initial support for case type selection#1501espoal wants to merge 23 commits intonestjs:masterfrom
espoal wants to merge 23 commits intonestjs:masterfrom
Conversation
3 tasks
micalevisk
reviewed
Sep 29, 2023
micalevisk
reviewed
Sep 29, 2023
espoal
commented
Oct 4, 2023
3 tasks
4 tasks
milsosa
reviewed
Oct 17, 2023
benjGam
reviewed
Jan 25, 2024
| 'kebab-or-snake' | ||
| ); | ||
|
|
||
| target.caseNaming = !!target.caseNaming ? target.caseNaming : 'snake'; |
There was a problem hiding this comment.
Hi, maybe i missed something, but this shouldn't be pascal by default ?
Author
There was a problem hiding this comment.
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
1 task
This file contains hidden or 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
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.
Summary
This is the first of a multi PR effort aiming at supporting custom name casing conventions, as detailed here.
@nestjs/schematicsto accept acaseTypeoption when generating a controller.caseNamingfield toGenerateOptionsFor 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/cliuseskebab-or-snakecase, as mentioned in this issue.What is the new behavior?
The goal is to add a
caseNamingoption tonest-cli.jsonso that generated files will follow the desired name casing convention.Does this PR introduce a breaking change?
Other informations