Closed prewk closed 3 months ago
Thanks for reporting this!
The suggested command is meant to be run with --projectNameAndRootFormat=as-provided
. You should get a prompt asking whether to use the command "as provided" or "derived". The warning advises to choose the "as provided" format moving forward.
If you're not getting the prompt, then you probably have generator defaults set in the nx.json
file, setting the option to derived
. In that case, you need to explicitly provide the --projectNameAndRootFormat=as-provided
.
A-ha! You're right. Thanks and sorry.
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
In nx 18, if I run
nx g @nx/angular:library shared/foo/bar
It'll create a library in
libs/shared/foo/bar
namedshared-foo-bar
with import path@acme/shared/foo/bar
. Nx wants to deprecate this behavior and require explicit arguments, as evident by its suggestion:Let's run the suggested command! Output:
shared-foo-bar
inside oflibs/shared/foo/bar
Expected Behavior
It seems the correct suggestion to achieve the same result would be:
yarn nx g @nx/angular:library bar --directory libs/shared/foo --importPath="@acme/shared/foo/bar"
GitHub Repo
No response
Steps to Reproduce
See further up
Nx Report