Yarn: workspace run commands only when it exists

Created on 29 Nov 2018  路  8Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
feature

What is the current behavior?
As specified in RFC yarn workspaces run <command> will fail if the command is missing in any package.

What is the expected behavior?
I'd like yarn to execute the command only on packages that have it. That would allow each package to opt-in by just declaring the desired commands. Note that this is how lerna does it by default.

Please mention your node.js, yarn and operating system version.
node v8.11.3
yarn 1.12.3
osx 10.13.6

cat-feature good first issue help wanted

All 8 comments

@rally25rs could you assign me this issue, I am new to the community, is there any IRC or gitter channel for the community?I have setup yarn on my machine

C:\Users\abhi\Documents\openGit\yarn>alias yarn-local="node $PWD/lib/cli/index.js"
'alias' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\abhi\Documents\openGit\yarn>

facing this issue while creating the test environment.

Hi @rally25rs I have a PR for this. Apologies if I've done something wrong with the PR process: https://github.com/yarnpkg/yarn/pull/6841

Hi @AsociTon You can't use _alias_ in Windows, that's a Linux command.

Hi @testerez do you mean yarn workspaces run command instead of yarn workspace run command in your current behavior description?

Right, @dezson. I updated my description. Thank!

@arcanis is this something you consider as sensible to implement? Should I work on it on this version or should contribute to Yarn 2.x (or both)?

Hey @benedyktdryl! This feature has actually been implemented (in the v2, so still developer preview) via the more powerful yarn workspaces foreach command, which only iterates on workspaces that define the script (when using the run subcommand).

That being said, we're always happy to welcome new contributors to the v2 - we have various issues tagged good first issue and help wanted, if you're interested to take a look 馃槉

Awesome, I will definitely check these labels, thanks!

Was this page helpful?
0 / 5 - 0 ratings