question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

run-many: Allow use of wildcards

See original GitHub issue

Description

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:closed
  • Created 2 years ago
  • Reactions:17
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
linbudu599commented, Mar 29, 2022

That is a great feature, I would like to have this option. Thanks for adding it. I noticed there is a PR open for some time, does anyone know if there is any progress being made to get this feature integrated? Thanks!

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.

2reactions
belgattitudecommented, Jun 2, 2022

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:

# yarn 3+ https://yarnpkg.com/cli/workspaces/foreach#options
# Works with --include / --exclude
yarn workspaces foreach -tv --include '@belgattitude/*' --since=origin/main --recursive run lint

# turbo: https://turborepo.org/docs/core-concepts/filtering
# Works with --filter and negations
turbo run lint --filter=./apps/* --filter=!admin

# pnpm https://pnpm.io/filtering
# works with --filter
pnpm --filter "@babel/*" lint

# lerna 5
# works with --scope / --exclude
lerna run --scope package-1 --scope *-2 lint

I find the --filter with negation quite easy to read.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using wildcards in commands
Using wildcards in commands. Wildcards allow you to use a single specification to indicate a number of resources whose names match the wildcard...
Read more >
Use wildcards in queries and parameters in Access
This table lists and describes the wildcard characters you can use in an Access query. ... You want to use wildcards with a...
Read more >
run-many - CLI command
run-many. Run target for multiple listed projects. Usage. nx run-many. Install nx globally to invoke the command directly using nx , or use...
Read more >
emulate windows chrome on mac
Microsoft Edge allows you to emulate other web browsers by changing the user ... CrossOver is the easiest way to run many Microsoft...
Read more >
LastPass says hackers stole customers' password vaults
would be allowed, and I would not consider that a good master password. ... Basically have all passwords have 2 parts, 1 password...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found