Skip to content

Replace usage of NPM CLI with HTTP calls to the NPM Registry.

Administrator requested to merge vg/npm-use-web-client into main

Created by: varungandhi-src

I will be adding support for credentials in a subsequent PR.

Questions:

  • There is a self-enforced rate limit code; I'm not sure if that's needed? - Resolution: kept self-enforced rate limit
  • Naming: is NPMWebClient fine? I was thinking of naming it NPMHTTPClient, but that seemed like too many capital letters all at once. - Resolution: Renamed to HTTPClient.
  • Is there a way to expose a dependency for only testing (i.e. expose a type through a package's tests, making it available only to tests of other packages)? I read some SO answers and I don't think it's possible, and decided to put the MockNPMClient in a separate npmtest package, so that I could reuse it in tests in different packages. - Resolution: Kept separate npmtest package.
  • Should we be making actual NPM API calls in at least some of the tests here? Previously, we weren't making npm CLI calls; does that consideration change if we're using the API? - Resolution: Added record + replay tests for API calls.

Merge request reports

Loading