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

Download yarn from custom npm registry #396

Merged
merged 10 commits into from
Feb 27, 2024

Conversation

zhyupe
Copy link
Contributor

@zhyupe zhyupe commented Feb 23, 2024

#339 uses custom npm registry to resolve package manager versions. However, it still downloads from npm since spec.url is set to repo.yarnpkg.com.

This PR trys to resolve a tarball from npm registry when COREPACK_NPM_REGISTRY is set. Moreover, as configured spec.bin for yarn berry only support package manager downloaded as .js file, the bin config for custom package managers is used and now has higher priority than spec.bin.

This should completely fix #337

sources/corepackUtils.ts Outdated Show resolved Hide resolved
@aduh95
Copy link
Contributor

aduh95 commented Feb 23, 2024

I don't know how reasonable it is to ask, but it'd be nice to have a test that emulates a custom registry so we can validate we don't introduce regressions with future changes.

@zhyupe
Copy link
Contributor Author

zhyupe commented Feb 23, 2024

I don't know how reasonable it is to ask, but it'd be nice to have a test that emulates a custom registry so we can validate we don't have regressions.

Okay, I'll add a test case later today.

@zhyupe zhyupe force-pushed the feat/download-from-custom-registry branch from 2bffa55 to 7423405 Compare February 24, 2024 14:07
@aduh95
Copy link
Contributor

aduh95 commented Feb 24, 2024

It looks like tests are failing, you probably need to update the nock db – you’d need to run the tests with NOCK_ENV=record and commit the updated db file.

@aduh95 aduh95 merged commit 47be27c into nodejs:main Feb 27, 2024
10 checks passed
@zhyupe zhyupe deleted the feat/download-from-custom-registry branch March 4, 2024 03:13
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.

feature request: use default npm registry for Yarn
2 participants