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

feat: add user-specified registry support (from npmrc) #470

Merged
merged 8 commits into from
Sep 19, 2024

Conversation

Kiameow
Copy link
Contributor

@Kiameow Kiameow commented Sep 5, 2024

πŸ”— Linked issue

nuxi always using default npm registry #453

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

For user who doesn't have the stable connection to the default npm regsitry, they tend to use the mirror site, but nuxi doesn't have very good support about it (user can set COREPACK_NPM_REGISTRY env to achieve the ideal result, but at least for me, I didn't realize it at first time).

Now the using of nuxi to install a package will directly read the registry info from user's .npmrc file, then change the registry to get package json info as well as the COREPACK_NPM_REGISTRY (if it isn't been set) to download the package

@atinux
Copy link
Member

atinux commented Sep 15, 2024

Did you think about using https://www.npmjs.com/package/npm-registry-fetch ?

@pi0
Copy link
Member

pi0 commented Sep 15, 2024

s.com/package/npm-registry-fetch ?

this looks nice however has lots of ties with Node.js deps and is CJS (also not sure if it respects corepack env, for reasons) I would personally pick simplest approach (can later refactor it out to nypm for easier maintenance)

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

I think we can go ahead and merge as a basic implementation and later improve with finer-grained support for per-package registries etc...

@danielroe danielroe merged commit ef57bb1 into nuxt:main Sep 19, 2024
2 checks passed
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.

4 participants