@expo/cli 1.0.0-canary-20250404-3c3b5fd → 1.0.0-canary-20250701-6a945c5

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 (182) hide show
  1. package/README.md +33 -24
  2. package/build/bin/cli +1 -1
  3. package/build/metro-require/require.js +6 -4
  4. package/build/src/api/user/actions.js +25 -11
  5. package/build/src/api/user/actions.js.map +1 -1
  6. package/build/src/customize/templates.js +15 -1
  7. package/build/src/customize/templates.js.map +1 -1
  8. package/build/src/export/exportApp.js +26 -14
  9. package/build/src/export/exportApp.js.map +1 -1
  10. package/build/src/export/exportAsync.js +6 -0
  11. package/build/src/export/exportAsync.js.map +1 -1
  12. package/build/src/export/exportHermes.js +2 -2
  13. package/build/src/export/exportHermes.js.map +1 -1
  14. package/build/src/export/persistMetroAssets.js.map +1 -1
  15. package/build/src/install/checkPackages.js +22 -4
  16. package/build/src/install/checkPackages.js.map +1 -1
  17. package/build/src/install/index.js +3 -1
  18. package/build/src/install/index.js.map +1 -1
  19. package/build/src/install/resolveOptions.js +7 -2
  20. package/build/src/install/resolveOptions.js.map +1 -1
  21. package/build/src/install/utils/checkPackagesCompatibility.js +1 -1
  22. package/build/src/install/utils/checkPackagesCompatibility.js.map +1 -1
  23. package/build/src/lint/ESlintPrerequisite.js +32 -48
  24. package/build/src/lint/ESlintPrerequisite.js.map +1 -1
  25. package/build/src/lint/index.js +45 -47
  26. package/build/src/lint/index.js.map +1 -1
  27. package/build/src/lint/lintAsync.js +150 -4
  28. package/build/src/lint/lintAsync.js.map +1 -1
  29. package/build/src/lint/resolveOptions.js +115 -0
  30. package/build/src/lint/resolveOptions.js.map +1 -0
  31. package/build/src/prebuild/renameTemplateAppName.js +4 -1
  32. package/build/src/prebuild/renameTemplateAppName.js.map +1 -1
  33. package/build/src/prebuild/resolveTemplate.js +4 -4
  34. package/build/src/prebuild/resolveTemplate.js.map +1 -1
  35. package/build/src/prebuild/updatePackageJson.js +19 -9
  36. package/build/src/prebuild/updatePackageJson.js.map +1 -1
  37. package/build/src/run/android/resolveOptions.js +13 -1
  38. package/build/src/run/android/resolveOptions.js.map +1 -1
  39. package/build/src/run/android/runAndroidAsync.js +39 -17
  40. package/build/src/run/android/runAndroidAsync.js.map +1 -1
  41. package/build/src/run/ios/XcodeBuild.js +3 -3
  42. package/build/src/run/ios/XcodeBuild.js.map +1 -1
  43. package/build/src/run/ios/options/resolveOptions.js +13 -1
  44. package/build/src/run/ios/options/resolveOptions.js.map +1 -1
  45. package/build/src/run/ios/runIosAsync.js +38 -7
  46. package/build/src/run/ios/runIosAsync.js.map +1 -1
  47. package/build/src/start/doctor/SecurityBinPrerequisite.js +1 -1
  48. package/build/src/start/doctor/SecurityBinPrerequisite.js.map +1 -1
  49. package/build/src/start/doctor/apple/XcodePrerequisite.js +1 -1
  50. package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
  51. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +1 -1
  52. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
  53. package/build/src/start/doctor/dependencies/resolvePackages.js +1 -1
  54. package/build/src/start/doctor/dependencies/resolvePackages.js.map +1 -1
  55. package/build/src/start/doctor/ngrok/ExternalModule.js +1 -1
  56. package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
  57. package/build/src/start/index.js +1 -1
  58. package/build/src/start/index.js.map +1 -1
  59. package/build/src/start/platforms/PlatformManager.js +1 -1
  60. package/build/src/start/platforms/PlatformManager.js.map +1 -1
  61. package/build/src/start/platforms/android/AndroidPlatformManager.js +1 -1
  62. package/build/src/start/platforms/android/AndroidPlatformManager.js.map +1 -1
  63. package/build/src/start/platforms/android/getDevices.js +1 -1
  64. package/build/src/start/platforms/android/getDevices.js.map +1 -1
  65. package/build/src/start/platforms/ios/AppleDeviceManager.js +1 -1
  66. package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -1
  67. package/build/src/start/platforms/ios/xcrun.js +1 -1
  68. package/build/src/start/platforms/ios/xcrun.js.map +1 -1
  69. package/build/src/start/project/dotExpo.js +5 -0
  70. package/build/src/start/project/dotExpo.js.map +1 -1
  71. package/build/src/start/resolveOptions.js +3 -0
  72. package/build/src/start/resolveOptions.js.map +1 -1
  73. package/build/src/start/server/metro/MetroBundlerDevServer.js +38 -26
  74. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  75. package/build/src/start/server/metro/MetroTerminalReporter.js +29 -2
  76. package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
  77. package/build/src/start/server/metro/createExpoFallbackResolver.js +6 -4
  78. package/build/src/start/server/metro/createExpoFallbackResolver.js.map +1 -1
  79. package/build/src/start/server/metro/createJResolver.js +2 -2
  80. package/build/src/start/server/metro/createJResolver.js.map +1 -1
  81. package/build/src/start/server/metro/createServerComponentsMiddleware.js +16 -5
  82. package/build/src/start/server/metro/createServerComponentsMiddleware.js.map +1 -1
  83. package/build/src/start/server/metro/debugging/createDebugMiddleware.js +19 -19
  84. package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -1
  85. package/build/src/start/server/metro/externals.js +1 -1
  86. package/build/src/start/server/metro/externals.js.map +1 -1
  87. package/build/src/start/server/metro/instantiateMetro.js +13 -8
  88. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  89. package/build/src/start/server/metro/log-box/LogBoxSymbolication.js +21 -2
  90. package/build/src/start/server/metro/log-box/LogBoxSymbolication.js.map +1 -1
  91. package/build/src/start/server/metro/log-box/formatProjectFilePath.js +15 -12
  92. package/build/src/start/server/metro/log-box/formatProjectFilePath.js.map +1 -1
  93. package/build/src/start/server/metro/metroErrorInterface.js +19 -8
  94. package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
  95. package/build/src/start/server/metro/runServer-fork.js +1 -1
  96. package/build/src/start/server/metro/runServer-fork.js.map +1 -1
  97. package/build/src/start/server/metro/withMetroMultiPlatform.js +7 -12
  98. package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
  99. package/build/src/start/server/middleware/CorsMiddleware.js +1 -1
  100. package/build/src/start/server/middleware/CorsMiddleware.js.map +1 -1
  101. package/build/src/start/server/middleware/ManifestMiddleware.js +4 -8
  102. package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
  103. package/build/src/start/server/middleware/inspector/JsInspector.js +2 -25
  104. package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -1
  105. package/build/src/start/server/middleware/metroOptions.js +2 -26
  106. package/build/src/start/server/middleware/metroOptions.js.map +1 -1
  107. package/build/src/utils/build-cache-providers/helpers.js +61 -0
  108. package/build/src/utils/build-cache-providers/helpers.js.map +1 -0
  109. package/build/src/utils/build-cache-providers/index.js +283 -0
  110. package/build/src/utils/build-cache-providers/index.js.map +1 -0
  111. package/build/src/utils/codesigning.js +14 -2
  112. package/build/src/utils/codesigning.js.map +1 -1
  113. package/build/src/utils/exit.js +0 -1
  114. package/build/src/utils/exit.js.map +1 -1
  115. package/build/src/utils/ip.js +7 -104
  116. package/build/src/utils/ip.js.map +1 -1
  117. package/build/src/utils/modifyConfigAsync.js +1 -1
  118. package/build/src/utils/modifyConfigAsync.js.map +1 -1
  119. package/build/src/utils/resolveArgs.js +8 -0
  120. package/build/src/utils/resolveArgs.js.map +1 -1
  121. package/build/src/utils/scheme.js +1 -1
  122. package/build/src/utils/scheme.js.map +1 -1
  123. package/build/src/utils/telemetry/clients/FetchClient.js +2 -2
  124. package/build/src/utils/telemetry/clients/FetchClient.js.map +1 -1
  125. package/build/src/utils/telemetry/utils/context.js +1 -1
  126. package/build/src/utils/tsconfig/evaluateTsConfig.js +7 -2
  127. package/build/src/utils/tsconfig/evaluateTsConfig.js.map +1 -1
  128. package/build/src/utils/variadic.js +63 -6
  129. package/build/src/utils/variadic.js.map +1 -1
  130. package/package.json +20 -20
  131. package/static/canary/react-is/cjs/react-is.development.js +118 -185
  132. package/static/canary/react-is/cjs/react-is.production.js +2 -2
  133. package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js +16582 -26565
  134. package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js +3495 -3357
  135. package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js +3929 -3801
  136. package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +16869 -27032
  137. package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3535 -3428
  138. package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4198 -4095
  139. package/static/canary/scheduler/cjs/scheduler-unstable_mock.development.js +387 -684
  140. package/static/canary/scheduler/cjs/scheduler-unstable_mock.production.js +0 -9
  141. package/static/canary/scheduler/cjs/scheduler-unstable_post_task.development.js +137 -195
  142. package/static/canary/scheduler/cjs/scheduler-unstable_post_task.production.js +0 -5
  143. package/static/canary/scheduler/cjs/scheduler.development.js +339 -600
  144. package/static/canary/scheduler/cjs/scheduler.native.development.js +324 -512
  145. package/static/canary/scheduler/cjs/scheduler.native.production.js +6 -5
  146. package/static/canary/scheduler/cjs/scheduler.production.js +16 -17
  147. package/static/canary-full/react/cjs/react-compiler-runtime.development.js +13 -68
  148. package/static/canary-full/react/cjs/react-jsx-dev-runtime.development.js +317 -1251
  149. package/static/canary-full/react/cjs/react-jsx-dev-runtime.react-server.development.js +353 -1286
  150. package/static/canary-full/react/cjs/react-jsx-runtime.development.js +326 -1279
  151. package/static/canary-full/react/cjs/react-jsx-runtime.react-server.development.js +353 -1286
  152. package/static/canary-full/react/cjs/react.development.js +1204 -2771
  153. package/static/canary-full/react/cjs/react.production.js +25 -20
  154. package/static/canary-full/react/cjs/react.react-server.development.js +783 -2162
  155. package/static/canary-full/react/cjs/react.react-server.production.js +13 -63
  156. package/static/canary-full/react/package.json +1 -1
  157. package/static/canary-full/react-dom/cjs/react-dom-client.development.js +24847 -37099
  158. package/static/canary-full/react-dom/cjs/react-dom-client.production.js +8261 -7475
  159. package/static/canary-full/react-dom/cjs/react-dom-profiling.development.js +25252 -37571
  160. package/static/canary-full/react-dom/cjs/react-dom-profiling.profiling.js +9442 -8662
  161. package/static/canary-full/react-dom/cjs/react-dom-server-legacy.browser.development.js +8944 -11568
  162. package/static/canary-full/react-dom/cjs/react-dom-server-legacy.browser.production.js +1378 -944
  163. package/static/canary-full/react-dom/cjs/react-dom-server-legacy.node.development.js +8944 -11568
  164. package/static/canary-full/react-dom/cjs/react-dom-server-legacy.node.production.js +1386 -954
  165. package/static/canary-full/react-dom/cjs/react-dom-server.browser.development.js +9344 -11600
  166. package/static/canary-full/react-dom/cjs/react-dom-server.browser.production.js +1545 -954
  167. package/static/canary-full/react-dom/cjs/react-dom-server.bun.development.js +8286 -11064
  168. package/static/canary-full/react-dom/cjs/react-dom-server.bun.production.js +1437 -976
  169. package/static/canary-full/react-dom/cjs/react-dom-server.edge.development.js +9356 -11609
  170. package/static/canary-full/react-dom/cjs/react-dom-server.edge.production.js +1542 -970
  171. package/static/canary-full/react-dom/cjs/react-dom-server.node.development.js +9227 -11571
  172. package/static/canary-full/react-dom/cjs/react-dom-server.node.production.js +1787 -1183
  173. package/static/canary-full/react-dom/cjs/react-dom-test-utils.development.js +13 -59
  174. package/static/canary-full/react-dom/cjs/react-dom.development.js +402 -604
  175. package/static/canary-full/react-dom/cjs/react-dom.production.js +4 -3
  176. package/static/canary-full/react-dom/cjs/react-dom.react-server.development.js +322 -382
  177. package/static/canary-full/react-dom/cjs/react-dom.react-server.production.js +6 -7
  178. package/static/canary-full/react-dom/package.json +5 -5
  179. package/static/canary-full/react-dom/static.browser.js +1 -0
  180. package/static/canary-full/react-dom/static.edge.js +1 -0
  181. package/static/canary-full/react-dom/static.node.js +1 -0
  182. package/static/template/eslint.config.js +10 -0
@@ -8,6 +8,13 @@ Object.defineProperty(exports, "runIosAsync", {
8
8
  return runIosAsync;
9
9
  }
10
10
  });
11
+ function _config() {
12
+ const data = require("@expo/config");
13
+ _config = function() {
14
+ return data;
15
+ };
16
+ return data;
17
+ }
11
18
  function _spawnasync() {
12
19
  const data = /*#__PURE__*/ _interop_require_default(require("@expo/spawn-async"));
13
20
  _spawnasync = function() {
@@ -36,9 +43,17 @@ function _path() {
36
43
  };
37
44
  return data;
38
45
  }
46
+ const _XcodeBuild = /*#__PURE__*/ _interop_require_wildcard(require("./XcodeBuild"));
47
+ const _launchApp = require("./launchApp");
48
+ const _resolveOptions = require("./options/resolveOptions");
49
+ const _validateExternalBinary = require("./validateExternalBinary");
50
+ const _exportEager = require("../../export/embed/exportEager");
39
51
  const _log = /*#__PURE__*/ _interop_require_wildcard(require("../../log"));
40
52
  const _AppleAppIdResolver = require("../../start/platforms/ios/AppleAppIdResolver");
53
+ const _simctl = require("../../start/platforms/ios/simctl");
54
+ const _buildcacheproviders = require("../../utils/build-cache-providers");
41
55
  const _cocoapods = require("../../utils/cocoapods");
56
+ const _errors = require("../../utils/errors");
42
57
  const _nodeEnv = require("../../utils/nodeEnv");
43
58
  const _port = require("../../utils/port");
44
59
  const _profile = require("../../utils/profile");
@@ -46,13 +61,6 @@ const _scheme = require("../../utils/scheme");
46
61
  const _ensureNativeProject = require("../ensureNativeProject");
47
62
  const _hints = require("../hints");
48
63
  const _startBundler = require("../startBundler");
49
- const _XcodeBuild = /*#__PURE__*/ _interop_require_wildcard(require("./XcodeBuild"));
50
- const _launchApp = require("./launchApp");
51
- const _resolveOptions = require("./options/resolveOptions");
52
- const _validateExternalBinary = require("./validateExternalBinary");
53
- const _exportEager = require("../../export/embed/exportEager");
54
- const _simctl = require("../../start/platforms/ios/simctl");
55
- const _errors = require("../../utils/errors");
56
64
  function _interop_require_default(obj) {
57
65
  return obj && obj.__esModule ? obj : {
58
66
  default: obj
@@ -114,6 +122,18 @@ async function runIosAsync(projectRoot, options) {
114
122
  }
115
123
  // Resolve the CLI arguments into useable options.
116
124
  const props = await (0, _profile.profile)(_resolveOptions.resolveOptionsAsync)(projectRoot, options);
125
+ const projectConfig = (0, _config().getConfig)(projectRoot);
126
+ if (!options.binary && props.buildCacheProvider && props.isSimulator) {
127
+ const localPath = await (0, _buildcacheproviders.resolveBuildCache)({
128
+ projectRoot,
129
+ platform: 'ios',
130
+ runOptions: options,
131
+ provider: props.buildCacheProvider
132
+ });
133
+ if (localPath) {
134
+ options.binary = localPath;
135
+ }
136
+ }
117
137
  if (options.rebundle) {
118
138
  _log.warn(`The --unstable-rebundle flag is experimental and may not work as expected.`);
119
139
  // Get the existing binary path to re-bundle the app.
@@ -157,6 +177,7 @@ async function runIosAsync(projectRoot, options) {
157
177
  }
158
178
  }
159
179
  let binaryPath;
180
+ let shouldUpdateBuildCache = false;
160
181
  if (options.binary) {
161
182
  binaryPath = await (0, _validateExternalBinary.getValidBinaryPathAsync)(options.binary, props);
162
183
  _log.log('Using custom binary path:', binaryPath);
@@ -176,6 +197,7 @@ async function runIosAsync(projectRoot, options) {
176
197
  // Find the path to the built app binary, this will be used to install the binary
177
198
  // on a device.
178
199
  binaryPath = await (0, _profile.profile)(_XcodeBuild.getAppBinaryPath)(buildOutput);
200
+ shouldUpdateBuildCache = true;
179
201
  }
180
202
  debug('Binary path:', binaryPath);
181
203
  // Ensure the port hasn't become busy during the build.
@@ -217,6 +239,15 @@ async function runIosAsync(projectRoot, options) {
217
239
  } else {
218
240
  await manager.stopAsync();
219
241
  }
242
+ if (shouldUpdateBuildCache && props.buildCacheProvider) {
243
+ await (0, _buildcacheproviders.uploadBuildCache)({
244
+ projectRoot,
245
+ platform: 'ios',
246
+ provider: props.buildCacheProvider,
247
+ buildPath: binaryPath,
248
+ runOptions: options
249
+ });
250
+ }
220
251
  }
221
252
  function assertPlatform() {
222
253
  if (process.platform !== 'darwin') {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport * as Log from '../../log';\nimport { AppleAppIdResolver } from '../../start/platforms/ios/AppleAppIdResolver';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { profile } from '../../utils/profile';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\nimport * as XcodeBuild from './XcodeBuild';\nimport { Options } from './XcodeBuild.types';\nimport { getLaunchInfoForBinaryAsync, launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\nimport { getValidBinaryPathAsync } from './validateExternalBinary';\nimport { exportEagerAsync } from '../../export/embed/exportEager';\nimport { getContainerPathAsync, simctlAsync } from '../../start/platforms/ios/simctl';\nimport { CommandError } from '../../utils/errors';\n\nconst debug = require('debug')('expo:run:ios');\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await profile(resolveOptionsAsync)(projectRoot, options);\n\n if (options.rebundle) {\n Log.warn(`The --unstable-rebundle flag is experimental and may not work as expected.`);\n // Get the existing binary path to re-bundle the app.\n\n let binaryPath: string;\n if (!options.binary) {\n if (!props.isSimulator) {\n throw new Error('Re-bundling on physical devices requires the --binary flag.');\n }\n const appId = await new AppleAppIdResolver(projectRoot).getAppIdAsync();\n const possibleBinaryPath = await getContainerPathAsync(props.device, {\n appId,\n });\n if (!possibleBinaryPath) {\n throw new CommandError(\n `Cannot rebundle because no --binary was provided and no existing binary was found on the device for ID: ${appId}.`\n );\n }\n binaryPath = possibleBinaryPath;\n Log.log('Re-using existing binary path:', binaryPath);\n // Set the binary path to the existing binary path.\n options.binary = binaryPath;\n }\n\n Log.log('Rebundling the Expo config file');\n // Re-bundle the config file the same way the app was originally bundled.\n await spawnAsync('node', [\n path.join(require.resolve('expo-constants/package.json'), '../scripts/getAppConfig.js'),\n projectRoot,\n path.join(options.binary, 'EXConstants.bundle'),\n ]);\n // Re-bundle the app.\n\n const possibleBundleOutput = path.join(options.binary, 'main.jsbundle');\n\n if (fs.existsSync(possibleBundleOutput)) {\n Log.log('Rebundling the app...');\n await exportEagerAsync(projectRoot, {\n resetCache: false,\n dev: false,\n platform: 'ios',\n assetsDest: path.join(options.binary, 'assets'),\n bundleOutput: possibleBundleOutput,\n });\n } else {\n Log.warn('Bundle output not found at expected location:', possibleBundleOutput);\n }\n }\n\n let binaryPath: string;\n if (options.binary) {\n binaryPath = await getValidBinaryPathAsync(options.binary, props);\n Log.log('Using custom binary path:', binaryPath);\n } else {\n let eagerBundleOptions: string | undefined;\n\n if (options.configuration === 'Release') {\n eagerBundleOptions = JSON.stringify(\n await exportEagerAsync(projectRoot, {\n dev: false,\n platform: 'ios',\n })\n );\n }\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync({\n ...props,\n eagerBundleOptions,\n });\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n }\n debug('Binary path:', binaryPath);\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n\n const launchInfo = await getLaunchInfoForBinaryAsync(binaryPath);\n const isCustomBinary = !!options.binary;\n\n // Always close the app before launching on a simulator. Otherwise certain cached resources like the splashscreen will not be available.\n if (props.isSimulator) {\n try {\n await simctlAsync(['terminate', props.device.udid, launchInfo.bundleId]);\n } catch (error) {\n // If we failed it's likely that the app was not running to begin with and we will get an `invalid device` error\n debug('Failed to terminate app (possibly because it was not running):', error);\n }\n }\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n\n scheme: isCustomBinary\n ? // If launching a custom binary, use the schemes in the Info.plist.\n launchInfo.schemes[0]\n : // If a scheme is specified then use that instead of the package name.\n (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(\n binaryPath,\n manager,\n {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n },\n launchInfo.bundleId\n );\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","debug","require","projectRoot","options","setNodeEnv","configuration","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","profile","resolveOptionsAsync","rebundle","Log","warn","binaryPath","binary","isSimulator","Error","appId","AppleAppIdResolver","getAppIdAsync","possibleBinaryPath","getContainerPathAsync","device","CommandError","log","spawnAsync","path","join","resolve","possibleBundleOutput","fs","existsSync","exportEagerAsync","resetCache","dev","assetsDest","bundleOutput","getValidBinaryPathAsync","eagerBundleOptions","JSON","stringify","buildOutput","XcodeBuild","buildAsync","getAppBinaryPath","shouldStartBundler","ensurePortAvailabilityAsync","launchInfo","getLaunchInfoForBinaryAsync","isCustomBinary","simctlAsync","udid","bundleId","error","manager","startBundlerAsync","port","headless","scheme","schemes","getSchemesForIosAsync","launchAppAsync","logProjectLogsLocation","stopAsync","process","exit","chalk"],"mappings":";;;;+BA0BsBA;;;eAAAA;;;;gEA1BC;;;;;;;gEACL;;;;;;;gEACH;;;;;;;gEACE;;;;;;6DAEI;oCACc;2BACQ;yBAChB;sBACiB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MAAME,aAAa,MAAMC,IAAAA,sCAA2B,EAACnC;IACrD,MAAMoC,iBAAiB,CAAC,CAACnD,QAAQgB,MAAM;IAEvC,wIAAwI;IACxI,IAAIP,MAAMQ,WAAW,EAAE;QACrB,IAAI;YACF,MAAMmC,IAAAA,mBAAW,EAAC;gBAAC;gBAAa3C,MAAMe,MAAM,CAAC6B,IAAI;gBAAEJ,WAAWK,QAAQ;aAAC;QACzE,EAAE,OAAOC,OAAO;YACd,gHAAgH;YAChH1D,MAAM,kEAAkE0D;QAC1E;IACF;IAEA,kEAAkE;IAClE,oCAAoC;IACpC,MAAMC,UAAU,MAAMC,IAAAA,+BAAiB,EAAC1D,aAAa;QACnD2D,MAAMjD,MAAMiD,IAAI;QAChBC,UAAU,CAAClD,MAAMsC,kBAAkB;QACnC,sEAAsE;QAEtEa,QAAQT,iBAEJF,WAAWY,OAAO,CAAC,EAAE,IAEpB,QAAA,MAAMC,IAAAA,6BAAqB,EAAC/D,iCAA7B,AAAC,KAA2C,CAAC,EAAE;IACrD;IAEA,iDAAiD;IACjD,MAAMgE,IAAAA,yBAAc,EAClBhD,YACAyC,SACA;QACEvC,aAAaR,MAAMQ,WAAW;QAC9BO,QAAQf,MAAMe,MAAM;QACpBuB,oBAAoBtC,MAAMsC,kBAAkB;IAC9C,GACAE,WAAWK,QAAQ;IAGrB,kDAAkD;IAClD,IAAI7C,MAAMsC,kBAAkB,EAAE;QAC5BiB,IAAAA,6BAAsB;IACxB,OAAO;QACL,MAAMR,QAAQS,SAAS;IACzB;AACF;AAEA,SAAS7D;IACP,IAAI8D,QAAQ3D,QAAQ,KAAK,UAAU;QACjCM,KAAIsD,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC,+FAA+F,CAAC;IAE1G;AACF"}
1
+ {"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport * as XcodeBuild from './XcodeBuild';\nimport { Options } from './XcodeBuild.types';\nimport { getLaunchInfoForBinaryAsync, launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\nimport { getValidBinaryPathAsync } from './validateExternalBinary';\nimport { exportEagerAsync } from '../../export/embed/exportEager';\nimport * as Log from '../../log';\nimport { AppleAppIdResolver } from '../../start/platforms/ios/AppleAppIdResolver';\nimport { getContainerPathAsync, simctlAsync } from '../../start/platforms/ios/simctl';\nimport { resolveBuildCache, uploadBuildCache } from '../../utils/build-cache-providers';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { CommandError } from '../../utils/errors';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { profile } from '../../utils/profile';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\n\nconst debug = require('debug')('expo:run:ios');\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await profile(resolveOptionsAsync)(projectRoot, options);\n\n const projectConfig = getConfig(projectRoot);\n if (!options.binary && props.buildCacheProvider && props.isSimulator) {\n const localPath = await resolveBuildCache({\n projectRoot,\n platform: 'ios',\n runOptions: options,\n provider: props.buildCacheProvider,\n });\n if (localPath) {\n options.binary = localPath;\n }\n }\n\n if (options.rebundle) {\n Log.warn(`The --unstable-rebundle flag is experimental and may not work as expected.`);\n // Get the existing binary path to re-bundle the app.\n\n let binaryPath: string;\n if (!options.binary) {\n if (!props.isSimulator) {\n throw new Error('Re-bundling on physical devices requires the --binary flag.');\n }\n const appId = await new AppleAppIdResolver(projectRoot).getAppIdAsync();\n const possibleBinaryPath = await getContainerPathAsync(props.device, {\n appId,\n });\n if (!possibleBinaryPath) {\n throw new CommandError(\n `Cannot rebundle because no --binary was provided and no existing binary was found on the device for ID: ${appId}.`\n );\n }\n binaryPath = possibleBinaryPath;\n Log.log('Re-using existing binary path:', binaryPath);\n // Set the binary path to the existing binary path.\n options.binary = binaryPath;\n }\n\n Log.log('Rebundling the Expo config file');\n // Re-bundle the config file the same way the app was originally bundled.\n await spawnAsync('node', [\n path.join(require.resolve('expo-constants/package.json'), '../scripts/getAppConfig.js'),\n projectRoot,\n path.join(options.binary, 'EXConstants.bundle'),\n ]);\n // Re-bundle the app.\n\n const possibleBundleOutput = path.join(options.binary, 'main.jsbundle');\n\n if (fs.existsSync(possibleBundleOutput)) {\n Log.log('Rebundling the app...');\n await exportEagerAsync(projectRoot, {\n resetCache: false,\n dev: false,\n platform: 'ios',\n assetsDest: path.join(options.binary, 'assets'),\n bundleOutput: possibleBundleOutput,\n });\n } else {\n Log.warn('Bundle output not found at expected location:', possibleBundleOutput);\n }\n }\n\n let binaryPath: string;\n let shouldUpdateBuildCache = false;\n if (options.binary) {\n binaryPath = await getValidBinaryPathAsync(options.binary, props);\n Log.log('Using custom binary path:', binaryPath);\n } else {\n let eagerBundleOptions: string | undefined;\n\n if (options.configuration === 'Release') {\n eagerBundleOptions = JSON.stringify(\n await exportEagerAsync(projectRoot, {\n dev: false,\n platform: 'ios',\n })\n );\n }\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync({\n ...props,\n eagerBundleOptions,\n });\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n shouldUpdateBuildCache = true;\n }\n debug('Binary path:', binaryPath);\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n\n const launchInfo = await getLaunchInfoForBinaryAsync(binaryPath);\n const isCustomBinary = !!options.binary;\n\n // Always close the app before launching on a simulator. Otherwise certain cached resources like the splashscreen will not be available.\n if (props.isSimulator) {\n try {\n await simctlAsync(['terminate', props.device.udid, launchInfo.bundleId]);\n } catch (error) {\n // If we failed it's likely that the app was not running to begin with and we will get an `invalid device` error\n debug('Failed to terminate app (possibly because it was not running):', error);\n }\n }\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n\n scheme: isCustomBinary\n ? // If launching a custom binary, use the schemes in the Info.plist.\n launchInfo.schemes[0]\n : // If a scheme is specified then use that instead of the package name.\n (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(\n binaryPath,\n manager,\n {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n },\n launchInfo.bundleId\n );\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n\n if (shouldUpdateBuildCache && props.buildCacheProvider) {\n await uploadBuildCache({\n projectRoot,\n platform: 'ios',\n provider: props.buildCacheProvider,\n buildPath: binaryPath,\n runOptions: options,\n });\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","debug","require","projectRoot","options","setNodeEnv","configuration","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","profile","resolveOptionsAsync","projectConfig","getConfig","binary","buildCacheProvider","isSimulator","localPath","resolveBuildCache","runOptions","provider","rebundle","Log","warn","binaryPath","Error","appId","AppleAppIdResolver","getAppIdAsync","possibleBinaryPath","getContainerPathAsync","device","CommandError","log","spawnAsync","path","join","resolve","possibleBundleOutput","fs","existsSync","exportEagerAsync","resetCache","dev","assetsDest","bundleOutput","shouldUpdateBuildCache","getValidBinaryPathAsync","eagerBundleOptions","JSON","stringify","buildOutput","XcodeBuild","buildAsync","getAppBinaryPath","shouldStartBundler","ensurePortAvailabilityAsync","launchInfo","getLaunchInfoForBinaryAsync","isCustomBinary","simctlAsync","udid","bundleId","error","manager","startBundlerAsync","port","headless","scheme","schemes","getSchemesForIosAsync","launchAppAsync","logProjectLogsLocation","stopAsync","uploadBuildCache","buildPath","process","exit","chalk"],"mappings":";;;;+BA4BsBA;;;eAAAA;;;;yBA5BI;;;;;;;gEACH;;;;;;;gEACL;;;;;;;gEACH;;;;;;;gEACE;;;;;;oEAEW;2BAEgC;gCACxB;wCACI;6BACP;6DACZ;oCACc;wBACgB;qCACC;2BACT;wBACd;yBACF;sBACiB;yBACpB;wBACc;qCACG;uBACF;8BACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeF,YAAYG,WAAmB,EAAEC,OAAgB;QAwI9D;IAvIPC,IAAAA,mBAAU,EAACD,QAAQE,aAAa,KAAK,YAAY,eAAe;IAChEJ,QAAQ,aAAaK,IAAI,CAACJ;IAE1BK;IAEA,MAAMC,UAAU,CAAC,CAACL,QAAQK,OAAO;IAEjC,IAAI,AAAC,MAAMC,IAAAA,6CAAwB,EAACP,aAAa;QAAEQ,UAAU;QAAOF;IAAQ,MAAOA,SAAS;QAC1F,MAAMG,IAAAA,qCAA0B,EAACT;IACnC;IAEA,kDAAkD;IAClD,MAAMU,QAAQ,MAAMC,IAAAA,gBAAO,EAACC,mCAAmB,EAAEZ,aAAaC;IAE9D,MAAMY,gBAAgBC,IAAAA,mBAAS,EAACd;IAChC,IAAI,CAACC,QAAQc,MAAM,IAAIL,MAAM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EAAkE;IAClE,oCAAoC;IACpC,MAAMC,UAAU,MAAMC,IAAAA,+BAAiB,EAAClE,aAAa;QACnDmE,MAAMzD,MAAMyD,IAAI;QAChBC,UAAU,CAAC1D,MAAM8C,kBAAkB;QACnC,sEAAsE;QAEtEa,QAAQT,iBAEJF,WAAWY,OAAO,CAAC,EAAE,IAEpB,QAAA,MAAMC,IAAAA,6BAAqB,EAACvE,iCAA7B,AAAC,KAA2C,CAAC,EAAE;IACrD;IAEA,iDAAiD;IACjD,MAAMwE,IAAAA,yBAAc,EAClB/C,YACAwC,SACA;QACEhD,aAAaP,MAAMO,WAAW;QAC9Be,QAAQtB,MAAMsB,MAAM;QACpBwB,oBAAoB9C,MAAM8C,kBAAkB;IAC9C,GACAE,WAAWK,QAAQ;IAGrB,kDAAkD;IAClD,IAAIrD,MAAM8C,kBAAkB,EAAE;QAC5BiB,IAAAA,6BAAsB;IACxB,OAAO;QACL,MAAMR,QAAQS,SAAS;IACzB;IAEA,IAAI3B,0BAA0BrC,MAAMM,kBAAkB,EAAE;QACtD,MAAM2D,IAAAA,qCAAgB,EAAC;YACrB3E;YACAQ,UAAU;YACVa,UAAUX,MAAMM,kBAAkB;YAClC4D,WAAWnD;YACXL,YAAYnB;QACd;IACF;AACF;AAEA,SAASI;IACP,IAAIwE,QAAQrE,QAAQ,KAAK,UAAU;QACjCe,KAAIuD,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC,+FAA+F,CAAC;IAE1G;AACF"}
@@ -30,7 +30,7 @@ class SecurityBinPrerequisite extends _Prerequisite.Prerequisite {
30
30
  'security'
31
31
  ]);
32
32
  } catch {
33
- throw new _Prerequisite.PrerequisiteCommandError('SECURITY_BIN', "Cannot code sign project because the CLI `security` is not available on your computer.\nPlease ensure it's installed and try again.");
33
+ throw new _Prerequisite.PrerequisiteCommandError('SECURITY_BIN', "Cannot code sign project because the CLI `security` is not available on your computer.\nEnsure it's installed and try again.");
34
34
  }
35
35
  }
36
36
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/start/doctor/SecurityBinPrerequisite.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\n\nimport { Prerequisite, PrerequisiteCommandError } from './Prerequisite';\n\nexport class SecurityBinPrerequisite extends Prerequisite {\n static instance = new SecurityBinPrerequisite();\n\n async assertImplementation(): Promise<void> {\n try {\n // make sure we can run security\n await spawnAsync('which', ['security']);\n } catch {\n throw new PrerequisiteCommandError(\n 'SECURITY_BIN',\n \"Cannot code sign project because the CLI `security` is not available on your computer.\\nPlease ensure it's installed and try again.\"\n );\n }\n }\n}\n"],"names":["SecurityBinPrerequisite","Prerequisite","instance","assertImplementation","spawnAsync","PrerequisiteCommandError"],"mappings":";;;;+BAIaA;;;eAAAA;;;;gEAJU;;;;;;8BAEgC;;;;;;AAEhD,MAAMA,gCAAgCC,0BAAY;qBAChDC,WAAW,IAAIF;IAEtB,MAAMG,uBAAsC;QAC1C,IAAI;YACF,gCAAgC;YAChC,MAAMC,IAAAA,qBAAU,EAAC,SAAS;gBAAC;aAAW;QACxC,EAAE,OAAM;YACN,MAAM,IAAIC,sCAAwB,CAChC,gBACA;QAEJ;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/start/doctor/SecurityBinPrerequisite.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\n\nimport { Prerequisite, PrerequisiteCommandError } from './Prerequisite';\n\nexport class SecurityBinPrerequisite extends Prerequisite {\n static instance = new SecurityBinPrerequisite();\n\n async assertImplementation(): Promise<void> {\n try {\n // make sure we can run security\n await spawnAsync('which', ['security']);\n } catch {\n throw new PrerequisiteCommandError(\n 'SECURITY_BIN',\n \"Cannot code sign project because the CLI `security` is not available on your computer.\\nEnsure it's installed and try again.\"\n );\n }\n }\n}\n"],"names":["SecurityBinPrerequisite","Prerequisite","instance","assertImplementation","spawnAsync","PrerequisiteCommandError"],"mappings":";;;;+BAIaA;;;eAAAA;;;;gEAJU;;;;;;8BAEgC;;;;;;AAEhD,MAAMA,gCAAgCC,0BAAY;qBAChDC,WAAW,IAAIF;IAEtB,MAAMG,uBAAsC;QAC1C,IAAI;YACF,gCAAgC;YAChC,MAAMC,IAAAA,qBAAU,EAAC,SAAS;gBAAC;aAAW;QACxC,EAAE,OAAM;YACN,MAAM,IAAIC,sCAAwB,CAChC,gBACA;QAEJ;IACF;AACF"}
@@ -225,7 +225,7 @@ class XcodePrerequisite extends _Prerequisite.Prerequisite {
225
225
  }
226
226
  }
227
227
  // Almost certainly Xcode isn't installed.
228
- await promptToOpenAppStoreAsync(`Xcode must be fully installed before you can continue. Continue to the App Store?`);
228
+ await promptToOpenAppStoreAsync(`Xcode must be fully installed before you can continue. If this message is still occurring after installing Xcode, you may need to finish the installation of the developer tools by running: \`sudo xcode-select -s /Applications/Xcode.app/Contents/Developer\`. Continue to the App Store?`);
229
229
  throw new _errors.AbortCommandError();
230
230
  }
231
231
  if (_semver().default.lt(version, SUGGESTED_XCODE_VERSION)) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/doctor/apple/XcodePrerequisite.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport semver from 'semver';\n\nimport * as Log from '../../../log';\nimport { AbortCommandError } from '../../../utils/errors';\nimport { profile } from '../../../utils/profile';\nimport { confirmAsync } from '../../../utils/prompts';\nimport { Prerequisite } from '../Prerequisite';\n\nconst debug = require('debug')('expo:doctor:apple:xcode') as typeof console.log;\n\n// Based on the Apple announcement (last updated: Aug 2023).\n// https://developer.apple.com/news/upcoming-requirements/?id=04252023a\nconst MIN_XCODE_VERSION = '14.1';\nconst APP_STORE_ID = '497799835';\n\nconst SUGGESTED_XCODE_VERSION = `${MIN_XCODE_VERSION}.0`;\n\nconst promptToOpenAppStoreAsync = async (message: string) => {\n // This prompt serves no purpose accept informing the user what to do next, we could just open the App Store but it could be confusing if they don't know what's going on.\n const confirm = await confirmAsync({ initial: true, message });\n if (confirm) {\n Log.log(`Going to the App Store, re-run Expo CLI when Xcode has finished installing.`);\n openAppStore(APP_STORE_ID);\n }\n};\n\nlet _xcodeVersionPromise: Promise<{ value: string | null | false; error?: string }> | null = null;\n\nexport const getXcodeVersionAsync = async ({\n silent,\n force,\n}: { silent?: boolean; force?: boolean } = {}): Promise<string | null | false> => {\n const logError = silent ? debug : Log.warn;\n const getVersion = async (): Promise<{ value: string | null | false; error?: string }> => {\n try {\n const { stdout } = await spawnAsync('xcodebuild', ['-version']);\n const last = stdout.match(/^Xcode (\\d+\\.\\d+)/)?.[1];\n // Convert to a semver string\n if (last) {\n const version = `${last}.0`;\n\n if (!semver.valid(version)) {\n // Not sure why this would happen, if it does we should add a more confident error message.\n return { error: `Xcode version is in an unknown format: ${version}`, value: false };\n }\n return { value: version };\n }\n\n // not sure what's going on\n return {\n error:\n 'Unable to check Xcode version. Command ran successfully but no version number was found.',\n value: null,\n };\n } catch {\n // not installed\n }\n return { value: null };\n };\n\n if (force) {\n _xcodeVersionPromise = null;\n }\n\n _xcodeVersionPromise = _xcodeVersionPromise ?? getVersion();\n\n const result = await _xcodeVersionPromise;\n\n if (result.error) {\n logError(result.error);\n }\n\n return result.value;\n};\n\n/**\n * Open a link to the App Store. Just link in mobile apps, **never** redirect without prompting first.\n *\n * @param appId\n */\nfunction openAppStore(appId: string) {\n const link = getAppStoreLink(appId);\n execSync(`open ${link}`, { stdio: 'ignore' });\n}\n\nfunction getAppStoreLink(appId: string): string {\n if (process.platform === 'darwin') {\n // TODO: Is there ever a case where the macappstore isn't available on mac?\n return `macappstore://itunes.apple.com/app/id${appId}`;\n }\n return `https://apps.apple.com/us/app/id${appId}`;\n}\n\nfunction spawnForString(cmd: string): string | null {\n try {\n return execSync(cmd, { stdio: 'pipe' }).toString().trim();\n } catch {}\n return null;\n}\n\n/** @returns a string like `/Applications/Xcode.app/Contents/Developer` when Xcode has a correctly selected path. */\nfunction getXcodeSelectPathAsync() {\n return spawnForString('/usr/bin/xcode-select --print-path');\n}\nfunction getXcodeInstalled() {\n return spawnForString('ls /Applications/Xcode.app/Contents/Developer');\n}\n\nexport class XcodePrerequisite extends Prerequisite {\n static instance = new XcodePrerequisite();\n\n /**\n * Ensure Xcode is installed and recent enough to be used with Expo.\n */\n async assertImplementation(): Promise<void> {\n const version = await profile(getXcodeVersionAsync)({ force: process.env.NODE_ENV === 'test' });\n debug(`Xcode version: ${version}`);\n if (!version) {\n // A couple different issues could have occurred, let's check them after we're past the point of no return\n // since we no longer need to be fast about validation.\n\n // Ensure Xcode.app can be found before we prompt to sudo select it.\n if (getXcodeInstalled()) {\n const selectPath = profile(getXcodeSelectPathAsync)();\n debug(`Xcode select path: ${selectPath}`);\n if (!selectPath) {\n Log.error(\n [\n '',\n chalk.bold('Xcode has not been fully setup for Apple development yet.'),\n 'Download at: https://developer.apple.com/xcode/',\n 'or in the App Store.',\n '',\n 'After downloading Xcode, run the following two commands in your terminal:',\n chalk.cyan(' sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer'),\n chalk.cyan(' sudo xcodebuild -runFirstLaunch'),\n '',\n 'Then you can re-run Expo CLI. Alternatively, you can build apps in the cloud with EAS CLI, or preview using the Expo Go app on a physical device.',\n '',\n ].join('\\n')\n );\n throw new AbortCommandError();\n } else {\n debug(`Unexpected Xcode setup (version: ${version}, select: ${selectPath})`);\n }\n }\n\n // Almost certainly Xcode isn't installed.\n await promptToOpenAppStoreAsync(\n `Xcode must be fully installed before you can continue. Continue to the App Store?`\n );\n throw new AbortCommandError();\n }\n\n if (semver.lt(version, SUGGESTED_XCODE_VERSION)) {\n // Xcode version is too old.\n await promptToOpenAppStoreAsync(\n `Xcode (${version}) needs to be updated to at least version ${MIN_XCODE_VERSION}. Continue to the App Store?`\n );\n throw new AbortCommandError();\n }\n }\n}\n"],"names":["XcodePrerequisite","getXcodeVersionAsync","debug","require","MIN_XCODE_VERSION","APP_STORE_ID","SUGGESTED_XCODE_VERSION","promptToOpenAppStoreAsync","message","confirm","confirmAsync","initial","Log","log","openAppStore","_xcodeVersionPromise","silent","force","logError","warn","getVersion","stdout","spawnAsync","last","match","version","semver","valid","error","value","result","appId","link","getAppStoreLink","execSync","stdio","process","platform","spawnForString","cmd","toString","trim","getXcodeSelectPathAsync","getXcodeInstalled","Prerequisite","instance","assertImplementation","profile","env","NODE_ENV","selectPath","chalk","bold","cyan","join","AbortCommandError","lt"],"mappings":";;;;;;;;;;;IA+GaA,iBAAiB;eAAjBA;;IAhFAC,oBAAoB;eAApBA;;;;gEA/BU;;;;;;;gEACL;;;;;;;yBACO;;;;;;;gEACN;;;;;;6DAEE;wBACa;yBACV;yBACK;8BACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,4DAA4D;AAC5D,uEAAuE;AACvE,MAAMC,oBAAoB;AAC1B,MAAMC,eAAe;AAErB,MAAMC,0BAA0B,GAAGF,kBAAkB,EAAE,CAAC;AAExD,MAAMG,4BAA4B,OAAOC;IACvC,0KAA0K;IAC1K,MAAMC,UAAU,MAAMC,IAAAA,qBAAY,EAAC;QAAEC,SAAS;QAAMH;IAAQ;IAC5D,IAAIC,SAAS;QACXG,KAAIC,GAAG,CAAC,CAAC,2EAA2E,CAAC;QACrFC,aAAaT;IACf;AACF;AAEA,IAAIU,uBAAyF;AAEtF,MAAMd,uBAAuB,OAAO,EACzCe,MAAM,EACNC,KAAK,EACiC,GAAG,CAAC,CAAC;IAC3C,MAAMC,WAAWF,SAASd,QAAQU,KAAIO,IAAI;IAC1C,MAAMC,aAAa;QACjB,IAAI;gBAEWC;YADb,MAAM,EAAEA,MAAM,EAAE,GAAG,MAAMC,IAAAA,qBAAU,EAAC,cAAc;gBAAC;aAAW;YAC9D,MAAMC,QAAOF,gBAAAA,OAAOG,KAAK,CAAC,yCAAbH,aAAmC,CAAC,EAAE;YACnD,6BAA6B;YAC7B,IAAIE,MAAM;gBACR,MAAME,UAAU,GAAGF,KAAK,EAAE,CAAC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AA,gBAAO,EAAC9C,sBAAsB;YAAEgB,OAAOmB,QAAQY,GAAG,CAACC,QAAQ,KAAK;QAAO;QAC7F/C,MAAM,CAAC,eAAe,EAAEuB,SAAS;QACjC,IAAI,CAACA,SAAS;YACZ,0GAA0G;YAC1G,uDAAuD;YAEvD,oEAAoE;YACpE,IAAIkB,qBAAqB;gBACvB,MAAMO,aAAaH,IAAAA,gBAAO,EAACL;gBAC3BxC,MAAM,CAAC,mBAAmB,EAAEgD,YAAY;gBACxC,IAAI,CAACA,YAAY;oBACftC,KAAIgB,KAAK,CACP;wBACE;wBACAuB,gBAAK,CAACC,IAAI,CAAC;wBACX;wBACA;wBACA;wBACA;wBACAD,gBAAK,CAACE,IAAI,CAAC;wBACXF,gBAAK,CAACE,IAAI,CAAC;wBACX;wBACA;wBACA;qBACD,CAACC,IAAI,CAAC;oBAET,MAAM,IAAIC,yBAAiB;gBAC7B,OAAO;oBACLrD,MAAM,CAAC,iCAAiC,EAAEuB,QAAQ,UAAU,EAAEyB,WAAW,CAAC,CAAC;gBAC7E;YACF;YAEA,0CAA0C;YAC1C,MAAM3C,0BACJ,CAAC,iFAAiF,CAAC;YAErF,MAAM,IAAIgD,yBAAiB;QAC7B;QAEA,IAAI7B,iBAAM,CAAC8B,EAAE,CAAC/B,SAASnB,0BAA0B;YAC/C,4BAA4B;YAC5B,MAAMC,0BACJ,CAAC,OAAO,EAAEkB,QAAQ,0CAA0C,EAAErB,kBAAkB,4BAA4B,CAAC;YAE/G,MAAM,IAAImD,yBAAiB;QAC7B;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../../src/start/doctor/apple/XcodePrerequisite.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport semver from 'semver';\n\nimport * as Log from '../../../log';\nimport { AbortCommandError } from '../../../utils/errors';\nimport { profile } from '../../../utils/profile';\nimport { confirmAsync } from '../../../utils/prompts';\nimport { Prerequisite } from '../Prerequisite';\n\nconst debug = require('debug')('expo:doctor:apple:xcode') as typeof console.log;\n\n// Based on the Apple announcement (last updated: Aug 2023).\n// https://developer.apple.com/news/upcoming-requirements/?id=04252023a\nconst MIN_XCODE_VERSION = '14.1';\nconst APP_STORE_ID = '497799835';\n\nconst SUGGESTED_XCODE_VERSION = `${MIN_XCODE_VERSION}.0`;\n\nconst promptToOpenAppStoreAsync = async (message: string) => {\n // This prompt serves no purpose accept informing the user what to do next, we could just open the App Store but it could be confusing if they don't know what's going on.\n const confirm = await confirmAsync({ initial: true, message });\n if (confirm) {\n Log.log(`Going to the App Store, re-run Expo CLI when Xcode has finished installing.`);\n openAppStore(APP_STORE_ID);\n }\n};\n\nlet _xcodeVersionPromise: Promise<{ value: string | null | false; error?: string }> | null = null;\n\nexport const getXcodeVersionAsync = async ({\n silent,\n force,\n}: { silent?: boolean; force?: boolean } = {}): Promise<string | null | false> => {\n const logError = silent ? debug : Log.warn;\n const getVersion = async (): Promise<{ value: string | null | false; error?: string }> => {\n try {\n const { stdout } = await spawnAsync('xcodebuild', ['-version']);\n const last = stdout.match(/^Xcode (\\d+\\.\\d+)/)?.[1];\n // Convert to a semver string\n if (last) {\n const version = `${last}.0`;\n\n if (!semver.valid(version)) {\n // Not sure why this would happen, if it does we should add a more confident error message.\n return { error: `Xcode version is in an unknown format: ${version}`, value: false };\n }\n return { value: version };\n }\n\n // not sure what's going on\n return {\n error:\n 'Unable to check Xcode version. Command ran successfully but no version number was found.',\n value: null,\n };\n } catch {\n // not installed\n }\n return { value: null };\n };\n\n if (force) {\n _xcodeVersionPromise = null;\n }\n\n _xcodeVersionPromise = _xcodeVersionPromise ?? getVersion();\n\n const result = await _xcodeVersionPromise;\n\n if (result.error) {\n logError(result.error);\n }\n\n return result.value;\n};\n\n/**\n * Open a link to the App Store. Just link in mobile apps, **never** redirect without prompting first.\n *\n * @param appId\n */\nfunction openAppStore(appId: string) {\n const link = getAppStoreLink(appId);\n execSync(`open ${link}`, { stdio: 'ignore' });\n}\n\nfunction getAppStoreLink(appId: string): string {\n if (process.platform === 'darwin') {\n // TODO: Is there ever a case where the macappstore isn't available on mac?\n return `macappstore://itunes.apple.com/app/id${appId}`;\n }\n return `https://apps.apple.com/us/app/id${appId}`;\n}\n\nfunction spawnForString(cmd: string): string | null {\n try {\n return execSync(cmd, { stdio: 'pipe' }).toString().trim();\n } catch {}\n return null;\n}\n\n/** @returns a string like `/Applications/Xcode.app/Contents/Developer` when Xcode has a correctly selected path. */\nfunction getXcodeSelectPathAsync() {\n return spawnForString('/usr/bin/xcode-select --print-path');\n}\nfunction getXcodeInstalled() {\n return spawnForString('ls /Applications/Xcode.app/Contents/Developer');\n}\n\nexport class XcodePrerequisite extends Prerequisite {\n static instance = new XcodePrerequisite();\n\n /**\n * Ensure Xcode is installed and recent enough to be used with Expo.\n */\n async assertImplementation(): Promise<void> {\n const version = await profile(getXcodeVersionAsync)({ force: process.env.NODE_ENV === 'test' });\n debug(`Xcode version: ${version}`);\n if (!version) {\n // A couple different issues could have occurred, let's check them after we're past the point of no return\n // since we no longer need to be fast about validation.\n\n // Ensure Xcode.app can be found before we prompt to sudo select it.\n if (getXcodeInstalled()) {\n const selectPath = profile(getXcodeSelectPathAsync)();\n debug(`Xcode select path: ${selectPath}`);\n if (!selectPath) {\n Log.error(\n [\n '',\n chalk.bold('Xcode has not been fully setup for Apple development yet.'),\n 'Download at: https://developer.apple.com/xcode/',\n 'or in the App Store.',\n '',\n 'After downloading Xcode, run the following two commands in your terminal:',\n chalk.cyan(' sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer'),\n chalk.cyan(' sudo xcodebuild -runFirstLaunch'),\n '',\n 'Then you can re-run Expo CLI. Alternatively, you can build apps in the cloud with EAS CLI, or preview using the Expo Go app on a physical device.',\n '',\n ].join('\\n')\n );\n throw new AbortCommandError();\n } else {\n debug(`Unexpected Xcode setup (version: ${version}, select: ${selectPath})`);\n }\n }\n\n // Almost certainly Xcode isn't installed.\n await promptToOpenAppStoreAsync(\n `Xcode must be fully installed before you can continue. If this message is still occurring after installing Xcode, you may need to finish the installation of the developer tools by running: \\`sudo xcode-select -s /Applications/Xcode.app/Contents/Developer\\`. Continue to the App Store?`\n );\n throw new AbortCommandError();\n }\n\n if (semver.lt(version, SUGGESTED_XCODE_VERSION)) {\n // Xcode version is too old.\n await promptToOpenAppStoreAsync(\n `Xcode (${version}) needs to be updated to at least version ${MIN_XCODE_VERSION}. Continue to the App Store?`\n );\n throw new AbortCommandError();\n }\n }\n}\n"],"names":["XcodePrerequisite","getXcodeVersionAsync","debug","require","MIN_XCODE_VERSION","APP_STORE_ID","SUGGESTED_XCODE_VERSION","promptToOpenAppStoreAsync","message","confirm","confirmAsync","initial","Log","log","openAppStore","_xcodeVersionPromise","silent","force","logError","warn","getVersion","stdout","spawnAsync","last","match","version","semver","valid","error","value","result","appId","link","getAppStoreLink","execSync","stdio","process","platform","spawnForString","cmd","toString","trim","getXcodeSelectPathAsync","getXcodeInstalled","Prerequisite","instance","assertImplementation","profile","env","NODE_ENV","selectPath","chalk","bold","cyan","join","AbortCommandError","lt"],"mappings":";;;;;;;;;;;IA+GaA,iBAAiB;eAAjBA;;IAhFAC,oBAAoB;eAApBA;;;;gEA/BU;;;;;;;gEACL;;;;;;;yBACO;;;;;;;gEACN;;;;;;6DAEE;wBACa;yBACV;yBACK;8BACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,4DAA4D;AAC5D,uEAAuE;AACvE,MAAMC,oBAAoB;AAC1B,MAAMC,eAAe;AAErB,MAAMC,0BAA0B,GAAGF,kBAAkB,EAAE,CAAC;AAExD,MAAMG,4BAA4B,OAAOC;IACvC,0KAA0K;IAC1K,MAAMC,UAAU,MAAMC,IAAAA,qBAAY,EAAC;QAAEC,SAAS;QAAMH;IAAQ;IAC5D,IAAIC,SAAS;QACXG,KAAIC,GAAG,CAAC,CAAC,2EAA2E,CAAC;QACrFC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AE,CAAC/B,SAASnB,0BAA0B;YAC/C,4BAA4B;YAC5B,MAAMC,0BACJ,CAAC,OAAO,EAAEkB,QAAQ,0CAA0C,EAAErB,kBAAkB,4BAA4B,CAAC;YAE/G,MAAM,IAAImD,yBAAiB;QAC7B;IACF;AACF"}
@@ -163,7 +163,7 @@ skipPrompt = !(0, _interactive.isInteractive)(), isProjectMutable = (0, _interac
163
163
  }
164
164
  const installCommand = 'npx expo install ' + missing.map(({ pkg })=>pkg).join(' ');
165
165
  const disableMessage = warningMessage;
166
- const solution = `Please install ${_chalk().default.bold(readableMissingPackages)} by running:\n\n ${_chalk().default.reset.bold(installCommand)}\n\n`;
166
+ const solution = `Install ${_chalk().default.bold(readableMissingPackages)} by running:\n\n ${_chalk().default.reset.bold(installCommand)}\n\n`;
167
167
  // This prevents users from starting a misconfigured JS or TS project by default.
168
168
  throw new _errors.CommandError(wrapForTerminal(title + solution + disableMessage + '\n'));
169
169
  }
@@ -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 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":["createInstallCommand","ensureDependenciesAsync","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":";;;;;;;;;;;IA+HgBA,oBAAoB;eAApBA;;IApGMC,uBAAuB;eAAvBA;;;;yBA3BgB;;;;;;;gEACpB;;;;;;;gEACG;;;;;;oCAEoC;8BAC5B;6DACR;wBACQ;6BACC;qBACA;yBACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBt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M,GAAG,EAAyC;IAExD,MAAMa,cAAcxB,gBAAK,CAACiB,IAAI,CAACZ,SAASX,IAAI,CAAC;IAC7CG,KAAIC,GAAG;IACP,MAAM2B,wBAAwBC,IAAAA,kBAAa,EAAC,CAAC,WAAW,EAAEF,aAAa;IACvE,IAAI;QACF,MAAMG,IAAAA,0BAAY,EAACtB,UAAU;YAAE5B;YAAakC;QAAI;IAClD,EAAE,OAAOiB,GAAQ;QACfH,sBAAsBI,IAAI,CAAC,CAAC,kBAAkB,EAAEL,YAAY,aAAa,EAAEI,EAAEzB,OAAO,EAAE;QACtF,MAAMyB;IACR;IACAH,sBAAsBK,OAAO,CAAC,CAAC,UAAU,EAAEN,aAAa;AAC1D"}
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 = `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":["createInstallCommand","ensureDependenciesAsync","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":";;;;;;;;;;;IA+HgBA,oBAAoB;eAApBA;;IApGMC,uBAAuB;eAAvBA;;;;yBA3BgB;;;;;;;gEACpB;;;;;;;gEACG;;;;;;oCAEoC;8BAC5B;6DACR;wBACQ;6BACC;qBACA;yBACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBtB,eAAeA,wBACpBC,WAAmB,EACnB,EACEC,MAAMC,IAAAA,mBAAS,EAACF,aAAaC,GAAG,EAChCE,gBAAgB,EAChBC,cAAc,EACdC,cAAc,EACd,qBAAqB;AACrBC,aAAa,CAACC,IAAAA,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,EAAEF,aAAa;IACvE,IAAI;QACF,MAAMG,IAAAA,0BAAY,EAACtB,UAAU;YAAE5B;YAAakC;QAAI;IAClD,EAAE,OAAOiB,GAAQ;QACfH,sBAAsBI,IAAI,CAAC,CAAC,kBAAkB,EAAEL,YAAY,aAAa,EAAEI,EAAEzB,OAAO,EAAE;QACtF,MAAMyB;IACR;IACAH,sBAAsBK,OAAO,CAAC,CAAC,UAAU,EAAEN,aAAa;AAC1D"}
@@ -59,7 +59,7 @@ async function resolvePackageVersionAsync(projectRoot, packageName) {
59
59
  }
60
60
  }
61
61
  if (!packageJsonPath) {
62
- throw new _errors.CommandError('PACKAGE_NOT_FOUND', `"${packageName}" is added as a dependency in your project's package.json but it doesn't seem to be installed. Please run "yarn" or "npm install" to fix this issue.`);
62
+ throw new _errors.CommandError('PACKAGE_NOT_FOUND', `"${packageName}" is added as a dependency in your project's package.json but it doesn't seem to be installed. Run "npm install", or the equivalent for your package manager, and try again.`);
63
63
  }
64
64
  const packageJson = await _jsonfile().default.readAsync(packageJsonPath);
65
65
  return packageJson.version;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/doctor/dependencies/resolvePackages.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nimport { CommandError } from '../../../utils/errors';\n\nexport async function resolvePackageVersionAsync(\n projectRoot: string,\n packageName: string\n): Promise<string> {\n let packageJsonPath: string | undefined;\n try {\n packageJsonPath = resolveFrom(projectRoot, `${packageName}/package.json`);\n } catch (error: any) {\n // This is a workaround for packages using `exports`. If this doesn't\n // include `package.json`, we have to use the error message to get the location.\n if (error.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {\n packageJsonPath = error.message.match(/(\"exports\"|defined) in (.*)$/i)?.[2];\n }\n }\n if (!packageJsonPath) {\n throw new CommandError(\n 'PACKAGE_NOT_FOUND',\n `\"${packageName}\" is added as a dependency in your project's package.json but it doesn't seem to be installed. Please run \"yarn\" or \"npm install\" to fix this issue.`\n );\n }\n const packageJson = await JsonFile.readAsync<{ version: string }>(packageJsonPath);\n return packageJson.version;\n}\n\nexport async function resolveAllPackageVersionsAsync(projectRoot: string, packages: string[]) {\n const resolvedPackages = await Promise.all(\n packages.map(async (packageName) => [\n packageName,\n await resolvePackageVersionAsync(projectRoot, packageName),\n ])\n );\n\n return Object.fromEntries(resolvedPackages);\n}\n\n/**\n * Determine if the project has a `expo@canary` version installed.\n * This means that an unsable version is used, without the API knowing the exact packages.\n * Since this may be called during, or before, packages are installed, we also need to test on `package.json`.\n * Note, this returns `false` for beta releases.\n */\nexport async function hasExpoCanaryAsync(projectRoot: string) {\n let expoVersion = '';\n\n try {\n // Resolve installed `expo` version first\n expoVersion = await resolvePackageVersionAsync(projectRoot, 'expo');\n } catch (error: any) {\n if (error.code !== 'PACKAGE_NOT_FOUND') {\n throw error;\n }\n\n // Resolve through project `package.json`\n const packageJson = await JsonFile.readAsync<{ dependencies?: Record<string, string> }>(\n resolveFrom(projectRoot, './package.json')\n );\n expoVersion = packageJson.dependencies?.expo ?? '';\n }\n\n if (expoVersion === 'canary') {\n return true;\n }\n\n const prerelease = semver.prerelease(expoVersion) || [];\n return !!prerelease.some((segment) => typeof segment === 'string' && segment.includes('canary'));\n}\n"],"names":["hasExpoCanaryAsync","resolveAllPackageVersionsAsync","resolvePackageVersionAsync","projectRoot","packageName","packageJsonPath","resolveFrom","error","code","message","match","CommandError","packageJson","JsonFile","readAsync","version","packages","resolvedPackages","Promise","all","map","Object","fromEntries","expoVersion","dependencies","expo","prerelease","semver","some","segment","includes"],"mappings":";;;;;;;;;;;IA+CsBA,kBAAkB;eAAlBA;;IAjBAC,8BAA8B;eAA9BA;;IAxBAC,0BAA0B;eAA1BA;;;;gEAND;;;;;;;gEACG;;;;;;;gEACL;;;;;;wBAEU;;;;;;AAEtB,eAAeA,2BACpBC,WAAmB,EACnBC,WAAmB;IAEnB,IAAIC;IACJ,IAAI;QACFA,kBAAkBC,IAA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AAQC,QAAQ,CAAC;AACxF"}
1
+ {"version":3,"sources":["../../../../../src/start/doctor/dependencies/resolvePackages.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nimport { CommandError } from '../../../utils/errors';\n\nexport async function resolvePackageVersionAsync(\n projectRoot: string,\n packageName: string\n): Promise<string> {\n let packageJsonPath: string | undefined;\n try {\n packageJsonPath = resolveFrom(projectRoot, `${packageName}/package.json`);\n } catch (error: any) {\n // This is a workaround for packages using `exports`. If this doesn't\n // include `package.json`, we have to use the error message to get the location.\n if (error.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {\n packageJsonPath = error.message.match(/(\"exports\"|defined) in (.*)$/i)?.[2];\n }\n }\n if (!packageJsonPath) {\n throw new CommandError(\n 'PACKAGE_NOT_FOUND',\n `\"${packageName}\" is added as a dependency in your project's package.json but it doesn't seem to be installed. Run \"npm install\", or the equivalent for your package manager, and try again.`\n );\n }\n const packageJson = await JsonFile.readAsync<{ version: string }>(packageJsonPath);\n return packageJson.version;\n}\n\nexport async function resolveAllPackageVersionsAsync(projectRoot: string, packages: string[]) {\n const resolvedPackages = await Promise.all(\n packages.map(async (packageName) => [\n packageName,\n await resolvePackageVersionAsync(projectRoot, packageName),\n ])\n );\n\n return Object.fromEntries(resolvedPackages);\n}\n\n/**\n * Determine if the project has a `expo@canary` version installed.\n * This means that an unsable version is used, without the API knowing the exact packages.\n * Since this may be called during, or before, packages are installed, we also need to test on `package.json`.\n * Note, this returns `false` for beta releases.\n */\nexport async function hasExpoCanaryAsync(projectRoot: string) {\n let expoVersion = '';\n\n try {\n // Resolve installed `expo` version first\n expoVersion = await resolvePackageVersionAsync(projectRoot, 'expo');\n } catch (error: any) {\n if (error.code !== 'PACKAGE_NOT_FOUND') {\n throw error;\n }\n\n // Resolve through project `package.json`\n const packageJson = await JsonFile.readAsync<{ dependencies?: Record<string, string> }>(\n resolveFrom(projectRoot, './package.json')\n );\n expoVersion = packageJson.dependencies?.expo ?? '';\n }\n\n if (expoVersion === 'canary') {\n return true;\n }\n\n const prerelease = semver.prerelease(expoVersion) || [];\n return !!prerelease.some((segment) => typeof segment === 'string' && segment.includes('canary'));\n}\n"],"names":["hasExpoCanaryAsync","resolveAllPackageVersionsAsync","resolvePackageVersionAsync","projectRoot","packageName","packageJsonPath","resolveFrom","error","code","message","match","CommandError","packageJson","JsonFile","readAsync","version","packages","resolvedPackages","Promise","all","map","Object","fromEntries","expoVersion","dependencies","expo","prerelease","semver","some","segment","includes"],"mappings":";;;;;;;;;;;IA+CsBA,kBAAkB;eAAlBA;;IAjBAC,8BAA8B;eAA9BA;;IAxBAC,0BAA0B;eAA1BA;;;;gEAND;;;;;;;gEACG;;;;;;;gEACL;;;;;;wBAEU;;;;;;AAEtB,eAAeA,2BACpBC,WAAmB,EACnBC,WAAmB;IAEnB,IAAIC;IACJ,IAAI;QACFA,kBAAkBC,IAAAA,sBAAW,EAACH,aAAa,GAAGC,YAAY,aAAa,CAAC;IAC1E,EAAE,OAAOG,OAAY;QACnB,qEAAqE;QACrE,gFAAgF;QAChF,IAAIA,MAAMC,IAAI,KAAK,iCAAiC;gBAChCD;YAAlBF,mBAAkBE,uBAAAA,MAAME,OAAO,CAACC,KAAK,CAAC,qDAApBH,oBAAsD,CAAC,EAAE;QAC7E;IACF;IACA,IAAI,CAACF,iBAAiB;QACpB,MAAM,IAAIM,oBAAY,CACpB,qBACA,CAAC,CAAC,EAAEP,YAAY,4KAA4K,CAAC;IAEjM;IACA,MAAMQ,cAAc,MAAMC,mBAAQ,CAACC,SAAS,CAAsBT;IAClE,OAAOO,YAAYG,OAAO;AAC5B;AAEO,eAAed,+BAA+BE,WAAmB,EAAEa,QAAkB;IAC1F,MAAMC,mBAAmB,MAAMC,QAAQC,GAAG,CACxCH,SAASI,GAAG,CAAC,OAAOhB,cAAgB;YAClCA;YACA,MAAMF,2BAA2BC,aAAaC;SAC/C;IAGH,OAAOiB,OAAOC,WAAW,CAACL;AAC5B;AAQO,eAAejB,mBAAmBG,WAAmB;IAC1D,IAAIoB,cAAc;IAElB,IAAI;QACF,yCAAyC;QACzCA,cAAc,MAAMrB,2BAA2BC,aAAa;IAC9D,EAAE,OAAOI,OAAY;YASLK;QARd,IAAIL,MAAMC,IAAI,KAAK,qBAAqB;YACtC,MAAMD;QACR;QAEA,yCAAyC;QACzC,MAAMK,cAAc,MAAMC,mBAAQ,CAACC,SAAS,CAC1CR,IAAAA,sBAAW,EAACH,aAAa;QAE3BoB,cAAcX,EAAAA,4BAAAA,YAAYY,YAAY,qBAAxBZ,0BAA0Ba,IAAI,KAAI;IAClD;IAEA,IAAIF,gBAAgB,UAAU;QAC5B,OAAO;IACT;IAEA,MAAMG,aAAaC,iBAAM,CAACD,UAAU,CAACH,gBAAgB,EAAE;IACvD,OAAO,CAAC,CAACG,WAAWE,IAAI,CAAC,CAACC,UAAY,OAAOA,YAAY,YAAYA,QAAQC,QAAQ,CAAC;AACxF"}
@@ -168,7 +168,7 @@ class ExternalModule {
168
168
  shouldPrompt: false
169
169
  });
170
170
  }
171
- throw new _errors.CommandError('EXTERNAL_MODULE_AVAILABILITY', `Please install ${packageName} and try again`);
171
+ throw new _errors.CommandError('EXTERNAL_MODULE_AVAILABILITY', `Install ${packageName} and try again`);
172
172
  }
173
173
  /** Get the module. */ get() {
174
174
  try {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/doctor/ngrok/ExternalModule.ts"],"sourcesContent":["import * as PackageManager from '@expo/package-manager';\nimport requireGlobal from 'requireg';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nimport * as Log from '../../../log';\nimport { delayAsync } from '../../../utils/delay';\nimport { env } from '../../../utils/env';\nimport { CommandError } from '../../../utils/errors';\nimport { confirmAsync } from '../../../utils/prompts';\n\nconst debug = require('debug')('expo:doctor:externalModule') as typeof console.log;\n\n/** An error that is thrown when a package is installed but doesn't meet the version criteria. */\nexport class ExternalModuleVersionError extends CommandError {\n constructor(\n message: string,\n public readonly shouldGloballyInstall: boolean\n ) {\n super('EXTERNAL_MODULE_VERSION', message);\n }\n}\n\ninterface PromptOptions {\n /** Should prompt the user to install, when false the module will just assert on missing packages, default `true`. Ignored when `autoInstall` is true. */\n shouldPrompt?: boolean;\n /** Should automatically install the package without prompting, default `false` */\n autoInstall?: boolean;\n}\n\nexport interface InstallPromptOptions extends PromptOptions {\n /** Should install the package globally, default `false` */\n shouldGloballyInstall?: boolean;\n}\n\nexport interface ResolvePromptOptions extends PromptOptions {\n /**\n * Prefer to install the package globally, this can be overridden if the function\n * detects that a locally installed package simply needs an upgrade, default `false`\n */\n prefersGlobalInstall?: boolean;\n}\n\n/** Resolves a local or globally installed package, prompts to install if missing. */\nexport class ExternalModule<TModule> {\n private instance: TModule | null = null;\n\n constructor(\n /** Project root for checking if the package is installed locally. */\n private projectRoot: string,\n /** Info on the external package. */\n private pkg: {\n /** NPM package name. */\n name: string;\n /** Required semver range, ex: `^1.0.0`. */\n versionRange: string;\n },\n /** A function used to create the installation prompt message. */\n private promptMessage: (pkgName: string) => string\n ) {}\n\n /** Resolve the globally or locally installed instance, or prompt to install. */\n async resolveAsync({\n prefersGlobalInstall,\n ...options\n }: ResolvePromptOptions = {}): Promise<TModule> {\n try {\n return (\n this.getVersioned() ??\n this.installAsync({\n ...options,\n shouldGloballyInstall: prefersGlobalInstall,\n })\n );\n } catch (error: any) {\n if (error instanceof ExternalModuleVersionError) {\n // If the module version in not compliant with the version range,\n // we should prompt the user to install the package where it already exists.\n return this.installAsync({\n ...options,\n shouldGloballyInstall: error.shouldGloballyInstall ?? prefersGlobalInstall,\n });\n }\n throw error;\n }\n }\n\n /** Prompt the user to install the package and try again. */\n async installAsync({\n shouldPrompt = true,\n autoInstall,\n shouldGloballyInstall,\n }: InstallPromptOptions = {}): Promise<TModule> {\n const packageName = [this.pkg.name, this.pkg.versionRange].join('@');\n if (!autoInstall) {\n // Delay the prompt so it doesn't conflict with other dev tool logs\n await delayAsync(100);\n }\n const answer =\n autoInstall ||\n (shouldPrompt &&\n (await confirmAsync({\n message: this.promptMessage(packageName),\n initial: true,\n })));\n if (answer) {\n Log.log(`Installing ${packageName}...`);\n\n // Always use npm for global installs\n const packageManager = shouldGloballyInstall\n ? new PackageManager.NpmPackageManager({\n cwd: this.projectRoot,\n log: Log.log,\n silent: !(env.EXPO_DEBUG || env.CI),\n })\n : PackageManager.createForProject(this.projectRoot, {\n silent: !(env.EXPO_DEBUG || env.CI),\n });\n\n try {\n if (shouldGloballyInstall) {\n await packageManager.addGlobalAsync([packageName]);\n } else {\n await packageManager.addDevAsync([packageName]);\n }\n Log.log(`Installed ${packageName}`);\n } catch (error: any) {\n error.message = `Failed to install ${packageName} ${\n shouldGloballyInstall ? 'globally' : 'locally'\n }: ${error.message}`;\n throw error;\n }\n return await this.resolveAsync({ shouldPrompt: false });\n }\n\n throw new CommandError(\n 'EXTERNAL_MODULE_AVAILABILITY',\n `Please install ${packageName} and try again`\n );\n }\n\n /** Get the module. */\n get(): TModule | null {\n try {\n return this.getVersioned();\n } catch {\n return null;\n }\n }\n\n /** Get the module, throws if the module is not versioned correctly. */\n getVersioned(): TModule | null {\n this.instance ??= this._resolveModule(true) ?? this._resolveModule(false);\n return this.instance;\n }\n\n /** Exposed for testing. */\n _require(moduleId: string): any {\n return require(moduleId);\n }\n\n /** Resolve a copy that's installed in the project. Exposed for testing. */\n _resolveLocal(moduleId: string): string {\n return resolveFrom(this.projectRoot, moduleId);\n }\n\n /** Resolve a copy that's installed globally. Exposed for testing. */\n _resolveGlobal(moduleId: string): string {\n return requireGlobal.resolve(moduleId);\n }\n\n /** Resolve the module and verify the version. Exposed for testing. */\n _resolveModule(isLocal: boolean): TModule | null {\n const resolver = isLocal ? this._resolveLocal.bind(this) : this._resolveGlobal.bind(this);\n try {\n const packageJsonPath = resolver(`${this.pkg.name}/package.json`);\n const packageJson = this._require(packageJsonPath);\n if (packageJson) {\n if (semver.satisfies(packageJson.version, this.pkg.versionRange)) {\n const modulePath = resolver(this.pkg.name);\n const requiredModule = this._require(modulePath);\n if (requiredModule == null) {\n throw new CommandError(\n 'EXTERNAL_MODULE_EXPORT',\n `${this.pkg.name} exports a nullish value, which is not allowed.`\n );\n }\n return requiredModule;\n }\n throw new ExternalModuleVersionError(\n `Required module '${this.pkg.name}@${packageJson.version}' does not satisfy ${this.pkg.versionRange}. Installed at: ${packageJsonPath}`,\n !isLocal\n );\n }\n } catch (error: any) {\n if (error instanceof CommandError) {\n throw error;\n } else if (error.code !== 'MODULE_NOT_FOUND') {\n debug('Failed to resolve module', error.message);\n }\n }\n return null;\n }\n}\n"],"names":["ExternalModule","ExternalModuleVersionError","debug","require","CommandError","constructor","message","shouldGloballyInstall","projectRoot","pkg","promptMessage","instance","resolveAsync","prefersGlobalInstall","options","getVersioned","installAsync","error","shouldPrompt","autoInstall","packageName","name","versionRange","join","delayAsync","answer","confirmAsync","initial","Log","log","packageManager","PackageManager","NpmPackageManager","cwd","silent","env","EXPO_DEBUG","CI","createForProject","addGlobalAsync","addDevAsync","get","_resolveModule","_require","moduleId","_resolveLocal","resolveFrom","_resolveGlobal","requireGlobal","resolve","isLocal","resolver","bind","packageJsonPath","packageJson","semver","satisfies","version","modulePath","requiredModule","code"],"mappings":";;;;;;;;;;;IA4CaA,cAAc;eAAdA;;IA9BAC,0BAA0B;eAA1BA;;;;iEAdmB;;;;;;;gEACN;;;;;;;gEACF;;;;;;;gEACL;;;;;;6DAEE;uBACM;qBACP;wBACS;yBACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAGxB,MAAMF,mCAAmCG,oBAAY;IAC1DC,YACEC,OAAe,EACf,AAAgBC,qBAA8B,CAC9C;QACA,KAAK,CAAC,2BAA2BD,eAFjBC,wBAAAA;IAGlB;AACF;AAuBO,MAAMP;IAGXK,YACE,mEAAmE,GACnE,AAAQG,WAAmB,EAC3B,kCAAkC,GAClC,AAA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AOI,mBAAa,CAACC,OAAO,CAACL;IAC/B;IAEA,oEAAoE,GACpEF,eAAeQ,OAAgB,EAAkB;QAC/C,MAAMC,WAAWD,UAAU,IAAI,CAACL,aAAa,CAACO,IAAI,CAAC,IAAI,IAAI,IAAI,CAACL,cAAc,CAACK,IAAI,CAAC,IAAI;QACxF,IAAI;YACF,MAAMC,kBAAkBF,SAAS,GAAG,IAAI,CAAC1C,GAAG,CAACY,IAAI,CAAC,aAAa,CAAC;YAChE,MAAMiC,cAAc,IAAI,CAACX,QAAQ,CAACU;YAClC,IAAIC,aAAa;gBACf,IAAIC,iBAAM,CAACC,SAAS,CAACF,YAAYG,OAAO,EAAE,IAAI,CAAChD,GAAG,CAACa,YAAY,GAAG;oBAChE,MAAMoC,aAAaP,SAAS,IAAI,CAAC1C,GAAG,CAACY,IAAI;oBACzC,MAAMsC,iBAAiB,IAAI,CAAChB,QAAQ,CAACe;oBACrC,IAAIC,kBAAkB,MAAM;wBAC1B,MAAM,IAAIvD,oBAAY,CACpB,0BACA,GAAG,IAAI,CAACK,GAAG,CAACY,IAAI,CAAC,+CAA+C,CAAC;oBAErE;oBACA,OAAOsC;gBACT;gBACA,MAAM,IAAI1D,2BACR,CAAC,iBAAiB,EAAE,IAAI,CAACQ,GAAG,CAACY,IAAI,CAAC,CAAC,EAAEiC,YAAYG,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAChD,GAAG,CAACa,YAAY,CAAC,gBAAgB,EAAE+B,iBAAiB,EACvI,CAACH;YAEL;QACF,EAAE,OAAOjC,OAAY;YACnB,IAAIA,iBAAiBb,oBAAY,EAAE;gBACjC,MAAMa;YACR,OAAO,IAAIA,MAAM2C,IAAI,KAAK,oBAAoB;gBAC5C1D,MAAM,4BAA4Be,MAAMX,OAAO;YACjD;QACF;QACA,OAAO;IACT;AACF"}
1
+ {"version":3,"sources":["../../../../../src/start/doctor/ngrok/ExternalModule.ts"],"sourcesContent":["import * as PackageManager from '@expo/package-manager';\nimport requireGlobal from 'requireg';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nimport * as Log from '../../../log';\nimport { delayAsync } from '../../../utils/delay';\nimport { env } from '../../../utils/env';\nimport { CommandError } from '../../../utils/errors';\nimport { confirmAsync } from '../../../utils/prompts';\n\nconst debug = require('debug')('expo:doctor:externalModule') as typeof console.log;\n\n/** An error that is thrown when a package is installed but doesn't meet the version criteria. */\nexport class ExternalModuleVersionError extends CommandError {\n constructor(\n message: string,\n public readonly shouldGloballyInstall: boolean\n ) {\n super('EXTERNAL_MODULE_VERSION', message);\n }\n}\n\ninterface PromptOptions {\n /** Should prompt the user to install, when false the module will just assert on missing packages, default `true`. Ignored when `autoInstall` is true. */\n shouldPrompt?: boolean;\n /** Should automatically install the package without prompting, default `false` */\n autoInstall?: boolean;\n}\n\nexport interface InstallPromptOptions extends PromptOptions {\n /** Should install the package globally, default `false` */\n shouldGloballyInstall?: boolean;\n}\n\nexport interface ResolvePromptOptions extends PromptOptions {\n /**\n * Prefer to install the package globally, this can be overridden if the function\n * detects that a locally installed package simply needs an upgrade, default `false`\n */\n prefersGlobalInstall?: boolean;\n}\n\n/** Resolves a local or globally installed package, prompts to install if missing. */\nexport class ExternalModule<TModule> {\n private instance: TModule | null = null;\n\n constructor(\n /** Project root for checking if the package is installed locally. */\n private projectRoot: string,\n /** Info on the external package. */\n private pkg: {\n /** NPM package name. */\n name: string;\n /** Required semver range, ex: `^1.0.0`. */\n versionRange: string;\n },\n /** A function used to create the installation prompt message. */\n private promptMessage: (pkgName: string) => string\n ) {}\n\n /** Resolve the globally or locally installed instance, or prompt to install. */\n async resolveAsync({\n prefersGlobalInstall,\n ...options\n }: ResolvePromptOptions = {}): Promise<TModule> {\n try {\n return (\n this.getVersioned() ??\n this.installAsync({\n ...options,\n shouldGloballyInstall: prefersGlobalInstall,\n })\n );\n } catch (error: any) {\n if (error instanceof ExternalModuleVersionError) {\n // If the module version in not compliant with the version range,\n // we should prompt the user to install the package where it already exists.\n return this.installAsync({\n ...options,\n shouldGloballyInstall: error.shouldGloballyInstall ?? prefersGlobalInstall,\n });\n }\n throw error;\n }\n }\n\n /** Prompt the user to install the package and try again. */\n async installAsync({\n shouldPrompt = true,\n autoInstall,\n shouldGloballyInstall,\n }: InstallPromptOptions = {}): Promise<TModule> {\n const packageName = [this.pkg.name, this.pkg.versionRange].join('@');\n if (!autoInstall) {\n // Delay the prompt so it doesn't conflict with other dev tool logs\n await delayAsync(100);\n }\n const answer =\n autoInstall ||\n (shouldPrompt &&\n (await confirmAsync({\n message: this.promptMessage(packageName),\n initial: true,\n })));\n if (answer) {\n Log.log(`Installing ${packageName}...`);\n\n // Always use npm for global installs\n const packageManager = shouldGloballyInstall\n ? new PackageManager.NpmPackageManager({\n cwd: this.projectRoot,\n log: Log.log,\n silent: !(env.EXPO_DEBUG || env.CI),\n })\n : PackageManager.createForProject(this.projectRoot, {\n silent: !(env.EXPO_DEBUG || env.CI),\n });\n\n try {\n if (shouldGloballyInstall) {\n await packageManager.addGlobalAsync([packageName]);\n } else {\n await packageManager.addDevAsync([packageName]);\n }\n Log.log(`Installed ${packageName}`);\n } catch (error: any) {\n error.message = `Failed to install ${packageName} ${\n shouldGloballyInstall ? 'globally' : 'locally'\n }: ${error.message}`;\n throw error;\n }\n return await this.resolveAsync({ shouldPrompt: false });\n }\n\n throw new CommandError('EXTERNAL_MODULE_AVAILABILITY', `Install ${packageName} and try again`);\n }\n\n /** Get the module. */\n get(): TModule | null {\n try {\n return this.getVersioned();\n } catch {\n return null;\n }\n }\n\n /** Get the module, throws if the module is not versioned correctly. */\n getVersioned(): TModule | null {\n this.instance ??= this._resolveModule(true) ?? this._resolveModule(false);\n return this.instance;\n }\n\n /** Exposed for testing. */\n _require(moduleId: string): any {\n return require(moduleId);\n }\n\n /** Resolve a copy that's installed in the project. Exposed for testing. */\n _resolveLocal(moduleId: string): string {\n return resolveFrom(this.projectRoot, moduleId);\n }\n\n /** Resolve a copy that's installed globally. Exposed for testing. */\n _resolveGlobal(moduleId: string): string {\n return requireGlobal.resolve(moduleId);\n }\n\n /** Resolve the module and verify the version. Exposed for testing. */\n _resolveModule(isLocal: boolean): TModule | null {\n const resolver = isLocal ? this._resolveLocal.bind(this) : this._resolveGlobal.bind(this);\n try {\n const packageJsonPath = resolver(`${this.pkg.name}/package.json`);\n const packageJson = this._require(packageJsonPath);\n if (packageJson) {\n if (semver.satisfies(packageJson.version, this.pkg.versionRange)) {\n const modulePath = resolver(this.pkg.name);\n const requiredModule = this._require(modulePath);\n if (requiredModule == null) {\n throw new CommandError(\n 'EXTERNAL_MODULE_EXPORT',\n `${this.pkg.name} exports a nullish value, which is not allowed.`\n );\n }\n return requiredModule;\n }\n throw new ExternalModuleVersionError(\n `Required module '${this.pkg.name}@${packageJson.version}' does not satisfy ${this.pkg.versionRange}. Installed at: ${packageJsonPath}`,\n !isLocal\n );\n }\n } catch (error: any) {\n if (error instanceof CommandError) {\n throw error;\n } else if (error.code !== 'MODULE_NOT_FOUND') {\n debug('Failed to resolve module', error.message);\n }\n }\n return null;\n }\n}\n"],"names":["ExternalModule","ExternalModuleVersionError","debug","require","CommandError","constructor","message","shouldGloballyInstall","projectRoot","pkg","promptMessage","instance","resolveAsync","prefersGlobalInstall","options","getVersioned","installAsync","error","shouldPrompt","autoInstall","packageName","name","versionRange","join","delayAsync","answer","confirmAsync","initial","Log","log","packageManager","PackageManager","NpmPackageManager","cwd","silent","env","EXPO_DEBUG","CI","createForProject","addGlobalAsync","addDevAsync","get","_resolveModule","_require","moduleId","_resolveLocal","resolveFrom","_resolveGlobal","requireGlobal","resolve","isLocal","resolver","bind","packageJsonPath","packageJson","semver","satisfies","version","modulePath","requiredModule","code"],"mappings":";;;;;;;;;;;IA4CaA,cAAc;eAAdA;;IA9BAC,0BAA0B;eAA1BA;;;;iEAdmB;;;;;;;gEACN;;;;;;;gEACF;;;;;;;gEACL;;;;;;6DAEE;uBACM;qBACP;wBACS;yBACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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YACnB,IAAIA,iBAAiBb,oBAAY,EAAE;gBACjC,MAAMa;YACR,OAAO,IAAIA,MAAM2C,IAAI,KAAK,oBAAoB;gBAC5C1D,MAAM,4BAA4Be,MAAMX,OAAO;YACjD;QACF;QACA,OAAO;IACT;AACF"}
@@ -123,7 +123,7 @@ const expoStart = async (argv)=>{
123
123
  `--localhost Same as --host localhost`,
124
124
  ``,
125
125
  `--offline Skip network requests and use anonymous manifest signatures`,
126
- `--https Start the dev server with https protocol`,
126
+ (0, _chalk().default)`--https Start the dev server with https protocol. {bold Deprecated in favor of --tunnel}`,
127
127
  `--scheme <scheme> Custom URI protocol to use when launching an app`,
128
128
  (0, _chalk().default)`-p, --port <number> Port to start the dev server on (does not apply to web or tunnel). {dim Default: 8081}`,
129
129
  ``,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/start/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertArgs, getProjectRoot, printHelp } from '../utils/args';\nimport { logCmdError } from '../utils/errors';\n\nexport const expoStart: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--clear': Boolean,\n '--max-workers': Number,\n '--no-dev': Boolean,\n '--minify': Boolean,\n '--https': Boolean,\n '--private-key-path': String,\n '--port': Number,\n '--dev-client': Boolean,\n '--scheme': String,\n '--android': Boolean,\n '--ios': Boolean,\n '--web': Boolean,\n '--host': String,\n '--tunnel': Boolean,\n '--lan': Boolean,\n '--localhost': Boolean,\n '--offline': Boolean,\n '--go': Boolean,\n // Aliases\n '-h': '--help',\n '-c': '--clear',\n '-p': '--port',\n '-a': '--android',\n '-i': '--ios',\n '-w': '--web',\n '-m': '--host',\n '-d': '--dev-client',\n '-g': '--go',\n // Alias for adding interop with the Metro docs and RedBox errors.\n '--reset-cache': '--clear',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Start a local dev server for the app`,\n chalk`npx expo start {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `-a, --android Open on a connected Android device`,\n `-i, --ios Open in an iOS simulator`,\n `-w, --web Open in a web browser`,\n ``,\n chalk`-d, --dev-client Launch in a custom native app`,\n chalk`-g, --go Launch in Expo Go`,\n ``,\n `-c, --clear Clear the bundler cache`,\n `--max-workers <number> Maximum number of tasks to allow Metro to spawn`,\n `--no-dev Bundle in production mode`,\n `--minify Minify JavaScript`,\n ``,\n chalk`-m, --host <string> Dev server hosting type. {dim Default: lan}`,\n chalk` {bold lan}: Use the local network`,\n chalk` {bold tunnel}: Use any network by tunnel through ngrok`,\n chalk` {bold localhost}: Connect to the dev server over localhost`,\n `--tunnel Same as --host tunnel`,\n `--lan Same as --host lan`,\n `--localhost Same as --host localhost`,\n ``,\n `--offline Skip network requests and use anonymous manifest signatures`,\n `--https Start the dev server with https protocol`,\n `--scheme <scheme> Custom URI protocol to use when launching an app`,\n chalk`-p, --port <number> Port to start the dev server on (does not apply to web or tunnel). {dim Default: 8081}`,\n ``,\n chalk`--private-key-path <path> Path to private key for code signing. {dim Default: \"private-key.pem\" in the same directory as the certificate specified by the expo-updates configuration in app.json.}`,\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n const projectRoot = getProjectRoot(args);\n\n // NOTE(cedric): `./resolveOptions` loads the expo config when using dev clients, this needs to be initialized before that\n const { setNodeEnv, loadEnvFiles } = await import('../utils/nodeEnv.js');\n setNodeEnv(!args['--no-dev'] ? 'development' : 'production');\n loadEnvFiles(projectRoot);\n\n const { resolveOptionsAsync } = await import('./resolveOptions.js');\n const options = await resolveOptionsAsync(projectRoot, args).catch(logCmdError);\n\n if (options.offline) {\n const { disableNetwork } = await import('../api/settings.js');\n disableNetwork();\n }\n\n const { startAsync } = await import('./startAsync.js');\n return startAsync(projectRoot, options, { webOnly: false }).catch(logCmdError);\n};\n"],"names":["expoStart","argv","args","assertArgs","Boolean","Number","String","printHelp","chalk","join","projectRoot","getProjectRoot","setNodeEnv","loadEnvFiles","resolveOptionsAsync","options","catch","logCmdError","offline","disableNetwork","startAsync","webOnly"],"mappings":";;;;;+BAOaA;;;eAAAA;;;;gEANK;;;;;;sBAGoC;wBAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErB,MAAMA,YAAqB,OAAOC;IACvC,MAAMC,OAAOC,IAAAA,gBAAU,EACrB;QACE,QAAQ;QACR,UAAUC;QACV,WAAWA;QACX,iBAAiBC;QACjB,YAAYD;QACZ,YAAYA;QACZ,WAAWA;QACX,sBAAsBE;QACtB,UAAUD;QACV,gBAAgBD;QAChB,YAAYE;QACZ,aAAaF;QACb,SAASA;QACT,SAASA;QACT,UAAUE;QACV,YAAYF;QACZ,SAASA;QACT,eAAeA;QACf,aAAaA;QACb,QAAQA;QACR,UAAU;QACV,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,kEAAkE;QAClE,iBAAiB;IACnB,GACAH;IAGF,IAAIC,IAAI,CAAC,SAAS,EAAE;QAClBK,IAAAA,eAAS,EACP,CAAC,oCAAoC,CAAC,EACtCC,IAAAA,gBAAK,CAAA,CAAC,0BAA0B,CAAC,EACjC;YACEA,IAAAA,gBAAK,CAAA,CAAC,uGAAuG,CAAC;YAC9G,CAAC,kEAAkE,CAAC;YACpE,CAAC,wDAAwD,CAAC;YAC1D,CAAC,qDAAqD,CAAC;YACvD,EAAE;YACFA,IAAAA,gBAAK,CAAA,CAAC,6DAA6D,CAAC;YACpEA,IAAAA,gBAAK,CAAA,CAAC,iDAAiD,CAAC;YACxD,EAAE;YACF,CAAC,uDAAuD,CAAC;YACzD,CAAC,+EAA+E,CAAC;YACjF,CAAC,yDAAyD,CAAC;YAC3D,CAAC,iDAAiD,CAAC;YACnD,EAAE;YACFA,IAAAA,gBAAK,CAAA,CAAC,2EAA2E,CAAC;YAClFA,IAAAA,gBAAK,CAAA,CAAC,iEAAiE,CAAC;YACxEA,IAAAA,gBAAK,CAAA,CAAC,sFAAsF,CAAC;YAC7FA,IAAAA,gBAAK,CAAA,CAAC,0FAA0F,CAAC;YACjG,CAAC,qDAAqD,CAAC;YACvD,CAAC,kDAAkD,CAAC;YACpD,CAAC,wDAAwD,CAAC;YAC1D,EAAE;YACF,CAAC,2FAA2F,CAAC;YAC7F,CAAC,wEAAwE,CAAC;YAC1E,CAAC,gFAAgF,CAAC;YAClFA,IAAAA,gBAAK,CAAA,CAAC,sHAAsH,CAAC;YAC7H,EAAE;YACFA,IAAAA,gBAAK,CAAA,CAAC,wMAAwM,CAAC;YAC/M,CAAC,0CAA0C,CAAC;SAC7C,CAACC,IAAI,CAAC;IAEX;IAEA,MAAMC,cAAcC,IAAAA,oBAAc,EAACT;IAEnC,0HAA0H;IAC1H,MAAM,EAAEU,UAAU,EAAEC,YAAY,EAAE,GAAG,MAAM,mEAAA,QAAO;IAClDD,WAAW,CAACV,IAAI,CAAC,WAAW,GAAG,gBAAgB;IAC/CW,aAAaH;IAEb,MAAM,EAAEI,mBAAmB,EAAE,GAAG,MAAM,mEAAA,QAAO;IAC7C,MAAMC,UAAU,MAAMD,oBAAoBJ,aAAaR,MAAMc,KAAK,CAACC,mBAAW;IAE9E,IAAIF,QAAQG,OAAO,EAAE;QACnB,MAAM,EAAEC,cAAc,EAAE,GAAG,MAAM,mEAAA,QAAO;QACxCA;IACF;IAEA,MAAM,EAAEC,UAAU,EAAE,GAAG,MAAM,mEAAA,QAAO;IACpC,OAAOA,WAAWV,aAAaK,SAAS;QAAEM,SAAS;IAAM,GAAGL,KAAK,CAACC,mBAAW;AAC/E"}
1
+ {"version":3,"sources":["../../../src/start/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertArgs, getProjectRoot, printHelp } from '../utils/args';\nimport { logCmdError } from '../utils/errors';\n\nexport const expoStart: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--clear': Boolean,\n '--max-workers': Number,\n '--no-dev': Boolean,\n '--minify': Boolean,\n '--https': Boolean,\n '--private-key-path': String,\n '--port': Number,\n '--dev-client': Boolean,\n '--scheme': String,\n '--android': Boolean,\n '--ios': Boolean,\n '--web': Boolean,\n '--host': String,\n '--tunnel': Boolean,\n '--lan': Boolean,\n '--localhost': Boolean,\n '--offline': Boolean,\n '--go': Boolean,\n // Aliases\n '-h': '--help',\n '-c': '--clear',\n '-p': '--port',\n '-a': '--android',\n '-i': '--ios',\n '-w': '--web',\n '-m': '--host',\n '-d': '--dev-client',\n '-g': '--go',\n // Alias for adding interop with the Metro docs and RedBox errors.\n '--reset-cache': '--clear',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Start a local dev server for the app`,\n chalk`npx expo start {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `-a, --android Open on a connected Android device`,\n `-i, --ios Open in an iOS simulator`,\n `-w, --web Open in a web browser`,\n ``,\n chalk`-d, --dev-client Launch in a custom native app`,\n chalk`-g, --go Launch in Expo Go`,\n ``,\n `-c, --clear Clear the bundler cache`,\n `--max-workers <number> Maximum number of tasks to allow Metro to spawn`,\n `--no-dev Bundle in production mode`,\n `--minify Minify JavaScript`,\n ``,\n chalk`-m, --host <string> Dev server hosting type. {dim Default: lan}`,\n chalk` {bold lan}: Use the local network`,\n chalk` {bold tunnel}: Use any network by tunnel through ngrok`,\n chalk` {bold localhost}: Connect to the dev server over localhost`,\n `--tunnel Same as --host tunnel`,\n `--lan Same as --host lan`,\n `--localhost Same as --host localhost`,\n ``,\n `--offline Skip network requests and use anonymous manifest signatures`,\n chalk`--https Start the dev server with https protocol. {bold Deprecated in favor of --tunnel}`,\n `--scheme <scheme> Custom URI protocol to use when launching an app`,\n chalk`-p, --port <number> Port to start the dev server on (does not apply to web or tunnel). {dim Default: 8081}`,\n ``,\n chalk`--private-key-path <path> Path to private key for code signing. {dim Default: \"private-key.pem\" in the same directory as the certificate specified by the expo-updates configuration in app.json.}`,\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n const projectRoot = getProjectRoot(args);\n\n // NOTE(cedric): `./resolveOptions` loads the expo config when using dev clients, this needs to be initialized before that\n const { setNodeEnv, loadEnvFiles } = await import('../utils/nodeEnv.js');\n setNodeEnv(!args['--no-dev'] ? 'development' : 'production');\n loadEnvFiles(projectRoot);\n\n const { resolveOptionsAsync } = await import('./resolveOptions.js');\n const options = await resolveOptionsAsync(projectRoot, args).catch(logCmdError);\n\n if (options.offline) {\n const { disableNetwork } = await import('../api/settings.js');\n disableNetwork();\n }\n\n const { startAsync } = await import('./startAsync.js');\n return startAsync(projectRoot, options, { webOnly: false }).catch(logCmdError);\n};\n"],"names":["expoStart","argv","args","assertArgs","Boolean","Number","String","printHelp","chalk","join","projectRoot","getProjectRoot","setNodeEnv","loadEnvFiles","resolveOptionsAsync","options","catch","logCmdError","offline","disableNetwork","startAsync","webOnly"],"mappings":";;;;;+BAOaA;;;eAAAA;;;;gEANK;;;;;;sBAGoC;wBAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErB,MAAMA,YAAqB,OAAOC;IACvC,MAAMC,OAAOC,IAAAA,gBAAU,EACrB;QACE,QAAQ;QACR,UAAUC;QACV,WAAWA;QACX,iBAAiBC;QACjB,YAAYD;QACZ,YAAYA;QACZ,WAAWA;QACX,sBAAsBE;QACtB,UAAUD;QACV,gBAAgBD;QAChB,YAAYE;QACZ,aAAaF;QACb,SAASA;QACT,SAASA;QACT,UAAUE;QACV,YAAYF;QACZ,SAASA;QACT,eAAeA;QACf,aAAaA;QACb,QAAQA;QACR,UAAU;QACV,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,kEAAkE;QAClE,iBAAiB;IACnB,GACAH;IAGF,IAAIC,IAAI,CAA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b,MAAM,EAAEI,mBAAmB,EAAE,GAAG,MAAM,mEAAA,QAAO;IAC7C,MAAMC,UAAU,MAAMD,oBAAoBJ,aAAaR,MAAMc,KAAK,CAACC,mBAAW;IAE9E,IAAIF,QAAQG,OAAO,EAAE;QACnB,MAAM,EAAEC,cAAc,EAAE,GAAG,MAAM,mEAAA,QAAO;QACxCA;IACF;IAEA,MAAM,EAAEC,UAAU,EAAE,GAAG,MAAM,mEAAA,QAAO;IACpC,OAAOA,WAAWV,aAAaK,SAAS;QAAEM,SAAS;IAAM,GAAGL,KAAK,CAACC,mBAAW;AAC/E"}
@@ -104,7 +104,7 @@ class PlatformManager {
104
104
  const applicationId = props.applicationId ?? await this._getAppIdResolver().getAppIdAsync();
105
105
  const deviceManager = await this.props.resolveDeviceAsync(resolveSettings);
106
106
  if (!await deviceManager.isAppInstalledAndIfSoReturnContainerPathForIOSAsync(applicationId)) {
107
- throw new _errors.CommandError(`No development build (${applicationId}) for this project is installed. ` + `Please make and install a development build on the device first.\n${(0, _link.learnMore)('https://docs.expo.dev/development/build/')}`);
107
+ throw new _errors.CommandError(`No development build (${applicationId}) for this project is installed. ` + `Install a development build on the target device and try again.\n${(0, _link.learnMore)('https://docs.expo.dev/development/build/')}`);
108
108
  }
109
109
  if (!url) {
110
110
  url = this._resolveAlternativeLaunchUrl(applicationId, props);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/start/platforms/PlatformManager.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport assert from 'assert';\nimport chalk from 'chalk';\n\nimport { AppIdResolver } from './AppIdResolver';\nimport { DeviceManager } from './DeviceManager';\nimport { Log } from '../../log';\nimport { CommandError, UnimplementedError } from '../../utils/errors';\nimport { learnMore } from '../../utils/link';\n\nconst debug = require('debug')('expo:start:platforms:platformManager') as typeof console.log;\n\nexport interface BaseOpenInCustomProps {\n scheme?: string;\n applicationId?: string | null;\n}\n\nexport interface BaseResolveDeviceProps<IDevice> {\n /** Should prompt the user to select a device. */\n shouldPrompt?: boolean;\n /** The target device to use. */\n device?: IDevice;\n}\n\n/** An abstract class for launching a URL on a device. */\nexport class PlatformManager<\n IDevice,\n IOpenInCustomProps extends BaseOpenInCustomProps = BaseOpenInCustomProps,\n IResolveDeviceProps extends BaseResolveDeviceProps<IDevice> = BaseResolveDeviceProps<IDevice>,\n> {\n constructor(\n protected projectRoot: string,\n protected props: {\n platform: 'ios' | 'android';\n /** Get the base URL for the dev server hosting this platform manager. */\n getDevServerUrl: () => string | null;\n /** Expo Go URL. */\n getExpoGoUrl: () => string;\n /**\n * Get redirect URL for native disambiguation.\n * @returns a URL like `http://localhost:8081/_expo/loading`\n */\n getRedirectUrl: () => string | null;\n /** Dev Client */\n getCustomRuntimeUrl: (props?: { scheme?: string }) => string | null;\n /** Resolve a device, this function should automatically handle opening the device and asserting any system validations. */\n resolveDeviceAsync: (\n resolver?: Partial<IResolveDeviceProps>\n ) => Promise<DeviceManager<IDevice>>;\n }\n ) {}\n\n /** Returns the project application identifier or asserts that one is not defined. Exposed for testing. */\n _getAppIdResolver(): AppIdResolver {\n throw new UnimplementedError();\n }\n\n /**\n * Get the URL for users intending to launch the project in Expo Go.\n * The CLI will check if the project has a custom dev client and if the redirect page feature is enabled.\n * If both are true, the CLI will return the redirect page URL.\n */\n protected async getExpoGoOrCustomRuntimeUrlAsync(\n deviceManager: DeviceManager<IDevice>\n ): Promise<string> {\n // Determine if the redirect page feature is enabled first since it's the cheapest to check.\n const redirectUrl = this.props.getRedirectUrl();\n if (redirectUrl) {\n // If the redirect page feature is enabled, check if the project has a resolvable native identifier.\n let applicationId;\n try {\n applicationId = await this._getAppIdResolver().getAppIdAsync();\n } catch {\n Log.warn(\n chalk`\\u203A Launching in Expo Go. If you want to use a ` +\n `development build, you need to create and install one first, or, if you already ` +\n chalk`have a build, add {bold ios.bundleIdentifier} and {bold android.package} to ` +\n `this project's app config.\\n${learnMore('https://docs.expo.dev/development/build/')}`\n );\n }\n if (applicationId) {\n debug(`Resolving launch URL: (appId: ${applicationId}, redirect URL: ${redirectUrl})`);\n // NOTE(EvanBacon): This adds considerable amount of time to the command, we should consider removing or memoizing it.\n // Finally determine if the target device has a custom dev client installed.\n if (\n await deviceManager.isAppInstalledAndIfSoReturnContainerPathForIOSAsync(applicationId)\n ) {\n return redirectUrl;\n } else {\n // Log a warning if no development build is available on the device, but the\n // interstitial page would otherwise be opened.\n Log.warn(\n chalk`\\u203A The {bold expo-dev-client} package is installed, but a development build is not ` +\n chalk`installed on {bold ${deviceManager.name}}.\\nLaunching in Expo Go. If you want to use a ` +\n `development build, you need to create and install one first.\\n${learnMore(\n 'https://docs.expo.dev/development/build/'\n )}`\n );\n }\n }\n }\n\n return this.props.getExpoGoUrl();\n }\n\n protected async openProjectInExpoGoAsync(\n resolveSettings: Partial<IResolveDeviceProps> = {}\n ): Promise<{ url: string }> {\n const deviceManager = await this.props.resolveDeviceAsync(resolveSettings);\n const url = await this.getExpoGoOrCustomRuntimeUrlAsync(deviceManager);\n\n deviceManager.logOpeningUrl(url);\n\n // TODO: Expensive, we should only do this once.\n const { exp } = getConfig(this.projectRoot);\n const sdkVersion = exp.sdkVersion;\n assert(sdkVersion, 'sdkVersion should be resolved by getConfig');\n await deviceManager.ensureExpoGoAsync(sdkVersion);\n\n deviceManager.activateWindowAsync();\n await deviceManager.openUrlAsync(url, { appId: deviceManager.getExpoGoAppId() });\n\n return { url };\n }\n\n protected async openProjectInCustomRuntimeAsync(\n resolveSettings: Partial<IResolveDeviceProps> = {},\n props: Partial<IOpenInCustomProps> = {}\n ): Promise<{ url: string }> {\n debug(\n `open custom (${Object.entries(props)\n .map(([k, v]) => `${k}: ${v}`)\n .join(', ')})`\n );\n\n let url = this.props.getCustomRuntimeUrl({ scheme: props.scheme });\n debug(`Opening project in custom runtime: ${url} -- %O`, props);\n // TODO: It's unclear why we do application id validation when opening with a URL\n // NOTE: But having it enables us to allow the deep link to directly open on iOS simulators without the modal.\n const applicationId = props.applicationId ?? (await this._getAppIdResolver().getAppIdAsync());\n\n const deviceManager = await this.props.resolveDeviceAsync(resolveSettings);\n\n if (!(await deviceManager.isAppInstalledAndIfSoReturnContainerPathForIOSAsync(applicationId))) {\n throw new CommandError(\n `No development build (${applicationId}) for this project is installed. ` +\n `Please make and install a development build on the device first.\\n${learnMore(\n 'https://docs.expo.dev/development/build/'\n )}`\n );\n }\n\n if (!url) {\n url = this._resolveAlternativeLaunchUrl(applicationId, props);\n }\n\n deviceManager.logOpeningUrl(url);\n await deviceManager.activateWindowAsync();\n\n await deviceManager.openUrlAsync(url, {\n appId: applicationId,\n });\n\n return {\n url,\n };\n }\n\n /** Launch the project on a device given the input runtime. */\n async openAsync(\n options:\n | {\n runtime: 'expo' | 'web';\n }\n | {\n runtime: 'custom';\n props?: Partial<IOpenInCustomProps>;\n },\n resolveSettings: Partial<IResolveDeviceProps> = {}\n ): Promise<{ url: string }> {\n debug(\n `open (runtime: ${options.runtime}, platform: ${this.props.platform}, device: %O, shouldPrompt: ${resolveSettings.shouldPrompt})`,\n resolveSettings.device\n );\n if (options.runtime === 'expo') {\n return this.openProjectInExpoGoAsync(resolveSettings);\n } else if (options.runtime === 'web') {\n return this.openWebProjectAsync(resolveSettings);\n } else if (options.runtime === 'custom') {\n return this.openProjectInCustomRuntimeAsync(resolveSettings, options.props);\n } else {\n throw new CommandError(`Invalid runtime target: ${options.runtime}`);\n }\n }\n\n /** Open the current web project (Webpack) in a device . */\n private async openWebProjectAsync(resolveSettings: Partial<IResolveDeviceProps> = {}): Promise<{\n url: string;\n }> {\n const url = this.props.getDevServerUrl();\n assert(url, 'Dev server is not running.');\n\n const deviceManager = await this.props.resolveDeviceAsync(resolveSettings);\n deviceManager.logOpeningUrl(url);\n await deviceManager.activateWindowAsync();\n await deviceManager.openUrlAsync(url);\n\n return { url };\n }\n\n /** If the launch URL cannot be determined (`custom` runtimes) then an alternative string can be provided to open the device. Often a device ID or activity to launch. Exposed for testing. */\n _resolveAlternativeLaunchUrl(\n applicationId: string,\n props: Partial<IOpenInCustomProps> = {}\n ): string {\n throw new UnimplementedError();\n }\n}\n"],"names":["PlatformManager","debug","require","constructor","projectRoot","props","_getAppIdResolver","UnimplementedError","getExpoGoOrCustomRuntimeUrlAsync","deviceManager","redirectUrl","getRedirectUrl","applicationId","getAppIdAsync","Log","warn","chalk","learnMore","isAppInstalledAndIfSoReturnContainerPathForIOSAsync","name","getExpoGoUrl","openProjectInExpoGoAsync","resolveSettings","resolveDeviceAsync","url","logOpeningUrl","exp","getConfig","sdkVersion","assert","ensureExpoGoAsync","activateWindowAsync","openUrlAsync","appId","getExpoGoAppId","openProjectInCustomRuntimeAsync","Object","entries","map","k","v","join","getCustomRuntimeUrl","scheme","CommandError","_resolveAlternativeLaunchUrl","openAsync","options","runtime","platform","shouldPrompt","device","openWebProjectAsync","getDevServerUrl"],"mappings":";;;;+BAyBaA;;;eAAAA;;;;yBAzBa;;;;;;;gEACP;;;;;;;gEACD;;;;;;qBAIE;wBAC6B;sBACvB;;;;;;AAE1B,MAAMC,QAAQC,QAAQ,SAAS;AAexB,MAAMF;IAKXG,YACE,AAAUC,WAAmB,EAC7B,AAAUC,KAiBT,CACD;aAnBUD,cAAAA;aACAC,QAAAA;IAkBT;IAEH,wGAAwG,GACxGC,oBAAmC;QACjC,MAAM,IAAIC,0BAAkB;IAC9B;IAEA;;;;GAIC,GACD,MAAgBC,iCACdC,aAAqC,EACpB;QACjB,4FAA4F;QAC5F,MAAMC,cAAc,IAAI,CAACL,KAAK,CAACM,cAAc;QAC7C,IAAID,aAAa;YACf,oGAAoG;YACpG,IAAIE;YACJ,IAAI;gBACFA,gBAAgB,MAAM,IAAI,CAACN,iBAAiB,GAAGO,aAAa;YAC9D,EAAE,OAAM;gBACNC,QAAG,CAACC,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC,kDAAkD,CAAC,GACvD,CAAC,gFAAgF,CAAC,GAClFA,IAAAA,gBAAK,CAAA,CAAC,4EAA4E,CAAC,GACnF,CAAC,4BAA4B,EAAE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QAAQC,OAAO,KAAK,OAAO;YACpC,OAAO,IAAI,CAACI,mBAAmB,CAAC9B;QAClC,OAAO,IAAIyB,QAAQC,OAAO,KAAK,UAAU;YACvC,OAAO,IAAI,CAACb,+BAA+B,CAACb,iBAAiByB,QAAQ1C,KAAK;QAC5E,OAAO;YACL,MAAM,IAAIuC,oBAAY,CAAC,CAAC,wBAAwB,EAAEG,QAAQC,OAAO,EAAE;QACrE;IACF;IAEA,yDAAyD,GACzD,MAAcI,oBAAoB9B,kBAAgD,CAAC,CAAC,EAEjF;QACD,MAAME,MAAM,IAAI,CAACnB,KAAK,CAACgD,eAAe;QACtCxB,IAAAA,iBAAM,EAACL,KAAK;QAEZ,MAAMf,gBAAgB,MAAM,IAAI,CAACJ,KAAK,CAACkB,kBAAkB,CAACD;QAC1Db,cAAcgB,aAAa,CAACD;QAC5B,MAAMf,cAAcsB,mBAAmB;QACvC,MAAMtB,cAAcuB,YAAY,CAACR;QAEjC,OAAO;YAAEA;QAAI;IACf;IAEA,4LAA4L,GAC5LqB,6BACEjC,aAAqB,EACrBP,QAAqC,CAAC,CAAC,EAC/B;QACR,MAAM,IAAIE,0BAAkB;IAC9B;AACF"}
1
+ {"version":3,"sources":["../../../../src/start/platforms/PlatformManager.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport assert from 'assert';\nimport chalk from 'chalk';\n\nimport { AppIdResolver } from './AppIdResolver';\nimport { DeviceManager } from './DeviceManager';\nimport { Log } from '../../log';\nimport { CommandError, UnimplementedError } from '../../utils/errors';\nimport { learnMore } from '../../utils/link';\n\nconst debug = require('debug')('expo:start:platforms:platformManager') as typeof console.log;\n\nexport interface BaseOpenInCustomProps {\n scheme?: string;\n applicationId?: string | null;\n}\n\nexport interface BaseResolveDeviceProps<IDevice> {\n /** Should prompt the user to select a device. */\n shouldPrompt?: boolean;\n /** The target device to use. */\n device?: IDevice;\n}\n\n/** An abstract class for launching a URL on a device. */\nexport class PlatformManager<\n IDevice,\n IOpenInCustomProps extends BaseOpenInCustomProps = BaseOpenInCustomProps,\n IResolveDeviceProps extends BaseResolveDeviceProps<IDevice> = BaseResolveDeviceProps<IDevice>,\n> {\n constructor(\n protected projectRoot: string,\n protected props: {\n platform: 'ios' | 'android';\n /** Get the base URL for the dev server hosting this platform manager. */\n getDevServerUrl: () => string | null;\n /** Expo Go URL. */\n getExpoGoUrl: () => string;\n /**\n * Get redirect URL for native disambiguation.\n * @returns a URL like `http://localhost:8081/_expo/loading`\n */\n getRedirectUrl: () => string | null;\n /** Dev Client */\n getCustomRuntimeUrl: (props?: { scheme?: string }) => string | null;\n /** Resolve a device, this function should automatically handle opening the device and asserting any system validations. */\n resolveDeviceAsync: (\n resolver?: Partial<IResolveDeviceProps>\n ) => Promise<DeviceManager<IDevice>>;\n }\n ) {}\n\n /** Returns the project application identifier or asserts that one is not defined. Exposed for testing. */\n _getAppIdResolver(): AppIdResolver {\n throw new UnimplementedError();\n }\n\n /**\n * Get the URL for users intending to launch the project in Expo Go.\n * The CLI will check if the project has a custom dev client and if the redirect page feature is enabled.\n * If both are true, the CLI will return the redirect page URL.\n */\n protected async getExpoGoOrCustomRuntimeUrlAsync(\n deviceManager: DeviceManager<IDevice>\n ): Promise<string> {\n // Determine if the redirect page feature is enabled first since it's the cheapest to check.\n const redirectUrl = this.props.getRedirectUrl();\n if (redirectUrl) {\n // If the redirect page feature is enabled, check if the project has a resolvable native identifier.\n let applicationId;\n try {\n applicationId = await this._getAppIdResolver().getAppIdAsync();\n } catch {\n Log.warn(\n chalk`\\u203A Launching in Expo Go. If you want to use a ` +\n `development build, you need to create and install one first, or, if you already ` +\n chalk`have a build, add {bold ios.bundleIdentifier} and {bold android.package} to ` +\n `this project's app config.\\n${learnMore('https://docs.expo.dev/development/build/')}`\n );\n }\n if (applicationId) {\n debug(`Resolving launch URL: (appId: ${applicationId}, redirect URL: ${redirectUrl})`);\n // NOTE(EvanBacon): This adds considerable amount of time to the command, we should consider removing or memoizing it.\n // Finally determine if the target device has a custom dev client installed.\n if (\n await deviceManager.isAppInstalledAndIfSoReturnContainerPathForIOSAsync(applicationId)\n ) {\n return redirectUrl;\n } else {\n // Log a warning if no development build is available on the device, but the\n // interstitial page would otherwise be opened.\n Log.warn(\n chalk`\\u203A The {bold expo-dev-client} package is installed, but a development build is not ` +\n chalk`installed on {bold ${deviceManager.name}}.\\nLaunching in Expo Go. If you want to use a ` +\n `development build, you need to create and install one first.\\n${learnMore(\n 'https://docs.expo.dev/development/build/'\n )}`\n );\n }\n }\n }\n\n return this.props.getExpoGoUrl();\n }\n\n protected async openProjectInExpoGoAsync(\n resolveSettings: Partial<IResolveDeviceProps> = {}\n ): Promise<{ url: string }> {\n const deviceManager = await this.props.resolveDeviceAsync(resolveSettings);\n const url = await this.getExpoGoOrCustomRuntimeUrlAsync(deviceManager);\n\n deviceManager.logOpeningUrl(url);\n\n // TODO: Expensive, we should only do this once.\n const { exp } = getConfig(this.projectRoot);\n const sdkVersion = exp.sdkVersion;\n assert(sdkVersion, 'sdkVersion should be resolved by getConfig');\n await deviceManager.ensureExpoGoAsync(sdkVersion);\n\n deviceManager.activateWindowAsync();\n await deviceManager.openUrlAsync(url, { appId: deviceManager.getExpoGoAppId() });\n\n return { url };\n }\n\n protected async openProjectInCustomRuntimeAsync(\n resolveSettings: Partial<IResolveDeviceProps> = {},\n props: Partial<IOpenInCustomProps> = {}\n ): Promise<{ url: string }> {\n debug(\n `open custom (${Object.entries(props)\n .map(([k, v]) => `${k}: ${v}`)\n .join(', ')})`\n );\n\n let url = this.props.getCustomRuntimeUrl({ scheme: props.scheme });\n debug(`Opening project in custom runtime: ${url} -- %O`, props);\n // TODO: It's unclear why we do application id validation when opening with a URL\n // NOTE: But having it enables us to allow the deep link to directly open on iOS simulators without the modal.\n const applicationId = props.applicationId ?? (await this._getAppIdResolver().getAppIdAsync());\n\n const deviceManager = await this.props.resolveDeviceAsync(resolveSettings);\n\n if (!(await deviceManager.isAppInstalledAndIfSoReturnContainerPathForIOSAsync(applicationId))) {\n throw new CommandError(\n `No development build (${applicationId}) for this project is installed. ` +\n `Install a development build on the target device and try again.\\n${learnMore(\n 'https://docs.expo.dev/development/build/'\n )}`\n );\n }\n\n if (!url) {\n url = this._resolveAlternativeLaunchUrl(applicationId, props);\n }\n\n deviceManager.logOpeningUrl(url);\n await deviceManager.activateWindowAsync();\n\n await deviceManager.openUrlAsync(url, {\n appId: applicationId,\n });\n\n return {\n url,\n };\n }\n\n /** Launch the project on a device given the input runtime. */\n async openAsync(\n options:\n | {\n runtime: 'expo' | 'web';\n }\n | {\n runtime: 'custom';\n props?: Partial<IOpenInCustomProps>;\n },\n resolveSettings: Partial<IResolveDeviceProps> = {}\n ): Promise<{ url: string }> {\n debug(\n `open (runtime: ${options.runtime}, platform: ${this.props.platform}, device: %O, shouldPrompt: ${resolveSettings.shouldPrompt})`,\n resolveSettings.device\n );\n if (options.runtime === 'expo') {\n return this.openProjectInExpoGoAsync(resolveSettings);\n } else if (options.runtime === 'web') {\n return this.openWebProjectAsync(resolveSettings);\n } else if (options.runtime === 'custom') {\n return this.openProjectInCustomRuntimeAsync(resolveSettings, options.props);\n } else {\n throw new CommandError(`Invalid runtime target: ${options.runtime}`);\n }\n }\n\n /** Open the current web project (Webpack) in a device . */\n private async openWebProjectAsync(resolveSettings: Partial<IResolveDeviceProps> = {}): Promise<{\n url: string;\n }> {\n const url = this.props.getDevServerUrl();\n assert(url, 'Dev server is not running.');\n\n const deviceManager = await this.props.resolveDeviceAsync(resolveSettings);\n deviceManager.logOpeningUrl(url);\n await deviceManager.activateWindowAsync();\n await deviceManager.openUrlAsync(url);\n\n return { url };\n }\n\n /** If the launch URL cannot be determined (`custom` runtimes) then an alternative string can be provided to open the device. Often a device ID or activity to launch. Exposed for testing. */\n _resolveAlternativeLaunchUrl(\n applicationId: string,\n props: Partial<IOpenInCustomProps> = {}\n ): string {\n throw new UnimplementedError();\n }\n}\n"],"names":["PlatformManager","debug","require","constructor","projectRoot","props","_getAppIdResolver","UnimplementedError","getExpoGoOrCustomRuntimeUrlAsync","deviceManager","redirectUrl","getRedirectUrl","applicationId","getAppIdAsync","Log","warn","chalk","learnMore","isAppInstalledAndIfSoReturnContainerPathForIOSAsync","name","getExpoGoUrl","openProjectInExpoGoAsync","resolveSettings","resolveDeviceAsync","url","logOpeningUrl","exp","getConfig","sdkVersion","assert","ensureExpoGoAsync","activateWindowAsync","openUrlAsync","appId","getExpoGoAppId","openProjectInCustomRuntimeAsync","Object","entries","map","k","v","join","getCustomRuntimeUrl","scheme","CommandError","_resolveAlternativeLaunchUrl","openAsync","options","runtime","platform","shouldPrompt","device","openWebProjectAsync","getDevServerUrl"],"mappings":";;;;+BAyBaA;;;eAAAA;;;;yBAzBa;;;;;;;gEACP;;;;;;;gEACD;;;;;;qBAIE;wBAC6B;sBACvB;;;;;;AAE1B,MAAMC,QAAQC,QAAQ,SAAS;AAexB,MAAMF;IAKXG,YACE,AAAUC,WAAmB,EAC7B,AAAUC,KAiBT,CACD;aAnBUD,cAAAA;aACAC,QAAAA;IAkBT;IAEH,wGAAwG,GACxGC,oBAAmC;QACjC,MAAM,IAAIC,0BAAkB;IAC9B;IAEA;;;;GAIC,GACD,MAAgBC,iCACdC,aAAqC,EACpB;QACjB,4FAA4F;QAC5F,MAAMC,cAAc,IAAI,CAACL,KAAK,CAACM,cAAc;QAC7C,IAAID,aAAa;YACf,oGAAoG;YACpG,IAAIE;YACJ,IAAI;gBACFA,gBAAgB,MAAM,IAAI,CAACN,iBAAiB,GAAGO,aAAa;YAC9D,EAAE,OAAM;gBACNC,QAAG,CAACC,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC,kDAAkD,CAAC,GACvD,CAAC,gFAAgF,CAAC,GAClFA,IAAAA,gBAAK,CAAA,CAAC,4EAA4E,CAAC,GACnF,CAAC,4BAA4B,EAAEC,IAAAA,eAAS,EAAC,6CAA6C;YAE5F;YACA,IAAIL,eAAe;gBACjBX,MAAM,CAAC,8BAA8B,EAAEW,cAAc,gBAAgB,EAAEF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YACvC,OAAO,IAAI,CAACb,+BAA+B,CAACb,iBAAiByB,QAAQ1C,KAAK;QAC5E,OAAO;YACL,MAAM,IAAIuC,oBAAY,CAAC,CAAC,wBAAwB,EAAEG,QAAQC,OAAO,EAAE;QACrE;IACF;IAEA,yDAAyD,GACzD,MAAcI,oBAAoB9B,kBAAgD,CAAC,CAAC,EAEjF;QACD,MAAME,MAAM,IAAI,CAACnB,KAAK,CAACgD,eAAe;QACtCxB,IAAAA,iBAAM,EAACL,KAAK;QAEZ,MAAMf,gBAAgB,MAAM,IAAI,CAACJ,KAAK,CAACkB,kBAAkB,CAACD;QAC1Db,cAAcgB,aAAa,CAACD;QAC5B,MAAMf,cAAcsB,mBAAmB;QACvC,MAAMtB,cAAcuB,YAAY,CAACR;QAEjC,OAAO;YAAEA;QAAI;IACf;IAEA,4LAA4L,GAC5LqB,6BACEjC,aAAqB,EACrBP,QAAqC,CAAC,CAAC,EAC/B;QACR,MAAM,IAAIE,0BAAkB;IAC9B;AACF"}
@@ -60,7 +60,7 @@ class AndroidPlatformManager extends _PlatformManager.PlatformManager {
60
60
  debug(`Opening custom runtime using launch activity: ${launchActivity} --`, options.props);
61
61
  const deviceManager = await this.props.resolveDeviceAsync(resolveSettings);
62
62
  if (!await deviceManager.isAppInstalledAndIfSoReturnContainerPathForIOSAsync(customAppId)) {
63
- throw new _errors.CommandError(`No development build (${customAppId}) for this project is installed. ` + `Please make and install a development build on the device first.\n${(0, _link.learnMore)('https://docs.expo.dev/development/build/')}`);
63
+ throw new _errors.CommandError(`No development build (${customAppId}) for this project is installed. ` + `Install a development build on the target device and try again.\n${(0, _link.learnMore)('https://docs.expo.dev/development/build/')}`);
64
64
  }
65
65
  deviceManager.logOpeningUrl(url ?? launchActivity);
66
66
  await deviceManager.activateWindowAsync();