Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

Arnaud-Nauwynck
Copy link

…try.yarnpkg.com/

Summary

Test plan

@@ -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...
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment unnecessary

@bestander
Copy link
Member

Thanks, @Arnaud-Nauwynck.
This is almost good enough but needs some configuration and a test.
Let me know if you are willing to address those.
Otherwise we could wait for someone else to pick it up

@bestander
Copy link
Member

ping, @Arnaud-Nauwynck

@bestander
Copy link
Member

I'll close as it can't be merge this way, please feel free to reopen after rebasing and addressing the issue.

@bestander bestander closed this Jun 23, 2017
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