api
api copied to clipboard
Fallback to GitHub search
Why not fallback to https://github.com/search?q={package}
if no {registry}
is provided?
Maybe I'm too strict, but I have a few concerns about it. First of all the live resolver
should be reliable as possible. What if the requested package and repository name are different. Another issue what if the package name is too generic the search api would return the most popular repository I guess. Also what if a package name is popular in more than one languages? All this unknowns can be easily lead to a wrong redirect.
As mentioned before I think the live resolver
should be reliable as possible and this isn't possible with a search request. I'm happy to discuss this further. @josephfrazier what's your view on this?
I just remembered that the GitHub search API has a language
filter which we can use to differentiate between different package for different languages.
https://help.github.com/articles/searching-repositories/#search-based-on-the-main-language-of-a-repository
I share the concerns about redirecting to a particular search result, given the likelihood that it would be wrong. I also think that searching github specifically is a bit too biased, because there are alternatives such as gitlab and others. We could fall back to a google/etc search results page for convenience, but even that feels a little out of place, in my opinion.