feat(core): allow tasks to run with a substring of project name #29552
+113
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When projects use only
package.json
and notproject.json
, we need to set the simple name in thenx
property ofpackage.json
. This isn't ideal because it's yet another Nx-specific thing that needs to be configured when our goal is to reduce boilerplate.This PR allows users to pass a substring that matches exactly one project when running a task.
For example, if
@acme/foo
is the name inpackage.json
, then runningnx build foo
will match it.If more than one projects match, then an error is thrown showing all the matched projects, and the user has to be more specific or type in the fully qualified name.
Current Behavior
Users need to pass exact matches for project names when running tasks.
Expected Behavior
User can pass a substring matching the project name.
Related Issue(s)
Fixes #