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.

[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:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
andrewmclagancommented, Mar 11, 2020

It seems an incredibly common workflow? I’d suggest a core implementation would be handy to allot of teams.

1reaction
arcaniscommented, Jan 28, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

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