added info CLI command#14428
Conversation
- install os-name package - require info in commands.js - implement info.js with node/npm versions etc
|
Great idea. |
|
Gets a bit hairy there because Android studio can be installed anywhere. Also sdkmanager and the older android manager very different. I'll do my best, any recommendations are welcome. |
|
@Stoffern By packages do you mean dev/Dependencies from package.json? |
- rename confusing variable for buildnumber - add wmic and type calls for version/build for windows android studio
- It is, in fact, named Program Files
- add better fallback language
|
@tabrindle yes |
|
Output now looks like this: |
|
Thats all i have. Is it fully tested and ready to be merged? |
|
I have tested on Windows Linux and MacOS for typical install locations, mostly because of Android Studio being difficult. If nobody has any objections, I believe it is ready. |
|
@tabrindle great work. |
|
My other PR has been updated to reflect the changes here as well - can you review that one too? It is for the issue template. |
|
@tabrindle i do not have the rights to confirm the review. |
|
I got tired of waiting for this PR to be looked at - I have been working on a separate module based on this work called envinfo on npm. That way, this can be used and extended in other projects.
If you use npx ( Bonus, this package now has the ability to specify through command line args which packages to pull from the cwd package.json, or all of them, like this: In an effort to start helping user+maintainers in the issues, I will start posting this. |
|
Sorry for the delay in getting this looked at. As you may have noticed, I've been spending more time trying to get the number of issues down rather than working on getting PRs moving as we usually do. Providing this as a separate package seems like a better approach as this can benefit many other projects. I suppose we can pull in this as a dependency on the CLI and therefore still provide a |
|
No problem at all! I just wanted to be able to help get the issue count down. Once this is in, we can just close issues without the relevant debug info. As long as you are comfortable pulling in my separate package, and just using it for the I wasn't sure if that was the direction I should go, considering how few external modules are used in the CLI. I am planning to continue developing my envinfo module, and wasn't sure the react/react-native team would allow code that wasn't reviewed first hand. |
|
Omg, I think it is suuuuper useful. We have to merge #14422 as well! |
|
I have updated the PR to simply wrap my envinfo module. I have also added options through the react native cli to add additional package versions if necessary, along with examples to go with it. By default the Output now looks like this by default: --help looks like this: adding additional packages looks like this: @hramos Let me know if there is anything else you can think of. |
|
@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
|
Working on the merge failure, shouldn't be too long. |
|
Would it help if I rebased @hramos? |
|
It should be landing shortly. Don't add any more commits, please. |
|
👍 |
Summary: envinfo has done a good job reporting issues in the issue template so far, and I've done a lot of work between version 3.x and 5.x that react-native could benefit from. This adds: - better information organization, including versions and paths - Platform/CPU/RAM - Android and iOS SDK version detection - npm package globbing (select all babel* packages - global npm packages (with globbing) envinfo also can report IDE versions, other binaries, languages and browsers if needed, and in different formats. Take a look here if interested: https://github.com/tabrindle/envinfo - run `react-native info` // standard info - run `react-native info --packages` // all packages in package.json - run `react-native info --packages jest,eslint,babel-polyfill` // specified packages - run `react-native info --packages *babel*` // globbed packages Sample standard output: ``` System: OS: macOS High Sierra 10.13 CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz Memory: 97.59 MB / 16.00 GB Shell: 5.4.2 - /usr/local/bin/zsh Binaries: Node: 8.11.0 - ~/.nvm/versions/node/v8.11.0/bin/node Yarn: 1.5.1 - ~/.yarn/bin/yarn npm: 5.6.0 - ~/.nvm/versions/node/v8.11.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 11.0, macOS 10.13, tvOS 11.0, watchOS 4.0 Android SDK: Build Tools: 27.0.3 API Levels: 26 IDEs: Android Studio: 3.0 AI-171.4443003 Xcode: 9.0/9A235 - /usr/bin/xcodebuild npmPackages: react: 16.3.2 => 16.3.2 react-native: 0.55.0 => 0.55.0 npmGlobalPackages: create-react-native-app: 1.0.0 react-native-cli: 2.0.1 ``` #14428 - original inclusion of `react-native info` [CLI] [ENHANCEMENT] [local-cli/info/info.js] - add more info to react-native info cli command, like global npm packages, binary paths, and SDK versions Closes #19331 Differential Revision: D8049650 Pulled By: hramos fbshipit-source-id: 35c677f369bcad1a014eb083b2ce60ba33fee0ea
Summary: Many issues filed on Github are missing platform/toolchain version information. Others have different ways of writing it, and require the issue writer to look in multiple places for these versions. Other CLI tools like Ionic have this function, and it's incredibly useful. Related to react/react-native#14420 Run in terminal/command prompt `react-native info` ``` trevors-imac:AwesomeProject tabrindle$ react-native info Versions: React Native: 1000.0.0 OS: macOS Sierra Node: v6.10.3 Yarn: 0.24.5 npm: 5.0.0 Xcode: Xcode 8.3.3 Build version 8E3004b ``` - CLA signed ✅ - Verify functionality + implementation Closes react/react-native#14428 Differential Revision: D5392446 Pulled By: hramos fbshipit-source-id: 460079f3860c0af1e0b77bf26552c26032e974be
Summary: envinfo has done a good job reporting issues in the issue template so far, and I've done a lot of work between version 3.x and 5.x that react-native could benefit from. This adds: - better information organization, including versions and paths - Platform/CPU/RAM - Android and iOS SDK version detection - npm package globbing (select all babel* packages - global npm packages (with globbing) envinfo also can report IDE versions, other binaries, languages and browsers if needed, and in different formats. Take a look here if interested: https://github.com/tabrindle/envinfo - run `react-native info` // standard info - run `react-native info --packages` // all packages in package.json - run `react-native info --packages jest,eslint,babel-polyfill` // specified packages - run `react-native info --packages *babel*` // globbed packages Sample standard output: ``` System: OS: macOS High Sierra 10.13 CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz Memory: 97.59 MB / 16.00 GB Shell: 5.4.2 - /usr/local/bin/zsh Binaries: Node: 8.11.0 - ~/.nvm/versions/node/v8.11.0/bin/node Yarn: 1.5.1 - ~/.yarn/bin/yarn npm: 5.6.0 - ~/.nvm/versions/node/v8.11.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 11.0, macOS 10.13, tvOS 11.0, watchOS 4.0 Android SDK: Build Tools: 27.0.3 API Levels: 26 IDEs: Android Studio: 3.0 AI-171.4443003 Xcode: 9.0/9A235 - /usr/bin/xcodebuild npmPackages: react: 16.3.2 => 16.3.2 react-native: 0.55.0 => 0.55.0 npmGlobalPackages: create-react-native-app: 1.0.0 react-native-cli: 2.0.1 ``` react/react-native#14428 - original inclusion of `react-native info` [CLI] [ENHANCEMENT] [local-cli/info/info.js] - add more info to react-native info cli command, like global npm packages, binary paths, and SDK versions Closes react/react-native#19331 Differential Revision: D8049650 Pulled By: hramos fbshipit-source-id: 35c677f369bcad1a014eb083b2ce60ba33fee0ea
Motivation (required)
Many issues filed on Github are missing platform/toolchain version information. Others have different ways of writing it, and require the issue writer to look in multiple places for these versions.
Other CLI tools like Ionic have this function, and it's incredibly useful. Related to #14420
Test Plan (required)
Run in terminal/command prompt
react-native infoNext Steps