autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

[npm] support private registry

Open claneo opened this issue 2 years ago • 0 comments

Sanity checks

  • [X] My issue relates to a specific CLI completion spec (e.g. git checkout is missing options in git completion 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.

claneo avatar Jan 31 '24 02:01 claneo