Socket
Socket
Sign inDemoInstall

@react-native-community/cli-doctor

Package Overview
Dependencies
Maintainers
31
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-community/cli-doctor - npm Package Compare versions

Comparing version 10.0.0-alpha.3 to 10.0.0

build/types.js.map

54

build/commands/doctor.js

@@ -7,39 +7,24 @@ "use strict";

exports.default = void 0;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
var _healthchecks = require("../tools/healthchecks");
var _printFixOptions = _interopRequireWildcard(require("../tools/printFixOptions"));
var _runAutomaticFix = _interopRequireWildcard(require("../tools/runAutomaticFix"));
var _envinfo = _interopRequireDefault(require("../tools/envinfo"));
var _common = require("../tools/healthchecks/common");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const printCategory = ({

@@ -52,6 +37,4 @@ label,

}
_cliTools().logger.log(_chalk().default.dim(label));
};
const printVersions = ({

@@ -68,3 +51,2 @@ version,

}
const versionsToShow = version && version !== 'Not Found' ? version : 'N/A';

@@ -75,3 +57,2 @@ (0, _common.logMessage)(`- Version found: ${_chalk().default.red(versionsToShow)}`);

};
const printIssue = ({

@@ -88,5 +69,3 @@ label,

const descriptionToShow = description ? ` - ${description}` : '';
_cliTools().logger.log(` ${symbol} ${label}${descriptionToShow}`);
if (needsToBeFixed && versionRange) {

@@ -100,3 +79,2 @@ return printVersions({

};
const printOverallStats = ({

@@ -107,6 +85,4 @@ errors,

_cliTools().logger.log(`\n${_chalk().default.bold('Errors:')} ${errors}`);
_cliTools().logger.log(`${_chalk().default.bold('Warnings:')} ${warnings}`);
};
/**

@@ -120,9 +96,6 @@ * Given a `healthcheck` and a `platform`, returns the specific fix for

return healthcheck.win32AutomaticFix || healthcheck.runAutomaticFix;
case 'darwin':
return healthcheck.darwinAutomaticFix || healthcheck.runAutomaticFix;
case 'linux':
return healthcheck.linuxAutomaticFix || healthcheck.runAutomaticFix;
default:

@@ -132,3 +105,2 @@ return healthcheck.runAutomaticFix;

};
const doctorCommand = async (_, options) => {

@@ -138,3 +110,2 @@ const loader = (0, _cliTools().getLoader)();

const environmentInfo = await (0, _envinfo.default)();
const iterateOverHealthChecks = async ({

@@ -149,3 +120,2 @@ label,

}
const {

@@ -156,4 +126,5 @@ needsToBeFixed,

versionRange
} = await healthcheck.getDiagnostics(environmentInfo); // Assume that it's required unless specified otherwise
} = await healthcheck.getDiagnostics(environmentInfo);
// Assume that it's required unless specified otherwise
const isRequired = healthcheck.isRequired !== false;

@@ -173,11 +144,9 @@ const isWarning = needsToBeFixed && !isRequired;

}))).filter(healthcheck => healthcheck !== undefined)
}); // Remove all the categories that don't have any healthcheck with
});
// Remove all the categories that don't have any healthcheck with
// `needsToBeFixed` so they don't show when the user taps to fix encountered
// issues
const removeFixedCategories = categories => categories.filter(category => category.healthchecks.some(healthcheck => healthcheck.needsToBeFixed));
const iterateOverCategories = categories => Promise.all(categories.map(iterateOverHealthChecks));
const healthchecksPerCategory = await iterateOverCategories(Object.values((0, _healthchecks.getHealthchecks)(options)).filter(category => category !== undefined));

@@ -190,3 +159,4 @@ loader.stop();

healthchecksPerCategory.forEach((issueCategory, key) => {
printCategory({ ...issueCategory,
printCategory({
...issueCategory,
key

@@ -196,3 +166,2 @@ });

printIssue(healthcheck);
if (healthcheck.type === _healthchecks.HEALTHCHECK_TYPES.WARNING) {

@@ -202,3 +171,2 @@ stats.warnings++;

}
if (healthcheck.type === _healthchecks.HEALTHCHECK_TYPES.ERROR) {

@@ -211,3 +179,2 @@ stats.errors++;

printOverallStats(stats);
if (options.fix) {

@@ -222,3 +189,2 @@ return await (0, _runAutomaticFix.default)({

}
const removeKeyPressListener = () => {

@@ -228,6 +194,4 @@ if (typeof process.stdin.setRawMode === 'function') {

}
process.stdin.removeAllListeners('data');
};
const onKeyPress = async key => {

@@ -238,6 +202,4 @@ if (key === _printFixOptions.KEYS.EXIT || key === '\u0003') {

}
if ([_printFixOptions.KEYS.FIX_ALL_ISSUES, _printFixOptions.KEYS.FIX_ERRORS, _printFixOptions.KEYS.FIX_WARNINGS].includes(key)) {
removeKeyPressListener();
try {

@@ -263,3 +225,2 @@ const automaticFixLevel = {

};
if (stats.errors || stats.warnings) {

@@ -271,3 +232,2 @@ (0, _printFixOptions.default)({

};
var _default = {

@@ -274,0 +234,0 @@ func: doctorCommand,

@@ -7,17 +7,11 @@ "use strict";

exports.default = void 0;
var _envinfo = _interopRequireDefault(require("../tools/envinfo"));
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**

@@ -29,9 +23,9 @@ * Copyright (c) Facebook, Inc. and its affiliates.

*/
// @ts-ignore untyped
const info = async function getInfo(_argv, ctx) {
try {
_cliTools().logger.info('Fetching system and libraries information...');
const output = await (0, _envinfo.default)(false);
_cliTools().logger.log(output);

@@ -44,3 +38,2 @@ } catch (err) {

};
var _default = {

@@ -47,0 +40,0 @@ name: 'info',

@@ -6,2 +6,3 @@ "use strict";

});
exports.commands = void 0;
Object.defineProperty(exports, "installPods", {

@@ -13,12 +14,6 @@ enumerable: true,

});
exports.commands = void 0;
var _doctor = _interopRequireDefault(require("./commands/doctor"));
var _info = _interopRequireDefault(require("./commands/info"));
var _installPods = _interopRequireDefault(require("./tools/installPods"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const commands = {

@@ -28,2 +23,3 @@ info: _info.default,

};
/**

@@ -34,5 +30,4 @@ * @todo

*/
exports.commands = commands;
//# sourceMappingURL=index.js.map

@@ -7,17 +7,11 @@ "use strict";

exports.brewInstall = brewInstall;
function _execa() {
const data = _interopRequireDefault(require("execa"));
_execa = function () {
return data;
};
return data;
}
var _common = require("./healthchecks/common");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
async function brewInstall({

@@ -31,10 +25,7 @@ pkg,

loader.start(label);
try {
await (0, _execa().default)('brew', ['install', pkg]);
if (typeof onSuccess === 'function') {
return onSuccess();
}
return loader.succeed();

@@ -45,3 +36,2 @@ } catch (error) {

}
(0, _common.logError)({

@@ -48,0 +38,0 @@ healthcheck: label || pkg,

@@ -6,29 +6,20 @@ "use strict";

});
exports.doesSoftwareNeedToBeFixed = exports.isSoftwareNotInstalled = exports.PACKAGE_MANAGERS = void 0;
exports.isSoftwareNotInstalled = exports.doesSoftwareNeedToBeFixed = exports.PACKAGE_MANAGERS = void 0;
function _semver() {
const data = _interopRequireDefault(require("semver"));
_semver = function () {
return data;
};
return data;
}
function _commandExists() {
const data = _interopRequireDefault(require("command-exists"));
_commandExists = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
let PACKAGE_MANAGERS;
exports.PACKAGE_MANAGERS = PACKAGE_MANAGERS;
(function (PACKAGE_MANAGERS) {

@@ -38,3 +29,2 @@ PACKAGE_MANAGERS["YARN"] = "YARN";

})(PACKAGE_MANAGERS || (exports.PACKAGE_MANAGERS = PACKAGE_MANAGERS = {}));
const isSoftwareNotInstalled = async command => {

@@ -48,5 +38,3 @@ try {

};
exports.isSoftwareNotInstalled = isSoftwareNotInstalled;
const doesSoftwareNeedToBeFixed = ({

@@ -60,8 +48,6 @@ version,

});
return version === 'Not Found' || coercedVersion === null || !_semver().default.satisfies(coercedVersion, versionRange);
};
exports.doesSoftwareNeedToBeFixed = doesSoftwareNeedToBeFixed;
//# sourceMappingURL=checkInstallation.js.map

@@ -7,23 +7,16 @@ "use strict";

exports.deleteFile = void 0;
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _util() {
const data = require("util");
_util = function () {
return data;
};
return data;
}
const deleteFile = (0, _util().promisify)(_fs().unlink);

@@ -30,0 +23,0 @@ exports.deleteFile = deleteFile;

@@ -7,17 +7,11 @@ "use strict";

exports.downloadAndUnzip = void 0;
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
var _unzip = require("./unzip");
var _deleteFile = require("./deleteFile");
/**

@@ -36,3 +30,2 @@ * Downloads `downloadUrl` and unzips the contents to `installPath` while

loader.text = `Installing ${component} in "${installPath}"`;
try {

@@ -44,5 +37,4 @@ await (0, _unzip.unzip)(installer, installPath);

};
exports.downloadAndUnzip = downloadAndUnzip;
//# sourceMappingURL=downloadAndUnzip.js.map

@@ -7,26 +7,19 @@ "use strict";

exports.default = void 0;
function _envinfo() {
const data = _interopRequireDefault(require("envinfo"));
_envinfo = function () {
return data;
};
return data;
}
function _os() {
const data = require("os");
_os = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// @ts-ignore
// @ts-ignore
async function getEnvironmentInfo(json = true) {

@@ -43,7 +36,5 @@ const options = {

const outOfTreePlatformPackage = outOfTreePlatforms[(0, _os().platform)()];
if (outOfTreePlatformPackage) {
packages.push(outOfTreePlatformPackage);
}
const info = await _envinfo().default.run({

@@ -59,10 +50,7 @@ System: ['OS', 'CPU', 'Memory', 'Shell'],

}, options);
if (options.json) {
return JSON.parse(info);
}
return info.trim();
}
var _default = getEnvironmentInfo;

@@ -69,0 +57,0 @@ exports.default = _default;

@@ -7,15 +7,10 @@ "use strict";

exports.default = void 0;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// List of answers on how to set `ANDROID_HOME` for each platform

@@ -27,5 +22,6 @@ const URLS = {

};
const label = 'ANDROID_HOME'; // Force the options for the platform to avoid providing a link
const label = 'ANDROID_HOME';
// Force the options for the platform to avoid providing a link
// for `ANDROID_HOME` for every platform NodeJS supports
const platform = process.platform;

@@ -47,3 +43,2 @@ const message = `Read more about how to set the ${label} at ${_chalk().default.dim(URLS[platform])}`;

}
loader.fail();

@@ -50,0 +45,0 @@ logManualInstallation({

@@ -7,19 +7,12 @@ "use strict";

exports.default = void 0;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
var _versionRanges = _interopRequireDefault(require("../versionRanges"));
var _checkInstallation = require("../checkInstallation");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = {

@@ -50,3 +43,2 @@ label: 'Android NDK',

loader.fail();
if (isNDKInstalled) {

@@ -57,3 +49,2 @@ return logManualInstallation({

}
return logManualInstallation({

@@ -60,0 +51,0 @@ healthcheck: 'Android NDK',

@@ -7,54 +7,36 @@ "use strict";

exports.default = void 0;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
var _androidWinHelpers = require("../windows/androidWinHelpers");
var _downloadAndUnzip = require("../downloadAndUnzip");
var _environmentVariables = require("../windows/environmentVariables");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const getBuildToolsVersion = () => {
let projectRoot = '';
try {

@@ -65,27 +47,21 @@ // doctor is a detached command, so we may not be in a RN project.

_cliTools().logger.log(); // for extra space
_cliTools().logger.warn("We couldn't find a package.json in this directory. Android SDK checks may fail. Doctor works best in a React Native project root.");
}
const gradleBuildFilePath = _path().default.join(projectRoot, 'android/build.gradle');
const buildToolsVersionEntry = 'buildToolsVersion';
if (!_fs().default.existsSync(gradleBuildFilePath)) {
return 'Not Found';
} // Read the content of the `build.gradle` file
}
// Read the content of the `build.gradle` file
const gradleBuildFile = _fs().default.readFileSync(gradleBuildFilePath, 'utf-8');
const buildToolsVersionIndex = gradleBuildFile.indexOf(buildToolsVersionEntry);
const buildToolsVersion = (gradleBuildFile // Get only the portion of the declaration of `buildToolsVersion`
.substring(buildToolsVersionIndex).split('\n')[0] // Get only the the value of `buildToolsVersion`
const buildToolsVersion = (gradleBuildFile
// Get only the portion of the declaration of `buildToolsVersion`
.substring(buildToolsVersionIndex).split('\n')[0]
// Get only the the value of `buildToolsVersion`
.match(/\d|\../g) || []).join('');
return buildToolsVersion || 'Not Found';
};
const installMessage = `Read more about how to update Android SDK at ${_chalk().default.dim('https://developer.android.com/studio')}`;
const isSDKInstalled = environmentInfo => {

@@ -95,3 +71,2 @@ const version = environmentInfo.SDKs['Android SDK'];

};
var _default = {

@@ -118,9 +93,10 @@ label: 'Android SDK',

const cliToolsUrl = 'https://dl.google.com/android/repository/commandlinetools-win-8512546_latest.zip';
const systemImage = 'system-images;android-31;google_apis;x86_64'; // Installing 29 as well so Android Studio does not complain on first boot
const componentsToInstall = ['platform-tools', 'build-tools;31.0.0', 'platforms;android-31', // Is 28 still needed?
const systemImage = 'system-images;android-31;google_apis;x86_64';
// Installing 29 as well so Android Studio does not complain on first boot
const componentsToInstall = ['platform-tools', 'build-tools;31.0.0', 'platforms;android-31',
// Is 28 still needed?
'build-tools;28.0.3', 'platforms;android-28', 'emulator', systemImage, '--licenses' // Accept any pending licenses at the end
];
const androidSDKRoot = (0, _androidWinHelpers.getAndroidSdkRootInstallation)();
if (androidSDKRoot === '') {

@@ -130,3 +106,2 @@ loader.fail('There was an error finding the Android SDK root');

}
await (0, _downloadAndUnzip.downloadAndUnzip)({

@@ -138,14 +113,13 @@ loader,

});
for (const component of componentsToInstall) {
loader.text = `Installing "${component}" (this may take a few minutes)`;
try {
await (0, _androidWinHelpers.installComponent)(component, androidSDKRoot);
} catch (e) {// Is there a way to persist a line in loader and continue the execution?
} catch (e) {
// Is there a way to persist a line in loader and continue the execution?
}
}
loader.text = 'Updating environment variables';
loader.text = 'Updating environment variables'; // Required for the emulator to work from the CLI
// Required for the emulator to work from the CLI
await (0, _environmentVariables.setEnvironment)('ANDROID_SDK_ROOT', androidSDKRoot);

@@ -160,3 +134,2 @@ await (0, _environmentVariables.setEnvironment)('ANDROID_HOME', androidSDKRoot);

} = await (0, _androidWinHelpers.getBestHypervisor)(androidSDKRoot);
if (!installed) {

@@ -167,3 +140,2 @@ if (hypervisor === 'none') {

}
if (hypervisor === 'AMDH') {

@@ -177,3 +149,2 @@ await (0, _androidWinHelpers.enableAMDH)(androidSDKRoot);

}
loader.text = 'Creating AVD';

@@ -189,3 +160,2 @@ await (0, _androidWinHelpers.createAVD)(androidSDKRoot, 'pixel_9.0', 'pixel', systemImage);

loader.fail();
if (isSDKInstalled(environmentInfo)) {

@@ -196,3 +166,2 @@ return logManualInstallation({

}
return logManualInstallation({

@@ -199,0 +168,0 @@ healthcheck: 'Android SDK',

@@ -7,21 +7,13 @@ "use strict";

exports.default = void 0;
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
var _downloadAndUnzip = require("../downloadAndUnzip");
var _executeWinCommand = require("../windows/executeWinCommand");
var _androidWinHelpers = require("../windows/androidWinHelpers");
var _createShortcut = require("../windows/create-shortcut");
var _default = {

@@ -37,4 +29,5 @@ label: 'Android Studio',

version: IDEs['Android Studio']
}; // On Windows `doctor` installs Android Studio locally in a well-known place
};
// On Windows `doctor` installs Android Studio locally in a well-known place
if (needsToBeFixed && process.platform === 'win32') {

@@ -46,7 +39,5 @@ const androidStudioPath = (0, _path().join)((0, _androidWinHelpers.getUserAndroidPath)(), 'android-studio', 'bin', 'studio.exe').replace(/\\/g, '\\\\');

const version = stdout.replace(/(\r\n|\n|\r)/gm, '').trim();
if (version === '') {
return missing;
}
return {

@@ -57,3 +48,2 @@ needsToBeFixed: false,

}
return missing;

@@ -60,0 +50,0 @@ },

@@ -7,23 +7,14 @@ "use strict";

exports.default = void 0;
function _execa() {
const data = _interopRequireDefault(require("execa"));
_execa = function () {
return data;
};
return data;
}
var _checkInstallation = require("../checkInstallation");
var _installPods = require("../installPods");
var _common = require("./common");
var _brewInstall = require("../brewInstall");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const label = 'CocoaPods';

@@ -43,14 +34,14 @@ var _default = {

promptQuestion
} = await (0, _installPods.promptCocoaPodsInstallationQuestion)(); // Capitalise `Homebrew` when printing on the screen
} = await (0, _installPods.promptCocoaPodsInstallationQuestion)();
// Capitalise `Homebrew` when printing on the screen
const installMethodCapitalized = installMethod === 'homebrew' ? installMethod.substr(0, 1).toUpperCase() + installMethod.substr(1) : installMethod;
const loaderInstallationMessage = `${label} (installing with ${installMethodCapitalized})`;
const loaderSucceedMessage = `${label} (installed with ${installMethodCapitalized})`; // Remove the prompt after the question of how to install CocoaPods is answered
const loaderSucceedMessage = `${label} (installed with ${installMethodCapitalized})`;
// Remove the prompt after the question of how to install CocoaPods is answered
(0, _common.removeMessage)(promptQuestion);
if (installMethod === 'gem') {
loader.start(loaderInstallationMessage);
const options = ['install', 'cocoapods', '--no-document'];
try {

@@ -75,3 +66,2 @@ // First attempt to install `cocoapods`

}
if (installMethod === 'homebrew') {

@@ -78,0 +68,0 @@ return await (0, _brewInstall.brewInstall)({

@@ -6,75 +6,52 @@ "use strict";

});
exports.logMessage = exports.logManualInstallation = exports.logError = void 0;
exports.removeMessage = removeMessage;
exports.logError = exports.logManualInstallation = exports.logMessage = void 0;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _readline() {
const data = _interopRequireDefault(require("readline"));
_readline = function () {
return data;
};
return data;
}
function _wcwidth() {
const data = _interopRequireDefault(require("wcwidth"));
_wcwidth = function () {
return data;
};
return data;
}
function _stripAnsi() {
const data = _interopRequireDefault(require("strip-ansi"));
_stripAnsi = function () {
return data;
};
return data;
}
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Space is necessary to keep correct ordering on screen
const logMessage = message => {
const indentation = ' ';
if (typeof message !== 'string') {
_cliTools().logger.log();
return;
}
const messageByLine = message.split('\n');
return _cliTools().logger.log(`${indentation}${messageByLine.join(`\n${indentation}`)}`);
};
exports.logMessage = logMessage;
const addBlankLine = () => logMessage();
const logManualInstallation = ({

@@ -89,3 +66,2 @@ healthcheck,

}
if (url) {

@@ -95,3 +71,2 @@ logMessage(`Read more about how to download ${healthcheck} at ${_chalk().default.dim.underline(url)}`);

}
if (command) {

@@ -101,5 +76,3 @@ logMessage(`Please install ${healthcheck} by running ${_chalk().default.bold(command)}`);

};
exports.logManualInstallation = logManualInstallation;
const logError = ({

@@ -115,6 +88,4 @@ healthcheck,

}
addBlankLine();
logMessage(_chalk().default.dim(error.message));
if (message) {

@@ -125,18 +96,15 @@ logMessage(message);

}
logMessage(`The error above occured while trying to install ${healthcheck}. Please try again manually: ${_chalk().default.bold(command)}`);
addBlankLine();
}; // Calculate the size of a message on terminal based on rows
};
// Calculate the size of a message on terminal based on rows
exports.logError = logError;
function calculateMessageSize(message) {
return Math.max(1, Math.ceil((0, _wcwidth().default)((0, _stripAnsi().default)(message)) / (process.stdout.columns || 80)));
} // Clear the message from the terminal
}
// Clear the message from the terminal
function removeMessage(message) {
_readline().default.moveCursor(process.stdout, 0, -calculateMessageSize(message));
_readline().default.clearScreenDown(process.stdout);

@@ -143,0 +111,0 @@ }

@@ -7,39 +7,22 @@ "use strict";

exports.getHealthchecks = exports.HEALTHCHECK_TYPES = void 0;
var _nodeJS = _interopRequireDefault(require("./nodeJS"));
var _packageManagers = require("./packageManagers");
var _jdk = _interopRequireDefault(require("./jdk"));
var _watchman = _interopRequireDefault(require("./watchman"));
var _androidHomeEnvVariable = _interopRequireDefault(require("./androidHomeEnvVariable"));
var _androidStudio = _interopRequireDefault(require("./androidStudio"));
var _androidSDK = _interopRequireDefault(require("./androidSDK"));
var _androidNDK = _interopRequireDefault(require("./androidNDK"));
var _xcode = _interopRequireDefault(require("./xcode"));
var _cocoaPods = _interopRequireDefault(require("./cocoaPods"));
var _iosDeploy = _interopRequireDefault(require("./iosDeploy"));
function _cliConfig() {
const data = _interopRequireDefault(require("@react-native-community/cli-config"));
_cliConfig = function () {
return data;
};
return data;
}
var _xcodeEnv = _interopRequireDefault(require("./xcodeEnv"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const HEALTHCHECK_TYPES = {

@@ -50,8 +33,8 @@ ERROR: 'ERROR',

exports.HEALTHCHECK_TYPES = HEALTHCHECK_TYPES;
const getHealthchecks = ({
contributor
}) => {
let additionalChecks = []; // Doctor can run in a detached mode, where there isn't a config so this can fail
let additionalChecks = [];
// Doctor can run in a detached mode, where there isn't a config so this can fail
try {

@@ -61,3 +44,2 @@ let config = (0, _cliConfig().default)();

} catch {}
return {

@@ -81,5 +63,4 @@ common: {

};
exports.getHealthchecks = getHealthchecks;
//# sourceMappingURL=index.js.map

@@ -7,45 +7,30 @@ "use strict";

exports.default = void 0;
function _execa() {
const data = _interopRequireDefault(require("execa"));
_execa = function () {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
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 = () => {

@@ -55,10 +40,7 @@ if (_packageManagers.packageManager === _checkInstallation.PACKAGE_MANAGERS.YARN) {

}
if (_packageManagers.packageManager === _checkInstallation.PACKAGE_MANAGERS.NPM) {
return installationWithNpm;
}
return undefined;
};
const installLibrary = async ({

@@ -83,3 +65,2 @@ installationCommand,

};
var _default = {

@@ -97,4 +78,5 @@ label,

loader.stop();
const installationCommand = identifyInstallationCommand(); // This means that we couldn't "guess" the package manager
const installationCommand = identifyInstallationCommand();
// This means that we couldn't "guess" the package manager
if (installationCommand === undefined) {

@@ -123,14 +105,13 @@ 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?`;

(0, _common.removeMessage)(`? ${promptQuestion} ${chosenPackageManager}`);
if (chosenPackageManager === skipInstallation.value || !chosenPackageManager // e.g. when user presses Esc
) {
loader.fail(); // Then we just print out the URL that the user can head to download the library
loader.fail();
logManualInstallation({
healthcheck: 'ios-deploy',
url: 'https://github.com/ios-control/ios-deploy#readme'
});
return;
}
// 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'
});
return;
}
const shouldInstallWithYarn = chosenPackageManager === installWithYarn.value;

@@ -143,3 +124,2 @@ return installLibrary({

}
return installLibrary({

@@ -146,0 +126,0 @@ installationCommand,

@@ -7,23 +7,14 @@ "use strict";

exports.default = void 0;
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
var _versionRanges = _interopRequireDefault(require("../versionRanges"));
var _checkInstallation = require("../checkInstallation");
var _downloadAndUnzip = require("../downloadAndUnzip");
var _environmentVariables = require("../windows/environmentVariables");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = {

@@ -30,0 +21,0 @@ label: 'JDK',

@@ -7,9 +7,5 @@ "use strict";

exports.default = void 0;
var _versionRanges = _interopRequireDefault(require("../versionRanges"));
var _checkInstallation = require("../checkInstallation");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = {

@@ -16,0 +12,0 @@ label: 'Node.js',

@@ -6,22 +6,14 @@ "use strict";

});
exports.npm = exports.yarn = exports.packageManager = void 0;
exports.yarn = exports.packageManager = exports.npm = void 0;
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
var _versionRanges = _interopRequireDefault(require("../versionRanges"));
var _checkInstallation = require("../checkInstallation");
var _install = require("../install");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const packageManager = (() => {

@@ -31,10 +23,7 @@ if (_fs().default.existsSync('yarn.lock')) {

}
if (_fs().default.existsSync('package-lock.json')) {
return _checkInstallation.PACKAGE_MANAGERS.NPM;
}
return undefined;
})();
exports.packageManager = packageManager;

@@ -41,0 +30,0 @@ const yarn = {

@@ -7,5 +7,3 @@ "use strict";

exports.default = void 0;
var _install = require("../install");
const label = 'Watchman';

@@ -12,0 +10,0 @@ var _default = {

@@ -7,9 +7,5 @@ "use strict";

exports.default = void 0;
var _versionRanges = _interopRequireDefault(require("../versionRanges"));
var _checkInstallation = require("../checkInstallation");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = {

@@ -16,0 +12,0 @@ label: 'Xcode',

@@ -7,48 +7,33 @@ "use strict";

exports.default = void 0;
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
function _util() {
const data = require("util");
_util = function () {
return data;
};
return data;
}
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
function _cliPlatformIos() {
const data = require("@react-native-community/cli-platform-ios");
_cliPlatformIos = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const xcodeEnvFile = '.xcode.env';
const pathSeparator = '/';
function removeLastPathComponent(pathString) {

@@ -59,3 +44,2 @@ const components = pathString.split(pathSeparator);

}
function pathHasXcodeEnvFile(pathString) {

@@ -65,7 +49,5 @@ const xcodeEnvPath = pathString + pathSeparator + xcodeEnvFile;

}
function pathDoesNotHaveXcodeEnvFile(pathString) {
return !pathHasXcodeEnvFile(pathString);
}
var _default = {

@@ -94,3 +76,4 @@ label: '.xcode.env',

const copyFileAsync = (0, _util().promisify)(_fs().default.copyFile);
(0, _cliPlatformIos().findPodfilePaths)(projectRoot).map(removeLastPathComponent) // avoid overriding existing .xcode.env
(0, _cliPlatformIos().findPodfilePaths)(projectRoot).map(removeLastPathComponent)
// avoid overriding existing .xcode.env
.filter(pathDoesNotHaveXcodeEnvFile).forEach(async pathString => {

@@ -97,0 +80,0 @@ const destFilePath = pathString + pathSeparator + xcodeEnvFile;

@@ -7,7 +7,4 @@ "use strict";

exports.install = install;
var _brewInstall = require("./brewInstall");
var _common = require("./healthchecks/common");
async function install({

@@ -28,3 +25,2 @@ pkg,

break;
default:

@@ -31,0 +27,0 @@ throw new Error('Not implemented yet');

@@ -6,74 +6,53 @@ "use strict";

});
exports.default = void 0;
exports.installCocoaPods = installCocoaPods;
exports.promptCocoaPodsInstallationQuestion = promptCocoaPodsInstallationQuestion;
exports.runSudo = runSudo;
exports.installCocoaPods = installCocoaPods;
exports.default = void 0;
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
function _execa() {
const data = _interopRequireDefault(require("execa"));
_execa = function () {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _prompts() {
const data = _interopRequireDefault(require("prompts"));
_prompts = function () {
return data;
};
return data;
}
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
function _sudoPrompt() {
const data = _interopRequireDefault(require("sudo-prompt"));
_sudoPrompt = function () {
return data;
};
return data;
}
var _runBundleInstall = _interopRequireDefault(require("./runBundleInstall"));
var _brewInstall = require("./brewInstall");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// @ts-ignore untyped
// @ts-ignore untyped
async function runPodInstall(loader, directory, shouldHandleRepoUpdate = true) {

@@ -86,2 +65,3 @@ try {

const stderr = error.stderr || error.stdout;
/**

@@ -94,3 +74,2 @@ * If CocoaPods failed due to repo being out of date, it will

*/
if (stderr.includes('pod repo update') && shouldHandleRepoUpdate) {

@@ -101,5 +80,3 @@ await runPodUpdate(loader);

loader.fail();
_cliTools().logger.error(stderr);
throw new Error('Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.');

@@ -109,3 +86,2 @@ }

}
async function runPodUpdate(loader) {

@@ -118,3 +94,2 @@ try {

_cliTools().logger.log(error.stderr || error.stdout);
loader.fail();

@@ -124,3 +99,2 @@ throw new Error(`Failed to update CocoaPods repositories for iOS project.\nPlease try again manually: "pod repo update".\nCocoaPods documentation: ${_chalk().default.dim.underline('https://cocoapods.org/')}`);

}
function runSudo(command) {

@@ -134,3 +108,2 @@ return new Promise((resolve, reject) => {

}
resolve();

@@ -140,3 +113,2 @@ });

}
async function promptCocoaPodsInstallationQuestion() {

@@ -166,6 +138,4 @@ const promptQuestion = `CocoaPods ${_chalk().default.dim.underline('(https://cocoapods.org/)')} ${_chalk().default.reset.bold('is not installed. CocoaPods is necessary for the iOS project to run correctly. Do you want to install it?')}`;

}
async function installCocoaPodsWithGem() {
const options = ['install', 'cocoapods', '--no-document'];
try {

@@ -179,3 +149,2 @@ // First attempt to install `cocoapods`

}
async function installCocoaPods(loader) {

@@ -186,6 +155,4 @@ loader.stop();

} = await promptCocoaPodsInstallationQuestion();
if (installMethod === 'gem') {
loader.start('Installing CocoaPods');
try {

@@ -196,9 +163,6 @@ await installCocoaPodsWithGem();

loader.fail();
_cliTools().logger.error(error.stderr);
throw new Error(`An error occured while trying to install CocoaPods, which is required by this template.\nPlease try again manually: sudo gem install cocoapods.\nCocoaPods documentation: ${_chalk().default.dim.underline('https://cocoapods.org/')}`);
}
}
if (installMethod === 'homebrew') {

@@ -212,3 +176,2 @@ return await (0, _brewInstall.brewInstall)({

}
async function installPods({

@@ -219,3 +182,2 @@ directory,

loader = loader || new (_cliTools().NoopLoader)();
try {

@@ -225,11 +187,10 @@ if (!_fs().default.existsSync('ios')) {

}
process.chdir('ios');
const hasPods = _fs().default.existsSync('Podfile');
if (!hasPods) {
return;
}
if (_fs().default.existsSync('../Gemfile')) {
await (0, _runBundleInstall.default)(loader);
}
try {

@@ -244,7 +205,3 @@ // Check if "pod" is available and usable. It happens that there are

}
await (0, _runBundleInstall.default)(loader);
await runPodInstall(loader, directory);
} catch (error) {
throw error;
} finally {

@@ -254,3 +211,2 @@ process.chdir('..');

}
var _default = installPods;

@@ -257,0 +213,0 @@ exports.default = _default;

@@ -7,25 +7,17 @@ "use strict";

exports.default = exports.KEYS = void 0;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const KEYS = {

@@ -38,10 +30,6 @@ FIX_ALL_ISSUES: 'f',

exports.KEYS = KEYS;
const printOption = option => _cliTools().logger.log(` \u203A ${option}`);
const printOptions = () => {
_cliTools().logger.log();
_cliTools().logger.log(_chalk().default.bold('Usage'));
printOption(`${_chalk().default.dim('Press')} ${KEYS.FIX_ALL_ISSUES} ${_chalk().default.dim('to try to fix issues.')}`);

@@ -52,3 +40,2 @@ printOption(`${_chalk().default.dim('Press')} ${KEYS.FIX_ERRORS} ${_chalk().default.dim('to try to fix errors.')}`);

};
var _default = ({

@@ -58,7 +45,5 @@ onKeyPress

printOptions();
if (process.stdin.setRawMode) {
process.stdin.setRawMode(true);
}
process.stdin.resume();

@@ -68,5 +53,4 @@ process.stdin.setEncoding('utf8');

};
exports.default = _default;
//# sourceMappingURL=printFixOptions.js.map

@@ -6,44 +6,30 @@ "use strict";

});
exports.AUTOMATIC_FIX_LEVELS = void 0;
exports.default = _default;
exports.AUTOMATIC_FIX_LEVELS = void 0;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _ora() {
const data = _interopRequireDefault(require("ora"));
_ora = function () {
return data;
};
return data;
}
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
var _healthchecks = require("./healthchecks");
var _common = require("./healthchecks/common");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
let AUTOMATIC_FIX_LEVELS;
exports.AUTOMATIC_FIX_LEVELS = AUTOMATIC_FIX_LEVELS;
(function (AUTOMATIC_FIX_LEVELS) {

@@ -54,3 +40,2 @@ AUTOMATIC_FIX_LEVELS["ALL_ISSUES"] = "ALL_ISSUES";

})(AUTOMATIC_FIX_LEVELS || (exports.AUTOMATIC_FIX_LEVELS = AUTOMATIC_FIX_LEVELS = {}));
async function _default({

@@ -65,7 +50,6 @@ healthchecks,

// @ts-ignore
process.stdout.moveCursor(0, -6); // @ts-ignore
process.stdout.moveCursor(0, -6);
// @ts-ignore
process.stdout.clearScreenDown();
}
const totalIssuesBasedOnFixLevel = {

@@ -77,5 +61,3 @@ [AUTOMATIC_FIX_LEVELS.ALL_ISSUES]: stats.errors + stats.warnings,

const issuesCount = totalIssuesBasedOnFixLevel[automaticFixLevel];
_cliTools().logger.log(`\nAttempting to fix ${_chalk().default.bold(issuesCount.toString())} issue${issuesCount > 1 ? 's' : ''}...`);
for (const category of healthchecks) {

@@ -86,20 +68,14 @@ const healthchecksToRun = category.healthchecks.filter(healthcheck => {

}
if (automaticFixLevel === AUTOMATIC_FIX_LEVELS.ERRORS) {
return healthcheck.needsToBeFixed && healthcheck.type === _healthchecks.HEALTHCHECK_TYPES.ERROR;
}
if (automaticFixLevel === AUTOMATIC_FIX_LEVELS.WARNINGS) {
return healthcheck.needsToBeFixed && healthcheck.type === _healthchecks.HEALTHCHECK_TYPES.WARNING;
}
return;
});
if (!healthchecksToRun.length) {
continue;
}
_cliTools().logger.log(`\n${_chalk().default.dim(category.label)}`);
for (const healthcheckToRun of healthchecksToRun) {

@@ -111,3 +87,2 @@ // @todo replace this with `getLoader` from `tools`

}).start();
try {

@@ -119,3 +94,4 @@ await healthcheckToRun.runAutomaticFix({

});
} catch (error) {// TODO: log the error in a meaningful way
} catch (error) {
// TODO: log the error in a meaningful way
}

@@ -122,0 +98,0 @@ }

@@ -7,25 +7,17 @@ "use strict";

exports.default = void 0;
function _execa() {
const data = _interopRequireDefault(require("execa"));
_execa = function () {
return data;
};
return data;
}
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
async function runBundleInstall(loader) {

@@ -37,11 +29,7 @@ try {

loader.fail();
_cliTools().logger.error(error.stderr || error.stdout);
throw new Error('Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.');
}
loader.succeed();
}
var _default = runBundleInstall;

@@ -48,0 +36,0 @@ exports.default = _default;

@@ -7,15 +7,10 @@ "use strict";

exports.unzip = void 0;
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
const StreamZip = require('node-stream-zip');
const unzip = async (source, destination) => {

@@ -33,7 +28,5 @@ return new Promise((resolve, reject) => {

zip.close();
if (err) {
return reject(err);
}
resolve();

@@ -44,5 +37,4 @@ });

};
exports.unzip = unzip;
//# sourceMappingURL=unzip.js.map

@@ -6,28 +6,19 @@ "use strict";

});
exports.enableAMDH = exports.enableHAXM = exports.enableWHPX = exports.getBestHypervisor = exports.createAVD = exports.installComponent = exports.getAndroidSdkRootInstallation = exports.getUserAndroidPath = void 0;
exports.installComponent = exports.getUserAndroidPath = exports.getBestHypervisor = exports.getAndroidSdkRootInstallation = exports.enableWHPX = exports.enableHAXM = exports.enableAMDH = exports.createAVD = void 0;
function _fsExtra() {
const data = require("fs-extra");
_fsExtra = function () {
return data;
};
return data;
}
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
var _executeWinCommand = require("./executeWinCommand");
var _processorType = require("./processorType");
/**

@@ -40,15 +31,14 @@ * Returns the path to where all Android related things should be installed

};
/**
* Deals with ANDROID_HOME, ANDROID_SDK_ROOT or generates a new one
*/
exports.getUserAndroidPath = getUserAndroidPath;
const getAndroidSdkRootInstallation = () => {
const env = process.env.ANDROID_SDK_ROOT || process.env.ANDROID_HOME;
const installPath = env ? // Happens if previous installations or not fully completed
env : // All Android zip files have a root folder, using `Android` as the common place
const installPath = env ?
// Happens if previous installations or not fully completed
env :
// All Android zip files have a root folder, using `Android` as the common place
(0, _path().join)(getUserAndroidPath(), 'Sdk');
if ((0, _fsExtra().pathExistsSync)(installPath)) {

@@ -60,2 +50,3 @@ return installPath;

};
/**

@@ -65,10 +56,6 @@ * Installs an Android component (e.g.: `platform-tools`, `emulator`)

*/
exports.getAndroidSdkRootInstallation = getAndroidSdkRootInstallation;
const installComponent = (component, androidSdkRoot) => {
return new Promise((done, error) => {
var _child$stdout, _child$stderr;
const sdkmanager = (0, _path().join)(androidSdkRoot, 'tools', 'bin', 'sdkmanager.bat');

@@ -81,3 +68,2 @@ const command = `"${sdkmanager}" --sdk_root="${androidSdkRoot}" "${component}"`;

var _child$stdin;
(_child$stdin = child.stdin) === null || _child$stdin === void 0 ? void 0 : _child$stdin.write('y\n');

@@ -101,2 +87,3 @@ }

};
/**

@@ -110,6 +97,3 @@ * For the given custom Hypervisor and the output of `emulator-check accel`

*/
exports.installComponent = installComponent;
const parseHypervisor = (status, customHypervisor) => {

@@ -125,2 +109,3 @@ /**

*/
if (status.includes('is not installed, but Windows Hypervisor Platform is available.')) {

@@ -132,3 +117,2 @@ return {

}
if (/WHPX \((\d|\.)+\) is installed and usable\./.test(status)) {

@@ -140,3 +124,2 @@ return {

}
if (/is installed and usable\./.test(status)) {

@@ -148,3 +131,2 @@ return {

}
if (status.includes("Your CPU: 'AuthenticAMD'")) {

@@ -156,3 +138,2 @@ return {

}
if (status.includes('is not installed on this machine')) {

@@ -164,6 +145,4 @@ return {

}
return null;
};
const getEmulatorAccelOutputInformation = async androidSDKRoot => {

@@ -190,2 +169,3 @@ /**

*/
try {

@@ -203,2 +183,3 @@ const {

};
/**

@@ -208,4 +189,2 @@ * Creates a new Android Virtual Device in the default folder with the

*/
const createAVD = async (androidSDKRoot, name, device, image) => {

@@ -218,4 +197,5 @@ try {

stdout
} = await (0, _executeWinCommand.executeCommand)(`${avdmanager} -s create avd --force --name "${name}" --device "${device}" --package "${image}" --tag "${tag}" --abi "${abi}"`); // For some reason `image.sysdir.1` in `config.ini` points to the wrong location and needs to be updated
} = await (0, _executeWinCommand.executeCommand)(`${avdmanager} -s create avd --force --name "${name}" --device "${device}" --package "${image}" --tag "${tag}" --abi "${abi}"`);
// For some reason `image.sysdir.1` in `config.ini` points to the wrong location and needs to be updated
const configPath = (0, _path().join)(process.env.HOMEPATH || '', '.android', 'avd', `${name}.avd`, 'config.ini');

@@ -233,2 +213,3 @@ const content = await (0, _fsExtra().readFile)(configPath, 'utf-8');

};
/**

@@ -240,6 +221,3 @@ * Returns what hypervisor should be installed for the Android emulator

*/
exports.createAVD = createAVD;
const getBestHypervisor = async androidSDKRoot => {

@@ -249,12 +227,10 @@ const customHypervisor = (0, _processorType.getProcessorType)() === 'Intel' ? 'HAXM' : 'AMDH';

const lines = stdout.split('\n');
for (const line of lines) {
const hypervisor = parseHypervisor(line, customHypervisor);
if (hypervisor) {
return hypervisor;
}
} // Couldn't identify the best one to run so not doing anything
}
// Couldn't identify the best one to run so not doing anything
return {

@@ -265,2 +241,3 @@ hypervisor: 'none',

};
/**

@@ -270,9 +247,7 @@ * Enables the Windows HypervisorPlatform and Hyper-V features.

*/
exports.getBestHypervisor = getBestHypervisor;
const enableWHPX = () => {
return (0, _executeWinCommand.executeCommand)('DISM /Quiet /NoRestart /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V /FeatureName:HypervisorPlatform', true);
};
/**

@@ -283,6 +258,3 @@ * Installs and enables the [HAXM](https://github.com/intel/haxm)

*/
exports.enableWHPX = enableWHPX;
const enableHAXM = async androidSdkInstallPath => {

@@ -292,2 +264,3 @@ await installComponent('extras;intel;Hardware_Accelerated_Execution_Manager', androidSdkInstallPath);

};
/**

@@ -299,6 +272,3 @@ * Installs and enables the

*/
exports.enableHAXM = enableHAXM;
const enableAMDH = async androidSdkInstallPath => {

@@ -308,5 +278,4 @@ await installComponent('extras;google;Android_Emulator_Hypervisor_Driver', androidSdkInstallPath);

};
exports.enableAMDH = enableAMDH;
//# sourceMappingURL=androidWinHelpers.js.map

@@ -7,35 +7,24 @@ "use strict";

exports.createShortcut = void 0;
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
function _os() {
const data = require("os");
_os = function () {
return data;
};
return data;
}
var _executeWinCommand = require("./executeWinCommand");
/**

@@ -66,5 +55,4 @@ * Creates a script in the user's Startup menu

};
exports.createShortcut = createShortcut;
//# sourceMappingURL=create-shortcut.js.map

@@ -7,5 +7,3 @@ "use strict";

exports.updateEnvironment = exports.setEnvironment = void 0;
var _executeWinCommand = require("./executeWinCommand");
/**

@@ -20,2 +18,3 @@ * Creates a new variable in the user's environment

};
/**

@@ -27,6 +26,3 @@ * Prepends the given `value` to the user's environment `variable`.

*/
exports.setEnvironment = setEnvironment;
const updateEnvironment = async (variable, value) => {

@@ -37,8 +33,6 @@ // Avoid adding the value multiple times to PATH

const envVariable = process.env[variable] || '';
if (variable === 'PATH' && envVariable.includes(`${value};`)) {
return;
} // https://superuser.com/a/601034
}
// https://superuser.com/a/601034
const command = `for /f "skip=2 tokens=3*" %a in ('reg query HKCU\\Environment /v ${variable}') do @if [%b]==[] ( @setx ${variable} "${value};%~a" ) else ( @setx ${variable} "${value};%~a %~b" )

@@ -49,5 +43,4 @@ `;

};
exports.updateEnvironment = updateEnvironment;
//# sourceMappingURL=environmentVariables.js.map

@@ -7,45 +7,31 @@ "use strict";

exports.executeCommand = void 0;
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _os() {
const data = require("os");
_os = function () {
return data;
};
return data;
}
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
function _execa() {
const data = _interopRequireDefault(require("execa"));
_execa = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/** Runs a command requestion permission to run elevated. */

@@ -55,3 +41,2 @@ const runElevated = command => {

// https://www.winhelponline.com/blog/vbscripts-and-uac-elevation/
/**

@@ -61,2 +46,3 @@ * Need to use a couple of intermediary files to make this work as

*/
// prettier-ignore

@@ -78,2 +64,3 @@ const script = `If WScript.Arguments.length = 0 Then

};
/**

@@ -89,4 +76,2 @@ * Groups all string arguments into a single one. E.g.:

*/
const groupArgs = args => {

@@ -98,10 +83,7 @@ let isStringArgument = false;

acum[acum.length - 1] = `${last} ${current}`;
if (current.endsWith('"')) {
isStringArgument = false;
}
return acum;
}
if (current.startsWith('"')) {

@@ -116,2 +98,3 @@ /**

}
/**

@@ -121,8 +104,5 @@ * Argument is surrounded by "" that need to be removed.

*/
acum.push(current.replace(/"/g, ''));
return acum;
}
acum.push(current);

@@ -133,2 +113,3 @@ return acum;

};
/**

@@ -138,12 +119,8 @@ * Executes the given `command` on a shell taking care of slicing the parameters

*/
const executeShellCommand = (command, elevated = false) => {
const args = groupArgs(command.split(' '));
const program = args.shift();
if (elevated) {
return runElevated(command);
}
return (0, _execa().default)(program, args, {

@@ -153,5 +130,4 @@ shell: true

};
exports.executeCommand = executeShellCommand;
//# sourceMappingURL=executeWinCommand.js.map

@@ -7,3 +7,2 @@ "use strict";

exports.getProcessorType = void 0;
/**

@@ -15,5 +14,4 @@ * Returns if the processor is Intel or AMD

};
exports.getProcessorType = getProcessorType;
//# sourceMappingURL=processorType.js.map

@@ -1,1 +0,3 @@

"use strict";
"use strict";
//# sourceMappingURL=types.js.map
{
"name": "@react-native-community/cli-doctor",
"version": "10.0.0-alpha.3",
"version": "10.0.0",
"license": "MIT",

@@ -11,5 +11,5 @@ "main": "build/index.js",

"dependencies": {
"@react-native-community/cli-config": "^10.0.0-alpha.3",
"@react-native-community/cli-platform-ios": "^10.0.0-alpha.3",
"@react-native-community/cli-tools": "^10.0.0-alpha.0",
"@react-native-community/cli-config": "^10.0.0",
"@react-native-community/cli-platform-ios": "^10.0.0",
"@react-native-community/cli-tools": "^10.0.0",
"chalk": "^4.1.2",

@@ -35,3 +35,3 @@ "command-exists": "^1.2.8",

"devDependencies": {
"@react-native-community/cli-types": "^10.0.0-alpha.0",
"@react-native-community/cli-types": "^10.0.0",
"@types/command-exists": "^1.2.0",

@@ -49,3 +49,3 @@ "@types/ip": "^1.1.0",

},
"gitHead": "5be29de1c654ade3113e6ef24e3be28732b3ae5e"
"gitHead": "f0ff82404a0feff3e7df20a4b3a055062a32bbbe"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc