docs.nestjs.com icon indicating copy to clipboard operation
docs.nestjs.com copied to clipboard

feat: document case naming generate option

Open espoal opened this issue 1 year ago • 1 comments

Summary

This is the third of a multi PR effort aiming at supporting custom name casing conventions, as detailed here.

  1. The first PR attempts to update @nestjs/schematics to accept a caseType option when generating a new file.
  2. In this PR we add a caseNaming field to GenerateOptions
  3. This is the PR to document the new option
  4. 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 the dist 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 custom nest-cli.json node bin/nest.js g co keb-pap in a folder with the correct nest-cli.json

espoal avatar Oct 17 '23 07:10 espoal

<3 thank you for creating this feature. it is really handy! can't wait to have it merged. Which version can it be expected?

vycos-zen avatar Apr 29 '24 15:04 vycos-zen