@depup/expo__cli 55.0.23-depup.0 → 57.0.10-depup.0

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 (594) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +13 -15
  3. package/build/bin/cli +4 -4
  4. package/build/bin/cli.map +1 -1
  5. package/build/src/api/endpoint.js +4 -4
  6. package/build/src/api/endpoint.js.map +1 -1
  7. package/build/src/api/getExpoSchema.js +3 -3
  8. package/build/src/api/getExpoSchema.js.map +1 -1
  9. package/build/src/api/graphql/client.js +26 -14
  10. package/build/src/api/graphql/client.js.map +1 -1
  11. package/build/src/api/graphql/mutations/TunnelMutation.js +31 -0
  12. package/build/src/api/graphql/mutations/TunnelMutation.js.map +1 -0
  13. package/build/src/api/rest/cache/FileSystemResponseCache.js.map +1 -1
  14. package/build/src/api/rest/cache/ResponseCache.js +5 -5
  15. package/build/src/api/rest/cache/ResponseCache.js.map +1 -1
  16. package/build/src/api/rest/client.js +35 -20
  17. package/build/src/api/rest/client.js.map +1 -1
  18. package/build/src/api/rest/wrapFetchWithBaseUrl.js.map +1 -1
  19. package/build/src/api/rest/wrapFetchWithOffline.js.map +1 -1
  20. package/build/src/api/rest/wrapFetchWithProgress.js.map +1 -1
  21. package/build/src/api/rest/wrapFetchWithUserAgent.js.map +1 -1
  22. package/build/src/api/updateDevelopmentSession.js +6 -5
  23. package/build/src/api/updateDevelopmentSession.js.map +1 -1
  24. package/build/src/api/user/UserSettings.js +28 -15
  25. package/build/src/api/user/UserSettings.js.map +1 -1
  26. package/build/src/api/user/actions.js +10 -3
  27. package/build/src/api/user/actions.js.map +1 -1
  28. package/build/src/api/user/expoSsoLauncher.js +76 -24
  29. package/build/src/api/user/expoSsoLauncher.js.map +1 -1
  30. package/build/src/api/user/otp.js +4 -4
  31. package/build/src/api/user/otp.js.map +1 -1
  32. package/build/src/api/user/user.js +19 -7
  33. package/build/src/api/user/user.js.map +1 -1
  34. package/build/src/config/configAsync.js +3 -3
  35. package/build/src/config/configAsync.js.map +1 -1
  36. package/build/src/config/index.js.map +1 -1
  37. package/build/src/customize/customizeAsync.js.map +1 -1
  38. package/build/src/customize/generate.js +7 -4
  39. package/build/src/customize/generate.js.map +1 -1
  40. package/build/src/customize/index.js.map +1 -1
  41. package/build/src/customize/templates.js +4 -6
  42. package/build/src/customize/templates.js.map +1 -1
  43. package/build/src/customize/typescript.js.map +1 -1
  44. package/build/src/events/index.js +19 -15
  45. package/build/src/events/index.js.map +1 -1
  46. package/build/src/events/stream.js +94 -24
  47. package/build/src/events/stream.js.map +1 -1
  48. package/build/src/expoUpdatesExports.js +4 -4
  49. package/build/src/expoUpdatesExports.js.map +1 -1
  50. package/build/src/export/createMetadataJson.js +2 -1
  51. package/build/src/export/createMetadataJson.js.map +1 -1
  52. package/build/src/export/embed/exportEmbedAsync.js +45 -20
  53. package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
  54. package/build/src/export/embed/exportServer.js +1 -1
  55. package/build/src/export/embed/exportServer.js.map +1 -1
  56. package/build/src/export/embed/index.js.map +1 -1
  57. package/build/src/export/embed/resolveOptions.js +7 -6
  58. package/build/src/export/embed/resolveOptions.js.map +1 -1
  59. package/build/src/export/embed/xcodeCompilerLogger.js +7 -7
  60. package/build/src/export/embed/xcodeCompilerLogger.js.map +1 -1
  61. package/build/src/export/exportApp.js +32 -28
  62. package/build/src/export/exportApp.js.map +1 -1
  63. package/build/src/export/exportAssets.js +5 -5
  64. package/build/src/export/exportAssets.js.map +1 -1
  65. package/build/src/export/exportAsync.js.map +1 -1
  66. package/build/src/export/exportDomComponents.js +5 -5
  67. package/build/src/export/exportDomComponents.js.map +1 -1
  68. package/build/src/export/exportHermes.js +23 -13
  69. package/build/src/export/exportHermes.js.map +1 -1
  70. package/build/src/export/exportStaticAsync.js +30 -21
  71. package/build/src/export/exportStaticAsync.js.map +1 -1
  72. package/build/src/export/favicon.js +26 -34
  73. package/build/src/export/favicon.js.map +1 -1
  74. package/build/src/export/getPublicExpoManifest.js.map +1 -1
  75. package/build/src/export/getResolvedLocales.js.map +1 -1
  76. package/build/src/export/html.js +3 -3
  77. package/build/src/export/html.js.map +1 -1
  78. package/build/src/export/index.js +2 -0
  79. package/build/src/export/index.js.map +1 -1
  80. package/build/src/export/metroAssetLocalPath.js +4 -4
  81. package/build/src/export/metroAssetLocalPath.js.map +1 -1
  82. package/build/src/export/persistMetroAssets.js +6 -6
  83. package/build/src/export/persistMetroAssets.js.map +1 -1
  84. package/build/src/export/publicFolder.js +16 -4
  85. package/build/src/export/publicFolder.js.map +1 -1
  86. package/build/src/export/resolveOptions.js +12 -13
  87. package/build/src/export/resolveOptions.js.map +1 -1
  88. package/build/src/export/saveAssets.js +3 -3
  89. package/build/src/export/saveAssets.js.map +1 -1
  90. package/build/src/export/static.js +6 -0
  91. package/build/src/export/static.js.map +1 -0
  92. package/build/src/export/web/exportWebAsync.js.map +1 -1
  93. package/build/src/export/web/index.js.map +1 -1
  94. package/build/src/export/writeContents.js.map +1 -1
  95. package/build/src/install/checkPackages.js +1 -28
  96. package/build/src/install/checkPackages.js.map +1 -1
  97. package/build/src/install/fixPackages.js.map +1 -1
  98. package/build/src/install/index.js.map +1 -1
  99. package/build/src/install/installAsync.js +3 -3
  100. package/build/src/install/installAsync.js.map +1 -1
  101. package/build/src/install/installExpoPackage.js.map +1 -1
  102. package/build/src/install/resolveOptions.js.map +1 -1
  103. package/build/src/install/utils/autoAddConfigPlugins.js +3 -3
  104. package/build/src/install/utils/autoAddConfigPlugins.js.map +1 -1
  105. package/build/src/install/utils/checkPackagesCompatibility.js +32 -16
  106. package/build/src/install/utils/checkPackagesCompatibility.js.map +1 -1
  107. package/build/src/lint/ESlintPrerequisite.js.map +1 -1
  108. package/build/src/log.js +32 -14
  109. package/build/src/log.js.map +1 -1
  110. package/build/src/login/index.js +25 -5
  111. package/build/src/login/index.js.map +1 -1
  112. package/build/src/logout/index.js.map +1 -1
  113. package/build/src/prebuild/clearNativeFolder.js +49 -14
  114. package/build/src/prebuild/clearNativeFolder.js.map +1 -1
  115. package/build/src/prebuild/configureProjectAsync.js.map +1 -1
  116. package/build/src/prebuild/copyTemplateFiles.js +3 -3
  117. package/build/src/prebuild/copyTemplateFiles.js.map +1 -1
  118. package/build/src/prebuild/ensureConfigAsync.js.map +1 -1
  119. package/build/src/prebuild/index.js +3 -2
  120. package/build/src/prebuild/index.js.map +1 -1
  121. package/build/src/prebuild/prebuildAsync.js +31 -6
  122. package/build/src/prebuild/prebuildAsync.js.map +1 -1
  123. package/build/src/prebuild/renameTemplateAppName.js +8 -5
  124. package/build/src/prebuild/renameTemplateAppName.js.map +1 -1
  125. package/build/src/prebuild/resolveOptions.js +7 -7
  126. package/build/src/prebuild/resolveOptions.js.map +1 -1
  127. package/build/src/prebuild/resolveTemplate.js +10 -5
  128. package/build/src/prebuild/resolveTemplate.js.map +1 -1
  129. package/build/src/prebuild/updateFromTemplate.js +3 -3
  130. package/build/src/prebuild/updateFromTemplate.js.map +1 -1
  131. package/build/src/prebuild/updatePackageJson.js +7 -7
  132. package/build/src/prebuild/updatePackageJson.js.map +1 -1
  133. package/build/src/prebuild/validateTemplatePlatforms.js.map +1 -1
  134. package/build/src/register/index.js.map +1 -1
  135. package/build/src/run/android/index.js.map +1 -1
  136. package/build/src/run/android/resolveGradlePropsAsync.js +3 -4
  137. package/build/src/run/android/resolveGradlePropsAsync.js.map +1 -1
  138. package/build/src/run/android/resolveInstallApkName.js +48 -1
  139. package/build/src/run/android/resolveInstallApkName.js.map +1 -1
  140. package/build/src/run/android/resolveLaunchProps.js +4 -1
  141. package/build/src/run/android/resolveLaunchProps.js.map +1 -1
  142. package/build/src/run/android/resolveOptions.js.map +1 -1
  143. package/build/src/run/android/runAndroidAsync.js.map +1 -1
  144. package/build/src/run/ensureNativeProject.js.map +1 -1
  145. package/build/src/run/hints.js +4 -4
  146. package/build/src/run/hints.js.map +1 -1
  147. package/build/src/run/index.js.map +1 -1
  148. package/build/src/run/ios/XcodeBuild.js +163 -23
  149. package/build/src/run/ios/XcodeBuild.js.map +1 -1
  150. package/build/src/run/ios/appleDevice/AppleDevice.js +6 -5
  151. package/build/src/run/ios/appleDevice/AppleDevice.js.map +1 -1
  152. package/build/src/run/ios/appleDevice/ClientManager.js.map +1 -1
  153. package/build/src/run/ios/appleDevice/client/AFCClient.js +10 -16
  154. package/build/src/run/ios/appleDevice/client/AFCClient.js.map +1 -1
  155. package/build/src/run/ios/appleDevice/client/DebugserverClient.js +1 -1
  156. package/build/src/run/ios/appleDevice/client/DebugserverClient.js.map +1 -1
  157. package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js +2 -1
  158. package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js.map +1 -1
  159. package/build/src/run/ios/appleDevice/client/LockdowndClient.js +1 -1
  160. package/build/src/run/ios/appleDevice/client/LockdowndClient.js.map +1 -1
  161. package/build/src/run/ios/appleDevice/client/MobileImageMounterClient.js.map +1 -1
  162. package/build/src/run/ios/appleDevice/client/ServiceClient.js +3 -3
  163. package/build/src/run/ios/appleDevice/client/ServiceClient.js.map +1 -1
  164. package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js.map +1 -1
  165. package/build/src/run/ios/appleDevice/installOnDeviceAsync.js +3 -3
  166. package/build/src/run/ios/appleDevice/installOnDeviceAsync.js.map +1 -1
  167. package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js +16 -13
  168. package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js.map +1 -1
  169. package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js +6 -6
  170. package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js.map +1 -1
  171. package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js +5 -5
  172. package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js.map +1 -1
  173. package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js +7 -7
  174. package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js.map +1 -1
  175. package/build/src/run/ios/appleDevice/protocol/UsbmuxProtocol.js +5 -5
  176. package/build/src/run/ios/appleDevice/protocol/UsbmuxProtocol.js.map +1 -1
  177. package/build/src/run/ios/codeSigning/Security.js +8 -8
  178. package/build/src/run/ios/codeSigning/Security.js.map +1 -1
  179. package/build/src/run/ios/codeSigning/configureCodeSigning.js +5 -3
  180. package/build/src/run/ios/codeSigning/configureCodeSigning.js.map +1 -1
  181. package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js +7 -5
  182. package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js.map +1 -1
  183. package/build/src/run/ios/codeSigning/settings.js +3 -3
  184. package/build/src/run/ios/codeSigning/settings.js.map +1 -1
  185. package/build/src/run/ios/codeSigning/xcodeCodeSigning.js +4 -4
  186. package/build/src/run/ios/codeSigning/xcodeCodeSigning.js.map +1 -1
  187. package/build/src/run/ios/index.js +8 -1
  188. package/build/src/run/ios/index.js.map +1 -1
  189. package/build/src/run/ios/launchApp.js +3 -3
  190. package/build/src/run/ios/launchApp.js.map +1 -1
  191. package/build/src/run/ios/options/appleDestinations.js.map +1 -1
  192. package/build/src/run/ios/options/promptDevice.js +3 -3
  193. package/build/src/run/ios/options/promptDevice.js.map +1 -1
  194. package/build/src/run/ios/options/resolveDevice.js +8 -3
  195. package/build/src/run/ios/options/resolveDevice.js.map +1 -1
  196. package/build/src/run/ios/options/resolveNativeScheme.js +4 -4
  197. package/build/src/run/ios/options/resolveNativeScheme.js.map +1 -1
  198. package/build/src/run/ios/options/resolveOptions.js +9 -4
  199. package/build/src/run/ios/options/resolveOptions.js.map +1 -1
  200. package/build/src/run/ios/options/resolveXcodeProject.js.map +1 -1
  201. package/build/src/run/ios/runIosAsync.js +39 -0
  202. package/build/src/run/ios/runIosAsync.js.map +1 -1
  203. package/build/src/run/ios/validateExternalBinary.js.map +1 -1
  204. package/build/src/run/startBundler.js +4 -0
  205. package/build/src/run/startBundler.js.map +1 -1
  206. package/build/src/serve/index.js +4 -1
  207. package/build/src/serve/index.js.map +1 -1
  208. package/build/src/serve/serveAsync.js +23 -11
  209. package/build/src/serve/serveAsync.js.map +1 -1
  210. package/build/src/serve/static.js +69 -0
  211. package/build/src/serve/static.js.map +1 -0
  212. package/build/src/start/checkDependenciesOnStart.js +131 -0
  213. package/build/src/start/checkDependenciesOnStart.js.map +1 -0
  214. package/build/src/start/detectDevClient.js +3 -3
  215. package/build/src/start/detectDevClient.js.map +1 -1
  216. package/build/src/start/doctor/Prerequisite.js +4 -4
  217. package/build/src/start/doctor/Prerequisite.js.map +1 -1
  218. package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js +53 -91
  219. package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js.map +1 -1
  220. package/build/src/start/doctor/apple/XcodePrerequisite.js +3 -3
  221. package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
  222. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +3 -3
  223. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
  224. package/build/src/start/doctor/dependencies/getMissingPackages.js +5 -5
  225. package/build/src/start/doctor/dependencies/getMissingPackages.js.map +1 -1
  226. package/build/src/start/doctor/dependencies/getVersionedPackages.js +5 -5
  227. package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
  228. package/build/src/start/doctor/dependencies/reactNativeTv.js +149 -0
  229. package/build/src/start/doctor/dependencies/reactNativeTv.js.map +1 -0
  230. package/build/src/start/doctor/dependencies/resolvePackages.js +4 -4
  231. package/build/src/start/doctor/dependencies/resolvePackages.js.map +1 -1
  232. package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +33 -8
  233. package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
  234. package/build/src/start/doctor/ngrok/ExternalModule.js +3 -3
  235. package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
  236. package/build/src/start/doctor/ngrok/NgrokResolver.js +3 -3
  237. package/build/src/start/doctor/ngrok/NgrokResolver.js.map +1 -1
  238. package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js.map +1 -1
  239. package/build/src/start/doctor/typescript/updateTSConfig.js +3 -3
  240. package/build/src/start/doctor/typescript/updateTSConfig.js.map +1 -1
  241. package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js +5 -12
  242. package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js.map +1 -1
  243. package/build/src/start/index.js +2 -0
  244. package/build/src/start/index.js.map +1 -1
  245. package/build/src/start/interface/KeyPressHandler.js.map +1 -1
  246. package/build/src/start/interface/cliExtensionMenuItemHandler.js.map +1 -1
  247. package/build/src/start/interface/commandsTable.js +6 -6
  248. package/build/src/start/interface/commandsTable.js.map +1 -1
  249. package/build/src/start/interface/createDevToolsMenuItems.js.map +1 -1
  250. package/build/src/start/interface/interactiveActions.js +49 -6
  251. package/build/src/start/interface/interactiveActions.js.map +1 -1
  252. package/build/src/start/interface/startInterface.js +13 -4
  253. package/build/src/start/interface/startInterface.js.map +1 -1
  254. package/build/src/start/platforms/AppIdResolver.js +4 -0
  255. package/build/src/start/platforms/AppIdResolver.js.map +1 -1
  256. package/build/src/start/platforms/DeviceManager.js.map +1 -1
  257. package/build/src/start/platforms/ExpoGoInstaller.js +13 -4
  258. package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -1
  259. package/build/src/start/platforms/PlatformManager.js.map +1 -1
  260. package/build/src/start/platforms/android/AndroidAppIdResolver.js.map +1 -1
  261. package/build/src/start/platforms/android/AndroidDeviceManager.js.map +1 -1
  262. package/build/src/start/platforms/android/AndroidPlatformManager.js.map +1 -1
  263. package/build/src/start/platforms/android/activateWindow.js.map +1 -1
  264. package/build/src/start/platforms/android/adb.js +36 -34
  265. package/build/src/start/platforms/android/adb.js.map +1 -1
  266. package/build/src/start/platforms/android/adbReverse.js +4 -4
  267. package/build/src/start/platforms/android/adbReverse.js.map +1 -1
  268. package/build/src/start/platforms/android/emulator.js +5 -5
  269. package/build/src/start/platforms/android/emulator.js.map +1 -1
  270. package/build/src/start/platforms/android/getDevices.js.map +1 -1
  271. package/build/src/start/platforms/android/gradle.js +5 -5
  272. package/build/src/start/platforms/android/gradle.js.map +1 -1
  273. package/build/src/start/platforms/android/promptAndroidDevice.js +3 -3
  274. package/build/src/start/platforms/android/promptAndroidDevice.js.map +1 -1
  275. package/build/src/start/platforms/ios/AppleAppIdResolver.js.map +1 -1
  276. package/build/src/start/platforms/ios/AppleDeviceManager.js +20 -6
  277. package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -1
  278. package/build/src/start/platforms/ios/ApplePlatformManager.js +11 -0
  279. package/build/src/start/platforms/ios/ApplePlatformManager.js.map +1 -1
  280. package/build/src/start/platforms/ios/devicectl.js +7 -7
  281. package/build/src/start/platforms/ios/devicectl.js.map +1 -1
  282. package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js +26 -11
  283. package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js.map +1 -1
  284. package/build/src/start/platforms/ios/getBestSimulator.js +5 -5
  285. package/build/src/start/platforms/ios/getBestSimulator.js.map +1 -1
  286. package/build/src/start/platforms/ios/promptAppleDevice.js +5 -4
  287. package/build/src/start/platforms/ios/promptAppleDevice.js.map +1 -1
  288. package/build/src/start/platforms/ios/simctl.js +25 -19
  289. package/build/src/start/platforms/ios/simctl.js.map +1 -1
  290. package/build/src/start/platforms/ios/simctlLogging.js +3 -3
  291. package/build/src/start/platforms/ios/simctlLogging.js.map +1 -1
  292. package/build/src/start/platforms/ios/xcrun.js +3 -3
  293. package/build/src/start/platforms/ios/xcrun.js.map +1 -1
  294. package/build/src/start/project/devices.js +6 -6
  295. package/build/src/start/project/devices.js.map +1 -1
  296. package/build/src/start/project/dotExpo.js +4 -3
  297. package/build/src/start/project/dotExpo.js.map +1 -1
  298. package/build/src/start/resolveOptions.js +7 -7
  299. package/build/src/start/resolveOptions.js.map +1 -1
  300. package/build/src/start/server/AsyncNgrok.js +1 -1
  301. package/build/src/start/server/AsyncNgrok.js.map +1 -1
  302. package/build/src/start/server/AsyncWsTunnel.js +120 -35
  303. package/build/src/start/server/AsyncWsTunnel.js.map +1 -1
  304. package/build/src/start/server/Bonjour.js +8 -3
  305. package/build/src/start/server/Bonjour.js.map +1 -1
  306. package/build/src/start/server/BundlerDevServer.js +23 -9
  307. package/build/src/start/server/BundlerDevServer.js.map +1 -1
  308. package/build/src/start/server/DevServerManager.js.map +1 -1
  309. package/build/src/start/server/DevToolsPlugin.js +63 -3
  310. package/build/src/start/server/DevToolsPlugin.js.map +1 -1
  311. package/build/src/start/server/DevToolsPlugin.schema.js +8 -3
  312. package/build/src/start/server/DevToolsPlugin.schema.js.map +1 -1
  313. package/build/src/start/server/DevToolsPluginCliExtensionExecutor.js +58 -23
  314. package/build/src/start/server/DevToolsPluginCliExtensionExecutor.js.map +1 -1
  315. package/build/src/start/server/DevToolsPluginCliExtensionResults.js +29 -0
  316. package/build/src/start/server/DevToolsPluginCliExtensionResults.js.map +1 -1
  317. package/build/src/start/server/DevToolsPluginManager.js +20 -6
  318. package/build/src/start/server/DevToolsPluginManager.js.map +1 -1
  319. package/build/src/start/server/DevToolsPluginServerHelpers.js +83 -0
  320. package/build/src/start/server/DevToolsPluginServerHelpers.js.map +1 -0
  321. package/build/src/start/server/DevelopmentSession.js +41 -24
  322. package/build/src/start/server/DevelopmentSession.js.map +1 -1
  323. package/build/src/start/server/MCP.js +10 -3
  324. package/build/src/start/server/MCP.js.map +1 -1
  325. package/build/src/start/server/MCPDevToolsPluginCLIExtensions.js +15 -5
  326. package/build/src/start/server/MCPDevToolsPluginCLIExtensions.js.map +1 -1
  327. package/build/src/start/server/UrlCreator.js +14 -1
  328. package/build/src/start/server/UrlCreator.js.map +1 -1
  329. package/build/src/start/server/createMCPDevToolsExtensionSchema.js +18 -4
  330. package/build/src/start/server/createMCPDevToolsExtensionSchema.js.map +1 -1
  331. package/build/src/start/server/getStaticRenderFunctions.js +13 -24
  332. package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
  333. package/build/src/start/server/metro/MetroBundlerDevServer.js +241 -109
  334. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  335. package/build/src/start/server/metro/MetroTerminalReporter.js +67 -16
  336. package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
  337. package/build/src/start/server/metro/TerminalReporter.js +22 -4
  338. package/build/src/start/server/metro/TerminalReporter.js.map +1 -1
  339. package/build/src/start/server/metro/createExpoAutolinkingResolver.js +25 -12
  340. package/build/src/start/server/metro/createExpoAutolinkingResolver.js.map +1 -1
  341. package/build/src/start/server/metro/createExpoFallbackResolver.js.map +1 -1
  342. package/build/src/start/server/metro/createFileMap-fork.js +196 -0
  343. package/build/src/start/server/metro/createFileMap-fork.js.map +1 -0
  344. package/build/src/start/server/metro/createServerComponentsMiddleware.js +22 -22
  345. package/build/src/start/server/metro/createServerComponentsMiddleware.js.map +1 -1
  346. package/build/src/start/server/metro/createServerRouteMiddleware.js.map +1 -1
  347. package/build/src/start/server/metro/createTypescriptResolver.js +410 -0
  348. package/build/src/start/server/metro/createTypescriptResolver.js.map +1 -0
  349. package/build/src/start/server/metro/debugging/MessageHandler.js.map +1 -1
  350. package/build/src/start/server/metro/debugging/attachAtlas.js +3 -3
  351. package/build/src/start/server/metro/debugging/attachAtlas.js.map +1 -1
  352. package/build/src/start/server/metro/debugging/createDebugMiddleware.js +6 -5
  353. package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -1
  354. package/build/src/start/server/metro/debugging/createHandlersFactory.js.map +1 -1
  355. package/build/src/start/server/metro/debugging/messageHandlers/NetworkResponse.js +20 -4
  356. package/build/src/start/server/metro/debugging/messageHandlers/NetworkResponse.js.map +1 -1
  357. package/build/src/start/server/metro/debugging/pageIsSupported.js.map +1 -1
  358. package/build/src/start/server/metro/dev-server/compression.js.map +1 -1
  359. package/build/src/start/server/metro/dev-server/createMessageSocket.js +13 -2
  360. package/build/src/start/server/metro/dev-server/createMessageSocket.js.map +1 -1
  361. package/build/src/start/server/metro/dev-server/createMetroMiddleware.js +9 -2
  362. package/build/src/start/server/metro/dev-server/createMetroMiddleware.js.map +1 -1
  363. package/build/src/start/server/metro/dev-server/utils/socketMessages.js +3 -3
  364. package/build/src/start/server/metro/dev-server/utils/socketMessages.js.map +1 -1
  365. package/build/src/start/server/metro/errors/FailedToResolveNativeOnlyModuleError.js.map +1 -1
  366. package/build/src/start/server/metro/externals.js +4 -4
  367. package/build/src/start/server/metro/externals.js.map +1 -1
  368. package/build/src/start/server/metro/fetchRouterManifest.js +3 -3
  369. package/build/src/start/server/metro/fetchRouterManifest.js.map +1 -1
  370. package/build/src/start/server/metro/getCssModulesFromBundler.js +3 -3
  371. package/build/src/start/server/metro/getCssModulesFromBundler.js.map +1 -1
  372. package/build/src/start/server/metro/instantiateMetro.js +141 -57
  373. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  374. package/build/src/start/server/metro/log-box/LogBoxLog.js.map +1 -1
  375. package/build/src/start/server/metro/log-box/LogBoxSymbolication.js +4 -4
  376. package/build/src/start/server/metro/log-box/LogBoxSymbolication.js.map +1 -1
  377. package/build/src/start/server/metro/log-box/formatProjectFilePath.js +3 -3
  378. package/build/src/start/server/metro/log-box/formatProjectFilePath.js.map +1 -1
  379. package/build/src/start/server/metro/metroErrorInterface.js +16 -13
  380. package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
  381. package/build/src/start/server/metro/metroErrors.js +3 -3
  382. package/build/src/start/server/metro/metroErrors.js.map +1 -1
  383. package/build/src/start/server/metro/metroWatchTypeScriptFiles.js +48 -16
  384. package/build/src/start/server/metro/metroWatchTypeScriptFiles.js.map +1 -1
  385. package/build/src/start/server/metro/resolveLoader.js +3 -3
  386. package/build/src/start/server/metro/resolveLoader.js.map +1 -1
  387. package/build/src/start/server/metro/router.js +23 -14
  388. package/build/src/start/server/metro/router.js.map +1 -1
  389. package/build/src/start/server/metro/runServer-fork.js +13 -10
  390. package/build/src/start/server/metro/runServer-fork.js.map +1 -1
  391. package/build/src/start/server/metro/serializeHtml.js +29 -13
  392. package/build/src/start/server/metro/serializeHtml.js.map +1 -1
  393. package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js +36 -34
  394. package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js.map +1 -1
  395. package/build/src/start/server/metro/withMetroErrorReportingResolver.js +53 -30
  396. package/build/src/start/server/metro/withMetroErrorReportingResolver.js.map +1 -1
  397. package/build/src/start/server/metro/withMetroMultiPlatform.js +187 -126
  398. package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
  399. package/build/src/start/server/metro/withMetroResolvers.js +4 -4
  400. package/build/src/start/server/metro/withMetroResolvers.js.map +1 -1
  401. package/build/src/start/server/middleware/ContextModuleSourceMapsMiddleware.js.map +1 -1
  402. package/build/src/start/server/middleware/CorsMiddleware.js +3 -3
  403. package/build/src/start/server/middleware/CorsMiddleware.js.map +1 -1
  404. package/build/src/start/server/middleware/CreateFileMiddleware.js.map +1 -1
  405. package/build/src/start/server/middleware/DevToolsPluginMiddleware.js +60 -9
  406. package/build/src/start/server/middleware/DevToolsPluginMiddleware.js.map +1 -1
  407. package/build/src/start/server/middleware/DomComponentsMiddleware.js +16 -12
  408. package/build/src/start/server/middleware/DomComponentsMiddleware.js.map +1 -1
  409. package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +6 -4
  410. package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -1
  411. package/build/src/start/server/middleware/ExpoMiddleware.js +3 -3
  412. package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
  413. package/build/src/start/server/middleware/FaviconMiddleware.js.map +1 -1
  414. package/build/src/start/server/middleware/HistoryFallbackMiddleware.js.map +1 -1
  415. package/build/src/start/server/middleware/InterstitialPageMiddleware.js +13 -8
  416. package/build/src/start/server/middleware/InterstitialPageMiddleware.js.map +1 -1
  417. package/build/src/start/server/middleware/ManifestMiddleware.js +15 -6
  418. package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
  419. package/build/src/start/server/middleware/OpenMiddleware.js +150 -0
  420. package/build/src/start/server/middleware/OpenMiddleware.js.map +1 -0
  421. package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js +13 -4
  422. package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js.map +1 -1
  423. package/build/src/start/server/middleware/ServeStaticMiddleware.js +2 -9
  424. package/build/src/start/server/middleware/ServeStaticMiddleware.js.map +1 -1
  425. package/build/src/start/server/middleware/domPolyfills.js +60 -0
  426. package/build/src/start/server/middleware/domPolyfills.js.map +1 -0
  427. package/build/src/start/server/middleware/inspector/JsInspector.js +6 -31
  428. package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -1
  429. package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js +14 -24
  430. package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js.map +1 -1
  431. package/build/src/start/server/middleware/inspector/middlwareMutations.js +3 -3
  432. package/build/src/start/server/middleware/inspector/middlwareMutations.js.map +1 -1
  433. package/build/src/start/server/middleware/metroOptions.js +15 -14
  434. package/build/src/start/server/middleware/metroOptions.js.map +1 -1
  435. package/build/src/start/server/middleware/mutations.js +3 -3
  436. package/build/src/start/server/middleware/mutations.js.map +1 -1
  437. package/build/src/start/server/middleware/openHandlers.js +157 -0
  438. package/build/src/start/server/middleware/openHandlers.js.map +1 -0
  439. package/build/src/start/server/middleware/resolveAssets.js +4 -4
  440. package/build/src/start/server/middleware/resolveAssets.js.map +1 -1
  441. package/build/src/start/server/middleware/resolvePlatform.js +9 -7
  442. package/build/src/start/server/middleware/resolvePlatform.js.map +1 -1
  443. package/build/src/start/server/middleware/resolveRuntimeVersionWithExpoUpdatesAsync.js.map +1 -1
  444. package/build/src/start/server/openPlatforms.js.map +1 -1
  445. package/build/src/start/server/platformBundlers.js +3 -1
  446. package/build/src/start/server/platformBundlers.js.map +1 -1
  447. package/build/src/start/server/serverLogLikeMetro.js +13 -36
  448. package/build/src/start/server/serverLogLikeMetro.js.map +1 -1
  449. package/build/src/start/server/type-generation/expo-env.js +3 -3
  450. package/build/src/start/server/type-generation/expo-env.js.map +1 -1
  451. package/build/src/start/server/type-generation/routes.js +14 -55
  452. package/build/src/start/server/type-generation/routes.js.map +1 -1
  453. package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js.map +1 -1
  454. package/build/src/start/server/type-generation/tsconfig.js +5 -5
  455. package/build/src/start/server/type-generation/tsconfig.js.map +1 -1
  456. package/build/src/start/server/webTemplate.js +12 -10
  457. package/build/src/start/server/webTemplate.js.map +1 -1
  458. package/build/src/start/server/webpack/WebpackBundlerDevServer.js +3 -3
  459. package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -1
  460. package/build/src/start/server/webpack/formatWebpackMessages.js.map +1 -1
  461. package/build/src/start/server/webpack/resolveFromProject.js +4 -4
  462. package/build/src/start/server/webpack/resolveFromProject.js.map +1 -1
  463. package/build/src/start/server/webpack/tls.js +3 -3
  464. package/build/src/start/server/webpack/tls.js.map +1 -1
  465. package/build/src/start/startAsync.js +21 -11
  466. package/build/src/start/startAsync.js.map +1 -1
  467. package/build/src/types.d.ts +2 -0
  468. package/build/src/utils/FileNotifier.js +1 -1
  469. package/build/src/utils/FileNotifier.js.map +1 -1
  470. package/build/src/utils/args.js +5 -5
  471. package/build/src/utils/args.js.map +1 -1
  472. package/build/src/utils/array.js +8 -8
  473. package/build/src/utils/array.js.map +1 -1
  474. package/build/src/utils/build-cache-providers/helpers.js +4 -4
  475. package/build/src/utils/build-cache-providers/helpers.js.map +1 -1
  476. package/build/src/utils/build-cache-providers/index.js +5 -5
  477. package/build/src/utils/build-cache-providers/index.js.map +1 -1
  478. package/build/src/utils/cocoapods.js +5 -5
  479. package/build/src/utils/cocoapods.js.map +1 -1
  480. package/build/src/utils/codesigning.js +12 -6
  481. package/build/src/utils/codesigning.js.map +1 -1
  482. package/build/src/utils/composeMetroIgnorePatterns.js +69 -0
  483. package/build/src/utils/composeMetroIgnorePatterns.js.map +1 -0
  484. package/build/src/utils/createTempPath.js +3 -3
  485. package/build/src/utils/createTempPath.js.map +1 -1
  486. package/build/src/utils/delay.js +4 -4
  487. package/build/src/utils/delay.js.map +1 -1
  488. package/build/src/utils/dir.js +21 -11
  489. package/build/src/utils/dir.js.map +1 -1
  490. package/build/src/utils/downloadAppAsync.js.map +1 -1
  491. package/build/src/utils/downloadExpoGoAsync.js +4 -4
  492. package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
  493. package/build/src/utils/editor.js +4 -4
  494. package/build/src/utils/editor.js.map +1 -1
  495. package/build/src/utils/env.js +39 -13
  496. package/build/src/utils/env.js.map +1 -1
  497. package/build/src/utils/errors.js +6 -6
  498. package/build/src/utils/errors.js.map +1 -1
  499. package/build/src/utils/exit.js +15 -19
  500. package/build/src/utils/exit.js.map +1 -1
  501. package/build/src/utils/expoUpdatesCli.js +5 -5
  502. package/build/src/utils/expoUpdatesCli.js.map +1 -1
  503. package/build/src/utils/fetch.js +4 -4
  504. package/build/src/utils/fetch.js.map +1 -1
  505. package/build/src/utils/findUp.js +3 -3
  506. package/build/src/utils/findUp.js.map +1 -1
  507. package/build/src/utils/fn.js +3 -3
  508. package/build/src/utils/fn.js.map +1 -1
  509. package/build/src/utils/freeport.js +3 -3
  510. package/build/src/utils/freeport.js.map +1 -1
  511. package/build/src/utils/getOrPromptApplicationId.js +3 -5
  512. package/build/src/utils/getOrPromptApplicationId.js.map +1 -1
  513. package/build/src/utils/getRunningProcess.js +5 -5
  514. package/build/src/utils/getRunningProcess.js.map +1 -1
  515. package/build/src/utils/git.js +3 -3
  516. package/build/src/utils/git.js.map +1 -1
  517. package/build/src/utils/glob.js +3 -3
  518. package/build/src/utils/glob.js.map +1 -1
  519. package/build/src/utils/ip.js +4 -4
  520. package/build/src/utils/ip.js.map +1 -1
  521. package/build/src/utils/link.js +3 -3
  522. package/build/src/utils/link.js.map +1 -1
  523. package/build/src/utils/mergeGitIgnorePaths.js +10 -10
  524. package/build/src/utils/mergeGitIgnorePaths.js.map +1 -1
  525. package/build/src/utils/modifyConfigAsync.js +3 -3
  526. package/build/src/utils/modifyConfigAsync.js.map +1 -1
  527. package/build/src/utils/net.js +23 -4
  528. package/build/src/utils/net.js.map +1 -1
  529. package/build/src/utils/nodeEnv.js +6 -6
  530. package/build/src/utils/nodeEnv.js.map +1 -1
  531. package/build/src/utils/npm.js +10 -9
  532. package/build/src/utils/npm.js.map +1 -1
  533. package/build/src/utils/obj.js +4 -4
  534. package/build/src/utils/obj.js.map +1 -1
  535. package/build/src/utils/open.js +240 -11
  536. package/build/src/utils/open.js.map +1 -1
  537. package/build/src/utils/ora.js +4 -4
  538. package/build/src/utils/ora.js.map +1 -1
  539. package/build/src/utils/plist.js +5 -4
  540. package/build/src/utils/plist.js.map +1 -1
  541. package/build/src/utils/port.js +12 -5
  542. package/build/src/utils/port.js.map +1 -1
  543. package/build/src/utils/progress.js +4 -4
  544. package/build/src/utils/progress.js.map +1 -1
  545. package/build/src/utils/prompts.js +11 -11
  546. package/build/src/utils/prompts.js.map +1 -1
  547. package/build/src/utils/qr.js +5 -4
  548. package/build/src/utils/qr.js.map +1 -1
  549. package/build/src/utils/resolveArgs.js +10 -9
  550. package/build/src/utils/resolveArgs.js.map +1 -1
  551. package/build/src/utils/scheme.js +4 -4
  552. package/build/src/utils/scheme.js.map +1 -1
  553. package/build/src/utils/strings.js.map +1 -1
  554. package/build/src/utils/tar.js +8 -7
  555. package/build/src/utils/tar.js.map +1 -1
  556. package/build/src/utils/telemetry/Telemetry.js +5 -0
  557. package/build/src/utils/telemetry/Telemetry.js.map +1 -1
  558. package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
  559. package/build/src/utils/telemetry/clients/FetchClient.js.map +1 -1
  560. package/build/src/utils/telemetry/clients/flushFetchDetached.js +5 -1
  561. package/build/src/utils/telemetry/clients/flushFetchDetached.js.map +1 -1
  562. package/build/src/utils/telemetry/index.js +4 -4
  563. package/build/src/utils/telemetry/index.js.map +1 -1
  564. package/build/src/utils/telemetry/utils/agent.js +42 -0
  565. package/build/src/utils/telemetry/utils/agent.js.map +1 -0
  566. package/build/src/utils/telemetry/utils/constants.js +3 -3
  567. package/build/src/utils/telemetry/utils/constants.js.map +1 -1
  568. package/build/src/utils/telemetry/utils/context.js +3 -2
  569. package/build/src/utils/telemetry/utils/context.js.map +1 -1
  570. package/build/src/utils/url.js +5 -17
  571. package/build/src/utils/url.js.map +1 -1
  572. package/build/src/utils/validateApplicationId.js +12 -12
  573. package/build/src/utils/validateApplicationId.js.map +1 -1
  574. package/build/src/utils/variadic.js +4 -4
  575. package/build/src/utils/variadic.js.map +1 -1
  576. package/build/src/whoami/index.js.map +1 -1
  577. package/changes.json +18 -26
  578. package/main.js +3 -0
  579. package/package.json +88 -80
  580. package/static/loading-page/index.html +45 -3
  581. package/static/template/+html.tsx +14 -5
  582. package/add-module.js +0 -8
  583. package/build/src/start/server/middleware/inspector/CdpClient.js +0 -81
  584. package/build/src/start/server/middleware/inspector/CdpClient.js.map +0 -1
  585. package/build/src/utils/resolveWatchFolders.js +0 -67
  586. package/build/src/utils/resolveWatchFolders.js.map +0 -1
  587. package/build/src/utils/tsconfig/evaluateTsConfig.js +0 -87
  588. package/build/src/utils/tsconfig/evaluateTsConfig.js.map +0 -1
  589. package/build/src/utils/tsconfig/loadTsConfigPaths.js +0 -84
  590. package/build/src/utils/tsconfig/loadTsConfigPaths.js.map +0 -1
  591. package/build/src/utils/tsconfig/matchTsConfigPathAlias.js +0 -94
  592. package/build/src/utils/tsconfig/matchTsConfigPathAlias.js.map +0 -1
  593. package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js +0 -62
  594. package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/export/exportHermes.ts"],"sourcesContent":["import { ExpoConfig, getConfigFilePaths, Platform } from '@expo/config';\nimport JsonFile from '@expo/json-file';\nimport fs from 'fs';\nimport path from 'path';\n\nconst PODFILE_HERMES_LHS = /(?::hermes_enabled\\s*=>|hermes_enabled\\s*:)/;\nconst PODFILE_HERMES_PROPS_REFERENCE_RE = new RegExp(\n String.raw`^\\s*${PODFILE_HERMES_LHS.source}\\s*podfile_properties\\['expo\\.jsEngine'\\]\\s*==\\s*nil\\s*\\|\\|\\s*podfile_properties\\['expo\\.jsEngine'\\]\\s*==\\s*'hermes'\\s*,?\\s*(?:#.*)?$`,\n 'm'\n);\nconst PODFILE_HERMES_TRUE_RE = new RegExp(\n String.raw`^\\s*${PODFILE_HERMES_LHS.source}\\s*true\\s*(?:,\\s*)?(?:[^\\n]*)?$`,\n 'm'\n);\nconst PODFILE_HERMES_FALSE_RE = new RegExp(\n String.raw`^\\s*${PODFILE_HERMES_LHS.source}\\s*false\\s*(?:,\\s*)?(?:[^\\n]*)?$`,\n 'm'\n);\n\nfunction getLiteralHermesSettingFromPodfile(content: string): boolean | null {\n const isPropsReference = content.search(PODFILE_HERMES_PROPS_REFERENCE_RE) >= 0;\n if (isPropsReference) {\n return null;\n }\n if (PODFILE_HERMES_TRUE_RE.test(content)) {\n return true;\n }\n if (PODFILE_HERMES_FALSE_RE.test(content)) {\n return false;\n }\n return null;\n}\n\nexport async function assertEngineMismatchAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'ios' | 'android' | 'jsEngine'>,\n platform: Platform\n) {\n const isHermesManaged = isEnableHermesManaged(exp, platform);\n const paths = getConfigFilePaths(projectRoot);\n const configFilePath = paths.dynamicConfigPath ?? paths.staticConfigPath ?? 'app.json';\n await maybeThrowFromInconsistentEngineAsync(\n projectRoot,\n configFilePath,\n platform,\n isHermesManaged\n );\n}\n\nexport function isEnableHermesManaged(\n expoConfig: Partial<Pick<ExpoConfig, 'ios' | 'android' | 'jsEngine'>>,\n platform: string\n): boolean {\n switch (platform) {\n case 'android': {\n return (expoConfig.android?.jsEngine ?? expoConfig.jsEngine) !== 'jsc';\n }\n case 'ios': {\n return (expoConfig.ios?.jsEngine ?? expoConfig.jsEngine) !== 'jsc';\n }\n default:\n return false;\n }\n}\n\nexport function parseGradleProperties(content: string): Record<string, string> {\n const result: Record<string, string> = {};\n for (let line of content.split('\\n')) {\n line = line.trim();\n if (!line || line.startsWith('#')) {\n continue;\n }\n\n const sepIndex = line.indexOf('=');\n const key = line.slice(0, sepIndex);\n const value = line.slice(sepIndex + 1);\n result[key] = value;\n }\n return result;\n}\n\nexport async function maybeThrowFromInconsistentEngineAsync(\n projectRoot: string,\n configFilePath: string,\n platform: string,\n isHermesManaged: boolean\n): Promise<void> {\n const configFileName = path.basename(configFilePath);\n if (\n platform === 'android' &&\n (await maybeInconsistentEngineAndroidAsync(projectRoot, isHermesManaged))\n ) {\n throw new Error(\n `JavaScript engine configuration is inconsistent between ${configFileName} and Android native project.\\n` +\n `In ${configFileName}: Hermes is ${isHermesManaged ? 'enabled' : 'not enabled'}\\n` +\n `In Android native project: Hermes is ${isHermesManaged ? 'not enabled' : 'enabled'}\\n` +\n `Check the following files for inconsistencies:\\n` +\n ` - ${configFilePath}\\n` +\n ` - ${path.join(projectRoot, 'android', 'gradle.properties')}\\n` +\n ` - ${path.join(projectRoot, 'android', 'app', 'build.gradle')}\\n` +\n 'Learn more: https://expo.fyi/hermes-android-config'\n );\n }\n\n if (platform === 'ios' && (await maybeInconsistentEngineIosAsync(projectRoot, isHermesManaged))) {\n throw new Error(\n `JavaScript engine configuration is inconsistent between ${configFileName} and iOS native project.\\n` +\n `In ${configFileName}: Hermes is ${isHermesManaged ? 'enabled' : 'not enabled'}\\n` +\n `In iOS native project: Hermes is ${isHermesManaged ? 'not enabled' : 'enabled'}\\n` +\n `Check the following files for inconsistencies:\\n` +\n ` - ${configFilePath}\\n` +\n ` - ${path.join(projectRoot, 'ios', 'Podfile')}\\n` +\n ` - ${path.join(projectRoot, 'ios', 'Podfile.properties.json')}\\n` +\n 'Learn more: https://expo.fyi/hermes-ios-config'\n );\n }\n}\n\nexport async function maybeInconsistentEngineAndroidAsync(\n projectRoot: string,\n isHermesManaged: boolean\n): Promise<boolean> {\n // Trying best to check android native project if by chance to be consistent between app config\n\n // Check gradle.properties from prebuild template\n const gradlePropertiesPath = path.join(projectRoot, 'android', 'gradle.properties');\n if (fs.existsSync(gradlePropertiesPath)) {\n const props = parseGradleProperties(await fs.promises.readFile(gradlePropertiesPath, 'utf8'));\n const isHermesBare = props['hermesEnabled'] === 'true';\n if (isHermesManaged !== isHermesBare) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function isHermesPossiblyEnabled(projectRoot: string): boolean | null {\n // Trying best to check ios native project if by chance to be consistent between app config\n\n // Check ios/Podfile for a literal :hermes_enabled => (true|false) or hermes_enabled: (true|false)\n const podfilePath = path.join(projectRoot, 'ios', 'Podfile');\n if (fs.existsSync(podfilePath)) {\n const content = fs.readFileSync(podfilePath, 'utf8');\n const literal = getLiteralHermesSettingFromPodfile(content);\n if (literal != null) return literal;\n\n // If there is no props reference and no literal, assume Hermes is enabled by default\n const hasPropsReference = PODFILE_HERMES_PROPS_REFERENCE_RE.test(content);\n if (!hasPropsReference) {\n return true;\n }\n }\n\n // Check Podfile.properties.json from prebuild template\n const podfilePropertiesPath = path.join(projectRoot, 'ios', 'Podfile.properties.json');\n if (fs.existsSync(podfilePropertiesPath)) {\n try {\n const props = JsonFile.read(podfilePropertiesPath);\n return props['expo.jsEngine'] === 'hermes';\n } catch {\n // ignore\n }\n }\n\n return null;\n}\n\nexport async function maybeInconsistentEngineIosAsync(\n projectRoot: string,\n isHermesManaged: boolean\n): Promise<boolean> {\n // Trying best to check ios native project if by chance to be consistent between app config\n\n // Check ios/Podfile for a literal :hermes_enabled => (true|false)\n const podfilePath = path.join(projectRoot, 'ios', 'Podfile');\n if (fs.existsSync(podfilePath)) {\n const content = await fs.promises.readFile(podfilePath, 'utf8');\n const literal = getLiteralHermesSettingFromPodfile(content);\n if (literal != null) {\n if (isHermesManaged !== literal) return true;\n } else {\n // If there is no props reference and no literal, assume Hermes is enabled by default\n const hasPropsReference = PODFILE_HERMES_PROPS_REFERENCE_RE.test(content);\n if (!hasPropsReference) {\n const assumedEnabled = true;\n if (isHermesManaged !== assumedEnabled) return true;\n }\n }\n }\n\n // Check Podfile.properties.json from prebuild template\n const podfilePropertiesPath = path.join(projectRoot, 'ios', 'Podfile.properties.json');\n if (fs.existsSync(podfilePropertiesPath)) {\n const props = await parsePodfilePropertiesAsync(podfilePropertiesPath);\n const isHermesBare = props['expo.jsEngine'] === 'hermes';\n if (isHermesManaged !== isHermesBare) {\n return true;\n }\n }\n\n return false;\n}\n\n// https://github.com/facebook/hermes/blob/release-v0.5/include/hermes/BCGen/HBC/BytecodeFileFormat.h#L24-L25\nconst HERMES_MAGIC_HEADER = 'c61fbc03c103191f';\n\nexport async function isHermesBytecodeBundleAsync(file: string): Promise<boolean> {\n const header = await readHermesHeaderAsync(file);\n return header.subarray(0, 8).toString('hex') === HERMES_MAGIC_HEADER;\n}\n\nexport async function getHermesBytecodeBundleVersionAsync(file: string): Promise<number> {\n const header = await readHermesHeaderAsync(file);\n if (header.subarray(0, 8).toString('hex') !== HERMES_MAGIC_HEADER) {\n throw new Error('Invalid hermes bundle file');\n }\n return header.readUInt32LE(8);\n}\n\nasync function readHermesHeaderAsync(file: string): Promise<Buffer> {\n const fd = await fs.promises.open(file, 'r');\n const buffer = Buffer.alloc(12);\n await fd.read(buffer, 0, 12, null);\n await fd.close();\n return buffer;\n}\n\nasync function parsePodfilePropertiesAsync(\n podfilePropertiesPath: string\n): Promise<Record<string, string>> {\n try {\n return JSON.parse(await fs.promises.readFile(podfilePropertiesPath, 'utf8'));\n } catch {\n return {};\n }\n}\n\nexport function isAndroidUsingHermes(projectRoot: string) {\n // Check gradle.properties from prebuild template\n const gradlePropertiesPath = path.join(projectRoot, 'android', 'gradle.properties');\n if (fs.existsSync(gradlePropertiesPath)) {\n const props = parseGradleProperties(fs.readFileSync(gradlePropertiesPath, 'utf8'));\n return props['hermesEnabled'] === 'true';\n }\n\n // Assume Hermes is used by default.\n return true;\n}\n\nexport function isIosUsingHermes(projectRoot: string) {\n // If nullish, then assume Hermes is used.\n return isHermesPossiblyEnabled(projectRoot) !== false;\n}\n"],"names":["assertEngineMismatchAsync","getHermesBytecodeBundleVersionAsync","isAndroidUsingHermes","isEnableHermesManaged","isHermesBytecodeBundleAsync","isHermesPossiblyEnabled","isIosUsingHermes","maybeInconsistentEngineAndroidAsync","maybeInconsistentEngineIosAsync","maybeThrowFromInconsistentEngineAsync","parseGradleProperties","PODFILE_HERMES_LHS","PODFILE_HERMES_PROPS_REFERENCE_RE","RegExp","String","raw","source","PODFILE_HERMES_TRUE_RE","PODFILE_HERMES_FALSE_RE","getLiteralHermesSettingFromPodfile","content","isPropsReference","search","test","projectRoot","exp","platform","isHermesManaged","paths","getConfigFilePaths","configFilePath","dynamicConfigPath","staticConfigPath","expoConfig","android","jsEngine","ios","result","line","split","trim","startsWith","sepIndex","indexOf","key","slice","value","configFileName","path","basename","Error","join","gradlePropertiesPath","fs","existsSync","props","promises","readFile","isHermesBare","podfilePath","readFileSync","literal","hasPropsReference","podfilePropertiesPath","JsonFile","read","assumedEnabled","parsePodfilePropertiesAsync","HERMES_MAGIC_HEADER","file","header","readHermesHeaderAsync","subarray","toString","readUInt32LE","fd","open","buffer","Buffer","alloc","close","JSON","parse"],"mappings":";;;;;;;;;;;IAiCsBA,yBAAyB;eAAzBA;;IAmLAC,mCAAmC;eAAnCA;;IA0BNC,oBAAoB;eAApBA;;IA7LAC,qBAAqB;eAArBA;;IA8JMC,2BAA2B;eAA3BA;;IAtENC,uBAAuB;eAAvBA;;IAiHAC,gBAAgB;eAAhBA;;IApIMC,mCAAmC;eAAnCA;;IAkDAC,+BAA+B;eAA/BA;;IAvFAC,qCAAqC;eAArCA;;IAhBNC,qBAAqB;eAArBA;;;;yBAjEyC;;;;;;;gEACpC;;;;;;;gEACN;;;;;;;gEACE;;;;;;;;;;;AAEjB,MAAMC,qBAAqB;AAC3B,MAAMC,oCAAoC,IAAIC,OAC5CC,OAAOC,GAAG,CAAC,I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,MAAM,IAAIlB,MAAM;IAClB;IACA,OAAOoB,OAAOI,YAAY,CAAC;AAC7B;AAEA,eAAeH,sBAAsBF,IAAY;IAC/C,MAAMM,KAAK,MAAMtB,aAAE,CAACG,QAAQ,CAACoB,IAAI,CAACP,MAAM;IACxC,MAAMQ,SAASC,OAAOC,KAAK,CAAC;IAC5B,MAAMJ,GAAGV,IAAI,CAACY,QAAQ,GAAG,IAAI;IAC7B,MAAMF,GAAGK,KAAK;IACd,OAAOH;AACT;AAEA,eAAeV,4BACbJ,qBAA6B;IAE7B,IAAI;QACF,OAAOkB,KAAKC,KAAK,CAAC,MAAM7B,aAAE,CAACG,QAAQ,CAACC,QAAQ,CAACM,uBAAuB;IACtE,EAAE,OAAM;QACN,OAAO,CAAC;IACV;AACF;AAEO,SAAS7D,qBAAqBsB,WAAmB;IACtD,iDAAiD;IACjD,MAAM4B,uBAAuBJ,eAAI,CAACG,IAAI,CAAC3B,aAAa,WAAW;IAC/D,IAAI6B,aAAE,CAACC,UAAU,CAACF,uBAAuB;QACvC,MAAMG,QAAQ7C,sBAAsB2C,aAAE,CAACO,YAAY,CAACR,sBAAsB;QAC1E,OAAOG,KAAK,CAAC,gBAAgB,KAAK;IACpC;IAEA,oCAAoC;IACpC,OAAO;AACT;AAEO,SAASjD,iBAAiBkB,WAAmB;IAClD,0CAA0C;IAC1C,OAAOnB,wBAAwBmB,iBAAiB;AAClD"}
1
+ {"version":3,"sources":["../../../src/export/exportHermes.ts"],"sourcesContent":["import type { ExpoConfig, Platform } from '@expo/config';\nimport { getConfigFilePaths } from '@expo/config';\nimport JsonFile from '@expo/json-file';\nimport fs from 'fs';\nimport path from 'path';\n\nconst PODFILE_HERMES_LHS = /(?::hermes_enabled\\s*=>|hermes_enabled\\s*:)/;\nconst PODFILE_HERMES_PROPS_REFERENCE_RE = new RegExp(\n String.raw`^\\s*${PODFILE_HERMES_LHS.source}\\s*podfile_properties\\['expo\\.jsEngine'\\]\\s*==\\s*nil\\s*\\|\\|\\s*podfile_properties\\['expo\\.jsEngine'\\]\\s*==\\s*'hermes'\\s*,?\\s*(?:#.*)?$`,\n 'm'\n);\nconst PODFILE_HERMES_TRUE_RE = new RegExp(\n String.raw`^\\s*${PODFILE_HERMES_LHS.source}\\s*true\\s*(?:,\\s*)?(?:[^\\n]*)?$`,\n 'm'\n);\nconst PODFILE_HERMES_FALSE_RE = new RegExp(\n String.raw`^\\s*${PODFILE_HERMES_LHS.source}\\s*false\\s*(?:,\\s*)?(?:[^\\n]*)?$`,\n 'm'\n);\n\nfunction getLiteralHermesSettingFromPodfile(content: string): boolean | null {\n const isPropsReference = content.search(PODFILE_HERMES_PROPS_REFERENCE_RE) >= 0;\n if (isPropsReference) {\n return null;\n }\n if (PODFILE_HERMES_TRUE_RE.test(content)) {\n return true;\n }\n if (PODFILE_HERMES_FALSE_RE.test(content)) {\n return false;\n }\n return null;\n}\n\nexport async function assertEngineMismatchAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'ios' | 'android'>,\n platform: Platform\n) {\n const isHermesManaged = isEnableHermesManaged(exp, platform);\n const paths = getConfigFilePaths(projectRoot);\n const configFilePath = paths.dynamicConfigPath ?? paths.staticConfigPath ?? 'app.json';\n await maybeThrowFromInconsistentEngineAsync(\n projectRoot,\n configFilePath,\n platform,\n isHermesManaged\n );\n}\n\nexport function isEnableHermesManaged(\n expoConfig: Partial<Pick<ExpoConfig, 'ios' | 'android'>>,\n platform: string\n): boolean {\n switch (platform) {\n case 'android': {\n // NOTE(@kitten): `jsEngine` was deprecated, but we're preserving the check\n return ((expoConfig.android as any)?.jsEngine ?? (expoConfig as any).jsEngine) !== 'jsc';\n }\n case 'ios':\n case 'tvos':\n case 'macos': {\n // NOTE(@kitten): `jsEngine` was deprecated, but we're preserving the check\n return ((expoConfig.ios as any)?.jsEngine ?? (expoConfig as any).jsEngine) !== 'jsc';\n }\n default:\n return false;\n }\n}\n\nexport function parseGradleProperties(content: string): Record<string, string> {\n const result: Record<string, string> = {};\n for (let line of content.split('\\n')) {\n line = line.trim();\n if (!line || line.startsWith('#')) {\n continue;\n }\n\n const sepIndex = line.indexOf('=');\n const key = line.slice(0, sepIndex);\n const value = line.slice(sepIndex + 1);\n result[key] = value;\n }\n return result;\n}\n\nexport async function maybeThrowFromInconsistentEngineAsync(\n projectRoot: string,\n configFilePath: string,\n platform: string,\n isHermesManaged: boolean\n): Promise<void> {\n const configFileName = path.basename(configFilePath);\n if (\n platform === 'android' &&\n (await maybeInconsistentEngineAndroidAsync(projectRoot, isHermesManaged))\n ) {\n throw new Error(\n `JavaScript engine configuration is inconsistent between ${configFileName} and Android native project.\\n` +\n `In ${configFileName}: Hermes is ${isHermesManaged ? 'enabled' : 'not enabled'}\\n` +\n `In Android native project: Hermes is ${isHermesManaged ? 'not enabled' : 'enabled'}\\n` +\n `Check the following files for inconsistencies:\\n` +\n ` - ${configFilePath}\\n` +\n ` - ${path.join(projectRoot, 'android', 'gradle.properties')}\\n` +\n ` - ${path.join(projectRoot, 'android', 'app', 'build.gradle')}\\n` +\n 'Learn more: https://expo.fyi/hermes-android-config'\n );\n }\n\n // TODO(@kitten): Since Hermes is now assumed, we loosen the relevant check for tvos and macos and just\n // assume we should look at the ios folder, and can otherwise assume Hermes\n if (\n (platform === 'ios' || platform === 'tvos' || platform === 'macos') &&\n (await maybeInconsistentEngineIosAsync(projectRoot, isHermesManaged))\n ) {\n throw new Error(\n `JavaScript engine configuration is inconsistent between ${configFileName} and iOS native project.\\n` +\n `In ${configFileName}: Hermes is ${isHermesManaged ? 'enabled' : 'not enabled'}\\n` +\n `In iOS native project: Hermes is ${isHermesManaged ? 'not enabled' : 'enabled'}\\n` +\n `Check the following files for inconsistencies:\\n` +\n ` - ${configFilePath}\\n` +\n ` - ${path.join(projectRoot, 'ios', 'Podfile')}\\n` +\n ` - ${path.join(projectRoot, 'ios', 'Podfile.properties.json')}\\n` +\n 'Learn more: https://expo.fyi/hermes-ios-config'\n );\n }\n}\n\nexport async function maybeInconsistentEngineAndroidAsync(\n projectRoot: string,\n isHermesManaged: boolean\n): Promise<boolean> {\n // Trying best to check android native project if by chance to be consistent between app config\n\n // Check gradle.properties from prebuild template\n const gradlePropertiesPath = path.join(projectRoot, 'android', 'gradle.properties');\n if (fs.existsSync(gradlePropertiesPath)) {\n const props = parseGradleProperties(await fs.promises.readFile(gradlePropertiesPath, 'utf8'));\n const isHermesBare = props['hermesEnabled'] === 'true';\n if (isHermesManaged !== isHermesBare) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function isHermesPossiblyEnabled(projectRoot: string): boolean | null {\n // Trying best to check ios native project if by chance to be consistent between app config\n\n // Check ios/Podfile for a literal :hermes_enabled => (true|false) or hermes_enabled: (true|false)\n const podfilePath = path.join(projectRoot, 'ios', 'Podfile');\n if (fs.existsSync(podfilePath)) {\n const content = fs.readFileSync(podfilePath, 'utf8');\n const literal = getLiteralHermesSettingFromPodfile(content);\n if (literal != null) return literal;\n\n // If there is no props reference and no literal, assume Hermes is enabled by default\n const hasPropsReference = PODFILE_HERMES_PROPS_REFERENCE_RE.test(content);\n if (!hasPropsReference) {\n return true;\n }\n }\n\n // Check Podfile.properties.json from prebuild template\n const podfilePropertiesPath = path.join(projectRoot, 'ios', 'Podfile.properties.json');\n if (fs.existsSync(podfilePropertiesPath)) {\n try {\n const props = JsonFile.read(podfilePropertiesPath);\n return props['expo.jsEngine'] === 'hermes';\n } catch {\n // ignore\n }\n }\n\n return null;\n}\n\nexport async function maybeInconsistentEngineIosAsync(\n projectRoot: string,\n isHermesManaged: boolean\n): Promise<boolean> {\n // Trying best to check ios native project if by chance to be consistent between app config\n\n // Check ios/Podfile for a literal :hermes_enabled => (true|false)\n const podfilePath = path.join(projectRoot, 'ios', 'Podfile');\n if (fs.existsSync(podfilePath)) {\n const content = await fs.promises.readFile(podfilePath, 'utf8');\n const literal = getLiteralHermesSettingFromPodfile(content);\n if (literal != null) {\n if (isHermesManaged !== literal) return true;\n } else {\n // If there is no props reference and no literal, assume Hermes is enabled by default\n const hasPropsReference = PODFILE_HERMES_PROPS_REFERENCE_RE.test(content);\n if (!hasPropsReference) {\n const assumedEnabled = true;\n if (isHermesManaged !== assumedEnabled) return true;\n }\n }\n }\n\n // Check Podfile.properties.json from prebuild template\n const podfilePropertiesPath = path.join(projectRoot, 'ios', 'Podfile.properties.json');\n if (fs.existsSync(podfilePropertiesPath)) {\n const props = await parsePodfilePropertiesAsync(podfilePropertiesPath);\n const isHermesBare = props['expo.jsEngine'] === 'hermes';\n if (isHermesManaged !== isHermesBare) {\n return true;\n }\n }\n\n return false;\n}\n\n// https://github.com/facebook/hermes/blob/release-v0.5/include/hermes/BCGen/HBC/BytecodeFileFormat.h#L24-L25\nconst HERMES_MAGIC_HEADER = 'c61fbc03c103191f';\n\nexport async function isHermesBytecodeBundleAsync(file: string): Promise<boolean> {\n const header = await readHermesHeaderAsync(file);\n return header.subarray(0, 8).toString('hex') === HERMES_MAGIC_HEADER;\n}\n\nexport async function getHermesBytecodeBundleVersionAsync(file: string): Promise<number> {\n const header = await readHermesHeaderAsync(file);\n if (header.subarray(0, 8).toString('hex') !== HERMES_MAGIC_HEADER) {\n throw new Error('Invalid hermes bundle file');\n }\n return header.readUInt32LE(8);\n}\n\nasync function readHermesHeaderAsync(file: string): Promise<Buffer> {\n const fd = await fs.promises.open(file, 'r');\n const buffer = Buffer.alloc(12);\n await fd.read(buffer, 0, 12, null);\n await fd.close();\n return buffer;\n}\n\nasync function parsePodfilePropertiesAsync(\n podfilePropertiesPath: string\n): Promise<Record<string, string>> {\n try {\n return JSON.parse(await fs.promises.readFile(podfilePropertiesPath, 'utf8'));\n } catch {\n return {};\n }\n}\n\nexport function isAndroidUsingHermes(projectRoot: string) {\n // Check gradle.properties from prebuild template\n const gradlePropertiesPath = path.join(projectRoot, 'android', 'gradle.properties');\n if (fs.existsSync(gradlePropertiesPath)) {\n const props = parseGradleProperties(fs.readFileSync(gradlePropertiesPath, 'utf8'));\n return props['hermesEnabled'] === 'true';\n }\n\n // Assume Hermes is used by default.\n return true;\n}\n\nexport function isIosUsingHermes(projectRoot: string) {\n // Assume Hermes and/or just check iOS\n if (!fs.existsSync(path.join(projectRoot, 'ios'))) {\n return true;\n }\n // If nullish, then assume Hermes is used.\n return isHermesPossiblyEnabled(projectRoot) !== false;\n}\n"],"names":["assertEngineMismatchAsync","getHermesBytecodeBundleVersionAsync","isAndroidUsingHermes","isEnableHermesManaged","isHermesBytecodeBundleAsync","isHermesPossiblyEnabled","isIosUsingHermes","maybeInconsistentEngineAndroidAsync","maybeInconsistentEngineIosAsync","maybeThrowFromInconsistentEngineAsync","parseGradleProperties","PODFILE_HERMES_LHS","PODFILE_HERMES_PROPS_REFERENCE_RE","RegExp","String","raw","source","PODFILE_HERMES_TRUE_RE","PODFILE_HERMES_FALSE_RE","getLiteralHermesSettingFromPodfile","content","isPropsReference","search","test","projectRoot","exp","platform","isHermesManaged","paths","getConfigFilePaths","configFilePath","dynamicConfigPath","staticConfigPath","expoConfig","android","jsEngine","ios","result","line","split","trim","startsWith","sepIndex","indexOf","key","slice","value","configFileName","path","basename","Error","join","gradlePropertiesPath","fs","existsSync","props","promises","readFile","isHermesBare","podfilePath","readFileSync","literal","hasPropsReference","podfilePropertiesPath","JsonFile","read","assumedEnabled","parsePodfilePropertiesAsync","HERMES_MAGIC_HEADER","file","header","readHermesHeaderAsync","subarray","toString","readUInt32LE","fd","open","buffer","Buffer","alloc","close","JSON","parse"],"mappings":";;;;;;;;;;;QAkCsBA;eAAAA;;QA4LAC;eAAAA;;QA0BNC;eAAAA;;QAtMAC;eAAAA;;QAuKMC;eAAAA;;QAtENC;eAAAA;;QAiHAC;eAAAA;;QApIMC;eAAAA;;QAkDAC;eAAAA;;QA5FAC;eAAAA;;QAhBNC;eAAAA;;;;yBArEmB;;;;;;;gEACd;;;;;;;gEACN;;;;;;;gEACE;;;;;;;;;;;AAEjB,MAAMC,qBAAqB;AAC3B,MAAMC,oCAAoC,IAAIC,OAC5CC,OAAOC,GAAG,CAAC,IAAI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oCAAoCoE,IAAY;IACpE,MAAMC,SAAS,MAAMC,sBAAsBF;IAC3C,IAAIC,OAAOE,QAAQ,CAAC,GAAG,GAAGC,QAAQ,CAAC,WAAWL,qBAAqB;QACjE,MAAM,IAAIlB,MAAM;IAClB;IACA,OAAOoB,OAAOI,YAAY,CAAC;AAC7B;AAEA,eAAeH,sBAAsBF,IAAY;IAC/C,MAAMM,KAAK,MAAMtB,aAAE,CAACG,QAAQ,CAACoB,IAAI,CAACP,MAAM;IACxC,MAAMQ,SAASC,OAAOC,KAAK,CAAC;IAC5B,MAAMJ,GAAGV,IAAI,CAACY,QAAQ,GAAG,IAAI;IAC7B,MAAMF,GAAGK,KAAK;IACd,OAAOH;AACT;AAEA,eAAeV,4BACbJ,qBAA6B;IAE7B,IAAI;QACF,OAAOkB,KAAKC,KAAK,CAAC,MAAM7B,aAAE,CAACG,QAAQ,CAACC,QAAQ,CAACM,uBAAuB;IACtE,EAAE,OAAM;QACN,OAAO,CAAC;IACV;AACF;AAEO,SAAS7D,qBAAqBsB,WAAmB;IACtD,iDAAiD;IACjD,MAAM4B,uBAAuBJ,eAAI,CAACG,IAAI,CAAC3B,aAAa,WAAW;IAC/D,IAAI6B,aAAE,CAACC,UAAU,CAACF,uBAAuB;QACvC,MAAMG,QAAQ7C,sBAAsB2C,aAAE,CAACO,YAAY,CAACR,sBAAsB;QAC1E,OAAOG,KAAK,CAAC,gBAAgB,KAAK;IACpC;IAEA,oCAAoC;IACpC,OAAO;AACT;AAEO,SAASjD,iBAAiBkB,WAAmB;IAClD,sCAAsC;IACtC,IAAI,CAAC6B,aAAE,CAACC,UAAU,CAACN,eAAI,CAACG,IAAI,CAAC3B,aAAa,SAAS;QACjD,OAAO;IACT;IACA,0CAA0C;IAC1C,OAAOnB,wBAAwBmB,iBAAiB;AAClD"}
@@ -10,26 +10,26 @@ Object.defineProperty(exports, "__esModule", {
10
10
  function _export(target, all) {
11
11
  for(var name in all)Object.defineProperty(target, name, {
12
12
  enumerable: true,
13
- get: all[name]
13
+ get: Object.getOwnPropertyDescriptor(all, name).get
14
14
  });
15
15
  }
16
16
  _export(exports, {
17
- exportApiRoutesStandaloneAsync: function() {
17
+ get exportApiRoutesStandaloneAsync () {
18
18
  return exportApiRoutesStandaloneAsync;
19
19
  },
20
- exportFromServerAsync: function() {
20
+ get exportFromServerAsync () {
21
21
  return exportFromServerAsync;
22
22
  },
23
- getFilesToExportFromServerAsync: function() {
23
+ get getFilesToExportFromServerAsync () {
24
24
  return getFilesToExportFromServerAsync;
25
25
  },
26
- getHtmlFiles: function() {
26
+ get getHtmlFiles () {
27
27
  return getHtmlFiles;
28
28
  },
29
- getPathVariations: function() {
29
+ get getPathVariations () {
30
30
  return getPathVariations;
31
31
  },
32
- injectScriptTags: function() {
32
+ get injectScriptTags () {
33
33
  return injectScriptTags;
34
34
  }
35
35
  });
@@ -192,7 +192,7 @@ async function exportFromServerAsync(projectRoot, devServer, { outputDir, baseUr
192
192
  const isExporting = true;
193
193
  const isExportingWithSSR = exportServer && useServerRendering && !devServer.isReactServerComponentsEnabled;
194
194
  const appDir = _path().default.join(projectRoot, routerRoot);
195
- const injectFaviconTag = await (0, _favicon.getVirtualFaviconAssetsAsync)(projectRoot, {
195
+ const faviconAsset = await (0, _favicon.generateFaviconAssetAsync)(projectRoot, {
196
196
  outputDir,
197
197
  baseUrl,
198
198
  files,
@@ -219,7 +219,7 @@ async function exportFromServerAsync(projectRoot, devServer, { outputDir, baseUr
219
219
  var _exp_extra_router, _exp_extra;
220
220
  const normalizedPathname = pathname === '' ? '/' : pathname.startsWith('/') ? pathname : `/${pathname}`;
221
221
  const useServerLoaders = exp == null ? void 0 : (_exp_extra = exp.extra) == null ? void 0 : (_exp_extra_router = _exp_extra.router) == null ? void 0 : _exp_extra_router.unstable_useServerDataLoaders;
222
- let renderOpts;
222
+ const renderOpts = {};
223
223
  if (useServerLoaders) {
224
224
  const loaderResponse = await executeLoaderAsync(normalizedPathname, route);
225
225
  if (loaderResponse !== undefined) {
@@ -233,14 +233,19 @@ async function exportFromServerAsync(projectRoot, devServer, { outputDir, baseUr
233
233
  targetDomain: 'client',
234
234
  loaderId: loaderKey
235
235
  });
236
- renderOpts = {
237
- loader: {
238
- data,
239
- key: loaderKey
240
- }
236
+ renderOpts.loader = {
237
+ data,
238
+ key: loaderKey
241
239
  };
242
240
  }
243
241
  }
242
+ if (faviconAsset) {
243
+ renderOpts.assets = {
244
+ css: [],
245
+ js: [],
246
+ favicon: faviconAsset.href
247
+ };
248
+ }
244
249
  const template = await renderAsync(normalizedPathname, route, renderOpts);
245
250
  let html = (0, _serializeHtml.serializeHtmlWithAssets)({
246
251
  isExporting,
@@ -250,9 +255,6 @@ async function exportFromServerAsync(projectRoot, devServer, { outputDir, baseUr
250
255
  route,
251
256
  hydrate: true
252
257
  });
253
- if (injectFaviconTag) {
254
- html = injectFaviconTag(html);
255
- }
256
258
  if (scriptTags) {
257
259
  // Inject script tags into the HTML.
258
260
  // <script type="type/expo" data-platform="ios" src="..." />
@@ -317,6 +319,11 @@ async function exportFromServerAsync(projectRoot, devServer, { outputDir, baseUr
317
319
  }
318
320
  const toAssetUrl = (filename)=>baseUrl ? `${baseUrl}/${filename}` : `/${filename}`;
319
321
  const cssAssets = resources.artifacts.filter((asset)=>asset.type === 'css').map((asset)=>toAssetUrl(asset.filename));
322
+ // External stylesheets (`@import url(https://...)`) are extracted out of the bundled CSS.
323
+ const externalCssAssets = resources.artifacts.filter((asset)=>asset.type === 'css-external').map((asset)=>({
324
+ href: asset.filename,
325
+ media: asset.metadata.media
326
+ }));
320
327
  const jsArtifacts = resources.artifacts.filter((asset)=>asset.type === 'js');
321
328
  const orderedJsAssets = (0, _serializeHtml.assetsRequiresSort)(jsArtifacts);
322
329
  const syncJs = orderedJsAssets.filter((asset)=>!asset.metadata.isAsync);
@@ -353,7 +360,9 @@ async function exportFromServerAsync(projectRoot, devServer, { outputDir, baseUr
353
360
  callback: (manifest)=>{
354
361
  manifest.assets = {
355
362
  css: cssAssets,
356
- js: syncJsAssets
363
+ externalCss: externalCssAssets,
364
+ js: syncJsAssets,
365
+ favicon: faviconAsset == null ? void 0 : faviconAsset.href
357
366
  };
358
367
  manifest.rendering = {
359
368
  mode: 'ssr',
@@ -473,7 +482,7 @@ function getPathVariations(routePath) {
473
482
  return;
474
483
  }
475
484
  const [head, ...rest] = segments;
476
- if (matchGroupName(head)) {
485
+ if (head && matchGroupName(head)) {
477
486
  const groups = head.slice(1, -1).split(',');
478
487
  if (groups.length > 1) {
479
488
  for (const group of groups){
@@ -489,10 +498,10 @@ function getPathVariations(routePath) {
489
498
  generateVariations(rest, current ? `${current}/(${groups[0]})` : `(${groups[0]})`);
490
499
  // This code will continue and add paths without this group included`
491
500
  }
492
- } else if (current) {
501
+ } else if (head && current) {
493
502
  current = `${current}/${head}`;
494
503
  } else {
495
- current = head;
504
+ current = head ?? current;
496
505
  }
497
506
  generateVariations(rest, current);
498
507
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/export/exportStaticAsync.ts"],"sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { ExpoConfig } from '@expo/config';\nimport type { SerialAsset } from '@expo/metro-config/build/serializer/serializerAssets';\nimport chalk from 'chalk';\nimport { RouteNode } from 'expo-router/build/Route';\nimport { getContextKey, stripGroupSegmentsFromPath } from 'expo-router/build/matchers';\nimport { shouldLinkExternally } from 'expo-router/build/utils/url';\nimport { type RoutesManifest } from 'expo-server/private';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\nimport { inspect } from 'util';\n\nimport { getVirtualFaviconAssetsAsync } from './favicon';\nimport { persistMetroAssetsAsync } from './persistMetroAssets';\nimport { ExportAssetMap, getFilesFromSerialAssets } from './saveAssets';\nimport { Log } from '../log';\nimport {\n ExpoRouterRuntimeManifest,\n MetroBundlerDevServer,\n} from '../start/server/metro/MetroBundlerDevServer';\nimport { logMetroErrorAsync } from '../start/server/metro/metroErrorInterface';\nimport { getApiRoutesForDirectory, getMiddlewareForDirectory } from '../start/server/metro/router';\nimport {\n assetsRequiresSort,\n serializeHtmlWithAssets,\n sortMatchedAssetsByEntryPoints,\n} from '../start/server/metro/serializeHtml';\nimport { learnMore } from '../utils/link';\n\nconst debug = require('debug')('expo:export:generateStaticRoutes') as typeof console.log;\n\ntype ExtraScriptTag = {\n platform: string;\n src: string;\n};\n\ntype Options = {\n mode: 'production' | 'development';\n files?: ExportAssetMap;\n outputDir: string;\n minify: boolean;\n exportServer: boolean;\n baseUrl: string;\n includeSourceMaps: boolean;\n entryPoint?: string;\n clear: boolean;\n routerRoot: string;\n reactCompiler: boolean;\n maxWorkers?: number;\n isExporting: boolean;\n exp?: ExpoConfig;\n // <script type=\"type/expo\" data-platform=\"ios\" src=\"...\" />\n scriptTags?: ExtraScriptTag[];\n};\n\ntype HtmlRequestLocation = {\n /** The output file path name to use relative to the static folder. */\n filePath: string;\n /** The pathname to make requests to in order to fetch the HTML. */\n pathname: string;\n /** The runtime route node object, used to associate async modules with the static HTML. */\n route: RouteNode;\n};\n\nexport function injectScriptTags(html: string, scriptTags: ExtraScriptTag[]): string {\n const scriptTagsHtml = scriptTags\n .map((tag) =>\n tag.platform === 'web'\n ? `<script src=\"${tag.src}\"></script>`\n : `<script type=\"type/expo\" src=\"${tag.src}\" data-platform=\"${tag.platform}\"></script>`\n )\n .join('\\n');\n html = html.replace('</head>', `${scriptTagsHtml}\\n</head>`);\n return html;\n}\n\n/** Match `(page)` -> `page` */\nfunction matchGroupName(name: string): string | undefined {\n return name.match(/^\\(([^/]+?)\\)$/)?.[1];\n}\n\nexport async function getFilesToExportFromServerAsync(\n projectRoot: string,\n {\n manifest,\n serverManifest,\n renderAsync,\n // Servers can handle group routes automatically and therefore\n // don't require the build-time generation of every possible group\n // variation.\n exportServer,\n skipHtmlPrerendering,\n // name : contents\n files = new Map(),\n }: {\n manifest: ExpoRouterRuntimeManifest;\n serverManifest: RoutesManifest;\n renderAsync: (requestLocation: HtmlRequestLocation) => Promise<string>;\n exportServer?: boolean;\n /**\n * Skip HTML pre-rendering when SSR is enabled (HTML will be rendered at runtime).\n *\n * This is separate from `exportServer` because RSC mode also uses `exportServer: true`,\n * but still needs placeholder HTML files.\n */\n skipHtmlPrerendering?: boolean;\n files?: ExportAssetMap;\n }\n): Promise<ExportAssetMap> {\n if (!exportServer && serverManifest) {\n // When we're not exporting a `server` output, we provide a `_expo/.routes.json` for\n // EAS Hosting to recognize the `headers` and `redirects` configs\n const subsetServerManifest = {\n headers: serverManifest.headers,\n redirects: serverManifest.redirects,\n };\n files.set('_expo/.routes.json', {\n contents: JSON.stringify(subsetServerManifest, null, 2),\n targetDomain: 'client',\n });\n }\n\n // Skip HTML pre-rendering in SSR mode since HTML will be rendered at runtime.\n if (skipHtmlPrerendering) {\n return files;\n }\n\n await Promise.all(\n getHtmlFiles({ manifest, includeGroupVariations: !exportServer }).map(\n async ({ route, filePath, pathname }) => {\n // Rewrite routes should not be statically generated\n if (route.type === 'rewrite') {\n return;\n }\n\n try {\n const targetDomain = exportServer ? 'server' : 'client';\n files.set(filePath, { contents: '', targetDomain });\n const data = await renderAsync({ route, filePath, pathname });\n files.set(filePath, {\n contents: data,\n routeId: pathname,\n targetDomain,\n });\n } catch (e: any) {\n await logMetroErrorAsync({ error: e, projectRoot });\n throw new Error('Failed to statically export route: ' + pathname);\n }\n }\n )\n );\n\n return files;\n}\n\nfunction modifyRouteNodeInRuntimeManifest(\n manifest: ExpoRouterRuntimeManifest,\n callback: (route: RouteNode) => any\n) {\n const iterateScreens = (screens: ExpoRouterRuntimeManifest['screens']) => {\n Object.values(screens).map((value) => {\n if (typeof value !== 'string') {\n if (value._route) callback(value._route);\n iterateScreens(value.screens);\n }\n });\n };\n\n iterateScreens(manifest.screens);\n}\n\n// TODO: Do this earlier in the process.\nfunction makeRuntimeEntryPointsAbsolute(manifest: ExpoRouterRuntimeManifest, appDir: string) {\n modifyRouteNodeInRuntimeManifest(manifest, (route) => {\n if (Array.isArray(route.entryPoints)) {\n route.entryPoints = route.entryPoints.map((entryPoint) => {\n // TODO(@hassankhan): ENG-16577\n if (shouldLinkExternally(entryPoint)) {\n return entryPoint;\n }\n\n if (entryPoint.startsWith('.')) {\n return path.resolve(appDir, entryPoint);\n } else if (!path.isAbsolute(entryPoint)) {\n return resolveFrom(appDir, entryPoint);\n }\n return entryPoint;\n });\n }\n });\n}\n\n/** Perform all fs commits */\nexport async function exportFromServerAsync(\n projectRoot: string,\n devServer: MetroBundlerDevServer,\n {\n outputDir,\n baseUrl,\n exportServer,\n includeSourceMaps,\n routerRoot,\n files = new Map(),\n exp,\n scriptTags,\n }: Options\n): Promise<ExportAssetMap> {\n const useServerRendering = exp?.extra?.router?.unstable_useServerRendering ?? false;\n\n const logOutput =\n exp?.web?.output === 'server' && useServerRendering\n ? `Server rendering is enabled. ${learnMore('https://docs.expo.dev/router/web/server-rendering/')}`\n : `Static rendering is enabled. ${learnMore('https://docs.expo.dev/router/web/static-rendering/')}`;\n Log.log(logOutput);\n\n const platform = 'web';\n const isExporting = true;\n const isExportingWithSSR =\n exportServer && useServerRendering && !devServer.isReactServerComponentsEnabled;\n const appDir = path.join(projectRoot, routerRoot);\n const injectFaviconTag = await getVirtualFaviconAssetsAsync(projectRoot, {\n outputDir,\n baseUrl,\n files,\n exp,\n });\n\n const [resources, { manifest, serverManifest, renderAsync, executeLoaderAsync }] =\n await Promise.all([\n devServer.getStaticResourcesAsync({\n includeSourceMaps,\n }),\n devServer.getStaticRenderFunctionAsync(),\n ]);\n\n makeRuntimeEntryPointsAbsolute(manifest, appDir);\n\n debug('Routes:\\n', inspect(manifest, { colors: true, depth: null }));\n\n await getFilesToExportFromServerAsync(projectRoot, {\n files,\n manifest,\n serverManifest,\n exportServer,\n skipHtmlPrerendering: isExportingWithSSR,\n async renderAsync({ pathname, route }) {\n const normalizedPathname =\n pathname === '' ? '/' : pathname.startsWith('/') ? pathname : `/${pathname}`;\n\n const useServerLoaders = exp?.extra?.router?.unstable_useServerDataLoaders;\n let renderOpts;\n\n if (useServerLoaders) {\n const loaderResponse = await executeLoaderAsync(normalizedPathname, route);\n\n if (loaderResponse !== undefined) {\n const data = await loaderResponse.json();\n // Transforms a `route.contextKey` into a normalized path. For example,\n // `./nested/[id]/index.tsx` becomes `/nested/[id]/index`\n const loaderKey = getContextKey(route.contextKey);\n const fileSystemPath = `_expo/loaders${loaderKey}`;\n files.set(fileSystemPath, {\n contents: JSON.stringify(data, null, 2),\n targetDomain: 'client',\n loaderId: loaderKey,\n });\n\n renderOpts = { loader: { data, key: loaderKey } };\n }\n }\n\n const template = await renderAsync(normalizedPathname, route, renderOpts);\n let html = serializeHtmlWithAssets({\n isExporting,\n resources: resources.artifacts,\n template,\n baseUrl,\n route,\n hydrate: true,\n });\n\n if (injectFaviconTag) {\n html = injectFaviconTag(html);\n }\n\n if (scriptTags) {\n // Inject script tags into the HTML.\n // <script type=\"type/expo\" data-platform=\"ios\" src=\"...\" />\n html = injectScriptTags(html, scriptTags);\n }\n\n return html;\n },\n });\n\n getFilesFromSerialAssets(resources.artifacts, {\n platform,\n includeSourceMaps,\n files,\n isServerHosted: true,\n });\n\n if (resources.assets) {\n // TODO: Collect files without writing to disk.\n // NOTE(kitten): Re. above, this is now using `files` except for iOS catalog output, which isn't used here\n await persistMetroAssetsAsync(projectRoot, resources.assets, {\n files,\n platform,\n outputDirectory: outputDir,\n baseUrl,\n });\n }\n\n if (exportServer) {\n const apiRoutes = await exportApiRoutesAsync({\n platform: 'web',\n server: devServer,\n manifest: serverManifest,\n // NOTE(kitten): For now, we always output source maps for API route exports\n includeSourceMaps: true,\n });\n\n // Add the api routes to the files to export.\n for (const [route, contents] of apiRoutes) {\n files.set(route, contents);\n }\n\n // Export SSR render module and add SSR configuration to routes manifest\n if (isExportingWithSSR) {\n await devServer.exportExpoRouterRenderModuleAsync({\n files,\n includeSourceMaps: true,\n platform: 'web',\n });\n\n // Export loader bundles for routes that have loader exports\n const useServerLoaders = exp?.extra?.router?.unstable_useServerDataLoaders;\n if (useServerLoaders) {\n // Get `loaderReferences` from client bundle metadata to determine which routes have loaders\n const loaderReferences = resources.artifacts?.flatMap(\n (artifact) => artifact.metadata?.loaderReferences ?? []\n );\n\n await exportLoadersAsync({\n devServer,\n serverManifest,\n appDir,\n files,\n platform: 'web',\n loaderReferences,\n });\n }\n\n const toAssetUrl = (filename: string) =>\n baseUrl ? `${baseUrl}/${filename}` : `/${filename}`;\n\n const cssAssets = resources.artifacts\n .filter((asset) => asset.type === 'css')\n .map((asset) => toAssetUrl(asset.filename));\n\n const jsArtifacts = resources.artifacts.filter((asset) => asset.type === 'js');\n const orderedJsAssets = assetsRequiresSort(jsArtifacts);\n const syncJs = orderedJsAssets.filter((asset) => !asset.metadata.isAsync);\n const asyncJs = orderedJsAssets.filter((asset) => asset.metadata.isAsync);\n\n const syncJsAssets = syncJs.map((asset) => toAssetUrl(asset.filename));\n\n const htmlRoutes = getHtmlFiles({ manifest, includeGroupVariations: false });\n\n // Build per-route async chunk assignments\n const routeAssets = new Map<string, string[]>();\n for (const { route } of htmlRoutes) {\n if (!route.entryPoints || !Array.isArray(route.entryPoints)) {\n continue;\n }\n\n const matchedChunks: SerialAsset[] = [];\n for (const asyncChunk of asyncJs) {\n if (!asyncChunk.metadata.modulePaths || !Array.isArray(asyncChunk.metadata.modulePaths)) {\n continue;\n }\n const hasRouteEntryPoint = route.entryPoints.some((entryPoint) =>\n (asyncChunk.metadata.modulePaths as string[]).includes(entryPoint)\n );\n if (hasRouteEntryPoint) {\n matchedChunks.push(asyncChunk);\n }\n }\n\n if (matchedChunks.length > 0) {\n const sorted = sortMatchedAssetsByEntryPoints(matchedChunks, route.entryPoints);\n routeAssets.set(\n route.contextKey,\n sorted.map((chunk) => toAssetUrl(chunk.filename))\n );\n }\n }\n\n // Add assets and rendering config to the routes manifest\n updateExportManifestInFiles({\n files,\n callback: (manifest) => {\n manifest.assets = { css: cssAssets, js: syncJsAssets };\n manifest.rendering = {\n mode: 'ssr',\n file: '_expo/server/render.js',\n };\n\n for (const route of manifest.htmlRoutes) {\n const asyncChunks = routeAssets.get(route.file);\n if (asyncChunks) {\n route.assets = { css: [], js: asyncChunks };\n }\n }\n },\n });\n }\n } else {\n warnPossibleInvalidExportType(appDir);\n }\n\n return files;\n}\n\nexport function getHtmlFiles({\n manifest,\n includeGroupVariations,\n}: {\n manifest: ExpoRouterRuntimeManifest;\n includeGroupVariations?: boolean;\n}): HtmlRequestLocation[] {\n const htmlFiles = new Set<Omit<HtmlRequestLocation, 'pathname'>>();\n\n function traverseScreens(\n screens: ExpoRouterRuntimeManifest['screens'],\n route: RouteNode | null,\n baseUrl = ''\n ) {\n for (const [key, value] of Object.entries(screens)) {\n let leaf: string | null = null;\n if (typeof value === 'string') {\n leaf = value;\n } else if (value.screens && Object.keys(value.screens).length === 0) {\n // Ensure the trailing index is accounted for.\n if (key === value.path + '/index') {\n leaf = key;\n } else {\n leaf = value.path;\n }\n\n route = value._route ?? null;\n }\n\n if (leaf != null) {\n let filePath = baseUrl + leaf;\n\n if (leaf === '') {\n filePath =\n baseUrl === ''\n ? 'index'\n : baseUrl.endsWith('/')\n ? baseUrl + 'index'\n : baseUrl.slice(0, -1);\n } else if (\n // If the path is a collection of group segments leading to an index route, append `/index`.\n stripGroupSegmentsFromPath(filePath) === ''\n ) {\n filePath += '/index';\n }\n\n // This should never happen, the type of `string | object` originally comes from React Navigation.\n if (!route) {\n throw new Error(\n `Internal error: Route not found for \"${filePath}\" while collecting static export paths.`\n );\n }\n\n if (includeGroupVariations) {\n // TODO: Dedupe requests for alias routes.\n addOptionalGroups(filePath, route);\n } else {\n htmlFiles.add({\n filePath,\n route,\n });\n }\n } else if (typeof value === 'object' && value?.screens) {\n // The __root slot has no path.\n const newPath = value.path ? baseUrl + value.path + '/' : baseUrl;\n traverseScreens(value.screens, value._route ?? null, newPath);\n }\n }\n }\n\n function addOptionalGroups(path: string, route: RouteNode) {\n const variations = getPathVariations(path);\n for (const variation of variations) {\n htmlFiles.add({ filePath: variation, route });\n }\n }\n\n traverseScreens(manifest.screens, null);\n\n return uniqueBy(Array.from(htmlFiles), (value) => value.filePath).map((value) => {\n const parts = value.filePath.split('/');\n // Replace `:foo` with `[foo]` and `*foo` with `[...foo]`\n const partsWithGroups = parts.map((part) => {\n if (part === '*not-found') {\n return `+not-found`;\n } else if (part.startsWith(':')) {\n return `[${part.slice(1)}]`;\n } else if (part.startsWith('*')) {\n return `[...${part.slice(1)}]`;\n }\n return part;\n });\n const filePathLocation = partsWithGroups.join('/');\n const filePath = filePathLocation + '.html';\n return {\n ...value,\n filePath,\n pathname: filePathLocation.replace(/(\\/?index)?$/, ''),\n };\n });\n}\n\nfunction uniqueBy<T>(array: T[], key: (value: T) => string): T[] {\n const seen = new Set<string>();\n const result: T[] = [];\n for (const value of array) {\n const id = key(value);\n if (!seen.has(id)) {\n seen.add(id);\n result.push(value);\n }\n }\n return result;\n}\n\n// Given a route like `(foo)/bar/(baz)`, return all possible variations of the route.\n// e.g. `(foo)/bar/(baz)`, `(foo)/bar/baz`, `foo/bar/(baz)`, `foo/bar/baz`,\nexport function getPathVariations(routePath: string): string[] {\n const variations = new Set<string>();\n const segments = routePath.split('/');\n\n function generateVariations(segments: string[], current = ''): void {\n if (segments.length === 0) {\n if (current) variations.add(current);\n return;\n }\n\n const [head, ...rest] = segments;\n\n if (matchGroupName(head)) {\n const groups = head.slice(1, -1).split(',');\n\n if (groups.length > 1) {\n for (const group of groups) {\n // If there are multiple groups, recurse on each group.\n generateVariations([`(${group.trim()})`, ...rest], current);\n }\n return;\n } else {\n // Start a fork where this group is included\n generateVariations(rest, current ? `${current}/(${groups[0]})` : `(${groups[0]})`);\n // This code will continue and add paths without this group included`\n }\n } else if (current) {\n current = `${current}/${head}`;\n } else {\n current = head;\n }\n\n generateVariations(rest, current);\n }\n\n generateVariations(segments);\n\n return Array.from(variations);\n}\n\nexport async function exportApiRoutesStandaloneAsync(\n devServer: MetroBundlerDevServer,\n {\n files = new Map(),\n platform,\n apiRoutesOnly,\n templateHtml,\n }: {\n files?: ExportAssetMap;\n platform: string;\n apiRoutesOnly: boolean;\n templateHtml?: string;\n }\n) {\n const { serverManifest, htmlManifest } = await devServer.getServerManifestAsync();\n\n const apiRoutes = await exportApiRoutesAsync({\n server: devServer,\n manifest: serverManifest,\n // NOTE(kitten): For now, we always output source maps for API route exports\n includeSourceMaps: true,\n platform,\n apiRoutesOnly,\n });\n\n // Add the api routes to the files to export.\n for (const [route, contents] of apiRoutes) {\n files.set(route, contents);\n }\n\n if (templateHtml && devServer.isReactServerComponentsEnabled) {\n // TODO: Export an HTML entry for each file. This is a temporary solution until we have SSR/SSG for RSC.\n await getFilesToExportFromServerAsync(devServer.projectRoot, {\n manifest: htmlManifest,\n serverManifest,\n exportServer: true,\n files,\n renderAsync: async ({ pathname, filePath }) => {\n files.set(filePath, {\n contents: templateHtml!,\n routeId: pathname,\n targetDomain: 'server',\n });\n return templateHtml!;\n },\n });\n }\n\n return files;\n}\n\nasync function exportApiRoutesAsync({\n includeSourceMaps,\n server,\n platform,\n apiRoutesOnly,\n ...props\n}: Pick<Options, 'includeSourceMaps'> & {\n server: MetroBundlerDevServer;\n manifest: RoutesManifest<string>;\n platform: string;\n apiRoutesOnly?: boolean;\n}): Promise<ExportAssetMap> {\n const { manifest, files } = await server.exportExpoRouterApiRoutesAsync({\n outputDir: '_expo/functions',\n prerenderManifest: props.manifest,\n includeSourceMaps,\n platform,\n });\n\n // HACK: Clear out the HTML and 404 routes if we're only exporting API routes. This is used for native apps that are using API routes but haven't implemented web support yet.\n if (apiRoutesOnly) {\n manifest.htmlRoutes = [];\n manifest.notFoundRoutes = [];\n }\n\n files.set('_expo/routes.json', {\n contents: JSON.stringify(manifest, null, 2),\n targetDomain: 'server',\n });\n\n return files;\n}\n\nfunction warnPossibleInvalidExportType(appDir: string) {\n const apiRoutes = getApiRoutesForDirectory(appDir);\n if (apiRoutes.length) {\n // TODO: Allow API Routes for native-only.\n Log.warn(\n chalk.yellow`Skipping export for API routes because \\`web.output\\` is not \"server\". You may want to remove the routes: ${apiRoutes\n .map((v) => path.relative(appDir, v))\n .join(', ')}`\n );\n }\n\n const middlewareFile = getMiddlewareForDirectory(appDir);\n if (middlewareFile) {\n Log.warn(\n chalk.yellow`Skipping export for middleware because \\`web.output\\` is not \"server\". You may want to remove ${path.relative(appDir, middlewareFile)}`\n );\n }\n}\n\n/**\n * Export loader bundles for routes that have loader exports and updates routes in the manifest\n * with a `loader` property.\n */\nasync function exportLoadersAsync({\n devServer,\n serverManifest,\n appDir,\n files,\n platform,\n loaderReferences,\n}: {\n devServer: MetroBundlerDevServer;\n serverManifest: RoutesManifest<string>;\n appDir: string;\n files: ExportAssetMap;\n platform: string;\n /** File paths of modules with loader exports from client bundle metadata */\n loaderReferences: string[];\n}): Promise<void> {\n const entryPoints: { file: string; page: string }[] = [];\n\n for (const route of serverManifest.htmlRoutes) {\n // Skip generated routes\n if (route.generated) {\n continue;\n }\n\n const filePath = path.isAbsolute(route.file) ? route.file : path.join(appDir, route.file);\n\n if (loaderReferences.includes(filePath)) {\n entryPoints.push({\n file: filePath,\n page: route.page,\n });\n }\n }\n\n if (entryPoints.length === 0) {\n debug('No routes with loaders to bundle');\n return;\n }\n\n const entryPointModules = entryPoints.map((e) => e.page);\n debug('Bundling loaders for routes:', entryPointModules);\n\n await devServer.exportExpoRouterLoadersAsync({\n platform,\n entryPoints,\n files,\n outputDir: '_expo/loaders',\n includeSourceMaps: true,\n });\n\n // Update `htmlRoutes` in routes manifest for routes that have loaders\n updateExportManifestInFiles({\n files,\n callback: (manifest) => {\n const routesWithLoaders = new Set(entryPointModules);\n for (const route of manifest.htmlRoutes) {\n if (routesWithLoaders.has(route.page)) {\n route.loader = `_expo/loaders${route.page}.js`;\n }\n }\n },\n });\n\n debug('Exported loaders for routes:', entryPointModules);\n}\n\n// NOTE(@hassankhan): We should ideally persist the manifest to `files` only once instead of\n// modifying it afterwards.\nfunction updateExportManifestInFiles({\n files,\n callback,\n}: {\n files: ExportAssetMap;\n callback: (manifest: RoutesManifest<string>) => void;\n}) {\n const routesJsonEntry = files.get('_expo/routes.json');\n if (routesJsonEntry) {\n const manifest = JSON.parse(routesJsonEntry.contents as string);\n callback(manifest);\n\n files.set('_expo/routes.json', {\n ...routesJsonEntry,\n contents: JSON.stringify(manifest, null, 2),\n });\n }\n}\n"],"names":["exportApiRoutesStandaloneAsync","exportFromServerAsync","getFilesToExportFromServerAsync","getHtmlFiles","getPathVariations","injectScriptTags","debug","require","html","scriptTags","scriptTagsHtml","map","tag","platform","src","join","replace","matchGroupName","name","match","projectRoot","manifest","serverManifest","renderAsync","exportServer","skipHtmlPrerendering","files","Map","subsetServerManifest","headers","redirects","set","contents","JSON","stringify","targetDomain","Promise","all","includeGroupVariations","route","filePath","pathname","type","data","routeId","e","logMetroErrorAsync","error","Error","modifyRouteNodeInRuntimeManifest","callback","iterateScreens","screens","Object","values","value","_route","makeRuntimeEntryPointsAbsolute","appDir","Array","isArray","entryPoints","entryPoint","shouldLinkExternally","startsWith","path","resolve","isAbsolute","resolveFrom","devServer","outputDir","baseUrl","includeSourceMaps","routerRoot","exp","useServerRendering","extra","router","unstable_useServerRendering","logOutput","web","output","learnMore","Log","log","isExporting","isExportingWithSSR","isReactServerComponentsEnabled","injectFaviconTag","getVirtualFaviconAssetsAsync","resources","executeLoaderAsync","getStaticResourcesAsync","getStaticRenderFunctionAsync","inspect","colors","depth","normalizedPathname","useServerLoaders","unstable_useServerDataLoaders","renderOpts","loaderResponse","undefined","json","loaderKey","getContextKey","contextKey","fileSystemPath","loaderId","loader","key","template","serializeHtmlWithAssets","artifacts","hydrate","getFilesFromSerialAssets","isServerHosted","assets","persistMetroAssetsAsync","outputDirectory","apiRoutes","exportApiRoutesAsync","server","exportExpoRouterRenderModuleAsync","loaderReferences","flatMap","artifact","metadata","exportLoadersAsync","toAssetUrl","filename","cssAssets","filter","asset","jsArtifacts","orderedJsAssets","assetsRequiresSort","syncJs","isAsync","asyncJs","syncJsAssets","htmlRoutes","routeAssets","matchedChunks","asyncChunk","modulePaths","hasRouteEntryPoint","some","includes","push","length","sorted","sortMatchedAssetsByEntryPoints","chunk","updateExportManifestInFiles","css","js","rendering","mode","file","asyncChunks","get","warnPossibleInvalidExportType","htmlFiles","Set","traverseScreens","entries","leaf","keys","endsWith","slice","stripGroupSegmentsFromPath","addOptionalGroups","add","newPath","variations","variation","uniqueBy","from","parts","split","partsWithGroups","part","filePathLocation","array","seen","result","id","has","routePath","segments","generateVariations","current","head","rest","groups","group","trim","apiRoutesOnly","templateHtml","htmlManifest","getServerManifestAsync","props","exportExpoRouterApiRoutesAsync","prerenderManifest","notFoundRoutes","getApiRoutesForDirectory","warn","chalk","yellow","v","relative","middlewareFile","getMiddlewareForDirectory","generated","page","entryPointModules","exportExpoRouterLoadersAsync","routesWithLoaders","routesJsonEntry","parse"],"mappings":"AAAA;;;;;CAKC;;;;;;;;;;;IAqkBqBA,8BAA8B;eAA9BA;;IApYAC,qBAAqB;eAArBA;;IAhHAC,+BAA+B;eAA/BA;;IAuVNC,YAAY;eAAZA;;IAqHAC,iBAAiB;eAAjBA;;IA7dAC,gBAAgB;eAAhBA;;;;gEA7DE;;;;;;;yBAEwC;;;;;;;yBACrB;;;;;;;gEAEpB;;;;;;;gEACO;;;;;;;yBACA;;;;;;yBAEqB;oCACL;4BACiB;qBACrC;qCAKe;wBACiC;+BAK7D;sBACmB;;;;;;AAE1B,MAAMC,QAAQC,QAAQ,SAAS;AAmCxB,SAASF,iBAAiBG,IAAY,EAAEC,UAA4B;IACzE,MAAMC,iBAAiBD,WACpBE,GAAG,CAAC,CAACC,MACJA,IAAIC,QAAQ,KAAK,QACb,CAAC,aAAa,EAAED,IAAIE,GAAG,CAAC,WAAW,CAAC,GACpC,CAAC,8BAA8B,EAAEF,IAAIE,GAAG,CAAC,iBAAiB,EAAEF,IAAIC,QAAQ,CAAC,WAAW,CAAC,EAE1FE,IAAI,CAAC;IACRP,OAAOA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AG;QAC5BhJ,MAAM;QACN;IACF;IAEA,MAAMkN,oBAAoB3J,YAAYlD,GAAG,CAAC,CAACkC,IAAMA,EAAE0K,IAAI;IACvDjN,MAAM,gCAAgCkN;IAEtC,MAAMnJ,UAAUoJ,4BAA4B,CAAC;QAC3C5M;QACAgD;QACAnC;QACA4C,WAAW;QACXE,mBAAmB;IACrB;IAEA,sEAAsE;IACtEkF,4BAA4B;QAC1BhI;QACAwB,UAAU,CAAC7B;YACT,MAAMqM,oBAAoB,IAAItD,IAAIoD;YAClC,KAAK,MAAMjL,SAASlB,SAASwH,UAAU,CAAE;gBACvC,IAAI6E,kBAAkB9B,GAAG,CAACrJ,MAAMgL,IAAI,GAAG;oBACrChL,MAAMsE,MAAM,GAAG,CAAC,aAAa,EAAEtE,MAAMgL,IAAI,CAAC,GAAG,CAAC;gBAChD;YACF;QACF;IACF;IAEAjN,MAAM,gCAAgCkN;AACxC;AAEA,4FAA4F;AAC5F,2BAA2B;AAC3B,SAAS9D,4BAA4B,EACnChI,KAAK,EACLwB,QAAQ,EAIT;IACC,MAAMyK,kBAAkBjM,MAAMuI,GAAG,CAAC;IAClC,IAAI0D,iBAAiB;QACnB,MAAMtM,WAAWY,KAAK2L,KAAK,CAACD,gBAAgB3L,QAAQ;QACpDkB,SAAS7B;QAETK,MAAMK,GAAG,CAAC,qBAAqB;YAC7B,GAAG4L,eAAe;YAClB3L,UAAUC,KAAKC,SAAS,CAACb,UAAU,MAAM;QAC3C;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/export/exportStaticAsync.ts"],"sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport type { ExpoConfig } from '@expo/config';\nimport type { SerialAsset } from '@expo/metro-config/build/serializer/serializerAssets';\nimport type { GetStaticContentOptions } from '@expo/router-server/build/static/renderStaticContent';\nimport chalk from 'chalk';\nimport type { RouteNode } from 'expo-router/build/Route';\nimport { getContextKey, stripGroupSegmentsFromPath } from 'expo-router/build/matchers';\nimport { shouldLinkExternally } from 'expo-router/build/utils/url';\nimport type { RoutesManifest } from 'expo-server/private';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\nimport { inspect } from 'util';\n\nimport { generateFaviconAssetAsync } from './favicon';\nimport { persistMetroAssetsAsync } from './persistMetroAssets';\nimport type { ExportAssetMap } from './saveAssets';\nimport { getFilesFromSerialAssets } from './saveAssets';\nimport { Log } from '../log';\nimport type {\n ExpoRouterRuntimeManifest,\n MetroBundlerDevServer,\n} from '../start/server/metro/MetroBundlerDevServer';\nimport { logMetroErrorAsync } from '../start/server/metro/metroErrorInterface';\nimport { getApiRoutesForDirectory, getMiddlewareForDirectory } from '../start/server/metro/router';\nimport {\n assetsRequiresSort,\n serializeHtmlWithAssets,\n sortMatchedAssetsByEntryPoints,\n} from '../start/server/metro/serializeHtml';\nimport { learnMore } from '../utils/link';\n\nconst debug = require('debug')('expo:export:generateStaticRoutes') as typeof console.log;\n\ntype ExtraScriptTag = {\n platform: string;\n src: string;\n};\n\ntype Options = {\n mode: 'production' | 'development';\n files?: ExportAssetMap;\n outputDir: string;\n minify: boolean;\n exportServer: boolean;\n baseUrl: string;\n includeSourceMaps: boolean;\n entryPoint?: string;\n clear: boolean;\n routerRoot: string;\n reactCompiler: boolean;\n maxWorkers?: number;\n isExporting: boolean;\n exp?: ExpoConfig;\n // <script type=\"type/expo\" data-platform=\"ios\" src=\"...\" />\n scriptTags?: ExtraScriptTag[];\n};\n\ntype HtmlRequestLocation = {\n /** The output file path name to use relative to the static folder. */\n filePath: string;\n /** The pathname to make requests to in order to fetch the HTML. */\n pathname: string;\n /** The runtime route node object, used to associate async modules with the static HTML. */\n route: RouteNode;\n};\n\nexport function injectScriptTags(html: string, scriptTags: ExtraScriptTag[]): string {\n const scriptTagsHtml = scriptTags\n .map((tag) =>\n tag.platform === 'web'\n ? `<script src=\"${tag.src}\"></script>`\n : `<script type=\"type/expo\" src=\"${tag.src}\" data-platform=\"${tag.platform}\"></script>`\n )\n .join('\\n');\n html = html.replace('</head>', `${scriptTagsHtml}\\n</head>`);\n return html;\n}\n\n/** Match `(page)` -> `page` */\nfunction matchGroupName(name: string): string | undefined {\n return name.match(/^\\(([^/]+?)\\)$/)?.[1];\n}\n\nexport async function getFilesToExportFromServerAsync(\n projectRoot: string,\n {\n manifest,\n serverManifest,\n renderAsync,\n // Servers can handle group routes automatically and therefore\n // don't require the build-time generation of every possible group\n // variation.\n exportServer,\n skipHtmlPrerendering,\n // name : contents\n files = new Map(),\n }: {\n manifest: ExpoRouterRuntimeManifest;\n serverManifest: RoutesManifest;\n renderAsync: (requestLocation: HtmlRequestLocation) => Promise<string>;\n exportServer?: boolean;\n /**\n * Skip HTML pre-rendering when SSR is enabled (HTML will be rendered at runtime).\n *\n * This is separate from `exportServer` because RSC mode also uses `exportServer: true`,\n * but still needs placeholder HTML files.\n */\n skipHtmlPrerendering?: boolean;\n files?: ExportAssetMap;\n }\n): Promise<ExportAssetMap> {\n if (!exportServer && serverManifest) {\n // When we're not exporting a `server` output, we provide a `_expo/.routes.json` for\n // EAS Hosting to recognize the `headers` and `redirects` configs\n const subsetServerManifest = {\n headers: serverManifest.headers,\n redirects: serverManifest.redirects,\n };\n files.set('_expo/.routes.json', {\n contents: JSON.stringify(subsetServerManifest, null, 2),\n targetDomain: 'client',\n });\n }\n\n // Skip HTML pre-rendering in SSR mode since HTML will be rendered at runtime.\n if (skipHtmlPrerendering) {\n return files;\n }\n\n await Promise.all(\n getHtmlFiles({ manifest, includeGroupVariations: !exportServer }).map(\n async ({ route, filePath, pathname }) => {\n // Rewrite routes should not be statically generated\n if (route.type === 'rewrite') {\n return;\n }\n\n try {\n const targetDomain = exportServer ? 'server' : 'client';\n files.set(filePath, { contents: '', targetDomain });\n const data = await renderAsync({ route, filePath, pathname });\n files.set(filePath, {\n contents: data,\n routeId: pathname,\n targetDomain,\n });\n } catch (e: any) {\n await logMetroErrorAsync({ error: e, projectRoot });\n throw new Error('Failed to statically export route: ' + pathname);\n }\n }\n )\n );\n\n return files;\n}\n\nfunction modifyRouteNodeInRuntimeManifest(\n manifest: ExpoRouterRuntimeManifest,\n callback: (route: RouteNode) => any\n) {\n const iterateScreens = (screens: ExpoRouterRuntimeManifest['screens']) => {\n Object.values(screens).map((value) => {\n if (typeof value !== 'string') {\n if (value._route) callback(value._route);\n iterateScreens(value.screens);\n }\n });\n };\n\n iterateScreens(manifest.screens);\n}\n\n// TODO: Do this earlier in the process.\nfunction makeRuntimeEntryPointsAbsolute(manifest: ExpoRouterRuntimeManifest, appDir: string) {\n modifyRouteNodeInRuntimeManifest(manifest, (route) => {\n if (Array.isArray(route.entryPoints)) {\n route.entryPoints = route.entryPoints.map((entryPoint) => {\n // TODO(@hassankhan): ENG-16577\n if (shouldLinkExternally(entryPoint)) {\n return entryPoint;\n }\n\n if (entryPoint.startsWith('.')) {\n return path.resolve(appDir, entryPoint);\n } else if (!path.isAbsolute(entryPoint)) {\n return resolveFrom(appDir, entryPoint);\n }\n return entryPoint;\n });\n }\n });\n}\n\n/** Perform all fs commits */\nexport async function exportFromServerAsync(\n projectRoot: string,\n devServer: MetroBundlerDevServer,\n {\n outputDir,\n baseUrl,\n exportServer,\n includeSourceMaps,\n routerRoot,\n files = new Map(),\n exp,\n scriptTags,\n }: Options\n): Promise<ExportAssetMap> {\n const useServerRendering = exp?.extra?.router?.unstable_useServerRendering ?? false;\n\n const logOutput =\n exp?.web?.output === 'server' && useServerRendering\n ? `Server rendering is enabled. ${learnMore('https://docs.expo.dev/router/web/server-rendering/')}`\n : `Static rendering is enabled. ${learnMore('https://docs.expo.dev/router/web/static-rendering/')}`;\n Log.log(logOutput);\n\n const platform = 'web';\n const isExporting = true;\n const isExportingWithSSR =\n exportServer && useServerRendering && !devServer.isReactServerComponentsEnabled;\n const appDir = path.join(projectRoot, routerRoot);\n const faviconAsset = await generateFaviconAssetAsync(projectRoot, {\n outputDir,\n baseUrl,\n files,\n exp,\n });\n\n const [resources, { manifest, serverManifest, renderAsync, executeLoaderAsync }] =\n await Promise.all([\n devServer.getStaticResourcesAsync({\n includeSourceMaps,\n }),\n devServer.getStaticRenderFunctionAsync(),\n ]);\n\n makeRuntimeEntryPointsAbsolute(manifest, appDir);\n\n debug('Routes:\\n', inspect(manifest, { colors: true, depth: null }));\n\n await getFilesToExportFromServerAsync(projectRoot, {\n files,\n manifest,\n serverManifest,\n exportServer,\n skipHtmlPrerendering: isExportingWithSSR,\n async renderAsync({ pathname, route }) {\n const normalizedPathname =\n pathname === '' ? '/' : pathname.startsWith('/') ? pathname : `/${pathname}`;\n\n const useServerLoaders = exp?.extra?.router?.unstable_useServerDataLoaders;\n const renderOpts: GetStaticContentOptions = {};\n\n if (useServerLoaders) {\n const loaderResponse = await executeLoaderAsync(normalizedPathname, route);\n\n if (loaderResponse !== undefined) {\n const data = await loaderResponse.json();\n // Transforms a `route.contextKey` into a normalized path. For example,\n // `./nested/[id]/index.tsx` becomes `/nested/[id]/index`\n const loaderKey = getContextKey(route.contextKey);\n const fileSystemPath = `_expo/loaders${loaderKey}`;\n files.set(fileSystemPath, {\n contents: JSON.stringify(data, null, 2),\n targetDomain: 'client',\n loaderId: loaderKey,\n });\n\n renderOpts.loader = { data, key: loaderKey };\n }\n }\n\n if (faviconAsset) {\n renderOpts.assets = { css: [], js: [], favicon: faviconAsset.href };\n }\n\n const template = await renderAsync(normalizedPathname, route, renderOpts);\n let html = serializeHtmlWithAssets({\n isExporting,\n resources: resources.artifacts,\n template,\n baseUrl,\n route,\n hydrate: true,\n });\n\n if (scriptTags) {\n // Inject script tags into the HTML.\n // <script type=\"type/expo\" data-platform=\"ios\" src=\"...\" />\n html = injectScriptTags(html, scriptTags);\n }\n\n return html;\n },\n });\n\n getFilesFromSerialAssets(resources.artifacts, {\n platform,\n includeSourceMaps,\n files,\n isServerHosted: true,\n });\n\n if (resources.assets) {\n // TODO: Collect files without writing to disk.\n // NOTE(kitten): Re. above, this is now using `files` except for iOS catalog output, which isn't used here\n await persistMetroAssetsAsync(projectRoot, resources.assets, {\n files,\n platform,\n outputDirectory: outputDir,\n baseUrl,\n });\n }\n\n if (exportServer) {\n const apiRoutes = await exportApiRoutesAsync({\n platform: 'web',\n server: devServer,\n manifest: serverManifest,\n // NOTE(kitten): For now, we always output source maps for API route exports\n includeSourceMaps: true,\n });\n\n // Add the api routes to the files to export.\n for (const [route, contents] of apiRoutes) {\n files.set(route, contents);\n }\n\n // Export SSR render module and add SSR configuration to routes manifest\n if (isExportingWithSSR) {\n await devServer.exportExpoRouterRenderModuleAsync({\n files,\n includeSourceMaps: true,\n platform: 'web',\n });\n\n // Export loader bundles for routes that have loader exports\n const useServerLoaders = exp?.extra?.router?.unstable_useServerDataLoaders;\n if (useServerLoaders) {\n // Get `loaderReferences` from client bundle metadata to determine which routes have loaders\n const loaderReferences = resources.artifacts?.flatMap(\n (artifact) => artifact.metadata?.loaderReferences ?? []\n );\n\n await exportLoadersAsync({\n devServer,\n serverManifest,\n appDir,\n files,\n platform: 'web',\n loaderReferences,\n });\n }\n\n const toAssetUrl = (filename: string) =>\n baseUrl ? `${baseUrl}/${filename}` : `/${filename}`;\n\n const cssAssets = resources.artifacts\n .filter((asset) => asset.type === 'css')\n .map((asset) => toAssetUrl(asset.filename));\n\n // External stylesheets (`@import url(https://...)`) are extracted out of the bundled CSS.\n const externalCssAssets = resources.artifacts\n .filter((asset) => asset.type === 'css-external')\n .map((asset) => ({\n href: asset.filename,\n media: asset.metadata.media,\n }));\n\n const jsArtifacts = resources.artifacts.filter((asset) => asset.type === 'js');\n const orderedJsAssets = assetsRequiresSort(jsArtifacts);\n const syncJs = orderedJsAssets.filter((asset) => !asset.metadata.isAsync);\n const asyncJs = orderedJsAssets.filter((asset) => asset.metadata.isAsync);\n\n const syncJsAssets = syncJs.map((asset) => toAssetUrl(asset.filename));\n\n const htmlRoutes = getHtmlFiles({ manifest, includeGroupVariations: false });\n\n // Build per-route async chunk assignments\n const routeAssets = new Map<string, string[]>();\n for (const { route } of htmlRoutes) {\n if (!route.entryPoints || !Array.isArray(route.entryPoints)) {\n continue;\n }\n\n const matchedChunks: SerialAsset[] = [];\n for (const asyncChunk of asyncJs) {\n if (!asyncChunk.metadata.modulePaths || !Array.isArray(asyncChunk.metadata.modulePaths)) {\n continue;\n }\n const hasRouteEntryPoint = route.entryPoints.some((entryPoint) =>\n (asyncChunk.metadata.modulePaths as string[]).includes(entryPoint)\n );\n if (hasRouteEntryPoint) {\n matchedChunks.push(asyncChunk);\n }\n }\n\n if (matchedChunks.length > 0) {\n const sorted = sortMatchedAssetsByEntryPoints(matchedChunks, route.entryPoints);\n routeAssets.set(\n route.contextKey,\n sorted.map((chunk) => toAssetUrl(chunk.filename))\n );\n }\n }\n\n // Add assets and rendering config to the routes manifest\n updateExportManifestInFiles({\n files,\n callback: (manifest) => {\n manifest.assets = {\n css: cssAssets,\n externalCss: externalCssAssets,\n js: syncJsAssets,\n favicon: faviconAsset?.href,\n };\n manifest.rendering = {\n mode: 'ssr',\n file: '_expo/server/render.js',\n };\n\n for (const route of manifest.htmlRoutes) {\n const asyncChunks = routeAssets.get(route.file);\n if (asyncChunks) {\n route.assets = { css: [], js: asyncChunks };\n }\n }\n },\n });\n }\n } else {\n warnPossibleInvalidExportType(appDir);\n }\n\n return files;\n}\n\nexport function getHtmlFiles({\n manifest,\n includeGroupVariations,\n}: {\n manifest: ExpoRouterRuntimeManifest;\n includeGroupVariations?: boolean;\n}): HtmlRequestLocation[] {\n const htmlFiles = new Set<Omit<HtmlRequestLocation, 'pathname'>>();\n\n function traverseScreens(\n screens: ExpoRouterRuntimeManifest['screens'],\n route: RouteNode | null,\n baseUrl = ''\n ) {\n for (const [key, value] of Object.entries(screens)) {\n let leaf: string | null = null;\n if (typeof value === 'string') {\n leaf = value;\n } else if (value.screens && Object.keys(value.screens).length === 0) {\n // Ensure the trailing index is accounted for.\n if (key === value.path + '/index') {\n leaf = key;\n } else {\n leaf = value.path;\n }\n\n route = value._route ?? null;\n }\n\n if (leaf != null) {\n let filePath = baseUrl + leaf;\n\n if (leaf === '') {\n filePath =\n baseUrl === ''\n ? 'index'\n : baseUrl.endsWith('/')\n ? baseUrl + 'index'\n : baseUrl.slice(0, -1);\n } else if (\n // If the path is a collection of group segments leading to an index route, append `/index`.\n stripGroupSegmentsFromPath(filePath) === ''\n ) {\n filePath += '/index';\n }\n\n // This should never happen, the type of `string | object` originally comes from React Navigation.\n if (!route) {\n throw new Error(\n `Internal error: Route not found for \"${filePath}\" while collecting static export paths.`\n );\n }\n\n if (includeGroupVariations) {\n // TODO: Dedupe requests for alias routes.\n addOptionalGroups(filePath, route);\n } else {\n htmlFiles.add({\n filePath,\n route,\n });\n }\n } else if (typeof value === 'object' && value?.screens) {\n // The __root slot has no path.\n const newPath = value.path ? baseUrl + value.path + '/' : baseUrl;\n traverseScreens(value.screens, value._route ?? null, newPath);\n }\n }\n }\n\n function addOptionalGroups(path: string, route: RouteNode) {\n const variations = getPathVariations(path);\n for (const variation of variations) {\n htmlFiles.add({ filePath: variation, route });\n }\n }\n\n traverseScreens(manifest.screens, null);\n\n return uniqueBy(Array.from(htmlFiles), (value) => value.filePath).map((value) => {\n const parts = value.filePath.split('/');\n // Replace `:foo` with `[foo]` and `*foo` with `[...foo]`\n const partsWithGroups = parts.map((part) => {\n if (part === '*not-found') {\n return `+not-found`;\n } else if (part.startsWith(':')) {\n return `[${part.slice(1)}]`;\n } else if (part.startsWith('*')) {\n return `[...${part.slice(1)}]`;\n }\n return part;\n });\n const filePathLocation = partsWithGroups.join('/');\n const filePath = filePathLocation + '.html';\n return {\n ...value,\n filePath,\n pathname: filePathLocation.replace(/(\\/?index)?$/, ''),\n };\n });\n}\n\nfunction uniqueBy<T>(array: T[], key: (value: T) => string): T[] {\n const seen = new Set<string>();\n const result: T[] = [];\n for (const value of array) {\n const id = key(value);\n if (!seen.has(id)) {\n seen.add(id);\n result.push(value);\n }\n }\n return result;\n}\n\n// Given a route like `(foo)/bar/(baz)`, return all possible variations of the route.\n// e.g. `(foo)/bar/(baz)`, `(foo)/bar/baz`, `foo/bar/(baz)`, `foo/bar/baz`,\nexport function getPathVariations(routePath: string): string[] {\n const variations = new Set<string>();\n const segments = routePath.split('/');\n\n function generateVariations(segments: string[], current = ''): void {\n if (segments.length === 0) {\n if (current) variations.add(current);\n return;\n }\n\n const [head, ...rest] = segments;\n\n if (head && matchGroupName(head)) {\n const groups = head.slice(1, -1).split(',');\n\n if (groups.length > 1) {\n for (const group of groups) {\n // If there are multiple groups, recurse on each group.\n generateVariations([`(${group.trim()})`, ...rest], current);\n }\n return;\n } else {\n // Start a fork where this group is included\n generateVariations(rest, current ? `${current}/(${groups[0]})` : `(${groups[0]})`);\n // This code will continue and add paths without this group included`\n }\n } else if (head && current) {\n current = `${current}/${head}`;\n } else {\n current = head ?? current;\n }\n\n generateVariations(rest, current);\n }\n\n generateVariations(segments);\n\n return Array.from(variations);\n}\n\nexport async function exportApiRoutesStandaloneAsync(\n devServer: MetroBundlerDevServer,\n {\n files = new Map(),\n platform,\n apiRoutesOnly,\n templateHtml,\n }: {\n files?: ExportAssetMap;\n platform: string;\n apiRoutesOnly: boolean;\n templateHtml?: string;\n }\n) {\n const { serverManifest, htmlManifest } = await devServer.getServerManifestAsync();\n\n const apiRoutes = await exportApiRoutesAsync({\n server: devServer,\n manifest: serverManifest,\n // NOTE(kitten): For now, we always output source maps for API route exports\n includeSourceMaps: true,\n platform,\n apiRoutesOnly,\n });\n\n // Add the api routes to the files to export.\n for (const [route, contents] of apiRoutes) {\n files.set(route, contents);\n }\n\n if (templateHtml && devServer.isReactServerComponentsEnabled) {\n // TODO: Export an HTML entry for each file. This is a temporary solution until we have SSR/SSG for RSC.\n await getFilesToExportFromServerAsync(devServer.projectRoot, {\n manifest: htmlManifest,\n serverManifest,\n exportServer: true,\n files,\n renderAsync: async ({ pathname, filePath }) => {\n files.set(filePath, {\n contents: templateHtml!,\n routeId: pathname,\n targetDomain: 'server',\n });\n return templateHtml!;\n },\n });\n }\n\n return files;\n}\n\nasync function exportApiRoutesAsync({\n includeSourceMaps,\n server,\n platform,\n apiRoutesOnly,\n ...props\n}: Pick<Options, 'includeSourceMaps'> & {\n server: MetroBundlerDevServer;\n manifest: RoutesManifest<string>;\n platform: string;\n apiRoutesOnly?: boolean;\n}): Promise<ExportAssetMap> {\n const { manifest, files } = await server.exportExpoRouterApiRoutesAsync({\n outputDir: '_expo/functions',\n prerenderManifest: props.manifest,\n includeSourceMaps,\n platform,\n });\n\n // HACK: Clear out the HTML and 404 routes if we're only exporting API routes. This is used for native apps that are using API routes but haven't implemented web support yet.\n if (apiRoutesOnly) {\n manifest.htmlRoutes = [];\n manifest.notFoundRoutes = [];\n }\n\n files.set('_expo/routes.json', {\n contents: JSON.stringify(manifest, null, 2),\n targetDomain: 'server',\n });\n\n return files;\n}\n\nfunction warnPossibleInvalidExportType(appDir: string) {\n const apiRoutes = getApiRoutesForDirectory(appDir);\n if (apiRoutes.length) {\n // TODO: Allow API Routes for native-only.\n Log.warn(\n chalk.yellow`Skipping export for API routes because \\`web.output\\` is not \"server\". You may want to remove the routes: ${apiRoutes\n .map((v) => path.relative(appDir, v))\n .join(', ')}`\n );\n }\n\n const middlewareFile = getMiddlewareForDirectory(appDir);\n if (middlewareFile) {\n Log.warn(\n chalk.yellow`Skipping export for middleware because \\`web.output\\` is not \"server\". You may want to remove ${path.relative(appDir, middlewareFile)}`\n );\n }\n}\n\n/**\n * Export loader bundles for routes that have loader exports and updates routes in the manifest\n * with a `loader` property.\n */\nasync function exportLoadersAsync({\n devServer,\n serverManifest,\n appDir,\n files,\n platform,\n loaderReferences,\n}: {\n devServer: MetroBundlerDevServer;\n serverManifest: RoutesManifest<string>;\n appDir: string;\n files: ExportAssetMap;\n platform: string;\n /** File paths of modules with loader exports from client bundle metadata */\n loaderReferences: string[];\n}): Promise<void> {\n const entryPoints: { file: string; page: string }[] = [];\n\n for (const route of serverManifest.htmlRoutes) {\n // Skip generated routes\n if (route.generated) {\n continue;\n }\n\n const filePath = path.isAbsolute(route.file) ? route.file : path.join(appDir, route.file);\n\n if (loaderReferences.includes(filePath)) {\n entryPoints.push({\n file: filePath,\n page: route.page,\n });\n }\n }\n\n if (entryPoints.length === 0) {\n debug('No routes with loaders to bundle');\n return;\n }\n\n const entryPointModules = entryPoints.map((e) => e.page);\n debug('Bundling loaders for routes:', entryPointModules);\n\n await devServer.exportExpoRouterLoadersAsync({\n platform,\n entryPoints,\n files,\n outputDir: '_expo/loaders',\n includeSourceMaps: true,\n });\n\n // Update `htmlRoutes` in routes manifest for routes that have loaders\n updateExportManifestInFiles({\n files,\n callback: (manifest) => {\n const routesWithLoaders = new Set(entryPointModules);\n for (const route of manifest.htmlRoutes) {\n if (routesWithLoaders.has(route.page)) {\n route.loader = `_expo/loaders${route.page}.js`;\n }\n }\n },\n });\n\n debug('Exported loaders for routes:', entryPointModules);\n}\n\n// NOTE(@hassankhan): We should ideally persist the manifest to `files` only once instead of\n// modifying it afterwards.\nfunction updateExportManifestInFiles({\n files,\n callback,\n}: {\n files: ExportAssetMap;\n callback: (manifest: RoutesManifest<string>) => void;\n}) {\n const routesJsonEntry = files.get('_expo/routes.json');\n if (routesJsonEntry) {\n const manifest = JSON.parse(routesJsonEntry.contents as string);\n callback(manifest);\n\n files.set('_expo/routes.json', {\n ...routesJsonEntry,\n contents: JSON.stringify(manifest, null, 2),\n });\n }\n}\n"],"names":["exportApiRoutesStandaloneAsync","exportFromServerAsync","getFilesToExportFromServerAsync","getHtmlFiles","getPathVariations","injectScriptTags","debug","require","html","scriptTags","scriptTagsHtml","map","tag","platform","src","join","replace","matchGroupName","name","match","projectRoot","manifest","serverManifest","renderAsync","exportServer","skipHtmlPrerendering","files","Map","subsetServerManifest","headers","redirects","set","contents","JSON","stringify","targetDomain","Promise","all","includeGroupVariations","route","filePath","pathname","type","data","routeId","e","logMetroErrorAsync","error","Error","modifyRouteNodeInRuntimeManifest","callback","iterateScreens","screens","Object","values","value","_route","makeRuntimeEntryPointsAbsolute","appDir","Array","isArray","entryPoints","entryPoint","shouldLinkExternally","startsWith","path","resolve","isAbsolute","resolveFrom","devServer","outputDir","baseUrl","includeSourceMaps","routerRoot","exp","useServerRendering","extra","router","unstable_useServerRendering","logOutput","web","output","learnMore","Log","log","isExporting","isExportingWithSSR","isReactServerComponentsEnabled","faviconAsset","generateFaviconAssetAsync","resources","executeLoaderAsync","getStaticResourcesAsync","getStaticRenderFunctionAsync","inspect","colors","depth","normalizedPathname","useServerLoaders","unstable_useServerDataLoaders","renderOpts","loaderResponse","undefined","json","loaderKey","getContextKey","contextKey","fileSystemPath","loaderId","loader","key","assets","css","js","favicon","href","template","serializeHtmlWithAssets","artifacts","hydrate","getFilesFromSerialAssets","isServerHosted","persistMetroAssetsAsync","outputDirectory","apiRoutes","exportApiRoutesAsync","server","exportExpoRouterRenderModuleAsync","loaderReferences","flatMap","artifact","metadata","exportLoadersAsync","toAssetUrl","filename","cssAssets","filter","asset","externalCssAssets","media","jsArtifacts","orderedJsAssets","assetsRequiresSort","syncJs","isAsync","asyncJs","syncJsAssets","htmlRoutes","routeAssets","matchedChunks","asyncChunk","modulePaths","hasRouteEntryPoint","some","includes","push","length","sorted","sortMatchedAssetsByEntryPoints","chunk","updateExportManifestInFiles","externalCss","rendering","mode","file","asyncChunks","get","warnPossibleInvalidExportType","htmlFiles","Set","traverseScreens","entries","leaf","keys","endsWith","slice","stripGroupSegmentsFromPath","addOptionalGroups","add","newPath","variations","variation","uniqueBy","from","parts","split","partsWithGroups","part","filePathLocation","array","seen","result","id","has","routePath","segments","generateVariations","current","head","rest","groups","group","trim","apiRoutesOnly","templateHtml","htmlManifest","getServerManifestAsync","props","exportExpoRouterApiRoutesAsync","prerenderManifest","notFoundRoutes","getApiRoutesForDirectory","warn","chalk","yellow","v","relative","middlewareFile","getMiddlewareForDirectory","generated","page","entryPointModules","exportExpoRouterLoadersAsync","routesWithLoaders","routesJsonEntry","parse"],"mappings":"AAAA;;;;;CAKC;;;;;;;;;;;QAolBqBA;eA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,sEAAsE;IACtEwF,4BAA4B;QAC1BtI;QACAwB,UAAU,CAAC7B;YACT,MAAM0M,oBAAoB,IAAItD,IAAIoD;YAClC,KAAK,MAAMtL,SAASlB,SAAS8H,UAAU,CAAE;gBACvC,IAAI4E,kBAAkB9B,GAAG,CAAC1J,MAAMqL,IAAI,GAAG;oBACrCrL,MAAMsE,MAAM,GAAG,CAAC,aAAa,EAAEtE,MAAMqL,IAAI,CAAC,GAAG,CAAC;gBAChD;YACF;QACF;IACF;IAEAtN,MAAM,gCAAgCuN;AACxC;AAEA,4FAA4F;AAC5F,2BAA2B;AAC3B,SAAS7D,4BAA4B,EACnCtI,KAAK,EACLwB,QAAQ,EAIT;IACC,MAAM8K,kBAAkBtM,MAAM4I,GAAG,CAAC;IAClC,IAAI0D,iBAAiB;QACnB,MAAM3M,WAAWY,KAAKgM,KAAK,CAACD,gBAAgBhM,QAAQ;QACpDkB,SAAS7B;QAETK,MAAMK,GAAG,CAAC,qBAAqB;YAC7B,GAAGiM,eAAe;YAClBhM,UAAUC,KAAKC,SAAS,CAACb,UAAU,MAAM;QAC3C;IACF;AACF"}
@@ -5,18 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getFaviconFromExpoConfigAsync: function() {
12
+ get generateFaviconAssetAsync () {
13
+ return generateFaviconAssetAsync;
14
+ },
15
+ get getFaviconFromExpoConfigAsync () {
13
16
  return getFaviconFromExpoConfigAsync;
14
17
  },
15
- getUserDefinedFaviconFile: function() {
18
+ get getUserDefinedFaviconFile () {
16
19
  return getUserDefinedFaviconFile;
17
- },
18
- getVirtualFaviconAssetsAsync: function() {
19
- return getVirtualFaviconAssetsAsync;
20
20
  }
21
21
  });
22
22
  function _config() {
@@ -33,16 +33,16 @@ function _imageutils() {
33
33
  };
34
34
  return data;
35
35
  }
36
- function _fs() {
37
- const data = /*#__PURE__*/ _interop_require_default(require("fs"));
38
- _fs = function() {
36
+ function _nodefs() {
37
+ const data = /*#__PURE__*/ _interop_require_default(require("node:fs"));
38
+ _nodefs = function() {
39
39
  return data;
40
40
  };
41
41
  return data;
42
42
  }
43
- function _path() {
44
- const data = /*#__PURE__*/ _interop_require_default(require("path"));
45
- _path = function() {
43
+ function _nodepath() {
44
+ const data = /*#__PURE__*/ _interop_require_default(require("node:path"));
45
+ _nodepath = function() {
46
46
  return data;
47
47
  };
48
48
  return data;
@@ -60,7 +60,7 @@ function getUserDefinedFaviconFile(projectRoot) {
60
60
  './favicon.ico'
61
61
  ]);
62
62
  }
63
- async function getVirtualFaviconAssetsAsync(projectRoot, { baseUrl, outputDir, files, exp }) {
63
+ async function generateFaviconAssetAsync(projectRoot, { baseUrl, outputDir, files, exp }) {
64
64
  const existing = getUserDefinedFaviconFile(projectRoot);
65
65
  if (existing) {
66
66
  debug('Using user-defined favicon.ico file.');
@@ -72,28 +72,20 @@ async function getVirtualFaviconAssetsAsync(projectRoot, { baseUrl, outputDir, f
72
72
  if (!data) {
73
73
  return null;
74
74
  }
75
- await Promise.all([
76
- data
77
- ].map(async (asset)=>{
78
- const assetPath = _path().default.join(outputDir, asset.path);
79
- if (files) {
80
- debug('Storing asset for persisting: ' + assetPath);
81
- files == null ? void 0 : files.set(asset.path, {
82
- contents: asset.source,
83
- targetDomain: 'client'
84
- });
85
- } else {
86
- debug('Writing asset to disk: ' + assetPath);
87
- await _fs().default.promises.writeFile(assetPath, asset.source);
88
- }
89
- }));
90
- function injectFaviconTag(html) {
91
- if (!html.includes('</head>')) {
92
- return html;
93
- }
94
- return html.replace('</head>', `<link rel="icon" href="${baseUrl}/favicon.ico" /></head>`);
75
+ const assetPath = _nodepath().default.join(outputDir, data.path);
76
+ if (files) {
77
+ debug('Storing asset for persisting: ' + assetPath);
78
+ files.set(data.path, {
79
+ contents: data.source,
80
+ targetDomain: 'client'
81
+ });
82
+ } else {
83
+ debug('Writing asset to disk: ' + assetPath);
84
+ await _nodefs().default.promises.writeFile(assetPath, data.source);
95
85
  }
96
- return injectFaviconTag;
86
+ return {
87
+ href: `${baseUrl}/${data.path}`
88
+ };
97
89
  }
98
90
  async function getFaviconFromExpoConfigAsync(projectRoot, { force = false, exp = (0, _config().getConfig)(projectRoot).exp } = {}) {
99
91
  var _exp_web;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/export/favicon.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport { generateFaviconAsync, generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { getUserDefinedFile } from './publicFolder';\nimport { ExportAssetMap } from './saveAssets';\nimport { Log } from '../log';\n\nconst debug = require('debug')('expo:favicon') as typeof console.log;\n\n/** @returns the file system path for a user-defined favicon.ico file in the public folder. */\nexport function getUserDefinedFaviconFile(projectRoot: string): string | null {\n return getUserDefinedFile(projectRoot, ['./favicon.ico']);\n}\n\nexport async function getVirtualFaviconAssetsAsync(\n projectRoot: string,\n {\n baseUrl,\n outputDir,\n files,\n exp,\n }: { outputDir: string; baseUrl: string; files?: ExportAssetMap; exp?: ExpoConfig }\n): Promise<((html: string) => string) | null> {\n const existing = getUserDefinedFaviconFile(projectRoot);\n if (existing) {\n debug('Using user-defined favicon.ico file.');\n return null;\n }\n\n const data = await getFaviconFromExpoConfigAsync(projectRoot, {\n exp,\n });\n\n if (!data) {\n return null;\n }\n\n await Promise.all(\n [data].map(async (asset) => {\n const assetPath = path.join(outputDir, asset.path);\n if (files) {\n debug('Storing asset for persisting: ' + assetPath);\n files?.set(asset.path, {\n contents: asset.source,\n targetDomain: 'client',\n });\n } else {\n debug('Writing asset to disk: ' + assetPath);\n await fs.promises.writeFile(assetPath, asset.source);\n }\n })\n );\n\n function injectFaviconTag(html: string): string {\n if (!html.includes('</head>')) {\n return html;\n }\n return html.replace('</head>', `<link rel=\"icon\" href=\"${baseUrl}/favicon.ico\" /></head>`);\n }\n\n return injectFaviconTag;\n}\n\nexport async function getFaviconFromExpoConfigAsync(\n projectRoot: string,\n { force = false, exp = getConfig(projectRoot).exp }: { force?: boolean; exp?: ExpoConfig } = {}\n) {\n const src = exp.web?.favicon ?? null;\n if (!src) {\n return null;\n }\n\n const dims = [16, 32, 48];\n const cacheType = 'favicon';\n\n const size = dims[dims.length - 1];\n try {\n const { source } = await generateImageAsync(\n { projectRoot, cacheType },\n {\n resizeMode: 'contain',\n src,\n backgroundColor: 'transparent',\n width: size,\n height: size,\n name: `favicon-${size}.png`,\n }\n );\n\n const faviconBuffer = await generateFaviconAsync(source, dims);\n\n return { source: faviconBuffer, path: 'favicon.ico' };\n } catch (error: any) {\n // Check for ENOENT\n if (!force && error.code === 'ENOENT') {\n Log.warn(`Favicon source file in Expo config (web.favicon) does not exist: ${src}`);\n return null;\n }\n throw error;\n }\n}\n"],"names":["getFaviconFromExpoConfigAsync","getUserDefinedFaviconFile","getVirtualFaviconAssetsAsync","debug","require","projectRoot","getUserDefinedFile","baseUrl","outputDir","files","exp","existing","data","Promise","all","map","asset","assetPath","path","join","set","contents","source","targetDomain","fs","promises","writeFile","injectFaviconTag","html","includes","replace","force","getConfig","src","web","favicon","dims","cacheType","size","length","generateImageAsync","resizeMode","backgroundColor","width","height","name","faviconBuffer","generateFaviconAsync","error","code","Log","warn"],"mappings":";;;;;;;;;;;IAiEsBA,6BAA6B;eAA7BA;;IArDNC,yBAAyB;eAAzBA;;IAIMC,4BAA4B;eAA5BA;;;;yBAhBgB;;;;;;;yBACmB;;;;;;;gEAC1C;;;;;;;gEACE;;;;;;8BAEkB;qBAEf;;;;;;AAEpB,MAAMC,QAAQC,QAAQ,SAAS;AAGxB,SAASH,0BAA0BI,WAAmB;IAC3D,OAAOC,IAAAA,gCAAkB,EAACD,aAAa;QAAC;KAAgB;AAC1D;AAEO,eAAeH,6BACpBG,WAAmB,EACnB,EACEE,OAAO,EACPC,SAA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GAAG,MAAMkB,IAAAA,gCAAkB,EACzC;YAAEnC;YAAagC;QAAU,GACzB;YACEI,YAAY;YACZR;YACAS,iBAAiB;YACjBC,OAAOL;YACPM,QAAQN;YACRO,MAAM,CAAC,QAAQ,EAAEP,KAAK,IAAI,CAAC;QAC7B;QAGF,MAAMQ,gBAAgB,MAAMC,IAAAA,kCAAoB,EAACzB,QAAQc;QAEzD,OAAO;YAAEd,QAAQwB;YAAe5B,MAAM;QAAc;IACtD,EAAE,OAAO8B,OAAY;QACnB,mBAAmB;QACnB,IAAI,CAACjB,SAASiB,MAAMC,IAAI,KAAK,UAAU;YACrCC,QAAG,CAACC,IAAI,CAAC,CAAC,iEAAiE,EAAElB,KAAK;YAClF,OAAO;QACT;QACA,MAAMe;IACR;AACF"}
1
+ {"version":3,"sources":["../../../src/export/favicon.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config';\nimport { getConfig } from '@expo/config';\nimport { generateFaviconAsync, generateImageAsync } from '@expo/image-utils';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { getUserDefinedFile } from './publicFolder';\nimport type { ExportAssetMap } from './saveAssets';\nimport { Log } from '../log';\n\nconst debug = require('debug')('expo:favicon') as typeof console.log;\n\n/** @returns the file system path for a user-defined favicon.ico file in the public folder. */\nexport function getUserDefinedFaviconFile(projectRoot: string): string | null {\n return getUserDefinedFile(projectRoot, ['./favicon.ico']);\n}\n\n/**\n * Generate a favicon.ico from `web.favicon` in the Expo config and write it into the asset map\n * (or to disk if no asset map is provided).\n *\n * @returns the public href for the generated favicon, or `null` when a user-supplied\n * `favicon.ico` already exists in the public folder (browsers resolve it at `/favicon.ico`\n * automatically) or when no `web.favicon` is configured.\n */\nexport async function generateFaviconAssetAsync(\n projectRoot: string,\n {\n baseUrl,\n outputDir,\n files,\n exp,\n }: { outputDir: string; baseUrl: string; files?: ExportAssetMap; exp?: ExpoConfig }\n): Promise<{ href: string } | null> {\n const existing = getUserDefinedFaviconFile(projectRoot);\n if (existing) {\n debug('Using user-defined favicon.ico file.');\n return null;\n }\n\n const data = await getFaviconFromExpoConfigAsync(projectRoot, {\n exp,\n });\n\n if (!data) {\n return null;\n }\n\n const assetPath = path.join(outputDir, data.path);\n if (files) {\n debug('Storing asset for persisting: ' + assetPath);\n files.set(data.path, {\n contents: data.source,\n targetDomain: 'client',\n });\n } else {\n debug('Writing asset to disk: ' + assetPath);\n await fs.promises.writeFile(assetPath, data.source);\n }\n\n return { href: `${baseUrl}/${data.path}` };\n}\n\nexport async function getFaviconFromExpoConfigAsync(\n projectRoot: string,\n { force = false, exp = getConfig(projectRoot).exp }: { force?: boolean; exp?: ExpoConfig } = {}\n) {\n const src = exp.web?.favicon ?? null;\n if (!src) {\n return null;\n }\n\n const dims = [16, 32, 48];\n const cacheType = 'favicon';\n\n const size = dims[dims.length - 1]!;\n try {\n const { source } = await generateImageAsync(\n { projectRoot, cacheType },\n {\n resizeMode: 'contain',\n src,\n backgroundColor: 'transparent',\n width: size,\n height: size,\n name: `favicon-${size}.png`,\n }\n );\n\n const faviconBuffer = await generateFaviconAsync(source, dims);\n\n return { source: faviconBuffer, path: 'favicon.ico' };\n } catch (error: any) {\n // Check for ENOENT\n if (!force && error.code === 'ENOENT') {\n Log.warn(`Favicon source file in Expo config (web.favicon) does not exist: ${src}`);\n return null;\n }\n throw error;\n }\n}\n"],"names":["generateFaviconAssetAsync","getFaviconFromExpoConfigAsync","getUserDefinedFaviconFile","debug","require","projectRoot","getUserDefinedFile","baseUrl","outputDir","files","exp","existing","data","assetPath","path","join","set","contents","source","targetDomain","fs","promises","writeFile","href","force","getConfig","src","web","favicon","dims","cacheType","size","length","generateImageAsync","resizeMode","backgroundColor","width","height","name","faviconBuffer","generateFaviconAsync","error","code","Log","warn"],"mappings":";;;;;;;;;;;QAyBsBA;eAAAA;;QAsCAC;eAAAA;;QAlDNC;eAAAA;;;;yBAZU;;;;;;;yBAC+B;;;;;;;gEAC1C;;;;;;;gEACE;;;;;;8BAEkB;qBAEf;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Me,IAAAA,gCAAkB,EACzC;YAAE5B;YAAayB;QAAU,GACzB;YACEI,YAAY;YACZR;YACAS,iBAAiB;YACjBC,OAAOL;YACPM,QAAQN;YACRO,MAAM,CAAC,QAAQ,EAAEP,KAAK,IAAI,CAAC;QAC7B;QAGF,MAAMQ,gBAAgB,MAAMC,IAAAA,kCAAoB,EAACtB,QAAQW;QAEzD,OAAO;YAAEX,QAAQqB;YAAezB,MAAM;QAAc;IACtD,EAAE,OAAO2B,OAAY;QACnB,mBAAmB;QACnB,IAAI,CAACjB,SAASiB,MAAMC,IAAI,KAAK,UAAU;YACrCC,QAAG,CAACC,IAAI,CAAC,CAAC,iEAAiE,EAAElB,KAAK;YAClF,OAAO;QACT;QACA,MAAMe;IACR;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/export/getPublicExpoManifest.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\n\nimport { LocaleMap, getResolvedLocalesAsync } from './getResolvedLocales';\nimport { env } from '../utils/env';\nimport { CommandError } from '../utils/errors';\n\n/** Get the public Expo manifest from the local project config. */\nexport async function getPublicExpoManifestAsync(\n projectRoot: string,\n { skipValidation }: { skipValidation?: boolean } = {}\n): Promise<ExpoConfig & { locales: LocaleMap; sdkVersion: string }> {\n // Read the config in public mode which strips the `hooks`.\n const { exp } = getConfig(projectRoot, {\n isPublicConfig: true,\n // This shouldn't be needed since the CLI is vendored in `expo`.\n skipSDKVersionRequirement: true,\n });\n\n // Only allow projects to be published with UNVERSIONED if a correct token is set in env\n if (\n !skipValidation &&\n exp.sdkVersion === 'UNVERSIONED' &&\n !env.EXPO_SKIP_MANIFEST_VALIDATION_TOKEN\n ) {\n throw new CommandError('INVALID_OPTIONS', 'Cannot publish with sdkVersion UNVERSIONED.');\n }\n\n return {\n ...exp,\n locales: await getResolvedLocalesAsync(projectRoot, exp),\n sdkVersion: exp.sdkVersion!,\n };\n}\n"],"names":["getPublicExpoManifestAsync","projectRoot","skipValidation","exp","getConfig","isPublicConfig","skipSDKVersionRequirement","sdkVersion","env","EXPO_SKIP_MANIFEST_VALIDATION_TOKEN","CommandError","locales","getResolvedLocalesAsync"],"mappings":";;;;+BAOsBA;;;eAAAA;;;;yBAPgB;;;;;;oCAEa;qBAC/B;wBACS;AAGtB,eAAeA,2BACpBC,WAAmB,EACnB,EAAEC,cAAc,EAAgC,GAAG,CAAC,CAAC;IAErD,2DAA2D;IAC3D,MAAM,EAAEC,GAAG,EAAE,GAAGC,IAAAA,mBAAS,EAACH,aAAa;QACrCI,gBAAgB;QAChB,gEAAgE;QAChEC,2BAA2B;IAC7B;IAEA,wFAAwF;IACxF,IACE,CAACJ,kBACDC,IAAII,UAAU,KAAK,iBACnB,CAACC,QAAG,CAACC,mCAAmC,EACxC;QACA,MAAM,IAAIC,oBAAY,CAAC,mBAAmB;IAC5C;IAEA,OAAO;QACL,GAAGP,GAAG;QACNQ,SAAS,MAAMC,IAAAA,2CAAuB,EAACX,aAAaE;QACpDI,YAAYJ,IAAII,UAAU;IAC5B;AACF"}
1
+ {"version":3,"sources":["../../../src/export/getPublicExpoManifest.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config';\nimport { getConfig } from '@expo/config';\n\nimport type { LocaleMap } from './getResolvedLocales';\nimport { getResolvedLocalesAsync } from './getResolvedLocales';\nimport { env } from '../utils/env';\nimport { CommandError } from '../utils/errors';\n\n/** Get the public Expo manifest from the local project config. */\nexport async function getPublicExpoManifestAsync(\n projectRoot: string,\n { skipValidation }: { skipValidation?: boolean } = {}\n): Promise<ExpoConfig & { locales: LocaleMap; sdkVersion: string }> {\n // Read the config in public mode which strips the `hooks`.\n const { exp } = getConfig(projectRoot, {\n isPublicConfig: true,\n // This shouldn't be needed since the CLI is vendored in `expo`.\n skipSDKVersionRequirement: true,\n });\n\n // Only allow projects to be published with UNVERSIONED if a correct token is set in env\n if (\n !skipValidation &&\n exp.sdkVersion === 'UNVERSIONED' &&\n !env.EXPO_SKIP_MANIFEST_VALIDATION_TOKEN\n ) {\n throw new CommandError('INVALID_OPTIONS', 'Cannot publish with sdkVersion UNVERSIONED.');\n }\n\n return {\n ...exp,\n locales: await getResolvedLocalesAsync(projectRoot, exp),\n sdkVersion: exp.sdkVersion!,\n };\n}\n"],"names":["getPublicExpoManifestAsync","projectRoot","skipValidation","exp","getConfig","isPublicConfig","skipSDKVersionRequirement","sdkVersion","env","EXPO_SKIP_MANIFEST_VALIDATION_TOKEN","CommandError","locales","getResolvedLocalesAsync"],"mappings":";;;;+BASsBA;;;eAAAA;;;;yBARI;;;;;;oCAGc;qBACpB;wBACS;AAGtB,eAAeA,2BACpBC,WAAmB,EACnB,EAAEC,cAAc,EAAgC,GAAG,CAAC,CAAC;IAErD,2DAA2D;IAC3D,MAAM,EAAEC,GAAG,EAAE,GAAGC,IAAAA,mBAAS,EAACH,aAAa;QACrCI,gBAAgB;QAChB,gEAAgE;QAChEC,2BAA2B;IAC7B;IAEA,wFAAwF;IACxF,IACE,CAACJ,kBACDC,IAAII,UAAU,KAAK,iBACnB,CAACC,QAAG,CAACC,mCAAmC,EACxC;QACA,MAAM,IAAIC,oBAAY,CAAC,mBAAmB;IAC5C;IAEA,OAAO;QACL,GAAGP,GAAG;QACNQ,SAAS,MAAMC,IAAAA,2CAAuB,EAACX,aAAaE;QACpDI,YAAYJ,IAAII,UAAU;IAC5B;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/export/getResolvedLocales.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport JsonFile, { JSONObject } from '@expo/json-file';\nimport path from 'path';\n\nimport { CommandError } from '../utils/errors';\n\nexport type LocaleMap = Record<string, JSONObject>;\n\n// Similar to how we resolve locales in `@expo/config-plugins`\nexport async function getResolvedLocalesAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'locales'>\n): Promise<LocaleMap> {\n if (!exp.locales) {\n return {};\n }\n\n const locales: LocaleMap = {};\n for (const [lang, localeJsonPath] of Object.entries(exp.locales)) {\n if (typeof localeJsonPath === 'string') {\n try {\n locales[lang] = await JsonFile.readAsync(path.join(projectRoot, localeJsonPath));\n } catch (error: any) {\n throw new CommandError('EXPO_CONFIG', JSON.stringify(error));\n }\n } else {\n // In the off chance that someone defined the locales json in the config, pass it directly to the object.\n // We do this to make the types more elegant.\n locales[lang] = localeJsonPath;\n }\n }\n return locales;\n}\n"],"names":["getResolvedLocalesAsync","projectRoot","exp","locales","lang","localeJsonPath","Object","entries","JsonFile","readAsync","path","join","error","CommandError","JSON","stringify"],"mappings":";;;;+BASsBA;;;eAAAA;;;;gEARe;;;;;;;gEACpB;;;;;;wBAEY;;;;;;AAKtB,eAAeA,wBACpBC,WAAmB,EACnBC,GAAgC;IAEhC,IAAI,CAACA,IAAIC,OAAO,EAAE;QAChB,OAAO,CAAC;IACV;IAEA,MAAMA,UAAqB,CAAC;IAC5B,KAAK,MAAM,CAACC,MAAMC,eAAe,IAAIC,OAAOC,OAAO,CAACL,IAAIC,OAAO,EAAG;QAChE,IAAI,OAAOE,mBAAmB,UAAU;YACtC,IAAI;gBACFF,OAAO,CAACC,KAAK,GAAG,MAAMI,mBAAQ,CAACC,SAAS,CAACC,eAAI,CAACC,IAAI,CAACV,aAAaI;YAClE,EAAE,OAAOO,OAAY;gBACnB,MAAM,IAAIC,oBAAY,CAAC,eAAeC,KAAKC,SAAS,CAACH;YACvD;QACF,OAAO;YACL,yGAAyG;YACzG,6CAA6C;YAC7CT,OAAO,CAACC,KAAK,GAAGC;QAClB;IACF;IACA,OAAOF;AACT"}
1
+ {"version":3,"sources":["../../../src/export/getResolvedLocales.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config';\nimport type { JSONObject } from '@expo/json-file';\nimport JsonFile from '@expo/json-file';\nimport path from 'path';\n\nimport { CommandError } from '../utils/errors';\n\nexport type LocaleMap = Record<string, JSONObject>;\n\n// Similar to how we resolve locales in `@expo/config-plugins`\nexport async function getResolvedLocalesAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'locales'>\n): Promise<LocaleMap> {\n if (!exp.locales) {\n return {};\n }\n\n const locales: LocaleMap = {};\n for (const [lang, localeJsonPath] of Object.entries(exp.locales)) {\n if (typeof localeJsonPath === 'string') {\n try {\n locales[lang] = await JsonFile.readAsync(path.join(projectRoot, localeJsonPath));\n } catch (error: any) {\n throw new CommandError('EXPO_CONFIG', JSON.stringify(error));\n }\n } else {\n // In the off chance that someone defined the locales json in the config, pass it directly to the object.\n // We do this to make the types more elegant.\n locales[lang] = localeJsonPath;\n }\n }\n return locales;\n}\n"],"names":["getResolvedLocalesAsync","projectRoot","exp","locales","lang","localeJsonPath","Object","entries","JsonFile","readAsync","path","join","error","CommandError","JSON","stringify"],"mappings":";;;;+BAUsBA;;;eAAAA;;;;gEARD;;;;;;;gEACJ;;;;;;wBAEY;;;;;;AAKtB,eAAeA,wBACpBC,WAAmB,EACnBC,GAAgC;IAEhC,IAAI,CAACA,IAAIC,OAAO,EAAE;QAChB,OAAO,CAAC;IACV;IAEA,MAAMA,UAAqB,CAAC;IAC5B,KAAK,MAAM,CAACC,MAAMC,eAAe,IAAIC,OAAOC,OAAO,CAACL,IAAIC,OAAO,EAAG;QAChE,IAAI,OAAOE,mBAAmB,UAAU;YACtC,IAAI;gBACFF,OAAO,CAACC,KAAK,GAAG,MAAMI,mBAAQ,CAACC,SAAS,CAACC,eAAI,CAACC,IAAI,CAACV,aAAaI;YAClE,EAAE,OAAOO,OAAY;gBACnB,MAAM,IAAIC,oBAAY,CAAC,eAAeC,KAAKC,SAAS,CAACH;YACvD;QACF,OAAO;YACL,yGAAyG;YACzG,6CAA6C;YAC7CT,OAAO,CAACC,KAAK,GAAGC;QAClB;IACF;IACA,OAAOF;AACT"}
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  function _export(target, all) {
7
7
  for(var name in all)Object.defineProperty(target, name, {
8
8
  enumerable: true,
9
- get: all[name]
9
+ get: Object.getOwnPropertyDescriptor(all, name).get
10
10
  });
11
11
  }
12
12
  _export(exports, {
13
- appendLinkToHtml: function() {
13
+ get appendLinkToHtml () {
14
14
  return appendLinkToHtml;
15
15
  },
16
- appendScriptsToHtml: function() {
16
+ get appendScriptsToHtml () {
17
17
  return appendScriptsToHtml;
18
18
  }
19
19
  });