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

[npm] support private registry #2255

Open
3 tasks done
claneo opened this issue Jan 31, 2024 · 0 comments
Open
3 tasks done

[npm] support private registry #2255

claneo opened this issue Jan 31, 2024 · 0 comments

Comments

@claneo
Copy link

claneo commented Jan 31, 2024

Sanity checks

  • 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
  • I have searched github.com/withfig/autocomplete/issues and there are no duplicates of my issue
  • 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

autocomplete/src/npm.ts

Lines 32 to 34 in 7922234

const queryPackagesUrl = keywordParameter
? `https://api.npms.io/v2/search?size=20&q=${searchTerm}${keywordParameter}`
: `https://api.npms.io/v2/search/suggestions?q=${searchTerm}&size=20`;

and registry.npmjs.org to search package version

`https://registry.npmjs.org/${searchTerm.slice(0, -1)}`,

Both api only support public npm registry.

My suggestion is to use npm --json search command for packages and npm --json info for versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant