-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat(nest): update nest generators to support name and directory format option #19668
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(nest): update nest generators to support name and directory format option #19668
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit fc4c987. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
"project": { | ||
"description": "The Nest project to target.", | ||
"type": "string", | ||
"$default": { "$source": "projectName" }, | ||
"alias": "p", | ||
"x-prompt": "What Nest project would you like to target?" | ||
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v18." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to also remove project
from the required
array in schema.
}; | ||
|
||
console.log({ normalizedOptions }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
nameAndDirectoryFormat: options.nameAndDirectoryFormat ?? 'derived', | ||
}); | ||
|
||
console.log({ directory, fileName }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
0dca254
to
525dea5
Compare
callingGenerator, | ||
artifactType, | ||
name: options.name, | ||
directory: options.directory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to pass derivedDirectory: options.directory
. The Nest generators are like the React ones where directory
is relative to project's source root, so nx g class foo --project test --directory a/b
will generate test/src/lib/a/b/foo.ts
.
name: options.name, | ||
directory: options.directory, | ||
project: options.project, | ||
flat: options.flat, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need flat: options.flat ?? true
so programmatic usage of generators maintain the same behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm... it's never been required both in schema.json
or the typescript types... and defaults to false
so this should be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's fine
Two changes needed to maintain same behavior for derived case, but rest LGTM. |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
No support for nameAndDirectoryFormat
Expected Behavior
Nest generators now support nameAndDirectoryFormat
Related Issue(s)
Fixes #