-
Notifications
You must be signed in to change notification settings - Fork 932
feat: move doctor into cli-doctor package, extract config into cli-config, clean-up types
#1480
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
feat: move doctor into cli-doctor package, extract config into cli-config, clean-up types
#1480
Conversation
grabbou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. It's a great thing to do such a cleanup. I did left some notes (not a big deal) that need to be applied before this one is good to be merged. Looking forward to it!
| @@ -1,5 +1,5 @@ | |||
| import androidHomeEnvVariables from '../androidHomeEnvVariable'; | |||
| import {NoopLoader} from '../../../../tools/loader'; | |||
| import {NoopLoader} from '@react-native-community/cli/src/tools/loader'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not require files directly from source, but rather expose them via public API. TL;DR always require from @react-native-community/cli.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Makes sense
| import * as androidWinHelpers from '../../../../tools/windows/androidWinHelpers'; | ||
| import * as environmentVariables from '../../../../tools/windows/environmentVariables'; | ||
| import * as androidWinHelpers from '@react-native-community/cli/src/tools/windows/androidWinHelpers'; | ||
| import * as environmentVariables from '@react-native-community/cli/src/tools/windows/environmentVariables'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all these functions used outside of a Doctor command? If all these tools, such as androidWinHelpers or downloadAndUnzip are used in Doctor only, then you should move them to doctor tools directory as well (first you may need to create one).
Check the recent commit that moves Metro to a separate package, it's a good example of moving the tooling around as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure will do thanks.
|
Thanks for the PR. I will continue the work (apply the changes + few tweaks and rebase) and merge it in order to move forward with this one today. |
|
This PR is still work in progress. I will return to it tomorrow. There are a few tools that need to be moved around to clean this up. |
|
Created a new package: |
packages/cli-doctor/src/index.ts
Outdated
|
|
||
| export const commands = {info, doctor}; | ||
|
|
||
| export {default as installPods} from './tools/installPods'; No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, I would like to remove dependency on this file from the CLI package.
|
One issue with |
cli-doctor package, extract config into cli-config, clean-up types
Summary:
Implemented changes as per the pr
From Mike:
Oraupdates and cleaned-upgetLoadercli-configinto a separate package, reorganised tools insidecliso that it containscli-only codepackage.json's for extraneous dependencies and made sure everything corresponds to the files usedTest Plan: