-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
PATCH for using .yarnrc registry url instead of default https://regis… #3528
Conversation
@@ -55,7 +55,10 @@ export default class NpmRegistry extends Registry { | |||
|
|||
request(pathname: string, opts?: RegistryRequestOptions = {}, packageName: ?string): Promise<*> { | |||
const registry = this.getRegistry(packageName || pathname); | |||
const requestUrl = url.resolve(registry, pathname); | |||
const requestBaseUrl = url.resolve(registry, pathname); // does not work... |
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.
what does not work?
@@ -55,7 +55,10 @@ export default class NpmRegistry extends Registry { | |||
|
|||
request(pathname: string, opts?: RegistryRequestOptions = {}, packageName: ?string): Promise<*> { | |||
const registry = this.getRegistry(packageName || pathname); | |||
const requestUrl = url.resolve(registry, pathname); | |||
const requestBaseUrl = url.resolve(registry, pathname); // does not work... | |||
const requestUrl = requestBaseUrl.replace('https://registry.yarnpkg.com/', registry); |
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.
I think you are on a right path.
Just make the domains configurable via .yarnrc.
Those can be read in config via getOption, e.g. https://github.com/yarnpkg/yarn/blob/master/src/config.js#L267
const requestUrl = url.resolve(registry, pathname); | ||
const requestBaseUrl = url.resolve(registry, pathname); // does not work... | ||
const requestUrl = requestBaseUrl.replace('https://registry.yarnpkg.com/', registry); | ||
// console.log('PATCH npm-registry.request(' + pathname + '..) => requestUrl:' + requestUrl + ' instead of ' + requestBaseUrl); |
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.
comment unnecessary
Thanks, @Arnaud-Nauwynck. |
ping, @Arnaud-Nauwynck |
I'll close as it can't be merge this way, please feel free to reopen after rebasing and addressing the issue. |
…try.yarnpkg.com/
Summary
Test plan