RFC: npm workspaces - Config management#273
Conversation
|
Per discussion on the call today, i have questions about how “add” works with a glob, or how “rm” works when the package to be removed is already included in a glob. |
|
To elaborate a bit more the confusion comes from the fact that supporting globs can get confusing really fast, one of the examples mentioned during the weekly meeting was trying to add negative globs, e.g: So the tricky question is what is a behavior that would be reasonable and actually helpful for the majority of users with regards to
|
|
I am generally in favor of adding some commands to make working with workspaces easy. I generally like how
|
|
@ruyadorno you had mentioned on the call there have been talks with the team behind lerna, so it might be cool to add that as a kind of context. Additionally. a link to I think workspaces v2 is what it is called would be nice here too, so people can follow up with the previous discussion. |
@Christian24 I mentioned that in the context of the RFC for running commands: #117 we do have a bunch of the conversations documented there 😊 |
|
|
||
| $ npm workspaces ls | ||
|
|
||
| $ npm workspaces add ./packages/dep-a |
There was a problem hiding this comment.
Reading npm workspaces add <package> I would not expect it to mutate the root config. I would expect it to mirror npm workspaces install <package> in #117 since npm add/rm are already aliases to install/uninstall dependencies.
I think npm workspaces <subcommand> can either be a command that operates on package.json#workspaces or every <workspaces>/package.json mixing and matching is confusing.
One thing we did in Bolt was have a bolt project/p command that allowed you to run commands on the root package containing all the workspaces.
Alternatives:
npm workspaces-config add/rmnpm project workspaces add/rmnpm workspaces add-workspace/rm-workspace
Adds a workspaces config management workflow.
See RFC