Skip to content

Conversation

@evaliyev
Copy link
Contributor

@evaliyev evaliyev commented Feb 2, 2026

Summary

  • Integrate npmrc-config-rs to resolve registry URLs from .npmrc files
  • Support scoped package registries (@company:registry=https://private.example.com)
  • Add authentication headers (Bearer tokens, Basic auth) for private registries
  • Fallback to npm.jsr.io for @jsr/* packages when not explicitly configured
  • Fixes feat(update): support custom npm registries #220

What I checked

  • cargo test - 276 tests pass
  • Manual test with private registry in .npmrc

@evaliyev evaliyev force-pushed the feat/npmrc-config-support branch from 1c7901e to def7ca5 Compare February 2, 2026 20:03
- Integrate npmrc-config-rs to resolve registry URLs from .npmrc files
- Support scoped package registries (@Company:registry=...)
- Add authentication headers (Bearer tokens, Basic auth) for private registries
- Fallback to npm.jsr.io for @jsr/* packages when not explicitly configured
- Change UpdateUrl to carry package_name instead of full URL
- Remove outdated "custom registries not supported" warning

Closes JamieMason#220
@evaliyev evaliyev force-pushed the feat/npmrc-config-support branch from def7ca5 to d41fd88 Compare February 2, 2026 20:04
@evaliyev
Copy link
Contributor Author

evaliyev commented Feb 2, 2026

@JamieMason Please take a look.

@JamieMason
Copy link
Owner

Thanks a lot @evaliyev, this new crate is a huge help.

It'll take some time to work through this PR but here are some thoughts so far:

  • I would want to keep the logic for finding out what registry url to fetch in one place, this was Instance::get_update_url() previously but is spread over 2-3 places here.
  • I think it's worth moving let npmrc = NpmrcConfig::load()?; above the let ctx = Context::create( line in main.rs, that data will likely be needed in other places in the future and it should also be easier to test LiveRegistryClient if we can pass it mock npmrcs to check different scenarios.
  • I'm not sure yet if the url logic that was in Instance::get_update_url() is best off staying in Instance or if it should move to LiveRegistryClient, I've a feeling LiveRegistryClient might be better as it will have access to npmrc, but I'm not sure.

Hope this makes sense, I can take a look myself when I get time but if you can have a go at these refactors before then, that would be great. And then finally, with the crate having been created in such a short space of time, I'd just ask that you add as many E2E or integration tests as you can, ideally including some on Windows as well as Linux if you can.

Thanks again for this, a massive step forward on an issue I was struggling with.

@evaliyev
Copy link
Contributor Author

evaliyev commented Feb 3, 2026

Thank you @JamieMason for the review! Your comments really make sense and I will try to address them in the next couple of days.

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.

feat(update): support custom npm registries

2 participants