Repository navigation
Allow platforms and community packages to provide additional health checks - #1231
Conversation
|
Nice! Kindly asking @lucasbento @molant to review :) |
lucasbento
left a comment
There was a problem hiding this comment.
Sorry for taking so long to review this, I checked this PR multiple times and I was sure that I had already submitted a review.
I don't really have much to comment here besides that this is an awesome initiative.
The thing that we would need to work on the most is the documentation, I think the API can get pretty confusing to understand without some visuals (screenshots of the list, the loading part, how errors are printed out, etc).
I would love to have this merged soon as it's a major contribution and will increase the value of react-native doctor greatly.
| ```js | ||
| module.exports = { | ||
| healthChecks: [ | ||
| { | ||
| label: 'Foo', | ||
| healthchecks: [ | ||
| label: 'bar-installed', | ||
| getDiagnostics: async () => ({ | ||
| needsToBeFixed: !isBarInstalled() | ||
| }), | ||
| runAutomaticFix: async ({loader}) => { | ||
| await installBar(); | ||
| loader.succeed(); | ||
| }, | ||
| } | ||
| ], | ||
| }; | ||
| ``` |
|
I added a little more documentation, but I think its probably something we can add to later. Hopefully once this merges+publishes I can add links to samples etc to at least react-native-windows where we will have a bunch of additional health checks. |
| npm: AvailableInformation; | ||
| Watchman: AvailableInformation; | ||
| }; | ||
| SDKs: { |
There was a problem hiding this comment.
is the idea that this is what will get asked of envinfo? if so, please make sure that info continues to report the windows properties we care about: Windows SDKs, VS installs, dev mode reg keys.
grabbou
left a comment
There was a problem hiding this comment.
Love this feautre. LGTM. Just a quick question on the type defs itself (left somewhere in the review) and this one is good to go from my side!
|
PS. Looks like a little rebase to resolve conflicts might be needed |
Summary:
Out of tree platforms, and specific community modules may have their own set of health checks that could help developers diagnose issues and be more productive. In particular I am looking at how to have react-native-windows provide checks to doctor. This change allows any out of tree platform to be able to provide their own checks.
Some talking points:
Test Plan:
I'm posting this early because I expect lots of feedback. I've run this locally with changes to react-native-windows to run through the end to end of adding health checks in react-native-windows and them showing up in doctor.