Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add --since flag support to yarn workspaces focus #6708

Open
1 of 2 tasks
WooWan opened this issue Mar 1, 2025 · 0 comments
Open
1 of 2 tasks

[Feature] Add --since flag support to yarn workspaces focus #6708

WooWan opened this issue Mar 1, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@WooWan
Copy link

WooWan commented Mar 1, 2025

  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

As a developer working in a monorepo, I frequently need to install and build only packages that have changed since a specific git reference, particularly in CI environments. Whilst yarn workspaces foreach supports the --since flag for running commands on modified workspaces, this capability is absent from yarn workspaces focus. This deficiency forces me to either install all workspaces or manually identify changed ones, which is terribly inefficient in larger monorepos with numerous interdependencies and significantly increases CI execution times.

Describe the solution you'd like

Add a --since flag to the yarn workspaces focus command that works exactly like the existing implementation in yarn workspaces foreach. When specified, Yarn would only focus on workspaces that have been modified since the specified git reference. This would dramatically reduce CI build times—potentially by 50-80% in large monorepos where only a small subset of packages changes between runs

Describe the drawbacks of your solution

Whilst this adds complexity to the codebase that may be less beneficial in zero-install scenarios (as noted in the existing focus documentation), I believe the implementation complexity should be minimal given that the --since option already exists within yarn workspaces foreach and could likely share much of the same code.

Describe alternatives you've considered

Given that the --since flag is already successfully implemented in yarn workspaces foreach, extending this functionality to yarn workspaces focus would provide a consistent developer experience across Yarn commands, reduce CI execution times significantly, and eliminate the need for workarounds or external tools

@WooWan WooWan added the enhancement New feature or request label Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant