-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
WIP: feat(workspaces): update configs #2836
Conversation
3cb6409
to
7f966c2
Compare
Add workspaces-related configs: - workspace: list of workspaces names/dir to filter for - workspaces: boolean value to enable/disable workspaces awareness This also adds the proposed note in the docs of each of the commands that are not affected by these configs. Relates to: npm/rfcs#117
7f966c2
to
8d6e0cd
Compare
@@ -12,6 +12,8 @@ npm adduser [--registry=url] [--scope=@orgname] [--always-auth] [--auth-type=leg | |||
aliases: login, add-user | |||
``` | |||
|
|||
Note: This command is unaware of 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.
maybe instead of just "unaware", commands like this should be marked to indicate that it wouldn't make sense for them to be workspace-aware?
(altho in this case i can imagine wanting to log in to specific users only in specific workspaces' .npmrc files)
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.
maybe instead of just "unaware", commands like this should be marked to indicate that it wouldn't make sense for them to be workspace-aware?
this is me marking them to indicate that it wouldn't make sense for them to be workspace-aware 😅
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.
Most of these do make sense for it, though :-)
@@ -10,6 +10,8 @@ description: Deprecate a version of a package | |||
npm deprecate <pkg>[@<version range>] <message> | |||
``` | |||
|
|||
Note: This command is unaware of 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.
this definitely should be workspace-aware, since folks will want to deprecate individual (or multiple) 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.
ok yeah, this comment is a clue on how we can improve the message... the true purpose of this note is to let users aware that there's no point trying to run this command with a --workspaces
or --workspace=<name>
configs 🤔
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.
of course folks will be able to deprecate a package even if it's managed as a workspace somewhere
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.
but i mean, i might want to deprecate N packages at a time, based on workspace config.
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.
def a valid usecase 🤔 honestly I think the confusion factor here is due to the current syntax of npm deprecate
that doesn't read any info from the current dir package.json
file, it only accepts a single @ argument along with a message, which makes it harder to scale to multiple pkgs or 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.
that said, it sounds more like something we're going to have to redesign later and probably in a breaking change way, so I guess for now it will still have to be marked here as a command that is unaware of the workspaces configs.
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.
opened a RFC to follow through: npm/rfcs#341
thanks @ljharb 👍
@@ -10,6 +10,8 @@ description: Log out of the registry | |||
npm logout [--registry=<url>] [--scope=<@scope>] | |||
``` | |||
|
|||
Note: This command is unaware of 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.
same comment as adduser (which, since this is called "logout", should really have "login" as the canonical name for it)
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.
well... for now there are no support to reading .npmrc
files within 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.
that seems like something worth doing
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.
or at least considered, might be waaay more work than it sounds though and probably rfc-worthy
closing in favor of #2864 |
Add workspaces-related configs:
This also adds the proposed note in the docs of each of the commands
that are not affected by these configs.
References
Relates to: npm/rfcs#117