-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(misc): ensure workspace directory is normalized correctly #16855
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
const args = unparse({ | ||
...options, | ||
}).join(' '); | ||
|
||
const pmc = getPackageManagerCommand(packageManager); | ||
|
||
const command = `new ${directory} ${args}`; | ||
const command = `new ${args}`; |
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.
The ${directory}
here was useless. The name
arg takes precedence over the positional arg and overwrites it.
I'm normalizing the name
option above, which is a known and required option, so we don't rely on the new
generator rederiving it. We could also pass the directory
option directly so it's more deterministic and we don't rely on some behavior in the new
generator, but that option is not in the new
generator schema for some reason. If someone can confirm whether it's intentional or just something we missed, I can add it and pass the option directly.
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
When creating a new workspace a providing a repo name with
_
in it, an error is thrown due to a mismatch in the directory name used by thenew
generator vs thecreate-nx-workspace
functionality. This mainly happens because thenew
generator is invoked with the non-normalized name and this generator wrongly sets thedirectory
to that value instead of setting it with the normalized name.Expected Behavior
Creating a new workspace providing a repo name with
_
should not throw an error.Related Issue(s)
Fixes #16841