Skip to content

Custom Registry url.resolve Issue#712

Merged
sebmck merged 1 commit into
yarnpkg:masterfrom
craftship:custom-npm-resolving
Oct 12, 2016
Merged

Custom Registry url.resolve Issue#712
sebmck merged 1 commit into
yarnpkg:masterfrom
craftship:custom-npm-resolving

Conversation

@jonsharratt
Copy link
Copy Markdown
Contributor

Summary
Ensures with and without trailing / registry url is correct and resolvable.

Currently if you set a npm registry via config to be:

  1. yarn config set registry https://mycustom.registry.com/dev/registry
  2. yarn add redux (not in cache / fresh install)

The url.resolve will turn the url to be https://mycustom.registry.com/dev/redux (no registry as part of the path due to / being removed removeSuffix.)

Test plan(s)


  1. yarn config set registry https://mycustom.registry.com/dev/registry
  2. yarn add react

  1. yarn config set registry https://mycustom.registry.com/dev/registry/
  2. yarn add redux

  1. yarn config set registry https://registry.npmjs.org/
  2. yarn add react-router

Note:

There appears to be a flow issue with url.format currently:

facebook/flow#908
https://nodejs.org/api/url.html#url_url_format_urlobject

Ensures with and without trailing / registry url is correct and resolvable.
@sebmck sebmck merged commit 369539f into yarnpkg:master Oct 12, 2016
@sebmck
Copy link
Copy Markdown
Contributor

sebmck commented Oct 12, 2016

Awesome, thank you!

@jonsharratt jonsharratt deleted the custom-npm-resolving branch October 12, 2016 11:58
devongovett added a commit to devongovett/yarn that referenced this pull request Oct 12, 2016
* Broken by yarnpkg#712, which changed from url.resolve to url.format. We need resolve in the case where the pathname is really a full url (when requesting tarballs). So only add the trailing / if it is not there.
* Only add authorization if the request is going to the registry (not random tarballs).
devongovett added a commit to devongovett/yarn that referenced this pull request Oct 15, 2016
* Broken by yarnpkg#712, which changed from url.resolve to url.format. We need resolve in the case where the pathname is really a full url (when requesting tarballs). So only add the trailing / if it is not there.
* Only add authorization if the request is going to the registry (not random tarballs).
sebmck pushed a commit that referenced this pull request Oct 15, 2016
* Get npm registry and auth from .npmrc file

* Fetch tarball through registry

Needed if the registry requires auth to get tarballs

* Support .npmrc auth for write commands

* Support basic auth

* Attempt to fix flow

* Implement default request method for BaseRegistry

Needed for tarball fetching now that it is going through the registry

* Fix flow bug

* Clean up

* Fix requestUrl

* Broken by #712, which changed from url.resolve to url.format. We need resolve in the case where the pathname is really a full url (when requesting tarballs). So only add the trailing / if it is not there.
* Only add authorization if the request is going to the registry (not random tarballs).

* Check scoped always-auth option

* Remove unused function (bad rebase)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants