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

Make npm registry url configurable #167

Open
marvinhagemeister opened this issue Oct 20, 2020 · 4 comments · May be fixed by #874
Open

Make npm registry url configurable #167

marvinhagemeister opened this issue Oct 20, 2020 · 4 comments · May be fixed by #874
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed reliability

Comments

@marvinhagemeister
Copy link
Member

Just came across one of our client projects, which uses their own npm registry instead of the official one. By making it configurable via cli-flag like --registry https://my-registry.com we could support that use case.

I'm wondering if this is how we can make our npm plugin testable too! We could spin up a fake registry since we only ever download the tarball and use the --registry flag in our tests to point to our mocked server.

@developit
Copy link
Member

@marvinhagemeister I wonder if we could check for an npmrc file at $cwd/.npmrc and pull the registry from there? Maybe in addition to the flag or something. Or we could even allow setting "registry":"..." in the package.json... so many options.

@developit developit added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed reliability labels Oct 28, 2020
@pajaydev
Copy link

pajaydev commented Dec 2, 2020

@marvinhagemeister @developit I would love to do this change, I can see three idea's

  1. getting it from cli-flag.
  2. keeping .npmrc file and reading from it.
  3. Making an entry in package.json.

Shall we support all three ideas ?.

@developit
Copy link
Member

@pajaydev I'm not sure about a CLI flag, since folks would need to pass it everywhere they run WMR.

I actually am thinking maybe as a start we could just check for process.env.NPM_CONFIG_REGISTRY? It's only defined when the script is run from npm, but that's most cases.

@chrstntdd
Copy link

Hey folks! I'm running into this same issue and would be interesting in getting this into wmr. Has there been any more progress on #151 that is blocking this from being implemented now?

Also, specific to my use case is that this project lives as a workspace within a mono-repo. This particular module being requested is present on disk and I have a hunch that it might be easier to resolve in the fs in these cases. Maybe mono-repo support is a whole separate discussion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed reliability
4 participants