yeet
This commit is contained in:
21
node_modules/@react-native-community/cli-platform-ios/LICENSE
generated
vendored
Normal file
21
node_modules/@react-native-community/cli-platform-ios/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 react-native-community
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
17
node_modules/@react-native-community/cli-platform-ios/build/commands/index.js
generated
vendored
Normal file
17
node_modules/@react-native-community/cli-platform-ios/build/commands/index.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _logIOS = _interopRequireDefault(require("./logIOS"));
|
||||
|
||||
var _runIOS = _interopRequireDefault(require("./runIOS"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = [_logIOS.default, _runIOS.default];
|
||||
exports.default = _default;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
110
node_modules/@react-native-community/cli-platform-ios/build/commands/logIOS/index.js
generated
vendored
Normal file
110
node_modules/@react-native-community/cli-platform-ios/build/commands/logIOS/index.js
generated
vendored
Normal file
@ -0,0 +1,110 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _child_process() {
|
||||
const data = require("child_process");
|
||||
|
||||
_child_process = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _os() {
|
||||
const data = _interopRequireDefault(require("os"));
|
||||
|
||||
_os = 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;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function findAvailableDevice(devices) {
|
||||
for (const key of Object.keys(devices)) {
|
||||
for (const device of devices[key]) {
|
||||
if (device.availability === '(available)' && device.state === 'Booted') {
|
||||
return device;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Starts iOS device syslog tail
|
||||
*/
|
||||
|
||||
|
||||
async function logIOS() {
|
||||
const rawDevices = (0, _child_process().execFileSync)('xcrun', ['simctl', 'list', 'devices', '--json'], {
|
||||
encoding: 'utf8'
|
||||
});
|
||||
const {
|
||||
devices
|
||||
} = JSON.parse(rawDevices);
|
||||
const device = findAvailableDevice(devices);
|
||||
|
||||
if (device === null) {
|
||||
_cliTools().logger.error('No active iOS device found');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
tailDeviceLogs(device.udid);
|
||||
}
|
||||
|
||||
function tailDeviceLogs(udid) {
|
||||
const logDir = _path().default.join(_os().default.homedir(), 'Library', 'Logs', 'CoreSimulator', udid, 'asl');
|
||||
|
||||
const log = (0, _child_process().spawnSync)('syslog', ['-w', '-F', 'std', '-d', logDir], {
|
||||
stdio: 'inherit'
|
||||
});
|
||||
|
||||
if (log.error !== null) {
|
||||
throw log.error;
|
||||
}
|
||||
}
|
||||
|
||||
var _default = {
|
||||
name: 'log-ios',
|
||||
description: 'starts iOS device syslog tail',
|
||||
func: logIOS
|
||||
};
|
||||
exports.default = _default;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
115
node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/findMatchingSimulator.js
generated
vendored
Normal file
115
node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/findMatchingSimulator.js
generated
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Takes in a parsed simulator list and a desired name, and returns an object with the matching simulator. The desired
|
||||
* name can optionally include the iOS version in between parenthesis after the device name. Ex: "iPhone 6 (9.2)" in
|
||||
* which case it'll attempt to find a simulator with the exact version specified.
|
||||
*
|
||||
* If the simulatorString argument is null, we'll go into default mode and return the currently booted simulator, or if
|
||||
* none is booted, it will be the first in the list.
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
function findMatchingSimulator(simulators, findOptions) {
|
||||
if (!simulators.devices) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const devices = simulators.devices;
|
||||
let simulatorVersion;
|
||||
let simulatorName = null;
|
||||
|
||||
if (findOptions && findOptions.simulator) {
|
||||
const parsedSimulatorName = findOptions.simulator.match(/(.*)? (?:\((\d+\.\d+)?\))$/);
|
||||
|
||||
if (parsedSimulatorName && parsedSimulatorName[2] !== undefined) {
|
||||
simulatorVersion = parsedSimulatorName[2];
|
||||
simulatorName = parsedSimulatorName[1];
|
||||
} else {
|
||||
simulatorName = findOptions.simulator;
|
||||
}
|
||||
}
|
||||
|
||||
let match;
|
||||
|
||||
for (const versionDescriptor in devices) {
|
||||
const device = devices[versionDescriptor];
|
||||
let version = versionDescriptor;
|
||||
|
||||
if (/^com\.apple\.CoreSimulator\.SimRuntime\./g.test(version)) {
|
||||
// Transform "com.apple.CoreSimulator.SimRuntime.iOS-12-2" into "iOS 12.2"
|
||||
version = version.replace(/^com\.apple\.CoreSimulator\.SimRuntime\.([^-]+)-([^-]+)-([^-]+)$/g, '$1 $2.$3');
|
||||
} // Making sure the version of the simulator is an iOS or tvOS (Removes Apple Watch, etc)
|
||||
|
||||
|
||||
if (!version.includes('iOS') && !version.includes('tvOS')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (simulatorVersion && !version.endsWith(simulatorVersion)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const i in device) {
|
||||
const simulator = device[i]; // Skipping non-available simulator
|
||||
|
||||
if (simulator.availability !== '(available)' && // @ts-ignore verify isAvailable parameter
|
||||
simulator.isAvailable !== 'YES' && simulator.isAvailable !== true) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const booted = simulator.state === 'Booted';
|
||||
const simulatorDescriptor = {
|
||||
udid: simulator.udid,
|
||||
name: simulator.name,
|
||||
booted,
|
||||
version
|
||||
};
|
||||
|
||||
if (findOptions && findOptions.udid) {
|
||||
if (simulator.udid === findOptions.udid) {
|
||||
return simulatorDescriptor;
|
||||
}
|
||||
} else {
|
||||
if (booted && simulatorName === null) {
|
||||
return simulatorDescriptor;
|
||||
}
|
||||
|
||||
if (simulator.name === simulatorName && !match) {
|
||||
match = simulatorDescriptor;
|
||||
} // Keeps track of the first available simulator for use if we can't find one above.
|
||||
|
||||
|
||||
if (simulatorName === null && !match) {
|
||||
match = simulatorDescriptor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (match) {
|
||||
return match;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
var _default = findMatchingSimulator;
|
||||
exports.default = _default;
|
||||
|
||||
//# sourceMappingURL=findMatchingSimulator.js.map
|
56
node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/findXcodeProject.js
generated
vendored
Normal file
56
node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/findXcodeProject.js
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require("path"));
|
||||
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function findXcodeProject(files) {
|
||||
const sortedFiles = files.sort();
|
||||
|
||||
for (let i = sortedFiles.length - 1; i >= 0; i--) {
|
||||
const fileName = files[i];
|
||||
|
||||
const ext = _path().default.extname(fileName);
|
||||
|
||||
if (ext === '.xcworkspace') {
|
||||
return {
|
||||
name: fileName,
|
||||
isWorkspace: true
|
||||
};
|
||||
}
|
||||
|
||||
if (ext === '.xcodeproj') {
|
||||
return {
|
||||
name: fileName,
|
||||
isWorkspace: false
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
var _default = findXcodeProject;
|
||||
exports.default = _default;
|
||||
|
||||
//# sourceMappingURL=findXcodeProject.js.map
|
489
node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js
generated
vendored
Normal file
489
node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js
generated
vendored
Normal file
@ -0,0 +1,489 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _child_process() {
|
||||
const data = _interopRequireDefault(require("child_process"));
|
||||
|
||||
_child_process = 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 _chalk() {
|
||||
const data = _interopRequireDefault(require("chalk"));
|
||||
|
||||
_chalk = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _findXcodeProject = _interopRequireDefault(require("./findXcodeProject"));
|
||||
|
||||
var _parseIOSDevicesList = _interopRequireDefault(require("./parseIOSDevicesList"));
|
||||
|
||||
var _findMatchingSimulator = _interopRequireDefault(require("./findMatchingSimulator"));
|
||||
|
||||
var _warnAboutManuallyLinkedLibs = _interopRequireDefault(require("../../link/warnAboutManuallyLinkedLibs"));
|
||||
|
||||
var _warnAboutPodInstall = _interopRequireDefault(require("../../link/warnAboutPodInstall"));
|
||||
|
||||
function _cliTools() {
|
||||
const data = require("@react-native-community/cli-tools");
|
||||
|
||||
_cliTools = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _ora() {
|
||||
const data = _interopRequireDefault(require("ora"));
|
||||
|
||||
_ora = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function runIOS(_, ctx, args) {
|
||||
if (!_fs().default.existsSync(args.projectPath)) {
|
||||
throw new (_cliTools().CLIError)('iOS project folder not found. Are you sure this is a React Native project?');
|
||||
}
|
||||
|
||||
(0, _warnAboutManuallyLinkedLibs.default)(ctx);
|
||||
(0, _warnAboutPodInstall.default)(ctx);
|
||||
process.chdir(args.projectPath);
|
||||
const xcodeProject = (0, _findXcodeProject.default)(_fs().default.readdirSync('.'));
|
||||
|
||||
if (!xcodeProject) {
|
||||
throw new (_cliTools().CLIError)(`Could not find Xcode project files in "${args.projectPath}" folder`);
|
||||
}
|
||||
|
||||
const inferredSchemeName = _path().default.basename(xcodeProject.name, _path().default.extname(xcodeProject.name));
|
||||
|
||||
const scheme = args.scheme || inferredSchemeName;
|
||||
|
||||
_cliTools().logger.info(`Found Xcode ${xcodeProject.isWorkspace ? 'workspace' : 'project'} "${_chalk().default.bold(xcodeProject.name)}"`); // No need to load all available devices
|
||||
|
||||
|
||||
if (!args.device && !args.udid) {
|
||||
return runOnSimulator(xcodeProject, scheme, args);
|
||||
}
|
||||
|
||||
if (args.device && args.udid) {
|
||||
return _cliTools().logger.error('The `device` and `udid` options are mutually exclusive.');
|
||||
}
|
||||
|
||||
const devices = (0, _parseIOSDevicesList.default)(_child_process().default.execFileSync('xcrun', ['instruments', '-s'], {
|
||||
encoding: 'utf8'
|
||||
}));
|
||||
|
||||
if (args.udid) {
|
||||
const device = devices.find(d => d.udid === args.udid);
|
||||
|
||||
if (!device) {
|
||||
return _cliTools().logger.error(`Could not find a device with udid: "${_chalk().default.bold(args.udid)}". ${printFoundDevices(devices)}`);
|
||||
}
|
||||
|
||||
if (device.type === 'simulator') {
|
||||
return runOnSimulator(xcodeProject, scheme, args);
|
||||
} else {
|
||||
return runOnDevice(device, scheme, xcodeProject, args);
|
||||
}
|
||||
} else {
|
||||
const physicalDevices = devices.filter(d => d.type !== 'simulator');
|
||||
const device = matchingDevice(physicalDevices, args.device);
|
||||
|
||||
if (device) {
|
||||
return runOnDevice(device, scheme, xcodeProject, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function runOnSimulator(xcodeProject, scheme, args) {
|
||||
let simulators;
|
||||
|
||||
try {
|
||||
simulators = JSON.parse(_child_process().default.execFileSync('xcrun', ['simctl', 'list', '--json', 'devices'], {
|
||||
encoding: 'utf8'
|
||||
}));
|
||||
} catch (error) {
|
||||
throw new (_cliTools().CLIError)('Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues.', error);
|
||||
}
|
||||
/**
|
||||
* If provided simulator does not exist, try simulators in following order
|
||||
* - iPhone X
|
||||
* - iPhone 8
|
||||
*/
|
||||
|
||||
|
||||
const fallbackSimulators = ['iPhone X', 'iPhone 8'];
|
||||
const selectedSimulator = fallbackSimulators.reduce((simulator, fallback) => {
|
||||
return simulator || (0, _findMatchingSimulator.default)(simulators, {
|
||||
simulator: fallback
|
||||
});
|
||||
}, (0, _findMatchingSimulator.default)(simulators, args));
|
||||
|
||||
if (!selectedSimulator) {
|
||||
throw new (_cliTools().CLIError)(`No simulator available with ${args.simulator ? `name "${args.simulator}"` : `udid "${args.udid}"`}`);
|
||||
}
|
||||
/**
|
||||
* Booting simulator through `xcrun simctl boot` will boot it in the `headless` mode
|
||||
* (running in the background).
|
||||
*
|
||||
* In order for user to see the app and the simulator itself, we have to make sure
|
||||
* that the Simulator.app is running.
|
||||
*
|
||||
* We also pass it `-CurrentDeviceUDID` so that when we launch it for the first time,
|
||||
* it will not boot the "default" device, but the one we set. If the app is already running,
|
||||
* this flag has no effect.
|
||||
*/
|
||||
|
||||
|
||||
const activeDeveloperDir = _child_process().default.execFileSync('xcode-select', ['-p'], {
|
||||
encoding: 'utf8'
|
||||
}).trim();
|
||||
|
||||
_child_process().default.execFileSync('open', [`${activeDeveloperDir}/Applications/Simulator.app`, '--args', '-CurrentDeviceUDID', selectedSimulator.udid]);
|
||||
|
||||
if (!selectedSimulator.booted) {
|
||||
bootSimulator(selectedSimulator);
|
||||
}
|
||||
|
||||
const appName = await buildProject(xcodeProject, selectedSimulator.udid, scheme, args);
|
||||
const appPath = getBuildPath(xcodeProject, args.configuration, appName, false, scheme);
|
||||
|
||||
_cliTools().logger.info(`Installing "${_chalk().default.bold(appPath)}"`);
|
||||
|
||||
_child_process().default.spawnSync('xcrun', ['simctl', 'install', selectedSimulator.udid, appPath], {
|
||||
stdio: 'inherit'
|
||||
});
|
||||
|
||||
const bundleID = _child_process().default.execFileSync('/usr/libexec/PlistBuddy', ['-c', 'Print:CFBundleIdentifier', _path().default.join(appPath, 'Info.plist')], {
|
||||
encoding: 'utf8'
|
||||
}).trim();
|
||||
|
||||
_cliTools().logger.info(`Launching "${_chalk().default.bold(bundleID)}"`);
|
||||
|
||||
const result = _child_process().default.spawnSync('xcrun', ['simctl', 'launch', selectedSimulator.udid, bundleID]);
|
||||
|
||||
if (result.status === 0) {
|
||||
_cliTools().logger.success('Successfully launched the app on the simulator');
|
||||
} else {
|
||||
_cliTools().logger.error('Failed to launch the app on simulator', result.stderr);
|
||||
}
|
||||
}
|
||||
|
||||
async function runOnDevice(selectedDevice, scheme, xcodeProject, args) {
|
||||
const isIOSDeployInstalled = _child_process().default.spawnSync('ios-deploy', ['--version'], {
|
||||
encoding: 'utf8'
|
||||
});
|
||||
|
||||
if (isIOSDeployInstalled.error) {
|
||||
throw new (_cliTools().CLIError)(`Failed to install the app on the device because we couldn't execute the "ios-deploy" command. Please install it by running "${_chalk().default.bold('npm install -g ios-deploy')}" and try again.`);
|
||||
}
|
||||
|
||||
const appName = await buildProject(xcodeProject, selectedDevice.udid, scheme, args);
|
||||
const iosDeployInstallArgs = ['--bundle', getBuildPath(xcodeProject, args.configuration, appName, true, scheme), '--id', selectedDevice.udid, '--justlaunch'];
|
||||
|
||||
_cliTools().logger.info(`Installing and launching your app on ${selectedDevice.name}`);
|
||||
|
||||
const iosDeployOutput = _child_process().default.spawnSync('ios-deploy', iosDeployInstallArgs, {
|
||||
encoding: 'utf8'
|
||||
});
|
||||
|
||||
if (iosDeployOutput.error) {
|
||||
throw new (_cliTools().CLIError)(`Failed to install the app on the device. We've encountered an error in "ios-deploy" command: ${iosDeployOutput.error.message}`);
|
||||
}
|
||||
|
||||
return _cliTools().logger.success('Installed the app on the device.');
|
||||
}
|
||||
|
||||
function buildProject(xcodeProject, udid, scheme, args) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const xcodebuildArgs = [xcodeProject.isWorkspace ? '-workspace' : '-project', xcodeProject.name, '-configuration', args.configuration, '-scheme', scheme, '-destination', `id=${udid}`];
|
||||
const loader = (0, _ora().default)();
|
||||
|
||||
_cliTools().logger.info(`Building ${_chalk().default.dim(`(using "xcodebuild ${xcodebuildArgs.join(' ')}")`)}`);
|
||||
|
||||
let xcpretty;
|
||||
|
||||
if (!args.verbose) {
|
||||
xcpretty = xcprettyAvailable() && _child_process().default.spawn('xcpretty', [], {
|
||||
stdio: ['pipe', process.stdout, process.stderr]
|
||||
});
|
||||
}
|
||||
|
||||
const buildProcess = _child_process().default.spawn('xcodebuild', xcodebuildArgs, getProcessOptions(args));
|
||||
|
||||
let buildOutput = '';
|
||||
let errorOutput = '';
|
||||
buildProcess.stdout.on('data', data => {
|
||||
const stringData = data.toString();
|
||||
buildOutput += stringData;
|
||||
|
||||
if (xcpretty) {
|
||||
xcpretty.stdin.write(data);
|
||||
} else {
|
||||
if (_cliTools().logger.isVerbose()) {
|
||||
_cliTools().logger.debug(stringData);
|
||||
} else {
|
||||
loader.start(`Building the app${'.'.repeat(buildOutput.length % 10)}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
buildProcess.stderr.on('data', data => {
|
||||
errorOutput += data;
|
||||
});
|
||||
buildProcess.on('close', code => {
|
||||
if (xcpretty) {
|
||||
xcpretty.stdin.end();
|
||||
} else {
|
||||
loader.stop();
|
||||
}
|
||||
|
||||
if (code !== 0) {
|
||||
reject(new (_cliTools().CLIError)(`
|
||||
Failed to build iOS project.
|
||||
|
||||
We ran "xcodebuild" command but it exited with error code ${code}. To debug build
|
||||
logs further, consider building your app with Xcode.app, by opening
|
||||
${xcodeProject.name}.
|
||||
`, buildOutput + '\n' + errorOutput));
|
||||
return;
|
||||
}
|
||||
|
||||
_cliTools().logger.success('Successfully built the app');
|
||||
|
||||
resolve(getProductName(buildOutput) || scheme);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function bootSimulator(selectedSimulator) {
|
||||
const simulatorFullName = formattedDeviceName(selectedSimulator);
|
||||
|
||||
_cliTools().logger.info(`Launching ${simulatorFullName}`);
|
||||
|
||||
try {
|
||||
_child_process().default.spawnSync('xcrun', ['instruments', '-w', selectedSimulator.udid]);
|
||||
} catch (_ignored) {// instruments always fail with 255 because it expects more arguments,
|
||||
// but we want it to only launch the simulator
|
||||
}
|
||||
}
|
||||
|
||||
function getTargetPaths(buildSettings) {
|
||||
const settings = JSON.parse(buildSettings); // Find app in all building settings - look for WRAPPER_EXTENSION: 'app',
|
||||
|
||||
for (const i in settings) {
|
||||
const wrapperExtension = settings[i].buildSettings.WRAPPER_EXTENSION;
|
||||
|
||||
if (wrapperExtension === 'app') {
|
||||
return {
|
||||
targetBuildDir: settings[i].buildSettings.TARGET_BUILD_DIR,
|
||||
executableFolderPath: settings[i].buildSettings.EXECUTABLE_FOLDER_PATH
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
function getBuildPath(xcodeProject, configuration, appName, isDevice, scheme) {
|
||||
let device;
|
||||
|
||||
if (isDevice) {
|
||||
device = 'iphoneos';
|
||||
} else if (appName.toLowerCase().includes('tvos')) {
|
||||
device = 'appletvsimulator';
|
||||
} else {
|
||||
device = 'iphonesimulator';
|
||||
}
|
||||
|
||||
const buildSettings = _child_process().default.execFileSync('xcodebuild', [xcodeProject.isWorkspace ? '-workspace' : '-project', xcodeProject.name, '-scheme', scheme, '-sdk', device, '-configuration', configuration, '-showBuildSettings', '-json'], {
|
||||
encoding: 'utf8'
|
||||
});
|
||||
|
||||
const {
|
||||
targetBuildDir,
|
||||
executableFolderPath
|
||||
} = getTargetPaths(buildSettings);
|
||||
|
||||
if (!targetBuildDir) {
|
||||
throw new (_cliTools().CLIError)('Failed to get the target build directory.');
|
||||
}
|
||||
|
||||
if (!executableFolderPath) {
|
||||
throw new (_cliTools().CLIError)('Failed to get the app name.');
|
||||
}
|
||||
|
||||
return `${targetBuildDir}/${executableFolderPath}`;
|
||||
}
|
||||
|
||||
function getProductName(buildOutput) {
|
||||
const productNameMatch = /export FULL_PRODUCT_NAME="?(.+).app"?$/m.exec(buildOutput);
|
||||
return productNameMatch ? productNameMatch[1] : null;
|
||||
}
|
||||
|
||||
function xcprettyAvailable() {
|
||||
try {
|
||||
_child_process().default.execSync('xcpretty --version', {
|
||||
stdio: [0, 'pipe', 'ignore']
|
||||
});
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function matchingDevice(devices, deviceName) {
|
||||
if (deviceName === true) {
|
||||
const firstIOSDevice = devices.find(d => d.type === 'device');
|
||||
|
||||
if (firstIOSDevice) {
|
||||
_cliTools().logger.info(`Using first available device named "${_chalk().default.bold(firstIOSDevice.name)}" due to lack of name supplied.`);
|
||||
|
||||
return firstIOSDevice;
|
||||
} else {
|
||||
_cliTools().logger.error('No iOS devices connected.');
|
||||
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
function formattedDeviceName(simulator) {
|
||||
return simulator.version ? `${simulator.name} (${simulator.version})` : simulator.name;
|
||||
}
|
||||
|
||||
function printFoundDevices(devices) {
|
||||
return ['Available devices:', ...devices.map(device => ` - ${device.name} (${device.udid})`)].join('\n');
|
||||
}
|
||||
|
||||
function getProcessOptions({
|
||||
packager,
|
||||
terminal,
|
||||
port
|
||||
}) {
|
||||
if (packager) {
|
||||
return {
|
||||
env: { ...process.env,
|
||||
RCT_TERMINAL: terminal,
|
||||
RCT_METRO_PORT: port.toString()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
env: { ...process.env,
|
||||
RCT_TERMINAL: terminal,
|
||||
RCT_NO_LAUNCH_PACKAGER: 'true'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var _default = {
|
||||
name: 'run-ios',
|
||||
description: 'builds your app and starts it on iOS simulator',
|
||||
func: runIOS,
|
||||
examples: [{
|
||||
desc: 'Run on a different simulator, e.g. iPhone SE',
|
||||
cmd: 'react-native run-ios --simulator "iPhone SE"'
|
||||
}, {
|
||||
desc: 'Pass a non-standard location of iOS directory',
|
||||
cmd: 'react-native run-ios --project-path "./app/ios"'
|
||||
}, {
|
||||
desc: "Run on a connected device, e.g. Max's iPhone",
|
||||
cmd: 'react-native run-ios --device "Max\'s iPhone"'
|
||||
}, {
|
||||
desc: 'Run on the AppleTV simulator',
|
||||
cmd: 'react-native run-ios --simulator "Apple TV" --scheme "helloworld-tvOS"'
|
||||
}],
|
||||
options: [{
|
||||
name: '--simulator [string]',
|
||||
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 11'
|
||||
}, {
|
||||
name: '--configuration [string]',
|
||||
description: 'Explicitly set the scheme configuration to use',
|
||||
default: 'Debug'
|
||||
}, {
|
||||
name: '--scheme [string]',
|
||||
description: 'Explicitly set Xcode scheme to use'
|
||||
}, {
|
||||
name: '--project-path [string]',
|
||||
description: 'Path relative to project root where the Xcode project ' + '(.xcodeproj) lives.',
|
||||
default: 'ios'
|
||||
}, {
|
||||
name: '--device [string]',
|
||||
description: 'Explicitly set device to use by name. The value is not required if you have a single device connected.'
|
||||
}, {
|
||||
name: '--udid [string]',
|
||||
description: 'Explicitly set device to use by udid'
|
||||
}, {
|
||||
name: '--no-packager',
|
||||
description: 'Do not launch packager while building'
|
||||
}, {
|
||||
name: '--verbose',
|
||||
description: 'Do not use xcpretty even if installed'
|
||||
}, {
|
||||
name: '--port [number]',
|
||||
default: process.env.RCT_METRO_PORT || 8081,
|
||||
parse: val => Number(val)
|
||||
}, {
|
||||
name: '--terminal [string]',
|
||||
description: 'Launches the Metro Bundler in a new window using the specified terminal path.',
|
||||
default: _cliTools().getDefaultUserTerminal
|
||||
}]
|
||||
};
|
||||
exports.default = _default;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
58
node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/parseIOSDevicesList.js
generated
vendored
Normal file
58
node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/parseIOSDevicesList.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Parses the output of the `xcrun instruments -s` command and returns metadata
|
||||
* about available iOS simulators and physical devices, as well as host Mac for
|
||||
* Catalyst purposes.
|
||||
*
|
||||
* Expected text looks roughly like this:
|
||||
*
|
||||
* ```
|
||||
* Known Devices:
|
||||
* this-mac-device [UDID]
|
||||
* A Physical Device (OS Version) [UDID]
|
||||
* A Simulator Device (OS Version) [UDID] (Simulator)
|
||||
* ```
|
||||
*/
|
||||
function parseIOSDevicesList(text) {
|
||||
const devices = [];
|
||||
text.split('\n').forEach(line => {
|
||||
const device = line.match(/(.*?) (\(([0-9\.]+)\) )?\[([0-9A-F-]+)\]( \(Simulator\))?/i);
|
||||
|
||||
if (device) {
|
||||
const [, name,, version, udid, isSimulator] = device;
|
||||
const metadata = {
|
||||
name,
|
||||
udid
|
||||
};
|
||||
|
||||
if (version) {
|
||||
metadata.version = version;
|
||||
metadata.type = isSimulator ? 'simulator' : 'device';
|
||||
} else {
|
||||
metadata.type = 'catalyst';
|
||||
}
|
||||
|
||||
devices.push(metadata);
|
||||
}
|
||||
});
|
||||
return devices;
|
||||
}
|
||||
|
||||
var _default = parseIOSDevicesList;
|
||||
exports.default = _default;
|
||||
|
||||
//# sourceMappingURL=parseIOSDevicesList.js.map
|
45
node_modules/@react-native-community/cli-platform-ios/build/config/findPodfilePath.js
generated
vendored
Normal file
45
node_modules/@react-native-community/cli-platform-ios/build/config/findPodfilePath.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = findPodfilePath;
|
||||
|
||||
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function findPodfilePath(projectFolder) {
|
||||
const podFilePath = _path().default.join(projectFolder, '..', 'Podfile');
|
||||
|
||||
const podFileExists = _fs().default.existsSync(podFilePath);
|
||||
|
||||
return podFileExists ? podFilePath : null;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=findPodfilePath.js.map
|
44
node_modules/@react-native-community/cli-platform-ios/build/config/findPodspec.js
generated
vendored
Normal file
44
node_modules/@react-native-community/cli-platform-ios/build/config/findPodspec.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = findPodspec;
|
||||
|
||||
function _glob() {
|
||||
const data = _interopRequireDefault(require("glob"));
|
||||
|
||||
_glob = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require("path"));
|
||||
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function findPodspec(folder) {
|
||||
const podspecs = _glob().default.sync('*.podspec', {
|
||||
cwd: folder
|
||||
});
|
||||
|
||||
if (podspecs.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const packagePodspec = _path().default.basename(folder) + '.podspec';
|
||||
const podspecFile = podspecs.includes(packagePodspec) ? packagePodspec : podspecs[0];
|
||||
return _path().default.join(folder, podspecFile);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=findPodspec.js.map
|
79
node_modules/@react-native-community/cli-platform-ios/build/config/findProject.js
generated
vendored
Normal file
79
node_modules/@react-native-community/cli-platform-ios/build/config/findProject.js
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = findProject;
|
||||
|
||||
function _glob() {
|
||||
const data = _interopRequireDefault(require("glob"));
|
||||
|
||||
_glob = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require("path"));
|
||||
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Glob pattern to look for xcodeproj
|
||||
*/
|
||||
const GLOB_PATTERN = '**/*.xcodeproj';
|
||||
/**
|
||||
* Regexp matching all test projects
|
||||
*/
|
||||
|
||||
const TEST_PROJECTS = /test|example|sample/i;
|
||||
/**
|
||||
* Base iOS folder
|
||||
*/
|
||||
|
||||
const IOS_BASE = 'ios';
|
||||
/**
|
||||
* These folders will be excluded from search to speed it up
|
||||
*/
|
||||
|
||||
const GLOB_EXCLUDE_PATTERN = ['**/@(Pods|node_modules|Carthage)/**'];
|
||||
/**
|
||||
* Finds iOS project by looking for all .xcodeproj files
|
||||
* in given folder.
|
||||
*
|
||||
* Returns first match if files are found or null
|
||||
*
|
||||
* Note: `./ios/*.xcodeproj` are returned regardless of the name
|
||||
*/
|
||||
|
||||
function findProject(folder) {
|
||||
const projects = _glob().default.sync(GLOB_PATTERN, {
|
||||
cwd: folder,
|
||||
ignore: GLOB_EXCLUDE_PATTERN
|
||||
}).filter(project => _path().default.dirname(project) === IOS_BASE || !TEST_PROJECTS.test(project)).sort(project => _path().default.dirname(project) === IOS_BASE ? -1 : 1);
|
||||
|
||||
if (projects.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return projects[0];
|
||||
}
|
||||
|
||||
//# sourceMappingURL=findProject.js.map
|
31
node_modules/@react-native-community/cli-platform-ios/build/config/getPodspecName.js
generated
vendored
Normal file
31
node_modules/@react-native-community/cli-platform-ios/build/config/getPodspecName.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getPodspecName;
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require("path"));
|
||||
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function getPodspecName(podspecFile) {
|
||||
return _path().default.basename(podspecFile).replace(/\.podspec$/, '');
|
||||
}
|
||||
|
||||
//# sourceMappingURL=getPodspecName.js.map
|
101
node_modules/@react-native-community/cli-platform-ios/build/config/index.js
generated
vendored
Normal file
101
node_modules/@react-native-community/cli-platform-ios/build/config/index.js
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.projectConfig = projectConfig;
|
||||
exports.dependencyConfig = void 0;
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require("path"));
|
||||
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _lodash() {
|
||||
const data = require("lodash");
|
||||
|
||||
_lodash = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _findProject = _interopRequireDefault(require("./findProject"));
|
||||
|
||||
var _findPodfilePath = _interopRequireDefault(require("./findPodfilePath"));
|
||||
|
||||
var _findPodspec = _interopRequireDefault(require("./findPodspec"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
const memoizedFindProject = (0, _lodash().memoize)(_findProject.default);
|
||||
/**
|
||||
* For libraries specified without an extension, add '.tbd' for those that
|
||||
* start with 'lib' and '.framework' to the rest.
|
||||
*/
|
||||
|
||||
const mapSharedLibaries = libraries => libraries.map(name => {
|
||||
if (_path().default.extname(name)) {
|
||||
return name;
|
||||
}
|
||||
|
||||
return name + (name.indexOf('lib') === 0 ? '.tbd' : '.framework');
|
||||
});
|
||||
/**
|
||||
* Returns project config by analyzing given folder and applying some user defaults
|
||||
* when constructing final object
|
||||
*/
|
||||
|
||||
|
||||
function projectConfig(folder, userConfig) {
|
||||
if (!userConfig) {
|
||||
return;
|
||||
}
|
||||
|
||||
const project = userConfig.project || memoizedFindProject(folder);
|
||||
/**
|
||||
* No iOS config found here
|
||||
*/
|
||||
|
||||
if (!project) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const projectPath = _path().default.join(folder, project);
|
||||
|
||||
const sourceDir = _path().default.dirname(projectPath);
|
||||
|
||||
return {
|
||||
sourceDir,
|
||||
folder,
|
||||
pbxprojPath: _path().default.join(projectPath, 'project.pbxproj'),
|
||||
podfile: (0, _findPodfilePath.default)(projectPath),
|
||||
podspecPath: userConfig.podspecPath || // podspecs are usually placed in the root dir of the library or in the
|
||||
// iOS project path
|
||||
(0, _findPodspec.default)(folder) || (0, _findPodspec.default)(sourceDir),
|
||||
projectPath,
|
||||
projectName: _path().default.basename(projectPath),
|
||||
libraryFolder: userConfig.libraryFolder || 'Libraries',
|
||||
sharedLibraries: mapSharedLibaries(userConfig.sharedLibraries || []),
|
||||
plist: userConfig.plist || [],
|
||||
scriptPhases: userConfig.scriptPhases || []
|
||||
};
|
||||
}
|
||||
|
||||
const dependencyConfig = projectConfig;
|
||||
exports.dependencyConfig = dependencyConfig;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
39
node_modules/@react-native-community/cli-platform-ios/build/index.js
generated
vendored
Normal file
39
node_modules/@react-native-community/cli-platform-ios/build/index.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "linkConfig", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _link.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "commands", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _commands.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "projectConfig", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _config.projectConfig;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "dependencyConfig", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _config.dependencyConfig;
|
||||
}
|
||||
});
|
||||
|
||||
var _link = _interopRequireDefault(require("./link"));
|
||||
|
||||
var _commands = _interopRequireDefault(require("./commands"));
|
||||
|
||||
var _config = require("./config");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
63
node_modules/@react-native-community/cli-platform-ios/build/link-pods/addPodEntry.js
generated
vendored
Normal file
63
node_modules/@react-native-community/cli-platform-ios/build/link-pods/addPodEntry.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = addPodEntry;
|
||||
|
||||
function _cliTools() {
|
||||
const data = require("@react-native-community/cli-tools");
|
||||
|
||||
_cliTools = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _getPodspecName = _interopRequireDefault(require("../config/getPodspecName"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function addPodEntry(podLines, linesToAddEntry, podspecPath, nodeModulePath) {
|
||||
const podName = (0, _getPodspecName.default)(podspecPath);
|
||||
const newEntry = `pod '${podName}', :path => '../node_modules/${nodeModulePath}'\n`;
|
||||
|
||||
if (!linesToAddEntry) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Array.isArray(linesToAddEntry)) {
|
||||
linesToAddEntry.map(({
|
||||
line,
|
||||
indentation
|
||||
}, idx) => {
|
||||
_cliTools().logger.debug(`Adding ${podName} to Pod file"`);
|
||||
|
||||
podLines.splice(line + idx, 0, getLineToAdd(newEntry, indentation));
|
||||
});
|
||||
} else {
|
||||
const {
|
||||
line,
|
||||
indentation
|
||||
} = linesToAddEntry;
|
||||
|
||||
_cliTools().logger.debug(`Adding ${podName} to Pod file"`);
|
||||
|
||||
podLines.splice(line, 0, getLineToAdd(newEntry, indentation));
|
||||
}
|
||||
}
|
||||
|
||||
function getLineToAdd(newEntry, indentation) {
|
||||
const spaces = Array(indentation + 1).join(' ');
|
||||
return spaces + newEntry;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=addPodEntry.js.map
|
39
node_modules/@react-native-community/cli-platform-ios/build/link-pods/findLineToAddPod.js
generated
vendored
Normal file
39
node_modules/@react-native-community/cli-platform-ios/build/link-pods/findLineToAddPod.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = findLineToAddPod;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function findLineToAddPod(podLines, firstTargetLine) {
|
||||
// match line with new target: target 'project_name' do (most likely target inside podfile main target)
|
||||
const nextTarget = /target ('|")\w+('|") do/g; // match line that has only 'end' (if we don't catch new target or function, this would mean this is end of current target)
|
||||
|
||||
const endOfCurrentTarget = /^\s*end\s*$/g; // match function definition, like: post_install do |installer| (some Podfiles have function defined inside main target
|
||||
|
||||
const functionDefinition = /^\s*[a-z_]+\s+do(\s+\|[a-z]+\|)?/g;
|
||||
|
||||
for (let i = firstTargetLine; i < podLines.length - 1; i++) {
|
||||
const matchNextConstruct = podLines[i].match(nextTarget) || podLines[i].match(functionDefinition);
|
||||
const matchEnd = podLines[i].match(endOfCurrentTarget);
|
||||
|
||||
if (matchNextConstruct || matchEnd) {
|
||||
const firstNonSpaceCharacter = podLines[i].search(/\S/);
|
||||
return {
|
||||
indentation: firstNonSpaceCharacter + (matchEnd ? 2 : 0),
|
||||
line: i
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=findLineToAddPod.js.map
|
34
node_modules/@react-native-community/cli-platform-ios/build/link-pods/findMarkedLinesInPodfile.js
generated
vendored
Normal file
34
node_modules/@react-native-community/cli-platform-ios/build/link-pods/findMarkedLinesInPodfile.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = findMarkedLinesInPodfile;
|
||||
exports.MARKER_TEXT = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
const MARKER_TEXT = '# Add new pods below this line';
|
||||
exports.MARKER_TEXT = MARKER_TEXT;
|
||||
|
||||
function findMarkedLinesInPodfile(podLines) {
|
||||
const result = [];
|
||||
|
||||
for (let i = 0, len = podLines.length; i < len; i++) {
|
||||
if (podLines[i].includes(MARKER_TEXT)) {
|
||||
result.push({
|
||||
line: i + 1,
|
||||
indentation: podLines[i].indexOf('#')
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=findMarkedLinesInPodfile.js.map
|
31
node_modules/@react-native-community/cli-platform-ios/build/link-pods/findPodTargetLine.js
generated
vendored
Normal file
31
node_modules/@react-native-community/cli-platform-ios/build/link-pods/findPodTargetLine.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = findPodTargetLine;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function findPodTargetLine(podLines, projectName) {
|
||||
const targetName = projectName.replace('.xcodeproj', ''); // match first target definition in file: target 'target_name' do
|
||||
|
||||
const targetRegex = new RegExp(`target ('|")${targetName}('|") do`, 'g');
|
||||
|
||||
for (let i = 0, len = podLines.length; i < len; i++) {
|
||||
const match = podLines[i].match(targetRegex);
|
||||
|
||||
if (match) {
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=findPodTargetLine.js.map
|
72
node_modules/@react-native-community/cli-platform-ios/build/link-pods/getDependenciesFromPodfileLock.js
generated
vendored
Normal file
72
node_modules/@react-native-community/cli-platform-ios/build/link-pods/getDependenciesFromPodfileLock.js
generated
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getDependenciesFromPodfileLock;
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require("fs"));
|
||||
|
||||
_fs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
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 _jsYaml() {
|
||||
const data = require("js-yaml");
|
||||
|
||||
_jsYaml = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const CHECKSUM_KEY = 'SPEC CHECKSUMS';
|
||||
|
||||
function getDependenciesFromPodfileLock(podfileLockPath) {
|
||||
_cliTools().logger.debug(`Reading ${podfileLockPath}`);
|
||||
|
||||
let fileContent;
|
||||
|
||||
try {
|
||||
fileContent = _fs().default.readFileSync(podfileLockPath, 'utf8');
|
||||
} catch (err) {
|
||||
_cliTools().logger.error(`Could not find "Podfile.lock" at ${_chalk().default.dim(podfileLockPath)}. Did you run "${_chalk().default.bold('pod install')}" in iOS directory?`);
|
||||
|
||||
return [];
|
||||
} // Previous portions of the lock file could be invalid yaml.
|
||||
// Only parse parts that are valid
|
||||
|
||||
|
||||
const tail = fileContent.split(CHECKSUM_KEY).slice(1);
|
||||
const checksumTail = CHECKSUM_KEY + tail;
|
||||
return Object.keys((0, _jsYaml().safeLoad)(checksumTail)[CHECKSUM_KEY] || {});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=getDependenciesFromPodfileLock.js.map
|
41
node_modules/@react-native-community/cli-platform-ios/build/link-pods/isInstalled.js
generated
vendored
Normal file
41
node_modules/@react-native-community/cli-platform-ios/build/link-pods/isInstalled.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isInstalled;
|
||||
|
||||
var _readPodfile = _interopRequireDefault(require("./readPodfile"));
|
||||
|
||||
var _getPodspecName = _interopRequireDefault(require("../config/getPodspecName"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function isInstalled(iOSProject, dependencyConfig) {
|
||||
if (!iOSProject.podfile || !dependencyConfig.podspecPath) {
|
||||
return false;
|
||||
} // match line with pod declaration: pod 'dependencyPodName' (other possible parameters of pod are ignored)
|
||||
|
||||
|
||||
const dependencyRegExp = new RegExp(`pod\\s+('|")${(0, _getPodspecName.default)(dependencyConfig.podspecPath)}('|")`, 'g');
|
||||
const podLines = (0, _readPodfile.default)(iOSProject.podfile);
|
||||
|
||||
for (let i = 0, len = podLines.length; i < len; i++) {
|
||||
const match = podLines[i].match(dependencyRegExp);
|
||||
|
||||
if (match) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=isInstalled.js.map
|
45
node_modules/@react-native-community/cli-platform-ios/build/link-pods/readPodfile.js
generated
vendored
Normal file
45
node_modules/@react-native-community/cli-platform-ios/build/link-pods/readPodfile.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = readPodfile;
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require("fs"));
|
||||
|
||||
_fs = 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 }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function readPodfile(podfilePath) {
|
||||
_cliTools().logger.debug(`Reading ${podfilePath}`);
|
||||
|
||||
const podContent = _fs().default.readFileSync(podfilePath, 'utf8');
|
||||
|
||||
return podContent.split(/\r?\n/g);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=readPodfile.js.map
|
85
node_modules/@react-native-community/cli-platform-ios/build/link-pods/registerNativeModule.js
generated
vendored
Normal file
85
node_modules/@react-native-community/cli-platform-ios/build/link-pods/registerNativeModule.js
generated
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = registerNativeModulePods;
|
||||
|
||||
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 _readPodfile = _interopRequireDefault(require("./readPodfile"));
|
||||
|
||||
var _findPodTargetLine = _interopRequireDefault(require("./findPodTargetLine"));
|
||||
|
||||
var _findLineToAddPod = _interopRequireDefault(require("./findLineToAddPod"));
|
||||
|
||||
var _findMarkedLinesInPodfile = _interopRequireWildcard(require("./findMarkedLinesInPodfile"));
|
||||
|
||||
var _addPodEntry = _interopRequireDefault(require("./addPodEntry"));
|
||||
|
||||
var _savePodFile = _interopRequireDefault(require("./savePodFile"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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 }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function registerNativeModulePods(name, podspecPath, iOSProject) {
|
||||
const podLines = (0, _readPodfile.default)(iOSProject.podfile);
|
||||
const linesToAddEntry = getLinesToAddEntry(podLines, iOSProject);
|
||||
(0, _addPodEntry.default)(podLines, linesToAddEntry, podspecPath, name);
|
||||
(0, _savePodFile.default)(iOSProject.podfile, podLines);
|
||||
}
|
||||
|
||||
function getLinesToAddEntry(podLines, {
|
||||
projectName
|
||||
}) {
|
||||
const linesToAddPodWithMarker = (0, _findMarkedLinesInPodfile.default)(podLines);
|
||||
|
||||
if (linesToAddPodWithMarker.length > 0) {
|
||||
return linesToAddPodWithMarker;
|
||||
}
|
||||
|
||||
const firstTargetLined = (0, _findPodTargetLine.default)(podLines, projectName);
|
||||
|
||||
if (firstTargetLined === null) {
|
||||
throw new (_cliTools().CLIError)(`
|
||||
We couldn't find a target to add a CocoaPods dependency.
|
||||
|
||||
Make sure that you have a "${_chalk().default.dim(`target '${projectName.replace('.xcodeproj', '')}' do`)}" line in your Podfile.
|
||||
|
||||
Alternatively, include "${_chalk().default.dim(_findMarkedLinesInPodfile.MARKER_TEXT)}" in a Podfile where we should add
|
||||
linked dependencies.
|
||||
`);
|
||||
}
|
||||
|
||||
return (0, _findLineToAddPod.default)(podLines, firstTargetLined);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=registerNativeModule.js.map
|
39
node_modules/@react-native-community/cli-platform-ios/build/link-pods/removePodEntry.js
generated
vendored
Normal file
39
node_modules/@react-native-community/cli-platform-ios/build/link-pods/removePodEntry.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removePodEntry;
|
||||
|
||||
function _cliTools() {
|
||||
const data = require("@react-native-community/cli-tools");
|
||||
|
||||
_cliTools = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _getPodspecName = _interopRequireDefault(require("../config/getPodspecName"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function removePodEntry(podfileContent, podspecPath) {
|
||||
const podName = (0, _getPodspecName.default)(podspecPath); // this regex should catch line(s) with full pod definition, like: pod 'podname', :path => '../node_modules/podname', :subspecs => ['Sub2', 'Sub1']
|
||||
|
||||
const podRegex = new RegExp(`\\n( |\\t)*pod\\s+("|')${podName}("|')(,\\s*(:[a-z]+\\s*=>)?\\s*(("|').*?("|')|\\[[\\s\\S]*?\\]))*\\n`, 'g');
|
||||
|
||||
_cliTools().logger.debug(`Removing ${podName} from Pod file`);
|
||||
|
||||
return podfileContent.replace(podRegex, '\n');
|
||||
}
|
||||
|
||||
//# sourceMappingURL=removePodEntry.js.map
|
45
node_modules/@react-native-community/cli-platform-ios/build/link-pods/savePodFile.js
generated
vendored
Normal file
45
node_modules/@react-native-community/cli-platform-ios/build/link-pods/savePodFile.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = savePodFile;
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require("fs"));
|
||||
|
||||
_fs = 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 }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function savePodFile(podfilePath, podLines) {
|
||||
const newPodfile = podLines.join('\n');
|
||||
|
||||
_cliTools().logger.debug(`Writing changes to ${podfilePath}`);
|
||||
|
||||
_fs().default.writeFileSync(podfilePath, newPodfile);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=savePodFile.js.map
|
53
node_modules/@react-native-community/cli-platform-ios/build/link-pods/unregisterNativeModule.js
generated
vendored
Normal file
53
node_modules/@react-native-community/cli-platform-ios/build/link-pods/unregisterNativeModule.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = unregisterNativeModule;
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require("fs"));
|
||||
|
||||
_fs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _removePodEntry = _interopRequireDefault(require("./removePodEntry"));
|
||||
|
||||
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 }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Unregister native module IOS with CocoaPods
|
||||
*/
|
||||
function unregisterNativeModule(dependencyConfig, iOSProject) {
|
||||
const podContent = _fs().default.readFileSync(iOSProject.podfile, 'utf8');
|
||||
|
||||
const removed = (0, _removePodEntry.default)(podContent, dependencyConfig.podspecPath);
|
||||
|
||||
_cliTools().logger.debug(`Writing changes to ${iOSProject.podfile}`);
|
||||
|
||||
_fs().default.writeFileSync(iOSProject.podfile, removed);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=unregisterNativeModule.js.map
|
41
node_modules/@react-native-community/cli-platform-ios/build/link/addFileToProject.js
generated
vendored
Normal file
41
node_modules/@react-native-community/cli-platform-ios/build/link/addFileToProject.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = addFileToProject;
|
||||
|
||||
function _pbxFile() {
|
||||
const data = _interopRequireDefault(require("xcode/lib/pbxFile"));
|
||||
|
||||
_pbxFile = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given xcodeproj and filePath, it creates new file
|
||||
* from path provided, adds it to the project
|
||||
* and returns newly created instance of a file
|
||||
*/
|
||||
function addFileToProject(project, filePath) {
|
||||
const file = new (_pbxFile().default)(filePath);
|
||||
file.uuid = project.generateUuid();
|
||||
file.fileRef = project.generateUuid();
|
||||
project.addToPbxFileReferenceSection(file);
|
||||
return file;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=addFileToProject.js.map
|
30
node_modules/@react-native-community/cli-platform-ios/build/link/addProjectToLibraries.js
generated
vendored
Normal file
30
node_modules/@react-native-community/cli-platform-ios/build/link/addProjectToLibraries.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = addProjectToLibraries;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given an array of xcodeproj libraries and pbxFile,
|
||||
* it appends it to that group
|
||||
*
|
||||
* Important: That function mutates `libraries` and it's not pure.
|
||||
* It's mainly due to limitations of `xcode` library.
|
||||
*/
|
||||
function addProjectToLibraries(libraries, file) {
|
||||
return libraries.children.push({
|
||||
value: file.fileRef,
|
||||
comment: file.basename
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=addProjectToLibraries.js.map
|
35
node_modules/@react-native-community/cli-platform-ios/build/link/addSharedLibraries.js
generated
vendored
Normal file
35
node_modules/@react-native-community/cli-platform-ios/build/link/addSharedLibraries.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = addSharedLibraries;
|
||||
|
||||
var _createGroupWithMessage = _interopRequireDefault(require("./createGroupWithMessage"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function addSharedLibraries(project, libraries) {
|
||||
if (!libraries.length) {
|
||||
return;
|
||||
} // Create a Frameworks group if necessary.
|
||||
|
||||
|
||||
(0, _createGroupWithMessage.default)(project, 'Frameworks');
|
||||
const target = project.getFirstTarget().uuid;
|
||||
|
||||
for (const name of libraries) {
|
||||
project.addFramework(name, {
|
||||
target
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=addSharedLibraries.js.map
|
35
node_modules/@react-native-community/cli-platform-ios/build/link/addToHeaderSearchPaths.js
generated
vendored
Normal file
35
node_modules/@react-native-community/cli-platform-ios/build/link/addToHeaderSearchPaths.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = addToHeaderSearchPaths;
|
||||
|
||||
var _mapHeaderSearchPaths = _interopRequireDefault(require("./mapHeaderSearchPaths"));
|
||||
|
||||
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 }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function addToHeaderSearchPaths(project, path) {
|
||||
_cliTools().logger.debug(`Adding ${path} to header search paths`);
|
||||
|
||||
(0, _mapHeaderSearchPaths.default)(project, searchPaths => searchPaths.concat(path));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=addToHeaderSearchPaths.js.map
|
26
node_modules/@react-native-community/cli-platform-ios/build/link/common/isInstalled.js
generated
vendored
Normal file
26
node_modules/@react-native-community/cli-platform-ios/build/link/common/isInstalled.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isInstalled;
|
||||
|
||||
var _isInstalled = _interopRequireDefault(require("../isInstalled"));
|
||||
|
||||
var _isInstalled2 = _interopRequireDefault(require("../../link-pods/isInstalled"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function isInstalled(projectConfig, // FIXME: name is never used
|
||||
_name, dependencyConfig) {
|
||||
return (0, _isInstalled.default)(projectConfig, dependencyConfig) || (0, _isInstalled2.default)(projectConfig, dependencyConfig);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=isInstalled.js.map
|
30
node_modules/@react-native-community/cli-platform-ios/build/link/common/registerNativeModule.js
generated
vendored
Normal file
30
node_modules/@react-native-community/cli-platform-ios/build/link/common/registerNativeModule.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = registerNativeModule;
|
||||
|
||||
var _registerNativeModule = _interopRequireDefault(require("../registerNativeModule"));
|
||||
|
||||
var _registerNativeModule2 = _interopRequireDefault(require("../../link-pods/registerNativeModule"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function registerNativeModule(name, dependencyConfig, // FIXME: Params is never used
|
||||
_params, projectConfig) {
|
||||
if (projectConfig.podfile && dependencyConfig.podspecPath) {
|
||||
(0, _registerNativeModule2.default)(name, dependencyConfig.podspecPath, projectConfig);
|
||||
} else {
|
||||
(0, _registerNativeModule.default)(dependencyConfig, projectConfig);
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=registerNativeModule.js.map
|
48
node_modules/@react-native-community/cli-platform-ios/build/link/common/unregisterNativeModule.js
generated
vendored
Normal file
48
node_modules/@react-native-community/cli-platform-ios/build/link/common/unregisterNativeModule.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = unregisterNativeModule;
|
||||
|
||||
function _lodash() {
|
||||
const data = require("lodash");
|
||||
|
||||
_lodash = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _isInstalled = _interopRequireDefault(require("../isInstalled"));
|
||||
|
||||
var _isInstalled2 = _interopRequireDefault(require("../../link-pods/isInstalled"));
|
||||
|
||||
var _unregisterNativeModule = _interopRequireDefault(require("../unregisterNativeModule"));
|
||||
|
||||
var _unregisterNativeModule2 = _interopRequireDefault(require("../../link-pods/unregisterNativeModule"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function unregisterNativeModule(_name, dependencyConfig, projectConfig, // FIXME: Add type signature here
|
||||
otherDependencies) {
|
||||
const isIosInstalled = (0, _isInstalled.default)(projectConfig, dependencyConfig);
|
||||
const isPodInstalled = (0, _isInstalled2.default)(projectConfig, dependencyConfig);
|
||||
|
||||
if (isIosInstalled) {
|
||||
const iOSDependencies = (0, _lodash().compact)(otherDependencies.map(d => d.platforms.ios));
|
||||
(0, _unregisterNativeModule.default)(dependencyConfig, projectConfig, iOSDependencies);
|
||||
} else if (isPodInstalled) {
|
||||
(0, _unregisterNativeModule2.default)(dependencyConfig, projectConfig);
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=unregisterNativeModule.js.map
|
99
node_modules/@react-native-community/cli-platform-ios/build/link/copyAssets.js
generated
vendored
Normal file
99
node_modules/@react-native-community/cli-platform-ios/build/link/copyAssets.js
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = linkAssetsIOS;
|
||||
|
||||
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 _xcode() {
|
||||
const data = _interopRequireDefault(require("xcode"));
|
||||
|
||||
_xcode = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _createGroupWithMessage = _interopRequireDefault(require("./createGroupWithMessage"));
|
||||
|
||||
var _getPlist = _interopRequireDefault(require("./getPlist"));
|
||||
|
||||
var _writePlist = _interopRequireDefault(require("./writePlist"));
|
||||
|
||||
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 }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* This function works in a similar manner to its Android version,
|
||||
* except it does not copy fonts but creates Xcode Group references
|
||||
*/
|
||||
function linkAssetsIOS(files, projectConfig) {
|
||||
const project = _xcode().default.project(projectConfig.pbxprojPath).parseSync();
|
||||
|
||||
const assets = (0, _cliTools().groupFilesByType)(files);
|
||||
const plist = (0, _getPlist.default)(project, projectConfig.sourceDir);
|
||||
(0, _createGroupWithMessage.default)(project, 'Resources');
|
||||
|
||||
function addResourceFile(f) {
|
||||
return (f || []).map(asset => {
|
||||
_cliTools().logger.debug(`Linking asset ${asset}`);
|
||||
|
||||
return project.addResourceFile(_path().default.relative(projectConfig.sourceDir, asset), {
|
||||
target: project.getFirstTarget().uuid
|
||||
});
|
||||
}).filter(Boolean) // xcode returns false if file is already there
|
||||
.map(file => file.basename);
|
||||
}
|
||||
|
||||
addResourceFile(assets.image);
|
||||
const fonts = addResourceFile(assets.font); // @ts-ignore Type mismatch with the lib
|
||||
|
||||
const existingFonts = plist.UIAppFonts || [];
|
||||
const allFonts = [...existingFonts, ...fonts]; // @ts-ignore Type mismatch with the lib
|
||||
|
||||
plist.UIAppFonts = Array.from(new Set(allFonts)); // use Set to dedupe w/existing
|
||||
|
||||
_fs().default.writeFileSync(projectConfig.pbxprojPath, project.writeSync());
|
||||
|
||||
(0, _writePlist.default)(project, projectConfig.sourceDir, plist);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=copyAssets.js.map
|
42
node_modules/@react-native-community/cli-platform-ios/build/link/createGroup.js
generated
vendored
Normal file
42
node_modules/@react-native-community/cli-platform-ios/build/link/createGroup.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = createGroup;
|
||||
|
||||
var _getGroup = _interopRequireDefault(require("./getGroup"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
const hasGroup = (pbxGroup, name) => pbxGroup.children.find(group => group.comment === name);
|
||||
/**
|
||||
* Given project and path of the group, it deeply creates a given group
|
||||
* making all outer groups if necessary
|
||||
*
|
||||
* Returns newly created group
|
||||
*/
|
||||
|
||||
|
||||
function createGroup(project, path) {
|
||||
return path.split('/').reduce((group, name) => {
|
||||
if (!hasGroup(group, name)) {
|
||||
const uuid = project.pbxCreateGroup(name, '""');
|
||||
group.children.push({
|
||||
value: uuid,
|
||||
comment: name
|
||||
});
|
||||
}
|
||||
|
||||
return project.pbxGroupByName(name);
|
||||
}, (0, _getGroup.default)(project));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=createGroup.js.map
|
50
node_modules/@react-native-community/cli-platform-ios/build/link/createGroupWithMessage.js
generated
vendored
Normal file
50
node_modules/@react-native-community/cli-platform-ios/build/link/createGroupWithMessage.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = createGroupWithMessage;
|
||||
|
||||
function _cliTools() {
|
||||
const data = require("@react-native-community/cli-tools");
|
||||
|
||||
_cliTools = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _createGroup = _interopRequireDefault(require("./createGroup"));
|
||||
|
||||
var _getGroup = _interopRequireDefault(require("./getGroup"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given project and path of the group, it checks if a group exists at that path,
|
||||
* and deeply creates a group for that path if its does not already exist.
|
||||
*
|
||||
* Returns the existing or newly created group
|
||||
*/
|
||||
function createGroupWithMessage(project, path) {
|
||||
let group = (0, _getGroup.default)(project, path);
|
||||
|
||||
if (!group) {
|
||||
group = (0, _createGroup.default)(project, path);
|
||||
|
||||
_cliTools().logger.warn(`Group '${path}' does not exist in your Xcode project. We have created it automatically for you.`);
|
||||
}
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=createGroupWithMessage.js.map
|
34
node_modules/@react-native-community/cli-platform-ios/build/link/getBuildProperty.js
generated
vendored
Normal file
34
node_modules/@react-native-community/cli-platform-ios/build/link/getBuildProperty.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getBuildProperty;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Gets build property from the main target build section
|
||||
*
|
||||
* It differs from the project.getBuildProperty exposed by xcode in the way that:
|
||||
* - it only checks for build property in the main target `Debug` section
|
||||
* - `xcode` library iterates over all build sections and because it misses
|
||||
* an early return when property is found, it will return undefined/wrong value
|
||||
* when there's another build section typically after the one you want to access
|
||||
* without the property defined (e.g. CocoaPods sections appended to project
|
||||
* miss INFOPLIST_FILE), see: https://github.com/alunny/node-xcode/blob/master/lib/pbxProject.js#L1765
|
||||
*/
|
||||
function getBuildProperty(project, prop) {
|
||||
const target = project.getFirstTarget().firstTarget;
|
||||
const config = project.pbxXCConfigurationList()[target.buildConfigurationList];
|
||||
const buildSection = project.pbxXCBuildConfigurationSection()[config.buildConfigurations[0].value];
|
||||
return buildSection.buildSettings[prop];
|
||||
}
|
||||
|
||||
//# sourceMappingURL=getBuildProperty.js.map
|
50
node_modules/@react-native-community/cli-platform-ios/build/link/getGroup.js
generated
vendored
Normal file
50
node_modules/@react-native-community/cli-platform-ios/build/link/getGroup.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getGroup;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
const getFirstProject = project => project.getFirstProject().firstProject;
|
||||
|
||||
const findGroup = (groups, name) => groups.children.find(group => group.comment === name);
|
||||
/**
|
||||
* Returns group from .xcodeproj if one exists, null otherwise
|
||||
*
|
||||
* Unlike node-xcode `pbxGroupByName` - it does not return `first-matching`
|
||||
* group if multiple groups with the same name exist
|
||||
*
|
||||
* If path is not provided, it returns top-level group
|
||||
*/
|
||||
|
||||
|
||||
function getGroup(project, path) {
|
||||
const firstProject = getFirstProject(project);
|
||||
let groups = project.getPBXGroupByKey(firstProject.mainGroup);
|
||||
|
||||
if (!path) {
|
||||
return groups;
|
||||
}
|
||||
|
||||
for (const name of path.split('/')) {
|
||||
const foundGroup = findGroup(groups, name);
|
||||
|
||||
if (foundGroup) {
|
||||
groups = project.getPBXGroupByKey(foundGroup.value);
|
||||
} else {
|
||||
groups = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return groups;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=getGroup.js.map
|
77
node_modules/@react-native-community/cli-platform-ios/build/link/getHeaderSearchPath.js
generated
vendored
Normal file
77
node_modules/@react-native-community/cli-platform-ios/build/link/getHeaderSearchPath.js
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getHeaderSearchPath;
|
||||
|
||||
function _path() {
|
||||
const data = require("path");
|
||||
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _lodash() {
|
||||
const data = require("lodash");
|
||||
|
||||
_lodash = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given an array of directories, it returns the one that contains
|
||||
* all the other directories in a given array inside it.
|
||||
*
|
||||
* Example:
|
||||
* Given an array of directories: ['/Users/Kureev/a', '/Users/Kureev/b']
|
||||
* the returned folder is `/Users/Kureev`
|
||||
*
|
||||
* Check `getHeaderSearchPath.spec.js` for more use-cases.
|
||||
*/
|
||||
const getOuterDirectory = directories => directories.reduce((topDir, currentDir) => {
|
||||
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(_path().posix.sep);
|
||||
}
|
||||
|
||||
return currentFolders.length < topMostFolders.length ? currentDir : topDir;
|
||||
});
|
||||
/**
|
||||
* Given an array of headers it returns search path so Xcode can resolve
|
||||
* headers when referenced like below:
|
||||
* ```
|
||||
* #import "CodePush.h"
|
||||
* ```
|
||||
* If all files are located in one directory (directories.length === 1),
|
||||
* we simply return a relative path to that location.
|
||||
*
|
||||
* Otherwise, we loop through them all to find the outer one that contains
|
||||
* all the headers inside. That location is then returned with /** appended at
|
||||
* the end so Xcode marks that location as `recursive` and will look inside
|
||||
* every folder of it to locate correct headers.
|
||||
*/
|
||||
|
||||
|
||||
function getHeaderSearchPath(sourceDir, headers) {
|
||||
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))}/**"`;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=getHeaderSearchPath.js.map
|
51
node_modules/@react-native-community/cli-platform-ios/build/link/getHeadersInFolder.js
generated
vendored
Normal file
51
node_modules/@react-native-community/cli-platform-ios/build/link/getHeadersInFolder.js
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getHeadersInFolder;
|
||||
|
||||
function _glob() {
|
||||
const data = _interopRequireDefault(require("glob"));
|
||||
|
||||
_glob = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require("path"));
|
||||
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
const GLOB_EXCLUDE_PATTERN = ['node_modules/**', 'Pods/**', 'Examples/**', 'examples/**'];
|
||||
/**
|
||||
* Given folder, it returns an array of all header files
|
||||
* inside it, ignoring node_modules and examples
|
||||
*/
|
||||
|
||||
function getHeadersInFolder(folder) {
|
||||
return _glob().default.sync('**/*.h', {
|
||||
cwd: folder,
|
||||
nodir: true,
|
||||
ignore: GLOB_EXCLUDE_PATTERN
|
||||
}).map(file => _path().default.join(folder, file));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=getHeadersInFolder.js.map
|
55
node_modules/@react-native-community/cli-platform-ios/build/link/getPlist.js
generated
vendored
Normal file
55
node_modules/@react-native-community/cli-platform-ios/build/link/getPlist.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getPlist;
|
||||
|
||||
function _plist() {
|
||||
const data = _interopRequireDefault(require("plist"));
|
||||
|
||||
_plist = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require("fs"));
|
||||
|
||||
_fs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _getPlistPath = _interopRequireDefault(require("./getPlistPath"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns Info.plist located in the iOS project
|
||||
*
|
||||
* Returns `null` if INFOPLIST_FILE is not specified.
|
||||
*/
|
||||
function getPlist(project, sourceDir) {
|
||||
const plistPath = (0, _getPlistPath.default)(project, sourceDir);
|
||||
|
||||
if (!plistPath || !_fs().default.existsSync(plistPath)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _plist().default.parse(_fs().default.readFileSync(plistPath, 'utf-8'));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=getPlist.js.map
|
39
node_modules/@react-native-community/cli-platform-ios/build/link/getPlistPath.js
generated
vendored
Normal file
39
node_modules/@react-native-community/cli-platform-ios/build/link/getPlistPath.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getPlistPath;
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require("path"));
|
||||
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _getBuildProperty = _interopRequireDefault(require("./getBuildProperty"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function getPlistPath(project, sourceDir) {
|
||||
const plistFile = (0, _getBuildProperty.default)(project, 'INFOPLIST_FILE');
|
||||
|
||||
if (!plistFile) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _path().default.join(sourceDir, plistFile.replace(/"/g, '').replace('$(SRCROOT)', ''));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=getPlistPath.js.map
|
41
node_modules/@react-native-community/cli-platform-ios/build/link/getTargets.js
generated
vendored
Normal file
41
node_modules/@react-native-community/cli-platform-ios/build/link/getTargets.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getTargets;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given xcodeproj it returns list of targets
|
||||
*/
|
||||
function getTargets(project) {
|
||||
const {
|
||||
firstProject: {
|
||||
targets
|
||||
}
|
||||
} = project.getFirstProject();
|
||||
const nativeTargetSection = project.pbxNativeTargetSection();
|
||||
return targets.filter(target => nativeTargetSection[target.value] !== undefined).map(target => {
|
||||
const key = target.value;
|
||||
const configurationListId = nativeTargetSection[key].buildConfigurationList;
|
||||
const configurationList = project.pbxXCConfigurationList()[configurationListId];
|
||||
const buildConfigurationId = configurationList.buildConfigurations[0].value;
|
||||
const buildConfiguration = project.pbxXCBuildConfigurationSection()[buildConfigurationId];
|
||||
return {
|
||||
uuid: key,
|
||||
target: nativeTargetSection[key],
|
||||
name: nativeTargetSection[key].productReference_comment,
|
||||
isTVOS: buildConfiguration.buildSettings.SDKROOT && buildConfiguration.buildSettings.SDKROOT.indexOf('appletv') !== -1 || false
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=getTargets.js.map
|
25
node_modules/@react-native-community/cli-platform-ios/build/link/hasLibraryImported.js
generated
vendored
Normal file
25
node_modules/@react-native-community/cli-platform-ios/build/link/hasLibraryImported.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = hasLibraryImported;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given an array of libraries already imported and packageName that will be
|
||||
* added, returns true or false depending on whether the library is already linked
|
||||
* or not
|
||||
*/
|
||||
function hasLibraryImported(libraries, packageName) {
|
||||
return libraries.children.filter(library => library.comment === packageName).length > 0;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=hasLibraryImported.js.map
|
41
node_modules/@react-native-community/cli-platform-ios/build/link/index.js
generated
vendored
Normal file
41
node_modules/@react-native-community/cli-platform-ios/build/link/index.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getIOSLinkConfig = getIOSLinkConfig;
|
||||
exports.default = void 0;
|
||||
|
||||
var _isInstalled = _interopRequireDefault(require("./common/isInstalled"));
|
||||
|
||||
var _registerNativeModule = _interopRequireDefault(require("./common/registerNativeModule"));
|
||||
|
||||
var _unregisterNativeModule = _interopRequireDefault(require("./common/unregisterNativeModule"));
|
||||
|
||||
var _copyAssets = _interopRequireDefault(require("./copyAssets"));
|
||||
|
||||
var _unlinkAssets = _interopRequireDefault(require("./unlinkAssets"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function getIOSLinkConfig() {
|
||||
return {
|
||||
isInstalled: _isInstalled.default,
|
||||
register: _registerNativeModule.default,
|
||||
unregister: _unregisterNativeModule.default,
|
||||
copyAssets: _copyAssets.default,
|
||||
unlinkAssets: _unlinkAssets.default
|
||||
};
|
||||
}
|
||||
|
||||
var _default = getIOSLinkConfig;
|
||||
exports.default = _default;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
56
node_modules/@react-native-community/cli-platform-ios/build/link/isInstalled.js
generated
vendored
Normal file
56
node_modules/@react-native-community/cli-platform-ios/build/link/isInstalled.js
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isInstalled;
|
||||
|
||||
function _xcode() {
|
||||
const data = _interopRequireDefault(require("xcode"));
|
||||
|
||||
_xcode = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _getGroup = _interopRequireDefault(require("./getGroup"));
|
||||
|
||||
var _hasLibraryImported = _interopRequireDefault(require("./hasLibraryImported"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
const memo = new Map();
|
||||
/**
|
||||
* Returns true if `xcodeproj` specified by dependencyConfig is present
|
||||
* in a top level `libraryFolder`
|
||||
*/
|
||||
|
||||
function isInstalled(projectConfig, dependencyConfig) {
|
||||
let project;
|
||||
|
||||
if (memo.has(projectConfig.pbxprojPath)) {
|
||||
project = memo.get(projectConfig.pbxprojPath);
|
||||
} else {
|
||||
project = _xcode().default.project(projectConfig.pbxprojPath).parseSync();
|
||||
memo.set(projectConfig.pbxprojPath, project);
|
||||
}
|
||||
|
||||
const libraries = (0, _getGroup.default)(project, projectConfig.libraryFolder);
|
||||
|
||||
if (!libraries) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (0, _hasLibraryImported.default)(libraries, dependencyConfig.projectName);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=isInstalled.js.map
|
48
node_modules/@react-native-community/cli-platform-ios/build/link/mapHeaderSearchPaths.js
generated
vendored
Normal file
48
node_modules/@react-native-community/cli-platform-ios/build/link/mapHeaderSearchPaths.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = headerSearchPathIter;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given Xcode project and path, iterate over all build configurations
|
||||
* and execute func with HEADER_SEARCH_PATHS from current section
|
||||
*
|
||||
* We cannot use builtin addToHeaderSearchPaths method since react-native init does not
|
||||
* use $(TARGET_NAME) for PRODUCT_NAME, but sets it manually so that method will skip
|
||||
* that target.
|
||||
*
|
||||
* To workaround that issue and make it more bullet-proof for different names,
|
||||
* we iterate over all configurations and look for `lc++` linker flag to detect
|
||||
* React Native target.
|
||||
*
|
||||
* Important: That function mutates `buildSettings` and it's not pure thus you should
|
||||
* not rely on its return value
|
||||
*/
|
||||
const defaultHeaderPaths = ['"$(inherited)"'];
|
||||
|
||||
function headerSearchPathIter(project, func) {
|
||||
const config = project.pbxXCBuildConfigurationSection();
|
||||
Object.keys(config).filter(ref => ref.indexOf('_comment') === -1).forEach(ref => {
|
||||
const {
|
||||
buildSettings
|
||||
} = config[ref];
|
||||
const shouldVisitBuildSettings = (Array.isArray(buildSettings.OTHER_LDFLAGS) ? buildSettings.OTHER_LDFLAGS : []).indexOf('"-lc++"') >= 0;
|
||||
|
||||
if (shouldVisitBuildSettings) {
|
||||
const searchPaths = buildSettings.HEADER_SEARCH_PATHS ? [].concat(buildSettings.HEADER_SEARCH_PATHS) : defaultHeaderPaths;
|
||||
buildSettings.HEADER_SEARCH_PATHS = func(searchPaths);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=mapHeaderSearchPaths.js.map
|
141
node_modules/@react-native-community/cli-platform-ios/build/link/registerNativeModule.js
generated
vendored
Normal file
141
node_modules/@react-native-community/cli-platform-ios/build/link/registerNativeModule.js
generated
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = registerNativeModuleIOS;
|
||||
|
||||
function _xcode() {
|
||||
const data = _interopRequireDefault(require("xcode"));
|
||||
|
||||
_xcode = 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 _lodash() {
|
||||
const data = require("lodash");
|
||||
|
||||
_lodash = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _addToHeaderSearchPaths = _interopRequireDefault(require("./addToHeaderSearchPaths"));
|
||||
|
||||
var _getHeadersInFolder = _interopRequireDefault(require("./getHeadersInFolder"));
|
||||
|
||||
var _getHeaderSearchPath = _interopRequireDefault(require("./getHeaderSearchPath"));
|
||||
|
||||
var _getTargets = _interopRequireDefault(require("./getTargets"));
|
||||
|
||||
var _createGroupWithMessage = _interopRequireDefault(require("./createGroupWithMessage"));
|
||||
|
||||
var _addFileToProject = _interopRequireDefault(require("./addFileToProject"));
|
||||
|
||||
var _addProjectToLibraries = _interopRequireDefault(require("./addProjectToLibraries"));
|
||||
|
||||
var _addSharedLibraries = _interopRequireDefault(require("./addSharedLibraries"));
|
||||
|
||||
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 }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Register native module IOS adds given dependency to project by adding
|
||||
* its xcodeproj to project libraries as well as attaching static library
|
||||
* to the first target (the main one)
|
||||
*
|
||||
* If library is already linked, this action is a no-op.
|
||||
*/
|
||||
function registerNativeModuleIOS(dependencyConfig, projectConfig) {
|
||||
_cliTools().logger.debug(`Reading ${projectConfig.pbxprojPath}`);
|
||||
|
||||
const project = _xcode().default.project(projectConfig.pbxprojPath).parseSync();
|
||||
|
||||
const dependencyProject = _xcode().default.project(dependencyConfig.pbxprojPath).parseSync();
|
||||
|
||||
const libraries = (0, _createGroupWithMessage.default)(project, projectConfig.libraryFolder);
|
||||
const file = (0, _addFileToProject.default)(project, _path().default.relative(projectConfig.sourceDir, dependencyConfig.projectPath));
|
||||
const targets = (0, _getTargets.default)(project);
|
||||
(0, _addProjectToLibraries.default)(libraries, file);
|
||||
(0, _getTargets.default)(dependencyProject).forEach(product => {
|
||||
let i;
|
||||
|
||||
if (!product.isTVOS) {
|
||||
for (i = 0; i < targets.length; i++) {
|
||||
if (!targets[i].isTVOS) {
|
||||
_cliTools().logger.debug(`Adding ${product.name} to ${targets[i].target.name}`);
|
||||
|
||||
project.addStaticLibrary(product.name, {
|
||||
target: targets[i].uuid
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (product.isTVOS) {
|
||||
for (i = 0; i < targets.length; i++) {
|
||||
if (targets[i].isTVOS) {
|
||||
_cliTools().logger.debug(`Adding ${product.name} to ${targets[i].target.name}`);
|
||||
|
||||
project.addStaticLibrary(product.name, {
|
||||
target: targets[i].uuid
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
(0, _addSharedLibraries.default)(project, dependencyConfig.sharedLibraries);
|
||||
const headers = (0, _getHeadersInFolder.default)(dependencyConfig.folder);
|
||||
|
||||
if (!(0, _lodash().isEmpty)(headers)) {
|
||||
(0, _addToHeaderSearchPaths.default)(project, (0, _getHeaderSearchPath.default)(projectConfig.sourceDir, headers));
|
||||
}
|
||||
|
||||
_cliTools().logger.debug(`Writing changes to ${projectConfig.pbxprojPath}`);
|
||||
|
||||
_fs().default.writeFileSync(projectConfig.pbxprojPath, project.writeSync());
|
||||
}
|
||||
|
||||
//# sourceMappingURL=registerNativeModule.js.map
|
39
node_modules/@react-native-community/cli-platform-ios/build/link/removeFromHeaderSearchPaths.js
generated
vendored
Normal file
39
node_modules/@react-native-community/cli-platform-ios/build/link/removeFromHeaderSearchPaths.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = addToHeaderSearchPaths;
|
||||
|
||||
var _mapHeaderSearchPaths = _interopRequireDefault(require("./mapHeaderSearchPaths"));
|
||||
|
||||
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 }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given Xcode project and absolute path, it makes sure there are no headers referring to it
|
||||
*/
|
||||
function addToHeaderSearchPaths(project, path) {
|
||||
_cliTools().logger.debug(`Removing ${path} from header search paths`);
|
||||
|
||||
(0, _mapHeaderSearchPaths.default)(project, searchPaths => searchPaths.filter(searchPath => searchPath !== path));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=removeFromHeaderSearchPaths.js.map
|
31
node_modules/@react-native-community/cli-platform-ios/build/link/removeFromPbxItemContainerProxySection.js
generated
vendored
Normal file
31
node_modules/@react-native-community/cli-platform-ios/build/link/removeFromPbxItemContainerProxySection.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removeFromPbxItemContainerProxySection;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* For all files that are created and referenced from another `.xcodeproj` -
|
||||
* a new PBXItemContainerProxy is created that contains `containerPortal` value
|
||||
* which equals to xcodeproj file.uuid from PBXFileReference section.
|
||||
*/
|
||||
function removeFromPbxItemContainerProxySection(project, file) {
|
||||
const section = project.hash.project.objects.PBXContainerItemProxy;
|
||||
|
||||
for (const key of Object.keys(section)) {
|
||||
if (section[key].containerPortal === file.uuid) {
|
||||
delete section[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=removeFromPbxItemContainerProxySection.js.map
|
30
node_modules/@react-native-community/cli-platform-ios/build/link/removeFromPbxReferenceProxySection.js
generated
vendored
Normal file
30
node_modules/@react-native-community/cli-platform-ios/build/link/removeFromPbxReferenceProxySection.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removeFromPbxReferenceProxySection;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Every file added to the project from another project is attached to
|
||||
* `PBXItemContainerProxy` through `PBXReferenceProxy`.
|
||||
*/
|
||||
function removeFromPbxReferenceProxySection(project, file) {
|
||||
const section = project.hash.project.objects.PBXReferenceProxy;
|
||||
|
||||
for (const key of Object.keys(section)) {
|
||||
if (section[key].path === file.basename) {
|
||||
delete section[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=removeFromPbxReferenceProxySection.js.map
|
40
node_modules/@react-native-community/cli-platform-ios/build/link/removeFromProjectReferences.js
generated
vendored
Normal file
40
node_modules/@react-native-community/cli-platform-ios/build/link/removeFromProjectReferences.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removeFromProjectReferences;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* For each file (.xcodeproj), there's an entry in `projectReferences` created
|
||||
* that has two entries - `ProjectRef` - reference to a file.uuid and
|
||||
* `ProductGroup` - uuid of a Products group.
|
||||
*
|
||||
* When projectReference is found - it's deleted and the removed value is returned
|
||||
* so that ProductGroup in PBXGroup section can be removed as well.
|
||||
*
|
||||
* Otherwise returns null
|
||||
*/
|
||||
function removeFromProjectReferences(project, file) {
|
||||
const {
|
||||
firstProject
|
||||
} = project.getFirstProject();
|
||||
const projectRef = firstProject.projectReferences.find(item => item.ProjectRef === file.uuid);
|
||||
|
||||
if (!projectRef) {
|
||||
return null;
|
||||
}
|
||||
|
||||
firstProject.projectReferences.splice(firstProject.projectReferences.indexOf(projectRef), 1);
|
||||
return projectRef;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=removeFromProjectReferences.js.map
|
46
node_modules/@react-native-community/cli-platform-ios/build/link/removeFromStaticLibraries.js
generated
vendored
Normal file
46
node_modules/@react-native-community/cli-platform-ios/build/link/removeFromStaticLibraries.js
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removeFromStaticLibraries;
|
||||
|
||||
function _pbxFile() {
|
||||
const data = _interopRequireDefault(require("xcode/lib/pbxFile"));
|
||||
|
||||
_pbxFile = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _removeFromPbxReferenceProxySection = _interopRequireDefault(require("./removeFromPbxReferenceProxySection"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Removes file from static libraries
|
||||
*
|
||||
* Similar to `node-xcode` addStaticLibrary
|
||||
*/
|
||||
function removeFromStaticLibraries(project, path, opts) {
|
||||
const file = new (_pbxFile().default)(path);
|
||||
file.target = opts ? opts.target : undefined;
|
||||
project.removeFromPbxFileReferenceSection(file);
|
||||
project.removeFromPbxBuildFileSection(file);
|
||||
project.removeFromPbxFrameworksBuildPhase(file);
|
||||
project.removeFromLibrarySearchPaths(file);
|
||||
(0, _removeFromPbxReferenceProxySection.default)(project, file);
|
||||
return file;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=removeFromStaticLibraries.js.map
|
25
node_modules/@react-native-community/cli-platform-ios/build/link/removeProductGroup.js
generated
vendored
Normal file
25
node_modules/@react-native-community/cli-platform-ios/build/link/removeProductGroup.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removeProductGroup;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function removeProductGroup(project, productGroupId) {
|
||||
const section = project.hash.project.objects.PBXGroup;
|
||||
|
||||
for (const key of Object.keys(section)) {
|
||||
if (key === productGroupId) {
|
||||
delete section[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=removeProductGroup.js.map
|
26
node_modules/@react-native-community/cli-platform-ios/build/link/removeProjectFromLibraries.js
generated
vendored
Normal file
26
node_modules/@react-native-community/cli-platform-ios/build/link/removeProjectFromLibraries.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removeProjectFromLibraries;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given an array of xcodeproj libraries and pbxFile,
|
||||
* it removes it from that group by comparing basenames
|
||||
*
|
||||
* Important: That function mutates `libraries` and it's not pure.
|
||||
* It's mainly due to limitations of `xcode` library.
|
||||
*/
|
||||
function removeProjectFromLibraries(libraries, file) {
|
||||
libraries.children = libraries.children.filter(library => library.comment !== file.basename);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=removeProjectFromLibraries.js.map
|
55
node_modules/@react-native-community/cli-platform-ios/build/link/removeProjectFromProject.js
generated
vendored
Normal file
55
node_modules/@react-native-community/cli-platform-ios/build/link/removeProjectFromProject.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removeProjectFromProject;
|
||||
|
||||
function _pbxFile() {
|
||||
const data = _interopRequireDefault(require("xcode/lib/pbxFile"));
|
||||
|
||||
_pbxFile = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _removeFromPbxItemContainerProxySection = _interopRequireDefault(require("./removeFromPbxItemContainerProxySection"));
|
||||
|
||||
var _removeFromProjectReferences = _interopRequireDefault(require("./removeFromProjectReferences"));
|
||||
|
||||
var _removeProductGroup = _interopRequireDefault(require("./removeProductGroup"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given xcodeproj and filePath, it creates new file
|
||||
* from path provided and removes it. That operation is required since
|
||||
* underlying method requires PbxFile instance to be passed (it does not
|
||||
* have to have uuid or fileRef defined since it will do equality check
|
||||
* by path)
|
||||
*
|
||||
* Returns removed file (that one will have UUID)
|
||||
*/
|
||||
function removeProjectFromProject(project, filePath) {
|
||||
const file = project.removeFromPbxFileReferenceSection(new (_pbxFile().default)(filePath));
|
||||
const projectRef = (0, _removeFromProjectReferences.default)(project, file);
|
||||
|
||||
if (projectRef) {
|
||||
(0, _removeProductGroup.default)(project, projectRef.ProductGroup);
|
||||
}
|
||||
|
||||
(0, _removeFromPbxItemContainerProxySection.default)(project, file);
|
||||
return file;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=removeProjectFromProject.js.map
|
29
node_modules/@react-native-community/cli-platform-ios/build/link/removeSharedLibraries.js
generated
vendored
Normal file
29
node_modules/@react-native-community/cli-platform-ios/build/link/removeSharedLibraries.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = removeSharedLibraries;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
function removeSharedLibraries(project, libraries) {
|
||||
if (!libraries.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const target = project.getFirstTarget().uuid;
|
||||
|
||||
for (const name of libraries) {
|
||||
project.removeFramework(name, {
|
||||
target
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=removeSharedLibraries.js.map
|
112
node_modules/@react-native-community/cli-platform-ios/build/link/unlinkAssets.js
generated
vendored
Normal file
112
node_modules/@react-native-community/cli-platform-ios/build/link/unlinkAssets.js
generated
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = unlinkAssetsIOS;
|
||||
|
||||
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 _xcode() {
|
||||
const data = _interopRequireDefault(require("xcode"));
|
||||
|
||||
_xcode = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _lodash() {
|
||||
const data = require("lodash");
|
||||
|
||||
_lodash = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _getPlist = _interopRequireDefault(require("./getPlist"));
|
||||
|
||||
var _writePlist = _interopRequireDefault(require("./writePlist"));
|
||||
|
||||
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 }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Unlinks assets from iOS project. Removes references for fonts from `Info.plist`
|
||||
* fonts provided by application and from `Resources` group
|
||||
*/
|
||||
function unlinkAssetsIOS(files, projectConfig) {
|
||||
const project = _xcode().default.project(projectConfig.pbxprojPath).parseSync();
|
||||
|
||||
const assets = (0, _cliTools().groupFilesByType)(files);
|
||||
const plist = (0, _getPlist.default)(project, projectConfig.sourceDir);
|
||||
|
||||
if (!plist) {
|
||||
_cliTools().logger.error('Could not locate "Info.plist" file. Check if your project has "INFOPLIST_FILE" set properly');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!project.pbxGroupByName('Resources')) {
|
||||
_cliTools().logger.error('Group "Resources" does not exist in your Xcode project. There is nothing to unlink.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const removeResourceFiles = (f = []) => (f || []).map(asset => {
|
||||
_cliTools().logger.debug(`Unlinking asset ${asset}`);
|
||||
|
||||
return project.removeResourceFile(_path().default.relative(projectConfig.sourceDir, asset), {
|
||||
target: project.getFirstTarget().uuid
|
||||
});
|
||||
}).map(file => file.basename);
|
||||
|
||||
removeResourceFiles(assets.image);
|
||||
const fonts = removeResourceFiles(assets.font); // @ts-ignore Type mismatch
|
||||
|
||||
plist.UIAppFonts = (0, _lodash().difference)(plist.UIAppFonts || [], fonts);
|
||||
|
||||
_fs().default.writeFileSync(projectConfig.pbxprojPath, project.writeSync());
|
||||
|
||||
(0, _writePlist.default)(project, projectConfig.sourceDir, plist);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=unlinkAssets.js.map
|
121
node_modules/@react-native-community/cli-platform-ios/build/link/unregisterNativeModule.js
generated
vendored
Normal file
121
node_modules/@react-native-community/cli-platform-ios/build/link/unregisterNativeModule.js
generated
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = unregisterNativeModule;
|
||||
|
||||
function _xcode() {
|
||||
const data = _interopRequireDefault(require("xcode"));
|
||||
|
||||
_xcode = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require("path"));
|
||||
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require("fs"));
|
||||
|
||||
_fs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _lodash() {
|
||||
const data = require("lodash");
|
||||
|
||||
_lodash = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _getGroup = _interopRequireDefault(require("./getGroup"));
|
||||
|
||||
var _getTargets = _interopRequireDefault(require("./getTargets"));
|
||||
|
||||
var _getHeadersInFolder = _interopRequireDefault(require("./getHeadersInFolder"));
|
||||
|
||||
var _getHeaderSearchPath = _interopRequireDefault(require("./getHeaderSearchPath"));
|
||||
|
||||
var _removeProjectFromProject = _interopRequireDefault(require("./removeProjectFromProject"));
|
||||
|
||||
var _removeProjectFromLibraries = _interopRequireDefault(require("./removeProjectFromLibraries"));
|
||||
|
||||
var _removeFromStaticLibraries = _interopRequireDefault(require("./removeFromStaticLibraries"));
|
||||
|
||||
var _removeFromHeaderSearchPaths = _interopRequireDefault(require("./removeFromHeaderSearchPaths"));
|
||||
|
||||
var _removeSharedLibraries = _interopRequireDefault(require("./removeSharedLibraries"));
|
||||
|
||||
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 }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Unregister native module IOS
|
||||
*
|
||||
* If library is already unlinked, this action is a no-op.
|
||||
*/
|
||||
function unregisterNativeModule(dependencyConfig, projectConfig, iOSDependencies) {
|
||||
_cliTools().logger.debug(`Reading ${projectConfig.pbxprojPath}`);
|
||||
|
||||
const project = _xcode().default.project(projectConfig.pbxprojPath).parseSync();
|
||||
|
||||
const dependencyProject = _xcode().default.project(dependencyConfig.pbxprojPath).parseSync();
|
||||
|
||||
const libraries = (0, _getGroup.default)(project, projectConfig.libraryFolder);
|
||||
const file = (0, _removeProjectFromProject.default)(project, _path().default.relative(projectConfig.sourceDir, dependencyConfig.projectPath));
|
||||
(0, _removeProjectFromLibraries.default)(libraries, file);
|
||||
(0, _getTargets.default)(dependencyProject).forEach(target => {
|
||||
_cliTools().logger.debug(`Removing ${target.name} from ${project.getFirstTarget().firstTarget.name}`);
|
||||
|
||||
(0, _removeFromStaticLibraries.default)(project, target.name, {
|
||||
target: project.getFirstTarget().uuid
|
||||
});
|
||||
});
|
||||
const sharedLibraries = (0, _lodash().difference)(dependencyConfig.sharedLibraries, iOSDependencies.reduce((libs, dependency) => libs.concat(dependency.sharedLibraries), projectConfig.sharedLibraries));
|
||||
(0, _removeSharedLibraries.default)(project, sharedLibraries);
|
||||
const headers = (0, _getHeadersInFolder.default)(dependencyConfig.folder);
|
||||
|
||||
if (!(0, _lodash().isEmpty)(headers)) {
|
||||
(0, _removeFromHeaderSearchPaths.default)(project, (0, _getHeaderSearchPath.default)(projectConfig.sourceDir, headers));
|
||||
}
|
||||
|
||||
_cliTools().logger.debug(`Writing changes to ${projectConfig.pbxprojPath}`);
|
||||
|
||||
_fs().default.writeFileSync(projectConfig.pbxprojPath, project.writeSync());
|
||||
}
|
||||
|
||||
//# sourceMappingURL=unregisterNativeModule.js.map
|
60
node_modules/@react-native-community/cli-platform-ios/build/link/warnAboutManuallyLinkedLibs.js
generated
vendored
Normal file
60
node_modules/@react-native-community/cli-platform-ios/build/link/warnAboutManuallyLinkedLibs.js
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = warnAboutManuallyLinkedLibs;
|
||||
|
||||
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 _index = _interopRequireDefault(require("./index"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
// TODO: move to cli-tools once platform-ios and platform-android are migrated
|
||||
// to TS and unify with Android implementation
|
||||
function warnAboutManuallyLinkedLibs(config, platform = 'ios', linkConfig = (0, _index.default)()) {
|
||||
let deps = [];
|
||||
|
||||
for (let key in config.dependencies) {
|
||||
const dependency = config.dependencies[key];
|
||||
|
||||
try {
|
||||
const projectConfig = config.project[platform];
|
||||
const dependencyConfig = dependency.platforms[platform];
|
||||
|
||||
if (projectConfig && dependencyConfig) {
|
||||
const x = linkConfig.isInstalled(projectConfig, dependency.name, dependencyConfig);
|
||||
deps = deps.concat(x ? dependency.name : []);
|
||||
}
|
||||
} catch (error) {
|
||||
_cliTools().logger.debug('Checking manually linked modules failed.', error);
|
||||
}
|
||||
}
|
||||
|
||||
const installedModules = [...new Set(deps)];
|
||||
|
||||
if (installedModules.length) {
|
||||
_cliTools().logger.error(`React Native CLI uses autolinking for native dependencies, but the following modules are linked manually: \n${installedModules.map(x => ` - ${_chalk().default.bold(x)} ${_chalk().default.dim(`(to unlink run: "react-native unlink ${x}")`)}`).join('\n')}\nThis is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.\nRead more about autolinking: ${_chalk().default.dim.underline('https://github.com/react-native-community/cli/blob/master/docs/autolinking.md')}`);
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=warnAboutManuallyLinkedLibs.js.map
|
55
node_modules/@react-native-community/cli-platform-ios/build/link/warnAboutPodInstall.js
generated
vendored
Normal file
55
node_modules/@react-native-community/cli-platform-ios/build/link/warnAboutPodInstall.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = warnAboutPodInstall;
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require("path"));
|
||||
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
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 _getDependenciesFromPodfileLock = _interopRequireDefault(require("../link-pods/getDependenciesFromPodfileLock"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function warnAboutPodInstall(config) {
|
||||
const podLockDeps = (0, _getDependenciesFromPodfileLock.default)(`${config.project.ios.podfile}.lock`);
|
||||
const podDeps = Object.keys(config.dependencies).map(depName => {
|
||||
const dependency = config.dependencies[depName].platforms.ios;
|
||||
return dependency && dependency.podspecPath ? _path().default.basename(dependency.podspecPath).replace(/\.podspec/, '') : '';
|
||||
}).filter(Boolean);
|
||||
const missingPods = podDeps.filter(podDep => !podLockDeps.includes(podDep));
|
||||
|
||||
if (missingPods.length) {
|
||||
_cliTools().logger.error(`Could not find the following native modules: ${missingPods.map(pod => _chalk().default.bold(pod)).join(', ')}. Did you forget to run "${_chalk().default.bold('pod install')}" ?`);
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=warnAboutPodInstall.js.map
|
62
node_modules/@react-native-community/cli-platform-ios/build/link/writePlist.js
generated
vendored
Normal file
62
node_modules/@react-native-community/cli-platform-ios/build/link/writePlist.js
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = writePlist;
|
||||
|
||||
function _plist() {
|
||||
const data = _interopRequireDefault(require("plist"));
|
||||
|
||||
_plist = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require("fs"));
|
||||
|
||||
_fs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _getPlistPath = _interopRequireDefault(require("./getPlistPath"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Writes to Info.plist located in the iOS project
|
||||
*
|
||||
* Returns `null` if INFOPLIST_FILE is not specified or file is non-existent.
|
||||
*/
|
||||
function writePlist(project, sourceDir, plist) {
|
||||
const plistPath = (0, _getPlistPath.default)(project, sourceDir);
|
||||
|
||||
if (!plistPath) {
|
||||
return null;
|
||||
} // We start with an offset of -1, because Xcode maintains a custom
|
||||
// indentation of the plist.
|
||||
// Ref: https://github.com/facebook/react-native/issues/11668
|
||||
|
||||
|
||||
return _fs().default.writeFileSync(plistPath, // @ts-ignore Type mismatch
|
||||
`${_plist().default.build(plist, {
|
||||
indent: '\t',
|
||||
offset: -1
|
||||
})}\n`);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=writePlist.js.map
|
1
node_modules/@react-native-community/cli-platform-ios/build/types.js
generated
vendored
Normal file
1
node_modules/@react-native-community/cli-platform-ios/build/types.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
"use strict";
|
159
node_modules/@react-native-community/cli-platform-ios/native_modules.rb
generated
vendored
Normal file
159
node_modules/@react-native-community/cli-platform-ios/native_modules.rb
generated
vendored
Normal file
@ -0,0 +1,159 @@
|
||||
# This is a function which is used inside your Podfile.
|
||||
#
|
||||
# It uses `react-native config` to grab a list of dependencies, and pulls out
|
||||
# all of the ones which declare themselves to be iOS/macOS dependencies (by
|
||||
# virtue of having a Podspec) and automatically imports those into your current
|
||||
# target.
|
||||
#
|
||||
# See the `IOSNativeModulesConfig` interface in `cli-types/src/ios.ts` to
|
||||
# understand what the input data should look like. Be sure to update that file
|
||||
# in lock-step with additional data being used here.
|
||||
|
||||
require 'pathname'
|
||||
require 'cocoapods'
|
||||
|
||||
def use_native_modules!(config = nil)
|
||||
if (config.is_a? String)
|
||||
Pod::UI.warn("Passing custom root to use_native_modules! is deprecated.",
|
||||
[
|
||||
"CLI detects root of the project automatically. The \"#{config}\" argument was ignored.",
|
||||
]);
|
||||
config = nil;
|
||||
end
|
||||
|
||||
# Resolving the path the RN CLI. The `@react-native-community/cli` module may not be there for certain package managers, so we fall back to resolving it through `react-native` package, that's always present in RN projects
|
||||
cli_resolve_script = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}"
|
||||
cli_bin = Pod::Executable.execute_command("node", ["-e", cli_resolve_script], true).strip
|
||||
|
||||
if (!config)
|
||||
json = []
|
||||
|
||||
IO.popen(["node", cli_bin, "config"]) do |data|
|
||||
while line = data.gets
|
||||
json << line
|
||||
end
|
||||
end
|
||||
|
||||
config = JSON.parse(json.join("\n"))
|
||||
end
|
||||
|
||||
project_root = Pathname.new(config["project"]["ios"]["sourceDir"])
|
||||
|
||||
packages = config["dependencies"]
|
||||
found_pods = []
|
||||
|
||||
packages.each do |package_name, package|
|
||||
next unless package_config = package["platforms"]["ios"]
|
||||
|
||||
podspec_path = package_config["podspecPath"]
|
||||
|
||||
# Add a warning to the queue and continue to the next dependency if the podspec_path is nil/empty
|
||||
if podspec_path.nil? || podspec_path.empty?
|
||||
Pod::UI.warn("use_native_modules! skipped the react-native dependency '#{package["name"]}'. No podspec file was found.",
|
||||
[
|
||||
"Check to see if there is an updated version that contains the necessary podspec file",
|
||||
"Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good example of a package.json driven podspec. See https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec",
|
||||
"If necessary, you can disable autolinking for the dependency and link it manually. See https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library"
|
||||
])
|
||||
end
|
||||
next if podspec_path.nil? || podspec_path.empty?
|
||||
|
||||
spec = Pod::Specification.from_file(podspec_path)
|
||||
|
||||
# Skip pods that do not support the platform of the current target.
|
||||
if platform = current_target_definition.platform
|
||||
next unless spec.supported_on_platform?(platform.name)
|
||||
else
|
||||
# TODO: In a future RN version we should update the Podfile template and
|
||||
# enable this assertion.
|
||||
#
|
||||
# raise Pod::Informative, "Cannot invoke `use_native_modules!` before defining the supported `platform`"
|
||||
end
|
||||
|
||||
# We want to do a look up inside the current CocoaPods target
|
||||
# to see if it's already included, this:
|
||||
# 1. Gives you the chance to define it beforehand
|
||||
# 2. Ensures CocoaPods won't explode if it's included twice
|
||||
#
|
||||
this_target = current_target_definition
|
||||
existing_deps = current_target_definition.dependencies
|
||||
|
||||
# Skip dependencies that the user already activated themselves.
|
||||
next if existing_deps.find do |existing_dep|
|
||||
existing_dep.name.split('/').first == spec.name
|
||||
end
|
||||
|
||||
podspec_dir_path = Pathname.new(File.dirname(podspec_path))
|
||||
|
||||
relative_path = podspec_dir_path.relative_path_from project_root
|
||||
|
||||
pod spec.name, :path => relative_path.to_path
|
||||
|
||||
if package_config["scriptPhases"] && !this_target.abstract?
|
||||
# Can be either an object, or an array of objects
|
||||
Array(package_config["scriptPhases"]).each do |phase|
|
||||
# see https://www.rubydoc.info/gems/cocoapods-core/Pod/Podfile/DSL#script_phase-instance_method
|
||||
# for the full object keys
|
||||
Pod::UI.puts "Adding a custom script phase for Pod #{spec.name}: #{phase["name"] || 'No name specified.'}"
|
||||
|
||||
# Support passing in a path relative to the root of the package
|
||||
if phase["path"]
|
||||
phase["script"] = File.read(File.expand_path(phase["path"], package["root"]))
|
||||
phase.delete("path")
|
||||
end
|
||||
|
||||
# Support converting the execution position into a symbol
|
||||
if phase["execution_position"]
|
||||
phase["execution_position"] = phase["execution_position"].to_sym
|
||||
end
|
||||
|
||||
phase = Hash[phase.map { |k, v| [k.to_sym, v] }]
|
||||
script_phase phase
|
||||
end
|
||||
end
|
||||
|
||||
found_pods.push spec
|
||||
end
|
||||
|
||||
if found_pods.size > 0
|
||||
pods = found_pods.map { |p| p.name }.sort.to_sentence
|
||||
Pod::UI.puts "Auto-linking React Native #{"module".pluralize(found_pods.size)} for target `#{current_target_definition.name}`: #{pods}"
|
||||
end
|
||||
|
||||
absolute_react_native_path = Pathname.new(config["reactNativePath"])
|
||||
|
||||
{ :reactNativePath => absolute_react_native_path.relative_path_from(project_root).to_s }
|
||||
end
|
||||
|
||||
# You can run the tests for this file by running:
|
||||
# $ yarn jest packages/platform-ios/src/config/__tests__/native_modules.test.ts
|
||||
if $0 == __FILE__
|
||||
require "json"
|
||||
runInput = JSON.parse(ARGF.read)
|
||||
|
||||
unless runInput["captureStdout"]
|
||||
Pod::Config.instance.silent = true
|
||||
end
|
||||
|
||||
return_values = []
|
||||
|
||||
podfile = Pod::Podfile.new do
|
||||
if runInput["podsActivatedByUser"]
|
||||
runInput["podsActivatedByUser"].each do |name|
|
||||
pod(name)
|
||||
end
|
||||
end
|
||||
target 'iOS Target' do
|
||||
platform :ios
|
||||
return_values[0] = use_native_modules!(runInput["dependencyConfig"])
|
||||
end
|
||||
target 'macOS Target' do
|
||||
platform :osx
|
||||
return_values[1] = use_native_modules!(runInput["dependencyConfig"])
|
||||
end
|
||||
end
|
||||
|
||||
unless runInput["captureStdout"]
|
||||
puts podfile.to_hash.merge({ "return_values": return_values }).to_json
|
||||
end
|
||||
end
|
345
node_modules/@react-native-community/cli-platform-ios/node_modules/ansi-styles/index.d.ts
generated
vendored
Normal file
345
node_modules/@react-native-community/cli-platform-ios/node_modules/ansi-styles/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,345 @@
|
||||
declare type CSSColor =
|
||||
| 'aliceblue'
|
||||
| 'antiquewhite'
|
||||
| 'aqua'
|
||||
| 'aquamarine'
|
||||
| 'azure'
|
||||
| 'beige'
|
||||
| 'bisque'
|
||||
| 'black'
|
||||
| 'blanchedalmond'
|
||||
| 'blue'
|
||||
| 'blueviolet'
|
||||
| 'brown'
|
||||
| 'burlywood'
|
||||
| 'cadetblue'
|
||||
| 'chartreuse'
|
||||
| 'chocolate'
|
||||
| 'coral'
|
||||
| 'cornflowerblue'
|
||||
| 'cornsilk'
|
||||
| 'crimson'
|
||||
| 'cyan'
|
||||
| 'darkblue'
|
||||
| 'darkcyan'
|
||||
| 'darkgoldenrod'
|
||||
| 'darkgray'
|
||||
| 'darkgreen'
|
||||
| 'darkgrey'
|
||||
| 'darkkhaki'
|
||||
| 'darkmagenta'
|
||||
| 'darkolivegreen'
|
||||
| 'darkorange'
|
||||
| 'darkorchid'
|
||||
| 'darkred'
|
||||
| 'darksalmon'
|
||||
| 'darkseagreen'
|
||||
| 'darkslateblue'
|
||||
| 'darkslategray'
|
||||
| 'darkslategrey'
|
||||
| 'darkturquoise'
|
||||
| 'darkviolet'
|
||||
| 'deeppink'
|
||||
| 'deepskyblue'
|
||||
| 'dimgray'
|
||||
| 'dimgrey'
|
||||
| 'dodgerblue'
|
||||
| 'firebrick'
|
||||
| 'floralwhite'
|
||||
| 'forestgreen'
|
||||
| 'fuchsia'
|
||||
| 'gainsboro'
|
||||
| 'ghostwhite'
|
||||
| 'gold'
|
||||
| 'goldenrod'
|
||||
| 'gray'
|
||||
| 'green'
|
||||
| 'greenyellow'
|
||||
| 'grey'
|
||||
| 'honeydew'
|
||||
| 'hotpink'
|
||||
| 'indianred'
|
||||
| 'indigo'
|
||||
| 'ivory'
|
||||
| 'khaki'
|
||||
| 'lavender'
|
||||
| 'lavenderblush'
|
||||
| 'lawngreen'
|
||||
| 'lemonchiffon'
|
||||
| 'lightblue'
|
||||
| 'lightcoral'
|
||||
| 'lightcyan'
|
||||
| 'lightgoldenrodyellow'
|
||||
| 'lightgray'
|
||||
| 'lightgreen'
|
||||
| 'lightgrey'
|
||||
| 'lightpink'
|
||||
| 'lightsalmon'
|
||||
| 'lightseagreen'
|
||||
| 'lightskyblue'
|
||||
| 'lightslategray'
|
||||
| 'lightslategrey'
|
||||
| 'lightsteelblue'
|
||||
| 'lightyellow'
|
||||
| 'lime'
|
||||
| 'limegreen'
|
||||
| 'linen'
|
||||
| 'magenta'
|
||||
| 'maroon'
|
||||
| 'mediumaquamarine'
|
||||
| 'mediumblue'
|
||||
| 'mediumorchid'
|
||||
| 'mediumpurple'
|
||||
| 'mediumseagreen'
|
||||
| 'mediumslateblue'
|
||||
| 'mediumspringgreen'
|
||||
| 'mediumturquoise'
|
||||
| 'mediumvioletred'
|
||||
| 'midnightblue'
|
||||
| 'mintcream'
|
||||
| 'mistyrose'
|
||||
| 'moccasin'
|
||||
| 'navajowhite'
|
||||
| 'navy'
|
||||
| 'oldlace'
|
||||
| 'olive'
|
||||
| 'olivedrab'
|
||||
| 'orange'
|
||||
| 'orangered'
|
||||
| 'orchid'
|
||||
| 'palegoldenrod'
|
||||
| 'palegreen'
|
||||
| 'paleturquoise'
|
||||
| 'palevioletred'
|
||||
| 'papayawhip'
|
||||
| 'peachpuff'
|
||||
| 'peru'
|
||||
| 'pink'
|
||||
| 'plum'
|
||||
| 'powderblue'
|
||||
| 'purple'
|
||||
| 'rebeccapurple'
|
||||
| 'red'
|
||||
| 'rosybrown'
|
||||
| 'royalblue'
|
||||
| 'saddlebrown'
|
||||
| 'salmon'
|
||||
| 'sandybrown'
|
||||
| 'seagreen'
|
||||
| 'seashell'
|
||||
| 'sienna'
|
||||
| 'silver'
|
||||
| 'skyblue'
|
||||
| 'slateblue'
|
||||
| 'slategray'
|
||||
| 'slategrey'
|
||||
| 'snow'
|
||||
| 'springgreen'
|
||||
| 'steelblue'
|
||||
| 'tan'
|
||||
| 'teal'
|
||||
| 'thistle'
|
||||
| 'tomato'
|
||||
| 'turquoise'
|
||||
| 'violet'
|
||||
| 'wheat'
|
||||
| 'white'
|
||||
| 'whitesmoke'
|
||||
| 'yellow'
|
||||
| 'yellowgreen';
|
||||
|
||||
declare namespace ansiStyles {
|
||||
interface ColorConvert {
|
||||
/**
|
||||
The RGB color space.
|
||||
|
||||
@param red - (`0`-`255`)
|
||||
@param green - (`0`-`255`)
|
||||
@param blue - (`0`-`255`)
|
||||
*/
|
||||
rgb(red: number, green: number, blue: number): string;
|
||||
|
||||
/**
|
||||
The RGB HEX color space.
|
||||
|
||||
@param hex - A hexadecimal string containing RGB data.
|
||||
*/
|
||||
hex(hex: string): string;
|
||||
|
||||
/**
|
||||
@param keyword - A CSS color name.
|
||||
*/
|
||||
keyword(keyword: CSSColor): string;
|
||||
|
||||
/**
|
||||
The HSL color space.
|
||||
|
||||
@param hue - (`0`-`360`)
|
||||
@param saturation - (`0`-`100`)
|
||||
@param lightness - (`0`-`100`)
|
||||
*/
|
||||
hsl(hue: number, saturation: number, lightness: number): string;
|
||||
|
||||
/**
|
||||
The HSV color space.
|
||||
|
||||
@param hue - (`0`-`360`)
|
||||
@param saturation - (`0`-`100`)
|
||||
@param value - (`0`-`100`)
|
||||
*/
|
||||
hsv(hue: number, saturation: number, value: number): string;
|
||||
|
||||
/**
|
||||
The HSV color space.
|
||||
|
||||
@param hue - (`0`-`360`)
|
||||
@param whiteness - (`0`-`100`)
|
||||
@param blackness - (`0`-`100`)
|
||||
*/
|
||||
hwb(hue: number, whiteness: number, blackness: number): string;
|
||||
|
||||
/**
|
||||
Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color.
|
||||
*/
|
||||
ansi(ansi: number): string;
|
||||
|
||||
/**
|
||||
Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
|
||||
*/
|
||||
ansi256(ansi: number): string;
|
||||
}
|
||||
|
||||
interface CSPair {
|
||||
/**
|
||||
The ANSI terminal control sequence for starting this style.
|
||||
*/
|
||||
readonly open: string;
|
||||
|
||||
/**
|
||||
The ANSI terminal control sequence for ending this style.
|
||||
*/
|
||||
readonly close: string;
|
||||
}
|
||||
|
||||
interface ColorBase {
|
||||
readonly ansi: ColorConvert;
|
||||
readonly ansi256: ColorConvert;
|
||||
readonly ansi16m: ColorConvert;
|
||||
|
||||
/**
|
||||
The ANSI terminal control sequence for ending this color.
|
||||
*/
|
||||
readonly close: string;
|
||||
}
|
||||
|
||||
interface Modifier {
|
||||
/**
|
||||
Resets the current color chain.
|
||||
*/
|
||||
readonly reset: CSPair;
|
||||
|
||||
/**
|
||||
Make text bold.
|
||||
*/
|
||||
readonly bold: CSPair;
|
||||
|
||||
/**
|
||||
Emitting only a small amount of light.
|
||||
*/
|
||||
readonly dim: CSPair;
|
||||
|
||||
/**
|
||||
Make text italic. (Not widely supported)
|
||||
*/
|
||||
readonly italic: CSPair;
|
||||
|
||||
/**
|
||||
Make text underline. (Not widely supported)
|
||||
*/
|
||||
readonly underline: CSPair;
|
||||
|
||||
/**
|
||||
Inverse background and foreground colors.
|
||||
*/
|
||||
readonly inverse: CSPair;
|
||||
|
||||
/**
|
||||
Prints the text, but makes it invisible.
|
||||
*/
|
||||
readonly hidden: CSPair;
|
||||
|
||||
/**
|
||||
Puts a horizontal line through the center of the text. (Not widely supported)
|
||||
*/
|
||||
readonly strikethrough: CSPair;
|
||||
}
|
||||
|
||||
interface ForegroundColor {
|
||||
readonly black: CSPair;
|
||||
readonly red: CSPair;
|
||||
readonly green: CSPair;
|
||||
readonly yellow: CSPair;
|
||||
readonly blue: CSPair;
|
||||
readonly cyan: CSPair;
|
||||
readonly magenta: CSPair;
|
||||
readonly white: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `blackBright`.
|
||||
*/
|
||||
readonly gray: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `blackBright`.
|
||||
*/
|
||||
readonly grey: CSPair;
|
||||
|
||||
readonly blackBright: CSPair;
|
||||
readonly redBright: CSPair;
|
||||
readonly greenBright: CSPair;
|
||||
readonly yellowBright: CSPair;
|
||||
readonly blueBright: CSPair;
|
||||
readonly cyanBright: CSPair;
|
||||
readonly magentaBright: CSPair;
|
||||
readonly whiteBright: CSPair;
|
||||
}
|
||||
|
||||
interface BackgroundColor {
|
||||
readonly bgBlack: CSPair;
|
||||
readonly bgRed: CSPair;
|
||||
readonly bgGreen: CSPair;
|
||||
readonly bgYellow: CSPair;
|
||||
readonly bgBlue: CSPair;
|
||||
readonly bgCyan: CSPair;
|
||||
readonly bgMagenta: CSPair;
|
||||
readonly bgWhite: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `bgBlackBright`.
|
||||
*/
|
||||
readonly bgGray: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `bgBlackBright`.
|
||||
*/
|
||||
readonly bgGrey: CSPair;
|
||||
|
||||
readonly bgBlackBright: CSPair;
|
||||
readonly bgRedBright: CSPair;
|
||||
readonly bgGreenBright: CSPair;
|
||||
readonly bgYellowBright: CSPair;
|
||||
readonly bgBlueBright: CSPair;
|
||||
readonly bgCyanBright: CSPair;
|
||||
readonly bgMagentaBright: CSPair;
|
||||
readonly bgWhiteBright: CSPair;
|
||||
}
|
||||
}
|
||||
|
||||
declare const ansiStyles: {
|
||||
readonly modifier: ansiStyles.Modifier;
|
||||
readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase;
|
||||
readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase;
|
||||
readonly codes: ReadonlyMap<number, number>;
|
||||
} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier;
|
||||
|
||||
export = ansiStyles;
|
163
node_modules/@react-native-community/cli-platform-ios/node_modules/ansi-styles/index.js
generated
vendored
Normal file
163
node_modules/@react-native-community/cli-platform-ios/node_modules/ansi-styles/index.js
generated
vendored
Normal file
@ -0,0 +1,163 @@
|
||||
'use strict';
|
||||
|
||||
const wrapAnsi16 = (fn, offset) => (...args) => {
|
||||
const code = fn(...args);
|
||||
return `\u001B[${code + offset}m`;
|
||||
};
|
||||
|
||||
const wrapAnsi256 = (fn, offset) => (...args) => {
|
||||
const code = fn(...args);
|
||||
return `\u001B[${38 + offset};5;${code}m`;
|
||||
};
|
||||
|
||||
const wrapAnsi16m = (fn, offset) => (...args) => {
|
||||
const rgb = fn(...args);
|
||||
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
||||
};
|
||||
|
||||
const ansi2ansi = n => n;
|
||||
const rgb2rgb = (r, g, b) => [r, g, b];
|
||||
|
||||
const setLazyProperty = (object, property, get) => {
|
||||
Object.defineProperty(object, property, {
|
||||
get: () => {
|
||||
const value = get();
|
||||
|
||||
Object.defineProperty(object, property, {
|
||||
value,
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return value;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
};
|
||||
|
||||
/** @type {typeof import('color-convert')} */
|
||||
let colorConvert;
|
||||
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
||||
if (colorConvert === undefined) {
|
||||
colorConvert = require('color-convert');
|
||||
}
|
||||
|
||||
const offset = isBackground ? 10 : 0;
|
||||
const styles = {};
|
||||
|
||||
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
||||
const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace;
|
||||
if (sourceSpace === targetSpace) {
|
||||
styles[name] = wrap(identity, offset);
|
||||
} else if (typeof suite === 'object') {
|
||||
styles[name] = wrap(suite[targetSpace], offset);
|
||||
}
|
||||
}
|
||||
|
||||
return styles;
|
||||
};
|
||||
|
||||
function assembleStyles() {
|
||||
const codes = new Map();
|
||||
const styles = {
|
||||
modifier: {
|
||||
reset: [0, 0],
|
||||
// 21 isn't widely supported and 22 does the same thing
|
||||
bold: [1, 22],
|
||||
dim: [2, 22],
|
||||
italic: [3, 23],
|
||||
underline: [4, 24],
|
||||
inverse: [7, 27],
|
||||
hidden: [8, 28],
|
||||
strikethrough: [9, 29]
|
||||
},
|
||||
color: {
|
||||
black: [30, 39],
|
||||
red: [31, 39],
|
||||
green: [32, 39],
|
||||
yellow: [33, 39],
|
||||
blue: [34, 39],
|
||||
magenta: [35, 39],
|
||||
cyan: [36, 39],
|
||||
white: [37, 39],
|
||||
|
||||
// Bright color
|
||||
blackBright: [90, 39],
|
||||
redBright: [91, 39],
|
||||
greenBright: [92, 39],
|
||||
yellowBright: [93, 39],
|
||||
blueBright: [94, 39],
|
||||
magentaBright: [95, 39],
|
||||
cyanBright: [96, 39],
|
||||
whiteBright: [97, 39]
|
||||
},
|
||||
bgColor: {
|
||||
bgBlack: [40, 49],
|
||||
bgRed: [41, 49],
|
||||
bgGreen: [42, 49],
|
||||
bgYellow: [43, 49],
|
||||
bgBlue: [44, 49],
|
||||
bgMagenta: [45, 49],
|
||||
bgCyan: [46, 49],
|
||||
bgWhite: [47, 49],
|
||||
|
||||
// Bright color
|
||||
bgBlackBright: [100, 49],
|
||||
bgRedBright: [101, 49],
|
||||
bgGreenBright: [102, 49],
|
||||
bgYellowBright: [103, 49],
|
||||
bgBlueBright: [104, 49],
|
||||
bgMagentaBright: [105, 49],
|
||||
bgCyanBright: [106, 49],
|
||||
bgWhiteBright: [107, 49]
|
||||
}
|
||||
};
|
||||
|
||||
// Alias bright black as gray (and grey)
|
||||
styles.color.gray = styles.color.blackBright;
|
||||
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
||||
styles.color.grey = styles.color.blackBright;
|
||||
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
||||
|
||||
for (const [groupName, group] of Object.entries(styles)) {
|
||||
for (const [styleName, style] of Object.entries(group)) {
|
||||
styles[styleName] = {
|
||||
open: `\u001B[${style[0]}m`,
|
||||
close: `\u001B[${style[1]}m`
|
||||
};
|
||||
|
||||
group[styleName] = styles[styleName];
|
||||
|
||||
codes.set(style[0], style[1]);
|
||||
}
|
||||
|
||||
Object.defineProperty(styles, groupName, {
|
||||
value: group,
|
||||
enumerable: false
|
||||
});
|
||||
}
|
||||
|
||||
Object.defineProperty(styles, 'codes', {
|
||||
value: codes,
|
||||
enumerable: false
|
||||
});
|
||||
|
||||
styles.color.close = '\u001B[39m';
|
||||
styles.bgColor.close = '\u001B[49m';
|
||||
|
||||
setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false));
|
||||
setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false));
|
||||
setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false));
|
||||
setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true));
|
||||
setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true));
|
||||
setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true));
|
||||
|
||||
return styles;
|
||||
}
|
||||
|
||||
// Make the export immutable
|
||||
Object.defineProperty(module, 'exports', {
|
||||
enumerable: true,
|
||||
get: assembleStyles
|
||||
});
|
9
node_modules/@react-native-community/cli-platform-ios/node_modules/ansi-styles/license
generated
vendored
Normal file
9
node_modules/@react-native-community/cli-platform-ios/node_modules/ansi-styles/license
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
56
node_modules/@react-native-community/cli-platform-ios/node_modules/ansi-styles/package.json
generated
vendored
Normal file
56
node_modules/@react-native-community/cli-platform-ios/node_modules/ansi-styles/package.json
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "ansi-styles",
|
||||
"version": "4.3.0",
|
||||
"description": "ANSI escape codes for styling strings in the terminal",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/ansi-styles",
|
||||
"funding": "https://github.com/chalk/ansi-styles?sponsor=1",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd",
|
||||
"screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"dependencies": {
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/color-convert": "^1.9.0",
|
||||
"ava": "^2.3.0",
|
||||
"svg-term-cli": "^2.1.1",
|
||||
"tsd": "^0.11.0",
|
||||
"xo": "^0.25.3"
|
||||
}
|
||||
}
|
152
node_modules/@react-native-community/cli-platform-ios/node_modules/ansi-styles/readme.md
generated
vendored
Normal file
152
node_modules/@react-native-community/cli-platform-ios/node_modules/ansi-styles/readme.md
generated
vendored
Normal file
@ -0,0 +1,152 @@
|
||||
# ansi-styles [](https://travis-ci.org/chalk/ansi-styles)
|
||||
|
||||
> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
|
||||
|
||||
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
|
||||
|
||||
<img src="screenshot.svg" width="900">
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-styles
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const style = require('ansi-styles');
|
||||
|
||||
console.log(`${style.green.open}Hello world!${style.green.close}`);
|
||||
|
||||
|
||||
// Color conversion between 16/256/truecolor
|
||||
// NOTE: If conversion goes to 16 colors or 256 colors, the original color
|
||||
// may be degraded to fit that color palette. This means terminals
|
||||
// that do not support 16 million colors will best-match the
|
||||
// original color.
|
||||
console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close);
|
||||
console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close);
|
||||
console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close);
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
Each style has an `open` and `close` property.
|
||||
|
||||
## Styles
|
||||
|
||||
### Modifiers
|
||||
|
||||
- `reset`
|
||||
- `bold`
|
||||
- `dim`
|
||||
- `italic` *(Not widely supported)*
|
||||
- `underline`
|
||||
- `inverse`
|
||||
- `hidden`
|
||||
- `strikethrough` *(Not widely supported)*
|
||||
|
||||
### Colors
|
||||
|
||||
- `black`
|
||||
- `red`
|
||||
- `green`
|
||||
- `yellow`
|
||||
- `blue`
|
||||
- `magenta`
|
||||
- `cyan`
|
||||
- `white`
|
||||
- `blackBright` (alias: `gray`, `grey`)
|
||||
- `redBright`
|
||||
- `greenBright`
|
||||
- `yellowBright`
|
||||
- `blueBright`
|
||||
- `magentaBright`
|
||||
- `cyanBright`
|
||||
- `whiteBright`
|
||||
|
||||
### Background colors
|
||||
|
||||
- `bgBlack`
|
||||
- `bgRed`
|
||||
- `bgGreen`
|
||||
- `bgYellow`
|
||||
- `bgBlue`
|
||||
- `bgMagenta`
|
||||
- `bgCyan`
|
||||
- `bgWhite`
|
||||
- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
|
||||
- `bgRedBright`
|
||||
- `bgGreenBright`
|
||||
- `bgYellowBright`
|
||||
- `bgBlueBright`
|
||||
- `bgMagentaBright`
|
||||
- `bgCyanBright`
|
||||
- `bgWhiteBright`
|
||||
|
||||
## Advanced usage
|
||||
|
||||
By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
|
||||
|
||||
- `style.modifier`
|
||||
- `style.color`
|
||||
- `style.bgColor`
|
||||
|
||||
###### Example
|
||||
|
||||
```js
|
||||
console.log(style.color.green.open);
|
||||
```
|
||||
|
||||
Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values.
|
||||
|
||||
###### Example
|
||||
|
||||
```js
|
||||
console.log(style.codes.get(36));
|
||||
//=> 39
|
||||
```
|
||||
|
||||
## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728)
|
||||
|
||||
`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors.
|
||||
|
||||
The following color spaces from `color-convert` are supported:
|
||||
|
||||
- `rgb`
|
||||
- `hex`
|
||||
- `keyword`
|
||||
- `hsl`
|
||||
- `hsv`
|
||||
- `hwb`
|
||||
- `ansi`
|
||||
- `ansi256`
|
||||
|
||||
To use these, call the associated conversion function with the intended output, for example:
|
||||
|
||||
```js
|
||||
style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code
|
||||
style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code
|
||||
|
||||
style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
|
||||
style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
|
||||
|
||||
style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code
|
||||
style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
## For enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
411
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/index.d.ts
generated
vendored
Normal file
411
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,411 @@
|
||||
declare const enum LevelEnum {
|
||||
/**
|
||||
All colors disabled.
|
||||
*/
|
||||
None = 0,
|
||||
|
||||
/**
|
||||
Basic 16 colors support.
|
||||
*/
|
||||
Basic = 1,
|
||||
|
||||
/**
|
||||
ANSI 256 colors support.
|
||||
*/
|
||||
Ansi256 = 2,
|
||||
|
||||
/**
|
||||
Truecolor 16 million colors support.
|
||||
*/
|
||||
TrueColor = 3
|
||||
}
|
||||
|
||||
/**
|
||||
Basic foreground colors.
|
||||
|
||||
[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support)
|
||||
*/
|
||||
declare type ForegroundColor =
|
||||
| 'black'
|
||||
| 'red'
|
||||
| 'green'
|
||||
| 'yellow'
|
||||
| 'blue'
|
||||
| 'magenta'
|
||||
| 'cyan'
|
||||
| 'white'
|
||||
| 'gray'
|
||||
| 'grey'
|
||||
| 'blackBright'
|
||||
| 'redBright'
|
||||
| 'greenBright'
|
||||
| 'yellowBright'
|
||||
| 'blueBright'
|
||||
| 'magentaBright'
|
||||
| 'cyanBright'
|
||||
| 'whiteBright';
|
||||
|
||||
/**
|
||||
Basic background colors.
|
||||
|
||||
[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support)
|
||||
*/
|
||||
declare type BackgroundColor =
|
||||
| 'bgBlack'
|
||||
| 'bgRed'
|
||||
| 'bgGreen'
|
||||
| 'bgYellow'
|
||||
| 'bgBlue'
|
||||
| 'bgMagenta'
|
||||
| 'bgCyan'
|
||||
| 'bgWhite'
|
||||
| 'bgGray'
|
||||
| 'bgGrey'
|
||||
| 'bgBlackBright'
|
||||
| 'bgRedBright'
|
||||
| 'bgGreenBright'
|
||||
| 'bgYellowBright'
|
||||
| 'bgBlueBright'
|
||||
| 'bgMagentaBright'
|
||||
| 'bgCyanBright'
|
||||
| 'bgWhiteBright';
|
||||
|
||||
/**
|
||||
Basic colors.
|
||||
|
||||
[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support)
|
||||
*/
|
||||
declare type Color = ForegroundColor | BackgroundColor;
|
||||
|
||||
declare type Modifiers =
|
||||
| 'reset'
|
||||
| 'bold'
|
||||
| 'dim'
|
||||
| 'italic'
|
||||
| 'underline'
|
||||
| 'inverse'
|
||||
| 'hidden'
|
||||
| 'strikethrough'
|
||||
| 'visible';
|
||||
|
||||
declare namespace chalk {
|
||||
type Level = LevelEnum;
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
Specify the color support for Chalk.
|
||||
By default, color support is automatically detected based on the environment.
|
||||
*/
|
||||
level?: Level;
|
||||
}
|
||||
|
||||
interface Instance {
|
||||
/**
|
||||
Return a new Chalk instance.
|
||||
*/
|
||||
new (options?: Options): Chalk;
|
||||
}
|
||||
|
||||
/**
|
||||
Detect whether the terminal supports color.
|
||||
*/
|
||||
interface ColorSupport {
|
||||
/**
|
||||
The color level used by Chalk.
|
||||
*/
|
||||
level: Level;
|
||||
|
||||
/**
|
||||
Return whether Chalk supports basic 16 colors.
|
||||
*/
|
||||
hasBasic: boolean;
|
||||
|
||||
/**
|
||||
Return whether Chalk supports ANSI 256 colors.
|
||||
*/
|
||||
has256: boolean;
|
||||
|
||||
/**
|
||||
Return whether Chalk supports Truecolor 16 million colors.
|
||||
*/
|
||||
has16m: boolean;
|
||||
}
|
||||
|
||||
interface ChalkFunction {
|
||||
/**
|
||||
Use a template string.
|
||||
|
||||
@remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341))
|
||||
|
||||
@example
|
||||
```
|
||||
import chalk = require('chalk');
|
||||
|
||||
log(chalk`
|
||||
CPU: {red ${cpu.totalPercent}%}
|
||||
RAM: {green ${ram.used / ram.total * 100}%}
|
||||
DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
|
||||
`);
|
||||
```
|
||||
*/
|
||||
(text: TemplateStringsArray, ...placeholders: unknown[]): string;
|
||||
|
||||
(...text: unknown[]): string;
|
||||
}
|
||||
|
||||
interface Chalk extends ChalkFunction {
|
||||
/**
|
||||
Return a new Chalk instance.
|
||||
*/
|
||||
Instance: Instance;
|
||||
|
||||
/**
|
||||
The color support for Chalk.
|
||||
By default, color support is automatically detected based on the environment.
|
||||
*/
|
||||
level: Level;
|
||||
|
||||
/**
|
||||
Use HEX value to set text color.
|
||||
|
||||
@param color - Hexadecimal value representing the desired color.
|
||||
|
||||
@example
|
||||
```
|
||||
import chalk = require('chalk');
|
||||
|
||||
chalk.hex('#DEADED');
|
||||
```
|
||||
*/
|
||||
hex(color: string): Chalk;
|
||||
|
||||
/**
|
||||
Use keyword color value to set text color.
|
||||
|
||||
@param color - Keyword value representing the desired color.
|
||||
|
||||
@example
|
||||
```
|
||||
import chalk = require('chalk');
|
||||
|
||||
chalk.keyword('orange');
|
||||
```
|
||||
*/
|
||||
keyword(color: string): Chalk;
|
||||
|
||||
/**
|
||||
Use RGB values to set text color.
|
||||
*/
|
||||
rgb(red: number, green: number, blue: number): Chalk;
|
||||
|
||||
/**
|
||||
Use HSL values to set text color.
|
||||
*/
|
||||
hsl(hue: number, saturation: number, lightness: number): Chalk;
|
||||
|
||||
/**
|
||||
Use HSV values to set text color.
|
||||
*/
|
||||
hsv(hue: number, saturation: number, value: number): Chalk;
|
||||
|
||||
/**
|
||||
Use HWB values to set text color.
|
||||
*/
|
||||
hwb(hue: number, whiteness: number, blackness: number): Chalk;
|
||||
|
||||
/**
|
||||
Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color.
|
||||
|
||||
30 <= code && code < 38 || 90 <= code && code < 98
|
||||
For example, 31 for red, 91 for redBright.
|
||||
*/
|
||||
ansi(code: number): Chalk;
|
||||
|
||||
/**
|
||||
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
|
||||
*/
|
||||
ansi256(index: number): Chalk;
|
||||
|
||||
/**
|
||||
Use HEX value to set background color.
|
||||
|
||||
@param color - Hexadecimal value representing the desired color.
|
||||
|
||||
@example
|
||||
```
|
||||
import chalk = require('chalk');
|
||||
|
||||
chalk.bgHex('#DEADED');
|
||||
```
|
||||
*/
|
||||
bgHex(color: string): Chalk;
|
||||
|
||||
/**
|
||||
Use keyword color value to set background color.
|
||||
|
||||
@param color - Keyword value representing the desired color.
|
||||
|
||||
@example
|
||||
```
|
||||
import chalk = require('chalk');
|
||||
|
||||
chalk.bgKeyword('orange');
|
||||
```
|
||||
*/
|
||||
bgKeyword(color: string): Chalk;
|
||||
|
||||
/**
|
||||
Use RGB values to set background color.
|
||||
*/
|
||||
bgRgb(red: number, green: number, blue: number): Chalk;
|
||||
|
||||
/**
|
||||
Use HSL values to set background color.
|
||||
*/
|
||||
bgHsl(hue: number, saturation: number, lightness: number): Chalk;
|
||||
|
||||
/**
|
||||
Use HSV values to set background color.
|
||||
*/
|
||||
bgHsv(hue: number, saturation: number, value: number): Chalk;
|
||||
|
||||
/**
|
||||
Use HWB values to set background color.
|
||||
*/
|
||||
bgHwb(hue: number, whiteness: number, blackness: number): Chalk;
|
||||
|
||||
/**
|
||||
Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color.
|
||||
|
||||
30 <= code && code < 38 || 90 <= code && code < 98
|
||||
For example, 31 for red, 91 for redBright.
|
||||
Use the foreground code, not the background code (for example, not 41, nor 101).
|
||||
*/
|
||||
bgAnsi(code: number): Chalk;
|
||||
|
||||
/**
|
||||
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color.
|
||||
*/
|
||||
bgAnsi256(index: number): Chalk;
|
||||
|
||||
/**
|
||||
Modifier: Resets the current color chain.
|
||||
*/
|
||||
readonly reset: Chalk;
|
||||
|
||||
/**
|
||||
Modifier: Make text bold.
|
||||
*/
|
||||
readonly bold: Chalk;
|
||||
|
||||
/**
|
||||
Modifier: Emitting only a small amount of light.
|
||||
*/
|
||||
readonly dim: Chalk;
|
||||
|
||||
/**
|
||||
Modifier: Make text italic. (Not widely supported)
|
||||
*/
|
||||
readonly italic: Chalk;
|
||||
|
||||
/**
|
||||
Modifier: Make text underline. (Not widely supported)
|
||||
*/
|
||||
readonly underline: Chalk;
|
||||
|
||||
/**
|
||||
Modifier: Inverse background and foreground colors.
|
||||
*/
|
||||
readonly inverse: Chalk;
|
||||
|
||||
/**
|
||||
Modifier: Prints the text, but makes it invisible.
|
||||
*/
|
||||
readonly hidden: Chalk;
|
||||
|
||||
/**
|
||||
Modifier: Puts a horizontal line through the center of the text. (Not widely supported)
|
||||
*/
|
||||
readonly strikethrough: Chalk;
|
||||
|
||||
/**
|
||||
Modifier: Prints the text only when Chalk has a color support level > 0.
|
||||
Can be useful for things that are purely cosmetic.
|
||||
*/
|
||||
readonly visible: Chalk;
|
||||
|
||||
readonly black: Chalk;
|
||||
readonly red: Chalk;
|
||||
readonly green: Chalk;
|
||||
readonly yellow: Chalk;
|
||||
readonly blue: Chalk;
|
||||
readonly magenta: Chalk;
|
||||
readonly cyan: Chalk;
|
||||
readonly white: Chalk;
|
||||
|
||||
/*
|
||||
Alias for `blackBright`.
|
||||
*/
|
||||
readonly gray: Chalk;
|
||||
|
||||
/*
|
||||
Alias for `blackBright`.
|
||||
*/
|
||||
readonly grey: Chalk;
|
||||
|
||||
readonly blackBright: Chalk;
|
||||
readonly redBright: Chalk;
|
||||
readonly greenBright: Chalk;
|
||||
readonly yellowBright: Chalk;
|
||||
readonly blueBright: Chalk;
|
||||
readonly magentaBright: Chalk;
|
||||
readonly cyanBright: Chalk;
|
||||
readonly whiteBright: Chalk;
|
||||
|
||||
readonly bgBlack: Chalk;
|
||||
readonly bgRed: Chalk;
|
||||
readonly bgGreen: Chalk;
|
||||
readonly bgYellow: Chalk;
|
||||
readonly bgBlue: Chalk;
|
||||
readonly bgMagenta: Chalk;
|
||||
readonly bgCyan: Chalk;
|
||||
readonly bgWhite: Chalk;
|
||||
|
||||
/*
|
||||
Alias for `bgBlackBright`.
|
||||
*/
|
||||
readonly bgGray: Chalk;
|
||||
|
||||
/*
|
||||
Alias for `bgBlackBright`.
|
||||
*/
|
||||
readonly bgGrey: Chalk;
|
||||
|
||||
readonly bgBlackBright: Chalk;
|
||||
readonly bgRedBright: Chalk;
|
||||
readonly bgGreenBright: Chalk;
|
||||
readonly bgYellowBright: Chalk;
|
||||
readonly bgBlueBright: Chalk;
|
||||
readonly bgMagentaBright: Chalk;
|
||||
readonly bgCyanBright: Chalk;
|
||||
readonly bgWhiteBright: Chalk;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Main Chalk object that allows to chain styles together.
|
||||
Call the last one as a method with a string argument.
|
||||
Order doesn't matter, and later styles take precedent in case of a conflict.
|
||||
This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
|
||||
*/
|
||||
declare const chalk: chalk.Chalk & chalk.ChalkFunction & {
|
||||
supportsColor: chalk.ColorSupport | false;
|
||||
Level: typeof LevelEnum;
|
||||
Color: Color;
|
||||
ForegroundColor: ForegroundColor;
|
||||
BackgroundColor: BackgroundColor;
|
||||
Modifiers: Modifiers;
|
||||
stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false};
|
||||
};
|
||||
|
||||
export = chalk;
|
9
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/license
generated
vendored
Normal file
9
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/license
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
63
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/package.json
generated
vendored
Normal file
63
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/package.json
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
{
|
||||
"name": "chalk",
|
||||
"version": "3.0.0",
|
||||
"description": "Terminal string styling done right",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/chalk",
|
||||
"main": "source",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava && tsd",
|
||||
"bench": "matcha benchmark.js"
|
||||
},
|
||||
"files": [
|
||||
"source",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"str",
|
||||
"ansi",
|
||||
"style",
|
||||
"styles",
|
||||
"tty",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^2.4.0",
|
||||
"coveralls": "^3.0.7",
|
||||
"execa": "^3.2.0",
|
||||
"import-fresh": "^3.1.0",
|
||||
"matcha": "^0.7.0",
|
||||
"nyc": "^14.1.1",
|
||||
"resolve-from": "^5.0.0",
|
||||
"tsd": "^0.7.4",
|
||||
"xo": "^0.25.3"
|
||||
},
|
||||
"xo": {
|
||||
"rules": {
|
||||
"unicorn/prefer-string-slice": "off",
|
||||
"unicorn/prefer-includes": "off"
|
||||
}
|
||||
}
|
||||
}
|
304
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/readme.md
generated
vendored
Normal file
304
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/readme.md
generated
vendored
Normal file
@ -0,0 +1,304 @@
|
||||
<h1 align="center">
|
||||
<br>
|
||||
<br>
|
||||
<img width="320" src="media/logo.svg" alt="Chalk">
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</h1>
|
||||
|
||||
> Terminal string styling done right
|
||||
|
||||
[](https://travis-ci.org/chalk/chalk) [](https://coveralls.io/github/chalk/chalk?branch=master) [](https://www.npmjs.com/package/chalk?activeTab=dependents) [](https://www.npmjs.com/package/chalk) [](https://www.youtube.com/watch?v=9auOCbH5Ns4) [](https://github.com/xojs/xo) 
|
||||
|
||||
<img src="https://cdn.jsdelivr.net/gh/chalk/ansi-styles@8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
|
||||
|
||||
|
||||
## Highlights
|
||||
|
||||
- Expressive API
|
||||
- Highly performant
|
||||
- Ability to nest styles
|
||||
- [256/Truecolor color support](#256-and-truecolor-color-support)
|
||||
- Auto-detects color support
|
||||
- Doesn't extend `String.prototype`
|
||||
- Clean and focused
|
||||
- Actively maintained
|
||||
- [Used by ~46,000 packages](https://www.npmjs.com/browse/depended/chalk) as of October 1, 2019
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```console
|
||||
$ npm install chalk
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const chalk = require('chalk');
|
||||
|
||||
console.log(chalk.blue('Hello world!'));
|
||||
```
|
||||
|
||||
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
|
||||
|
||||
```js
|
||||
const chalk = require('chalk');
|
||||
const log = console.log;
|
||||
|
||||
// Combine styled and normal strings
|
||||
log(chalk.blue('Hello') + ' World' + chalk.red('!'));
|
||||
|
||||
// Compose multiple styles using the chainable API
|
||||
log(chalk.blue.bgRed.bold('Hello world!'));
|
||||
|
||||
// Pass in multiple arguments
|
||||
log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
|
||||
|
||||
// Nest styles
|
||||
log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
|
||||
|
||||
// Nest styles of the same type even (color, underline, background)
|
||||
log(chalk.green(
|
||||
'I am a green line ' +
|
||||
chalk.blue.underline.bold('with a blue substring') +
|
||||
' that becomes green again!'
|
||||
));
|
||||
|
||||
// ES2015 template literal
|
||||
log(`
|
||||
CPU: ${chalk.red('90%')}
|
||||
RAM: ${chalk.green('40%')}
|
||||
DISK: ${chalk.yellow('70%')}
|
||||
`);
|
||||
|
||||
// ES2015 tagged template literal
|
||||
log(chalk`
|
||||
CPU: {red ${cpu.totalPercent}%}
|
||||
RAM: {green ${ram.used / ram.total * 100}%}
|
||||
DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
|
||||
`);
|
||||
|
||||
// Use RGB colors in terminal emulators that support it.
|
||||
log(chalk.keyword('orange')('Yay for orange colored text!'));
|
||||
log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
|
||||
log(chalk.hex('#DEADED').bold('Bold gray!'));
|
||||
```
|
||||
|
||||
Easily define your own themes:
|
||||
|
||||
```js
|
||||
const chalk = require('chalk');
|
||||
|
||||
const error = chalk.bold.red;
|
||||
const warning = chalk.keyword('orange');
|
||||
|
||||
console.log(error('Error!'));
|
||||
console.log(warning('Warning!'));
|
||||
```
|
||||
|
||||
Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):
|
||||
|
||||
```js
|
||||
const name = 'Sindre';
|
||||
console.log(chalk.green('Hello %s'), name);
|
||||
//=> 'Hello Sindre'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### chalk.`<style>[.<style>...](string, [string...])`
|
||||
|
||||
Example: `chalk.red.bold.underline('Hello', 'world');`
|
||||
|
||||
Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
|
||||
|
||||
Multiple arguments will be separated by space.
|
||||
|
||||
### chalk.level
|
||||
|
||||
Specifies the level of color support.
|
||||
|
||||
Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers.
|
||||
|
||||
If you need to change this in a reusable module, create a new instance:
|
||||
|
||||
```js
|
||||
const ctx = new chalk.Instance({level: 0});
|
||||
```
|
||||
|
||||
| Level | Description |
|
||||
| :---: | :--- |
|
||||
| `0` | All colors disabled |
|
||||
| `1` | Basic color support (16 colors) |
|
||||
| `2` | 256 color support |
|
||||
| `3` | Truecolor support (16 million colors) |
|
||||
|
||||
### chalk.supportsColor
|
||||
|
||||
Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
|
||||
|
||||
Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
|
||||
|
||||
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
|
||||
|
||||
### chalk.stderr and chalk.stderr.supportsColor
|
||||
|
||||
`chalk.stderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `chalk.supportsColor` apply to this too. `chalk.stderr.supportsColor` is exposed for convenience.
|
||||
|
||||
|
||||
## Styles
|
||||
|
||||
### Modifiers
|
||||
|
||||
- `reset` - Resets the current color chain.
|
||||
- `bold` - Make text bold.
|
||||
- `dim` - Emitting only a small amount of light.
|
||||
- `italic` - Make text italic. *(Not widely supported)*
|
||||
- `underline` - Make text underline. *(Not widely supported)*
|
||||
- `inverse`- Inverse background and foreground colors.
|
||||
- `hidden` - Prints the text, but makes it invisible.
|
||||
- `strikethrough` - Puts a horizontal line through the center of the text. *(Not widely supported)*
|
||||
- `visible`- Prints the text only when Chalk has a color level > 0. Can be useful for things that are purely cosmetic.
|
||||
|
||||
### Colors
|
||||
|
||||
- `black`
|
||||
- `red`
|
||||
- `green`
|
||||
- `yellow`
|
||||
- `blue`
|
||||
- `magenta`
|
||||
- `cyan`
|
||||
- `white`
|
||||
- `blackBright` (alias: `gray`, `grey`)
|
||||
- `redBright`
|
||||
- `greenBright`
|
||||
- `yellowBright`
|
||||
- `blueBright`
|
||||
- `magentaBright`
|
||||
- `cyanBright`
|
||||
- `whiteBright`
|
||||
|
||||
### Background colors
|
||||
|
||||
- `bgBlack`
|
||||
- `bgRed`
|
||||
- `bgGreen`
|
||||
- `bgYellow`
|
||||
- `bgBlue`
|
||||
- `bgMagenta`
|
||||
- `bgCyan`
|
||||
- `bgWhite`
|
||||
- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
|
||||
- `bgRedBright`
|
||||
- `bgGreenBright`
|
||||
- `bgYellowBright`
|
||||
- `bgBlueBright`
|
||||
- `bgMagentaBright`
|
||||
- `bgCyanBright`
|
||||
- `bgWhiteBright`
|
||||
|
||||
|
||||
## Tagged template literal
|
||||
|
||||
Chalk can be used as a [tagged template literal](http://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
|
||||
|
||||
```js
|
||||
const chalk = require('chalk');
|
||||
|
||||
const miles = 18;
|
||||
const calculateFeet = miles => miles * 5280;
|
||||
|
||||
console.log(chalk`
|
||||
There are {bold 5280 feet} in a mile.
|
||||
In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
|
||||
`);
|
||||
```
|
||||
|
||||
Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).
|
||||
|
||||
Template styles are chained exactly like normal Chalk styles. The following two statements are equivalent:
|
||||
|
||||
```js
|
||||
console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
|
||||
console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
|
||||
```
|
||||
|
||||
Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters.
|
||||
|
||||
All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
|
||||
|
||||
|
||||
## 256 and Truecolor color support
|
||||
|
||||
Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
|
||||
|
||||
Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red).
|
||||
|
||||
Examples:
|
||||
|
||||
- `chalk.hex('#DEADED').underline('Hello, world!')`
|
||||
- `chalk.keyword('orange')('Some orange text')`
|
||||
- `chalk.rgb(15, 100, 204).inverse('Hello!')`
|
||||
|
||||
Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors).
|
||||
|
||||
- `chalk.bgHex('#DEADED').underline('Hello, world!')`
|
||||
- `chalk.bgKeyword('orange')('Some orange text')`
|
||||
- `chalk.bgRgb(15, 100, 204).inverse('Hello!')`
|
||||
|
||||
The following color models can be used:
|
||||
|
||||
- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
|
||||
- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
|
||||
- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
|
||||
- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
|
||||
- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
|
||||
- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
|
||||
- [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')`
|
||||
- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`
|
||||
|
||||
|
||||
## Windows
|
||||
|
||||
If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.
|
||||
|
||||
|
||||
## Origin story
|
||||
|
||||
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
|
||||
|
||||
|
||||
## chalk for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of chalk and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-chalk?utm_source=npm-chalk&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
|
||||
- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
|
||||
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
|
||||
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
|
||||
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream
|
||||
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
|
||||
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
|
||||
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
|
||||
- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
|
||||
- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models
|
||||
- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
|
||||
- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
|
||||
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
|
||||
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
233
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/source/index.js
generated
vendored
Normal file
233
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/source/index.js
generated
vendored
Normal file
@ -0,0 +1,233 @@
|
||||
'use strict';
|
||||
const ansiStyles = require('ansi-styles');
|
||||
const {stdout: stdoutColor, stderr: stderrColor} = require('supports-color');
|
||||
const {
|
||||
stringReplaceAll,
|
||||
stringEncaseCRLFWithFirstIndex
|
||||
} = require('./util');
|
||||
|
||||
// `supportsColor.level` → `ansiStyles.color[name]` mapping
|
||||
const levelMapping = [
|
||||
'ansi',
|
||||
'ansi',
|
||||
'ansi256',
|
||||
'ansi16m'
|
||||
];
|
||||
|
||||
const styles = Object.create(null);
|
||||
|
||||
const applyOptions = (object, options = {}) => {
|
||||
if (options.level > 3 || options.level < 0) {
|
||||
throw new Error('The `level` option should be an integer from 0 to 3');
|
||||
}
|
||||
|
||||
// Detect level if not set manually
|
||||
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
||||
object.level = options.level === undefined ? colorLevel : options.level;
|
||||
};
|
||||
|
||||
class ChalkClass {
|
||||
constructor(options) {
|
||||
return chalkFactory(options);
|
||||
}
|
||||
}
|
||||
|
||||
const chalkFactory = options => {
|
||||
const chalk = {};
|
||||
applyOptions(chalk, options);
|
||||
|
||||
chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
|
||||
|
||||
Object.setPrototypeOf(chalk, Chalk.prototype);
|
||||
Object.setPrototypeOf(chalk.template, chalk);
|
||||
|
||||
chalk.template.constructor = () => {
|
||||
throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.');
|
||||
};
|
||||
|
||||
chalk.template.Instance = ChalkClass;
|
||||
|
||||
return chalk.template;
|
||||
};
|
||||
|
||||
function Chalk(options) {
|
||||
return chalkFactory(options);
|
||||
}
|
||||
|
||||
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
||||
styles[styleName] = {
|
||||
get() {
|
||||
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
||||
Object.defineProperty(this, styleName, {value: builder});
|
||||
return builder;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
styles.visible = {
|
||||
get() {
|
||||
const builder = createBuilder(this, this._styler, true);
|
||||
Object.defineProperty(this, 'visible', {value: builder});
|
||||
return builder;
|
||||
}
|
||||
};
|
||||
|
||||
const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256'];
|
||||
|
||||
for (const model of usedModels) {
|
||||
styles[model] = {
|
||||
get() {
|
||||
const {level} = this;
|
||||
return function (...arguments_) {
|
||||
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
||||
return createBuilder(this, styler, this._isEmpty);
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
for (const model of usedModels) {
|
||||
const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
|
||||
styles[bgModel] = {
|
||||
get() {
|
||||
const {level} = this;
|
||||
return function (...arguments_) {
|
||||
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
||||
return createBuilder(this, styler, this._isEmpty);
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const proto = Object.defineProperties(() => {}, {
|
||||
...styles,
|
||||
level: {
|
||||
enumerable: true,
|
||||
get() {
|
||||
return this._generator.level;
|
||||
},
|
||||
set(level) {
|
||||
this._generator.level = level;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const createStyler = (open, close, parent) => {
|
||||
let openAll;
|
||||
let closeAll;
|
||||
if (parent === undefined) {
|
||||
openAll = open;
|
||||
closeAll = close;
|
||||
} else {
|
||||
openAll = parent.openAll + open;
|
||||
closeAll = close + parent.closeAll;
|
||||
}
|
||||
|
||||
return {
|
||||
open,
|
||||
close,
|
||||
openAll,
|
||||
closeAll,
|
||||
parent
|
||||
};
|
||||
};
|
||||
|
||||
const createBuilder = (self, _styler, _isEmpty) => {
|
||||
const builder = (...arguments_) => {
|
||||
// Single argument is hot path, implicit coercion is faster than anything
|
||||
// eslint-disable-next-line no-implicit-coercion
|
||||
return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));
|
||||
};
|
||||
|
||||
// `__proto__` is used because we must return a function, but there is
|
||||
// no way to create a function with a different prototype
|
||||
builder.__proto__ = proto; // eslint-disable-line no-proto
|
||||
|
||||
builder._generator = self;
|
||||
builder._styler = _styler;
|
||||
builder._isEmpty = _isEmpty;
|
||||
|
||||
return builder;
|
||||
};
|
||||
|
||||
const applyStyle = (self, string) => {
|
||||
if (self.level <= 0 || !string) {
|
||||
return self._isEmpty ? '' : string;
|
||||
}
|
||||
|
||||
let styler = self._styler;
|
||||
|
||||
if (styler === undefined) {
|
||||
return string;
|
||||
}
|
||||
|
||||
const {openAll, closeAll} = styler;
|
||||
if (string.indexOf('\u001B') !== -1) {
|
||||
while (styler !== undefined) {
|
||||
// Replace any instances already present with a re-opening code
|
||||
// otherwise only the part of the string until said closing code
|
||||
// will be colored, and the rest will simply be 'plain'.
|
||||
string = stringReplaceAll(string, styler.close, styler.open);
|
||||
|
||||
styler = styler.parent;
|
||||
}
|
||||
}
|
||||
|
||||
// We can move both next actions out of loop, because remaining actions in loop won't have
|
||||
// any/visible effect on parts we add here. Close the styling before a linebreak and reopen
|
||||
// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92
|
||||
const lfIndex = string.indexOf('\n');
|
||||
if (lfIndex !== -1) {
|
||||
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
||||
}
|
||||
|
||||
return openAll + string + closeAll;
|
||||
};
|
||||
|
||||
let template;
|
||||
const chalkTag = (chalk, ...strings) => {
|
||||
const [firstString] = strings;
|
||||
|
||||
if (!Array.isArray(firstString)) {
|
||||
// If chalk() was called by itself or with a string,
|
||||
// return the string itself as a string.
|
||||
return strings.join(' ');
|
||||
}
|
||||
|
||||
const arguments_ = strings.slice(1);
|
||||
const parts = [firstString.raw[0]];
|
||||
|
||||
for (let i = 1; i < firstString.length; i++) {
|
||||
parts.push(
|
||||
String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'),
|
||||
String(firstString.raw[i])
|
||||
);
|
||||
}
|
||||
|
||||
if (template === undefined) {
|
||||
template = require('./templates');
|
||||
}
|
||||
|
||||
return template(chalk, parts.join(''));
|
||||
};
|
||||
|
||||
Object.defineProperties(Chalk.prototype, styles);
|
||||
|
||||
const chalk = Chalk(); // eslint-disable-line new-cap
|
||||
chalk.supportsColor = stdoutColor;
|
||||
chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap
|
||||
chalk.stderr.supportsColor = stderrColor;
|
||||
|
||||
// For TypeScript
|
||||
chalk.Level = {
|
||||
None: 0,
|
||||
Basic: 1,
|
||||
Ansi256: 2,
|
||||
TrueColor: 3,
|
||||
0: 'None',
|
||||
1: 'Basic',
|
||||
2: 'Ansi256',
|
||||
3: 'TrueColor'
|
||||
};
|
||||
|
||||
module.exports = chalk;
|
134
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/source/templates.js
generated
vendored
Normal file
134
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/source/templates.js
generated
vendored
Normal file
@ -0,0 +1,134 @@
|
||||
'use strict';
|
||||
const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
||||
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
||||
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
||||
const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi;
|
||||
|
||||
const ESCAPES = new Map([
|
||||
['n', '\n'],
|
||||
['r', '\r'],
|
||||
['t', '\t'],
|
||||
['b', '\b'],
|
||||
['f', '\f'],
|
||||
['v', '\v'],
|
||||
['0', '\0'],
|
||||
['\\', '\\'],
|
||||
['e', '\u001B'],
|
||||
['a', '\u0007']
|
||||
]);
|
||||
|
||||
function unescape(c) {
|
||||
const u = c[0] === 'u';
|
||||
const bracket = c[1] === '{';
|
||||
|
||||
if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
|
||||
return String.fromCharCode(parseInt(c.slice(1), 16));
|
||||
}
|
||||
|
||||
if (u && bracket) {
|
||||
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
||||
}
|
||||
|
||||
return ESCAPES.get(c) || c;
|
||||
}
|
||||
|
||||
function parseArguments(name, arguments_) {
|
||||
const results = [];
|
||||
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
||||
let matches;
|
||||
|
||||
for (const chunk of chunks) {
|
||||
const number = Number(chunk);
|
||||
if (!Number.isNaN(number)) {
|
||||
results.push(number);
|
||||
} else if ((matches = chunk.match(STRING_REGEX))) {
|
||||
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
||||
} else {
|
||||
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
function parseStyle(style) {
|
||||
STYLE_REGEX.lastIndex = 0;
|
||||
|
||||
const results = [];
|
||||
let matches;
|
||||
|
||||
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
||||
const name = matches[1];
|
||||
|
||||
if (matches[2]) {
|
||||
const args = parseArguments(name, matches[2]);
|
||||
results.push([name].concat(args));
|
||||
} else {
|
||||
results.push([name]);
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
function buildStyle(chalk, styles) {
|
||||
const enabled = {};
|
||||
|
||||
for (const layer of styles) {
|
||||
for (const style of layer.styles) {
|
||||
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
||||
}
|
||||
}
|
||||
|
||||
let current = chalk;
|
||||
for (const [styleName, styles] of Object.entries(enabled)) {
|
||||
if (!Array.isArray(styles)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(styleName in current)) {
|
||||
throw new Error(`Unknown Chalk style: ${styleName}`);
|
||||
}
|
||||
|
||||
current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
|
||||
}
|
||||
|
||||
return current;
|
||||
}
|
||||
|
||||
module.exports = (chalk, temporary) => {
|
||||
const styles = [];
|
||||
const chunks = [];
|
||||
let chunk = [];
|
||||
|
||||
// eslint-disable-next-line max-params
|
||||
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
||||
if (escapeCharacter) {
|
||||
chunk.push(unescape(escapeCharacter));
|
||||
} else if (style) {
|
||||
const string = chunk.join('');
|
||||
chunk = [];
|
||||
chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
|
||||
styles.push({inverse, styles: parseStyle(style)});
|
||||
} else if (close) {
|
||||
if (styles.length === 0) {
|
||||
throw new Error('Found extraneous } in Chalk template literal');
|
||||
}
|
||||
|
||||
chunks.push(buildStyle(chalk, styles)(chunk.join('')));
|
||||
chunk = [];
|
||||
styles.pop();
|
||||
} else {
|
||||
chunk.push(character);
|
||||
}
|
||||
});
|
||||
|
||||
chunks.push(chunk.join(''));
|
||||
|
||||
if (styles.length > 0) {
|
||||
const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
|
||||
throw new Error(errMsg);
|
||||
}
|
||||
|
||||
return chunks.join('');
|
||||
};
|
39
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/source/util.js
generated
vendored
Normal file
39
node_modules/@react-native-community/cli-platform-ios/node_modules/chalk/source/util.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
const stringReplaceAll = (string, substring, replacer) => {
|
||||
let index = string.indexOf(substring);
|
||||
if (index === -1) {
|
||||
return string;
|
||||
}
|
||||
|
||||
const substringLength = substring.length;
|
||||
let endIndex = 0;
|
||||
let returnValue = '';
|
||||
do {
|
||||
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
||||
endIndex = index + substringLength;
|
||||
index = string.indexOf(substring, endIndex);
|
||||
} while (index !== -1);
|
||||
|
||||
returnValue += string.substr(endIndex);
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
||||
let endIndex = 0;
|
||||
let returnValue = '';
|
||||
do {
|
||||
const gotCR = string[index - 1] === '\r';
|
||||
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
|
||||
endIndex = index + 1;
|
||||
index = string.indexOf('\n', endIndex);
|
||||
} while (index !== -1);
|
||||
|
||||
returnValue += string.substr(endIndex);
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
stringReplaceAll,
|
||||
stringEncaseCRLFWithFirstIndex
|
||||
};
|
54
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/CHANGELOG.md
generated
vendored
Normal file
54
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
# 1.0.0 - 2016-01-07
|
||||
|
||||
- Removed: unused speed test
|
||||
- Added: Automatic routing between previously unsupported conversions
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Removed: `convert()` class
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Changed: all functions to lookup dictionary
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Changed: `ansi` to `ansi256`
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Fixed: argument grouping for functions requiring only one argument
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
|
||||
# 0.6.0 - 2015-07-23
|
||||
|
||||
- Added: methods to handle
|
||||
[ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors:
|
||||
- rgb2ansi16
|
||||
- rgb2ansi
|
||||
- hsl2ansi16
|
||||
- hsl2ansi
|
||||
- hsv2ansi16
|
||||
- hsv2ansi
|
||||
- hwb2ansi16
|
||||
- hwb2ansi
|
||||
- cmyk2ansi16
|
||||
- cmyk2ansi
|
||||
- keyword2ansi16
|
||||
- keyword2ansi
|
||||
- ansi162rgb
|
||||
- ansi162hsl
|
||||
- ansi162hsv
|
||||
- ansi162hwb
|
||||
- ansi162cmyk
|
||||
- ansi162keyword
|
||||
- ansi2rgb
|
||||
- ansi2hsl
|
||||
- ansi2hsv
|
||||
- ansi2hwb
|
||||
- ansi2cmyk
|
||||
- ansi2keyword
|
||||
([#18](https://github.com/harthur/color-convert/pull/18))
|
||||
|
||||
# 0.5.3 - 2015-06-02
|
||||
|
||||
- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]`
|
||||
([#15](https://github.com/harthur/color-convert/issues/15))
|
||||
|
||||
---
|
||||
|
||||
Check out commit logs for older releases
|
21
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/LICENSE
generated
vendored
Normal file
21
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
68
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/README.md
generated
vendored
Normal file
68
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/README.md
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
# color-convert
|
||||
|
||||
[](https://travis-ci.org/Qix-/color-convert)
|
||||
|
||||
Color-convert is a color conversion library for JavaScript and node.
|
||||
It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest):
|
||||
|
||||
```js
|
||||
var convert = require('color-convert');
|
||||
|
||||
convert.rgb.hsl(140, 200, 100); // [96, 48, 59]
|
||||
convert.keyword.rgb('blue'); // [0, 0, 255]
|
||||
|
||||
var rgbChannels = convert.rgb.channels; // 3
|
||||
var cmykChannels = convert.cmyk.channels; // 4
|
||||
var ansiChannels = convert.ansi16.channels; // 1
|
||||
```
|
||||
|
||||
# Install
|
||||
|
||||
```console
|
||||
$ npm install color-convert
|
||||
```
|
||||
|
||||
# API
|
||||
|
||||
Simply get the property of the _from_ and _to_ conversion that you're looking for.
|
||||
|
||||
All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function.
|
||||
|
||||
All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha).
|
||||
|
||||
```js
|
||||
var convert = require('color-convert');
|
||||
|
||||
// Hex to LAB
|
||||
convert.hex.lab('DEADBF'); // [ 76, 21, -2 ]
|
||||
convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ]
|
||||
|
||||
// RGB to CMYK
|
||||
convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ]
|
||||
convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ]
|
||||
```
|
||||
|
||||
### Arrays
|
||||
All functions that accept multiple arguments also support passing an array.
|
||||
|
||||
Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.)
|
||||
|
||||
```js
|
||||
var convert = require('color-convert');
|
||||
|
||||
convert.rgb.hex(123, 45, 67); // '7B2D43'
|
||||
convert.rgb.hex([123, 45, 67]); // '7B2D43'
|
||||
```
|
||||
|
||||
## Routing
|
||||
|
||||
Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex).
|
||||
|
||||
Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js).
|
||||
|
||||
# Contribute
|
||||
|
||||
If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request.
|
||||
|
||||
# License
|
||||
Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE).
|
839
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/conversions.js
generated
vendored
Normal file
839
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/conversions.js
generated
vendored
Normal file
@ -0,0 +1,839 @@
|
||||
/* MIT license */
|
||||
/* eslint-disable no-mixed-operators */
|
||||
const cssKeywords = require('color-name');
|
||||
|
||||
// NOTE: conversions should only return primitive values (i.e. arrays, or
|
||||
// values that give correct `typeof` results).
|
||||
// do not use box values types (i.e. Number(), String(), etc.)
|
||||
|
||||
const reverseKeywords = {};
|
||||
for (const key of Object.keys(cssKeywords)) {
|
||||
reverseKeywords[cssKeywords[key]] = key;
|
||||
}
|
||||
|
||||
const convert = {
|
||||
rgb: {channels: 3, labels: 'rgb'},
|
||||
hsl: {channels: 3, labels: 'hsl'},
|
||||
hsv: {channels: 3, labels: 'hsv'},
|
||||
hwb: {channels: 3, labels: 'hwb'},
|
||||
cmyk: {channels: 4, labels: 'cmyk'},
|
||||
xyz: {channels: 3, labels: 'xyz'},
|
||||
lab: {channels: 3, labels: 'lab'},
|
||||
lch: {channels: 3, labels: 'lch'},
|
||||
hex: {channels: 1, labels: ['hex']},
|
||||
keyword: {channels: 1, labels: ['keyword']},
|
||||
ansi16: {channels: 1, labels: ['ansi16']},
|
||||
ansi256: {channels: 1, labels: ['ansi256']},
|
||||
hcg: {channels: 3, labels: ['h', 'c', 'g']},
|
||||
apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
|
||||
gray: {channels: 1, labels: ['gray']}
|
||||
};
|
||||
|
||||
module.exports = convert;
|
||||
|
||||
// Hide .channels and .labels properties
|
||||
for (const model of Object.keys(convert)) {
|
||||
if (!('channels' in convert[model])) {
|
||||
throw new Error('missing channels property: ' + model);
|
||||
}
|
||||
|
||||
if (!('labels' in convert[model])) {
|
||||
throw new Error('missing channel labels property: ' + model);
|
||||
}
|
||||
|
||||
if (convert[model].labels.length !== convert[model].channels) {
|
||||
throw new Error('channel and label counts mismatch: ' + model);
|
||||
}
|
||||
|
||||
const {channels, labels} = convert[model];
|
||||
delete convert[model].channels;
|
||||
delete convert[model].labels;
|
||||
Object.defineProperty(convert[model], 'channels', {value: channels});
|
||||
Object.defineProperty(convert[model], 'labels', {value: labels});
|
||||
}
|
||||
|
||||
convert.rgb.hsl = function (rgb) {
|
||||
const r = rgb[0] / 255;
|
||||
const g = rgb[1] / 255;
|
||||
const b = rgb[2] / 255;
|
||||
const min = Math.min(r, g, b);
|
||||
const max = Math.max(r, g, b);
|
||||
const delta = max - min;
|
||||
let h;
|
||||
let s;
|
||||
|
||||
if (max === min) {
|
||||
h = 0;
|
||||
} else if (r === max) {
|
||||
h = (g - b) / delta;
|
||||
} else if (g === max) {
|
||||
h = 2 + (b - r) / delta;
|
||||
} else if (b === max) {
|
||||
h = 4 + (r - g) / delta;
|
||||
}
|
||||
|
||||
h = Math.min(h * 60, 360);
|
||||
|
||||
if (h < 0) {
|
||||
h += 360;
|
||||
}
|
||||
|
||||
const l = (min + max) / 2;
|
||||
|
||||
if (max === min) {
|
||||
s = 0;
|
||||
} else if (l <= 0.5) {
|
||||
s = delta / (max + min);
|
||||
} else {
|
||||
s = delta / (2 - max - min);
|
||||
}
|
||||
|
||||
return [h, s * 100, l * 100];
|
||||
};
|
||||
|
||||
convert.rgb.hsv = function (rgb) {
|
||||
let rdif;
|
||||
let gdif;
|
||||
let bdif;
|
||||
let h;
|
||||
let s;
|
||||
|
||||
const r = rgb[0] / 255;
|
||||
const g = rgb[1] / 255;
|
||||
const b = rgb[2] / 255;
|
||||
const v = Math.max(r, g, b);
|
||||
const diff = v - Math.min(r, g, b);
|
||||
const diffc = function (c) {
|
||||
return (v - c) / 6 / diff + 1 / 2;
|
||||
};
|
||||
|
||||
if (diff === 0) {
|
||||
h = 0;
|
||||
s = 0;
|
||||
} else {
|
||||
s = diff / v;
|
||||
rdif = diffc(r);
|
||||
gdif = diffc(g);
|
||||
bdif = diffc(b);
|
||||
|
||||
if (r === v) {
|
||||
h = bdif - gdif;
|
||||
} else if (g === v) {
|
||||
h = (1 / 3) + rdif - bdif;
|
||||
} else if (b === v) {
|
||||
h = (2 / 3) + gdif - rdif;
|
||||
}
|
||||
|
||||
if (h < 0) {
|
||||
h += 1;
|
||||
} else if (h > 1) {
|
||||
h -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
h * 360,
|
||||
s * 100,
|
||||
v * 100
|
||||
];
|
||||
};
|
||||
|
||||
convert.rgb.hwb = function (rgb) {
|
||||
const r = rgb[0];
|
||||
const g = rgb[1];
|
||||
let b = rgb[2];
|
||||
const h = convert.rgb.hsl(rgb)[0];
|
||||
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
||||
|
||||
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
||||
|
||||
return [h, w * 100, b * 100];
|
||||
};
|
||||
|
||||
convert.rgb.cmyk = function (rgb) {
|
||||
const r = rgb[0] / 255;
|
||||
const g = rgb[1] / 255;
|
||||
const b = rgb[2] / 255;
|
||||
|
||||
const k = Math.min(1 - r, 1 - g, 1 - b);
|
||||
const c = (1 - r - k) / (1 - k) || 0;
|
||||
const m = (1 - g - k) / (1 - k) || 0;
|
||||
const y = (1 - b - k) / (1 - k) || 0;
|
||||
|
||||
return [c * 100, m * 100, y * 100, k * 100];
|
||||
};
|
||||
|
||||
function comparativeDistance(x, y) {
|
||||
/*
|
||||
See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
|
||||
*/
|
||||
return (
|
||||
((x[0] - y[0]) ** 2) +
|
||||
((x[1] - y[1]) ** 2) +
|
||||
((x[2] - y[2]) ** 2)
|
||||
);
|
||||
}
|
||||
|
||||
convert.rgb.keyword = function (rgb) {
|
||||
const reversed = reverseKeywords[rgb];
|
||||
if (reversed) {
|
||||
return reversed;
|
||||
}
|
||||
|
||||
let currentClosestDistance = Infinity;
|
||||
let currentClosestKeyword;
|
||||
|
||||
for (const keyword of Object.keys(cssKeywords)) {
|
||||
const value = cssKeywords[keyword];
|
||||
|
||||
// Compute comparative distance
|
||||
const distance = comparativeDistance(rgb, value);
|
||||
|
||||
// Check if its less, if so set as closest
|
||||
if (distance < currentClosestDistance) {
|
||||
currentClosestDistance = distance;
|
||||
currentClosestKeyword = keyword;
|
||||
}
|
||||
}
|
||||
|
||||
return currentClosestKeyword;
|
||||
};
|
||||
|
||||
convert.keyword.rgb = function (keyword) {
|
||||
return cssKeywords[keyword];
|
||||
};
|
||||
|
||||
convert.rgb.xyz = function (rgb) {
|
||||
let r = rgb[0] / 255;
|
||||
let g = rgb[1] / 255;
|
||||
let b = rgb[2] / 255;
|
||||
|
||||
// Assume sRGB
|
||||
r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);
|
||||
g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);
|
||||
b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);
|
||||
|
||||
const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
|
||||
const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
|
||||
const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
|
||||
|
||||
return [x * 100, y * 100, z * 100];
|
||||
};
|
||||
|
||||
convert.rgb.lab = function (rgb) {
|
||||
const xyz = convert.rgb.xyz(rgb);
|
||||
let x = xyz[0];
|
||||
let y = xyz[1];
|
||||
let z = xyz[2];
|
||||
|
||||
x /= 95.047;
|
||||
y /= 100;
|
||||
z /= 108.883;
|
||||
|
||||
x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
|
||||
y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
|
||||
z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
|
||||
|
||||
const l = (116 * y) - 16;
|
||||
const a = 500 * (x - y);
|
||||
const b = 200 * (y - z);
|
||||
|
||||
return [l, a, b];
|
||||
};
|
||||
|
||||
convert.hsl.rgb = function (hsl) {
|
||||
const h = hsl[0] / 360;
|
||||
const s = hsl[1] / 100;
|
||||
const l = hsl[2] / 100;
|
||||
let t2;
|
||||
let t3;
|
||||
let val;
|
||||
|
||||
if (s === 0) {
|
||||
val = l * 255;
|
||||
return [val, val, val];
|
||||
}
|
||||
|
||||
if (l < 0.5) {
|
||||
t2 = l * (1 + s);
|
||||
} else {
|
||||
t2 = l + s - l * s;
|
||||
}
|
||||
|
||||
const t1 = 2 * l - t2;
|
||||
|
||||
const rgb = [0, 0, 0];
|
||||
for (let i = 0; i < 3; i++) {
|
||||
t3 = h + 1 / 3 * -(i - 1);
|
||||
if (t3 < 0) {
|
||||
t3++;
|
||||
}
|
||||
|
||||
if (t3 > 1) {
|
||||
t3--;
|
||||
}
|
||||
|
||||
if (6 * t3 < 1) {
|
||||
val = t1 + (t2 - t1) * 6 * t3;
|
||||
} else if (2 * t3 < 1) {
|
||||
val = t2;
|
||||
} else if (3 * t3 < 2) {
|
||||
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
||||
} else {
|
||||
val = t1;
|
||||
}
|
||||
|
||||
rgb[i] = val * 255;
|
||||
}
|
||||
|
||||
return rgb;
|
||||
};
|
||||
|
||||
convert.hsl.hsv = function (hsl) {
|
||||
const h = hsl[0];
|
||||
let s = hsl[1] / 100;
|
||||
let l = hsl[2] / 100;
|
||||
let smin = s;
|
||||
const lmin = Math.max(l, 0.01);
|
||||
|
||||
l *= 2;
|
||||
s *= (l <= 1) ? l : 2 - l;
|
||||
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
||||
const v = (l + s) / 2;
|
||||
const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
|
||||
|
||||
return [h, sv * 100, v * 100];
|
||||
};
|
||||
|
||||
convert.hsv.rgb = function (hsv) {
|
||||
const h = hsv[0] / 60;
|
||||
const s = hsv[1] / 100;
|
||||
let v = hsv[2] / 100;
|
||||
const hi = Math.floor(h) % 6;
|
||||
|
||||
const f = h - Math.floor(h);
|
||||
const p = 255 * v * (1 - s);
|
||||
const q = 255 * v * (1 - (s * f));
|
||||
const t = 255 * v * (1 - (s * (1 - f)));
|
||||
v *= 255;
|
||||
|
||||
switch (hi) {
|
||||
case 0:
|
||||
return [v, t, p];
|
||||
case 1:
|
||||
return [q, v, p];
|
||||
case 2:
|
||||
return [p, v, t];
|
||||
case 3:
|
||||
return [p, q, v];
|
||||
case 4:
|
||||
return [t, p, v];
|
||||
case 5:
|
||||
return [v, p, q];
|
||||
}
|
||||
};
|
||||
|
||||
convert.hsv.hsl = function (hsv) {
|
||||
const h = hsv[0];
|
||||
const s = hsv[1] / 100;
|
||||
const v = hsv[2] / 100;
|
||||
const vmin = Math.max(v, 0.01);
|
||||
let sl;
|
||||
let l;
|
||||
|
||||
l = (2 - s) * v;
|
||||
const lmin = (2 - s) * vmin;
|
||||
sl = s * vmin;
|
||||
sl /= (lmin <= 1) ? lmin : 2 - lmin;
|
||||
sl = sl || 0;
|
||||
l /= 2;
|
||||
|
||||
return [h, sl * 100, l * 100];
|
||||
};
|
||||
|
||||
// http://dev.w3.org/csswg/css-color/#hwb-to-rgb
|
||||
convert.hwb.rgb = function (hwb) {
|
||||
const h = hwb[0] / 360;
|
||||
let wh = hwb[1] / 100;
|
||||
let bl = hwb[2] / 100;
|
||||
const ratio = wh + bl;
|
||||
let f;
|
||||
|
||||
// Wh + bl cant be > 1
|
||||
if (ratio > 1) {
|
||||
wh /= ratio;
|
||||
bl /= ratio;
|
||||
}
|
||||
|
||||
const i = Math.floor(6 * h);
|
||||
const v = 1 - bl;
|
||||
f = 6 * h - i;
|
||||
|
||||
if ((i & 0x01) !== 0) {
|
||||
f = 1 - f;
|
||||
}
|
||||
|
||||
const n = wh + f * (v - wh); // Linear interpolation
|
||||
|
||||
let r;
|
||||
let g;
|
||||
let b;
|
||||
/* eslint-disable max-statements-per-line,no-multi-spaces */
|
||||
switch (i) {
|
||||
default:
|
||||
case 6:
|
||||
case 0: r = v; g = n; b = wh; break;
|
||||
case 1: r = n; g = v; b = wh; break;
|
||||
case 2: r = wh; g = v; b = n; break;
|
||||
case 3: r = wh; g = n; b = v; break;
|
||||
case 4: r = n; g = wh; b = v; break;
|
||||
case 5: r = v; g = wh; b = n; break;
|
||||
}
|
||||
/* eslint-enable max-statements-per-line,no-multi-spaces */
|
||||
|
||||
return [r * 255, g * 255, b * 255];
|
||||
};
|
||||
|
||||
convert.cmyk.rgb = function (cmyk) {
|
||||
const c = cmyk[0] / 100;
|
||||
const m = cmyk[1] / 100;
|
||||
const y = cmyk[2] / 100;
|
||||
const k = cmyk[3] / 100;
|
||||
|
||||
const r = 1 - Math.min(1, c * (1 - k) + k);
|
||||
const g = 1 - Math.min(1, m * (1 - k) + k);
|
||||
const b = 1 - Math.min(1, y * (1 - k) + k);
|
||||
|
||||
return [r * 255, g * 255, b * 255];
|
||||
};
|
||||
|
||||
convert.xyz.rgb = function (xyz) {
|
||||
const x = xyz[0] / 100;
|
||||
const y = xyz[1] / 100;
|
||||
const z = xyz[2] / 100;
|
||||
let r;
|
||||
let g;
|
||||
let b;
|
||||
|
||||
r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
|
||||
g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
|
||||
b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
|
||||
|
||||
// Assume sRGB
|
||||
r = r > 0.0031308
|
||||
? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)
|
||||
: r * 12.92;
|
||||
|
||||
g = g > 0.0031308
|
||||
? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)
|
||||
: g * 12.92;
|
||||
|
||||
b = b > 0.0031308
|
||||
? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)
|
||||
: b * 12.92;
|
||||
|
||||
r = Math.min(Math.max(0, r), 1);
|
||||
g = Math.min(Math.max(0, g), 1);
|
||||
b = Math.min(Math.max(0, b), 1);
|
||||
|
||||
return [r * 255, g * 255, b * 255];
|
||||
};
|
||||
|
||||
convert.xyz.lab = function (xyz) {
|
||||
let x = xyz[0];
|
||||
let y = xyz[1];
|
||||
let z = xyz[2];
|
||||
|
||||
x /= 95.047;
|
||||
y /= 100;
|
||||
z /= 108.883;
|
||||
|
||||
x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
|
||||
y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
|
||||
z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
|
||||
|
||||
const l = (116 * y) - 16;
|
||||
const a = 500 * (x - y);
|
||||
const b = 200 * (y - z);
|
||||
|
||||
return [l, a, b];
|
||||
};
|
||||
|
||||
convert.lab.xyz = function (lab) {
|
||||
const l = lab[0];
|
||||
const a = lab[1];
|
||||
const b = lab[2];
|
||||
let x;
|
||||
let y;
|
||||
let z;
|
||||
|
||||
y = (l + 16) / 116;
|
||||
x = a / 500 + y;
|
||||
z = y - b / 200;
|
||||
|
||||
const y2 = y ** 3;
|
||||
const x2 = x ** 3;
|
||||
const z2 = z ** 3;
|
||||
y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
|
||||
x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
|
||||
z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
|
||||
|
||||
x *= 95.047;
|
||||
y *= 100;
|
||||
z *= 108.883;
|
||||
|
||||
return [x, y, z];
|
||||
};
|
||||
|
||||
convert.lab.lch = function (lab) {
|
||||
const l = lab[0];
|
||||
const a = lab[1];
|
||||
const b = lab[2];
|
||||
let h;
|
||||
|
||||
const hr = Math.atan2(b, a);
|
||||
h = hr * 360 / 2 / Math.PI;
|
||||
|
||||
if (h < 0) {
|
||||
h += 360;
|
||||
}
|
||||
|
||||
const c = Math.sqrt(a * a + b * b);
|
||||
|
||||
return [l, c, h];
|
||||
};
|
||||
|
||||
convert.lch.lab = function (lch) {
|
||||
const l = lch[0];
|
||||
const c = lch[1];
|
||||
const h = lch[2];
|
||||
|
||||
const hr = h / 360 * 2 * Math.PI;
|
||||
const a = c * Math.cos(hr);
|
||||
const b = c * Math.sin(hr);
|
||||
|
||||
return [l, a, b];
|
||||
};
|
||||
|
||||
convert.rgb.ansi16 = function (args, saturation = null) {
|
||||
const [r, g, b] = args;
|
||||
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
|
||||
|
||||
value = Math.round(value / 50);
|
||||
|
||||
if (value === 0) {
|
||||
return 30;
|
||||
}
|
||||
|
||||
let ansi = 30
|
||||
+ ((Math.round(b / 255) << 2)
|
||||
| (Math.round(g / 255) << 1)
|
||||
| Math.round(r / 255));
|
||||
|
||||
if (value === 2) {
|
||||
ansi += 60;
|
||||
}
|
||||
|
||||
return ansi;
|
||||
};
|
||||
|
||||
convert.hsv.ansi16 = function (args) {
|
||||
// Optimization here; we already know the value and don't need to get
|
||||
// it converted for us.
|
||||
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
||||
};
|
||||
|
||||
convert.rgb.ansi256 = function (args) {
|
||||
const r = args[0];
|
||||
const g = args[1];
|
||||
const b = args[2];
|
||||
|
||||
// We use the extended greyscale palette here, with the exception of
|
||||
// black and white. normal palette only has 4 greyscale shades.
|
||||
if (r === g && g === b) {
|
||||
if (r < 8) {
|
||||
return 16;
|
||||
}
|
||||
|
||||
if (r > 248) {
|
||||
return 231;
|
||||
}
|
||||
|
||||
return Math.round(((r - 8) / 247) * 24) + 232;
|
||||
}
|
||||
|
||||
const ansi = 16
|
||||
+ (36 * Math.round(r / 255 * 5))
|
||||
+ (6 * Math.round(g / 255 * 5))
|
||||
+ Math.round(b / 255 * 5);
|
||||
|
||||
return ansi;
|
||||
};
|
||||
|
||||
convert.ansi16.rgb = function (args) {
|
||||
let color = args % 10;
|
||||
|
||||
// Handle greyscale
|
||||
if (color === 0 || color === 7) {
|
||||
if (args > 50) {
|
||||
color += 3.5;
|
||||
}
|
||||
|
||||
color = color / 10.5 * 255;
|
||||
|
||||
return [color, color, color];
|
||||
}
|
||||
|
||||
const mult = (~~(args > 50) + 1) * 0.5;
|
||||
const r = ((color & 1) * mult) * 255;
|
||||
const g = (((color >> 1) & 1) * mult) * 255;
|
||||
const b = (((color >> 2) & 1) * mult) * 255;
|
||||
|
||||
return [r, g, b];
|
||||
};
|
||||
|
||||
convert.ansi256.rgb = function (args) {
|
||||
// Handle greyscale
|
||||
if (args >= 232) {
|
||||
const c = (args - 232) * 10 + 8;
|
||||
return [c, c, c];
|
||||
}
|
||||
|
||||
args -= 16;
|
||||
|
||||
let rem;
|
||||
const r = Math.floor(args / 36) / 5 * 255;
|
||||
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
||||
const b = (rem % 6) / 5 * 255;
|
||||
|
||||
return [r, g, b];
|
||||
};
|
||||
|
||||
convert.rgb.hex = function (args) {
|
||||
const integer = ((Math.round(args[0]) & 0xFF) << 16)
|
||||
+ ((Math.round(args[1]) & 0xFF) << 8)
|
||||
+ (Math.round(args[2]) & 0xFF);
|
||||
|
||||
const string = integer.toString(16).toUpperCase();
|
||||
return '000000'.substring(string.length) + string;
|
||||
};
|
||||
|
||||
convert.hex.rgb = function (args) {
|
||||
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
||||
if (!match) {
|
||||
return [0, 0, 0];
|
||||
}
|
||||
|
||||
let colorString = match[0];
|
||||
|
||||
if (match[0].length === 3) {
|
||||
colorString = colorString.split('').map(char => {
|
||||
return char + char;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
const integer = parseInt(colorString, 16);
|
||||
const r = (integer >> 16) & 0xFF;
|
||||
const g = (integer >> 8) & 0xFF;
|
||||
const b = integer & 0xFF;
|
||||
|
||||
return [r, g, b];
|
||||
};
|
||||
|
||||
convert.rgb.hcg = function (rgb) {
|
||||
const r = rgb[0] / 255;
|
||||
const g = rgb[1] / 255;
|
||||
const b = rgb[2] / 255;
|
||||
const max = Math.max(Math.max(r, g), b);
|
||||
const min = Math.min(Math.min(r, g), b);
|
||||
const chroma = (max - min);
|
||||
let grayscale;
|
||||
let hue;
|
||||
|
||||
if (chroma < 1) {
|
||||
grayscale = min / (1 - chroma);
|
||||
} else {
|
||||
grayscale = 0;
|
||||
}
|
||||
|
||||
if (chroma <= 0) {
|
||||
hue = 0;
|
||||
} else
|
||||
if (max === r) {
|
||||
hue = ((g - b) / chroma) % 6;
|
||||
} else
|
||||
if (max === g) {
|
||||
hue = 2 + (b - r) / chroma;
|
||||
} else {
|
||||
hue = 4 + (r - g) / chroma;
|
||||
}
|
||||
|
||||
hue /= 6;
|
||||
hue %= 1;
|
||||
|
||||
return [hue * 360, chroma * 100, grayscale * 100];
|
||||
};
|
||||
|
||||
convert.hsl.hcg = function (hsl) {
|
||||
const s = hsl[1] / 100;
|
||||
const l = hsl[2] / 100;
|
||||
|
||||
const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));
|
||||
|
||||
let f = 0;
|
||||
if (c < 1.0) {
|
||||
f = (l - 0.5 * c) / (1.0 - c);
|
||||
}
|
||||
|
||||
return [hsl[0], c * 100, f * 100];
|
||||
};
|
||||
|
||||
convert.hsv.hcg = function (hsv) {
|
||||
const s = hsv[1] / 100;
|
||||
const v = hsv[2] / 100;
|
||||
|
||||
const c = s * v;
|
||||
let f = 0;
|
||||
|
||||
if (c < 1.0) {
|
||||
f = (v - c) / (1 - c);
|
||||
}
|
||||
|
||||
return [hsv[0], c * 100, f * 100];
|
||||
};
|
||||
|
||||
convert.hcg.rgb = function (hcg) {
|
||||
const h = hcg[0] / 360;
|
||||
const c = hcg[1] / 100;
|
||||
const g = hcg[2] / 100;
|
||||
|
||||
if (c === 0.0) {
|
||||
return [g * 255, g * 255, g * 255];
|
||||
}
|
||||
|
||||
const pure = [0, 0, 0];
|
||||
const hi = (h % 1) * 6;
|
||||
const v = hi % 1;
|
||||
const w = 1 - v;
|
||||
let mg = 0;
|
||||
|
||||
/* eslint-disable max-statements-per-line */
|
||||
switch (Math.floor(hi)) {
|
||||
case 0:
|
||||
pure[0] = 1; pure[1] = v; pure[2] = 0; break;
|
||||
case 1:
|
||||
pure[0] = w; pure[1] = 1; pure[2] = 0; break;
|
||||
case 2:
|
||||
pure[0] = 0; pure[1] = 1; pure[2] = v; break;
|
||||
case 3:
|
||||
pure[0] = 0; pure[1] = w; pure[2] = 1; break;
|
||||
case 4:
|
||||
pure[0] = v; pure[1] = 0; pure[2] = 1; break;
|
||||
default:
|
||||
pure[0] = 1; pure[1] = 0; pure[2] = w;
|
||||
}
|
||||
/* eslint-enable max-statements-per-line */
|
||||
|
||||
mg = (1.0 - c) * g;
|
||||
|
||||
return [
|
||||
(c * pure[0] + mg) * 255,
|
||||
(c * pure[1] + mg) * 255,
|
||||
(c * pure[2] + mg) * 255
|
||||
];
|
||||
};
|
||||
|
||||
convert.hcg.hsv = function (hcg) {
|
||||
const c = hcg[1] / 100;
|
||||
const g = hcg[2] / 100;
|
||||
|
||||
const v = c + g * (1.0 - c);
|
||||
let f = 0;
|
||||
|
||||
if (v > 0.0) {
|
||||
f = c / v;
|
||||
}
|
||||
|
||||
return [hcg[0], f * 100, v * 100];
|
||||
};
|
||||
|
||||
convert.hcg.hsl = function (hcg) {
|
||||
const c = hcg[1] / 100;
|
||||
const g = hcg[2] / 100;
|
||||
|
||||
const l = g * (1.0 - c) + 0.5 * c;
|
||||
let s = 0;
|
||||
|
||||
if (l > 0.0 && l < 0.5) {
|
||||
s = c / (2 * l);
|
||||
} else
|
||||
if (l >= 0.5 && l < 1.0) {
|
||||
s = c / (2 * (1 - l));
|
||||
}
|
||||
|
||||
return [hcg[0], s * 100, l * 100];
|
||||
};
|
||||
|
||||
convert.hcg.hwb = function (hcg) {
|
||||
const c = hcg[1] / 100;
|
||||
const g = hcg[2] / 100;
|
||||
const v = c + g * (1.0 - c);
|
||||
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
||||
};
|
||||
|
||||
convert.hwb.hcg = function (hwb) {
|
||||
const w = hwb[1] / 100;
|
||||
const b = hwb[2] / 100;
|
||||
const v = 1 - b;
|
||||
const c = v - w;
|
||||
let g = 0;
|
||||
|
||||
if (c < 1) {
|
||||
g = (v - c) / (1 - c);
|
||||
}
|
||||
|
||||
return [hwb[0], c * 100, g * 100];
|
||||
};
|
||||
|
||||
convert.apple.rgb = function (apple) {
|
||||
return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
|
||||
};
|
||||
|
||||
convert.rgb.apple = function (rgb) {
|
||||
return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
|
||||
};
|
||||
|
||||
convert.gray.rgb = function (args) {
|
||||
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
||||
};
|
||||
|
||||
convert.gray.hsl = function (args) {
|
||||
return [0, 0, args[0]];
|
||||
};
|
||||
|
||||
convert.gray.hsv = convert.gray.hsl;
|
||||
|
||||
convert.gray.hwb = function (gray) {
|
||||
return [0, 100, gray[0]];
|
||||
};
|
||||
|
||||
convert.gray.cmyk = function (gray) {
|
||||
return [0, 0, 0, gray[0]];
|
||||
};
|
||||
|
||||
convert.gray.lab = function (gray) {
|
||||
return [gray[0], 0, 0];
|
||||
};
|
||||
|
||||
convert.gray.hex = function (gray) {
|
||||
const val = Math.round(gray[0] / 100 * 255) & 0xFF;
|
||||
const integer = (val << 16) + (val << 8) + val;
|
||||
|
||||
const string = integer.toString(16).toUpperCase();
|
||||
return '000000'.substring(string.length) + string;
|
||||
};
|
||||
|
||||
convert.rgb.gray = function (rgb) {
|
||||
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
||||
return [val / 255 * 100];
|
||||
};
|
81
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/index.js
generated
vendored
Normal file
81
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/index.js
generated
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
const conversions = require('./conversions');
|
||||
const route = require('./route');
|
||||
|
||||
const convert = {};
|
||||
|
||||
const models = Object.keys(conversions);
|
||||
|
||||
function wrapRaw(fn) {
|
||||
const wrappedFn = function (...args) {
|
||||
const arg0 = args[0];
|
||||
if (arg0 === undefined || arg0 === null) {
|
||||
return arg0;
|
||||
}
|
||||
|
||||
if (arg0.length > 1) {
|
||||
args = arg0;
|
||||
}
|
||||
|
||||
return fn(args);
|
||||
};
|
||||
|
||||
// Preserve .conversion property if there is one
|
||||
if ('conversion' in fn) {
|
||||
wrappedFn.conversion = fn.conversion;
|
||||
}
|
||||
|
||||
return wrappedFn;
|
||||
}
|
||||
|
||||
function wrapRounded(fn) {
|
||||
const wrappedFn = function (...args) {
|
||||
const arg0 = args[0];
|
||||
|
||||
if (arg0 === undefined || arg0 === null) {
|
||||
return arg0;
|
||||
}
|
||||
|
||||
if (arg0.length > 1) {
|
||||
args = arg0;
|
||||
}
|
||||
|
||||
const result = fn(args);
|
||||
|
||||
// We're assuming the result is an array here.
|
||||
// see notice in conversions.js; don't use box types
|
||||
// in conversion functions.
|
||||
if (typeof result === 'object') {
|
||||
for (let len = result.length, i = 0; i < len; i++) {
|
||||
result[i] = Math.round(result[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
// Preserve .conversion property if there is one
|
||||
if ('conversion' in fn) {
|
||||
wrappedFn.conversion = fn.conversion;
|
||||
}
|
||||
|
||||
return wrappedFn;
|
||||
}
|
||||
|
||||
models.forEach(fromModel => {
|
||||
convert[fromModel] = {};
|
||||
|
||||
Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
|
||||
Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
|
||||
|
||||
const routes = route(fromModel);
|
||||
const routeModels = Object.keys(routes);
|
||||
|
||||
routeModels.forEach(toModel => {
|
||||
const fn = routes[toModel];
|
||||
|
||||
convert[fromModel][toModel] = wrapRounded(fn);
|
||||
convert[fromModel][toModel].raw = wrapRaw(fn);
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = convert;
|
48
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/package.json
generated
vendored
Normal file
48
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/package.json
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "color-convert",
|
||||
"description": "Plain color conversion functions",
|
||||
"version": "2.0.1",
|
||||
"author": "Heather Arthur <fayearthur@gmail.com>",
|
||||
"license": "MIT",
|
||||
"repository": "Qix-/color-convert",
|
||||
"scripts": {
|
||||
"pretest": "xo",
|
||||
"test": "node test/basic.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=7.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"color",
|
||||
"colour",
|
||||
"convert",
|
||||
"converter",
|
||||
"conversion",
|
||||
"rgb",
|
||||
"hsl",
|
||||
"hsv",
|
||||
"hwb",
|
||||
"cmyk",
|
||||
"ansi",
|
||||
"ansi16"
|
||||
],
|
||||
"files": [
|
||||
"index.js",
|
||||
"conversions.js",
|
||||
"route.js"
|
||||
],
|
||||
"xo": {
|
||||
"rules": {
|
||||
"default-case": 0,
|
||||
"no-inline-comments": 0,
|
||||
"operator-linebreak": 0
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"chalk": "^2.4.2",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
}
|
||||
}
|
97
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/route.js
generated
vendored
Normal file
97
node_modules/@react-native-community/cli-platform-ios/node_modules/color-convert/route.js
generated
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
const conversions = require('./conversions');
|
||||
|
||||
/*
|
||||
This function routes a model to all other models.
|
||||
|
||||
all functions that are routed have a property `.conversion` attached
|
||||
to the returned synthetic function. This property is an array
|
||||
of strings, each with the steps in between the 'from' and 'to'
|
||||
color models (inclusive).
|
||||
|
||||
conversions that are not possible simply are not included.
|
||||
*/
|
||||
|
||||
function buildGraph() {
|
||||
const graph = {};
|
||||
// https://jsperf.com/object-keys-vs-for-in-with-closure/3
|
||||
const models = Object.keys(conversions);
|
||||
|
||||
for (let len = models.length, i = 0; i < len; i++) {
|
||||
graph[models[i]] = {
|
||||
// http://jsperf.com/1-vs-infinity
|
||||
// micro-opt, but this is simple.
|
||||
distance: -1,
|
||||
parent: null
|
||||
};
|
||||
}
|
||||
|
||||
return graph;
|
||||
}
|
||||
|
||||
// https://en.wikipedia.org/wiki/Breadth-first_search
|
||||
function deriveBFS(fromModel) {
|
||||
const graph = buildGraph();
|
||||
const queue = [fromModel]; // Unshift -> queue -> pop
|
||||
|
||||
graph[fromModel].distance = 0;
|
||||
|
||||
while (queue.length) {
|
||||
const current = queue.pop();
|
||||
const adjacents = Object.keys(conversions[current]);
|
||||
|
||||
for (let len = adjacents.length, i = 0; i < len; i++) {
|
||||
const adjacent = adjacents[i];
|
||||
const node = graph[adjacent];
|
||||
|
||||
if (node.distance === -1) {
|
||||
node.distance = graph[current].distance + 1;
|
||||
node.parent = current;
|
||||
queue.unshift(adjacent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return graph;
|
||||
}
|
||||
|
||||
function link(from, to) {
|
||||
return function (args) {
|
||||
return to(from(args));
|
||||
};
|
||||
}
|
||||
|
||||
function wrapConversion(toModel, graph) {
|
||||
const path = [graph[toModel].parent, toModel];
|
||||
let fn = conversions[graph[toModel].parent][toModel];
|
||||
|
||||
let cur = graph[toModel].parent;
|
||||
while (graph[cur].parent) {
|
||||
path.unshift(graph[cur].parent);
|
||||
fn = link(conversions[graph[cur].parent][cur], fn);
|
||||
cur = graph[cur].parent;
|
||||
}
|
||||
|
||||
fn.conversion = path;
|
||||
return fn;
|
||||
}
|
||||
|
||||
module.exports = function (fromModel) {
|
||||
const graph = deriveBFS(fromModel);
|
||||
const conversion = {};
|
||||
|
||||
const models = Object.keys(graph);
|
||||
for (let len = models.length, i = 0; i < len; i++) {
|
||||
const toModel = models[i];
|
||||
const node = graph[toModel];
|
||||
|
||||
if (node.parent === null) {
|
||||
// No possible conversion, or this node is the source model.
|
||||
continue;
|
||||
}
|
||||
|
||||
conversion[toModel] = wrapConversion(toModel, graph);
|
||||
}
|
||||
|
||||
return conversion;
|
||||
};
|
||||
|
8
node_modules/@react-native-community/cli-platform-ios/node_modules/color-name/LICENSE
generated
vendored
Normal file
8
node_modules/@react-native-community/cli-platform-ios/node_modules/color-name/LICENSE
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
The MIT License (MIT)
|
||||
Copyright (c) 2015 Dmitry Ivanov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
11
node_modules/@react-native-community/cli-platform-ios/node_modules/color-name/README.md
generated
vendored
Normal file
11
node_modules/@react-native-community/cli-platform-ios/node_modules/color-name/README.md
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.
|
||||
|
||||
[](https://nodei.co/npm/color-name/)
|
||||
|
||||
|
||||
```js
|
||||
var colors = require('color-name');
|
||||
colors.red //[255,0,0]
|
||||
```
|
||||
|
||||
<a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a>
|
152
node_modules/@react-native-community/cli-platform-ios/node_modules/color-name/index.js
generated
vendored
Normal file
152
node_modules/@react-native-community/cli-platform-ios/node_modules/color-name/index.js
generated
vendored
Normal file
@ -0,0 +1,152 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
"aliceblue": [240, 248, 255],
|
||||
"antiquewhite": [250, 235, 215],
|
||||
"aqua": [0, 255, 255],
|
||||
"aquamarine": [127, 255, 212],
|
||||
"azure": [240, 255, 255],
|
||||
"beige": [245, 245, 220],
|
||||
"bisque": [255, 228, 196],
|
||||
"black": [0, 0, 0],
|
||||
"blanchedalmond": [255, 235, 205],
|
||||
"blue": [0, 0, 255],
|
||||
"blueviolet": [138, 43, 226],
|
||||
"brown": [165, 42, 42],
|
||||
"burlywood": [222, 184, 135],
|
||||
"cadetblue": [95, 158, 160],
|
||||
"chartreuse": [127, 255, 0],
|
||||
"chocolate": [210, 105, 30],
|
||||
"coral": [255, 127, 80],
|
||||
"cornflowerblue": [100, 149, 237],
|
||||
"cornsilk": [255, 248, 220],
|
||||
"crimson": [220, 20, 60],
|
||||
"cyan": [0, 255, 255],
|
||||
"darkblue": [0, 0, 139],
|
||||
"darkcyan": [0, 139, 139],
|
||||
"darkgoldenrod": [184, 134, 11],
|
||||
"darkgray": [169, 169, 169],
|
||||
"darkgreen": [0, 100, 0],
|
||||
"darkgrey": [169, 169, 169],
|
||||
"darkkhaki": [189, 183, 107],
|
||||
"darkmagenta": [139, 0, 139],
|
||||
"darkolivegreen": [85, 107, 47],
|
||||
"darkorange": [255, 140, 0],
|
||||
"darkorchid": [153, 50, 204],
|
||||
"darkred": [139, 0, 0],
|
||||
"darksalmon": [233, 150, 122],
|
||||
"darkseagreen": [143, 188, 143],
|
||||
"darkslateblue": [72, 61, 139],
|
||||
"darkslategray": [47, 79, 79],
|
||||
"darkslategrey": [47, 79, 79],
|
||||
"darkturquoise": [0, 206, 209],
|
||||
"darkviolet": [148, 0, 211],
|
||||
"deeppink": [255, 20, 147],
|
||||
"deepskyblue": [0, 191, 255],
|
||||
"dimgray": [105, 105, 105],
|
||||
"dimgrey": [105, 105, 105],
|
||||
"dodgerblue": [30, 144, 255],
|
||||
"firebrick": [178, 34, 34],
|
||||
"floralwhite": [255, 250, 240],
|
||||
"forestgreen": [34, 139, 34],
|
||||
"fuchsia": [255, 0, 255],
|
||||
"gainsboro": [220, 220, 220],
|
||||
"ghostwhite": [248, 248, 255],
|
||||
"gold": [255, 215, 0],
|
||||
"goldenrod": [218, 165, 32],
|
||||
"gray": [128, 128, 128],
|
||||
"green": [0, 128, 0],
|
||||
"greenyellow": [173, 255, 47],
|
||||
"grey": [128, 128, 128],
|
||||
"honeydew": [240, 255, 240],
|
||||
"hotpink": [255, 105, 180],
|
||||
"indianred": [205, 92, 92],
|
||||
"indigo": [75, 0, 130],
|
||||
"ivory": [255, 255, 240],
|
||||
"khaki": [240, 230, 140],
|
||||
"lavender": [230, 230, 250],
|
||||
"lavenderblush": [255, 240, 245],
|
||||
"lawngreen": [124, 252, 0],
|
||||
"lemonchiffon": [255, 250, 205],
|
||||
"lightblue": [173, 216, 230],
|
||||
"lightcoral": [240, 128, 128],
|
||||
"lightcyan": [224, 255, 255],
|
||||
"lightgoldenrodyellow": [250, 250, 210],
|
||||
"lightgray": [211, 211, 211],
|
||||
"lightgreen": [144, 238, 144],
|
||||
"lightgrey": [211, 211, 211],
|
||||
"lightpink": [255, 182, 193],
|
||||
"lightsalmon": [255, 160, 122],
|
||||
"lightseagreen": [32, 178, 170],
|
||||
"lightskyblue": [135, 206, 250],
|
||||
"lightslategray": [119, 136, 153],
|
||||
"lightslategrey": [119, 136, 153],
|
||||
"lightsteelblue": [176, 196, 222],
|
||||
"lightyellow": [255, 255, 224],
|
||||
"lime": [0, 255, 0],
|
||||
"limegreen": [50, 205, 50],
|
||||
"linen": [250, 240, 230],
|
||||
"magenta": [255, 0, 255],
|
||||
"maroon": [128, 0, 0],
|
||||
"mediumaquamarine": [102, 205, 170],
|
||||
"mediumblue": [0, 0, 205],
|
||||
"mediumorchid": [186, 85, 211],
|
||||
"mediumpurple": [147, 112, 219],
|
||||
"mediumseagreen": [60, 179, 113],
|
||||
"mediumslateblue": [123, 104, 238],
|
||||
"mediumspringgreen": [0, 250, 154],
|
||||
"mediumturquoise": [72, 209, 204],
|
||||
"mediumvioletred": [199, 21, 133],
|
||||
"midnightblue": [25, 25, 112],
|
||||
"mintcream": [245, 255, 250],
|
||||
"mistyrose": [255, 228, 225],
|
||||
"moccasin": [255, 228, 181],
|
||||
"navajowhite": [255, 222, 173],
|
||||
"navy": [0, 0, 128],
|
||||
"oldlace": [253, 245, 230],
|
||||
"olive": [128, 128, 0],
|
||||
"olivedrab": [107, 142, 35],
|
||||
"orange": [255, 165, 0],
|
||||
"orangered": [255, 69, 0],
|
||||
"orchid": [218, 112, 214],
|
||||
"palegoldenrod": [238, 232, 170],
|
||||
"palegreen": [152, 251, 152],
|
||||
"paleturquoise": [175, 238, 238],
|
||||
"palevioletred": [219, 112, 147],
|
||||
"papayawhip": [255, 239, 213],
|
||||
"peachpuff": [255, 218, 185],
|
||||
"peru": [205, 133, 63],
|
||||
"pink": [255, 192, 203],
|
||||
"plum": [221, 160, 221],
|
||||
"powderblue": [176, 224, 230],
|
||||
"purple": [128, 0, 128],
|
||||
"rebeccapurple": [102, 51, 153],
|
||||
"red": [255, 0, 0],
|
||||
"rosybrown": [188, 143, 143],
|
||||
"royalblue": [65, 105, 225],
|
||||
"saddlebrown": [139, 69, 19],
|
||||
"salmon": [250, 128, 114],
|
||||
"sandybrown": [244, 164, 96],
|
||||
"seagreen": [46, 139, 87],
|
||||
"seashell": [255, 245, 238],
|
||||
"sienna": [160, 82, 45],
|
||||
"silver": [192, 192, 192],
|
||||
"skyblue": [135, 206, 235],
|
||||
"slateblue": [106, 90, 205],
|
||||
"slategray": [112, 128, 144],
|
||||
"slategrey": [112, 128, 144],
|
||||
"snow": [255, 250, 250],
|
||||
"springgreen": [0, 255, 127],
|
||||
"steelblue": [70, 130, 180],
|
||||
"tan": [210, 180, 140],
|
||||
"teal": [0, 128, 128],
|
||||
"thistle": [216, 191, 216],
|
||||
"tomato": [255, 99, 71],
|
||||
"turquoise": [64, 224, 208],
|
||||
"violet": [238, 130, 238],
|
||||
"wheat": [245, 222, 179],
|
||||
"white": [255, 255, 255],
|
||||
"whitesmoke": [245, 245, 245],
|
||||
"yellow": [255, 255, 0],
|
||||
"yellowgreen": [154, 205, 50]
|
||||
};
|
28
node_modules/@react-native-community/cli-platform-ios/node_modules/color-name/package.json
generated
vendored
Normal file
28
node_modules/@react-native-community/cli-platform-ios/node_modules/color-name/package.json
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "color-name",
|
||||
"version": "1.1.4",
|
||||
"description": "A list of color names and its values",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:colorjs/color-name.git"
|
||||
},
|
||||
"keywords": [
|
||||
"color-name",
|
||||
"color",
|
||||
"color-keyword",
|
||||
"keyword"
|
||||
],
|
||||
"author": "DY <dfcreative@gmail.com>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/colorjs/color-name/issues"
|
||||
},
|
||||
"homepage": "https://github.com/colorjs/color-name"
|
||||
}
|
39
node_modules/@react-native-community/cli-platform-ios/node_modules/has-flag/index.d.ts
generated
vendored
Normal file
39
node_modules/@react-native-community/cli-platform-ios/node_modules/has-flag/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
/**
|
||||
Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag.
|
||||
|
||||
@param flag - CLI flag to look for. The `--` prefix is optional.
|
||||
@param argv - CLI arguments. Default: `process.argv`.
|
||||
@returns Whether the flag exists.
|
||||
|
||||
@example
|
||||
```
|
||||
// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow
|
||||
|
||||
// foo.ts
|
||||
import hasFlag = require('has-flag');
|
||||
|
||||
hasFlag('unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('--unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('f');
|
||||
//=> true
|
||||
|
||||
hasFlag('-f');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo=bar');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo');
|
||||
//=> false
|
||||
|
||||
hasFlag('rainbow');
|
||||
//=> false
|
||||
```
|
||||
*/
|
||||
declare function hasFlag(flag: string, argv?: string[]): boolean;
|
||||
|
||||
export = hasFlag;
|
8
node_modules/@react-native-community/cli-platform-ios/node_modules/has-flag/index.js
generated
vendored
Normal file
8
node_modules/@react-native-community/cli-platform-ios/node_modules/has-flag/index.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (flag, argv = process.argv) => {
|
||||
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
||||
const position = argv.indexOf(prefix + flag);
|
||||
const terminatorPosition = argv.indexOf('--');
|
||||
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
||||
};
|
9
node_modules/@react-native-community/cli-platform-ios/node_modules/has-flag/license
generated
vendored
Normal file
9
node_modules/@react-native-community/cli-platform-ios/node_modules/has-flag/license
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
46
node_modules/@react-native-community/cli-platform-ios/node_modules/has-flag/package.json
generated
vendored
Normal file
46
node_modules/@react-native-community/cli-platform-ios/node_modules/has-flag/package.json
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "has-flag",
|
||||
"version": "4.0.0",
|
||||
"description": "Check if argv has a specific flag",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/has-flag",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"has",
|
||||
"check",
|
||||
"detect",
|
||||
"contains",
|
||||
"find",
|
||||
"flag",
|
||||
"cli",
|
||||
"command-line",
|
||||
"argv",
|
||||
"process",
|
||||
"arg",
|
||||
"args",
|
||||
"argument",
|
||||
"arguments",
|
||||
"getopt",
|
||||
"minimist",
|
||||
"optimist"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
89
node_modules/@react-native-community/cli-platform-ios/node_modules/has-flag/readme.md
generated
vendored
Normal file
89
node_modules/@react-native-community/cli-platform-ios/node_modules/has-flag/readme.md
generated
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
# has-flag [](https://travis-ci.org/sindresorhus/has-flag)
|
||||
|
||||
> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
|
||||
|
||||
Correctly stops looking after an `--` argument terminator.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-has-flag?utm_source=npm-has-flag&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install has-flag
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
const hasFlag = require('has-flag');
|
||||
|
||||
hasFlag('unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('--unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('f');
|
||||
//=> true
|
||||
|
||||
hasFlag('-f');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo=bar');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo');
|
||||
//=> false
|
||||
|
||||
hasFlag('rainbow');
|
||||
//=> false
|
||||
```
|
||||
|
||||
```
|
||||
$ node foo.js -f --unicorn --foo=bar -- --rainbow
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### hasFlag(flag, [argv])
|
||||
|
||||
Returns a boolean for whether the flag exists.
|
||||
|
||||
#### flag
|
||||
|
||||
Type: `string`
|
||||
|
||||
CLI flag to look for. The `--` prefix is optional.
|
||||
|
||||
#### argv
|
||||
|
||||
Type: `string[]`<br>
|
||||
Default: `process.argv`
|
||||
|
||||
CLI arguments.
|
||||
|
||||
|
||||
## Security
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
5
node_modules/@react-native-community/cli-platform-ios/node_modules/supports-color/browser.js
generated
vendored
Normal file
5
node_modules/@react-native-community/cli-platform-ios/node_modules/supports-color/browser.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
module.exports = {
|
||||
stdout: false,
|
||||
stderr: false
|
||||
};
|
135
node_modules/@react-native-community/cli-platform-ios/node_modules/supports-color/index.js
generated
vendored
Normal file
135
node_modules/@react-native-community/cli-platform-ios/node_modules/supports-color/index.js
generated
vendored
Normal file
@ -0,0 +1,135 @@
|
||||
'use strict';
|
||||
const os = require('os');
|
||||
const tty = require('tty');
|
||||
const hasFlag = require('has-flag');
|
||||
|
||||
const {env} = process;
|
||||
|
||||
let forceColor;
|
||||
if (hasFlag('no-color') ||
|
||||
hasFlag('no-colors') ||
|
||||
hasFlag('color=false') ||
|
||||
hasFlag('color=never')) {
|
||||
forceColor = 0;
|
||||
} else if (hasFlag('color') ||
|
||||
hasFlag('colors') ||
|
||||
hasFlag('color=true') ||
|
||||
hasFlag('color=always')) {
|
||||
forceColor = 1;
|
||||
}
|
||||
|
||||
if ('FORCE_COLOR' in env) {
|
||||
if (env.FORCE_COLOR === 'true') {
|
||||
forceColor = 1;
|
||||
} else if (env.FORCE_COLOR === 'false') {
|
||||
forceColor = 0;
|
||||
} else {
|
||||
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
||||
}
|
||||
}
|
||||
|
||||
function translateLevel(level) {
|
||||
if (level === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
level,
|
||||
hasBasic: true,
|
||||
has256: level >= 2,
|
||||
has16m: level >= 3
|
||||
};
|
||||
}
|
||||
|
||||
function supportsColor(haveStream, streamIsTTY) {
|
||||
if (forceColor === 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (hasFlag('color=16m') ||
|
||||
hasFlag('color=full') ||
|
||||
hasFlag('color=truecolor')) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
if (hasFlag('color=256')) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const min = forceColor || 0;
|
||||
|
||||
if (env.TERM === 'dumb') {
|
||||
return min;
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
||||
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
||||
const osRelease = os.release().split('.');
|
||||
if (
|
||||
Number(osRelease[0]) >= 10 &&
|
||||
Number(osRelease[2]) >= 10586
|
||||
) {
|
||||
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ('CI' in env) {
|
||||
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return min;
|
||||
}
|
||||
|
||||
if ('TEAMCITY_VERSION' in env) {
|
||||
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
||||
}
|
||||
|
||||
if (env.COLORTERM === 'truecolor') {
|
||||
return 3;
|
||||
}
|
||||
|
||||
if ('TERM_PROGRAM' in env) {
|
||||
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
||||
|
||||
switch (env.TERM_PROGRAM) {
|
||||
case 'iTerm.app':
|
||||
return version >= 3 ? 3 : 2;
|
||||
case 'Apple_Terminal':
|
||||
return 2;
|
||||
// No default
|
||||
}
|
||||
}
|
||||
|
||||
if (/-256(color)?$/i.test(env.TERM)) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ('COLORTERM' in env) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return min;
|
||||
}
|
||||
|
||||
function getSupportLevel(stream) {
|
||||
const level = supportsColor(stream, stream && stream.isTTY);
|
||||
return translateLevel(level);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
supportsColor: getSupportLevel,
|
||||
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
||||
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
||||
};
|
9
node_modules/@react-native-community/cli-platform-ios/node_modules/supports-color/license
generated
vendored
Normal file
9
node_modules/@react-native-community/cli-platform-ios/node_modules/supports-color/license
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
53
node_modules/@react-native-community/cli-platform-ios/node_modules/supports-color/package.json
generated
vendored
Normal file
53
node_modules/@react-native-community/cli-platform-ios/node_modules/supports-color/package.json
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
"name": "supports-color",
|
||||
"version": "7.2.0",
|
||||
"description": "Detect whether a terminal supports color",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/supports-color",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"browser.js"
|
||||
],
|
||||
"keywords": [
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"ansi",
|
||||
"styles",
|
||||
"tty",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"command-line",
|
||||
"support",
|
||||
"supports",
|
||||
"capability",
|
||||
"detect",
|
||||
"truecolor",
|
||||
"16m"
|
||||
],
|
||||
"dependencies": {
|
||||
"has-flag": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"import-fresh": "^3.0.0",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"browser": "browser.js"
|
||||
}
|
76
node_modules/@react-native-community/cli-platform-ios/node_modules/supports-color/readme.md
generated
vendored
Normal file
76
node_modules/@react-native-community/cli-platform-ios/node_modules/supports-color/readme.md
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
# supports-color [](https://travis-ci.org/chalk/supports-color)
|
||||
|
||||
> Detect whether a terminal supports color
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install supports-color
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const supportsColor = require('supports-color');
|
||||
|
||||
if (supportsColor.stdout) {
|
||||
console.log('Terminal stdout supports color');
|
||||
}
|
||||
|
||||
if (supportsColor.stdout.has256) {
|
||||
console.log('Terminal stdout supports 256 colors');
|
||||
}
|
||||
|
||||
if (supportsColor.stderr.has16m) {
|
||||
console.log('Terminal stderr supports 16 million colors (truecolor)');
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported.
|
||||
|
||||
The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag:
|
||||
|
||||
- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
|
||||
- `.level = 2` and `.has256 = true`: 256 color support
|
||||
- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
It obeys the `--color` and `--no-color` CLI flags.
|
||||
|
||||
For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
|
||||
|
||||
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
|
||||
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-supports-color?utm_source=npm-supports-color&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
---
|
2
node_modules/@react-native-community/cli-platform-ios/node_modules/xcode/.ratignore
generated
vendored
Normal file
2
node_modules/@react-native-community/cli-platform-ios/node_modules/xcode/.ratignore
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
fixtures
|
||||
*.pbxproj
|
24
node_modules/@react-native-community/cli-platform-ios/node_modules/xcode/.travis.yml
generated
vendored
Normal file
24
node_modules/@react-native-community/cli-platform-ios/node_modules/xcode/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
language: node_js
|
||||
sudo: false
|
||||
|
||||
git:
|
||||
depth: 10
|
||||
|
||||
node_js:
|
||||
- 6
|
||||
- 8
|
||||
- 10
|
||||
- 12
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
install:
|
||||
- nvm --version
|
||||
- node --version
|
||||
- npm --version
|
||||
- npm install
|
||||
|
||||
script:
|
||||
- npm test
|
6
node_modules/@react-native-community/cli-platform-ios/node_modules/xcode/AUTHORS
generated
vendored
Normal file
6
node_modules/@react-native-community/cli-platform-ios/node_modules/xcode/AUTHORS
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
Andrew Lunny (@alunny)
|
||||
Anis Kadri (@imhotep)
|
||||
Mike Reinstein (@mreinstein)
|
||||
Filip Maj (@filmaj)
|
||||
Brett Rudd (@goya)
|
||||
Bob Easterday (@bobeast)
|
202
node_modules/@react-native-community/cli-platform-ios/node_modules/xcode/LICENSE
generated
vendored
Normal file
202
node_modules/@react-native-community/cli-platform-ios/node_modules/xcode/LICENSE
generated
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
24
node_modules/@react-native-community/cli-platform-ios/node_modules/xcode/Makefile
generated
vendored
Normal file
24
node_modules/@react-native-community/cli-platform-ios/node_modules/xcode/Makefile
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
tests:
|
||||
nodeunit test/* test/parser/*
|
||||
|
||||
parser:
|
||||
pegjs lib/parser/pbxproj.pegjs
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user