-
Notifications
You must be signed in to change notification settings - Fork 240
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
[Poll] Preference on how to filter workspaces #160
Comments
|
Somehow I failed to make the polls bot work here, I'll try again later. @ljharb that's good feedback, please bring it to the original RFC instead - note: what we have in mind for now to solve the glob story/requirement is using that Group/Alias feature described there in the original RFC 😊 |
oof after some back and forth it looks like the poll is on! 😅 thanks @darcyclarke! |
I think the standard |
Probably not as solid an argument, but I think there's some value to keeping it close to what already exists out there. For better or worse it's what the community came to adopt. Yarn has two forms to either run on a single workspace or multiple workspaces, while lerna has a single syntax that runs commands on all packages by default, but allows a Should we add these as options too? |
I think there is value in this argument as long as we don't blindly follow. I think the The Yarn versionis much less optimal IMO. Not only should we try to avoid having two ways to do the same thing, I think the positional arguments version is harder to understand for the same reasons positional options in a function are hard, you have to memorize the order. Obviously in this case it is rather simple, but it is a philosophical thing which I find worth sticking to in most cases. |
My vote is That's very easy to implement, doesn't create a "flags are config values" footgun (which Bottom line is whether My view is that it's a whole different kind of thing, so it'd be surprising and weird (to me, at least) to do But if you see "what workspace am I in" as something akin to doing Questions that might help drive to the heart of this distinction:
I think I might've just talked myself into using |
It would not make any sense to me for a script to be able to run differently based on whether it was ran from the top-level, or ran in situ, so on this one i'd land on "not + separate command"
no, but i might want to do it via env vars.
Strongly B, although I could get used to A.
Either one seems fine to me.
No, that sounds like a violation of encapsulation and separation of concerns; siblings should not know about each other (except as linked dependencies, of course). On balance I think that leaves me leaning towards |
From discussion:
|
I'll make sure to document these results in the RFC: #117 |
This is just a quick poll to collect feedback on the overall preference from the community on how to filter workspaces when running npm commands, in case you have any technical concerns about these or if you want to bring something up to discussion please do so in the original RFC instead.
Given a nested package
foo
which is declared as aworkspace
for a top-level workspaces-enabled project, how would you prefer to run commands on it (following examples usingtest
command):1️⃣ Positional argument with one-char alias:
npm workspace foo test
ornpm w foo test
2️⃣ Positional argument but shorter default name:
npm ws foo test
ornpm w foo test
3️⃣ Special character (operator-like):
npm :foo test
4️⃣ Named argument:
npm --workspace=foo test
ornpm -w=foo test
🔀 Something else? Comment to suggest different alternatives
The text was updated successfully, but these errors were encountered: