-
Notifications
You must be signed in to change notification settings - Fork 906
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
☂ Umbrella: Install development dependencies when missing #976
Comments
Thanks for the thorough proposal! I think we could definitely make it a part of |
I'm starting to look at this in more depth and here is my current proposal. I've look at the current code and there's a export default {
label: 'Python',
getDiagnostics: async ({Languages}) => ({
// ...
}),
runAutomaticFix: async ({loader}) => {
switch(process.platform) {
case 'win32': await windowsInstall(urlToDownload, command, label, loader); break;
case 'darwin': await brewInstall({pkg, label, loader}); break;
default: logManualInstallation(...); break;
},
},
} as HealthCheckInterface; Another option (that I think I prefer) would be to have specific actions per platform and a default one in case it is not supported. That way we remove the export default {
label: 'Python',
getDiagnostics: async ({Languages}) => ({
// ...
}),
win32AutomaticFix: async () => { },
darwinAutomaticFix: async () => { },
runAutomaticFix: async () => { /* fallback scenario */ },
} as HealthCheckInterface; One of the pros of the latest approach is that it should be easy to look at a file and know what platform doesn't have an automatic fix.
For the testing strategy I'm thinking about using some mocks and look at:
Let me know what you think and if everything looks fine I'll start working on the Python healthcheck and make a draft PR to start looking at the changes! |
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
Describe the Feature
Getting an environment ready for React Native development can take some time and is error prone. Developers have also problems setting up all the Android environment and emulators and on Windows it's even worse with the mixed messages about Hyper-V and HAXM.
After talking with a few RN developers from different projects and companies, it seems like the average to get a new machine up and running is between 1/2-1 day 😓
doctor
is great to help with this, and I think we can take it even further by automatically installing and configuring the required dependencies if missing.Tasks
Possible Implementations
My tests were mainly on Windows because I believe it's going to be the most complicated platform. My goal is to not require admin privileges so the developer doesn't see the UAC prompt. I think it's doable.
The list of dependencies from the docs are:
Node 10+
Script runs on node so not a lot to check other than the version via
process.version
for completeness?Python 2
We can use the same approach as
windows-build-tools
.The installation on Windows should be under
%LOCALAPPDATA%/python2
msiexec.exe /i "${pythonInstaller}" TARGETDIR="${targetDir}" /qn /L*P "python-log.txt"
JDK
Version 8 or later is recommended in the docs. I'd rather use a later one as the installation without admin privileges will be a lot easier.
https://javadl.oracle.com/webapps/download/GetFile/${JAVA_VERSION}-b${BUILD}/${ID}/windows-i586/jdk-${JDK_VERSION}-windows-x64.exe
(need to add some extra stuff in that URL...)"${jdkInstaller}" /s INSTALLDIR="${targetDir}" ADDLOCAL="ToolsFeature,SourceFeature"
;Android packages
My initial tests where without Android Studio and going directly with the Android SDK Tools (https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip). It looks like a lot of developers still need AS for native debugging and other scenarios so I think we should start with it and then maybe add an option to only download the SDK tools.
The biggest problem here was that user needs to accept licenses when using the CLI or nothing gets downloaded/installed. I ended up doing the following to auto-accept:
Hyper-V vs HAXM vs WHPX
I know there's a command to know if Hyper-V is active or not. I'll check with other teams in Microsoft (Xamarin?) to know exactly what the best configuration is for running the Android emulators.
Setting and updating environment variables
The approaches that worked for me are:
And execute it via
require('child_process').exec
This will only modify the user ones, which was one of my goals.
Open questions
For reference, my testing project is in here.
Hope this is enough to get the conversation started and identify any other issues or conflicts!
The text was updated successfully, but these errors were encountered: