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

[json] Autodetect npm registry in package.json dependencies autocomplete #7430

Closed
fsmaia opened this issue Jun 8, 2016 · 4 comments
Closed
Assignees
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities json JSON support issues
Milestone

Comments

@fsmaia
Copy link

fsmaia commented Jun 8, 2016

First of all, congratulations for such a nice integration in package.json, with Schema Store support and server packages autocomplete.

I noted here that NPM's default registry is hardcoded, even if a custom registry was set by npm config set registry.

Is there any possible way to use a registry provided by the user instead of the default one? Does JavaScript extension even provide any extensibility or customization at this point?

@fsmaia
Copy link
Author

fsmaia commented Jun 8, 2016

Actually it could follow npmrc default precedence:

  • per-project config file (/path/to/my/project/.npmrc)
  • per-user config file (~/.npmrc)
  • global config file ($PREFIX/etc/npmrc)
  • npm builtin config file (/path/to/npm/npmrc)

I think the job here is to seek these paths inside packageJSONContribution.ts.

@aeschli
Copy link
Contributor

aeschli commented Jun 15, 2016

As you saw, it's currently not possible to configure the registry we use.
I guess we can call npm config get registry to figure out the registry url. I haven't found out how we get the URL of the skimdb. Any ideas?

I'm afraid this is not on the top of the backlog, help is welcome...

@aeschli aeschli added this to the Backlog milestone Jun 15, 2016
@aeschli aeschli added json JSON support issues feature-request Request for new features or functionality labels Jun 15, 2016
@aeschli aeschli added the help wanted Issues identified as good community contribution opportunities label Aug 4, 2016
@aeschli aeschli changed the title Autodetect npm registry in package.json dependencies autocomplete [json] Autodetect npm registry in package.json dependencies autocomplete Aug 4, 2016
@mdorda
Copy link

mdorda commented Jun 13, 2017

Well, this is really nice to have feature for our team, so I tried to figure it out. As @aeschli wrote above, the problem is the skimdb url.

As you can find in the official documentation:

The official public npm registry is at https://registry.npmjs.org/. It is powered by a CouchDB database, of which there is a public mirror at https://skimdb.npmjs.com/registry.

The offical public registry does not support _design/app/_view path, because it is not allowed by its configuration. skimdb supports that. The skimdb URL is used only for downloading package names, everything else is downloaded from the official public registry.

And the problem is that the mentioned path is not basically supported in any other registry (eg. VSTS registry).

And I am affraid there is no cross-registry-working solution. It is piece of cake to download at least semver info, but intellisense for package names is not so easy. So only thing to do is to find out how to search package names in registry. Any ideas?

Edit: I found on stackoverflow this solution. It is possible to use:

https://registry.npmjs.org/-/_view/browseAll?group_level=1&limit=40&start_key=%5B%22${currentWord}%22%5D&end_key=%5B%22${currentWord}z%22,%7B%7D%5D

so skimdb is no longer needed, but still - eg. VSTS does not support this path.

@aeschli
Copy link
Contributor

aeschli commented Nov 22, 2017

To keep the number of issues in our inbox on a manageable level, we're closing issues that have been on the backlog for a long time but haven't gained traction: We look at the number of votes the issue has received and the number of duplicates issues filed.
If you disagree and feel that this issue is crucial: We're happy to listen and to reconsider.
Maybe you want to give it a try yourself and provide the feature through an extension or a PR: We're happy to give advise and get you started.
Thanks for your understanding. Thanks for helping and happy coding!

@aeschli aeschli closed this as completed Nov 22, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities json JSON support issues
Projects
None yet
Development

No branches or pull requests

3 participants