docs.nestjs.com
docs.nestjs.com copied to clipboard
feat: document case naming generate option
Summary
This is the third of a multi PR effort aiming at supporting custom name casing conventions, as detailed here.
- The first PR attempts to update
@nestjs/schematics
to accept acaseType
option when generating a new file. - In this PR we add a
caseNaming
field toGenerateOptions
- This is the PR to document the new option
- Future PRs will extend this feature in term of supported actions, tests and configuration
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
- [x] Tests for the changes have been added (for bug fixes / features)
- [x] Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:
What is the current behavior?
Currently @nestjs/cli
uses kebab-case
, as mentioned in this issue.
Issue Number: 462
What is the new behavior?
The goal is to add a caseNaming
option to the GenerateOptions
CLI config so that generated files will follow the desired name casing convention.
Does this PR introduce a breaking change?
[ ] Yes
[x] No
Other informations
How to run
- Install deps and build:
npm install
npm run build
- Build updated
@nestjs/schematics
Clone this branch, and do:
npm install
npm run build
-
Install the updated
@nestjs/schematics
package Copy thedist
folder in@nestjs/nest-cli
deps:nest-cli/node_modules/@nestjs/schematics/dist/
-
Run it with one of those commands:
node bin/nest.js new test-nest -s --caseNaming=camel
to generate a customnest-cli.json
node bin/nest.js g co keb-pap
in a folder with the correctnest-cli.json
<3 thank you for creating this feature. it is really handy! can't wait to have it merged. Which version can it be expected?