-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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(config_file): add config file option npmRegistry
#19317
Conversation
f790b05
to
42efb61
Compare
@dsherret This seems to work pretty well. Adding an option might be a controversial thing though, do you know the process/next steps to have this functionality land? |
npmRegistry
b7c1032
to
ee64caa
Compare
ee64caa
to
1afd38d
Compare
Wondering if a flag would make more sense rather than a config file option. |
@lino-levan That wouldn't work for the LSP, or how would you suggest to solve that? I solved that in a previous iteration of this PR where the url was given to the LSP via a setting (so in VS Code you could specify the url). |
I'm a fan of making it an option in the vscode extension, feels a bit iffy to have yet another top level config option for this. Wonder if it's worth making all of the npm/node stuff under a single option? |
I do think it makes sense to use a config option in this case, since it's critical for both the LSP and the runtime. If it was only relevant to one or the other, I can see how a flag (+optional config option) or a LSP setting would be preferable. And as for the syntactics, I'm unopinionated. I just want to make it work for the company-internal npm mirror. |
I did not realize that I could just start the VS Code process and locally override the |
Yeah, I agree because this is often a user setting. Let's implement denoland/vscode_deno#858 (comment) for now. |
Adding Configuration file option
"npmRegistry"
, respected in the LSP and in the runtime. TheNPM_CONFIG_REGISTRY
env var takes precedence. Both"npmRegistry"
andNPM_CONFIG_REGISTRY
are treated the same in terms of trailing slash (added if not already present).Closes #16105
In the issue there are calls for a per-scope configurable value, but perhaps this is a good enough first milestone (since it makes the LSP usable with a custom registry). The config value can also be expanded in the future to be either a string url or an object map from scope to registry url, building on top this behavior.