@react-native-community/cli-platform-ios
Advanced tools
Comparing version 3.0.0-alpha.2 to 3.0.0-alpha.3
@@ -56,3 +56,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -59,0 +58,0 @@ function findAvailableDevice(devices) { |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -26,6 +25,5 @@ | ||
* | ||
* @param Object simulators a parsed list from `xcrun simctl list --json devices` command | ||
* @param String|null simulatorString the string with the name of desired simulator. If null, it will use the currently | ||
* @param simulators a parsed list from `xcrun simctl list --json devices` command | ||
* @param simulatorString the string with the name of desired simulator. If null, it will use the currently | ||
* booted simulator, or if none are booted, the first in the list. | ||
* @returns {Object} {udid, name, version} | ||
*/ | ||
@@ -38,7 +36,9 @@ function findMatchingSimulator(simulators, simulatorString) { | ||
const devices = simulators.devices; | ||
let simulatorVersion; | ||
let simulatorName; | ||
const parsedSimulatorName = simulatorString ? simulatorString.match(/(.*)? (?:\((\d+\.\d+)?\))$/) : []; | ||
if (parsedSimulatorName && parsedSimulatorName[2] !== undefined) { | ||
var simulatorVersion = parsedSimulatorName[2]; | ||
var simulatorName = parsedSimulatorName[1]; | ||
simulatorVersion = parsedSimulatorName[2]; | ||
simulatorName = parsedSimulatorName[1]; | ||
} else { | ||
@@ -71,3 +71,4 @@ simulatorName = simulatorString; | ||
if (simulator.availability !== '(available)' && simulator.isAvailable !== 'YES' && simulator.isAvailable !== true) { | ||
if (simulator.availability !== '(available)' && // @ts-ignore verify isAvailable parameter | ||
simulator.isAvailable !== 'YES' && simulator.isAvailable !== true) { | ||
continue; | ||
@@ -74,0 +75,0 @@ } |
@@ -26,4 +26,2 @@ "use strict"; | ||
* | ||
* @format | ||
* strict | ||
*/ | ||
@@ -30,0 +28,0 @@ function findXcodeProject(files) { |
@@ -56,2 +56,4 @@ "use strict"; | ||
var _warnAboutPodInstall = _interopRequireDefault(require("../../link/warnAboutPodInstall")); | ||
function _cliTools() { | ||
@@ -79,2 +81,3 @@ const data = require("@react-native-community/cli-tools"); | ||
(0, _warnAboutManuallyLinkedLibs.default)(ctx); | ||
(0, _warnAboutPodInstall.default)(ctx); | ||
process.chdir(args.projectPath); | ||
@@ -102,4 +105,3 @@ const xcodeProject = (0, _findXcodeProject.default)(_fs().default.readdirSync('.')); | ||
const devices = (0, _parseIOSDevicesList.default)( // $FlowExpectedError https://github.com/facebook/flow/issues/5675 | ||
_child_process().default.execFileSync('xcrun', ['instruments', '-s'], { | ||
const devices = (0, _parseIOSDevicesList.default)(_child_process().default.execFileSync('xcrun', ['instruments', '-s'], { | ||
encoding: 'utf8' | ||
@@ -131,4 +133,3 @@ })); | ||
try { | ||
simulators = JSON.parse( // $FlowIssue: https://github.com/facebook/flow/issues/5675 | ||
_child_process().default.execFileSync('xcrun', ['simctl', 'list', '--json', 'devices'], { | ||
simulators = JSON.parse(_child_process().default.execFileSync('xcrun', ['simctl', 'list', '--json', 'devices'], { | ||
encoding: 'utf8' | ||
@@ -139,5 +140,14 @@ })); | ||
} | ||
/** | ||
* If provided simulator does not exist, try simulators in following order | ||
* - iPhone X | ||
* - iPhone 8 | ||
*/ | ||
const selectedSimulator = (0, _findMatchingSimulator.default)(simulators, args.simulator); | ||
const fallbackSimulators = ['iPhone X', 'iPhone 8']; | ||
const selectedSimulator = fallbackSimulators.reduce((simulator, fallback) => { | ||
return simulator || (0, _findMatchingSimulator.default)(simulators, fallback); | ||
}, (0, _findMatchingSimulator.default)(simulators, args.simulator)); | ||
if (!selectedSimulator) { | ||
@@ -161,4 +171,3 @@ throw new (_cliTools().CLIError)(`Could not find "${args.simulator}" simulator`); | ||
encoding: 'utf8' | ||
}) // $FlowExpectedError https://github.com/facebook/flow/issues/5675 | ||
.trim(); | ||
}).trim(); | ||
@@ -182,4 +191,3 @@ _child_process().default.execFileSync('open', [`${activeDeveloperDir}/Applications/Simulator.app`, '--args', '-CurrentDeviceUDID', selectedSimulator.udid]); | ||
encoding: 'utf8' | ||
}) // $FlowExpectedError https://github.com/facebook/flow/issues/5675 | ||
.trim(); | ||
}).trim(); | ||
@@ -364,3 +372,3 @@ _cliTools().logger.info(`Launching "${_chalk().default.bold(bundleID)}"`); | ||
RCT_TERMINAL: terminal, | ||
RCT_METRO_PORT: port | ||
RCT_METRO_PORT: port.toString() | ||
}) | ||
@@ -373,3 +381,3 @@ }; | ||
RCT_TERMINAL: terminal, | ||
RCT_NO_LAUNCH_PACKAGER: true | ||
RCT_NO_LAUNCH_PACKAGER: 'true' | ||
}) | ||
@@ -399,3 +407,3 @@ }; | ||
description: 'Explicitly set simulator to use. Optionally include iOS version between' + 'parenthesis at the end to match an exact version: "iPhone 6 (10.0)"', | ||
default: 'iPhone X' | ||
default: 'iPhone 11' | ||
}, { | ||
@@ -402,0 +410,0 @@ name: '--configuration [string]', |
@@ -14,4 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
* strict | ||
*/ | ||
@@ -18,0 +16,0 @@ |
@@ -36,4 +36,2 @@ "use strict"; | ||
* | ||
* @format | ||
* | ||
*/ | ||
@@ -40,0 +38,0 @@ function findPodfilePath(projectFolder) { |
@@ -36,4 +36,2 @@ "use strict"; | ||
* | ||
* @format | ||
* | ||
*/ | ||
@@ -40,0 +38,0 @@ |
@@ -26,3 +26,2 @@ "use strict"; | ||
* | ||
* | ||
*/ | ||
@@ -29,0 +28,0 @@ function getPodspecName(podspecFile) { |
@@ -43,4 +43,2 @@ "use strict"; | ||
* | ||
* @format | ||
* | ||
*/ | ||
@@ -47,0 +45,0 @@ const memoizedFindProject = (0, _lodash().memoize)(_findProject.default); |
@@ -28,3 +28,2 @@ "use strict"; | ||
* | ||
* | ||
*/ | ||
@@ -31,0 +30,0 @@ function addPodEntry(podLines, linesToAddEntry, podspecPath, nodeModulePath) { |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ function findLineToAddPod(podLines, firstTargetLine) { |
@@ -15,3 +15,2 @@ "use strict"; | ||
* | ||
* | ||
*/ | ||
@@ -18,0 +17,0 @@ const MARKER_TEXT = '# Add new pods below this line'; |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ function findPodTargetLine(podLines, projectName) { |
@@ -20,3 +20,2 @@ "use strict"; | ||
* | ||
* | ||
*/ | ||
@@ -23,0 +22,0 @@ function isInstalled(iOSProject, dependencyConfig) { |
@@ -36,3 +36,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -39,0 +38,0 @@ function readPodfile(podfilePath) { |
@@ -50,3 +50,2 @@ "use strict"; | ||
* | ||
* | ||
*/ | ||
@@ -53,0 +52,0 @@ function registerNativeModulePods(name, podspecPath, iOSProject) { |
@@ -28,3 +28,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -31,0 +30,0 @@ function removePodEntry(podfileContent, podspecPath) { |
@@ -36,3 +36,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -39,0 +38,0 @@ function savePodFile(podfilePath, podLines) { |
@@ -38,3 +38,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -41,0 +40,0 @@ |
@@ -26,4 +26,2 @@ "use strict"; | ||
* | ||
* @format | ||
* | ||
*/ | ||
@@ -30,0 +28,0 @@ |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ |
@@ -18,3 +18,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -21,0 +20,0 @@ function addSharedLibraries(project, libraries) { |
@@ -28,3 +28,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -31,0 +30,0 @@ function addToHeaderSearchPaths(project, path) { |
@@ -20,6 +20,6 @@ "use strict"; | ||
* | ||
* | ||
*/ | ||
function isInstalled(projectConfig, name, dependencyConfig) { | ||
function isInstalled(projectConfig, // FIXME: name is never used | ||
_name, dependencyConfig) { | ||
return (0, _isInstalled.default)(projectConfig, dependencyConfig) || (0, _isInstalled2.default)(projectConfig, dependencyConfig); | ||
} |
@@ -20,5 +20,5 @@ "use strict"; | ||
* | ||
* | ||
*/ | ||
function registerNativeModule(name, dependencyConfig, params, projectConfig) { | ||
function registerNativeModule(name, dependencyConfig, // FIXME: Params is never used | ||
_params, projectConfig) { | ||
if (projectConfig.podfile && dependencyConfig.podspecPath) { | ||
@@ -25,0 +25,0 @@ (0, _registerNativeModule2.default)(name, dependencyConfig.podspecPath, projectConfig); |
@@ -34,5 +34,5 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
function unregisterNativeModule(name, dependencyConfig, projectConfig, otherDependencies) { | ||
function unregisterNativeModule(_name, dependencyConfig, projectConfig, // FIXME: Add type signature here | ||
otherDependencies) { | ||
const isIosInstalled = (0, _isInstalled.default)(projectConfig, dependencyConfig); | ||
@@ -39,0 +39,0 @@ const isPodInstalled = (0, _isInstalled2.default)(projectConfig, dependencyConfig); |
@@ -62,3 +62,2 @@ "use strict"; | ||
* | ||
* | ||
*/ | ||
@@ -89,5 +88,7 @@ | ||
addResourceFile(assets.image); | ||
const fonts = addResourceFile(assets.font); | ||
const fonts = addResourceFile(assets.font); // @ts-ignore Type mismatch with the lib | ||
const existingFonts = plist.UIAppFonts || []; | ||
const allFonts = [...existingFonts, ...fonts]; | ||
const allFonts = [...existingFonts, ...fonts]; // @ts-ignore Type mismatch with the lib | ||
plist.UIAppFonts = Array.from(new Set(allFonts)); // use Set to dedupe w/existing | ||
@@ -94,0 +95,0 @@ |
@@ -18,3 +18,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -21,0 +20,0 @@ const hasGroup = (pbxGroup, name) => pbxGroup.children.find(group => group.comment === name); |
@@ -30,3 +30,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -33,0 +32,0 @@ |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ const getFirstProject = project => project.getFirstProject().firstProject; |
@@ -9,3 +9,3 @@ "use strict"; | ||
function _path() { | ||
const data = _interopRequireDefault(require("path")); | ||
const data = require("path"); | ||
@@ -29,4 +29,2 @@ _path = function () { | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -38,3 +36,2 @@ * Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* @format | ||
*/ | ||
@@ -53,7 +50,7 @@ | ||
const getOuterDirectory = directories => directories.reduce((topDir, currentDir) => { | ||
const currentFolders = currentDir.split('/'); | ||
const topMostFolders = topDir.split('/'); | ||
const currentFolders = currentDir.split(_path().posix.sep); | ||
const topMostFolders = topDir.split(_path().posix.sep); | ||
if (currentFolders.length === topMostFolders.length && (0, _lodash().last)(currentFolders) !== (0, _lodash().last)(topMostFolders)) { | ||
return currentFolders.slice(0, -1).join('/'); | ||
return currentFolders.slice(0, -1).join(_path().posix.sep); | ||
} | ||
@@ -80,4 +77,4 @@ | ||
function getHeaderSearchPath(sourceDir, headers) { | ||
const directories = (0, _lodash().union)(headers.map(_path().default.dirname)); | ||
return directories.length === 1 ? `"$(SRCROOT)/${_path().default.relative(sourceDir, directories[0])}"` : `"$(SRCROOT)/${_path().default.relative(sourceDir, getOuterDirectory(directories))}/**"`; | ||
const directories = (0, _lodash().union)(headers.map(_path().posix.dirname)); | ||
return directories.length === 1 ? `"$(SRCROOT)/${_path().posix.relative(sourceDir, directories[0])}"` : `"$(SRCROOT)/${_path().posix.relative(sourceDir, getOuterDirectory(directories))}/**"`; | ||
} |
@@ -36,3 +36,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -39,0 +38,0 @@ const GLOB_EXCLUDE_PATTERN = ['node_modules/**', 'Pods/**', 'Examples/**', 'examples/**']; |
@@ -38,3 +38,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -41,0 +40,0 @@ |
@@ -28,3 +28,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -31,0 +30,0 @@ function getPlistPath(project, sourceDir) { |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ |
@@ -27,3 +27,2 @@ "use strict"; | ||
* | ||
* | ||
*/ | ||
@@ -30,0 +29,0 @@ function getIOSLinkConfig() { |
@@ -30,3 +30,2 @@ "use strict"; | ||
* | ||
* | ||
*/ | ||
@@ -33,0 +32,0 @@ const memo = new Map(); |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ |
@@ -82,3 +82,2 @@ "use strict"; | ||
* | ||
* | ||
*/ | ||
@@ -85,0 +84,0 @@ |
@@ -28,3 +28,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -31,0 +30,0 @@ |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ |
@@ -28,3 +28,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -31,0 +30,0 @@ |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ function removeProductGroup(project, productGroupId) { |
@@ -32,3 +32,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -35,0 +34,0 @@ |
@@ -14,3 +14,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -17,0 +16,0 @@ function removeSharedLibraries(project, libraries) { |
@@ -103,3 +103,4 @@ "use strict"; | ||
removeResourceFiles(assets.image); | ||
const fonts = removeResourceFiles(assets.font); | ||
const fonts = removeResourceFiles(assets.font); // @ts-ignore Type mismatch | ||
plist.UIAppFonts = (0, _lodash().difference)(plist.UIAppFonts || [], fonts); | ||
@@ -106,0 +107,0 @@ |
@@ -84,3 +84,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -87,0 +86,0 @@ |
@@ -38,3 +38,2 @@ "use strict"; | ||
* | ||
* @format | ||
*/ | ||
@@ -57,3 +56,4 @@ | ||
return _fs().default.writeFileSync(plistPath, `${_plist().default.build(plist, { | ||
return _fs().default.writeFileSync(plistPath, // @ts-ignore Type mismatch | ||
`${_plist().default.build(plist, { | ||
indent: '\t', | ||
@@ -60,0 +60,0 @@ offset: -1 |
{ | ||
"name": "@react-native-community/cli-platform-ios", | ||
"version": "3.0.0-alpha.2", | ||
"version": "3.0.0-alpha.3", | ||
"license": "MIT", | ||
@@ -9,4 +9,10 @@ "main": "build/index.js", | ||
"chalk": "^2.4.2", | ||
"js-yaml": "^3.13.1", | ||
"xcode": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@react-native-community/cli-types": "^3.0.0-alpha.3", | ||
"@types/js-yaml": "^3.12.1", | ||
"@types/plist": "^3.0.2" | ||
}, | ||
"files": [ | ||
@@ -16,3 +22,3 @@ "build", | ||
], | ||
"gitHead": "4d38c4cdb5a1e05c6670a046ef5a44afd655111a" | ||
"gitHead": "726266eb96e91bbe677b1b95757b896e8d6c5b29" | ||
} |
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
152191
185
3403
4
3
16
+ Addedjs-yaml@^3.13.1
+ Addedargparse@1.0.10(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedjs-yaml@3.14.1(transitive)
+ Addedsprintf-js@1.0.3(transitive)