rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

RFC: npm workspaces - Config management

Open ruyadorno opened this issue 4 years ago • 5 comments

Adds a workspaces config management workflow.

See RFC

ruyadorno avatar Nov 04 '20 17:11 ruyadorno

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.

ljharb avatar Nov 04 '20 19:11 ljharb

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: npm ws add !test and how that can lead to hazardous results given different expectations from users.

So the tricky question is what is a behavior that would be reasonable and actually helpful for the majority of users with regards to add/remove.

npm workspaces ls on the other hand seems to have no contention at all and might be implemented regardless of the decision on add and/or remove in this RFC.

ruyadorno avatar Nov 04 '20 21:11 ruyadorno

I am generally in favor of adding some commands to make working with workspaces easy. I generally like how lerna makes using workspaces easy, but we shouldn't attempt to rebuild lerna.

  • Maybe something like workspace init to start a guide which helps with initial setup would be cool?
  • Git submodules might also be an interesting as inspiration: https://git-scm.com/book/en/v2/Git-Tools-Submodules
  • Especially something like foreach might be nice, for things like audit etc. However, since this isn't config management feel free to tell me to shut up @ruyadorno ;)

Christian24 avatar Dec 02 '20 18:12 Christian24

@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 avatar Dec 02 '20 20:12 Christian24

@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 😊

ruyadorno avatar Dec 09 '20 20:12 ruyadorno