autocomplete
autocomplete copied to clipboard
[npm] support private registry
Sanity checks
- [X] My issue relates to a specific CLI completion spec (e.g.
git checkoutis missing options ingitcompletion spec). If your issue is more general, please create your issue here: withfig/fig - [X] I have searched github.com/withfig/autocomplete/issues and there are no duplicates of my issue
- [X] I would like to work on this.
What CLI tool does this relate to?
npm
Which statement makes the most sense?
There is a bug with this completion spec
Issue Details
Currently npm autocomplete uses api.npms.io to search package
https://github.com/withfig/autocomplete/blob/7922234c72777fc1a5be89699ad69be6720fa838/src/npm.ts#L32-L34
and registry.npmjs.org to search package version
https://github.com/withfig/autocomplete/blob/7922234c72777fc1a5be89699ad69be6720fa838/src/npm.ts#L48
Both api only support public npm registry.
My suggestion is to use npm --json search command for packages and npm --json info for versions.