-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Prefix workspace commands with workspace name #6932
base: master
Are you sure you want to change the base?
Conversation
d2324be
to
4dae788
Compare
|
f1f2a31
to
144f115
Compare
144f115
to
be94713
Compare
Looks really nice, but it still has the problem that it's BC-breaking. People relying on this command output will have their scripts broken:
|
Can't it just be put behind a command line flag so that the people who want this can enable it and the people who have a working build configuration won't have that be broken?
|
I'm not sure how feasible it is with the CLI - but if it works, I'm ok with it. Another option would be to wait for the v2, since making breaking changes of this kind will be perfectly fine then. What do you think? |
@arcanis flag in v1, default in v2? |
Yup, I'm fine with that 🙂 If a CLI flag is too hard to implement, I'd also be open to use a yarnrc flag for it (like |
// Stay consistent by using the key that is mapped to proc | ||
if (!workspaceColors[key]) { | ||
const randInt = Math.floor(Math.random() * colors.length); | ||
workspaceColors[key] = colors[randInt]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason not to just go through the colors array in order here?
It seems like by using rand
we could potentially pick the same color for neighboring workspaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by going through the array it will also make the output deterministic
@arcanis ok so just to review, we will update this PR to include a flag in v1. As far as V2 is concerned, how do we contribute to it? Or will you implement that side? |
Awesome, thanks! 🙂 The v2 trunk is here: https://github.com/yarnpkg/berry - the contribution process is pretty much the same as here (in this case the command you're likely interested in would be |
Is this PR abandoned? This feature would be nice to have. |
Fixes: #6389 (as discussed with @eps1lon/@arcanis, created a separate PR for this)
When running commands via
yarn workspaces run foo
, prefix command with bold and colorized workspace name. (This change was inspired in large part by lerna's implementation).This provides much more clarity when working in a multi-workspace repo.