Skip to content

feat: added new generate option to control spec file name#1968

Merged
kamilmysliwiec merged 2 commits into
nestjs:masterfrom
hrkeni:spec-file-suffix
Apr 14, 2023
Merged

feat: added new generate option to control spec file name#1968
kamilmysliwiec merged 2 commits into
nestjs:masterfrom
hrkeni:spec-file-suffix

Conversation

@hrkeni

@hrkeni hrkeni commented Mar 12, 2023

Copy link
Copy Markdown

PR Checklist

Please check if your PR fulfills the following requirements:

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, a generated spec file always ends with .spec.ts

Issue Number: #1683

What is the new behavior?

There should be a cli flag and config option to specify the suffix to be used, with the default being spec.

nest g res foo --spec-file-suffix=test
nest-cli.json:

{
"generateOptions": {
"spec": true,
"specFileSuffix": "test"
}
}

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Comment thread lib/utils/project-utils.ts Outdated
@hrkeni hrkeni force-pushed the spec-file-suffix branch from 616e282 to 85e8452 Compare April 6, 2023 23:09
@kamilmysliwiec

Copy link
Copy Markdown
Member

And how is this new option applied to schematics?

@hrkeni

hrkeni commented Apr 13, 2023

Copy link
Copy Markdown
Author

@kamilmysliwiec The changes to schematics were already made in July 22 nestjs/schematics#1077
This is just enabling CLI to use those

@kamilmysliwiec kamilmysliwiec merged commit 4781b7d into nestjs:master Apr 14, 2023
@kamilmysliwiec

Copy link
Copy Markdown
Member

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants