Add a feature flag to split remote registry from onlyPeers flag#84
Closed
developher-net wants to merge 4 commits intonathanhleung:masterfrom
developher-net:avoid-proxies
Closed
Add a feature flag to split remote registry from onlyPeers flag#84developher-net wants to merge 4 commits intonathanhleung:masterfrom developher-net:avoid-proxies
developher-net wants to merge 4 commits intonathanhleung:masterfrom
developher-net:avoid-proxies
Conversation
Renames onlyPeers parameter to noRegistry which better reflects what this function is doing. This function doesn't care about peers vs. main, that's in a different scope.
… lists `--only-peers` was doing two different things which complicated the need for proxy settings. Not only was it flagging whether to install the main package with the peers, it was also toggling whether the peerDeps list was being generated from a local node_modules vs a remote registry. By splitting this into two distinct feature flags, we make behavior clearer, and future case of delegating proxy settings to NPM or Yarn instead of handling those in the utility. BREAKING_CHANGE: `--only-peers` now searches for peerDeps via the registry unless `--no-registry` is also specified * was: `install-peerdeps <package> --only-peers` * now: `install-peerdeps <package> --only-peers --no-registry`
ljharb
reviewed
May 1, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In response to #73
If this enhancement is added, then I believe the need for this app to support proxies goes away entirely, as a developer can use their normal
.npmrcsetup instead. This PR doesn't remove any of the auth and proxy features. Just introduces a configuration that lets us avoid them for certain use cases.--only-peerswas doing two different things which complicated the needfor proxy settings. Not only was it flagging whether to install the main
package with the peers, it was also toggling whether the peerDeps list
was being generated from a local node_modules vs a remote registry.
By splitting this into two distinct feature flags, we make behavior clearer,
and future case of delegating proxy settings to NPM or Yarn instead
of handling those in the utility.
BREAKING_CHANGE:
--only-peersnow searches for peerDeps via the registryunless
--no-registryis also specifiedinstall-peerdeps <package> --only-peersinstall-peerdeps <package> --only-peers --no-registry