From 02b545edeec19a18e0d02ae3931a5602c93e45a9 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Thu, 17 May 2018 10:59:11 -0400 Subject: [PATCH 1/2] cli: upgrade envinfo for new features in `react-native info` --- local-cli/info/info.js | 38 +++++++++++++++++++++++++------------- package.json | 2 +- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/local-cli/info/info.js b/local-cli/info/info.js index 0164c0acde54..b9c8b2b3c123 100644 --- a/local-cli/info/info.js +++ b/local-cli/info/info.js @@ -14,17 +14,28 @@ const envinfo = require('envinfo'); const info = function() { const args = Array.prototype.slice.call(arguments)[2]; - try { - envinfo.print({ - packages: - typeof args.packages === 'string' - ? ['react', 'react-native'].concat(args.packages.split(',')) - : args.packages, + envinfo + .run( + { + System: ['OS', 'CPU', 'Memory', 'Shell'], + Binaries: ['Node', 'Yarn', 'npm', 'Watchman'], + IDEs: ['Xcode', 'Android Studio'], + SDKs: ['iOS SDK', 'Android SDK'], + npmPackages: + (typeof args.packages === 'string' && !args.packages.includes('*')) || + !args.packages + ? ['react', 'react-native'].concat((args.packages || '').split(',')) + : args.packages, + npmGlobalPackages: '*react-native*', + }, + { + console: true, + }, + ) + .catch(err => { + console.log('Error: unable to print environment info'); + console.log(err); }); - } catch (error) { - console.log('Error: unable to print environment info'); - console.log(error); - } }; module.exports = { @@ -35,7 +46,6 @@ module.exports = { command: '--packages [string]', description: 'Which packages from your package.json to include, in addition to the default React Native and React versions.', - default: ['react', 'react-native'], }, ], examples: [ @@ -44,8 +54,10 @@ module.exports = { cmd: 'react-native info', }, { - desc: 'Get standard version info & specified package versions', - cmd: 'react-native info --packages jest,eslint,babel-polyfill', + desc: + 'Get standard version info & specified, globbed or all package versions', + cmd: + 'react-native info --packages jest,eslint || react-native info --packages "*react*" || react-native info --packages', }, ], func: info, diff --git a/package.json b/package.json index 1229456241e8..e9d4eb303573 100644 --- a/package.json +++ b/package.json @@ -156,7 +156,7 @@ "create-react-class": "^15.6.3", "debug": "^2.2.0", "denodeify": "^1.2.1", - "envinfo": "^3.0.0", + "envinfo": "^5.6.0", "errorhandler": "^1.5.0", "escape-string-regexp": "^1.0.5", "event-target-shim": "^1.0.5", From 5399ff15358c4ca884eedd26e168eb030a73c3d1 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Thu, 17 May 2018 15:42:51 -0400 Subject: [PATCH 2/2] cli: upgrade envinfo for title option, clipboard option --- .github/ISSUE_TEMPLATE.md | 2 +- local-cli/info/info.js | 73 +++++++++++++++++++++++++-------------- package.json | 2 +- 3 files changed, 49 insertions(+), 28 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 46d7bb4760de..8a3924a13f93 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -12,7 +12,7 @@ ## Environment - + ## Steps to Reproduce