run-many: Allow use of wildcards
See original GitHub issueDescription
Allow use of * wildcard in run-many command, like nx run-many --target="lint" --projects="core-*"
Old issue from 2020 was auto-closed without any solution. I think todays it still is a useful and relatively easy to implement addition. https://github.com/nrwl/nx/issues/3736
Motivation
For all larger monorepos it becomes an increasingly tedious task to run testing/linting processes on multiple packages. Providing packages follow a wellthought naming convention, run-many could save us lots of writing by accepting a wildcard operator.
Examples:
nx run-many --target=lint --projects="myapp-frontend-*"
nx run-many --target=lint --projects="libs-ui-*"
nx run-many --target=lint --projects="*database*"
Suggested Implementation
When trying to find the package IDs matching the input data, a check for * operator must happen, if found, package names in workspace/angular.json must be matched against the input wildcard. After matching process, the run-many command can continue working as usual.
Alternate Implementations
Thinking further, the matching process could also/additionally work by matching nx tags assigned to the packages.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:17
- Comments:6 (2 by maintainers)
I’m the original initiator of the PR, sorry for putting it on hold after I ran into some problems with the testing after the feature was implemented, I’ll start refining the PR this week and ask for help from official members and get it in the official version as soon as possible.
Would be great. I generally have different actions and would be nice to have wildcards / paths.
Not sure I would re-use the
--project
though.In the wild:
I find the --filter with negation quite easy to read.