

The architecture is there, it just needs to get polished to show what Example: unlink: yarn workspaces foreach run unlink link: yarn workspaces foreach.
To add the plugin run: yarn plugin import workspace-tools Usage: yarn workspaces foreachI still see a lot of potential and benefit in berry Using the Yarn workspace-tools plugin you can make use of the Yarn foreach command to run a command on all workspaces. If -topological-dev is set, both the dependencies and devDependencies fields will be considered when figuring out the wait points. Good product and a good developer experience. If -t,-topological is set, Yarn will only run the command after all workspaces that it depends on through the dependencies field have successfully finished executing. Yarn is about hidingĬomplexity, user convenience and happiness, and performance.Īs odd as that may sound - it's important to strike a balance of a This is direct opposite to what yarn is about. The underlying feeling I have is berry is optimizing for the maintainers,

This may have a practical use case for it, e.g. Not a fan of how YN0000 shows everywhere. If it's not fitting the scenario - don't even Show practical examples of what type of projects these configuration My guess is the settings are to fill niche caches and specialized Overwhelmed byĮvery configuration option is listed, with no help given to making the 99% of the options berry has make no sense to me. With not adopting an incremental approach to make yarn v1 better. It seems to decouple architecture (yay) but I'm concerned Why give it another name, unless losing track of where it came from It seems to be a project in the midst of a philosophical problem. yarn workspace yarn workspaces focus yarn workspaces foreach yarn workspaces list yarnpkg/builder. I imagine parsing the output of CLI tools in some way is a common enough use case that Yarn should have the flag to allow it without strange workarounds.Įven though we may not ultimately use it:

This could also be worked around by piping the output through another command that removes that prefix from the output, but my intuition is that'd be prone to failure. This could be solved by modifying the regex in the problem matcher, but I believe it's out of scope for a tsc problem matcher to account for all kinds of wrappers that might be mutating the compiler's error format. I don't think there are any specific drawbacks to this feature in particular, but I'm unfamiliar with Yarn's codebase so I likely have blind spots here. Just the general drawback of having yet another flag/feature to maintain/test. I'd be willing to work on this PR if it's something that would be accepted. Yarn workspaces foreach -vpt -topological-dev -j 100 -raw-output run build I think yarn workspaces foreach should have a flag to suppress stuff like ➤ YN0000: from the output, or in other words a flag to get the raw unmodified output of the command(s) being run: In particular, it breaks on matching the file name, causing the annotation to end up in the wrong place. However, since I use yarn workspaces foreach, the output gets prefixed with Yarn's log level codes, causing the problem matcher to not match the output correctly. If my CI runs yarn run build on a workspace directly, the output is identical to the output of tsc, so the matcher works fine.
#Yarn workspaces foreach code#
That setup step by default includes a tsc problem matcher which uses regex to match the output of the Typescript compiler and annotate the code in a PR with the actual errors. I use GitHub Actions as my CI with the action to configure my CI environment for building my project.

When I execute yarn workspaces run build it triggers the build script for all workspaces.Yarn workspaces foreach -vpt -topological-dev -j 100 run buildĮach workspace's build script calls tsc with some flags. In my packages dir I have a folder common amongst others, with its own package.json etc. I have workspaces set up like this "private": true,
