[Feature] Workspaces foreach namespace or glob support
See original GitHub issue- I’d be willing to implement this feature
- This feature can already be implemented through a plugin
Describe the user story
Given an application structure such as:
workspaces: [
"packages/*",
"services/*",
"utils/*"
]
You may want to run a command on all subsets. eg. yarn workspaces foreach --include services/* run start
. Currently, it appears the include flag only works with direct names eg. yarn workspaces foreach --include api <command>
Describe the solution you’d like
- Allow glob patterns in the
--include/exclude
flag. - Allow certain workspaces such as
yarn workspaces foreach --include-workspace services <command>
. Similarly for--exclude-workspace
Command names are of course open to discussion.
Describe the drawbacks of your solution
Not sure. Open to feedback.
Describe alternatives you’ve considered
- Passing each manually into the script.
- Use lerna via
lerna run
with filter glob patterns.
Additional context
Previously discussed for Yarn 1 here:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Workspaces - Yarn
Workspaces are a new way to set up your package architecture that's available by default starting from Yarn 1.0. It allows you to...
Read more >Set up multi-tenancy with workspaces :: Gloo Gateway Docs
Use Gloo workspaces to organize Kubernetes and Gloo Gateway resources for multiple teams. Workspaces allow for multi-tenancy and serve as a boundary for...
Read more >Chapter 5. Advanced configuration options
The strategy creates a new namespace for each new workspace. To use the strategy, ... Configuring support for self-signed Git repositories on OpenShift....
Read more >How to filter NPM commands to a pattern of workspaces (like ...
...and that builds all your workspaces with that namespace and either the plugin- or preset- prefix. In lerna, the --scope flag also took...
Read more >Get started using Unity Catalog - Azure Databricks
Create a metastore for each region in which your organization operates. ... of users, service principals, and groups across all workspaces.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems an incredibly common workflow? I’d suggest a core implementation would be handy to allot of teams.
I’d tend to say that the current feature set is low-level enough that you can implement the behaviour you’re looking for directly within your scripts. This is for example what we do in ours.