Socket
Socket
Sign inDemoInstall

@react-native-community/cli-platform-apple

Package Overview
Dependencies
6
Maintainers
0
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 14.0.0-alpha.5 to 14.0.0-alpha.6

2

build/commands/buildCommand/getConfiguration.d.ts

@@ -1,2 +0,2 @@

import { IOSProjectInfo } from '@react-native-community/cli-types';
import type { IOSProjectInfo } from '@react-native-community/cli-types';
import type { BuildFlags } from './buildOptions';

@@ -3,0 +3,0 @@ import { ApplePlatform } from '../../types';

@@ -36,3 +36,3 @@ "use strict";

var _info$schemes;
const info = (0, _getInfo.getInfo)();
const info = (0, _getInfo.getInfo)(xcodeProject, sourceDir);
if (args.mode) {

@@ -39,0 +39,0 @@ (0, _checkIfConfigurationExists.checkIfConfigurationExists)((info === null || info === void 0 ? void 0 : info.configurations) ?? [], args.mode);

@@ -167,8 +167,8 @@ "use strict";

}) => name).join(', ')}`);
for (const simulator of bootedSimulators) {
await (0, _runOnSimulator.runOnSimulator)(xcodeProject, platformName, mode, scheme, args, simulator || fallbackSimulator);
}
for (const device of bootedDevices) {
await (0, _runOnDevice.runOnDevice)(device, platformName, mode, scheme, xcodeProject, args);
}
for (const simulator of bootedSimulators) {
await (0, _runOnSimulator.runOnSimulator)(xcodeProject, platformName, mode, scheme, args, simulator || fallbackSimulator);
}
return;

@@ -190,7 +190,17 @@ }

} else if (args.device) {
const physicalDevices = devices.filter(({
type
}) => type !== 'simulator');
const device = (0, _matchingDevice.matchingDevice)(physicalDevices, args.device);
if (device) {
let device = (0, _matchingDevice.matchingDevice)(devices, args.device);
if (!device) {
const deviceByUdid = devices.find(d => d.udid === args.device);
if (!deviceByUdid) {
return _cliTools().logger.error(`Could not find a physical device with name or unique device identifier: "${_chalk().default.bold(args.device)}". ${(0, _matchingDevice.printFoundDevices)(devices, 'device')}`);
}
device = deviceByUdid;
if (deviceByUdid.type === 'simulator') {
return _cliTools().logger.error(`The device with udid: "${_chalk().default.bold(args.device)}" is a simulator. If you want to run on a simulator, use the "--simulator" flag instead.`);
}
}
if (device && device.type === 'simulator') {
return _cliTools().logger.error("`--device` flag is intended for physical devices. If you're trying to run on a simulator, use `--simulator` instead.");
}
if (device && device.type === 'device') {
return (0, _runOnDevice.runOnDevice)(device, platformName, mode, scheme, xcodeProject, args);

@@ -197,0 +207,0 @@ }

@@ -1,5 +0,5 @@

import { Device } from '../../types';
import { Device, DeviceType } from '../../types';
export declare function matchingDevice(devices: Array<Device>, deviceName: string | true | undefined): Device | undefined;
export declare function formattedDeviceName(simulator: Device): string;
export declare function printFoundDevices(devices: Array<Device>): string;
export declare function printFoundDevices(devices: Array<Device>, type?: DeviceType): string;
//# sourceMappingURL=matchingDevice.d.ts.map

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

function matchingDevice(devices, deviceName) {
// The condition specifically checks if the value is `true`, not just truthy to allow for `--device` flag without a value
if (deviceName === true) {

@@ -36,7 +37,3 @@ const firstIOSDevice = devices.find(d => d.type === 'device');

}
const deviceByName = devices.find(device => device.name === deviceName || formattedDeviceName(device) === deviceName);
if (!deviceByName) {
_cliTools().logger.error(`Could not find a device named: "${_chalk().default.bold(String(deviceName))}". ${printFoundDevices(devices)}`);
}
return deviceByName;
return devices.find(device => device.name === deviceName || formattedDeviceName(device) === deviceName);
}

@@ -46,6 +43,13 @@ function formattedDeviceName(simulator) {

}
function printFoundDevices(devices) {
return ['Available devices:', ...devices.map(device => ` - ${device.name} (${device.udid})`)].join('\n');
function printFoundDevices(devices, type) {
let filteredDevice = [...devices];
if (type) {
filteredDevice = filteredDevice.filter(device => device.type === type);
}
return ['Available devices:', ...filteredDevice.map(({
name,
udid
}) => ` - ${name} (${udid})`)].join('\n');
}
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli-platform-apple/build/commands/runCommand/matchingDevice.js.map

@@ -49,3 +49,3 @@ "use strict";

// here we're intentionally using [] over <> to make passed value optional to allow users to run only on physical devices
description: 'Explicitly set the device to use by name. If the value is not provided,' + 'the app will run on the first available physical device.'
description: 'Explicitly set the device to use by name or by unique device identifier . If the value is not provided,' + 'the app will run on the first available physical device.'
}, ...(0, _buildOptions.getBuildOptions)({

@@ -52,0 +52,0 @@ platformName

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

import { IosInfo } from '../types';
export declare function getInfo(): IosInfo | undefined;
import type { IOSProjectInfo } from '@react-native-community/cli-types';
import type { IosInfo } from '../types';
export declare function getInfo(projectInfo: IOSProjectInfo, sourceDir: string): IosInfo | undefined;
//# sourceMappingURL=getInfo.d.ts.map

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

}
function _fastXmlParser() {
const data = require("fast-xml-parser");
_fastXmlParser = function () {
return data;
};
return data;
}
function fs() {
const data = _interopRequireWildcard(require("fs"));
fs = function () {
return data;
};
return data;
}
function path() {
const data = _interopRequireWildcard(require("path"));
path = function () {
return data;
};
return data;
}
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 }; }
function getInfo() {
function isErrorLike(err) {
return Boolean(err && typeof err === 'object' && 'message' in err && typeof err.message === 'string');
}
function parseTargetList(json) {
try {
const value = JSON.parse(_execa().default.sync('xcodebuild', ['-list', '-json']).stdout);
if ('project' in value) {
return value.project;
} else if ('workspace' in value) {
return value.workspace;
const info = JSON.parse(json);
if ('project' in info) {
return info.project;
} else if ('workspace' in info) {
return info.workspace;
}
return undefined;
} catch (error) {
var _ref;
if (((_ref = error) === null || _ref === void 0 ? void 0 : _ref.message) && error.message.includes('xcodebuild: error:')) {
if (isErrorLike(error)) {
const match = error.message.match(/xcodebuild: error: (.*)/);
const err = match ? match[0] : error;
throw new Error(err);
if (match) {
throw new Error(match[0]);
}
}
throw new Error(error);
throw error;
}
}
function getInfo(projectInfo, sourceDir) {
if (!projectInfo.isWorkspace) {
const xcodebuild = _execa().default.sync('xcodebuild', ['-list', '-json']);
return parseTargetList(xcodebuild.stdout);
}
const xmlParser = new (_fastXmlParser().XMLParser)({
ignoreAttributes: false
});
const xcworkspacedata = path().join(sourceDir, projectInfo.name, 'contents.xcworkspacedata');
const workspace = fs().readFileSync(xcworkspacedata, {
encoding: 'utf-8'
});
const fileRef = xmlParser.parse(workspace).Workspace.FileRef;
const refs = Array.isArray(fileRef) ? fileRef : [fileRef];
return refs.reduce((result, ref) => {
const location = ref['@_location'];
// Ignore the project generated by CocoaPods
if (location.endsWith('/Pods.xcodeproj')) {
return result;
}
const xcodebuild = _execa().default.sync('xcodebuild', ['-list', '-json', '-project', path().join(sourceDir, location.replace('group:', ''))]);
const info = parseTargetList(xcodebuild.stdout);
if (!info) {
return result;
}
const schemes = info.schemes;
// If this is the first project, use it as the "main" project
if (!result) {
if (!Array.isArray(schemes)) {
info.schemes = [];
}
return info;
}
if (!Array.isArray(result.schemes)) {
throw new Error("This shouldn't happen since we set it earlier");
}
// For subsequent projects, merge schemes list
if (Array.isArray(schemes) && schemes.length > 0) {
result.schemes = result.schemes.concat(schemes);
}
return result;
}, undefined);
}
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli-platform-apple/build/tools/getInfo.js.map

@@ -13,5 +13,6 @@ import { supportedPlatforms } from './config/supportedPlatforms';

availabilityError?: string;
type?: 'simulator' | 'device' | 'catalyst';
type?: DeviceType;
lastBootedAt?: string;
}
export type DeviceType = 'simulator' | 'device' | 'catalyst';
export interface IosInfo {

@@ -18,0 +19,0 @@ name: string;

{
"name": "@react-native-community/cli-platform-apple",
"version": "14.0.0-alpha.5",
"version": "14.0.0-alpha.6",
"license": "MIT",

@@ -10,3 +10,3 @@ "main": "build/index.js",

"dependencies": {
"@react-native-community/cli-tools": "14.0.0-alpha.5",
"@react-native-community/cli-tools": "14.0.0-alpha.6",
"chalk": "^4.1.2",

@@ -19,3 +19,3 @@ "execa": "^5.0.0",

"devDependencies": {
"@react-native-community/cli-types": "14.0.0-alpha.5",
"@react-native-community/cli-types": "14.0.0-alpha.6",
"@types/lodash": "^4.14.149",

@@ -35,3 +35,3 @@ "hasbin": "^1.2.3"

},
"gitHead": "0bcdb73b48fd9c8755b5031326fc0f93bbe69789"
"gitHead": "3e225892eedc9335ad7dc8c64a4014939d2838a5"
}

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc