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

Fix Private package credentials bug aka the FontAwesome bug #615

Closed
wants to merge 14 commits into from

Conversation

crubier
Copy link
Contributor

@crubier crubier commented Nov 27, 2019

What's the problem this PR addresses?

#601
...

How did you fix it?

Tried to follow instructions in #601 (comment) , but with no experience on the yarn codebase and no comments in the code, I have pretty much no idea what I am doing 🔥 :this-is-fine: :cat_coding:

@arcanis
Copy link
Member

arcanis commented Nov 27, 2019

Good start! The subtlety in this fix is that the registry is automatically added in npmHttpUtils, cf here:

https://github.com/yarnpkg/berry/blob/master/packages/plugin-npm/sources/npmHttpUtils.ts#L50

If the URL is absolute, it will be problematic as the default registry will be prepended to the URL. At the same time, we want to obtain the right registry information from the absolute URL so that we can extract its configuration, including the credentials.

So what you need to do is implement in npmHttpUtils support for absolute URLs by splitting them into registry and pathname components, based on the registries configured in the project (npmRegistries).

And of course we'll need a test, which involves modifying the mock server (cf test.ts in pkg-tests-core).

@arcanis
Copy link
Member

arcanis commented Dec 11, 2019

Closing as duplicate of #622 (which is now in master 🎉)

@arcanis arcanis closed this Dec 11, 2019
@crubier crubier deleted the master branch January 18, 2020 11:34
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