@expo/cli 0.18.2 → 0.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/build/bin/cli +1 -1
  2. package/build/src/install/installAsync.js +2 -2
  3. package/build/src/install/installAsync.js.map +1 -1
  4. package/build/src/run/ios/XcodeBuild.types.js.map +1 -1
  5. package/build/src/run/ios/appleDevice/AppleDevice.js +103 -31
  6. package/build/src/run/ios/appleDevice/AppleDevice.js.map +1 -1
  7. package/build/src/run/ios/appleDevice/installOnDeviceAsync.js +14 -0
  8. package/build/src/run/ios/appleDevice/installOnDeviceAsync.js.map +1 -1
  9. package/build/src/run/ios/launchApp.js +12 -7
  10. package/build/src/run/ios/launchApp.js.map +1 -1
  11. package/build/src/run/ios/options/appleDestinations.js +124 -0
  12. package/build/src/run/ios/options/appleDestinations.js.map +1 -0
  13. package/build/src/run/ios/options/promptDevice.js +1 -1
  14. package/build/src/run/ios/options/promptDevice.js.map +1 -1
  15. package/build/src/run/ios/options/resolveDevice.js +49 -16
  16. package/build/src/run/ios/options/resolveDevice.js.map +1 -1
  17. package/build/src/run/ios/options/resolveNativeScheme.js.map +1 -1
  18. package/build/src/run/ios/options/resolveOptions.js +6 -3
  19. package/build/src/run/ios/options/resolveOptions.js.map +1 -1
  20. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
  21. package/build/src/start/platforms/ios/devicectl.js +371 -0
  22. package/build/src/start/platforms/ios/devicectl.js.map +1 -0
  23. package/build/src/start/platforms/ios/promptAppleDevice.js.map +1 -1
  24. package/build/src/start/platforms/ios/simctl.js.map +1 -1
  25. package/build/src/start/server/metro/debugging/AtlasPrerequisite.js +47 -0
  26. package/build/src/start/server/metro/debugging/AtlasPrerequisite.js.map +1 -0
  27. package/build/src/start/server/metro/debugging/attachAtlas.js +69 -0
  28. package/build/src/start/server/metro/debugging/attachAtlas.js.map +1 -0
  29. package/build/src/start/server/metro/instantiateMetro.js +11 -0
  30. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  31. package/build/src/start/server/metro/router.js +4 -2
  32. package/build/src/start/server/metro/router.js.map +1 -1
  33. package/build/src/utils/env.js +3 -0
  34. package/build/src/utils/env.js.map +1 -1
  35. package/build/src/utils/telemetry/getContext.js +1 -1
  36. package/package.json +4 -3
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "resolveDestinationsAsync", {
6
+ enumerable: true,
7
+ get: ()=>resolveDestinationsAsync
8
+ });
9
+ function _spawnAsync() {
10
+ const data = /*#__PURE__*/ _interopRequireDefault(require("@expo/spawn-async"));
11
+ _spawnAsync = function() {
12
+ return data;
13
+ };
14
+ return data;
15
+ }
16
+ const _log = require("../../../log");
17
+ function _interopRequireDefault(obj) {
18
+ return obj && obj.__esModule ? obj : {
19
+ default: obj
20
+ };
21
+ }
22
+ const debug = require("debug")("expo:apple-destination");
23
+ function coerceDestinationPlatformToOsType(platform) {
24
+ // The only two devices I have to test against...
25
+ switch(platform){
26
+ case "iOS":
27
+ return "iOS";
28
+ case "xrOS":
29
+ case "visionOS":
30
+ return "xrOS";
31
+ case "macOS":
32
+ return "macOS";
33
+ default:
34
+ debug("Unknown destination platform (needs to be added to Expo CLI):", platform);
35
+ return platform;
36
+ }
37
+ }
38
+ // Runs `.filter(Boolean)` on the array with correct types.
39
+ function filterBoolean(array) {
40
+ return array.filter(Boolean);
41
+ }
42
+ function warnDestinationObject(obj) {
43
+ if (!obj || typeof obj !== "object") {
44
+ return null;
45
+ }
46
+ if ("platform" in obj && "id" in obj && "name" in obj) {
47
+ return obj;
48
+ }
49
+ _log.Log.warn("Unexpected xcode destination object:", obj);
50
+ return null;
51
+ }
52
+ function parseXcodeDestinationString(str) {
53
+ const parsedLines = filterBoolean(str.trim().split("\n").map((line)=>{
54
+ line = line.trim();
55
+ return line.startsWith("{") ? line : null;
56
+ })).map((line)=>{
57
+ var ref;
58
+ const inner = (ref = line.match(/{(.*)}/)) == null ? void 0 : ref[1];
59
+ if (!inner) return null;
60
+ return Object.fromEntries(filterBoolean(inner.trim().split(", ").map((item)=>{
61
+ var ref;
62
+ return (ref = item.trim().match(/(?<key>[^:]+):(?<value>.+)/)) == null ? void 0 : ref.groups;
63
+ })).map((item)=>[
64
+ item.key,
65
+ item.value
66
+ ]));
67
+ });
68
+ return filterBoolean(parsedLines.map(warnDestinationObject));
69
+ }
70
+ function coercePhysicalDevice(device) {
71
+ // physical device
72
+ return {
73
+ /** @example `00008101-001964A22629003A` */ udid: device.id,
74
+ /** @example `Evan's phone` */ name: device.name,
75
+ /** @example `iPhone13,4` */ // model: 'UNKNOWN',
76
+ /** @example `device` */ deviceType: "device",
77
+ osType: coerceDestinationPlatformToOsType(device.platform),
78
+ osVersion: ""
79
+ };
80
+ }
81
+ function coerceSimulatorDevice(device) {
82
+ // simulator
83
+ return {
84
+ /** '00E55DC0-0364-49DF-9EC6-77BE587137D4' */ udid: device.id,
85
+ /** 'com.apple.CoreSimulator.SimRuntime.iOS-15-1' */ runtime: "",
86
+ /** If the device is "available" which generally means that the OS files haven't been deleted (this can happen when Xcode updates). */ isAvailable: true,
87
+ deviceTypeIdentifier: "",
88
+ state: "Shutdown",
89
+ /** 'iPhone 13 Pro' */ name: device.name,
90
+ /** Type of OS the device uses. */ osType: device.platform === "visionOS Simulator" ? "xrOS" : "iOS",
91
+ /** '15.1' */ osVersion: device.OS,
92
+ /** 'iPhone 13 Pro (15.1)' */ windowName: `${device.name} (${device.OS})`
93
+ };
94
+ }
95
+ function coerceDestinationObjectToKnownDeviceType(device) {
96
+ if (device.arch) {
97
+ // physical device
98
+ return coercePhysicalDevice(device);
99
+ } else if (device.OS) {
100
+ // simulator
101
+ return coerceSimulatorDevice(device);
102
+ } else {
103
+ // "Any device"
104
+ return null;
105
+ }
106
+ }
107
+ async function resolveDestinationsAsync(props) {
108
+ // xcodebuild -workspace /Users/evanbacon/Documents/GitHub/lab/apr23/ios/apr23.xcworkspace -configuration Debug -scheme apr23 -showdestinations -json
109
+ const { stdout } = await (0, _spawnAsync().default)("xcodebuild", [
110
+ props.xcodeProject.isWorkspace ? "-workspace" : "-project",
111
+ props.xcodeProject.name,
112
+ "-configuration",
113
+ props.configuration,
114
+ "-scheme",
115
+ props.scheme,
116
+ "-showdestinations",
117
+ "-quiet",
118
+ ]);
119
+ // console.log(JSON.stringify(stdout, null, 2));
120
+ const destinationObjects = parseXcodeDestinationString(stdout);
121
+ return filterBoolean(destinationObjects.map(coerceDestinationObjectToKnownDeviceType));
122
+ }
123
+
124
+ //# sourceMappingURL=appleDestinations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/run/ios/options/appleDestinations.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\n\nimport { Log } from '../../../log';\nimport { OSType } from '../../../start/platforms/ios/simctl';\nimport * as SimControl from '../../../start/platforms/ios/simctl';\nimport { BuildProps } from '../XcodeBuild.types';\nimport * as AppleDevice from '../appleDevice/AppleDevice';\n\nconst debug = require('debug')('expo:apple-destination') as typeof console.log;\n\ninterface Destination {\n // 'visionOS'\n platform: string;\n // 'arm64'\n arch?: string;\n // 'Designed for [iPad,iPhone]'\n variant?: string;\n // '00008112-001A20EC1E78A01E'\n id: string;\n // 'Apple Vision Pro'\n name: string;\n // Available in simulators\n OS?: string;\n}\n\nfunction coerceDestinationPlatformToOsType(platform: string): OSType {\n // The only two devices I have to test against...\n switch (platform) {\n case 'iOS':\n return 'iOS';\n case 'xrOS':\n case 'visionOS':\n return 'xrOS';\n case 'macOS':\n return 'macOS';\n default:\n debug('Unknown destination platform (needs to be added to Expo CLI):', platform);\n return platform as OSType;\n }\n}\n\n// Runs `.filter(Boolean)` on the array with correct types.\nfunction filterBoolean<T>(array: (T | null | undefined)[]): T[] {\n return array.filter(Boolean) as T[];\n}\n\nfunction warnDestinationObject(obj: any): Destination | null {\n if (!obj || typeof obj !== 'object') {\n return null;\n }\n\n if ('platform' in obj && 'id' in obj && 'name' in obj) {\n return obj;\n }\n Log.warn('Unexpected xcode destination object:', obj);\n return null;\n}\n\nfunction parseXcodeDestinationString(str: string): Destination[] {\n const parsedLines = filterBoolean(\n str\n .trim()\n .split('\\n')\n .map((line: string) => {\n line = line.trim();\n return line.startsWith('{') ? line : null;\n })\n ).map((line) => {\n const inner = line.match(/{(.*)}/)?.[1];\n\n if (!inner) return null;\n\n return Object.fromEntries(\n filterBoolean(\n inner\n .trim()\n .split(', ')\n .map((item) => item.trim().match(/(?<key>[^:]+):(?<value>.+)/)?.groups)\n ).map((item) => [item!.key, item!.value])\n );\n });\n\n return filterBoolean(parsedLines.map(warnDestinationObject));\n}\n\nfunction coercePhysicalDevice(\n device: Destination\n): Pick<AppleDevice.ConnectedDevice, 'udid' | 'name' | 'osType' | 'deviceType' | 'osVersion'> {\n // physical device\n return {\n /** @example `00008101-001964A22629003A` */\n udid: device.id,\n /** @example `Evan's phone` */\n name: device.name,\n /** @example `iPhone13,4` */\n // model: 'UNKNOWN',\n /** @example `device` */\n deviceType: 'device',\n osType: coerceDestinationPlatformToOsType(device.platform),\n\n osVersion: '',\n };\n}\n\nfunction coerceSimulatorDevice(\n device: Destination\n): Pick<\n SimControl.Device,\n | 'udid'\n | 'name'\n | 'osType'\n | 'osVersion'\n | 'runtime'\n | 'isAvailable'\n | 'deviceTypeIdentifier'\n | 'state'\n | 'windowName'\n> {\n // simulator\n return {\n /** '00E55DC0-0364-49DF-9EC6-77BE587137D4' */\n udid: device.id,\n /** 'com.apple.CoreSimulator.SimRuntime.iOS-15-1' */\n runtime: '',\n /** If the device is \"available\" which generally means that the OS files haven't been deleted (this can happen when Xcode updates). */\n isAvailable: true,\n\n deviceTypeIdentifier: '',\n\n state: 'Shutdown',\n /** 'iPhone 13 Pro' */\n name: device.name,\n /** Type of OS the device uses. */\n osType: device.platform === 'visionOS Simulator' ? 'xrOS' : 'iOS',\n /** '15.1' */\n osVersion: device.OS!,\n /** 'iPhone 13 Pro (15.1)' */\n windowName: `${device.name} (${device.OS})`,\n };\n}\n\nfunction coerceDestinationObjectToKnownDeviceType(device: Destination) {\n if (device.arch) {\n // physical device\n return coercePhysicalDevice(device);\n } else if (device.OS) {\n // simulator\n return coerceSimulatorDevice(device);\n } else {\n // \"Any device\"\n return null;\n }\n}\n\nexport async function resolveDestinationsAsync(\n props: Pick<BuildProps, 'configuration' | 'scheme' | 'xcodeProject'>\n): Promise<{ name: string; osType: OSType; osVersion: string; udid: string }[]> {\n // xcodebuild -workspace /Users/evanbacon/Documents/GitHub/lab/apr23/ios/apr23.xcworkspace -configuration Debug -scheme apr23 -showdestinations -json\n\n const { stdout } = await spawnAsync('xcodebuild', [\n props.xcodeProject.isWorkspace ? '-workspace' : '-project',\n props.xcodeProject.name,\n '-configuration',\n props.configuration,\n '-scheme',\n props.scheme,\n '-showdestinations',\n '-quiet',\n ]);\n\n // console.log(JSON.stringify(stdout, null, 2));\n\n const destinationObjects = parseXcodeDestinationString(stdout);\n\n return filterBoolean(destinationObjects.map(coerceDestinationObjectToKnownDeviceType));\n}\n"],"names":["resolveDestinationsAsync","debug","require","coerceDestinationPlatformToOsType","platform","filterBoolean","array","filter","Boolean","warnDestinationObject","obj","Log","warn","parseXcodeDestinationString","str","parsedLines","trim","split","map","line","startsWith","inner","match","Object","fromEntries","item","groups","key","value","coercePhysicalDevice","device","udid","id","name","deviceType","osType","osVersion","coerceSimulatorDevice","runtime","isAvailable","deviceTypeIdentifier","state","OS","windowName","coerceDestinationObjectToKnownDeviceType","arch","props","stdout","spawnAsync","xcodeProject","isWorkspace","configuration","scheme","destinationObjects"],"mappings":"AAAA;;;;+BA0JsBA,0BAAwB;;aAAxBA,wBAAwB;;;8DA1JvB,mBAAmB;;;;;;qBAEtB,cAAc;;;;;;AAMlC,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,wBAAwB,CAAC,AAAsB,AAAC;AAiB/E,SAASC,iCAAiC,C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C,CAAC,CAAC;AACzF,CAAC"}
@@ -34,7 +34,7 @@ function isSimControlDevice(item) {
34
34
  function formatDeviceChoice(item) {
35
35
  const isConnected = isConnectedDevice(item) && item.deviceType === "device";
36
36
  const isActive = isSimControlDevice(item) && item.state === "Booted";
37
- const symbol = isConnected ? item.connectionType === "Network" ? "\uD83C\uDF10 " : "\uD83D\uDD0C " : "";
37
+ const symbol = item.osType === "macOS" ? "\uD83D\uDDA5️ " : isConnected ? item.connectionType === "Network" ? "\uD83C\uDF10 " : "\uD83D\uDD0C " : "";
38
38
  const format = isActive ? _chalk().default.bold : (text)=>text;
39
39
  return {
40
40
  title: `${symbol}${format(item.name)}${item.osVersion ? _chalk().default.dim(` (${item.osVersion})`) : ""}`,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/run/ios/options/promptDevice.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as SimControl from '../../../start/platforms/ios/simctl';\nimport prompt from '../../../utils/prompts';\nimport { ConnectedDevice } from '../appleDevice/AppleDevice';\n\ntype AnyDevice = SimControl.Device | ConnectedDevice;\n\nfunction isConnectedDevice(item: AnyDevice): item is ConnectedDevice {\n return 'deviceType' in item;\n}\n\nfunction isSimControlDevice(item: AnyDevice): item is SimControl.Device {\n return 'state' in item;\n}\n\n/** Format a device for the prompt list. Exposed for testing. */\nexport function formatDeviceChoice(item: AnyDevice): { title: string; value: string } {\n const isConnected = isConnectedDevice(item) && item.deviceType === 'device';\n const isActive = isSimControlDevice(item) && item.state === 'Booted';\n const symbol = isConnected ? (item.connectionType === 'Network' ? '🌐 ' : '🔌 ') : '';\n const format = isActive ? chalk.bold : (text: string) => text;\n return {\n title: `${symbol}${format(item.name)}${\n item.osVersion ? chalk.dim(` (${item.osVersion})`) : ''\n }`,\n value: item.udid,\n };\n}\n\n/** Prompt to select a device from a searchable list of devices. */\nexport async function promptDeviceAsync(devices: AnyDevice[]): Promise<AnyDevice> {\n // --device with no props after\n const { value } = await prompt({\n type: 'autocomplete',\n name: 'value',\n limit: 11,\n message: 'Select a device',\n choices: devices.map((item) => formatDeviceChoice(item)),\n suggest: (input: any, choices: any) => {\n const regex = new RegExp(input, 'i');\n return choices.filter((choice: any) => regex.test(choice.title));\n },\n });\n return devices.find((device) => device.udid === value)!;\n}\n"],"names":["formatDeviceChoice","promptDeviceAsync","isConnectedDevice","item","isSimControlDevice","isConnected","deviceType","isActive","state","symbol","connectionType","format","chalk","bold","text","title","name","osVersion","dim","value","udid","devices","prompt","type","limit","message","choices","map","suggest","input","regex","RegExp","filter","choice","test","find","device"],"mappings":"AAAA;;;;;;;;;;;IAiBgBA,kBAAkB,MAAlBA,kBAAkB;IAcZC,iBAAiB,MAAjBA,iBAAiB;;;8DA/BrB,OAAO;;;;;;8DAGN,wBAAwB;;;;;;AAK3C,SAASC,iBAAiB,CAACC,IAAe,EAA2B;IACnE,OAAO,YAAY,IAAIA,IAAI,CAAC;AAC9B,CAAC;AAED,SAASC,kBAAkB,CAACD,IAAe,EAA6B;IACtE,OAAO,OAAO,IAAIA,IAAI,CAAC;AACzB,CAAC;AAGM,SAASH,kBAAkB,CAACG,IAAe,EAAoC;IACpF,MAAME,WAAW,GAAGH,iBAAiB,CAACC,IAAI,CAAC,IAAIA,IAAI,CAACG,UAAU,KAAK,QAAQ,AAAC;IAC5E,MAAMC,QAAQ,GAAGH,kBAAkB,CAACD,IAAI,CAAC,IAAIA,IAAI,CAACK,KAAK,KAAK,QAAQ,AAAC;IACrE,MAAMC,MAAM,GAAGJ,WAAW,GAAIF,IAAI,CAACO,cAAc,KAAK,SAAS,GAAG,eAAI,GAAG,eAAI,GAAI,EAAE,AAAC;IACpF,MAAMC,MAAM,GAAGJ,QAAQ,GAAGK,MAAK,EAAA,QAAA,CAACC,IAAI,GAAG,CAACC,IAAY,GAAKA,IAAI,AAAC;IAC9D,OAAO;QACLC,KAAK,EAAE,CAAC,EAAEN,MAAM,CAAC,EAAEE,MAAM,CAACR,IAAI,CAACa,IAAI,CAAC,CAAC,EACnCb,IAAI,CAACc,SAAS,GAAGL,MAAK,EAAA,QAAA,CAACM,GAAG,CAAC,CAAC,EAAE,EAAEf,IAAI,CAACc,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CACxD,CAAC;QACFE,KAAK,EAAEhB,IAAI,CAACiB,IAAI;KACjB,CAAC;AACJ,CAAC;AAGM,eAAenB,iBAAiB,CAACoB,OAAoB,EAAsB;IAChF,+BAA+B;IAC/B,MAAM,EAAEF,KAAK,CAAA,EAAE,GAAG,MAAMG,IAAAA,QAAM,QAAA,EAAC;QAC7BC,IAAI,EAAE,cAAc;QACpBP,IAAI,EAAE,OAAO;QACbQ,KAAK,EAAE,EAAE;QACTC,OAAO,EAAE,iBAAiB;QAC1BC,OAAO,EAAEL,OAAO,CAACM,GAAG,CAAC,CAACxB,IAAI,GAAKH,kBAAkB,CAACG,IAAI,CAAC,CAAC;QACxDyB,OAAO,EAAE,CAACC,KAAU,EAAEH,OAAY,GAAK;YACrC,MAAMI,KAAK,GAAG,IAAIC,MAAM,CAACF,KAAK,EAAE,GAAG,CAAC,AAAC;YACrC,OAAOH,OAAO,CAACM,MAAM,CAAC,CAACC,MAAW,GAAKH,KAAK,CAACI,IAAI,CAACD,MAAM,CAAClB,KAAK,CAAC,CAAC,CAAC;QACnE,CAAC;KACF,CAAC,AAAC;IACH,OAAOM,OAAO,CAACc,IAAI,CAAC,CAACC,MAAM,GAAKA,MAAM,CAAChB,IAAI,KAAKD,KAAK,CAAC,CAAE;AAC1D,CAAC"}
1
+ {"version":3,"sources":["../../../../../src/run/ios/options/promptDevice.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as SimControl from '../../../start/platforms/ios/simctl';\nimport prompt from '../../../utils/prompts';\nimport { ConnectedDevice } from '../appleDevice/AppleDevice';\n\ntype AnyDevice = SimControl.Device | ConnectedDevice;\n\nfunction isConnectedDevice(item: AnyDevice): item is ConnectedDevice {\n return 'deviceType' in item;\n}\n\nfunction isSimControlDevice(item: AnyDevice): item is SimControl.Device {\n return 'state' in item;\n}\n\n/** Format a device for the prompt list. Exposed for testing. */\nexport function formatDeviceChoice(item: AnyDevice): { title: string; value: string } {\n const isConnected = isConnectedDevice(item) && item.deviceType === 'device';\n const isActive = isSimControlDevice(item) && item.state === 'Booted';\n const symbol =\n item.osType === 'macOS'\n ? '🖥️ '\n : isConnected\n ? item.connectionType === 'Network'\n ? '🌐 '\n : '🔌 '\n : '';\n const format = isActive ? chalk.bold : (text: string) => text;\n return {\n title: `${symbol}${format(item.name)}${\n item.osVersion ? chalk.dim(` (${item.osVersion})`) : ''\n }`,\n value: item.udid,\n };\n}\n\n/** Prompt to select a device from a searchable list of devices. */\nexport async function promptDeviceAsync(devices: AnyDevice[]): Promise<AnyDevice> {\n // --device with no props after\n const { value } = await prompt({\n type: 'autocomplete',\n name: 'value',\n limit: 11,\n message: 'Select a device',\n choices: devices.map((item) => formatDeviceChoice(item)),\n suggest: (input: any, choices: any) => {\n const regex = new RegExp(input, 'i');\n return choices.filter((choice: any) => regex.test(choice.title));\n },\n });\n return devices.find((device) => device.udid === value)!;\n}\n"],"names":["formatDeviceChoice","promptDeviceAsync","isConnectedDevice","item","isSimControlDevice","isConnected","deviceType","isActive","state","symbol","osType","connectionType","format","chalk","bold","text","title","name","osVersion","dim","value","udid","devices","prompt","type","limit","message","choices","map","suggest","input","regex","RegExp","filter","choice","test","find","device"],"mappings":"AAAA;;;;;;;;;;;IAiBgBA,kBAAkB,MAAlBA,kBAAkB;IAqBZC,iBAAiB,MAAjBA,iBAAiB;;;8DAtCrB,OAAO;;;;;;8DAGN,wBAAwB;;;;;;AAK3C,SAASC,iBAAiB,CAACC,IAAe,EAA2B;IACnE,OAAO,YAAY,IAAIA,IAAI,CAAC;AAC9B,CAAC;AAED,SAASC,kBAAkB,CAACD,IAAe,EAA6B;IACtE,OAAO,OAAO,IAAIA,IAAI,CAAC;AACzB,CAAC;AAGM,SAASH,kBAAkB,CAACG,IAAe,EAAoC;IACpF,MAA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AC,AAAC;YACrC,OAAOH,OAAO,CAACM,MAAM,CAAC,CAACC,MAAW,GAAKH,KAAK,CAACI,IAAI,CAACD,MAAM,CAAClB,KAAK,CAAC,CAAC,CAAC;QACnE,CAAC;KACF,CAAC,AAAC;IACH,OAAOM,OAAO,CAACc,IAAI,CAAC,CAACC,MAAM,GAAKA,MAAM,CAAChB,IAAI,KAAKD,KAAK,CAAC,CAAE;AAC1D,CAAC"}
@@ -12,11 +12,13 @@ _export(exports, {
12
12
  resolveDeviceAsync: ()=>resolveDeviceAsync,
13
13
  isSimulatorDevice: ()=>isSimulatorDevice
14
14
  });
15
+ const _appleDestinations = require("./appleDestinations");
15
16
  const _promptDevice = require("./promptDevice");
16
17
  const _log = /*#__PURE__*/ _interopRequireWildcard(require("../../../log"));
17
18
  const _appleDeviceManager = require("../../../start/platforms/ios/AppleDeviceManager");
18
19
  const _promptAppleDevice = require("../../../start/platforms/ios/promptAppleDevice");
19
20
  const _simctl = /*#__PURE__*/ _interopRequireWildcard(require("../../../start/platforms/ios/simctl"));
21
+ const _array = require("../../../utils/array");
20
22
  const _errors = require("../../../utils/errors");
21
23
  const _profile = require("../../../utils/profile");
22
24
  const _hints = require("../../hints");
@@ -60,39 +62,70 @@ function _interopRequireWildcard(obj, nodeInterop) {
60
62
  }
61
63
  return newObj;
62
64
  }
63
- /** Get a list of devices (called destinations) that are connected to the host machine. Filter by `osType` if defined. */ async function getDevicesAsync({ osType } = {}) {
64
- const connectedDevices = await _appleDevice.getConnectedDevicesAsync();
65
- const simulators = await (0, _promptAppleDevice.sortDefaultDeviceToBeginningAsync)(await (0, _profile.profile)(_simctl.getDevicesAsync)(), osType);
66
- const devices = [
67
- ...connectedDevices,
68
- ...simulators
65
+ // type AnyDevice = SimControl.Device | AppleDevice.ConnectedDevice;
66
+ /** Get a list of devices (called destinations) that are connected to the host machine. Filter by `osType` if defined. */ async function getDevicesAsync({ osType , ...buildProps }) {
67
+ const devices = await (0, _promptAppleDevice.sortDefaultDeviceToBeginningAsync)((0, _array.uniqBy)((await Promise.all([
68
+ _appleDevice.getConnectedDevicesAsync(),
69
+ await (0, _profile.profile)(_simctl.getDevicesAsync)(),
70
+ (0, _appleDestinations.resolveDestinationsAsync)(buildProps),
71
+ ])).flat(), (item)=>item.udid), osType);
72
+ // Sort devices to top of front of the list
73
+ const physical = [];
74
+ const simulators = devices.filter((device)=>{
75
+ if ("isAvailable" in device) {
76
+ return true;
77
+ } else {
78
+ physical.push(device);
79
+ return false;
80
+ }
81
+ });
82
+ const isPhone = (a)=>a.osType === "iOS";
83
+ const sorted = [
84
+ ...physical.sort((a, b)=>{
85
+ const aPhone = isPhone(a);
86
+ const bPhone = isPhone(b);
87
+ if (aPhone && !bPhone) return -1;
88
+ if (!aPhone && bPhone) return 1;
89
+ return 0;
90
+ }),
91
+ ...simulators,
69
92
  ];
70
93
  // If osType is defined, then filter out ineligible simulators.
71
94
  // Only do this inside of the device selection so users who pass the entire device udid can attempt to select any simulator (even if it's invalid).
72
- return osType ? filterDevicesForOsType(devices, osType) : devices;
95
+ return osType ? filterDevicesForOsType(sorted, osType) : sorted;
73
96
  }
74
97
  /** @returns a list of devices, filtered by the provided `osType`. */ function filterDevicesForOsType(devices, osType) {
75
- return devices.filter((device)=>!("osType" in device) || device.osType === osType);
98
+ return devices.filter((device)=>{
99
+ if (osType === "iOS") {
100
+ // Compatible devices for iOS builds
101
+ return [
102
+ "iOS",
103
+ "macOS",
104
+ "xrOS"
105
+ ].includes(device.osType);
106
+ }
107
+ return device.osType === osType;
108
+ });
76
109
  }
77
- async function resolveDeviceAsync(device, { osType } = {}) {
110
+ async function resolveDeviceAsync(device, buildProps) {
78
111
  await _appleDeviceManager.AppleDeviceManager.assertSystemRequirementsAsync();
79
112
  if (!device) {
80
113
  /** Finds the first possible device and returns in a booted state. */ const manager = await _appleDeviceManager.AppleDeviceManager.resolveAsync({
81
114
  device: {
82
- osType
115
+ osType: buildProps.osType
83
116
  }
84
117
  });
85
- _log.debug(`Resolved default device (name: ${manager.device.name}, udid: ${manager.device.udid}, osType: ${osType})`);
118
+ _log.debug(`Resolved default device (name: ${manager.device.name}, udid: ${manager.device.udid}, osType: ${buildProps.osType})`);
86
119
  return manager.device;
87
120
  }
88
- const devices = await getDevicesAsync({
89
- osType
90
- });
91
- const resolved = device === true ? await (0, _promptDevice.promptDeviceAsync)(devices) : findDeviceFromSearchValue(devices, device.toLowerCase());
121
+ const devices = await getDevicesAsync(buildProps);
122
+ const resolved = device === true ? // @ts-expect-error
123
+ await (0, _promptDevice.promptDeviceAsync)(devices) : findDeviceFromSearchValue(devices, device.toLowerCase());
92
124
  return ensureBootedAsync(resolved);
93
125
  }
94
126
  function isSimulatorDevice(device) {
95
- return !("deviceType" in device) || device.deviceType.startsWith("com.apple.CoreSimulator.SimDeviceType.");
127
+ var ref;
128
+ return !("deviceType" in device) || !!((ref = device.deviceType) == null ? void 0 : ref.startsWith == null ? void 0 : ref.startsWith("com.apple.CoreSimulator.SimDeviceType."));
96
129
  }
97
130
  /** @returns device matching the `searchValue` against name or UDID. */ function findDeviceFromSearchValue(devices, searchValue) {
98
131
  const device = devices.find((device)=>device.udid.toLowerCase() === searchValue || device.name.toLowerCase() === searchValue);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/run/ios/options/resolveDevice.ts"],"sourcesContent":["import { promptDeviceAsync } from './promptDevice';\nimport * as Log from '../../../log';\nimport {\n AppleDeviceManager,\n ensureSimulatorOpenAsync,\n} from '../../../start/platforms/ios/AppleDeviceManager';\nimport { sortDefaultDeviceToBeginningAsync } from '../../../start/platforms/ios/promptAppleDevice';\nimport { OSType } from '../../../start/platforms/ios/simctl';\nimport * as SimControl from '../../../start/platforms/ios/simctl';\nimport { CommandError } from '../../../utils/errors';\nimport { profile } from '../../../utils/profile';\nimport { logDeviceArgument } from '../../hints';\nimport * as AppleDevice from '../appleDevice/AppleDevice';\n\ntype AnyDevice = SimControl.Device | AppleDevice.ConnectedDevice;\n\n/** Get a list of devices (called destinations) that are connected to the host machine. Filter by `osType` if defined. */\nasync function getDevicesAsync({ osType }: { osType?: OSType } = {}): Promise<AnyDevice[]> {\n const connectedDevices = await AppleDevice.getConnectedDevicesAsync();\n\n const simulators = await sortDefaultDeviceToBeginningAsync(\n await profile(SimControl.getDevicesAsync)(),\n osType\n );\n\n const devices = [...connectedDevices, ...simulators];\n\n // If osType is defined, then filter out ineligible simulators.\n // Only do this inside of the device selection so users who pass the entire device udid can attempt to select any simulator (even if it's invalid).\n return osType ? filterDevicesForOsType(devices, osType) : devices;\n}\n\n/** @returns a list of devices, filtered by the provided `osType`. */\nfunction filterDevicesForOsType(devices: AnyDevice[], osType: OSType): AnyDevice[] {\n return devices.filter((device) => !('osType' in device) || device.osType === osType);\n}\n\n/** Given a `device` argument from the CLI, parse and prompt our way to a usable device for building. */\nexport async function resolveDeviceAsync(\n device?: string | boolean,\n { osType }: { osType?: OSType } = {}\n): Promise<AnyDevice> {\n await AppleDeviceManager.assertSystemRequirementsAsync();\n\n if (!device) {\n /** Finds the first possible device and returns in a booted state. */\n const manager = await AppleDeviceManager.resolveAsync({\n device: {\n osType,\n },\n });\n Log.debug(\n `Resolved default device (name: ${manager.device.name}, udid: ${manager.device.udid}, osType: ${osType})`\n );\n return manager.device;\n }\n\n const devices: AnyDevice[] = await getDevicesAsync({\n osType,\n });\n\n const resolved =\n device === true\n ? // `--device` (no props after)\n await promptDeviceAsync(devices)\n : // `--device <name|udid>`\n findDeviceFromSearchValue(devices, device.toLowerCase());\n\n return ensureBootedAsync(resolved);\n}\n\n/** @returns `true` if the given device is a simulator. */\nexport function isSimulatorDevice(device: AnyDevice): boolean {\n return (\n !('deviceType' in device) ||\n device.deviceType.startsWith('com.apple.CoreSimulator.SimDeviceType.')\n );\n}\n\n/** @returns device matching the `searchValue` against name or UDID. */\nfunction findDeviceFromSearchValue(devices: AnyDevice[], searchValue: string): AnyDevice {\n const device = devices.find(\n (device) =>\n device.udid.toLowerCase() === searchValue || device.name.toLowerCase() === searchValue\n );\n if (!device) {\n throw new CommandError('BAD_ARGS', `No device UDID or name matching \"${searchValue}\"`);\n }\n return device;\n}\n\n/** Ensures the device is booted if it's a simulator. */\nasync function ensureBootedAsync(device: AnyDevice): Promise<AnyDevice> {\n // --device with no props after\n logDeviceArgument(device.udid);\n if (isSimulatorDevice(device)) {\n return ensureSimulatorOpenAsync({ udid: device.udid });\n }\n return device;\n}\n"],"names":["resolveDeviceAsync","isSimulatorDevice","getDevicesAsync","osType","connectedDevices","AppleDevice","getConnectedDevicesAsync","simulators","sortDefaultDeviceToBeginningAsync","profile","SimControl","devices","filterDevicesForOsType","filter","device","AppleDeviceManager","assertSystemRequirementsAsync","manager","resolveAsync","Log","debug","name","udid","resolved","promptDeviceAsync","findDeviceFromSearchValue","toLowerCase","ensureBootedAsync","deviceType","startsWith","searchValue","find","CommandError","logDeviceArgument","ensureSimulatorOpenAsync"],"mappings":"AAAA;;;;;;;;;;;IAsCsBA,kBAAkB,MAAlBA,kBAAkB;IAkCxBC,iBAAiB,MAAjBA,iBAAiB;;8BAxEC,gBAAgB;2DAC7B,cAAc;oCAI5B,iDAAiD;mCACN,gDAAgD;8DAEtE,qCAAqC;wBACpC,uBAAuB;yBAC5B,wBAAwB;uBACd,aAAa;mEAClB,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIzD,uHAAuH,GACvH,eAAeC,eAAe,CAAC,EAAEC,MAAM,CAAA,EAAuB,GAAG,EAAE,EAAwB;IACzF,MAAMC,gBAAgB,GAAG,MAAMC,YAAW,CAACC,wBAAwB,EAAE,AAAC;IAEtE,MAAMC,UAAU,GAAG,MAAMC,IAAAA,kBAAiC,kCAAA,EACxD,MAAMC,IAAAA,QAAO,QAAA,EAACC,OAAU,CAACR,eAAe,CAAC,EAAE,EAC3CC,MAAM,CACP,AAAC;IAEF,MAAMQ,OAAO,GAAG;WAAIP,gBAAgB;WAAKG,UAAU;KAAC,AAAC;IAErD,+DAA+D;IAC/D,mJAA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ACE,CAAC,CAAC,YAAY,IAAIA,MAAM,CAAC,IACzBA,MAAM,CAACc,UAAU,CAACC,UAAU,CAAC,wCAAwC,CAAC,CACtE;AACJ,CAAC;AAED,qEAAqE,GACrE,SAASJ,yBAAyB,CAACd,OAAoB,EAAEmB,WAAmB,EAAa;IACvF,MAAMhB,MAAM,GAAGH,OAAO,CAACoB,IAAI,CACzB,CAACjB,MAAM,GACLA,MAAM,CAACQ,IAAI,CAACI,WAAW,EAAE,KAAKI,WAAW,IAAIhB,MAAM,CAACO,IAAI,CAACK,WAAW,EAAE,KAAKI,WAAW,CACzF,AAAC;IACF,IAAI,CAAChB,MAAM,EAAE;QACX,MAAM,IAAIkB,OAAY,aAAA,CAAC,UAAU,EAAE,CAAC,iCAAiC,EAAEF,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACzF,CAAC;IACD,OAAOhB,MAAM,CAAC;AAChB,CAAC;AAED,sDAAsD,GACtD,eAAea,iBAAiB,CAACb,MAAiB,EAAsB;IACtE,+BAA+B;IAC/BmB,IAAAA,MAAiB,kBAAA,EAACnB,MAAM,CAACQ,IAAI,CAAC,CAAC;IAC/B,IAAIrB,iBAAiB,CAACa,MAAM,CAAC,EAAE;QAC7B,OAAOoB,IAAAA,mBAAwB,yBAAA,EAAC;YAAEZ,IAAI,EAAER,MAAM,CAACQ,IAAI;SAAE,CAAC,CAAC;IACzD,CAAC;IACD,OAAOR,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"sources":["../../../../../src/run/ios/options/resolveDevice.ts"],"sourcesContent":["import { resolveDestinationsAsync } from './appleDestinations';\nimport { promptDeviceAsync } from './promptDevice';\nimport * as Log from '../../../log';\nimport {\n AppleDeviceManager,\n ensureSimulatorOpenAsync,\n} from '../../../start/platforms/ios/AppleDeviceManager';\nimport { sortDefaultDeviceToBeginningAsync } from '../../../start/platforms/ios/promptAppleDevice';\nimport { OSType } from '../../../start/platforms/ios/simctl';\nimport * as SimControl from '../../../start/platforms/ios/simctl';\nimport { uniqBy } from '../../../utils/array';\nimport { CommandError } from '../../../utils/errors';\nimport { profile } from '../../../utils/profile';\nimport { logDeviceArgument } from '../../hints';\nimport { BuildProps } from '../XcodeBuild.types';\nimport * as AppleDevice from '../appleDevice/AppleDevice';\n\ntype AnyDevice = {\n name: string;\n osType: OSType;\n osVersion: string;\n udid: string;\n deviceType?: string;\n};\n// type AnyDevice = SimControl.Device | AppleDevice.ConnectedDevice;\n\n/** Get a list of devices (called destinations) that are connected to the host machine. Filter by `osType` if defined. */\nasync function getDevicesAsync({\n osType,\n ...buildProps\n}: { osType?: OSType } & Pick<BuildProps, 'xcodeProject' | 'scheme' | 'configuration'>): Promise<\n AnyDevice[]\n> {\n const devices = await sortDefaultDeviceToBeginningAsync(\n uniqBy(\n (\n await Promise.all([\n AppleDevice.getConnectedDevicesAsync(),\n await profile(SimControl.getDevicesAsync)(),\n resolveDestinationsAsync(buildProps),\n ])\n ).flat(),\n (item) => item.udid\n ),\n osType\n );\n\n // Sort devices to top of front of the list\n\n const physical: AnyDevice[] = [];\n\n const simulators = devices.filter((device) => {\n if ('isAvailable' in device) {\n return true;\n } else {\n physical.push(device);\n return false;\n }\n });\n\n const isPhone = (a: any) => a.osType === 'iOS';\n const sorted = [\n ...physical.sort((a, b) => {\n const aPhone = isPhone(a);\n const bPhone = isPhone(b);\n if (aPhone && !bPhone) return -1;\n if (!aPhone && bPhone) return 1;\n\n return 0;\n }),\n ...simulators,\n ];\n\n // If osType is defined, then filter out ineligible simulators.\n // Only do this inside of the device selection so users who pass the entire device udid can attempt to select any simulator (even if it's invalid).\n return osType ? filterDevicesForOsType(sorted, osType) : sorted;\n}\n\n/** @returns a list of devices, filtered by the provided `osType`. */\nfunction filterDevicesForOsType<TDevice extends { osType: OSType }>(\n devices: TDevice[],\n osType: OSType\n): TDevice[] {\n return devices.filter((device) => {\n if (osType === 'iOS') {\n // Compatible devices for iOS builds\n return ['iOS', 'macOS', 'xrOS'].includes(device.osType);\n }\n return device.osType === osType;\n });\n}\n\n/** Given a `device` argument from the CLI, parse and prompt our way to a usable device for building. */\nexport async function resolveDeviceAsync(\n device: string | boolean | undefined,\n buildProps: { osType?: OSType } & Pick<BuildProps, 'xcodeProject' | 'scheme' | 'configuration'>\n): Promise<AnyDevice> {\n await AppleDeviceManager.assertSystemRequirementsAsync();\n\n if (!device) {\n /** Finds the first possible device and returns in a booted state. */\n const manager = await AppleDeviceManager.resolveAsync({\n device: {\n osType: buildProps.osType,\n },\n });\n Log.debug(\n `Resolved default device (name: ${manager.device.name}, udid: ${manager.device.udid}, osType: ${buildProps.osType})`\n );\n return manager.device;\n }\n\n const devices = await getDevicesAsync(buildProps);\n\n const resolved =\n device === true\n ? // `--device` (no props after)\n // @ts-expect-error\n await promptDeviceAsync(devices)\n : // `--device <name|udid>`\n findDeviceFromSearchValue(devices, device.toLowerCase());\n\n return ensureBootedAsync(resolved);\n}\n\n/** @returns `true` if the given device is a simulator. */\nexport function isSimulatorDevice(device: AnyDevice): boolean {\n return (\n !('deviceType' in device) ||\n !!device.deviceType?.startsWith?.('com.apple.CoreSimulator.SimDeviceType.')\n );\n}\n\n/** @returns device matching the `searchValue` against name or UDID. */\nfunction findDeviceFromSearchValue(devices: AnyDevice[], searchValue: string): AnyDevice {\n const device = devices.find(\n (device) =>\n device.udid.toLowerCase() === searchValue || device.name.toLowerCase() === searchValue\n );\n if (!device) {\n throw new CommandError('BAD_ARGS', `No device UDID or name matching \"${searchValue}\"`);\n }\n return device;\n}\n\n/** Ensures the device is booted if it's a simulator. */\nasync function ensureBootedAsync(device: AnyDevice): Promise<AnyDevice> {\n // --device with no props after\n logDeviceArgument(device.udid);\n if (isSimulatorDevice(device)) {\n return ensureSimulatorOpenAsync({ udid: device.udid });\n }\n return device;\n}\n"],"names":["resolveDeviceAsync","isSimulatorDevice","getDevicesAsync","osType","buildProps","devices","sortDefaultDeviceToBeginningAsync","uniqBy","Promise","all","AppleDevice","getConnectedDevicesAsync","profile","SimControl","resolveDestinationsAsync","flat","item","udid","physical","simulators","filter","device","push","isPhone","a","sorted","sort","b","aPhone","bPhone","filterDevicesForOsType","includes","AppleDeviceManager","assertSystemRequirementsAsync","manager","resolveAsync","Log","debug","name","resolved","promptDeviceAsync","findDeviceFromSearchValue","toLowerCase","ensureBootedAsync","deviceType","startsWith","searchValue","find","CommandError","logDeviceArgument","ensureSimulatorOpenAsync"],"mappings":"AAAA;;;;;;;;;;;IA6FsBA,kBAAkB,MAAlBA,kBAAkB;IAiCxBC,iBAAiB,MAAjBA,iBAAiB;;mCA9HQ,qBAAqB;8BAC5B,gBAAgB;2DAC7B,cAAc;oCAI5B,iDAAiD;mCACN,gDAAgD;8DAEtE,qCAAqC;uBAC1C,sBAAsB;wBAChB,uBAAuB;yBAC5B,wBAAwB;uBACd,aAAa;mEAElB,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASzD,oEAAoE;AAEpE,uHAAuH,GACvH,eAAeC,eAAe,CAAC,EAC7BC,MAAM,CAAA,EACN,GAAGC,UAAU,EACuE,EAEpF;IACA,MAAMC,OAAO,GAAG,MAAMC,IAAAA,kBAAiC,kCAAA,EACrDC,IAAAA,MAAM,OAAA,EACJ,CACE,MAAMC,OAAO,CAACC,GAAG,CAAC;QAChBC,YAAW,CAACC,wBAAwB,EAAE;QACtC,MAAMC,IAAAA,QAAO,QAAA,EAACC,OAAU,CAACX,eAAe,CAAC,EAAE;QAC3CY,IAAAA,kBAAwB,yBAAA,EAACV,UAAU,CAAC;KACrC,CAAC,CACH,CAACW,IAAI,EAAE,EACR,CAACC,IAAI,GAAKA,IAAI,CAACC,IAAI,CACpB,EACDd,MAAM,CACP,AAAC;IAEF,2CAA2C;IAE3C,MAAMe,QAAQ,GAAgB,EAAE,AAAC;IAEjC,MAAMC,UAAU,GAAGd,OAAO,CAACe,MAAM,CAAC,CAACC,MAAM,GAAK;QAC5C,IAAI,aAAa,IAAIA,MAAM,EAAE;YAC3B,OAAO,IAAI,CAAC;Q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C1B,MAAM,GACLA,MAAM,CAACJ,IAAI,CAACyB,WAAW,EAAE,KAAKI,WAAW,IAAIzB,MAAM,CAACiB,IAAI,CAACI,WAAW,EAAE,KAAKI,WAAW,CACzF,AAAC;IACF,IAAI,CAACzB,MAAM,EAAE;QACX,MAAM,IAAI2B,OAAY,aAAA,CAAC,UAAU,EAAE,CAAC,iCAAiC,EAAEF,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACzF,CAAC;IACD,OAAOzB,MAAM,CAAC;AAChB,CAAC;AAED,sDAAsD,GACtD,eAAesB,iBAAiB,CAACtB,MAAiB,EAAsB;IACtE,+BAA+B;IAC/B4B,IAAAA,MAAiB,kBAAA,EAAC5B,MAAM,CAACJ,IAAI,CAAC,CAAC;IAC/B,IAAIhB,iBAAiB,CAACoB,MAAM,CAAC,EAAE;QAC7B,OAAO6B,IAAAA,mBAAwB,yBAAA,EAAC;YAAEjC,IAAI,EAAEI,MAAM,CAACJ,IAAI;SAAE,CAAC,CAAC;IACzD,CAAC;IACD,OAAOI,MAAM,CAAC;AAChB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/run/ios/options/resolveNativeScheme.ts"],"sourcesContent":["import { IOSConfig } from '@expo/config-plugins';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport * as Log from '../../../log';\nimport { CommandError } from '../../../utils/errors';\nimport { profile } from '../../../utils/profile';\nimport { selectAsync } from '../../../utils/prompts';\nimport { Options, ProjectInfo, XcodeConfiguration } from '../XcodeBuild.types';\n\nconst debug = require('debug')('expo:run:ios:options:resolveNativeScheme') as typeof console.log;\n\ntype NativeSchemeProps = {\n name: string;\n osType?: string;\n};\n\nexport async function resolveNativeSchemePropsAsync(\n projectRoot: string,\n options: Pick<Options, 'scheme' | 'configuration'>,\n xcodeProject: ProjectInfo\n): Promise<NativeSchemeProps> {\n return (\n (await promptOrQueryNativeSchemeAsync(projectRoot, options)) ??\n getDefaultNativeScheme(projectRoot, options, xcodeProject)\n );\n}\n\n/** Resolve the native iOS build `scheme` for a given `configuration`. If the `scheme` isn't provided then the user will be prompted to select one. */\nexport async function promptOrQueryNativeSchemeAsync(\n projectRoot: string,\n { scheme, configuration }: { scheme?: string | boolean; configuration?: XcodeConfiguration }\n): Promise<NativeSchemeProps | null> {\n const schemes = IOSConfig.BuildScheme.getRunnableSchemesFromXcodeproj(projectRoot, {\n configuration,\n });\n if (!schemes.length) {\n throw new CommandError('IOS_MALFORMED', 'No native iOS build schemes found');\n }\n\n if (scheme === true) {\n if (schemes.length === 1) {\n Log.log(`Auto selecting only available scheme: ${schemes[0].name}`);\n return schemes[0];\n }\n const resolvedSchemeName = await selectAsync(\n 'Select a scheme',\n schemes.map((value) => {\n const isApp =\n value.type === IOSConfig.Target.TargetType.APPLICATION && value.osType === 'iOS';\n return {\n value: value.name,\n title: isApp ? chalk.bold(value.name) + chalk.gray(' (app)') : value.name,\n };\n }),\n {\n nonInteractiveHelp: `--scheme: argument must be provided with a string in non-interactive mode. Valid choices are: ${schemes.join(\n ', '\n )}`,\n }\n );\n return schemes.find(({ name }) => resolvedSchemeName === name) ?? null;\n }\n // Attempt to match the schemes up so we can open the correct simulator\n return scheme ? schemes.find(({ name }) => name === scheme) || { name: scheme } : null;\n}\n\nexport function getDefaultNativeScheme(\n projectRoot: string,\n options: Pick<Options, 'configuration'>,\n xcodeProject: Pick<ProjectInfo, 'name'>\n): NativeSchemeProps {\n // If the resolution failed then we should just use the first runnable scheme that\n // matches the provided configuration.\n const resolvedSchemes = profile(IOSConfig.BuildScheme.getRunnableSchemesFromXcodeproj)(\n projectRoot,\n {\n configuration: options.configuration,\n }\n );\n\n // If there are multiple schemes, then the default should be the application.\n if (resolvedSchemes.length > 1) {\n const scheme =\n resolvedSchemes.find(({ type }) => type === IOSConfig.Target.TargetType.APPLICATION) ??\n resolvedSchemes[0];\n debug(`Using default scheme: ${scheme.name}`);\n return scheme;\n }\n\n // If we couldn't find the scheme, then we'll guess at it,\n // this is needed for cases where the native code hasn't been generated yet.\n if (resolvedSchemes[0]) {\n return resolvedSchemes[0];\n }\n return {\n name: path.basename(xcodeProject.name, path.extname(xcodeProject.name)),\n };\n}\n"],"names":["resolveNativeSchemePropsAsync","promptOrQueryNativeSchemeAsync","getDefaultNativeScheme","debug","require","projectRoot","options","xcodeProject","scheme","configuration","schemes","IOSConfig","BuildScheme","getRunnableSchemesFromXcodeproj","length","CommandError","Log","log","name","resolvedSchemeName","selectAsync","map","value","isApp","type","Target","TargetType","APPLICATION","osType","title","chalk","bold","gray","nonInteractiveHelp","join","find","resolvedSchemes","profile","path","basename","extname"],"mappings":"AAAA;;;;;;;;;;;IAiBsBA,6BAA6B,MAA7BA,6BAA6B;IAY7BC,8BAA8B,MAA9BA,8BAA8B;IAsCpCC,sBAAsB,MAAtBA,sBAAsB;;;yBAnEZ,sBAAsB;;;;;;;8DAC9B,OAAO;;;;;;;8DACR,MAAM;;;;;;2DAEF,cAAc;wBACN,uBAAuB;yBAC5B,wBAAwB;yBACpB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGpD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,0CAA0C,CAAC,AAAsB,AAAC;AAO1F,eAAeJ,6BAA6B,CACjDK,WAAmB,EACnBC,OAAkD,EAClDC,YAAyB,EACG;QAE1B,GAA4D;IAD9D,OACE,CAAA,GAA4D,GAA3D,MAAMN,8BAA8B,CAACI,WAAW,EAAEC,OAAO,CAAC,YAA3D,GAA4D,GAC5DJ,sBAAsB,CAACG,WAAW,EAAEC,OAAO,EAAEC,YAAY,CAAC,CAC1D;AACJ,CAAC;AAGM,eAAeN,8BAA8B,CAClDI,WAAmB,EACnB,EAAEG,MAAM,CAAA,EAAEC,aAAa,CAAA,EAAqE,EACzD;IACnC,MAAMC,OAAO,GAAGC,cAAS,EAAA,UAAA,CAACC,WAAW,CAACC,+BAA+B,CAACR,WAAW,EAAE;QACjFI,aAAa;KACd,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
1
+ {"version":3,"sources":["../../../../../src/run/ios/options/resolveNativeScheme.ts"],"sourcesContent":["import { IOSConfig } from '@expo/config-plugins';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport * as Log from '../../../log';\nimport { CommandError } from '../../../utils/errors';\nimport { profile } from '../../../utils/profile';\nimport { selectAsync } from '../../../utils/prompts';\nimport { Options, ProjectInfo, XcodeConfiguration } from '../XcodeBuild.types';\n\nconst debug = require('debug')('expo:run:ios:options:resolveNativeScheme') as typeof console.log;\n\ntype NativeSchemeProps = {\n name: string;\n osType?: string;\n};\n\nexport async function resolveNativeSchemePropsAsync(\n projectRoot: string,\n options: Pick<Options, 'scheme' | 'configuration'>,\n xcodeProject: ProjectInfo\n): Promise<NativeSchemeProps> {\n return (\n (await promptOrQueryNativeSchemeAsync(projectRoot, options)) ??\n getDefaultNativeScheme(projectRoot, options, xcodeProject)\n );\n}\n\n/** Resolve the native iOS build `scheme` for a given `configuration`. If the `scheme` isn't provided then the user will be prompted to select one. */\nexport async function promptOrQueryNativeSchemeAsync(\n projectRoot: string,\n { scheme, configuration }: { scheme?: string | boolean; configuration?: XcodeConfiguration }\n): Promise<NativeSchemeProps | null> {\n const schemes = IOSConfig.BuildScheme.getRunnableSchemesFromXcodeproj(projectRoot, {\n configuration,\n });\n\n if (!schemes.length) {\n throw new CommandError('IOS_MALFORMED', 'No native iOS build schemes found');\n }\n\n if (scheme === true) {\n if (schemes.length === 1) {\n Log.log(`Auto selecting only available scheme: ${schemes[0].name}`);\n return schemes[0];\n }\n const resolvedSchemeName = await selectAsync(\n 'Select a scheme',\n schemes.map((value) => {\n const isApp =\n value.type === IOSConfig.Target.TargetType.APPLICATION && value.osType === 'iOS';\n return {\n value: value.name,\n title: isApp ? chalk.bold(value.name) + chalk.gray(' (app)') : value.name,\n };\n }),\n {\n nonInteractiveHelp: `--scheme: argument must be provided with a string in non-interactive mode. Valid choices are: ${schemes.join(\n ', '\n )}`,\n }\n );\n return schemes.find(({ name }) => resolvedSchemeName === name) ?? null;\n }\n // Attempt to match the schemes up so we can open the correct simulator\n return scheme ? schemes.find(({ name }) => name === scheme) || { name: scheme } : null;\n}\n\nexport function getDefaultNativeScheme(\n projectRoot: string,\n options: Pick<Options, 'configuration'>,\n xcodeProject: Pick<ProjectInfo, 'name'>\n): NativeSchemeProps {\n // If the resolution failed then we should just use the first runnable scheme that\n // matches the provided configuration.\n const resolvedSchemes = profile(IOSConfig.BuildScheme.getRunnableSchemesFromXcodeproj)(\n projectRoot,\n {\n configuration: options.configuration,\n }\n );\n\n // If there are multiple schemes, then the default should be the application.\n if (resolvedSchemes.length > 1) {\n const scheme =\n resolvedSchemes.find(({ type }) => type === IOSConfig.Target.TargetType.APPLICATION) ??\n resolvedSchemes[0];\n debug(`Using default scheme: ${scheme.name}`);\n return scheme;\n }\n\n // If we couldn't find the scheme, then we'll guess at it,\n // this is needed for cases where the native code hasn't been generated yet.\n if (resolvedSchemes[0]) {\n return resolvedSchemes[0];\n }\n return {\n name: path.basename(xcodeProject.name, path.extname(xcodeProject.name)),\n };\n}\n"],"names":["resolveNativeSchemePropsAsync","promptOrQueryNativeSchemeAsync","getDefaultNativeScheme","debug","require","projectRoot","options","xcodeProject","scheme","configuration","schemes","IOSConfig","BuildScheme","getRunnableSchemesFromXcodeproj","length","CommandError","Log","log","name","resolvedSchemeName","selectAsync","map","value","isApp","type","Target","TargetType","APPLICATION","osType","title","chalk","bold","gray","nonInteractiveHelp","join","find","resolvedSchemes","profile","path","basename","extname"],"mappings":"AAAA;;;;;;;;;;;IAiBsBA,6BAA6B,MAA7BA,6BAA6B;IAY7BC,8BAA8B,MAA9BA,8BAA8B;IAuCpCC,sBAAsB,MAAtBA,sBAAsB;;;yBApEZ,sBAAsB;;;;;;;8DAC9B,OAAO;;;;;;;8DACR,MAAM;;;;;;2DAEF,cAAc;wBACN,uBAAuB;yBAC5B,wBAAwB;yBACpB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAA,UAAA,CAACc,MAAM,CAACC,UAAU,CAACC,WAAW,CAAC,YAApFS,GAAoF,GACpFA,eAAe,CAAC,CAAC,CAAC,AAAC;QACrBjC,KAAK,CAAC,CAAC,sBAAsB,EAAEK,MAAM,CAACU,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9C,OAAOV,MAAM,CAAC;IAChB,CAAC;IAED,0DAA0D;IAC1D,4EAA4E;IAC5E,IAAI4B,eAAe,CAAC,CAAC,CAAC,EAAE;QACtB,OAAOA,eAAe,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO;QACLlB,IAAI,EAAEoB,KAAI,EAAA,QAAA,CAACC,QAAQ,CAAChC,YAAY,CAACW,IAAI,EAAEoB,KAAI,EAAA,QAAA,CAACE,OAAO,CAACjC,YAAY,CAACW,IAAI,CAAC,CAAC;KACxE,CAAC;AACJ,CAAC"}
@@ -17,15 +17,18 @@ async function resolveOptionsAsync(projectRoot, options) {
17
17
  // Resolve the scheme before the device so we can filter devices based on
18
18
  // whichever scheme is selected (i.e. don't present TV devices if the scheme cannot be run on a TV).
19
19
  const { osType , name: scheme } = await (0, _resolveNativeScheme.resolveNativeSchemePropsAsync)(projectRoot, options, xcodeProject);
20
+ // Use the configuration or `Debug` if none is provided.
21
+ const configuration = options.configuration || "Debug";
20
22
  // Resolve the device based on the provided device id or prompt
21
23
  // from a list of devices (connected or simulated) that are filtered by the scheme.
22
24
  const device = await (0, _resolveDevice.resolveDeviceAsync)(options.device, {
23
25
  // It's unclear if there's any value to asserting that we haven't hardcoded the os type in the CLI.
24
- osType: (0, _simctl.isOSType)(osType) ? osType : undefined
26
+ osType: (0, _simctl.isOSType)(osType) ? osType : undefined,
27
+ xcodeProject,
28
+ scheme,
29
+ configuration
25
30
  });
26
31
  const isSimulator = (0, _resolveDevice.isSimulatorDevice)(device);
27
- // Use the configuration or `Debug` if none is provided.
28
- const configuration = options.configuration || "Debug";
29
32
  // This optimization skips resetting the Metro cache needlessly.
30
33
  // The cache is reset in `../node_modules/react-native/scripts/react-native-xcode.sh` when the
31
34
  // project is running in Debug and built onto a physical device. It seems that this is done because
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/run/ios/options/resolveOptions.ts"],"sourcesContent":["import { isSimulatorDevice, resolveDeviceAsync } from './resolveDevice';\nimport { resolveNativeSchemePropsAsync } from './resolveNativeScheme';\nimport { resolveXcodeProject } from './resolveXcodeProject';\nimport { isOSType } from '../../../start/platforms/ios/simctl';\nimport { resolveBundlerPropsAsync } from '../../resolveBundlerProps';\nimport { BuildProps, Options } from '../XcodeBuild.types';\n\n/** Resolve arguments for the `run:ios` command. */\nexport async function resolveOptionsAsync(\n projectRoot: string,\n options: Options\n): Promise<BuildProps> {\n const xcodeProject = resolveXcodeProject(projectRoot);\n\n const bundlerProps = await resolveBundlerPropsAsync(projectRoot, options);\n\n // Resolve the scheme before the device so we can filter devices based on\n // whichever scheme is selected (i.e. don't present TV devices if the scheme cannot be run on a TV).\n const { osType, name: scheme } = await resolveNativeSchemePropsAsync(\n projectRoot,\n options,\n xcodeProject\n );\n\n // Resolve the device based on the provided device id or prompt\n // from a list of devices (connected or simulated) that are filtered by the scheme.\n const device = await resolveDeviceAsync(options.device, {\n // It's unclear if there's any value to asserting that we haven't hardcoded the os type in the CLI.\n osType: isOSType(osType) ? osType : undefined,\n });\n\n const isSimulator = isSimulatorDevice(device);\n\n // Use the configuration or `Debug` if none is provided.\n const configuration = options.configuration || 'Debug';\n\n // This optimization skips resetting the Metro cache needlessly.\n // The cache is reset in `../node_modules/react-native/scripts/react-native-xcode.sh` when the\n // project is running in Debug and built onto a physical device. It seems that this is done because\n // the script is run from Xcode and unaware of the CLI instance.\n const shouldSkipInitialBundling = configuration === 'Debug' && !isSimulator;\n\n return {\n ...bundlerProps,\n projectRoot,\n isSimulator,\n xcodeProject,\n device,\n configuration,\n shouldSkipInitialBundling,\n buildCache: options.buildCache !== false,\n scheme,\n };\n}\n"],"names":["resolveOptionsAsync","projectRoot","options","xcodeProject","resolveXcodeProject","bundlerProps","resolveBundlerPropsAsync","osType","name","scheme","resolveNativeSchemePropsAsync","device","resolveDeviceAsync","isOSType","undefined","isSimulator","isSimulatorDevice","configuration","shouldSkipInitialBundling","buildCache"],"mappings":"AAAA;;;;+BAQsBA,qBAAmB;;aAAnBA,mBAAmB;;+BARa,iBAAiB;qCACzB,uBAAuB;qCACjC,uBAAuB;wBAClC,qCAAqC;qCACrB,2BAA2B;AAI7D,eAAeA,mBAAmB,CACvCC,WAAmB,EACnBC,OAAgB,EACK;IACrB,MAAMC,YAAY,GAAGC,IAAAA,oBAAmB,oBAAA,EAACH,WAAW,CAAC,AAAC;IAEtD,MAAMI,YAAY,GAAG,MAAMC,IAAAA,oBAAwB,yBAAA,EAACL,WAAW,EAAEC,OAAO,CAAC,AAAC;IAE1E,yEAAyE;IACzE,oGAAoG;IACpG,MAAM,EAAEK,MAAM,CAAA,EAAEC,IAAI,EAAEC,MAAM,CAAA,EAAE,GAAG,MAAMC,IAAAA,oBAA6B,8BAAA,EAClET,WAAW,EACXC,OAAO,EACPC,YAAY,CACb,AAAC;IAEF,+DAA+D;IAC/D,mFAAmF;IACnF,MAAMQ,MAAM,GAAG,MAAMC,IAAAA,cAAkB,mBAAA,EAACV,OAAO,CAACS,MAAM,EAAE;QACtD,mGAAmG;QACnGJ,MAAM,EAAEM,IAAAA,OAAQ,SAAA,EAACN,MAAM,CAAC,GAAGA,MAAM,GAAGO,SAAS;KAC9C,CAAC,AAAC;IAEH,MAAMC,WAAW,GAAGC,IAAAA,cAAiB,kBAAA,EAACL,MAAM,CAAC,AAAC;IAE9C,wDAAwD;IACxD,MAAMM,aAAa,GAAGf,OAAO,CAACe,aAAa,IAAI,OAAO,AAAC;IAEvD,gEAAgE;IAChE,8FAA8F;IAC9F,mGAAmG;IACnG,gEAAgE;IAChE,MAAMC,yBAAyB,GAAGD,aAAa,KAAK,OAAO,IAAI,CAACF,WAAW,AAAC;IAE5E,OAAO;QACL,GAAGV,YAAY;QACfJ,WAAW;QACXc,WAAW;QACXZ,YAAY;QACZQ,MAAM;QACNM,aAAa;QACbC,yBAAyB;QACzBC,UAAU,EAAEjB,OAAO,CAACiB,UAAU,KAAK,KAAK;QACxCV,MAAM;KACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"sources":["../../../../../src/run/ios/options/resolveOptions.ts"],"sourcesContent":["import { isSimulatorDevice, resolveDeviceAsync } from './resolveDevice';\nimport { resolveNativeSchemePropsAsync } from './resolveNativeScheme';\nimport { resolveXcodeProject } from './resolveXcodeProject';\nimport { isOSType } from '../../../start/platforms/ios/simctl';\nimport { resolveBundlerPropsAsync } from '../../resolveBundlerProps';\nimport { BuildProps, Options } from '../XcodeBuild.types';\n\n/** Resolve arguments for the `run:ios` command. */\nexport async function resolveOptionsAsync(\n projectRoot: string,\n options: Options\n): Promise<BuildProps> {\n const xcodeProject = resolveXcodeProject(projectRoot);\n\n const bundlerProps = await resolveBundlerPropsAsync(projectRoot, options);\n\n // Resolve the scheme before the device so we can filter devices based on\n // whichever scheme is selected (i.e. don't present TV devices if the scheme cannot be run on a TV).\n const { osType, name: scheme } = await resolveNativeSchemePropsAsync(\n projectRoot,\n options,\n xcodeProject\n );\n\n // Use the configuration or `Debug` if none is provided.\n const configuration = options.configuration || 'Debug';\n\n // Resolve the device based on the provided device id or prompt\n // from a list of devices (connected or simulated) that are filtered by the scheme.\n const device = await resolveDeviceAsync(options.device, {\n // It's unclear if there's any value to asserting that we haven't hardcoded the os type in the CLI.\n osType: isOSType(osType) ? osType : undefined,\n xcodeProject,\n scheme,\n configuration,\n });\n\n const isSimulator = isSimulatorDevice(device);\n\n // This optimization skips resetting the Metro cache needlessly.\n // The cache is reset in `../node_modules/react-native/scripts/react-native-xcode.sh` when the\n // project is running in Debug and built onto a physical device. It seems that this is done because\n // the script is run from Xcode and unaware of the CLI instance.\n const shouldSkipInitialBundling = configuration === 'Debug' && !isSimulator;\n\n return {\n ...bundlerProps,\n projectRoot,\n isSimulator,\n xcodeProject,\n device,\n configuration,\n shouldSkipInitialBundling,\n buildCache: options.buildCache !== false,\n scheme,\n };\n}\n"],"names":["resolveOptionsAsync","projectRoot","options","xcodeProject","resolveXcodeProject","bundlerProps","resolveBundlerPropsAsync","osType","name","scheme","resolveNativeSchemePropsAsync","configuration","device","resolveDeviceAsync","isOSType","undefined","isSimulator","isSimulatorDevice","shouldSkipInitialBundling","buildCache"],"mappings":"AAAA;;;;+BAQsBA,qBAAmB;;aAAnBA,mBAAmB;;+BARa,iBAAiB;qCACzB,uBAAuB;qCACjC,uBAAuB;wBAClC,qCAAqC;qCACrB,2BAA2B;AAI7D,eAAeA,mBAAmB,CACvCC,WAAmB,EACnBC,OAAgB,EACK;IACrB,MAAMC,YAAY,GAAGC,IAAAA,oBAAmB,oBAAA,EAACH,WAAW,CAAC,AAAC;IAEtD,MAAMI,YAAY,GAAG,MAAMC,IAAAA,oBAAwB,yBAAA,EAACL,WAAW,EAAEC,OAAO,CAAC,AAAC;IAE1E,yEAAyE;IACzE,oGAAoG;IACpG,MAAM,EAAEK,MAAM,CAAA,EAAEC,IAAI,EAAEC,MAAM,CAAA,EAAE,GAAG,MAAMC,IAAAA,oBAA6B,8BAAA,EAClET,WAAW,EACXC,OAAO,EACPC,YAAY,CACb,AAAC;IAEF,wDAAwD;IACxD,MAAMQ,aAAa,GAAGT,OAAO,CAACS,aAAa,IAAI,OAAO,AAAC;IAEvD,+DAA+D;IAC/D,mFAAmF;IACnF,MAAMC,MAAM,GAAG,MAAMC,IAAAA,cAAkB,mBAAA,EAACX,OAAO,CAACU,MAAM,EAAE;QACtD,mGAAmG;QACnGL,MAAM,EAAEO,IAAAA,OAAQ,SAAA,EAACP,MAAM,CAAC,GAAGA,MAAM,GAAGQ,SAAS;QAC7CZ,YAAY;QACZM,MAAM;QACNE,aAAa;KACd,CAAC,AAAC;IAEH,MAAMK,WAAW,GAAGC,IAAAA,cAAiB,kBAAA,EAACL,MAAM,CAAC,AAAC;IAE9C,gEAAgE;IAChE,8FAA8F;IAC9F,mGAAmG;IACnG,gEAAgE;IAChE,MAAMM,yBAAyB,GAAGP,aAAa,KAAK,OAAO,IAAI,CAACK,WAAW,AAAC;IAE5E,OAAO;QACL,GAAGX,YAAY;QACfJ,WAAW;QACXe,WAAW;QACXb,YAAY;QACZS,MAAM;QACND,aAAa;QACbO,yBAAyB;QACzBC,UAAU,EAAEjB,OAAO,CAACiB,UAAU,KAAK,KAAK;QACxCV,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/doctor/dependencies/ensureDependenciesAsync.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport chalk from 'chalk';\nimport wrapAnsi from 'wrap-ansi';\n\nimport { getMissingPackagesAsync, ResolvedPackage } from './getMissingPackages';\nimport { installAsync } from '../../../install/installAsync';\nimport * as Log from '../../../log';\nimport { CommandError } from '../../../utils/errors';\nimport { isInteractive } from '../../../utils/interactive';\nimport { logNewSection } from '../../../utils/ora';\nimport { confirmAsync } from '../../../utils/prompts';\n\nexport async function ensureDependenciesAsync(\n projectRoot: string,\n {\n exp = getConfig(projectRoot).exp,\n requiredPackages,\n warningMessage,\n installMessage,\n // Don't prompt in CI\n skipPrompt = !isInteractive(),\n isProjectMutable = isInteractive(),\n }: {\n exp?: ExpoConfig;\n installMessage: string;\n warningMessage: string;\n requiredPackages: ResolvedPackage[];\n skipPrompt?: boolean;\n /** Project can be mutated in the current environment. */\n isProjectMutable?: boolean;\n }\n): Promise<boolean> {\n const { missing } = await getMissingPackagesAsync(projectRoot, {\n sdkVersion: exp.sdkVersion,\n requiredPackages,\n });\n if (!missing.length) {\n return true;\n }\n\n // Prompt to install or bail out...\n const readableMissingPackages = missing\n .map(({ pkg, version }) => (version ? [pkg, version].join('@') : pkg))\n .join(', ');\n\n let title = installMessage;\n\n if (skipPrompt && !isProjectMutable) {\n title += '\\n\\n';\n } else {\n let confirm = skipPrompt;\n if (skipPrompt) {\n // Automatically install packages without prompting.\n Log.log(wrapForTerminal(title + ` Installing ${chalk.cyan(readableMissingPackages)}`));\n } else {\n confirm = await confirmAsync({\n message: wrapForTerminal(\n title + ` Would you like to install ${chalk.cyan(readableMissingPackages)}?`\n ),\n initial: true,\n });\n }\n\n if (confirm) {\n // Format with version if available.\n const [packages, devPackages] = missing.reduce(\n ([deps, devDeps], p) => {\n const pkg = p.version ? [p.pkg, p.version].join('@') : p.pkg;\n if (p.dev) {\n return [deps, devDeps.concat(pkg)];\n }\n return [deps.concat(pkg), devDeps];\n },\n [[], []] as [string[], string[]]\n );\n\n if (packages.length) {\n await installPackagesAsync(projectRoot, {\n packages,\n });\n }\n\n if (devPackages.length) {\n await installPackagesAsync(projectRoot, {\n packages: devPackages,\n dev: true,\n });\n }\n\n // Try again but skip prompting twice, simply fail if the packages didn't install correctly.\n return await ensureDependenciesAsync(projectRoot, {\n skipPrompt: true,\n installMessage,\n warningMessage,\n requiredPackages,\n });\n }\n\n // Reset the title so it doesn't print twice in interactive mode.\n title = '';\n }\n\n const installCommand = 'npx expo install ' + missing.map(({ pkg }) => pkg).join(' ');\n\n const disableMessage = warningMessage;\n\n const solution = `Please install ${chalk.bold(\n readableMissingPackages\n )} by running:\\n\\n ${chalk.reset.bold(installCommand)}\\n\\n`;\n\n // This prevents users from starting a misconfigured JS or TS project by default.\n throw new CommandError(wrapForTerminal(title + solution + disableMessage + '\\n'));\n}\n\n/** Wrap long messages to fit smaller terminals. */\nfunction wrapForTerminal(message: string): string {\n return wrapAnsi(message, process.stdout.columns || 80);\n}\n\n/** Create the bash install command from a given set of packages and settings. */\nexport function createInstallCommand({\n packages,\n}: {\n packages: {\n file: string;\n pkg: string;\n version?: string | undefined;\n }[];\n}) {\n return 'npx expo install ' + packages.map(({ pkg }) => pkg).join(' ');\n}\n\n/** Install packages in the project. */\nasync function installPackagesAsync(\n projectRoot: string,\n { packages, dev }: { packages: string[]; dev?: boolean }\n) {\n const packagesStr = chalk.bold(packages.join(', '));\n Log.log();\n const installingPackageStep = logNewSection(`Installing ${packagesStr}`);\n try {\n await installAsync(packages, { projectRoot, dev });\n } catch (e: any) {\n installingPackageStep.fail(`Failed to install ${packagesStr} with error: ${e.message}`);\n throw e;\n }\n installingPackageStep.succeed(`Installed ${packagesStr}`);\n}\n"],"names":["ensureDependenciesAsync","createInstallCommand","projectRoot","exp","getConfig","requiredPackages","warningMessage","installMessage","skipPrompt","isInteractive","isProjectMutable","missing","getMissingPackagesAsync","sdkVersion","length","readableMissingPackages","map","pkg","version","join","title","confirm","Log","log","wrapForTerminal","chalk","cyan","confirmAsync","message","initial","packages","devPackages","reduce","deps","devDeps","p","dev","concat","installPackagesAsync","installCommand","disableMessage","solution","bold","reset","CommandError","wrapAnsi","process","stdout","columns","packagesStr","installingPackageStep","logNewSection","installAsync","e","fail","succeed"],"mappings":"AAAA;;;;;;;;;;;IAYsBA,uBAAuB,MAAvBA,uBAAuB;IA4G7BC,oBAAoB,MAApBA,oBAAoB;;;yBAxHE,cAAc;;;;;;;8DAClC,OAAO;;;;;;;8DACJ,WAAW;;;;;;oCAEyB,sBAAsB;8BAClD,+BAA+B;2DACvC,cAAc;wBACN,uBAAuB;6BACtB,4BAA4B;qBAC5B,oBAAoB;yBACrB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9C,eAAeD,uBAAuB,CAC3CE,WAAmB,EACnB,EACEC,GAAG,EAAGC,IAAAA,OAAS,EAAA,UAAA,EAACF,WAAW,CAAC,CAACC,GAAG,CAAA,EAChCE,gBAAgB,CAAA,EAChBC,cAAc,CAAA,EACdC,cAAc,CAAA,EACd,qBAAqB;AACrBC,UAAU,EAAG,CAACC,IAAAA,YAAa,cAAA,GAAE,CAAA,EAC7BC,gBAAgB,EAAGD,IAAAA,YAAa,cAAA,GAAE,CAAA,EASnC,EACiB;IAClB,MAAM,EAAEE,OAAO,CAAA,EAAE,GAAG,MAAMC,IAAAA,mBAAuB,w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,CAAC,kBAAkB,EAAEL,WAAW,CAAC,aAAa,EAAEI,CAAC,CAACzB,OAAO,CAAC,CAAC,CAAC,CAAC;QACxF,MAAMyB,CAAC,CAAC;IACV,CAAC;IACDH,qBAAqB,CAACK,OAAO,CAAC,CAAC,UAAU,EAAEN,WAAW,CAAC,CAAC,CAAC,CAAC;AAC5D,CAAC"}
1
+ {"version":3,"sources":["../../../../../src/start/doctor/dependencies/ensureDependenciesAsync.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport chalk from 'chalk';\nimport wrapAnsi from 'wrap-ansi';\n\nimport { getMissingPackagesAsync, ResolvedPackage } from './getMissingPackages';\nimport { installAsync } from '../../../install/installAsync';\nimport * as Log from '../../../log';\nimport { CommandError } from '../../../utils/errors';\nimport { isInteractive } from '../../../utils/interactive';\nimport { logNewSection } from '../../../utils/ora';\nimport { confirmAsync } from '../../../utils/prompts';\n\nexport type EnsureDependenciesOptions = {\n /** The packages and/or version ranges that should be enforced in the project */\n requiredPackages: ResolvedPackage[];\n /** The user-facing message when the required packages are missing or incorrect */\n installMessage: string;\n /** The user-facing message when users aborted the installation */\n warningMessage: string;\n /** A previously loaded Expo configuration (loads when omitted) */\n exp?: ExpoConfig;\n /** If the prompts asking users to install should be skipped (defaults to false, in CI defaults to true) */\n skipPrompt?: boolean;\n /** Project can be mutated in the current environment (defaults to true, in CI defaults to false) */\n isProjectMutable?: boolean;\n};\n\nexport async function ensureDependenciesAsync(\n projectRoot: string,\n {\n exp = getConfig(projectRoot).exp,\n requiredPackages,\n warningMessage,\n installMessage,\n // Don't prompt in CI\n skipPrompt = !isInteractive(),\n isProjectMutable = isInteractive(),\n }: EnsureDependenciesOptions\n): Promise<boolean> {\n const { missing } = await getMissingPackagesAsync(projectRoot, {\n sdkVersion: exp.sdkVersion,\n requiredPackages,\n });\n if (!missing.length) {\n return true;\n }\n\n // Prompt to install or bail out...\n const readableMissingPackages = missing\n .map(({ pkg, version }) => (version ? [pkg, version].join('@') : pkg))\n .join(', ');\n\n let title = installMessage;\n\n if (skipPrompt && !isProjectMutable) {\n title += '\\n\\n';\n } else {\n let confirm = skipPrompt;\n if (skipPrompt) {\n // Automatically install packages without prompting.\n Log.log(wrapForTerminal(title + ` Installing ${chalk.cyan(readableMissingPackages)}`));\n } else {\n confirm = await confirmAsync({\n message: wrapForTerminal(\n title + ` Would you like to install ${chalk.cyan(readableMissingPackages)}?`\n ),\n initial: true,\n });\n }\n\n if (confirm) {\n // Format with version if available.\n const [packages, devPackages] = missing.reduce(\n ([deps, devDeps], p) => {\n const pkg = p.version ? [p.pkg, p.version].join('@') : p.pkg;\n if (p.dev) {\n return [deps, devDeps.concat(pkg)];\n }\n return [deps.concat(pkg), devDeps];\n },\n [[], []] as [string[], string[]]\n );\n\n if (packages.length) {\n await installPackagesAsync(projectRoot, {\n packages,\n });\n }\n\n if (devPackages.length) {\n await installPackagesAsync(projectRoot, {\n packages: devPackages,\n dev: true,\n });\n }\n\n // Try again but skip prompting twice, simply fail if the packages didn't install correctly.\n return await ensureDependenciesAsync(projectRoot, {\n skipPrompt: true,\n installMessage,\n warningMessage,\n requiredPackages,\n });\n }\n\n // Reset the title so it doesn't print twice in interactive mode.\n title = '';\n }\n\n const installCommand = 'npx expo install ' + missing.map(({ pkg }) => pkg).join(' ');\n\n const disableMessage = warningMessage;\n\n const solution = `Please install ${chalk.bold(\n readableMissingPackages\n )} by running:\\n\\n ${chalk.reset.bold(installCommand)}\\n\\n`;\n\n // This prevents users from starting a misconfigured JS or TS project by default.\n throw new CommandError(wrapForTerminal(title + solution + disableMessage + '\\n'));\n}\n\n/** Wrap long messages to fit smaller terminals. */\nfunction wrapForTerminal(message: string): string {\n return wrapAnsi(message, process.stdout.columns || 80);\n}\n\n/** Create the bash install command from a given set of packages and settings. */\nexport function createInstallCommand({\n packages,\n}: {\n packages: {\n file: string;\n pkg: string;\n version?: string | undefined;\n }[];\n}) {\n return 'npx expo install ' + packages.map(({ pkg }) => pkg).join(' ');\n}\n\n/** Install packages in the project. */\nasync function installPackagesAsync(\n projectRoot: string,\n { packages, dev }: { packages: string[]; dev?: boolean }\n) {\n const packagesStr = chalk.bold(packages.join(', '));\n Log.log();\n const installingPackageStep = logNewSection(`Installing ${packagesStr}`);\n try {\n await installAsync(packages, { projectRoot, dev });\n } catch (e: any) {\n installingPackageStep.fail(`Failed to install ${packagesStr} with error: ${e.message}`);\n throw e;\n }\n installingPackageStep.succeed(`Installed ${packagesStr}`);\n}\n"],"names":["ensureDependenciesAsync","createInstallCommand","projectRoot","exp","getConfig","requiredPackages","warningMessage","installMessage","skipPrompt","isInteractive","isProjectMutable","missing","getMissingPackagesAsync","sdkVersion","length","readableMissingPackages","map","pkg","version","join","title","confirm","Log","log","wrapForTerminal","chalk","cyan","confirmAsync","message","initial","packages","devPackages","reduce","deps","devDeps","p","dev","concat","installPackagesAsync","installCommand","disableMessage","solution","bold","reset","CommandError","wrapAnsi","process","stdout","columns","packagesStr","installingPackageStep","logNewSection","installAsync","e","fail","succeed"],"mappings":"AAAA;;;;;;;;;;;IA2BsBA,uBAAuB,MAAvBA,uBAAuB;IAoG7BC,oBAAoB,MAApBA,oBAAoB;;;yBA/HE,cAAc;;;;;;;8DAClC,OAAO;;;;;;;8DACJ,WAAW;;;;;;oCAEyB,sBAAsB;8BAClD,+BAA+B;2DACvC,cAAc;wBACN,uBAAuB;6BACtB,4BAA4B;qBAC5B,oBAAoB;yBACrB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiB9C,eAAeD,uBAAuB,CAC3CE,WAAmB,EACnB,EACEC,GAAG,EAAGC,IAAAA,OAAS,EAAA,UAAA,EAACF,WAAW,CAAC,CAACC,GAAG,CAAA,EAChCE,gBAAgB,CAAA,EAChBC,cAAc,CAAA,EACdC,cAAc,CAAA,EACd,qBAAqB;AACrBC,UAAU,EAAG,CAACC,IAAAA,YAAa,cAAA,GAAE,CAAA,EAC7BC,gBAAgB,EAAGD,IAAA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