-
Notifications
You must be signed in to change notification settings - Fork 22
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
Adds whether there are types for a package to an index #346
Conversation
@mjackson, are you fine with us calling unpkg here this many times? |
Would be cool if there were tests for the new code :) looking at it, i think we’ll be fine with the impact on indexing time |
It would do a head request to unpkg at most once per package given that it's likely the majority of packages don't have types, then I'd expect the majority of packages to do this |
I think we should nest this inside a “types” property, so that if there’s interest, we can add flow & reason eg |
Makes sense - it does that now, and has tests 👍 |
|
Yeah, great point - fixed! |
The only caveat is that the index for |
There’s a weekly refresh of the whole index to catch things like this. I guess we could add some extra code to schedule an update of the relevant package of an @types but it’s not that big of an issue I think |
@Haroenv I'm 👍 with calling unpkg like this. I'll let y'all know as soon as I launch a better way to do this than making |
Perfect 👌 I’ll take a look at if this works well next week |
Co-Authored-By: Haroen Viaene <fingebimus@me.com>
Co-Authored-By: Haroen Viaene <fingebimus@me.com>
@orta I don't seem to be able to commit my comments, can you do it or give access to the repo? I'd like to try it out live |
hah, faster than my comment |
👍 |
Awesome, merged! 🙌 I guess the next step to get this online is for someone to do a PR to yarnpkg/website as per And then something for the npm website too? cc @mxstbr |
Yes, the next step would be to add this to the website since it's now fully indexed |
Looks like something went wrong here still, I'll investigate, but the whole index has |
Doh! |
Based on this discussion. This PR adds a new field to the JSON index for npm search
or
and if they don't support it:
which might be absent in JSON? Or false. Actually not sure. But definitely falsy.
Running
yarn format
did a few more changes than I would have done solo, but I'll leave comments in here about what I've changed.Note: I've not been able to successfully run this locally against a set of packages, so right now it's somewhat ready for testing but not guaranteed to be shippable without risk. Should work tho - hah.
Adding comments now.