Skip to content
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: Add skip import option to generate command #1580

Merged
merged 1 commit into from
Apr 7, 2022

Conversation

StringKe
Copy link
Contributor

@StringKe StringKe commented Mar 22, 2022

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?

Issue Number: N/A

What is the new behavior?

When using the generate command you can skip the service controller automatic import into module by adding --skip-import

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@@ -121,7 +121,10 @@ const mapSchematicOptions = (inputs: Input[]): SchematicOption[] => {
const options: SchematicOption[] = [];
inputs.forEach((input) => {
if (!excludedInputNames.includes(input.name) && input.value !== undefined) {
options.push(new SchematicOption(input.name, input.value));
const keepInputName = input.options
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this keepInputName for? can't we have the --skip-import flag without adding this logic? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, thanks. Looks like this is a limitation of that SchematicOption#toCommandString method as it expects that long names for flags should be translated to kebab case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Schematic Option#toCommandString affects the parameters ultimately passed to Schema.

@jmcdo29
Copy link
Member

jmcdo29 commented Apr 6, 2022

@kamilmysliwiec could we get some attention on the PR?

@kamilmysliwiec
Copy link
Member

lgtm

@kamilmysliwiec kamilmysliwiec merged commit eb51666 into nestjs:master Apr 7, 2022
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.

None yet

4 participants