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

[cli] Turn off validate-def checks against npm #4249

Merged
merged 2 commits into from Feb 3, 2022

Conversation

Brianzchen
Copy link
Member

Hear me out, this is the beginning of a series of changes. After having a read of #87 and then testing validate-def I found that the testing against npmjs doesn't actually work. It uses got to ping npmjs.com but because it's hitting a website even if the website says 404 the website itself it a 200 response. Furthermore hitting a website like crazy reaches a HTTPError: Response code 429 (Too Many Requests) error. I've changed this to use api.npms.io/v2/ instead which can support the load and will reliably return with whether the request succeeds or fails.

But the code using a mix of then/catch + async/await doesn't actually work properly, even if the got reaches a 404 it still ends saying All libdefs are named and structured correctly.

Finally there is one library called core.es5 that was added 2 years ago and isn't actually an npm library, because of this it is meant to fail but it's perfectly valid given the reason it's there but it's not in the right place (definitions/npm) and as a result I cannot have the npmjs check working until we've shifted the definition somewhere else (I'm thinking definitions/core but I'll raise a discussion around this first).

What this PR does

Turn off the npmjs part of the validation to improve speed as we improve other areas to allow it turn back on.

@Brianzchen Brianzchen requested a review from a team February 2, 2022 05:47
Copy link
Contributor

@AndrewSouthpaw AndrewSouthpaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the context!

Copy link
Member

@gantoine gantoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah seems fine to me, this was originally a change I proposed waaay back in the day, and the implementation is lacking. Glad to see you're working on improving it. 👍🏼

@Brianzchen Brianzchen merged commit d576e7d into flow-typed:master Feb 3, 2022
@Brianzchen Brianzchen deleted the validate-def-tidying branch February 3, 2022 23:59
@Brianzchen
Copy link
Member Author

#4250 discussion on core defs here. We can catchup later to discuss whether core defs is something worth doing after an initial read.

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

Successfully merging this pull request may close these issues.

None yet

3 participants