NPM: 'cordova' turns up 'cordova-plugin-device'
BUG on npm search:
Trying to add 'cordova' https://www.npmjs.com/package/cordova
Instead turns up 'cordova-plugin-device' https://www.npmjs.com/package/cordova-plugin-device
Also, adding 'cordova-cli' from the Github search doesn't link it up to its npm counterpart 'cordova' on Moiva, even though they are linked in reality:
https://www.npmjs.com/package/cordova links to https://github.com/apache/cordova-cli
I proxy results of the official npm search API. I also noticed its limitations in the past and not being able to find certain packages. I was already in contact with npm team on this matter, but don't remember how exactly it was settled. Will probably raise the issue again In the meantime, I suggest specify package names directly in the URL https://moiva.io/?npm=cordova I'm thinking of adding such hint in the search results
Also, adding 'cordova-cli' from the Github search doesn't link it up to its npm counterpart 'cordova' on Moiva, even though they are linked in reality:
it's not that easy. When you search for an npm package, then getting a corresponding GitHub repo is straightforward you get it from the npm API (though there are some cases when the provided GitHub repo is not the correct one). In other direction it doesn't work that way - you can't unambiguously derive the npm package from a GitHub repo, because
- a repo can be a source of many npm packages
- a repo can define root npm package.json as private and have a public npm package in some other folder
- I saw some popular repos publishing their npm packages in a totally separate repositories
The only reliable solution I came up with was to maintain a catalog where I specify all the relationships between npm and github https://github.com/aantipov/moiva-catalog
Long story short,
- I try my best and maintain a catalog of popular libraries to make Moiva smart and show npm stats when a user uses GitHub search
- If you want to see npm stats and you know the name of a package, then use npm search
Thanks for the good explanations!
-
Great, thanks for the workaround!
-
Ah, ofc. Makes sense! Maybe the catalog could be automatically updated by users manually linking when coming across such scenarios?
Maybe the catalog could be automatically updated by users manually linking when coming across such scenarios?
Interesting idea. I'll think about it