@react-native-community/cli-doctor
Advanced tools
Comparing version 11.3.5 to 11.3.6
@@ -7,9 +7,4 @@ "use strict"; | ||
exports.default = void 0; | ||
function _execa() { | ||
const data = _interopRequireDefault(require("execa")); | ||
_execa = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
var _checkInstallation = require("../checkInstallation"); | ||
var _brewInstall = require("../brewInstall"); | ||
function _chalk() { | ||
@@ -22,50 +17,10 @@ const data = _interopRequireDefault(require("chalk")); | ||
} | ||
function _prompts() { | ||
const data = _interopRequireDefault(require("prompts")); | ||
_prompts = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
var _checkInstallation = require("../checkInstallation"); | ||
var _packageManagers = require("./packageManagers"); | ||
var _common = require("./common"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const label = 'ios-deploy'; | ||
const installationWithYarn = 'yarn global add ios-deploy'; | ||
const installationWithNpm = 'npm install ios-deploy --global'; | ||
const identifyInstallationCommand = () => { | ||
if (_packageManagers.packageManager === _checkInstallation.PACKAGE_MANAGERS.YARN) { | ||
return installationWithYarn; | ||
} | ||
if (_packageManagers.packageManager === _checkInstallation.PACKAGE_MANAGERS.NPM) { | ||
return installationWithNpm; | ||
} | ||
return undefined; | ||
}; | ||
const installLibrary = async ({ | ||
installationCommand, | ||
packageManagerToUse, | ||
loader | ||
}) => { | ||
try { | ||
loader.start(`${label} (installing with ${packageManagerToUse})`); | ||
const installationCommandArgs = installationCommand.split(' '); | ||
await (0, _execa().default)(installationCommandArgs[0], installationCommandArgs.splice(1)); | ||
loader.succeed(`${label} (installed with ${packageManagerToUse})`); | ||
} catch (error) { | ||
(0, _common.logError)({ | ||
healthcheck: label, | ||
loader, | ||
error: error, | ||
command: installationCommand | ||
}); | ||
} | ||
}; | ||
const packageName = 'ios-deploy'; | ||
var _default = { | ||
label, | ||
label: packageName, | ||
isRequired: false, | ||
description: 'Required for installing your app on a physical device with the CLI', | ||
getDiagnostics: async () => ({ | ||
needsToBeFixed: await (0, _checkInstallation.isSoftwareNotInstalled)('ios-deploy') | ||
needsToBeFixed: await (0, _checkInstallation.isSoftwareNotInstalled)(packageName) | ||
}), | ||
@@ -76,51 +31,16 @@ runAutomaticFix: async ({ | ||
}) => { | ||
loader.stop(); | ||
const installationCommand = identifyInstallationCommand(); | ||
// This means that we couldn't "guess" the package manager | ||
if (installationCommand === undefined) { | ||
const promptQuestion = `ios-deploy needs to be installed either by ${_chalk().default.bold('yarn')} ${_chalk().default.reset('or')} ${_chalk().default.bold('npm')} ${_chalk().default.reset()}, which one do you want to use?`; | ||
const installWithYarn = { | ||
title: 'yarn', | ||
value: 'yarn' | ||
}; | ||
const installWithNpm = { | ||
title: 'npm', | ||
value: 'npm' | ||
}; | ||
const skipInstallation = { | ||
title: 'Skip installation', | ||
value: 'skip' | ||
}; | ||
const { | ||
chosenPackageManager | ||
} = await (0, _prompts().default)([{ | ||
type: 'select', | ||
name: 'chosenPackageManager', | ||
message: promptQuestion, | ||
choices: [installWithYarn, installWithNpm, skipInstallation] | ||
}]); | ||
(0, _common.removeMessage)(`? ${promptQuestion} ${chosenPackageManager}`); | ||
if (chosenPackageManager === skipInstallation.value || !chosenPackageManager // e.g. when user presses Esc | ||
) { | ||
await (0, _brewInstall.brewInstall)({ | ||
pkg: packageName, | ||
label: packageName, | ||
loader, | ||
onSuccess: () => { | ||
loader.succeed(`Successfully installed ${_chalk().default.bold(packageName)} with Homebrew`); | ||
}, | ||
onFail: () => { | ||
loader.fail(); | ||
// Then we just print out the URL that the user can head to download the library | ||
logManualInstallation({ | ||
healthcheck: 'ios-deploy', | ||
url: 'https://github.com/ios-control/ios-deploy#readme' | ||
healthcheck: packageName, | ||
url: 'https://github.com/ios-control/ios-deploy#installation' | ||
}); | ||
return; | ||
} | ||
const shouldInstallWithYarn = chosenPackageManager === installWithYarn.value; | ||
return installLibrary({ | ||
installationCommand: shouldInstallWithYarn ? installationWithYarn : installationWithNpm, | ||
loader, | ||
packageManagerToUse: chosenPackageManager | ||
}); | ||
} | ||
return installLibrary({ | ||
installationCommand, | ||
packageManagerToUse: _packageManagers.packageManager.toLowerCase(), | ||
loader | ||
}); | ||
@@ -127,0 +47,0 @@ } |
{ | ||
"name": "@react-native-community/cli-doctor", | ||
"version": "11.3.5", | ||
"version": "11.3.6", | ||
"license": "MIT", | ||
@@ -11,6 +11,6 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@react-native-community/cli-config": "11.3.5", | ||
"@react-native-community/cli-platform-android": "11.3.5", | ||
"@react-native-community/cli-platform-ios": "11.3.5", | ||
"@react-native-community/cli-tools": "11.3.5", | ||
"@react-native-community/cli-config": "11.3.6", | ||
"@react-native-community/cli-platform-android": "11.3.6", | ||
"@react-native-community/cli-platform-ios": "11.3.6", | ||
"@react-native-community/cli-tools": "11.3.6", | ||
"chalk": "^4.1.2", | ||
@@ -25,3 +25,3 @@ "command-exists": "^1.2.8", | ||
"prompts": "^2.4.0", | ||
"semver": "^6.3.0", | ||
"semver": "^7.5.2", | ||
"strip-ansi": "^5.2.0", | ||
@@ -38,3 +38,3 @@ "sudo-prompt": "^9.0.0", | ||
"devDependencies": { | ||
"@react-native-community/cli-types": "11.3.5", | ||
"@react-native-community/cli-types": "11.3.6", | ||
"@types/command-exists": "^1.2.0", | ||
@@ -53,3 +53,3 @@ "@types/envinfo": "^7.8.1", | ||
}, | ||
"gitHead": "474094dbcd507522b5dec026553289b7f812212e" | ||
"gitHead": "ae61a11bda5d5c1b495f7bf5745123d8df8ffaef" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
263336
3122
+ Added@react-native-community/cli-config@11.3.6(transitive)
+ Added@react-native-community/cli-platform-android@11.3.6(transitive)
+ Added@react-native-community/cli-platform-ios@11.3.6(transitive)
+ Added@react-native-community/cli-tools@11.3.6(transitive)
+ Addedsemver@7.6.3(transitive)
- Removed@react-native-community/cli-config@11.3.5(transitive)
- Removed@react-native-community/cli-platform-android@11.3.5(transitive)
- Removed@react-native-community/cli-platform-ios@11.3.5(transitive)
- Removed@react-native-community/cli-tools@11.3.5(transitive)
- Removedsemver@6.3.1(transitive)
Updatedsemver@^7.5.2