@expo/cli 1.0.0-canary-20250404-87e2506 → 1.0.0-canary-20250630-547cd82

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 +8 -2
  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
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/platforms/android/AndroidPlatformManager.ts"],"sourcesContent":["import { AndroidAppIdResolver } from './AndroidAppIdResolver';\nimport { AndroidDeviceManager } from './AndroidDeviceManager';\nimport { Device } from './adb';\nimport { startAdbReverseAsync } from './adbReverse';\nimport { CommandError } from '../../../utils/errors';\nimport { memoize } from '../../../utils/fn';\nimport { learnMore } from '../../../utils/link';\nimport { hasDirectDevClientDependency } from '../../detectDevClient';\nimport { AppIdResolver } from '../AppIdResolver';\nimport { BaseOpenInCustomProps, BaseResolveDeviceProps, PlatformManager } from '../PlatformManager';\n\nconst debug = require('debug')(\n 'expo:start:platforms:platformManager:android'\n) as typeof console.log;\n\nexport interface AndroidOpenInCustomProps extends BaseOpenInCustomProps {\n /**\n * The Android app intent to launch through `adb shell am start -n <launchActivity>`.\n */\n launchActivity?: string;\n /**\n * The custom app id to launch, provided through `--app-id`.\n * By default, the app id is identical to the package name.\n * When using product flavors, the app id might be customized.\n */\n customAppId?: string;\n}\n\nexport class AndroidPlatformManager extends PlatformManager<Device, AndroidOpenInCustomProps> {\n /** The last used custom launch props, should be reused whenever launching custom runtime without launch props */\n private lastCustomRuntimeLaunchProps?: AndroidOpenInCustomProps;\n /** Memoized method to detect if dev client is installed */\n private hasDevClientInstalled: () => boolean;\n\n constructor(\n protected projectRoot: string,\n protected port: number,\n options: {\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 /** Get redirect URL for native disambiguation. */\n getRedirectUrl: () => string | null;\n /** Dev Client URL. */\n getCustomRuntimeUrl: (props?: { scheme?: string }) => string | null;\n }\n ) {\n super(projectRoot, {\n platform: 'android',\n ...options,\n resolveDeviceAsync: AndroidDeviceManager.resolveAsync,\n });\n\n this.hasDevClientInstalled = memoize(hasDirectDevClientDependency.bind(this, projectRoot));\n }\n\n async openAsync(\n options:\n | { runtime: 'expo' | 'web' }\n | { runtime: 'custom'; props?: Partial<AndroidOpenInCustomProps> },\n resolveSettings?: Partial<BaseResolveDeviceProps<Device>>\n ): Promise<{ url: string }> {\n await startAdbReverseAsync([this.port]);\n\n if (options.runtime === 'custom') {\n // Store the resolved launch properties for future \"openAsync\" request.\n // This reuses the same launch properties when opening through the CLI interface (pressing `a`).\n if (options.props) {\n this.lastCustomRuntimeLaunchProps = options.props;\n } else if (!options.props && this.lastCustomRuntimeLaunchProps) {\n options.props = this.lastCustomRuntimeLaunchProps;\n }\n\n // Handle projects that need to launch with a custom app id and launch activity\n return this.openProjectInCustomRuntimeWithCustomAppIdAsync(options, resolveSettings);\n }\n\n return super.openAsync(options, resolveSettings);\n }\n\n /**\n * Launch the custom runtime project, using the provided custom app id and launch activity.\n * Instead of \"open url\", this will launch the activity directly.\n * If dev client is installed, it will also pass the dev client URL to the activity.\n */\n async openProjectInCustomRuntimeWithCustomAppIdAsync(\n options: { runtime: 'custom'; props?: Partial<AndroidOpenInCustomProps> },\n resolveSettings?: Partial<BaseResolveDeviceProps<Device>>\n ) {\n // Fall back to default dev client URL open behavior if no custom app id or launch activity is provided\n if (!options.props?.customAppId || !options.props?.launchActivity) {\n return super.openProjectInCustomRuntimeAsync(resolveSettings, options.props);\n }\n\n const { customAppId, launchActivity } = options.props;\n const url = this.hasDevClientInstalled()\n ? (this.props.getCustomRuntimeUrl({ scheme: options.props.scheme }) ?? undefined)\n : undefined;\n\n debug(`Opening custom runtime using launch activity: ${launchActivity} --`, options.props);\n\n const deviceManager = (await this.props.resolveDeviceAsync(\n resolveSettings\n )) as AndroidDeviceManager;\n\n if (!(await deviceManager.isAppInstalledAndIfSoReturnContainerPathForIOSAsync(customAppId))) {\n throw new CommandError(\n `No development build (${customAppId}) 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 deviceManager.logOpeningUrl(url ?? launchActivity);\n await deviceManager.activateWindowAsync();\n await deviceManager.launchActivityAsync(launchActivity, url);\n\n return { url: url ?? launchActivity };\n }\n\n _getAppIdResolver(): AppIdResolver {\n return new AndroidAppIdResolver(this.projectRoot);\n }\n\n _resolveAlternativeLaunchUrl(\n applicationId: string,\n props?: Partial<AndroidOpenInCustomProps>\n ): string {\n return props?.launchActivity ?? `${applicationId}/.MainActivity`;\n }\n}\n"],"names":["AndroidPlatformManager","debug","require","PlatformManager","constructor","projectRoot","port","options","platform","resolveDeviceAsync","AndroidDeviceManager","resolveAsync","hasDevClientInstalled","memoize","hasDirectDevClientDependency","bind","openAsync","resolveSettings","startAdbReverseAsync","runtime","props","lastCustomRuntimeLaunchProps","openProjectInCustomRuntimeWithCustomAppIdAsync","customAppId","launchActivity","openProjectInCustomRuntimeAsync","url","getCustomRuntimeUrl","scheme","undefined","deviceManager","isAppInstalledAndIfSoReturnContainerPathForIOSAsync","CommandError","learnMore","logOpeningUrl","activateWindowAsync","launchActivityAsync","_getAppIdResolver","AndroidAppIdResolver","_resolveAlternativeLaunchUrl","applicationId"],"mappings":";;;;+BA4BaA;;;eAAAA;;;sCA5BwB;sCACA;4BAEA;wBACR;oBACL;sBACE;iCACmB;iCAEkC;AAE/E,MAAMC,QAAQC,QAAQ,SACpB;AAgBK,MAAMF,+BAA+BG,gCAAe;IAMzDC,YACE,AAAUC,WAAmB,EAC7B,AAAUC,IAAY,EACtBC,OASC,CACD;QACA,KAAK,CAACF,aAAa;YACjBG,UAAU;YACV,GAAGD,OAAO;YACVE,oBAAoBC,0CAAoB,CAACC,YAAY;QACvD,SAjBUN,cAAAA,kBACAC,OAAAA;QAkBV,IAAI,CAACM,qBAAqB,GAAGC,IAAAA,WAAO,EAACC,6CAA4B,CAACC,IAAI,CAAC,IAAI,EAAEV;IAC/E;IAEA,MAAMW,UACJT,OAEoE,EACpEU,eAAyD,EAC/B;QAC1B,MAAMC,IAAAA,gCAAoB,EAAC;YAAC,IAAI,CAACZ,IAAI;SAAC;QAEtC,IAAIC,QAAQY,OAAO,KAAK,UAAU;YAChC,uEAAuE;YACvE,gGAAgG;YAChG,IAAIZ,QAAQa,KAAK,EAAE;gBACjB,IAAI,CAACC,4BAA4B,GAAGd,QAAQa,KAAK;YACnD,OAAO,IAAI,CAACb,QAAQa,KAAK,IAA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AI,CAACjC,WAAW;IAClD;IAEAkC,6BACEC,aAAqB,EACrBpB,KAAyC,EACjC;QACR,OAAOA,CAAAA,yBAAAA,MAAOI,cAAc,KAAI,GAAGgB,cAAc,cAAc,CAAC;IAClE;AACF"}
1
+ {"version":3,"sources":["../../../../../src/start/platforms/android/AndroidPlatformManager.ts"],"sourcesContent":["import { AndroidAppIdResolver } from './AndroidAppIdResolver';\nimport { AndroidDeviceManager } from './AndroidDeviceManager';\nimport { Device } from './adb';\nimport { startAdbReverseAsync } from './adbReverse';\nimport { CommandError } from '../../../utils/errors';\nimport { memoize } from '../../../utils/fn';\nimport { learnMore } from '../../../utils/link';\nimport { hasDirectDevClientDependency } from '../../detectDevClient';\nimport { AppIdResolver } from '../AppIdResolver';\nimport { BaseOpenInCustomProps, BaseResolveDeviceProps, PlatformManager } from '../PlatformManager';\n\nconst debug = require('debug')(\n 'expo:start:platforms:platformManager:android'\n) as typeof console.log;\n\nexport interface AndroidOpenInCustomProps extends BaseOpenInCustomProps {\n /**\n * The Android app intent to launch through `adb shell am start -n <launchActivity>`.\n */\n launchActivity?: string;\n /**\n * The custom app id to launch, provided through `--app-id`.\n * By default, the app id is identical to the package name.\n * When using product flavors, the app id might be customized.\n */\n customAppId?: string;\n}\n\nexport class AndroidPlatformManager extends PlatformManager<Device, AndroidOpenInCustomProps> {\n /** The last used custom launch props, should be reused whenever launching custom runtime without launch props */\n private lastCustomRuntimeLaunchProps?: AndroidOpenInCustomProps;\n /** Memoized method to detect if dev client is installed */\n private hasDevClientInstalled: () => boolean;\n\n constructor(\n protected projectRoot: string,\n protected port: number,\n options: {\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 /** Get redirect URL for native disambiguation. */\n getRedirectUrl: () => string | null;\n /** Dev Client URL. */\n getCustomRuntimeUrl: (props?: { scheme?: string }) => string | null;\n }\n ) {\n super(projectRoot, {\n platform: 'android',\n ...options,\n resolveDeviceAsync: AndroidDeviceManager.resolveAsync,\n });\n\n this.hasDevClientInstalled = memoize(hasDirectDevClientDependency.bind(this, projectRoot));\n }\n\n async openAsync(\n options:\n | { runtime: 'expo' | 'web' }\n | { runtime: 'custom'; props?: Partial<AndroidOpenInCustomProps> },\n resolveSettings?: Partial<BaseResolveDeviceProps<Device>>\n ): Promise<{ url: string }> {\n await startAdbReverseAsync([this.port]);\n\n if (options.runtime === 'custom') {\n // Store the resolved launch properties for future \"openAsync\" request.\n // This reuses the same launch properties when opening through the CLI interface (pressing `a`).\n if (options.props) {\n this.lastCustomRuntimeLaunchProps = options.props;\n } else if (!options.props && this.lastCustomRuntimeLaunchProps) {\n options.props = this.lastCustomRuntimeLaunchProps;\n }\n\n // Handle projects that need to launch with a custom app id and launch activity\n return this.openProjectInCustomRuntimeWithCustomAppIdAsync(options, resolveSettings);\n }\n\n return super.openAsync(options, resolveSettings);\n }\n\n /**\n * Launch the custom runtime project, using the provided custom app id and launch activity.\n * Instead of \"open url\", this will launch the activity directly.\n * If dev client is installed, it will also pass the dev client URL to the activity.\n */\n async openProjectInCustomRuntimeWithCustomAppIdAsync(\n options: { runtime: 'custom'; props?: Partial<AndroidOpenInCustomProps> },\n resolveSettings?: Partial<BaseResolveDeviceProps<Device>>\n ) {\n // Fall back to default dev client URL open behavior if no custom app id or launch activity is provided\n if (!options.props?.customAppId || !options.props?.launchActivity) {\n return super.openProjectInCustomRuntimeAsync(resolveSettings, options.props);\n }\n\n const { customAppId, launchActivity } = options.props;\n const url = this.hasDevClientInstalled()\n ? (this.props.getCustomRuntimeUrl({ scheme: options.props.scheme }) ?? undefined)\n : undefined;\n\n debug(`Opening custom runtime using launch activity: ${launchActivity} --`, options.props);\n\n const deviceManager = (await this.props.resolveDeviceAsync(\n resolveSettings\n )) as AndroidDeviceManager;\n\n if (!(await deviceManager.isAppInstalledAndIfSoReturnContainerPathForIOSAsync(customAppId))) {\n throw new CommandError(\n `No development build (${customAppId}) 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 deviceManager.logOpeningUrl(url ?? launchActivity);\n await deviceManager.activateWindowAsync();\n await deviceManager.launchActivityAsync(launchActivity, url);\n\n return { url: url ?? launchActivity };\n }\n\n _getAppIdResolver(): AppIdResolver {\n return new AndroidAppIdResolver(this.projectRoot);\n }\n\n _resolveAlternativeLaunchUrl(\n applicationId: string,\n props?: Partial<AndroidOpenInCustomProps>\n ): string {\n return props?.launchActivity ?? `${applicationId}/.MainActivity`;\n }\n}\n"],"names":["AndroidPlatformManager","debug","require","PlatformManager","constructor","projectRoot","port","options","platform","resolveDeviceAsync","AndroidDeviceManager","resolveAsync","hasDevClientInstalled","memoize","hasDirectDevClientDependency","bind","openAsync","resolveSettings","startAdbReverseAsync","runtime","props","lastCustomRuntimeLaunchProps","openProjectInCustomRuntimeWithCustomAppIdAsync","customAppId","launchActivity","openProjectInCustomRuntimeAsync","url","getCustomRuntimeUrl","scheme","undefined","deviceManager","isAppInstalledAndIfSoReturnContainerPathForIOSAsync","CommandError","learnMore","logOpeningUrl","activateWindowAsync","launchActivityAsync","_getAppIdResolver","AndroidAppIdResolver","_resolveAlternativeLaunchUrl","applicationId"],"mappings":";;;;+BA4BaA;;;eAAAA;;;sCA5BwB;sCACA;4BAEA;wBACR;oBACL;sBACE;iCACmB;iCAEkC;AAE/E,MAAMC,QAAQC,QAAQ,SACpB;AAgBK,MAAMF,+BAA+BG,gCAAe;IAMzDC,YACE,AAAUC,WAAmB,EAC7B,AAAUC,IAAY,EACtBC,OASC,CACD;QACA,KAAK,CAACF,aAAa;YACjBG,UAAU;YACV,GAAGD,OAAO;YACVE,oBAAoBC,0CAAoB,CAACC,YAAY;QACvD,SAjBUN,cAAAA,kBACAC,OAAAA;QAkBV,IAAI,CAACM,qBAAqB,GAAGC,IAAAA,WAAO,EAACC,6CAA4B,CAACC,IAAI,CAAC,IAAI,EAAEV;IAC/E;IAEA,MAAMW,UACJ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EAAET,YAAY,iCAAiC,CAAC,GACrE,CAAC,iEAAiE,EAAEU,IAAAA,eAAS,EAC3E,6CACC;QAET;QAEAH,cAAcI,aAAa,CAACR,OAAOF;QACnC,MAAMM,cAAcK,mBAAmB;QACvC,MAAML,cAAcM,mBAAmB,CAACZ,gBAAgBE;QAExD,OAAO;YAAEA,KAAKA,OAAOF;QAAe;IACtC;IAEAa,oBAAmC;QACjC,OAAO,IAAIC,0CAAoB,CAAC,IAAI,CAACjC,WAAW;IAClD;IAEAkC,6BACEC,aAAqB,EACrBpB,KAAyC,EACjC;QACR,OAAOA,CAAAA,yBAAAA,MAAOI,cAAc,KAAI,GAAGgB,cAAc,cAAc,CAAC;IAClE;AACF"}
@@ -28,7 +28,7 @@ async function getDevicesAsync() {
28
28
  if (!allDevices.length) {
29
29
  throw new _errors.CommandError([
30
30
  `No Android connected device found, and no emulators could be started automatically.`,
31
- `Please connect a device or create an emulator (https://docs.expo.dev/workflow/android-studio-emulator).`,
31
+ `Connect a device or create an emulator (https://docs.expo.dev/workflow/android-studio-emulator).`,
32
32
  `Then follow the instructions here to enable USB debugging:`,
33
33
  `https://developer.android.com/studio/run/device.html#developer-device-options. If you are using Genymotion go to Settings -> ADB, select "Use custom Android SDK tools", and point it at your Android SDK directory.`
34
34
  ].join('\n'));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/platforms/android/getDevices.ts"],"sourcesContent":["import { Device, getAttachedDevicesAsync } from './adb';\nimport { listAvdsAsync } from './emulator';\nimport { CommandError } from '../../../utils/errors';\n\n/** Get a list of all devices including offline emulators. Asserts if no devices are available. */\nexport async function getDevicesAsync(): Promise<Device[]> {\n const bootedDevices = await getAttachedDevicesAsync();\n\n const data = await listAvdsAsync();\n const connectedNames = bootedDevices.map(({ name }) => name);\n\n const offlineEmulators = data\n .filter(({ name }) => !connectedNames.includes(name))\n .map(({ name, type }) => {\n return {\n name,\n type,\n isBooted: false,\n // TODO: Are emulators always authorized?\n isAuthorized: true,\n };\n });\n\n const allDevices = bootedDevices.concat(offlineEmulators);\n\n if (!allDevices.length) {\n throw new CommandError(\n [\n `No Android connected device found, and no emulators could be started automatically.`,\n `Please connect a device or create an emulator (https://docs.expo.dev/workflow/android-studio-emulator).`,\n `Then follow the instructions here to enable USB debugging:`,\n `https://developer.android.com/studio/run/device.html#developer-device-options. If you are using Genymotion go to Settings -> ADB, select \"Use custom Android SDK tools\", and point it at your Android SDK directory.`,\n ].join('\\n')\n );\n }\n\n return allDevices;\n}\n"],"names":["getDevicesAsync","bootedDevices","getAttachedDevicesAsync","data","listAvdsAsync","connectedNames","map","name","offlineEmulators","filter","includes","type","isBooted","isAuthorized","allDevices","concat","length","CommandError","join"],"mappings":";;;;+BAKsBA;;;eAAAA;;;qBAL0B;0BAClB;wBACD;AAGtB,eAAeA;IACpB,MAAMC,gBAAgB,MAAMC,IAAAA,4BAAuB;IAEnD,MAAMC,OAAO,MAAMC,IAAAA,uBAAa;IAChC,MAAMC,iBAAiBJ,cAAcK,GAAG,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAKA;IAEvD,MAAMC,mBAAmBL,KACtBM,MAAM,CAAC,CAAC,EAAEF,IAAI,EAAE,GAAK,CAACF,eAAeK,QAAQ,CAACH,OAC9CD,GAAG,CAAC,CAAC,EAAEC,IAAI,EAAEI,IAAI,EAAE;QAClB,OAAO;YACLJ;YACAI;YACAC,UAAU;YACV,yCAAyC;YACzCC,cAAc;QAChB;IACF;IAEF,MAAMC,aAAab,cAAcc,MAAM,CAACP;IAExC,IAAI,CAACM,WAAWE,MAAM,EAAE;QACtB,MAAM,IAAIC,oBAAY,CACpB;YACE,CAAC,mFAAmF,CAAC;YACrF,CAAC,uGAAuG,CAAC;YACzG,CAAC,0DAA0D,CAAC;YAC5D,CAAC,oNAAoN,CAAC;SACvN,CAACC,IAAI,CAAC;IAEX;IAEA,OAAOJ;AACT"}
1
+ {"version":3,"sources":["../../../../../src/start/platforms/android/getDevices.ts"],"sourcesContent":["import { Device, getAttachedDevicesAsync } from './adb';\nimport { listAvdsAsync } from './emulator';\nimport { CommandError } from '../../../utils/errors';\n\n/** Get a list of all devices including offline emulators. Asserts if no devices are available. */\nexport async function getDevicesAsync(): Promise<Device[]> {\n const bootedDevices = await getAttachedDevicesAsync();\n\n const data = await listAvdsAsync();\n const connectedNames = bootedDevices.map(({ name }) => name);\n\n const offlineEmulators = data\n .filter(({ name }) => !connectedNames.includes(name))\n .map(({ name, type }) => {\n return {\n name,\n type,\n isBooted: false,\n // TODO: Are emulators always authorized?\n isAuthorized: true,\n };\n });\n\n const allDevices = bootedDevices.concat(offlineEmulators);\n\n if (!allDevices.length) {\n throw new CommandError(\n [\n `No Android connected device found, and no emulators could be started automatically.`,\n `Connect a device or create an emulator (https://docs.expo.dev/workflow/android-studio-emulator).`,\n `Then follow the instructions here to enable USB debugging:`,\n `https://developer.android.com/studio/run/device.html#developer-device-options. If you are using Genymotion go to Settings -> ADB, select \"Use custom Android SDK tools\", and point it at your Android SDK directory.`,\n ].join('\\n')\n );\n }\n\n return allDevices;\n}\n"],"names":["getDevicesAsync","bootedDevices","getAttachedDevicesAsync","data","listAvdsAsync","connectedNames","map","name","offlineEmulators","filter","includes","type","isBooted","isAuthorized","allDevices","concat","length","CommandError","join"],"mappings":";;;;+BAKsBA;;;eAAAA;;;qBAL0B;0BAClB;wBACD;AAGtB,eAAeA;IACpB,MAAMC,gBAAgB,MAAMC,IAAAA,4BAAuB;IAEnD,MAAMC,OAAO,MAAMC,IAAAA,uBAAa;IAChC,MAAMC,iBAAiBJ,cAAcK,GAAG,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAKA;IAEvD,MAAMC,mBAAmBL,KACtBM,MAAM,CAAC,CAAC,EAAEF,IAAI,EAAE,GAAK,CAACF,eAAeK,QAAQ,CAACH,OAC9CD,GAAG,CAAC,CAAC,EAAEC,IAAI,EAAEI,IAAI,EAAE;QAClB,OAAO;YACLJ;YACAI;YACAC,UAAU;YACV,yCAAyC;YACzCC,cAAc;QAChB;IACF;IAEF,MAAMC,aAAab,cAAcc,MAAM,CAACP;IAExC,IAAI,CAACM,WAAWE,MAAM,EAAE;QACtB,MAAM,IAAIC,oBAAY,CACpB;YACE,CAAC,mFAAmF,CAAC;YACrF,CAAC,gGAAgG,CAAC;YAClG,CAAC,0DAA0D,CAAC;YAC5D,CAAC,oNAAoN,CAAC;SACvN,CAACC,IAAI,CAAC;IAEX;IAEA,OAAOJ;AACT"}
@@ -194,7 +194,7 @@ class AppleDeviceManager extends _DeviceManager.DeviceManager {
194
194
  let errorMessage = `Couldn't open iOS app with ID "${appId}" on device "${this.name}".`;
195
195
  if (error instanceof _errors.CommandError && error.code === 'APP_NOT_INSTALLED') {
196
196
  if (appId === EXPO_GO_BUNDLE_IDENTIFIER) {
197
- errorMessage = `Couldn't open Expo Go app on device "${this.name}". Please install.`;
197
+ errorMessage = `Couldn't open Expo Go app on device "${this.name}". Install it: https://expo.dev/go.`;
198
198
  } else {
199
199
  errorMessage += `\nThe app might not be installed, try installing it with: ${_chalk().default.bold(`npx expo run:ios -d ${this.device.udid}`)}`;
200
200
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/platforms/ios/AppleDeviceManager.ts"],"sourcesContent":["import * as osascript from '@expo/osascript';\nimport assert from 'assert';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { assertSystemRequirementsAsync } from './assertSystemRequirements';\nimport { ensureSimulatorAppRunningAsync } from './ensureSimulatorAppRunning';\nimport {\n getBestBootedSimulatorAsync,\n getBestUnbootedSimulatorAsync,\n getSelectableSimulatorsAsync,\n} from './getBestSimulator';\nimport { promptAppleDeviceAsync } from './promptAppleDevice';\nimport * as SimControl from './simctl';\nimport { delayAsync, waitForActionAsync } from '../../../utils/delay';\nimport { CommandError } from '../../../utils/errors';\nimport { parsePlistAsync } from '../../../utils/plist';\nimport { validateUrl } from '../../../utils/url';\nimport { DeviceManager } from '../DeviceManager';\nimport { ExpoGoInstaller } from '../ExpoGoInstaller';\nimport { BaseResolveDeviceProps } from '../PlatformManager';\n\nconst debug = require('debug')('expo:start:platforms:ios:AppleDeviceManager') as typeof console.log;\n\nconst EXPO_GO_BUNDLE_IDENTIFIER = 'host.exp.Exponent';\n\n/**\n * Ensure a simulator is booted and the Simulator app is opened.\n * This is where any timeout related error handling should live.\n */\nexport async function ensureSimulatorOpenAsync(\n { udid, osType }: Partial<Pick<SimControl.Device, 'udid' | 'osType'>> = {},\n tryAgain: boolean = true\n): Promise<SimControl.Device> {\n // Use a default simulator if none was specified\n if (!udid) {\n // If a simulator is open, side step the entire booting sequence.\n const simulatorOpenedByApp = await getBestBootedSimulatorAsync({ osType });\n if (simulatorOpenedByApp) {\n return simulatorOpenedByApp;\n }\n\n // Otherwise, find the best possible simulator from user defaults and continue\n const bestUdid = await getBestUnbootedSimulatorAsync({ osType });\n if (!bestUdid) {\n throw new CommandError('No simulators found.');\n }\n udid = bestUdid;\n }\n\n const bootedDevice = await waitForActionAsync({\n action: () => {\n // Just for the type check.\n assert(udid);\n return SimControl.bootAsync({ udid });\n },\n });\n\n if (!bootedDevice) {\n // Give it a second chance, this might not be needed but it could potentially lead to a better UX on slower devices.\n if (tryAgain) {\n return await ensureSimulatorOpenAsync({ udid, osType }, false);\n }\n // TODO: We should eliminate all needs for a timeout error, it's bad UX to get an error about the simulator not starting while the user can clearly see it starting on their slow computer.\n throw new CommandError(\n 'SIMULATOR_TIMEOUT',\n `Simulator didn't boot fast enough. Try opening Simulator first, then running your app.`\n );\n }\n return bootedDevice;\n}\nexport class AppleDeviceManager extends DeviceManager<SimControl.Device> {\n static assertSystemRequirementsAsync = assertSystemRequirementsAsync;\n\n static async resolveAsync({\n device,\n shouldPrompt,\n }: BaseResolveDeviceProps<\n Partial<Pick<SimControl.Device, 'udid' | 'osType'>>\n > = {}): Promise<AppleDeviceManager> {\n if (shouldPrompt) {\n const devices = await getSelectableSimulatorsAsync(device);\n device = await promptAppleDeviceAsync(devices, device?.osType);\n }\n\n const booted = await ensureSimulatorOpenAsync(device);\n return new AppleDeviceManager(booted);\n }\n\n get name() {\n return this.device.name;\n }\n\n get identifier(): string {\n return this.device.udid;\n }\n\n async getAppVersionAsync(\n appId: string,\n { containerPath }: { containerPath?: string } = {}\n ): Promise<string | null> {\n return await SimControl.getInfoPlistValueAsync(this.device, {\n appId,\n key: 'CFBundleShortVersionString',\n containerPath,\n });\n }\n\n async startAsync(): Promise<SimControl.Device> {\n return ensureSimulatorOpenAsync({ osType: this.device.osType, udid: this.device.udid });\n }\n\n async launchApplicationIdAsync(appId: string) {\n try {\n const result = await SimControl.openAppIdAsync(this.device, {\n appId,\n });\n if (result.status === 0) {\n await this.activateWindowAsync();\n } else {\n throw new CommandError(result.stderr);\n }\n } catch (error: any) {\n let errorMessage = `Couldn't open iOS app with ID \"${appId}\" on device \"${this.name}\".`;\n if (error instanceof CommandError && error.code === 'APP_NOT_INSTALLED') {\n if (appId === EXPO_GO_BUNDLE_IDENTIFIER) {\n errorMessage = `Couldn't open Expo Go app on device \"${this.name}\". Please install.`;\n } else {\n errorMessage += `\\nThe app might not be installed, try installing it with: ${chalk.bold(\n `npx expo run:ios -d ${this.device.udid}`\n )}`;\n }\n }\n if (error.stderr) {\n errorMessage += chalk.gray(`\\n${error.stderr}`);\n } else if (error.message) {\n errorMessage += chalk.gray(`\\n${error.message}`);\n }\n throw new CommandError(errorMessage);\n }\n }\n\n async installAppAsync(filePath: string) {\n await SimControl.installAsync(this.device, {\n filePath,\n });\n\n await this.waitForAppInstalledAsync(await this.getApplicationIdFromBundle(filePath));\n }\n\n private async getApplicationIdFromBundle(filePath: string): Promise<string> {\n debug('getApplicationIdFromBundle:', filePath);\n const builtInfoPlistPath = path.join(filePath, 'Info.plist');\n if (fs.existsSync(builtInfoPlistPath)) {\n const { CFBundleIdentifier } = await parsePlistAsync(builtInfoPlistPath);\n debug('getApplicationIdFromBundle: using built Info.plist', CFBundleIdentifier);\n return CFBundleIdentifier;\n }\n debug('getApplicationIdFromBundle: no Info.plist found');\n return EXPO_GO_BUNDLE_IDENTIFIER;\n }\n\n private async waitForAppInstalledAsync(applicationId: string): Promise<boolean> {\n while (true) {\n if (await this.isAppInstalledAndIfSoReturnContainerPathForIOSAsync(applicationId)) {\n return true;\n }\n await delayAsync(100);\n }\n }\n\n async uninstallAppAsync(appId: string) {\n await SimControl.uninstallAsync(this.device, {\n appId,\n });\n }\n\n async isAppInstalledAndIfSoReturnContainerPathForIOSAsync(appId: string) {\n return (\n (await SimControl.getContainerPathAsync(this.device, {\n appId,\n })) ?? false\n );\n }\n\n async openUrlAsync(url: string, options: { appId?: string } = {}) {\n // Non-compliant URLs will be treated as application identifiers.\n if (!validateUrl(url, { requireProtocol: true })) {\n return await this.launchApplicationIdAsync(url);\n }\n\n try {\n await SimControl.openUrlAsync(this.device, { url, appId: options.appId });\n } catch (error: any) {\n // 194 means the device does not conform to a given URL, in this case we'll assume that the desired app is not installed.\n if (error.status === 194) {\n // An error was encountered processing the command (domain=NSOSStatusErrorDomain, code=-10814):\n // The operation couldn’t be completed. (OSStatus error -10814.)\n //\n // This can be thrown when no app conforms to the URI scheme that we attempted to open.\n throw new CommandError(\n 'APP_NOT_INSTALLED',\n `Device ${this.device.name} (${this.device.udid}) has no app to handle the URI: ${url}`\n );\n }\n throw error;\n }\n }\n\n async activateWindowAsync() {\n await ensureSimulatorAppRunningAsync(this.device);\n // TODO: Focus the individual window\n await osascript.execAsync(`tell application \"Simulator\" to activate`);\n }\n\n getExpoGoAppId(): string {\n return EXPO_GO_BUNDLE_IDENTIFIER;\n }\n\n async ensureExpoGoAsync(sdkVersion: string): Promise<boolean> {\n const installer = new ExpoGoInstaller('ios', EXPO_GO_BUNDLE_IDENTIFIER, sdkVersion);\n return installer.ensureAsync(this);\n }\n}\n"],"names":["AppleDeviceManager","ensureSimulatorOpenAsync","debug","require","EXPO_GO_BUNDLE_IDENTIFIER","udid","osType","tryAgain","simulatorOpenedByApp","getBestBootedSimulatorAsync","bestUdid","getBestUnbootedSimulatorAsync","CommandError","bootedDevice","waitForActionAsync","action","assert","SimControl","bootAsync","DeviceManager","assertSystemRequirementsAsync","resolveAsync","device","shouldPrompt","devices","getSelectableSimulatorsAsync","promptAppleDeviceAsync","booted","name","identifier","getAppVersionAsync","appId","containerPath","getInfoPlistValueAsync","key","startAsync","launchApplicationIdAsync","result","openAppIdAsync","status","activateWindowAsync","stderr","error","errorMessage","code","chalk","bold","gray","message","installAppAsync","filePath","installAsync","waitForAppInstalledAsync","getApplicationIdFromBundle","builtInfoPlistPath","path","join","fs","existsSync","CFBundleIdentifier","parsePlistAsync","applicationId","isAppInstalledAndIfSoReturnContainerPathForIOSAsync","delayAsync","uninstallAppAsync","uninstallAsync","getContainerPathAsync","openUrlAsync","url","options","validateUrl","requireProtocol","ensureSimulatorAppRunningAsync","osascript","execAsync","getExpoGoAppId","ensureExpoGoAsync","sdkVersion","installer","ExpoGoInstaller","ensureAsync"],"mappings":";;;;;;;;;;;IAwEaA,kBAAkB;eAAlBA;;IAzCSC,wBAAwB;eAAxBA;;;;iEA/BK;;;;;;;gEACR;;;;;;;gEACD;;;;;;;gEACH;;;;;;;gEACE;;;;;;0CAE6B;2CACC;kCAKxC;mCACgC;gEACX;uBACmB;wBAClB;uBACG;qBACJ;+BACE;iCACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGhC,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,MAAMC,4BAA4B;AAM3B,eAAeH,yBACpB,EAAEI,IAAI,EAAEC,MAAM,EAAuD,GAAG,CAAC,CAAC,EAC1EC,WAAoB,IAAI;IAExB,gDAAgD;IAChD,IAAI,CAACF,MAAM;QACT,iEAAiE;QACjE,MAAMG,uBAAuB,MAAMC,IAAAA,6CAA2B,EAAC;YAAEH;QAAO;QACxE,IAAIE,sBAAsB;YACxB,OAAOA;QACT;QAEA,8EAA8E;QAC9E,MAAME,WAAW,MAAMC,IAAAA,+CAA6B,EAAC;YAAEL;QAA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pB,qBACA,CAAC,OAAO,EAAE,IAAI,CAACU,MAAM,CAACM,IAAI,CAAC,EAAE,EAAE,IAAI,CAACN,MAAM,CAACjB,IAAI,CAAC,gCAAgC,EAAE+D,KAAK;YAE3F;YACA,MAAM1B;QACR;IACF;IAEA,MAAMF,sBAAsB;QAC1B,MAAMgC,IAAAA,yDAA8B,EAAC,IAAI,CAAClD,MAAM;QAChD,oCAAoC;QACpC,MAAMmD,aAAUC,SAAS,CAAC,CAAC,wCAAwC,CAAC;IACtE;IAEAC,iBAAyB;QACvB,OAAOvE;IACT;IAEA,MAAMwE,kBAAkBC,UAAkB,EAAoB;QAC5D,MAAMC,YAAY,IAAIC,gCAAe,CAAC,OAAO3E,2BAA2ByE;QACxE,OAAOC,UAAUE,WAAW,CAAC,IAAI;IACnC;AACF"}
1
+ {"version":3,"sources":["../../../../../src/start/platforms/ios/AppleDeviceManager.ts"],"sourcesContent":["import * as osascript from '@expo/osascript';\nimport assert from 'assert';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { assertSystemRequirementsAsync } from './assertSystemRequirements';\nimport { ensureSimulatorAppRunningAsync } from './ensureSimulatorAppRunning';\nimport {\n getBestBootedSimulatorAsync,\n getBestUnbootedSimulatorAsync,\n getSelectableSimulatorsAsync,\n} from './getBestSimulator';\nimport { promptAppleDeviceAsync } from './promptAppleDevice';\nimport * as SimControl from './simctl';\nimport { delayAsync, waitForActionAsync } from '../../../utils/delay';\nimport { CommandError } from '../../../utils/errors';\nimport { parsePlistAsync } from '../../../utils/plist';\nimport { validateUrl } from '../../../utils/url';\nimport { DeviceManager } from '../DeviceManager';\nimport { ExpoGoInstaller } from '../ExpoGoInstaller';\nimport { BaseResolveDeviceProps } from '../PlatformManager';\n\nconst debug = require('debug')('expo:start:platforms:ios:AppleDeviceManager') as typeof console.log;\n\nconst EXPO_GO_BUNDLE_IDENTIFIER = 'host.exp.Exponent';\n\n/**\n * Ensure a simulator is booted and the Simulator app is opened.\n * This is where any timeout related error handling should live.\n */\nexport async function ensureSimulatorOpenAsync(\n { udid, osType }: Partial<Pick<SimControl.Device, 'udid' | 'osType'>> = {},\n tryAgain: boolean = true\n): Promise<SimControl.Device> {\n // Use a default simulator if none was specified\n if (!udid) {\n // If a simulator is open, side step the entire booting sequence.\n const simulatorOpenedByApp = await getBestBootedSimulatorAsync({ osType });\n if (simulatorOpenedByApp) {\n return simulatorOpenedByApp;\n }\n\n // Otherwise, find the best possible simulator from user defaults and continue\n const bestUdid = await getBestUnbootedSimulatorAsync({ osType });\n if (!bestUdid) {\n throw new CommandError('No simulators found.');\n }\n udid = bestUdid;\n }\n\n const bootedDevice = await waitForActionAsync({\n action: () => {\n // Just for the type check.\n assert(udid);\n return SimControl.bootAsync({ udid });\n },\n });\n\n if (!bootedDevice) {\n // Give it a second chance, this might not be needed but it could potentially lead to a better UX on slower devices.\n if (tryAgain) {\n return await ensureSimulatorOpenAsync({ udid, osType }, false);\n }\n // TODO: We should eliminate all needs for a timeout error, it's bad UX to get an error about the simulator not starting while the user can clearly see it starting on their slow computer.\n throw new CommandError(\n 'SIMULATOR_TIMEOUT',\n `Simulator didn't boot fast enough. Try opening Simulator first, then running your app.`\n );\n }\n return bootedDevice;\n}\nexport class AppleDeviceManager extends DeviceManager<SimControl.Device> {\n static assertSystemRequirementsAsync = assertSystemRequirementsAsync;\n\n static async resolveAsync({\n device,\n shouldPrompt,\n }: BaseResolveDeviceProps<\n Partial<Pick<SimControl.Device, 'udid' | 'osType'>>\n > = {}): Promise<AppleDeviceManager> {\n if (shouldPrompt) {\n const devices = await getSelectableSimulatorsAsync(device);\n device = await promptAppleDeviceAsync(devices, device?.osType);\n }\n\n const booted = await ensureSimulatorOpenAsync(device);\n return new AppleDeviceManager(booted);\n }\n\n get name() {\n return this.device.name;\n }\n\n get identifier(): string {\n return this.device.udid;\n }\n\n async getAppVersionAsync(\n appId: string,\n { containerPath }: { containerPath?: string } = {}\n ): Promise<string | null> {\n return await SimControl.getInfoPlistValueAsync(this.device, {\n appId,\n key: 'CFBundleShortVersionString',\n containerPath,\n });\n }\n\n async startAsync(): Promise<SimControl.Device> {\n return ensureSimulatorOpenAsync({ osType: this.device.osType, udid: this.device.udid });\n }\n\n async launchApplicationIdAsync(appId: string) {\n try {\n const result = await SimControl.openAppIdAsync(this.device, {\n appId,\n });\n if (result.status === 0) {\n await this.activateWindowAsync();\n } else {\n throw new CommandError(result.stderr);\n }\n } catch (error: any) {\n let errorMessage = `Couldn't open iOS app with ID \"${appId}\" on device \"${this.name}\".`;\n if (error instanceof CommandError && error.code === 'APP_NOT_INSTALLED') {\n if (appId === EXPO_GO_BUNDLE_IDENTIFIER) {\n errorMessage = `Couldn't open Expo Go app on device \"${this.name}\". Install it: https://expo.dev/go.`;\n } else {\n errorMessage += `\\nThe app might not be installed, try installing it with: ${chalk.bold(\n `npx expo run:ios -d ${this.device.udid}`\n )}`;\n }\n }\n if (error.stderr) {\n errorMessage += chalk.gray(`\\n${error.stderr}`);\n } else if (error.message) {\n errorMessage += chalk.gray(`\\n${error.message}`);\n }\n throw new CommandError(errorMessage);\n }\n }\n\n async installAppAsync(filePath: string) {\n await SimControl.installAsync(this.device, {\n filePath,\n });\n\n await this.waitForAppInstalledAsync(await this.getApplicationIdFromBundle(filePath));\n }\n\n private async getApplicationIdFromBundle(filePath: string): Promise<string> {\n debug('getApplicationIdFromBundle:', filePath);\n const builtInfoPlistPath = path.join(filePath, 'Info.plist');\n if (fs.existsSync(builtInfoPlistPath)) {\n const { CFBundleIdentifier } = await parsePlistAsync(builtInfoPlistPath);\n debug('getApplicationIdFromBundle: using built Info.plist', CFBundleIdentifier);\n return CFBundleIdentifier;\n }\n debug('getApplicationIdFromBundle: no Info.plist found');\n return EXPO_GO_BUNDLE_IDENTIFIER;\n }\n\n private async waitForAppInstalledAsync(applicationId: string): Promise<boolean> {\n while (true) {\n if (await this.isAppInstalledAndIfSoReturnContainerPathForIOSAsync(applicationId)) {\n return true;\n }\n await delayAsync(100);\n }\n }\n\n async uninstallAppAsync(appId: string) {\n await SimControl.uninstallAsync(this.device, {\n appId,\n });\n }\n\n async isAppInstalledAndIfSoReturnContainerPathForIOSAsync(appId: string) {\n return (\n (await SimControl.getContainerPathAsync(this.device, {\n appId,\n })) ?? false\n );\n }\n\n async openUrlAsync(url: string, options: { appId?: string } = {}) {\n // Non-compliant URLs will be treated as application identifiers.\n if (!validateUrl(url, { requireProtocol: true })) {\n return await this.launchApplicationIdAsync(url);\n }\n\n try {\n await SimControl.openUrlAsync(this.device, { url, appId: options.appId });\n } catch (error: any) {\n // 194 means the device does not conform to a given URL, in this case we'll assume that the desired app is not installed.\n if (error.status === 194) {\n // An error was encountered processing the command (domain=NSOSStatusErrorDomain, code=-10814):\n // The operation couldn’t be completed. (OSStatus error -10814.)\n //\n // This can be thrown when no app conforms to the URI scheme that we attempted to open.\n throw new CommandError(\n 'APP_NOT_INSTALLED',\n `Device ${this.device.name} (${this.device.udid}) has no app to handle the URI: ${url}`\n );\n }\n throw error;\n }\n }\n\n async activateWindowAsync() {\n await ensureSimulatorAppRunningAsync(this.device);\n // TODO: Focus the individual window\n await osascript.execAsync(`tell application \"Simulator\" to activate`);\n }\n\n getExpoGoAppId(): string {\n return EXPO_GO_BUNDLE_IDENTIFIER;\n }\n\n async ensureExpoGoAsync(sdkVersion: string): Promise<boolean> {\n const installer = new ExpoGoInstaller('ios', EXPO_GO_BUNDLE_IDENTIFIER, sdkVersion);\n return installer.ensureAsync(this);\n }\n}\n"],"names":["AppleDeviceManager","ensureSimulatorOpenAsync","debug","require","EXPO_GO_BUNDLE_IDENTIFIER","udid","osType","tryAgain","simulatorOpenedByApp","getBestBootedSimulatorAsync","bestUdid","getBestUnbootedSimulatorAsync","CommandError","bootedDevice","waitForActionAsync","action","assert","SimControl","bootAsync","DeviceManager","assertSystemRequirementsAsync","resolveAsync","device","shouldPrompt","devices","getSelectableSimulatorsAsync","promptAppleDeviceAsync","booted","name","identifier","getAppVersionAsync","appId","containerPath","getInfoPlistValueAsync","key","startAsync","launchApplicationIdAsync","result","openAppIdAsync","status","activateWindowAsync","stderr","error","errorMessage","code","chalk","bold","gray","message","installAppAsync","filePath","installAsync","waitForAppInstalledAsync","getApplicationIdFromBundle","builtInfoPlistPath","path","join","fs","existsSync","CFBundleIdentifier","parsePlistAsync","applicationId","isAppInstalledAndIfSoReturnContainerPathForIOSAsync","delayAsync","uninstallAppAsync","uninstallAsync","getContainerPathAsync","openUrlAsync","url","options","validateUrl","requireProtocol","ensureSimulatorAppRunningAsync","osascript","execAsync","getExpoGoAppId","ensureExpoGoAsync","sdkVersion","installer","ExpoGoInstaller","ensureAsync"],"mappings":";;;;;;;;;;;IAwEaA,kBAAkB;eAAlBA;;IAzCSC,wBAAwB;eAAxBA;;;;iEA/BK;;;;;;;gEACR;;;;;;;gEACD;;;;;;;gEACH;;;;;;;gEACE;;;;;;0CAE6B;2CACC;kCAKxC;mCACgC;gEACX;uBACmB;wBAClB;uBACG;qBACJ;+BACE;iCACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGhC,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,MAAMC,4BAA4B;AAM3B,eAAeH,yBACpB,EAAEI,IAAI,EAAEC,MAAM,EAAuD,GAAG,CAAC,CAAC,EAC1EC,WAAoB,IAAI;IAExB,gDAAgD;IAChD,IAAI,CAACF,MAAM;QACT,iEAAiE;QACjE,MAAMG,uBAAuB,MAAMC,IAAAA,6CAA2B,EAAC;YAAEH;QAAO;QACxE,IAAIE,sBAAsB;YACxB,OAAOA;QACT;QAEA,8EAA8E;QAC9E,MAAME,WAAW,MAAMC,IAAAA,+CAA6B,EAAC;YAAEL;QAAO;QAC9D,IAAI,CAACI,UAAU;YACb,MAAM,IAAIE,oBAAY,CAAC;QACzB;QACAP,OAAOK;IACT;IAEA,MAAMG,eAAe,MAAMC,IAAAA,yBAAkB,EAAC;QAC5CC,QAAQ;YACN,2BAA2B;YAC3BC,IAAAA,iBAA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BAAsB;QAC1B,MAAMgC,IAAAA,yDAA8B,EAAC,IAAI,CAAClD,MAAM;QAChD,oCAAoC;QACpC,MAAMmD,aAAUC,SAAS,CAAC,CAAC,wCAAwC,CAAC;IACtE;IAEAC,iBAAyB;QACvB,OAAOvE;IACT;IAEA,MAAMwE,kBAAkBC,UAAkB,EAAoB;QAC5D,MAAMC,YAAY,IAAIC,gCAAe,CAAC,OAAO3E,2BAA2ByE;QACxE,OAAOC,UAAUE,WAAW,CAAC,IAAI;IACnC;AACF"}
@@ -51,7 +51,7 @@ async function xcrunAsync(args, options) {
51
51
  function throwXcrunError(e) {
52
52
  var _e_stderr;
53
53
  if (isLicenseOutOfDate(e.stdout) || isLicenseOutOfDate(e.stderr)) {
54
- throw new _errors.CommandError('XCODE_LICENSE_NOT_ACCEPTED', 'Xcode license is not accepted. Please run `sudo xcodebuild -license`.');
54
+ throw new _errors.CommandError('XCODE_LICENSE_NOT_ACCEPTED', 'Xcode license is not accepted. Run `sudo xcodebuild -license`.');
55
55
  } else if ((_e_stderr = e.stderr) == null ? void 0 : _e_stderr.includes('not a developer tool or in PATH')) {
56
56
  throw new _errors.CommandError('SIMCTL_NOT_AVAILABLE', `You may need to run ${_chalk().default.bold('sudo xcode-select -s /Applications/Xcode.app')} and try again.`);
57
57
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/platforms/ios/xcrun.ts"],"sourcesContent":["import spawnAsync, { SpawnOptions, SpawnResult } from '@expo/spawn-async';\nimport chalk from 'chalk';\n\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')('expo:start:platforms:ios:xcrun') as typeof console.log;\n\nexport function isSpawnResultError(obj: any): obj is Error & SpawnResult {\n return (\n obj &&\n 'message' in obj &&\n obj.status !== undefined &&\n obj.stdout !== undefined &&\n obj.stderr !== undefined\n );\n}\n\nexport async function xcrunAsync(args: (string | undefined)[], options?: SpawnOptions) {\n debug('Running: xcrun ' + args.join(' '));\n try {\n return await spawnAsync('xcrun', args.filter(Boolean) as string[], options);\n } catch (e) {\n throwXcrunError(e);\n }\n}\n\nfunction throwXcrunError(e: any): never {\n if (isLicenseOutOfDate(e.stdout) || isLicenseOutOfDate(e.stderr)) {\n throw new CommandError(\n 'XCODE_LICENSE_NOT_ACCEPTED',\n 'Xcode license is not accepted. Please run `sudo xcodebuild -license`.'\n );\n } else if (e.stderr?.includes('not a developer tool or in PATH')) {\n throw new CommandError(\n 'SIMCTL_NOT_AVAILABLE',\n `You may need to run ${chalk.bold(\n 'sudo xcode-select -s /Applications/Xcode.app'\n )} and try again.`\n );\n }\n // Attempt to craft a better error message...\n if (Array.isArray(e.output)) {\n e.message += '\\n' + e.output.join('\\n').trim();\n } else if (e.stderr) {\n e.message += '\\n' + e.stderr;\n }\n throw e;\n}\n\nfunction isLicenseOutOfDate(text: string) {\n if (!text) {\n return false;\n }\n\n const lower = text.toLowerCase();\n return lower.includes('xcode') && lower.includes('license');\n}\n"],"names":["isSpawnResultError","xcrunAsync","debug","require","obj","status","undefined","stdout","stderr","args","options","join","spawnAsync","filter","Boolean","e","throwXcrunError","isLicenseOutOfDate","CommandError","includes","chalk","bold","Array","isArray","output","message","trim","text","lower","toLowerCase"],"mappings":";;;;;;;;;;;IAOgBA,kBAAkB;eAAlBA;;IAUMC,UAAU;eAAVA;;;;gEAjBgC;;;;;;;gEACpC;;;;;;wBAEW;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAExB,SAASH,mBAAmBI,GAAQ;IACzC,OACEA,OACA,aAAaA,OACbA,IAAIC,MAAM,KAAKC,aACfF,IAAIG,MAAM,KAAKD,aACfF,IAAII,MAAM,KAAKF;AAEnB;AAEO,eAAeL,WAAWQ,IAA4B,EAAEC,OAAsB;IACnFR,MAAM,oBAAoBO,KAAKE,IAAI,CAAC;IACpC,IAAI;QACF,OAAO,MAAMC,IAAAA,qBAAU,EAAC,SAASH,KAAKI,MAAM,CAACC,UAAsBJ;IACrE,EAAE,OAAOK,GAAG;QACVC,gBAAgBD;IAClB;AACF;AAEA,SAASC,gBAAgBD,CAAM;QAMlBA;IALX,IAAIE,mBAAmBF,EAAER,MAAM,KAAKU,mBAAmBF,EAAEP,MAAM,GAAG;QAChE,MAAM,IAAIU,oBAAY,CACpB,8BACA;IAEJ,OAAO,KAAIH,YAAAA,EAAEP,MAAM,qBAARO,UAAUI,QAAQ,CAAC,oCAAoC;QAChE,MAAM,IAAID,oBAAY,CACpB,wBACA,CAAC,oBAAoB,EAAEE,gBAAK,CAACC,IAAI,CAC/B,gDACA,eAAe,CAAC;IAEtB;IACA,6CAA6C;IAC7C,IAAIC,MAAMC,OAAO,CAACR,EAAES,MAAM,GAAG;QAC3BT,EAAEU,OAAO,IAAI,OAAOV,EAAES,MAAM,CAACb,IAAI,CAAC,MAAMe,IAAI;IAC9C,OAAO,IAAIX,EAAEP,MAAM,EAAE;QACnBO,EAAEU,OAAO,IAAI,OAAOV,EAAEP,MAAM;IAC9B;IACA,MAAMO;AACR;AAEA,SAASE,mBAAmBU,IAAY;IACtC,IAAI,CAACA,MAAM;QACT,OAAO;IACT;IAEA,MAAMC,QAAQD,KAAKE,WAAW;IAC9B,OAAOD,MAAMT,QAAQ,CAAC,YAAYS,MAAMT,QAAQ,CAAC;AACnD"}
1
+ {"version":3,"sources":["../../../../../src/start/platforms/ios/xcrun.ts"],"sourcesContent":["import spawnAsync, { SpawnOptions, SpawnResult } from '@expo/spawn-async';\nimport chalk from 'chalk';\n\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')('expo:start:platforms:ios:xcrun') as typeof console.log;\n\nexport function isSpawnResultError(obj: any): obj is Error & SpawnResult {\n return (\n obj &&\n 'message' in obj &&\n obj.status !== undefined &&\n obj.stdout !== undefined &&\n obj.stderr !== undefined\n );\n}\n\nexport async function xcrunAsync(args: (string | undefined)[], options?: SpawnOptions) {\n debug('Running: xcrun ' + args.join(' '));\n try {\n return await spawnAsync('xcrun', args.filter(Boolean) as string[], options);\n } catch (e) {\n throwXcrunError(e);\n }\n}\n\nfunction throwXcrunError(e: any): never {\n if (isLicenseOutOfDate(e.stdout) || isLicenseOutOfDate(e.stderr)) {\n throw new CommandError(\n 'XCODE_LICENSE_NOT_ACCEPTED',\n 'Xcode license is not accepted. Run `sudo xcodebuild -license`.'\n );\n } else if (e.stderr?.includes('not a developer tool or in PATH')) {\n throw new CommandError(\n 'SIMCTL_NOT_AVAILABLE',\n `You may need to run ${chalk.bold(\n 'sudo xcode-select -s /Applications/Xcode.app'\n )} and try again.`\n );\n }\n // Attempt to craft a better error message...\n if (Array.isArray(e.output)) {\n e.message += '\\n' + e.output.join('\\n').trim();\n } else if (e.stderr) {\n e.message += '\\n' + e.stderr;\n }\n throw e;\n}\n\nfunction isLicenseOutOfDate(text: string) {\n if (!text) {\n return false;\n }\n\n const lower = text.toLowerCase();\n return lower.includes('xcode') && lower.includes('license');\n}\n"],"names":["isSpawnResultError","xcrunAsync","debug","require","obj","status","undefined","stdout","stderr","args","options","join","spawnAsync","filter","Boolean","e","throwXcrunError","isLicenseOutOfDate","CommandError","includes","chalk","bold","Array","isArray","output","message","trim","text","lower","toLowerCase"],"mappings":";;;;;;;;;;;IAOgBA,kBAAkB;eAAlBA;;IAUMC,UAAU;eAAVA;;;;gEAjBgC;;;;;;;gEACpC;;;;;;wBAEW;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAExB,SAASH,mBAAmBI,GAAQ;IACzC,OACEA,OACA,aAAaA,OACbA,IAAIC,MAAM,KAAKC,aACfF,IAAIG,MAAM,KAAKD,aACfF,IAAII,MAAM,KAAKF;AAEnB;AAEO,eAAeL,WAAWQ,IAA4B,EAAEC,OAAsB;IACnFR,MAAM,oBAAoBO,KAAKE,IAAI,CAAC;IACpC,IAAI;QACF,OAAO,MAAMC,IAAAA,qBAAU,EAAC,SAASH,KAAKI,MAAM,CAACC,UAAsBJ;IACrE,EAAE,OAAOK,GAAG;QACVC,gBAAgBD;IAClB;AACF;AAEA,SAASC,gBAAgBD,CAAM;QAMlBA;IALX,IAAIE,mBAAmBF,EAAER,MAAM,KAAKU,mBAAmBF,EAAEP,MAAM,GAAG;QAChE,MAAM,IAAIU,oBAAY,CACpB,8BACA;IAEJ,OAAO,KAAIH,YAAAA,EAAEP,MAAM,qBAARO,UAAUI,QAAQ,CAAC,oCAAoC;QAChE,MAAM,IAAID,oBAAY,CACpB,wBACA,CAAC,oBAAoB,EAAEE,gBAAK,CAACC,IAAI,CAC/B,gDACA,eAAe,CAAC;IAEtB;IACA,6CAA6C;IAC7C,IAAIC,MAAMC,OAAO,CAACR,EAAES,MAAM,GAAG;QAC3BT,EAAEU,OAAO,IAAI,OAAOV,EAAES,MAAM,CAACb,IAAI,CAAC,MAAMe,IAAI;IAC9C,OAAO,IAAIX,EAAEP,MAAM,EAAE;QACnBO,EAAEU,OAAO,IAAI,OAAOV,EAAEP,MAAM;IAC9B;IACA,MAAMO;AACR;AAEA,SAASE,mBAAmBU,IAAY;IACtC,IAAI,CAACA,MAAM;QACT,OAAO;IACT;IAEA,MAAMC,QAAQD,KAAKE,WAAW;IAC9B,OAAOD,MAAMT,QAAQ,CAAC,YAAYS,MAAMT,QAAQ,CAAC;AACnD"}
@@ -89,11 +89,16 @@ function ensureDotExpoProjectDirectoryInitialized(projectRoot) {
89
89
  const readmeFilePath = _path().default.resolve(dirPath, 'README.md');
90
90
  if (!_fs().default.existsSync(readmeFilePath)) {
91
91
  _fs().default.writeFileSync(readmeFilePath, `> Why do I have a folder named ".expo" in my project?
92
+
92
93
  The ".expo" folder is created when an Expo project is started using "expo start" command.
94
+
93
95
  > What do the files contain?
96
+
94
97
  - "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
95
98
  - "settings.json": contains the server configuration that is used to serve the application manifest.
99
+
96
100
  > Should I commit the ".expo" folder?
101
+
97
102
  No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
98
103
  Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
99
104
  `);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/start/project/dotExpo.ts"],"sourcesContent":["import JsonFile, { JSONObject } from '@expo/json-file';\nimport fs from 'fs';\nimport path from 'path';\n\n/** Create a set of functions for managing a file in the project's `.expo` directory. */\nexport function createTemporaryProjectFile<T extends JSONObject>(fileName: string, defaults: T) {\n function getFile(projectRoot: string): JsonFile<T> {\n const dotExpoDir = ensureDotExpoProjectDirectoryInitialized(projectRoot);\n return new JsonFile<T>(path.join(dotExpoDir, fileName));\n }\n\n async function readAsync(projectRoot: string): Promise<T> {\n let projectSettings;\n try {\n projectSettings = await getFile(projectRoot).readAsync();\n } catch {\n projectSettings = await getFile(projectRoot).writeAsync(defaults);\n }\n // Set defaults for any missing fields\n return { ...defaults, ...projectSettings };\n }\n\n async function setAsync(projectRoot: string, json: Partial<T>): Promise<T> {\n try {\n return await getFile(projectRoot).mergeAsync(json, {\n cantReadFileDefault: defaults,\n });\n } catch {\n return await getFile(projectRoot).writeAsync({\n ...defaults,\n ...json,\n });\n }\n }\n\n return {\n getFile,\n readAsync,\n setAsync,\n };\n}\n\nfunction getDotExpoProjectDirectory(projectRoot: string): string {\n return path.join(projectRoot, '.expo');\n}\n\nexport function ensureDotExpoProjectDirectoryInitialized(projectRoot: string): string {\n const dirPath = getDotExpoProjectDirectory(projectRoot);\n fs.mkdirSync(dirPath, { recursive: true });\n\n const readmeFilePath = path.resolve(dirPath, 'README.md');\n if (!fs.existsSync(readmeFilePath)) {\n fs.writeFileSync(\n readmeFilePath,\n `> Why do I have a folder named \".expo\" in my project?\nThe \".expo\" folder is created when an Expo project is started using \"expo start\" command.\n> What do the files contain?\n- \"devices.json\": contains information about devices that have recently opened this project. This is used to populate the \"Development sessions\" list in your development builds.\n- \"settings.json\": contains the server configuration that is used to serve the application manifest.\n> Should I commit the \".expo\" folder?\nNo, you should not share the \".expo\" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.\nUpon project creation, the \".expo\" folder is already added to your \".gitignore\" file.\n`\n );\n }\n return dirPath;\n}\n"],"names":["createTemporaryProjectFile","ensureDotExpoProjectDirectoryInitialized","fileName","defaults","getFile","projectRoot","dotExpoDir","JsonFile","path","join","readAsync","projectSettings","writeAsync","setAsync","json","mergeAsync","cantReadFileDefault","getDotExpoProjectDirectory","dirPath","fs","mkdirSync","recursive","readmeFilePath","resolve","existsSync","writeFileSync"],"mappings":";;;;;;;;;;;IAKgBA,0BAA0B;eAA1BA;;IAyCAC,wCAAwC;eAAxCA;;;;gEA9CqB;;;;;;;gEACtB;;;;;;;gEACE;;;;;;;;;;;AAGV,SAASD,2BAAiDE,QAAgB,EAAEC,QAAW;IAC5F,SAASC,QAAQC,WAAmB;QAClC,MAAMC,aAAaL,yCAAyCI;QAC5D,OAAO,IAAIE,CAAAA,WAAO,SAAC,CAAIC,eAAI,CAACC,IAAI,CAACH,YAAYJ;IAC/C;IAEA,eAAeQ,UAAUL,WAAmB;QAC1C,IAAIM;QACJ,IAAI;YACFA,kBAAkB,MAAMP,QAAQC,aAAaK,SAAS;QACxD,EAAE,OAAM;YACNC,kBAAkB,MAAMP,QAAQC,aAAaO,UAAU,CAACT;QAC1D;QACA,sCAAsC;QACtC,OAAO;YAAE,GAAGA,QAAQ;YAAE,GAAGQ,eAAe;QAAC;IAC3C;IAEA,eAAeE,SAASR,WAAmB,EAAES,IAAgB;QAC3D,IAAI;YACF,OAAO,MAAMV,QAAQC,aAAaU,UAAU,CAACD,MAAM;gBACjDE,qBAAqBb;YACvB;QACF,EAAE,OAAM;YACN,OAAO,MAAMC,QAAQC,aAAaO,UAAU,CAAC;gBAC3C,GAAGT,QAAQ;gBACX,GAAGW,IAAI;YACT;QACF;IACF;IAEA,OAAO;QACLV;QACAM;QACAG;IACF;AACF;AAEA,SAASI,2BAA2BZ,WAAmB;IACrD,OAAOG,eAAI,CAACC,IAAI,CAACJ,aAAa;AAChC;AAEO,SAASJ,yCAAyCI,WAAmB;IAC1E,MAAMa,UAAUD,2BAA2BZ;IAC3Cc,aAAE,CAACC,SAAS,CAACF,SAAS;QAAEG,WAAW;IAAK;IAExC,MAAMC,iBAAiBd,eAAI,CAACe,OAAO,CAACL,SAAS;IAC7C,IAAI,CAACC,aAAE,CAACK,UAAU,CAACF,iBAAiB;QAClCH,aAAE,CAACM,aAAa,CACdH,gBACA,CAAC;;;;;;;;AAQP,CAAC;IAEC;IACA,OAAOJ;AACT"}
1
+ {"version":3,"sources":["../../../../src/start/project/dotExpo.ts"],"sourcesContent":["import JsonFile, { JSONObject } from '@expo/json-file';\nimport fs from 'fs';\nimport path from 'path';\n\n/** Create a set of functions for managing a file in the project's `.expo` directory. */\nexport function createTemporaryProjectFile<T extends JSONObject>(fileName: string, defaults: T) {\n function getFile(projectRoot: string): JsonFile<T> {\n const dotExpoDir = ensureDotExpoProjectDirectoryInitialized(projectRoot);\n return new JsonFile<T>(path.join(dotExpoDir, fileName));\n }\n\n async function readAsync(projectRoot: string): Promise<T> {\n let projectSettings;\n try {\n projectSettings = await getFile(projectRoot).readAsync();\n } catch {\n projectSettings = await getFile(projectRoot).writeAsync(defaults);\n }\n // Set defaults for any missing fields\n return { ...defaults, ...projectSettings };\n }\n\n async function setAsync(projectRoot: string, json: Partial<T>): Promise<T> {\n try {\n return await getFile(projectRoot).mergeAsync(json, {\n cantReadFileDefault: defaults,\n });\n } catch {\n return await getFile(projectRoot).writeAsync({\n ...defaults,\n ...json,\n });\n }\n }\n\n return {\n getFile,\n readAsync,\n setAsync,\n };\n}\n\nfunction getDotExpoProjectDirectory(projectRoot: string): string {\n return path.join(projectRoot, '.expo');\n}\n\nexport function ensureDotExpoProjectDirectoryInitialized(projectRoot: string): string {\n const dirPath = getDotExpoProjectDirectory(projectRoot);\n fs.mkdirSync(dirPath, { recursive: true });\n\n const readmeFilePath = path.resolve(dirPath, 'README.md');\n if (!fs.existsSync(readmeFilePath)) {\n fs.writeFileSync(\n readmeFilePath,\n `> Why do I have a folder named \".expo\" in my project?\n\nThe \".expo\" folder is created when an Expo project is started using \"expo start\" command.\n\n> What do the files contain?\n\n- \"devices.json\": contains information about devices that have recently opened this project. This is used to populate the \"Development sessions\" list in your development builds.\n- \"settings.json\": contains the server configuration that is used to serve the application manifest.\n\n> Should I commit the \".expo\" folder?\n\nNo, you should not share the \".expo\" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.\nUpon project creation, the \".expo\" folder is already added to your \".gitignore\" file.\n`\n );\n }\n return dirPath;\n}\n"],"names":["createTemporaryProjectFile","ensureDotExpoProjectDirectoryInitialized","fileName","defaults","getFile","projectRoot","dotExpoDir","JsonFile","path","join","readAsync","projectSettings","writeAsync","setAsync","json","mergeAsync","cantReadFileDefault","getDotExpoProjectDirectory","dirPath","fs","mkdirSync","recursive","readmeFilePath","resolve","existsSync","writeFileSync"],"mappings":";;;;;;;;;;;IAKgBA,0BAA0B;eAA1BA;;IAyCAC,wCAAwC;eAAxCA;;;;gEA9CqB;;;;;;;gEACtB;;;;;;;gEACE;;;;;;;;;;;AAGV,SAASD,2BAAiDE,QAAgB,EAAEC,QAAW;IAC5F,SAASC,QAAQC,WAAmB;QAClC,MAAMC,aAAaL,yCAAyCI;QAC5D,OAAO,IAAIE,CAAAA,WAAO,SAAC,CAAIC,eAAI,CAACC,IAAI,CAACH,YAAYJ;IAC/C;IAEA,eAAeQ,UAAUL,WAAmB;QAC1C,IAAIM;QACJ,IAAI;YACFA,kBAAkB,MAAMP,QAAQC,aAAaK,SAAS;QACxD,EAAE,OAAM;YACNC,kBAAkB,MAAMP,QAAQC,aAAaO,UAAU,CAACT;QAC1D;QACA,sCAAsC;QACtC,OAAO;YAAE,GAAGA,QAAQ;YAAE,GAAGQ,eAAe;QAAC;IAC3C;IAEA,eAAeE,SAASR,WAAmB,EAAES,IAAgB;QAC3D,IAAI;YACF,OAAO,MAAMV,QAAQC,aAAaU,UAAU,CAACD,MAAM;gBACjDE,qBAAqBb;YACvB;QACF,EAAE,OAAM;YACN,OAAO,MAAMC,QAAQC,aAAaO,UAAU,CAAC;gBAC3C,GAAGT,QAAQ;gBACX,GAAGW,IAAI;YACT;QACF;IACF;IAEA,OAAO;QACLV;QACAM;QACAG;IACF;AACF;AAEA,SAASI,2BAA2BZ,WAAmB;IACrD,OAAOG,eAAI,CAACC,IAAI,CAACJ,aAAa;AAChC;AAEO,SAASJ,yCAAyCI,WAAmB;IAC1E,MAAMa,UAAUD,2BAA2BZ;IAC3Cc,aAAE,CAACC,SAAS,CAACF,SAAS;QAAEG,WAAW;IAAK;IAExC,MAAMC,iBAAiBd,eAAI,CAACe,OAAO,CAACL,SAAS;IAC7C,IAAI,CAACC,aAAE,CAACK,UAAU,CAACF,iBAAiB;QAClCH,aAAE,CAACM,aAAa,CACdH,gBACA,CAAC;;;;;;;;;;;;;AAaP,CAAC;IAEC;IACA,OAAOJ;AACT"}
@@ -57,6 +57,9 @@ async function resolveOptionsAsync(projectRoot, args) {
57
57
  localhost: args['--localhost'],
58
58
  tunnel: args['--tunnel']
59
59
  });
60
+ if (args['--https']) {
61
+ _log.Log.warn((0, _chalk().default)`{bold --https} option is deprecated in favor of {bold --tunnel}`);
62
+ }
60
63
  // User can force the default target by passing either `--dev-client` or `--go`. They can also
61
64
  // swap between them during development by pressing `s`.
62
65
  const isUserDefinedDevClient = !!args['--dev-client'] || (args['--go'] == null ? false : !args['--go']);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/start/resolveOptions.ts"],"sourcesContent":["import assert from 'assert';\nimport chalk from 'chalk';\n\nimport { canResolveDevClient, hasDirectDevClientDependency } from './detectDevClient';\nimport { Log } from '../log';\nimport { envIsWebcontainer } from '../utils/env';\nimport { AbortCommandError, CommandError } from '../utils/errors';\nimport { resolvePortAsync } from '../utils/port';\n\nexport type Options = {\n privateKeyPath: string | null;\n android: boolean;\n web: boolean;\n ios: boolean;\n offline: boolean;\n clear: boolean;\n dev: boolean;\n https: boolean;\n maxWorkers: number;\n port: number;\n /** Should instruct the bundler to create minified bundles. */\n minify: boolean;\n devClient: boolean;\n scheme: string | null;\n host: 'localhost' | 'lan' | 'tunnel';\n};\n\nexport async function resolveOptionsAsync(projectRoot: string, args: any): Promise<Options> {\n if (args['--dev-client'] && args['--go']) {\n throw new CommandError('BAD_ARGS', 'Cannot use both --dev-client and --go together.');\n }\n const host = resolveHostType({\n host: args['--host'],\n offline: args['--offline'],\n lan: args['--lan'],\n localhost: args['--localhost'],\n tunnel: args['--tunnel'],\n });\n\n // User can force the default target by passing either `--dev-client` or `--go`. They can also\n // swap between them during development by pressing `s`.\n const isUserDefinedDevClient =\n !!args['--dev-client'] || (args['--go'] == null ? false : !args['--go']);\n\n // If the user didn't specify `--dev-client` or `--go` we check if they have the dev client package\n // in their package.json.\n const isAutoDevClient =\n args['--dev-client'] == null &&\n args['--go'] == null &&\n hasDirectDevClientDependency(projectRoot);\n\n const isDevClient = isAutoDevClient || isUserDefinedDevClient;\n\n const scheme = await resolveSchemeAsync(projectRoot, {\n scheme: args['--scheme'],\n devClient: isDevClient,\n });\n\n return {\n privateKeyPath: args['--private-key-path'] ?? null,\n\n android: !!args['--android'],\n web: !!args['--web'],\n ios: !!args['--ios'],\n offline: !!args['--offline'],\n\n clear: !!args['--clear'],\n dev: !args['--no-dev'],\n https: !!args['--https'],\n maxWorkers: args['--max-workers'],\n port: args['--port'],\n minify: !!args['--minify'],\n\n devClient: isDevClient,\n\n scheme,\n host,\n };\n}\n\nexport async function resolveSchemeAsync(\n projectRoot: string,\n options: { scheme?: string; devClient?: boolean }\n): Promise<string | null> {\n if (typeof options.scheme === 'string') {\n // Use the custom scheme\n return options.scheme ?? null;\n }\n\n if (options.devClient || canResolveDevClient(projectRoot)) {\n const { getOptionalDevClientSchemeAsync } =\n require('../utils/scheme') as typeof import('../utils/scheme');\n // Attempt to find the scheme or warn the user how to setup a custom scheme\n const resolvedScheme = await getOptionalDevClientSchemeAsync(projectRoot);\n if (!resolvedScheme.scheme) {\n if (resolvedScheme.resolution === 'shared') {\n // This can happen if one of the native projects has no URI schemes defined in it.\n // Normally, this should never happen.\n Log.warn(\n chalk`Could not find a shared URI scheme for the dev client between the local {bold /ios} and {bold /android} directories. App launches (QR code, interstitial, terminal keys) may not work as expected. You can configure a custom scheme using the {bold --scheme} option, or by running {bold npx expo prebuild} to regenerate the native directories with URI schemes.`\n );\n } else if (['ios', 'android'].includes(resolvedScheme.resolution)) {\n Log.warn(\n chalk`The {bold /${resolvedScheme.resolution}} project does not contain any URI schemes. Expo CLI will not be able to use links to launch the project. You can configure a custom URI scheme using the {bold --scheme} option.`\n );\n }\n }\n return resolvedScheme.scheme;\n } else {\n // Ensure this is reset when users don't use `--scheme`, `--dev-client` and don't have the `expo-dev-client` package installed.\n return null;\n }\n}\n\n/** Resolve and assert host type options. */\nexport function resolveHostType(options: {\n host?: string;\n offline?: boolean;\n lan?: boolean;\n localhost?: boolean;\n tunnel?: boolean;\n}): 'lan' | 'tunnel' | 'localhost' {\n if (\n [options.offline, options.host, options.lan, options.localhost, options.tunnel].filter((i) => i)\n .length > 1\n ) {\n throw new CommandError(\n 'BAD_ARGS',\n 'Specify at most one of: --offline, --host, --tunnel, --lan, --localhost'\n );\n }\n\n if (options.offline) {\n // Force `lan` in offline mode.\n return 'lan';\n } else if (options.host) {\n assert.match(options.host, /^(lan|tunnel|localhost)$/);\n return options.host as 'lan' | 'tunnel' | 'localhost';\n } else if (options.tunnel) {\n return 'tunnel';\n } else if (options.lan) {\n return 'lan';\n } else if (options.localhost) {\n return 'localhost';\n }\n\n // If no option is provided, and we are running in Stackblitz, enable tunnel by default\n if (envIsWebcontainer()) {\n return 'tunnel';\n }\n\n return 'lan';\n}\n\n/** Resolve the port options for all supported bundlers. */\nexport async function resolvePortsAsync(\n projectRoot: string,\n options: Partial<Pick<Options, 'port' | 'devClient'>>,\n settings: { webOnly?: boolean }\n) {\n const multiBundlerSettings: { webpackPort?: number; metroPort?: number } = {};\n\n if (settings.webOnly) {\n const webpackPort = await resolvePortAsync(projectRoot, {\n defaultPort: options.port,\n // Default web port\n fallbackPort: 19006,\n });\n if (!webpackPort) {\n throw new AbortCommandError();\n }\n multiBundlerSettings.webpackPort = webpackPort;\n } else {\n const fallbackPort = process.env.RCT_METRO_PORT\n ? parseInt(process.env.RCT_METRO_PORT, 10)\n : 8081;\n const metroPort = await resolvePortAsync(projectRoot, {\n defaultPort: options.port,\n fallbackPort,\n });\n if (!metroPort) {\n throw new AbortCommandError();\n }\n multiBundlerSettings.metroPort = metroPort;\n }\n\n return multiBundlerSettings;\n}\n"],"names":["resolveHostType","resolveOptionsAsync","resolvePortsAsync","resolveSchemeAsync","projectRoot","args","CommandError","host","offline","lan","localhost","tunnel","isUserDefinedDevClient","isAutoDevClient","hasDirectDevClientDependency","isDevClient","scheme","devClient","privateKeyPath","android","web","ios","clear","dev","https","maxWorkers","port","minify","options","canResolveDevClient","getOptionalDevClientSchemeAsync","require","resolvedScheme","resolution","Log","warn","chalk","includes","filter","i","length","assert","match","envIsWebcontainer","settings","multiBundlerSettings","webOnly","webpackPort","resolvePortAsync","defaultPort","fallbackPort","AbortCommandError","process","env","RCT_METRO_PORT","parseInt","metroPort"],"mappings":";;;;;;;;;;;IAmHgBA,eAAe;eAAfA;;IAxFMC,mBAAmB;eAAnBA;;IAgIAC,iBAAiB;eAAjBA;;IA3EAC,kBAAkB;eAAlBA;;;;gEAhFH;;;;;;;gEACD;;;;;;iCAEgD;qBAC9C;qBACc;wBACc;sBACf;;;;;;AAoB1B,eAAeF,oBAAoBG,WAAmB,EAAEC,IAAS;IACtE,IAAIA,IAAI,CAAC,eAAe,IAAIA,IAAI,CAAC,OAAO,EAAE;QACxC,MAAM,IAAIC,oBAAY,CAAC,YAAY;IACrC;IACA,MAAMC,OAAOP,gBAAgB;QAC3BO,MAAMF,IAAI,CAAC,SAAS;QACpBG,SAASH,IAAI,CAAC,YAAY;QAC1BI,KAAKJ,IAAI,CAAC,QAAQ;QAClBK,WAAWL,IAAI,CAAC,cAAc;QAC9BM,QAAQN,IAAI,CAAC,WAAW;IAC1B;IAEA,8F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AA+B;IAE/B,MAAMC,uBAAqE,CAAC;IAE5E,IAAID,SAASE,OAAO,EAAE;QACpB,MAAMC,cAAc,MAAMC,IAAAA,sBAAgB,EAAC5C,aAAa;YACtD6C,aAAarB,QAAQF,IAAI;YACzB,mBAAmB;YACnBwB,cAAc;QAChB;QACA,IAAI,CAACH,aAAa;YAChB,MAAM,IAAII,yBAAiB;QAC7B;QACAN,qBAAqBE,WAAW,GAAGA;IACrC,OAAO;QACL,MAAMG,eAAeE,QAAQC,GAAG,CAACC,cAAc,GAC3CC,SAASH,QAAQC,GAAG,CAACC,cAAc,EAAE,MACrC;QACJ,MAAME,YAAY,MAAMR,IAAAA,sBAAgB,EAAC5C,aAAa;YACpD6C,aAAarB,QAAQF,IAAI;YACzBwB;QACF;QACA,IAAI,CAACM,WAAW;YACd,MAAM,IAAIL,yBAAiB;QAC7B;QACAN,qBAAqBW,SAAS,GAAGA;IACnC;IAEA,OAAOX;AACT"}
1
+ {"version":3,"sources":["../../../src/start/resolveOptions.ts"],"sourcesContent":["import assert from 'assert';\nimport chalk from 'chalk';\n\nimport { canResolveDevClient, hasDirectDevClientDependency } from './detectDevClient';\nimport { Log } from '../log';\nimport { envIsWebcontainer } from '../utils/env';\nimport { AbortCommandError, CommandError } from '../utils/errors';\nimport { resolvePortAsync } from '../utils/port';\n\nexport type Options = {\n privateKeyPath: string | null;\n android: boolean;\n web: boolean;\n ios: boolean;\n offline: boolean;\n clear: boolean;\n dev: boolean;\n https: boolean;\n maxWorkers: number;\n port: number;\n /** Should instruct the bundler to create minified bundles. */\n minify: boolean;\n devClient: boolean;\n scheme: string | null;\n host: 'localhost' | 'lan' | 'tunnel';\n};\n\nexport async function resolveOptionsAsync(projectRoot: string, args: any): Promise<Options> {\n if (args['--dev-client'] && args['--go']) {\n throw new CommandError('BAD_ARGS', 'Cannot use both --dev-client and --go together.');\n }\n const host = resolveHostType({\n host: args['--host'],\n offline: args['--offline'],\n lan: args['--lan'],\n localhost: args['--localhost'],\n tunnel: args['--tunnel'],\n });\n\n if (args['--https']) {\n Log.warn(chalk`{bold --https} option is deprecated in favor of {bold --tunnel}`);\n }\n\n // User can force the default target by passing either `--dev-client` or `--go`. They can also\n // swap between them during development by pressing `s`.\n const isUserDefinedDevClient =\n !!args['--dev-client'] || (args['--go'] == null ? false : !args['--go']);\n\n // If the user didn't specify `--dev-client` or `--go` we check if they have the dev client package\n // in their package.json.\n const isAutoDevClient =\n args['--dev-client'] == null &&\n args['--go'] == null &&\n hasDirectDevClientDependency(projectRoot);\n\n const isDevClient = isAutoDevClient || isUserDefinedDevClient;\n\n const scheme = await resolveSchemeAsync(projectRoot, {\n scheme: args['--scheme'],\n devClient: isDevClient,\n });\n\n return {\n privateKeyPath: args['--private-key-path'] ?? null,\n\n android: !!args['--android'],\n web: !!args['--web'],\n ios: !!args['--ios'],\n offline: !!args['--offline'],\n\n clear: !!args['--clear'],\n dev: !args['--no-dev'],\n https: !!args['--https'],\n maxWorkers: args['--max-workers'],\n port: args['--port'],\n minify: !!args['--minify'],\n\n devClient: isDevClient,\n\n scheme,\n host,\n };\n}\n\nexport async function resolveSchemeAsync(\n projectRoot: string,\n options: { scheme?: string; devClient?: boolean }\n): Promise<string | null> {\n if (typeof options.scheme === 'string') {\n // Use the custom scheme\n return options.scheme ?? null;\n }\n\n if (options.devClient || canResolveDevClient(projectRoot)) {\n const { getOptionalDevClientSchemeAsync } =\n require('../utils/scheme') as typeof import('../utils/scheme');\n // Attempt to find the scheme or warn the user how to setup a custom scheme\n const resolvedScheme = await getOptionalDevClientSchemeAsync(projectRoot);\n if (!resolvedScheme.scheme) {\n if (resolvedScheme.resolution === 'shared') {\n // This can happen if one of the native projects has no URI schemes defined in it.\n // Normally, this should never happen.\n Log.warn(\n chalk`Could not find a shared URI scheme for the dev client between the local {bold /ios} and {bold /android} directories. App launches (QR code, interstitial, terminal keys) may not work as expected. You can configure a custom scheme using the {bold --scheme} option, or by running {bold npx expo prebuild} to regenerate the native directories with URI schemes.`\n );\n } else if (['ios', 'android'].includes(resolvedScheme.resolution)) {\n Log.warn(\n chalk`The {bold /${resolvedScheme.resolution}} project does not contain any URI schemes. Expo CLI will not be able to use links to launch the project. You can configure a custom URI scheme using the {bold --scheme} option.`\n );\n }\n }\n return resolvedScheme.scheme;\n } else {\n // Ensure this is reset when users don't use `--scheme`, `--dev-client` and don't have the `expo-dev-client` package installed.\n return null;\n }\n}\n\n/** Resolve and assert host type options. */\nexport function resolveHostType(options: {\n host?: string;\n offline?: boolean;\n lan?: boolean;\n localhost?: boolean;\n tunnel?: boolean;\n}): 'lan' | 'tunnel' | 'localhost' {\n if (\n [options.offline, options.host, options.lan, options.localhost, options.tunnel].filter((i) => i)\n .length > 1\n ) {\n throw new CommandError(\n 'BAD_ARGS',\n 'Specify at most one of: --offline, --host, --tunnel, --lan, --localhost'\n );\n }\n\n if (options.offline) {\n // Force `lan` in offline mode.\n return 'lan';\n } else if (options.host) {\n assert.match(options.host, /^(lan|tunnel|localhost)$/);\n return options.host as 'lan' | 'tunnel' | 'localhost';\n } else if (options.tunnel) {\n return 'tunnel';\n } else if (options.lan) {\n return 'lan';\n } else if (options.localhost) {\n return 'localhost';\n }\n\n // If no option is provided, and we are running in Stackblitz, enable tunnel by default\n if (envIsWebcontainer()) {\n return 'tunnel';\n }\n\n return 'lan';\n}\n\n/** Resolve the port options for all supported bundlers. */\nexport async function resolvePortsAsync(\n projectRoot: string,\n options: Partial<Pick<Options, 'port' | 'devClient'>>,\n settings: { webOnly?: boolean }\n) {\n const multiBundlerSettings: { webpackPort?: number; metroPort?: number } = {};\n\n if (settings.webOnly) {\n const webpackPort = await resolvePortAsync(projectRoot, {\n defaultPort: options.port,\n // Default web port\n fallbackPort: 19006,\n });\n if (!webpackPort) {\n throw new AbortCommandError();\n }\n multiBundlerSettings.webpackPort = webpackPort;\n } else {\n const fallbackPort = process.env.RCT_METRO_PORT\n ? parseInt(process.env.RCT_METRO_PORT, 10)\n : 8081;\n const metroPort = await resolvePortAsync(projectRoot, {\n defaultPort: options.port,\n fallbackPort,\n });\n if (!metroPort) {\n throw new AbortCommandError();\n }\n multiBundlerSettings.metroPort = metroPort;\n }\n\n return multiBundlerSettings;\n}\n"],"names":["resolveHostType","resolveOptionsAsync","resolvePortsAsync","resolveSchemeAsync","projectRoot","args","CommandError","host","offline","lan","localhost","tunnel","Log","warn","chalk","isUserDefinedDevClient","isAutoDevClient","hasDirectDevClientDependency","isDevClient","scheme","devClient","privateKeyPath","android","web","ios","clear","dev","https","maxWorkers","port","minify","options","canResolveDevClient","getOptionalDevClientSchemeAsync","require","resolvedScheme","resolution","includes","filter","i","length","assert","match","envIsWebcontainer","settings","multiBundlerSettings","webOnly","webpackPort","resolvePortAsync","defaultPort","fallbackPort","AbortCommandError","process","env","RCT_METRO_PORT","parseInt","metroPort"],"mappings":";;;;;;;;;;;IAuHgBA,eAAe;eAAfA;;IA5FMC,mBAAmB;eAAnBA;;IAoIAC,iBAAiB;eAAjBA;;IA3EAC,kBAAkB;eAAlBA;;;;gEApFH;;;;;;;gEACD;;;;;;iCAEgD;qBAC9C;qBACc;wBACc;sBACf;;;;;;AAoB1B,eAAeF,oBAAoBG,WAAmB,EAAEC,IAAS;IACtE,IAAIA,IAAI,CAAC,eAAe,IAAIA,IAAI,CAAC,OAAO,EAAE;QACxC,MAAM,IAAIC,oBAAY,CAAC,YAAY;IACrC;IACA,MAAMC,OAAOP,gBAAgB;QAC3BO,MAAMF,IAAI,CAAC,SAAS;QACpBG,SAASH,IAAI,CAAC,YAAY;QAC1BI,KAAKJ,IAAI,CAAC,QAAQ;QAClBK,WAAWL,IAAI,CAAC,cAAc;QAC9BM,QAAQN,IAAI,CAAC,WAAW;IAC1B;IAEA,IAAIA,IAAI,CAAC,UAAU,EAAE;QACnBO,QAAG,CAACC,IAAI,CAACC,IAAAA,gBAAK,CAAA,CAAC,+DAA+D,CAAC;IACjF;IAEA,8FAA8F;IAC9F,wDAAwD;IACxD,MAAMC,yBACJ,CAAC,CAACV,IAAI,CA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OAAO,EAAE;QACpB,MAAMC,cAAc,MAAMC,IAAAA,sBAAgB,EAAC5C,aAAa;YACtD6C,aAAalB,QAAQF,IAAI;YACzB,mBAAmB;YACnBqB,cAAc;QAChB;QACA,IAAI,CAACH,aAAa;YAChB,MAAM,IAAII,yBAAiB;QAC7B;QACAN,qBAAqBE,WAAW,GAAGA;IACrC,OAAO;QACL,MAAMG,eAAeE,QAAQC,GAAG,CAACC,cAAc,GAC3CC,SAASH,QAAQC,GAAG,CAACC,cAAc,EAAE,MACrC;QACJ,MAAME,YAAY,MAAMR,IAAAA,sBAAgB,EAAC5C,aAAa;YACpD6C,aAAalB,QAAQF,IAAI;YACzBqB;QACF;QACA,IAAI,CAACM,WAAW;YACd,MAAM,IAAIL,yBAAiB;QAC7B;QACAN,qBAAqBW,SAAS,GAAGA;IACnC;IAEA,OAAOX;AACT"}
@@ -319,7 +319,7 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
319
319
  environment: 'client',
320
320
  serializerIncludeMaps: includeSourceMaps,
321
321
  mainModuleName: resolvedMainModuleName,
322
- lazy: (0, _metroOptions.shouldEnableAsyncImports)(this.projectRoot),
322
+ lazy: !_env1.env.EXPO_NO_METRO_LAZY,
323
323
  asyncRoutes,
324
324
  baseUrl,
325
325
  isExporting,
@@ -342,7 +342,7 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
342
342
  mainModuleName: (0, _ManifestMiddleware.resolveMainModuleName)(this.projectRoot, {
343
343
  platform
344
344
  }),
345
- lazy: (0, _metroOptions.shouldEnableAsyncImports)(this.projectRoot),
345
+ lazy: !_env1.env.EXPO_NO_METRO_LAZY,
346
346
  baseUrl,
347
347
  isExporting,
348
348
  asyncRoutes,
@@ -614,7 +614,8 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
614
614
  targetDomain: 'server',
615
615
  contents: 'module.exports = ' + JSON.stringify(// TODO: Add a less leaky version of this across the framework with just [key, value] (module ID, chunk).
616
616
  Object.fromEntries(Array.from(ssrManifest.entries()).map(([key, value])=>[
617
- _path().default.join(serverRoot, key),
617
+ // Must match babel plugin.
618
+ './' + (0, _filePath.toPosixPath)(_path().default.relative(this.projectRoot, _path().default.join(serverRoot, key))),
618
619
  [
619
620
  key,
620
621
  value
@@ -1157,31 +1158,42 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
1157
1158
  type: 'bundle_build_started'
1158
1159
  });
1159
1160
  try {
1160
- var _transformOptions_customTransformOptions;
1161
1161
  let delta;
1162
1162
  let revision;
1163
- // TODO: Some bug in Metro/RSC causes this to break when changing imports in server components.
1164
- // We should resolve the bug because it results in ~6x faster bundling to reuse the graph revision.
1165
- if (((_transformOptions_customTransformOptions = transformOptions.customTransformOptions) == null ? void 0 : _transformOptions_customTransformOptions.environment) === 'react-server') {
1166
- const props = await this.metro.getBundler().initializeGraph(// NOTE: Using absolute path instead of relative input path is a breaking change.
1167
- // entryFile,
1168
- resolvedEntryFilePath, transformOptions, resolverOptions, {
1169
- onProgress,
1170
- shallow: graphOptions.shallow,
1171
- lazy: graphOptions.lazy
1172
- });
1173
- delta = props.delta;
1174
- revision = props.revision;
1175
- } else {
1176
- const props = await (revPromise != null ? this.metro.getBundler().updateGraph(await revPromise, false) : this.metro.getBundler().initializeGraph(// NOTE: Using absolute path instead of relative input path is a breaking change.
1177
- // entryFile,
1178
- resolvedEntryFilePath, transformOptions, resolverOptions, {
1179
- onProgress,
1180
- shallow: graphOptions.shallow,
1181
- lazy: graphOptions.lazy
1182
- }));
1183
- delta = props.delta;
1184
- revision = props.revision;
1163
+ try {
1164
+ var _transformOptions_customTransformOptions;
1165
+ // TODO: Some bug in Metro/RSC causes this to break when changing imports in server components.
1166
+ // We should resolve the bug because it results in ~6x faster bundling to reuse the graph revision.
1167
+ if (((_transformOptions_customTransformOptions = transformOptions.customTransformOptions) == null ? void 0 : _transformOptions_customTransformOptions.environment) === 'react-server') {
1168
+ const props = await this.metro.getBundler().initializeGraph(// NOTE: Using absolute path instead of relative input path is a breaking change.
1169
+ // entryFile,
1170
+ resolvedEntryFilePath, transformOptions, resolverOptions, {
1171
+ onProgress,
1172
+ shallow: graphOptions.shallow,
1173
+ lazy: graphOptions.lazy
1174
+ });
1175
+ delta = props.delta;
1176
+ revision = props.revision;
1177
+ } else {
1178
+ const props = await (revPromise != null ? this.metro.getBundler().updateGraph(await revPromise, false) : this.metro.getBundler().initializeGraph(// NOTE: Using absolute path instead of relative input path is a breaking change.
1179
+ // entryFile,
1180
+ resolvedEntryFilePath, transformOptions, resolverOptions, {
1181
+ onProgress,
1182
+ shallow: graphOptions.shallow,
1183
+ lazy: graphOptions.lazy
1184
+ }));
1185
+ delta = props.delta;
1186
+ revision = props.revision;
1187
+ }
1188
+ } catch (error) {
1189
+ if (error instanceof Error) {
1190
+ // Space out build failures.
1191
+ const cause = error.cause;
1192
+ if (cause && '_expoImportStack' in cause) {
1193
+ error.message += '\n\n' + cause._expoImportStack;
1194
+ }
1195
+ }
1196
+ throw error;
1185
1197
  }
1186
1198
  bundlePerfLogger == null ? void 0 : bundlePerfLogger.annotate({
1187
1199
  int: {