@depup/expo__cli 55.0.23-depup.0 → 57.0.9-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 +239 -108
  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/writeContents.ts"],"sourcesContent":["import { Asset } from './saveAssets';\n\nexport function createAssetMap({ assets }: { assets: Asset[] }) {\n // Convert the assets array to a k/v pair where the asset hash is the key and the asset is the value.\n return Object.fromEntries(assets.map((asset) => [asset.hash, asset]));\n}\n"],"names":["createAssetMap","assets","Object","fromEntries","map","asset","hash"],"mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,eAAe,EAAEC,MAAM,EAAuB;IAC5D,qGAAqG;IACrG,OAAOC,OAAOC,WAAW,CAACF,OAAOG,GAAG,CAAC,CAACC,QAAU;YAACA,MAAMC,IAAI;YAAED;SAAM;AACrE"}
1
+ {"version":3,"sources":["../../../src/export/writeContents.ts"],"sourcesContent":["import type { Asset } from './saveAssets';\n\nexport function createAssetMap({ assets }: { assets: Asset[] }) {\n // Convert the assets array to a k/v pair where the asset hash is the key and the asset is the value.\n return Object.fromEntries(assets.map((asset) => [asset.hash, asset]));\n}\n"],"names":["createAssetMap","assets","Object","fromEntries","map","asset","hash"],"mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,eAAe,EAAEC,MAAM,EAAuB;IAC5D,qGAAqG;IACrG,OAAOC,OAAOC,WAAW,CAACF,OAAOG,GAAG,CAAC,CAACC,QAAU;YAACA,MAAMC,IAAI;YAAED;SAAM;AACrE"}
@@ -22,13 +22,6 @@ function _chalk() {
22
22
  };
23
23
  return data;
24
24
  }
25
- function _resolvefrom() {
26
- const data = /*#__PURE__*/ _interop_require_default(require("resolve-from"));
27
- _resolvefrom = function() {
28
- return data;
29
- };
30
- return data;
31
- }
32
25
  const _fixPackages = require("./fixPackages");
33
26
  const _log = /*#__PURE__*/ _interop_require_wildcard(require("../log"));
34
27
  const _validateDependenciesVersions = require("../start/doctor/dependencies/validateDependenciesVersions");
@@ -84,7 +77,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
84
77
  }
85
78
  const debug = require('debug')('expo:install:check');
86
79
  async function checkPackagesAsync(projectRoot, { packages, packageManager, options: { fix, json }, packageManagerArguments }) {
87
- var _pkg_expo_install_exclude, _pkg_expo_install, _pkg_expo, _pkg_dependencies;
80
+ var _pkg_expo_install_exclude, _pkg_expo_install, _pkg_expo;
88
81
  // Read the project Expo config without plugins.
89
82
  const { exp, pkg } = (0, _config().getConfig)(projectRoot, {
90
83
  // Sometimes users will add a plugin to the config before installing the library,
@@ -95,26 +88,6 @@ async function checkPackagesAsync(projectRoot, { packages, packageManager, optio
95
88
  _log.log((0, _chalk().default)`Skipped ${fix ? 'fixing' : 'checking'} dependencies: ${(0, _strings.joinWithCommasAnd)(pkg.expo.install.exclude)}. These dependencies are listed in {bold expo.install.exclude} in package.json. ${(0, _link.learnMore)('https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation')}`);
96
89
  }
97
90
  const dependencies = await (0, _validateDependenciesVersions.getVersionedDependenciesAsync)(projectRoot, exp, pkg, packages);
98
- /*
99
- * Expo Router projects will do this additional check
100
- * Note: The e2e tests use nexpo which will always resolve 'expo-router/doctor.js'
101
- * For that reason, you cannot use nexpo to test for the sub-dependency check,
102
- * and you cannot replace this guard with a try/catch around the import('expo-router')
103
- */ if ((_pkg_dependencies = pkg.dependencies) == null ? void 0 : _pkg_dependencies['expo-router']) {
104
- // TODO(@kitten): This should be removed. None of the checks apply anymore
105
- try {
106
- const { doctor: routerDoctor } = await Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("expo-router/doctor.js")));
107
- dependencies.push(...routerDoctor(pkg, _resolvefrom().default.silent(projectRoot, '@react-navigation/native'), {
108
- bold: _chalk().default.bold,
109
- learnMore: _link.learnMore
110
- }));
111
- } catch (error) {
112
- if (!json) {
113
- _log.log(`Skipped checking expo-router dependencies: expo-router/doctor.js not found.`);
114
- }
115
- debug('expo-router/doctor error:', error);
116
- }
117
- }
118
91
  if (!dependencies.length) {
119
92
  if (json) {
120
93
  console.log(JSON.stringify({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/install/checkPackages.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\nimport resolveFrom from 'resolve-from';\n\nimport { fixPackagesAsync } from './fixPackages';\nimport { Options } from './resolveOptions';\nimport * as Log from '../log';\nimport {\n getVersionedDependenciesAsync,\n logIncorrectDependencies,\n} from '../start/doctor/dependencies/validateDependenciesVersions';\nimport { isInteractive } from '../utils/interactive';\nimport { learnMore } from '../utils/link';\nimport { confirmAsync } from '../utils/prompts';\nimport { joinWithCommasAnd } from '../utils/strings';\n\nconst debug = require('debug')('expo:install:check') as typeof console.log;\n\n/**\n * Handles `expo install --fix|check'.\n * Checks installed dependencies against bundledNativeModules and versions endpoints to find any incompatibilities.\n * If `--fix` is passed, it will install the correct versions of the dependencies.\n * If `--check` is passed, it will prompt the user to install the correct versions of the dependencies (on interactive terminal).\n */\nexport async function checkPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n options: { fix, json },\n packageManagerArguments,\n }: {\n /**\n * List of packages to version\n * @example ['uuid', 'react-native-reanimated@latest']\n */\n packages: string[];\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n\n /** How the check should resolve */\n options: Pick<Options, 'fix' | 'json'>;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n }\n) {\n // Read the project Expo config without plugins.\n const { exp, pkg } = getConfig(projectRoot, {\n // Sometimes users will add a plugin to the config before installing the library,\n // this wouldn't work unless we dangerously disable plugin serialization.\n skipPlugins: true,\n });\n\n if (pkg.expo?.install?.exclude?.length && !json) {\n Log.log(\n chalk`Skipped ${fix ? 'fixing' : 'checking'} dependencies: ${joinWithCommasAnd(\n pkg.expo.install.exclude\n )}. These dependencies are listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n\n const dependencies = await getVersionedDependenciesAsync(projectRoot, exp, pkg, packages);\n\n /*\n * Expo Router projects will do this additional check\n * Note: The e2e tests use nexpo which will always resolve 'expo-router/doctor.js'\n * For that reason, you cannot use nexpo to test for the sub-dependency check,\n * and you cannot replace this guard with a try/catch around the import('expo-router')\n */\n if (pkg.dependencies?.['expo-router']) {\n // TODO(@kitten): This should be removed. None of the checks apply anymore\n try {\n const { doctor: routerDoctor } = await import('expo-router/doctor.js');\n dependencies.push(\n ...routerDoctor(pkg, resolveFrom.silent(projectRoot, '@react-navigation/native'), {\n bold: chalk.bold,\n learnMore,\n })\n );\n } catch (error) {\n if (!json) {\n Log.log(`Skipped checking expo-router dependencies: expo-router/doctor.js not found.`);\n }\n debug('expo-router/doctor error:', error);\n }\n }\n\n if (!dependencies.length) {\n if (json) {\n console.log(JSON.stringify({ dependencies: [], upToDate: true }));\n } else {\n Log.exit(chalk.greenBright('Dependencies are up to date'), 0);\n }\n return;\n }\n\n if (json) {\n console.log(JSON.stringify({ dependencies, upToDate: false }, null, 2));\n // Exit with non-zero exit code to indicate outdated dependencies\n process.exit(1);\n }\n\n logIncorrectDependencies(dependencies);\n\n const value =\n // If `--fix` then always fix.\n fix ||\n // Otherwise prompt to fix when not running in CI.\n (isInteractive() && (await confirmAsync({ message: 'Fix dependencies?' }).catch(() => false)));\n\n if (value) {\n debug('Installing fixed dependencies:', dependencies);\n // Install the corrected dependencies.\n return fixPackagesAsync(projectRoot, {\n packageManager,\n packages: dependencies,\n packageManagerArguments,\n sdkVersion: exp.sdkVersion!,\n });\n }\n\n // Exit with non-zero exit code if any of the dependencies are out of date.\n Log.exit(chalk.red('Found outdated dependencies'), 1);\n}\n"],"names":["checkPackagesAsync","debug","require","projectRoot","packages","packageManager","options","fix","json","packageManagerArguments","pkg","exp","getConfig","skipPlugins","expo","install","exclude","length","Log","log","chalk","joinWithCommasAnd","learnMore","dependencies","getVersionedDependenciesAsync","doctor","routerDoctor","push","resolveFrom","silent","bold","error","console","JSON","stringify","upToDate","exit","greenBright","process","logIncorrectDependencies","value","isInteractive","confirmAsync","message","catch","fixPackagesAsync","sdkVersion","red"],"mappings":";;;;+BAyBsBA;;;eAAAA;;;;yBAzBI;;;;;;;gEAER;;;;;;;gEACM;;;;;;6BAES;6DAEZ;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B,MAAM;gBACTU,KAAIC,GAAG,CAAC,CAAC,2EAA2E,CAAC;YACvF;YACAlB,MAAM,6BAA6B8B;QACrC;IACF;IAEA,IAAI,CAACR,aAAaN,MAAM,EAAE;QACxB,IAAIT,MAAM;YACRwB,QAAQb,GAAG,CAACc,KAAKC,SAAS,CAAC;gBAAEX,cAAc,EAAE;gBAAEY,UAAU;YAAK;QAChE,OAAO;YACLjB,KAAIkB,IAAI,CAAChB,gBAAK,CAACiB,WAAW,CAAC,gCAAgC;QAC7D;QACA;IACF;IAEA,IAAI7B,MAAM;QACRwB,QAAQb,GAAG,CAACc,KAAKC,SAAS,CAAC;YAAEX;YAAcY,UAAU;QAAM,GAAG,MAAM;QACpE,iEAAiE;QACjEG,QAAQF,IAAI,CAAC;IACf;IAEAG,IAAAA,sDAAwB,EAAChB;IAEzB,MAAMiB,QACJ,8BAA8B;IAC9BjC,OACA,kDAAkD;IACjDkC,IAAAA,0BAAa,OAAO,MAAMC,IAAAA,qBAAY,EAAC;QAAEC,SAAS;IAAoB,GAAGC,KAAK,CAAC,IAAM;IAExF,IAAIJ,OAAO;QACTvC,MAAM,kCAAkCsB;QACxC,sCAAsC;QACtC,OAAOsB,IAAAA,6BAAgB,EAAC1C,aAAa;YACnCE;YACAD,UAAUmB;YACVd;YACAqC,YAAYnC,IAAImC,UAAU;QAC5B;IACF;IAEA,2EAA2E;IAC3E5B,KAAIkB,IAAI,CAAChB,gBAAK,CAAC2B,GAAG,CAAC,gCAAgC;AACrD"}
1
+ {"version":3,"sources":["../../../src/install/checkPackages.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport type * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport { fixPackagesAsync } from './fixPackages';\nimport type { Options } from './resolveOptions';\nimport * as Log from '../log';\nimport {\n getVersionedDependenciesAsync,\n logIncorrectDependencies,\n} from '../start/doctor/dependencies/validateDependenciesVersions';\nimport { isInteractive } from '../utils/interactive';\nimport { learnMore } from '../utils/link';\nimport { confirmAsync } from '../utils/prompts';\nimport { joinWithCommasAnd } from '../utils/strings';\n\nconst debug = require('debug')('expo:install:check') as typeof console.log;\n\n/**\n * Handles `expo install --fix|check'.\n * Checks installed dependencies against bundledNativeModules and versions endpoints to find any incompatibilities.\n * If `--fix` is passed, it will install the correct versions of the dependencies.\n * If `--check` is passed, it will prompt the user to install the correct versions of the dependencies (on interactive terminal).\n */\nexport async function checkPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n options: { fix, json },\n packageManagerArguments,\n }: {\n /**\n * List of packages to version\n * @example ['uuid', 'react-native-reanimated@latest']\n */\n packages: string[];\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n\n /** How the check should resolve */\n options: Pick<Options, 'fix' | 'json'>;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n }\n) {\n // Read the project Expo config without plugins.\n const { exp, pkg } = getConfig(projectRoot, {\n // Sometimes users will add a plugin to the config before installing the library,\n // this wouldn't work unless we dangerously disable plugin serialization.\n skipPlugins: true,\n });\n\n if (pkg.expo?.install?.exclude?.length && !json) {\n Log.log(\n chalk`Skipped ${fix ? 'fixing' : 'checking'} dependencies: ${joinWithCommasAnd(\n pkg.expo.install.exclude\n )}. These dependencies are listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n\n const dependencies = await getVersionedDependenciesAsync(projectRoot, exp, pkg, packages);\n\n if (!dependencies.length) {\n if (json) {\n console.log(JSON.stringify({ dependencies: [], upToDate: true }));\n } else {\n Log.exit(chalk.greenBright('Dependencies are up to date'), 0);\n }\n return;\n }\n\n if (json) {\n console.log(JSON.stringify({ dependencies, upToDate: false }, null, 2));\n // Exit with non-zero exit code to indicate outdated dependencies\n process.exit(1);\n }\n\n logIncorrectDependencies(dependencies);\n\n const value =\n // If `--fix` then always fix.\n fix ||\n // Otherwise prompt to fix when not running in CI.\n (isInteractive() && (await confirmAsync({ message: 'Fix dependencies?' }).catch(() => false)));\n\n if (value) {\n debug('Installing fixed dependencies:', dependencies);\n // Install the corrected dependencies.\n return fixPackagesAsync(projectRoot, {\n packageManager,\n packages: dependencies,\n packageManagerArguments,\n sdkVersion: exp.sdkVersion!,\n });\n }\n\n // Exit with non-zero exit code if any of the dependencies are out of date.\n Log.exit(chalk.red('Found outdated dependencies'), 1);\n}\n"],"names":["checkPackagesAsync","debug","require","projectRoot","packages","packageManager","options","fix","json","packageManagerArguments","pkg","exp","getConfig","skipPlugins","expo","install","exclude","length","Log","log","chalk","joinWithCommasAnd","learnMore","dependencies","getVersionedDependenciesAsync","console","JSON","stringify","upToDate","exit","greenBright","process","logIncorrectDependencies","value","isInteractive","confirmAsync","message","catch","fixPackagesAsync","sdkVersion","red"],"mappings":";;;;+BAwBsBA;;;eAAAA;;;;yBAxBI;;;;;;;gEAER;;;;;;6BAEe;6DAEZ;8CAId;6BACuB;sBACJ;yBACG;yBACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,MAAMC,QAAQC,QAAQ,SAAS;AAQxB,eAAeF,mBACpBG,WAAmB,EACnB,EACEC,QAAQ,EACRC,cAAc,EACdC,SAAS,EAAEC,GAAG,EAAEC,IAAI,EAAE,EACtBC,uBAAuB,EAiBxB;QASGC,2BAAAA,mBAAAA;IAPJ,gDAAgD;IAChD,MAAM,EAAEC,GAAG,EAAED,GAAG,EAAE,GAAGE,IAAAA,mBAAS,EAACT,aAAa;QAC1C,iFAAiF;QACjF,yEAAyE;QACzEU,aAAa;IACf;IAEA,IAAIH,EAAAA,YAAAA,IAAII,IAAI,sBAARJ,oBAAAA,UAAUK,OAAO,sBAAjBL,4BAAAA,kBAAmBM,OAAO,qBAA1BN,0BAA4BO,MAAM,KAAI,CAACT,MAAM;QAC/CU,KAAIC,GAAG,CACLC,IAAAA,gBAAK,CAAA,CAAC,QAAQ,EAAEb,MAAM,WAAW,WAAW,eAAe,EAAEc,IAAAA,0BAAiB,EAC5EX,IAAII,IAAI,CAACC,OAAO,CAACC,OAAO,EACxB,gFAAgF,EAAEM,IAAAA,eAAS,EAC3F,0EACA,CAAC;IAEP;IAEA,MAAMC,eAAe,MAAMC,IAAAA,2DAA6B,EAACrB,aAAaQ,KAAKD,KAAKN;IAEhF,IAAI,CAACmB,aAAaN,MAAM,EAAE;QACxB,IAAIT,MAAM;YACRiB,QAAQN,GAAG,CAACO,KAAKC,SAAS,CAAC;gBAAEJ,cAAc,EAAE;gBAAEK,UAAU;YAAK;QAChE,OAAO;YACLV,KAAIW,IAAI,CAACT,gBAAK,CAACU,WAAW,CAAC,gCAAgC;QAC7D;QACA;IACF;IAEA,IAAItB,MAAM;QACRiB,QAAQN,GAAG,CAACO,KAAKC,SAAS,CAAC;YAAEJ;YAAcK,UAAU;QAAM,GAAG,MAAM;QACpE,iEAAiE;QACjEG,QAAQF,IAAI,CAAC;IACf;IAEAG,IAAAA,sDAAwB,EAACT;IAEzB,MAAMU,QACJ,8BAA8B;IAC9B1B,OACA,kDAAkD;IACjD2B,IAAAA,0BAAa,OAAO,MAAMC,IAAAA,qBAAY,EAAC;QAAEC,SAAS;IAAoB,GAAGC,KAAK,CAAC,IAAM;IAExF,IAAIJ,OAAO;QACThC,MAAM,kCAAkCsB;QACxC,sCAAsC;QACtC,OAAOe,IAAAA,6BAAgB,EAACnC,aAAa;YACnCE;YACAD,UAAUmB;YACVd;YACA8B,YAAY5B,IAAI4B,UAAU;QAC5B;IACF;IAEA,2EAA2E;IAC3ErB,KAAIW,IAAI,CAACT,gBAAK,CAACoB,GAAG,CAAC,gCAAgC;AACrD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/install/fixPackages.ts"],"sourcesContent":["import * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport { applyPluginsAsync } from './applyPlugins';\nimport { installExpoPackageAsync } from './installExpoPackage';\nimport * as Log from '../log';\nimport { getOperationLog } from '../start/doctor/dependencies/getVersionedPackages';\nimport { getVersionedDependenciesAsync } from '../start/doctor/dependencies/validateDependenciesVersions';\nimport { groupBy } from '../utils/array';\n\n/**\n * Given a list of incompatible packages, installs the correct versions of the packages with the package manager used for the project.\n */\nexport async function fixPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n sdkVersion,\n packageManagerArguments,\n }: {\n packages: Awaited<ReturnType<typeof getVersionedDependenciesAsync>>;\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * SDK to version `packages` for.\n * @example '44.0.0'\n */\n sdkVersion: string;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n }\n): Promise<void> {\n if (!packages.length) {\n return;\n }\n\n const { dependencies = [], devDependencies = [] } = groupBy(packages, (dep) => dep.packageType);\n const versioningMessages = getOperationLog({\n othersCount: 0, // All fixable packages are versioned\n nativeModulesCount: packages.length,\n sdkVersion,\n });\n\n // display all packages to update, including expo package\n Log.log(\n chalk`\\u203A Installing ${\n versioningMessages.length ? versioningMessages.join(' and ') + ' ' : ''\n }using {bold ${packageManager.name}}`\n );\n\n // if updating expo package, install this first, then run expo install --fix again under new version\n const expoDep = dependencies.find((dep) => dep.packageName === 'expo');\n if (expoDep) {\n await installExpoPackageAsync(projectRoot, {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall: `expo@${expoDep.expectedVersionOrRange}`,\n followUpCommandArgs: ['--fix'],\n });\n // follow-up commands will be spawned in a detached process, so return immediately\n return;\n }\n\n if (dependencies.length) {\n const versionedPackages = dependencies.map(\n (dep) => `${dep.packageName}@${dep.expectedVersionOrRange}`\n );\n\n await packageManager.addAsync([...packageManagerArguments, ...versionedPackages]);\n\n await applyPluginsAsync(\n projectRoot,\n dependencies.map((dep) => dep.packageName)\n );\n }\n\n if (devDependencies.length) {\n await packageManager.addDevAsync([\n ...packageManagerArguments,\n ...devDependencies.map((dep) => `${dep.packageName}@${dep.expectedVersionOrRange}`),\n ]);\n }\n}\n"],"names":["fixPackagesAsync","projectRoot","packages","packageManager","sdkVersion","packageManagerArguments","length","dependencies","devDependencies","groupBy","dep","packageType","versioningMessages","getOperationLog","othersCount","nativeModulesCount","Log","log","chalk","join","name","expoDep","find","packageName","installExpoPackageAsync","expoPackageToInstall","expectedVersionOrRange","followUpCommandArgs","versionedPackages","map","addAsync","applyPluginsAsync","addDevAsync"],"mappings":";;;;+BAasBA;;;eAAAA;;;;gEAZJ;;;;;;8BAEgB;oCACM;6DACnB;sCACW;uBAER;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKjB,eAAeA,iBACpBC,WAAmB,EACnB,EACEC,QAAQ,EACRC,cAAc,EACdC,UAAU,EACVC,uBAAuB,EAexB;IAED,IAAI,CAACH,SAASI,MAAM,EAAE;QACpB;IACF;IAEA,MAAM,EAAEC,eAAe,EAAE,EAAEC,kBAAkB,EAAE,EAAE,GAAGC,IAAAA,cAAO,EAACP,UAAU,CAACQ,MAAQA,IAAIC,WAAW;IAC9F,MAAMC,qBAAqBC,IAAAA,qCAAe,EAAC;QACzCC,aAAa;QACbC,oBAAoBb,SAASI,MAAM;QACnCF;IACF;IAEA,yDAAyD;IACzDY,KAAIC,GAAG,CACLC,IAAAA,gBAAK,CAAA,CAAC,kBAAkB,EACtBN,mBAAmBN,MAAM,GAAGM,mBAAmBO,IAAI,CAAC,WAAW,MAAM,GACtE,YAAY,EAAEhB,eAAeiB,IAAI,CAAC,CAAC,CAAC;IAGvC,oGAAoG;IACpG,MAAMC,UAAUd,aAAae,IAAI,CAAC,CAACZ,MAAQA,IAAIa,WAAW,KAAK;IAC/D,IAAIF,SAAS;QACX,MAAMG,IAAAA,2CAAuB,EAACvB,aAAa;YACzCE;YACAE;YACAoB,sBAAsB,CAAC,KAAK,EAAEJ,QAAQK,sBAAsB,EAAE;YAC9DC,qBAAqB;gBAAC;aAAQ;QAChC;QACA,kFAAkF;QAClF;IACF;IAEA,IAAIpB,aAAaD,MAAM,EAAE;QACvB,MAAMsB,oBAAoBrB,aAAasB,GAAG,CACxC,CAACnB,MAAQ,GAAGA,IAAIa,WAAW,CAAC,CAAC,EAAEb,IAAIgB,sBAAsB,EAAE;QAG7D,MAAMvB,eAAe2B,QAAQ,CAAC;eAAIzB;eAA4BuB;SAAkB;QAEhF,MAAMG,IAAAA,+BAAiB,EACrB9B,aACAM,aAAasB,GAAG,CAAC,CAACnB,MAAQA,IAAIa,WAAW;IAE7C;IAEA,IAAIf,gBAAgBF,MAAM,EAAE;QAC1B,MAAMH,eAAe6B,WAAW,CAAC;eAC5B3B;eACAG,gBAAgBqB,GAAG,CAAC,CAACnB,MAAQ,GAAGA,IAAIa,WAAW,CAAC,CAAC,EAAEb,IAAIgB,sBAAsB,EAAE;SACnF;IACH;AACF"}
1
+ {"version":3,"sources":["../../../src/install/fixPackages.ts"],"sourcesContent":["import type * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport { applyPluginsAsync } from './applyPlugins';\nimport { installExpoPackageAsync } from './installExpoPackage';\nimport * as Log from '../log';\nimport { getOperationLog } from '../start/doctor/dependencies/getVersionedPackages';\nimport type { getVersionedDependenciesAsync } from '../start/doctor/dependencies/validateDependenciesVersions';\nimport { groupBy } from '../utils/array';\n\n/**\n * Given a list of incompatible packages, installs the correct versions of the packages with the package manager used for the project.\n */\nexport async function fixPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n sdkVersion,\n packageManagerArguments,\n }: {\n packages: Awaited<ReturnType<typeof getVersionedDependenciesAsync>>;\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * SDK to version `packages` for.\n * @example '44.0.0'\n */\n sdkVersion: string;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n }\n): Promise<void> {\n if (!packages.length) {\n return;\n }\n\n const { dependencies = [], devDependencies = [] } = groupBy(packages, (dep) => dep.packageType);\n const versioningMessages = getOperationLog({\n othersCount: 0, // All fixable packages are versioned\n nativeModulesCount: packages.length,\n sdkVersion,\n });\n\n // display all packages to update, including expo package\n Log.log(\n chalk`\\u203A Installing ${\n versioningMessages.length ? versioningMessages.join(' and ') + ' ' : ''\n }using {bold ${packageManager.name}}`\n );\n\n // if updating expo package, install this first, then run expo install --fix again under new version\n const expoDep = dependencies.find((dep) => dep.packageName === 'expo');\n if (expoDep) {\n await installExpoPackageAsync(projectRoot, {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall: `expo@${expoDep.expectedVersionOrRange}`,\n followUpCommandArgs: ['--fix'],\n });\n // follow-up commands will be spawned in a detached process, so return immediately\n return;\n }\n\n if (dependencies.length) {\n const versionedPackages = dependencies.map(\n (dep) => `${dep.packageName}@${dep.expectedVersionOrRange}`\n );\n\n await packageManager.addAsync([...packageManagerArguments, ...versionedPackages]);\n\n await applyPluginsAsync(\n projectRoot,\n dependencies.map((dep) => dep.packageName)\n );\n }\n\n if (devDependencies.length) {\n await packageManager.addDevAsync([\n ...packageManagerArguments,\n ...devDependencies.map((dep) => `${dep.packageName}@${dep.expectedVersionOrRange}`),\n ]);\n }\n}\n"],"names":["fixPackagesAsync","projectRoot","packages","packageManager","sdkVersion","packageManagerArguments","length","dependencies","devDependencies","groupBy","dep","packageType","versioningMessages","getOperationLog","othersCount","nativeModulesCount","Log","log","chalk","join","name","expoDep","find","packageName","installExpoPackageAsync","expoPackageToInstall","expectedVersionOrRange","followUpCommandArgs","versionedPackages","map","addAsync","applyPluginsAsync","addDevAsync"],"mappings":";;;;+BAasBA;;;eAAAA;;;;gEAZJ;;;;;;8BAEgB;oCACM;6DACnB;sCACW;uBAER;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKjB,eAAeA,iBACpBC,WAAmB,EACnB,EACEC,QAAQ,EACRC,cAAc,EACdC,UAAU,EACVC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AAIgB,sBAAsB,EAAE;SACnF;IACH;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/install/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../utils/args';\n\nexport const expoInstall: Command = async (argv) => {\n const args = assertWithOptionsArgs(\n {\n // Other options are parsed manually.\n '--help': Boolean,\n '--json': Boolean,\n // Aliases\n '-h': '--help',\n },\n {\n argv,\n // Allow other options, we'll throw an error if unexpected values are passed.\n permissive: true,\n }\n );\n\n if (args['--help']) {\n printHelp(\n `Install a module or other package to a project`,\n `npx expo install`,\n [\n `--check Check which installed packages need to be updated`,\n '--dev Save the dependencies as devDependencies',\n `--fix Automatically update any invalid package versions`,\n chalk`--npm Use npm to install dependencies. {dim Default when package-lock.json exists}`,\n chalk`--yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}`,\n chalk`--bun Use bun to install dependencies. {dim Default when bun.lock or bun.lockb exists}`,\n chalk`--pnpm Use pnpm to install dependencies. {dim Default when pnpm-lock.yaml exists}`,\n `-h, --help Usage info`,\n `--json Output dependency information in JSON format with --check flag`,\n ].join('\\n'),\n [\n '',\n chalk` Additional options can be passed to the underlying install command by using {bold --}`,\n chalk` {dim $} npx expo install react -- --verbose`,\n chalk` {dim >} yarn add react --verbose`,\n '',\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo install -h` shows as fast as possible.\n const { installAsync } = require('./installAsync') as typeof import('./installAsync');\n const { logCmdError } = require('../utils/errors') as typeof import('../utils/errors');\n const { resolveArgsAsync } = require('./resolveOptions') as typeof import('./resolveOptions');\n\n const { variadic, options, extras } = await resolveArgsAsync(process.argv.slice(3)).catch(\n logCmdError\n );\n return installAsync(variadic, options, extras).catch(logCmdError);\n};\n"],"names":["expoInstall","argv","args","assertWithOptionsArgs","Boolean","permissive","printHelp","chalk","join","installAsync","require","logCmdError","resolveArgsAsync","variadic","options","ext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AACvD"}
1
+ {"version":3,"sources":["../../../src/install/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport type { Command } from '../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../utils/args';\n\nexport const expoInstall: Command = async (argv) => {\n const args = assertWithOptionsArgs(\n {\n // Other options are parsed manually.\n '--help': Boolean,\n '--json': Boolean,\n // Aliases\n '-h': '--help',\n },\n {\n argv,\n // Allow other options, we'll throw an error if unexpected values are passed.\n permissive: true,\n }\n );\n\n if (args['--help']) {\n printHelp(\n `Install a module or other package to a project`,\n `npx expo install`,\n [\n `--check Check which installed packages need to be updated`,\n '--dev Save the dependencies as devDependencies',\n `--fix Automatically update any invalid package versions`,\n chalk`--npm Use npm to install dependencies. {dim Default when package-lock.json exists}`,\n chalk`--yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}`,\n chalk`--bun Use bun to install dependencies. {dim Default when bun.lock or bun.lockb exists}`,\n chalk`--pnpm Use pnpm to install dependencies. {dim Default when pnpm-lock.yaml exists}`,\n `-h, --help Usage info`,\n `--json Output dependency information in JSON format with --check flag`,\n ].join('\\n'),\n [\n '',\n chalk` Additional options can be passed to the underlying install command by using {bold --}`,\n chalk` {dim $} npx expo install react -- --verbose`,\n chalk` {dim >} yarn add react --verbose`,\n '',\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo install -h` shows as fast as possible.\n const { installAsync } = require('./installAsync') as typeof import('./installAsync');\n const { logCmdError } = require('../utils/errors') as typeof import('../utils/errors');\n const { resolveArgsAsync } = require('./resolveOptions') as typeof import('./resolveOptions');\n\n const { variadic, options, extras } = await resolveArgsAsync(process.argv.slice(3)).catch(\n logCmdError\n );\n return installAsync(variadic, options, extras).catch(logCmdError);\n};\n"],"names":["expoInstall","argv","args","assertWithOptionsArgs","Boolean","permissive","printHelp","chalk","join","installAsync","require","logCmdError","resolveArgsAsync","variadic","options","extras","process","slice","catch"],"mappings":";;;;;+BAMaA;;;eAAAA;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__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
- installAsync: function() {
12
+ get installAsync () {
13
13
  return installAsync;
14
14
  },
15
- installPackagesAsync: function() {
15
+ get installPackagesAsync () {
16
16
  return installPackagesAsync;
17
17
  }
18
18
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/install/installAsync.ts"],"sourcesContent":["import { getConfig, getPackageJson } from '@expo/config';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport { applyPluginsAsync } from './applyPlugins';\nimport { checkPackagesAsync } from './checkPackages';\nimport { installExpoPackageAsync } from './installExpoPackage';\nimport { Options } from './resolveOptions';\nimport * as Log from '../log';\nimport { checkPackagesCompatibility } from './utils/checkPackagesCompatibility';\nimport { getVersionedPackagesAsync } from '../start/doctor/dependencies/getVersionedPackages';\nimport { env } from '../utils/env';\nimport { CommandError } from '../utils/errors';\nimport { findUpProjectRootOrAssert } from '../utils/findUp';\nimport { learnMore } from '../utils/link';\nimport { setNodeEnv, loadEnvFiles } from '../utils/nodeEnv';\nimport { joinWithCommasAnd } from '../utils/strings';\n\n/**\n * Installs versions of specified packages compatible with the current Expo SDK version, or\n * checks/ fixes dependencies in project if they don't match compatible versions specified in bundledNativeModules or versions endpoints.\n *\n * @param packages list of packages to install, if installing specific packages and not checking/ fixing\n * @param options options, including check or fix\n * @param packageManagerArguments arguments to forward to the package manager invoked while installing\n * @returns Promise<void>\n */\nexport async function installAsync(\n packages: string[],\n options: Options & { projectRoot?: string },\n packageManagerArguments: string[] = []\n) {\n setNodeEnv('development');\n // Locate the project root based on the process current working directory.\n // This enables users to run `npx expo install` from a subdirectory of the project.\n const projectRoot = options?.projectRoot ?? findUpProjectRootOrAssert(process.cwd());\n loadEnvFiles(projectRoot);\n\n // Resolve the package manager used by the project, or based on the provided arguments.\n const packageManager = PackageManager.createForProject(projectRoot, {\n npm: options.npm,\n yarn: options.yarn,\n bun: options.bun,\n pnpm: options.pnpm,\n silent: options.silent,\n log: Log.log,\n });\n\n const expoVersion = findPackageByName(packages, 'expo');\n const otherPackages = packages.filter((pkg) => pkg !== expoVersion);\n\n // Abort early when installing `expo@<version>` and other packages with `--fix/--check`\n if (packageHasVersion(expoVersion) && otherPackages.length && (options.check || options.fix)) {\n throw new CommandError(\n 'BAD_ARGS',\n `Cannot install other packages with ${expoVersion} and --fix or --check`\n );\n }\n\n // Only check/fix packages if `expo@<version>` is not requested\n if (!packageHasVersion(expoVersion) && (options.check || options.fix)) {\n return await checkPackagesAsync(projectRoot, {\n packages,\n options,\n packageManager,\n packageManagerArguments,\n });\n }\n\n // note(simek): check out the packages compatibility with New Architecture against RND API\n if (!env.EXPO_NO_DEPENDENCY_VALIDATION && !env.EXPO_NO_NEW_ARCH_COMPAT_CHECK) {\n await checkPackagesCompatibility(otherPackages);\n }\n\n // Read the project Expo config without plugins.\n const { exp } = getConfig(projectRoot, {\n // Sometimes users will add a plugin to the config before installing the library,\n // this wouldn't work unless we dangerously disable plugin serialization.\n skipPlugins: true,\n });\n\n // Resolve the versioned packages, then install them.\n return installPackagesAsync(projectRoot, {\n ...options,\n packageManager,\n packages,\n packageManagerArguments,\n sdkVersion: exp.sdkVersion!,\n });\n}\n\n/** Version packages and install in a project. */\nexport async function installPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n sdkVersion,\n packageManagerArguments,\n fix,\n check,\n dev,\n }: Options & {\n /**\n * List of packages to version, grouped by the type of dependency.\n * @example ['uuid', 'react-native-reanimated@latest']\n */\n packages: string[];\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * SDK to version `packages` for.\n * @example '44.0.0'\n */\n sdkVersion: string;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n }\n): Promise<void> {\n // Read the project Expo config without plugins.\n const pkg = getPackageJson(projectRoot);\n\n //assertNotInstallingExcludedPackages(projectRoot, packages, pkg);\n\n const versioning = await getVersionedPackagesAsync(projectRoot, {\n packages,\n // sdkVersion is always defined because we don't skipSDKVersionRequirement in getConfig.\n sdkVersion,\n pkg,\n });\n\n Log.log(\n chalk`\\u203A Installing ${\n versioning.messages.length ? versioning.messages.join(' and ') + ' ' : ''\n }using {bold ${packageManager.name}}`\n );\n\n if (versioning.excludedNativeModules.length) {\n const alreadyExcluded = versioning.excludedNativeModules.filter(\n (module) => module.isExcludedFromValidation\n );\n const specifiedExactVersion = versioning.excludedNativeModules.filter(\n (module) => !module.isExcludedFromValidation\n );\n\n if (alreadyExcluded.length) {\n Log.log(\n chalk`\\u203A Using ${joinWithCommasAnd(\n alreadyExcluded.map(\n ({ bundledNativeVersion, name, specifiedVersion }) =>\n `${specifiedVersion || 'latest'} instead of ${bundledNativeVersion} for ${name}`\n )\n )} because ${\n alreadyExcluded.length > 1 ? 'they are' : 'it is'\n } listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n\n if (specifiedExactVersion.length) {\n Log.log(\n chalk`\\u203A Using ${joinWithCommasAnd(\n specifiedExactVersion.map(\n ({ bundledNativeVersion, name, specifiedVersion }) =>\n `${specifiedVersion} instead of ${bundledNativeVersion} for ${name}`\n )\n )} because ${\n specifiedExactVersion.length > 1 ? 'these versions' : 'this version'\n } was explicitly provided. Packages excluded from dependency validation should be listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n }\n\n // `expo` needs to be installed before installing other packages\n const expoPackage = findPackageByName(packages, 'expo');\n if (expoPackage) {\n const postInstallCommand = packages.filter((pkg) => pkg !== expoPackage);\n\n // Pipe options to the next command\n if (fix) postInstallCommand.push('--fix');\n if (check) postInstallCommand.push('--check');\n\n // Abort after installing `expo`, follow up command is spawn in a new process\n return await installExpoPackageAsync(projectRoot, {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall: versioning.packages.find((pkg) => pkg.startsWith('expo@'))!,\n followUpCommandArgs: postInstallCommand,\n });\n }\n\n if (dev) {\n await packageManager.addDevAsync([...packageManagerArguments, ...versioning.packages]);\n } else {\n await packageManager.addAsync([...packageManagerArguments, ...versioning.packages]);\n }\n\n await applyPluginsAsync(projectRoot, versioning.packages);\n}\n\n/** Find a package, by name, in the requested packages list (`expo` -> `expo`/`expo@<version>`) */\nfunction findPackageByName(packages: string[], name: string) {\n return packages.find((pkg) => pkg === name || pkg.startsWith(`${name}@`));\n}\n\n/** Determine if a specific version is requested for a package */\nfunction packageHasVersion(name = '') {\n return name.indexOf('@', 1) > 0; // Scoped packages may start with `@`\n}\n"],"names":["installAsync","installPackagesAsync","packages","options","packageManagerArguments","setNodeEnv","projectRoot","findUpProjectRootOrAssert","process","cwd","loadEnvFiles","packageManager","PackageManager","createForProject","npm","yarn","bun","pnpm","silent","log","Log","expoVersion","findPackageByName","otherPackages","filter","pkg","packageHasVersion","length","check","fix","CommandError","checkPackagesAsync","env","EXPO_NO_DEPENDENCY_VALIDATION","EXPO_NO_NEW_ARCH_COMPAT_CHECK","checkPackagesCompatibility","exp","getConfig","skipPlugins","sdkVersion","dev","getPackageJson","versioning","getVersionedPackagesAsync","chalk","messages","join","name","excludedNativeModules","alreadyExcluded","module","isExcludedFromValidation","specifiedExactVersion","joinWithCommasAnd","map","bundledNativeVersion","specifiedVersion","learnMore","expoPackage","postInstallCommand","push","installExpoPackageAsync","expoPackageToInstall","find","startsWith","followUpCommandArgs","addDevAsync","addAsync","applyPluginsAsync","indexOf"],"mappings":";;;;;;;;;;;IA2BsBA,YAAY;eAAZA;;IAiEAC,oBAAoB;eAApBA;;;;yBA5FoB;;;;;;;iEACV;;;;;;;gEACd;;;;;;8BAEgB;+BACC;oCACK;6DAEnB;4CACsB;sCACD;qBACt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,SAASoB,kBAAkBpB,QAAkB,EAAE6C,IAAY;IACzD,OAAO7C,SAAS6D,IAAI,CAAC,CAACtC,MAAQA,QAAQsB,QAAQtB,IAAIuC,UAAU,CAAC,GAAGjB,KAAK,CAAC,CAAC;AACzE;AAEA,+DAA+D,GAC/D,SAASrB,kBAAkBqB,OAAO,EAAE;IAClC,OAAOA,KAAKsB,OAAO,CAAC,KAAK,KAAK,GAAG,qCAAqC;AACxE"}
1
+ {"version":3,"sources":["../../../src/install/installAsync.ts"],"sourcesContent":["import { getConfig, getPackageJson } from '@expo/config';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport { applyPluginsAsync } from './applyPlugins';\nimport { checkPackagesAsync } from './checkPackages';\nimport { installExpoPackageAsync } from './installExpoPackage';\nimport type { Options } from './resolveOptions';\nimport * as Log from '../log';\nimport { checkPackagesCompatibility } from './utils/checkPackagesCompatibility';\nimport { getVersionedPackagesAsync } from '../start/doctor/dependencies/getVersionedPackages';\nimport { env } from '../utils/env';\nimport { CommandError } from '../utils/errors';\nimport { findUpProjectRootOrAssert } from '../utils/findUp';\nimport { learnMore } from '../utils/link';\nimport { setNodeEnv, loadEnvFiles } from '../utils/nodeEnv';\nimport { joinWithCommasAnd } from '../utils/strings';\n\n/**\n * Installs versions of specified packages compatible with the current Expo SDK version, or\n * checks/ fixes dependencies in project if they don't match compatible versions specified in bundledNativeModules or versions endpoints.\n *\n * @param packages list of packages to install, if installing specific packages and not checking/ fixing\n * @param options options, including check or fix\n * @param packageManagerArguments arguments to forward to the package manager invoked while installing\n * @returns Promise<void>\n */\nexport async function installAsync(\n packages: string[],\n options: Options & { projectRoot?: string },\n packageManagerArguments: string[] = []\n) {\n setNodeEnv('development');\n // Locate the project root based on the process current working directory.\n // This enables users to run `npx expo install` from a subdirectory of the project.\n const projectRoot = options?.projectRoot ?? findUpProjectRootOrAssert(process.cwd());\n loadEnvFiles(projectRoot);\n\n // Resolve the package manager used by the project, or based on the provided arguments.\n const packageManager = PackageManager.createForProject(projectRoot, {\n npm: options.npm,\n yarn: options.yarn,\n bun: options.bun,\n pnpm: options.pnpm,\n silent: options.silent,\n log: Log.log,\n });\n\n const expoVersion = findPackageByName(packages, 'expo');\n const otherPackages = packages.filter((pkg) => pkg !== expoVersion);\n\n // Abort early when installing `expo@<version>` and other packages with `--fix/--check`\n if (packageHasVersion(expoVersion) && otherPackages.length && (options.check || options.fix)) {\n throw new CommandError(\n 'BAD_ARGS',\n `Cannot install other packages with ${expoVersion} and --fix or --check`\n );\n }\n\n // Only check/fix packages if `expo@<version>` is not requested\n if (!packageHasVersion(expoVersion) && (options.check || options.fix)) {\n return await checkPackagesAsync(projectRoot, {\n packages,\n options,\n packageManager,\n packageManagerArguments,\n });\n }\n\n // note(simek): check out the packages compatibility with New Architecture against RND API\n if (!env.EXPO_NO_DEPENDENCY_VALIDATION && !env.EXPO_NO_NEW_ARCH_COMPAT_CHECK) {\n await checkPackagesCompatibility(otherPackages);\n }\n\n // Read the project Expo config without plugins.\n const { exp } = getConfig(projectRoot, {\n // Sometimes users will add a plugin to the config before installing the library,\n // this wouldn't work unless we dangerously disable plugin serialization.\n skipPlugins: true,\n });\n\n // Resolve the versioned packages, then install them.\n return installPackagesAsync(projectRoot, {\n ...options,\n packageManager,\n packages,\n packageManagerArguments,\n sdkVersion: exp.sdkVersion!,\n });\n}\n\n/** Version packages and install in a project. */\nexport async function installPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n sdkVersion,\n packageManagerArguments,\n fix,\n check,\n dev,\n }: Options & {\n /**\n * List of packages to version, grouped by the type of dependency.\n * @example ['uuid', 'react-native-reanimated@latest']\n */\n packages: string[];\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * SDK to version `packages` for.\n * @example '44.0.0'\n */\n sdkVersion: string;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n }\n): Promise<void> {\n // Read the project Expo config without plugins.\n const pkg = getPackageJson(projectRoot);\n\n //assertNotInstallingExcludedPackages(projectRoot, packages, pkg);\n\n const versioning = await getVersionedPackagesAsync(projectRoot, {\n packages,\n // sdkVersion is always defined because we don't skipSDKVersionRequirement in getConfig.\n sdkVersion,\n pkg,\n });\n\n Log.log(\n chalk`\\u203A Installing ${\n versioning.messages.length ? versioning.messages.join(' and ') + ' ' : ''\n }using {bold ${packageManager.name}}`\n );\n\n if (versioning.excludedNativeModules.length) {\n const alreadyExcluded = versioning.excludedNativeModules.filter(\n (module) => module.isExcludedFromValidation\n );\n const specifiedExactVersion = versioning.excludedNativeModules.filter(\n (module) => !module.isExcludedFromValidation\n );\n\n if (alreadyExcluded.length) {\n Log.log(\n chalk`\\u203A Using ${joinWithCommasAnd(\n alreadyExcluded.map(\n ({ bundledNativeVersion, name, specifiedVersion }) =>\n `${specifiedVersion || 'latest'} instead of ${bundledNativeVersion} for ${name}`\n )\n )} because ${\n alreadyExcluded.length > 1 ? 'they are' : 'it is'\n } listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n\n if (specifiedExactVersion.length) {\n Log.log(\n chalk`\\u203A Using ${joinWithCommasAnd(\n specifiedExactVersion.map(\n ({ bundledNativeVersion, name, specifiedVersion }) =>\n `${specifiedVersion} instead of ${bundledNativeVersion} for ${name}`\n )\n )} because ${\n specifiedExactVersion.length > 1 ? 'these versions' : 'this version'\n } was explicitly provided. Packages excluded from dependency validation should be listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n }\n\n // `expo` needs to be installed before installing other packages\n const expoPackage = findPackageByName(packages, 'expo');\n if (expoPackage) {\n const postInstallCommand = packages.filter((pkg) => pkg !== expoPackage);\n\n // Pipe options to the next command\n if (fix) postInstallCommand.push('--fix');\n if (check) postInstallCommand.push('--check');\n\n // Abort after installing `expo`, follow up command is spawn in a new process\n return await installExpoPackageAsync(projectRoot, {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall: versioning.packages.find((pkg) => pkg.startsWith('expo@'))!,\n followUpCommandArgs: postInstallCommand,\n });\n }\n\n if (dev) {\n await packageManager.addDevAsync([...packageManagerArguments, ...versioning.packages]);\n } else {\n await packageManager.addAsync([...packageManagerArguments, ...versioning.packages]);\n }\n\n await applyPluginsAsync(projectRoot, versioning.packages);\n}\n\n/** Find a package, by name, in the requested packages list (`expo` -> `expo`/`expo@<version>`) */\nfunction findPackageByName(packages: string[], name: string) {\n return packages.find((pkg) => pkg === name || pkg.startsWith(`${name}@`));\n}\n\n/** Determine if a specific version is requested for a package */\nfunction packageHasVersion(name = '') {\n return name.indexOf('@', 1) > 0; // Scoped packages may start with `@`\n}\n"],"names":["installAsync","installPackagesAsync","packages","options","packageManagerArguments","setNodeEnv","projectRoot","findUpProjectRootOrAssert","process","cwd","loadEnvFiles","packageManager","PackageManager","createForProject","npm","yarn","bun","pnpm","silent","log","Log","expoVersion","findPackageByName","otherPackages","filter","pkg","packageHasVersion","length","check","fix","CommandError","checkPackagesAsync","env","EXPO_NO_DEPENDENCY_VALIDATION","EXPO_NO_NEW_ARCH_COMPAT_CHECK","checkPackagesCompatibility","exp","getConfig","skipPlugins","sdkVersion","dev","getPackageJson","versioning","getVersionedPackagesAsync","chalk","messages","join","name","excludedNativeModules","alreadyExcluded","module","isExcludedFromValidation","specifiedExactVersion","joinWithCommasAnd","map","bundledNativeVersion","specifiedVersion","learnMore","expoPackage","postInstallCommand","push","installExpoPackageAsync","expoPackageToInstall","find","startsWith","followUpCommandArgs","addDevAsync","addAsync","applyPluginsAsync","indexOf"],"mappings":";;;;;;;;;;;QA2BsBA;eAAAA;;QAiEAC;eAAAA;;;;yBA5FoB;;;;;;;iEACV;;;;;;;gEACd;;;;;;8BAEgB;+BACC;oCACK;6DAEnB;4CACsB;sCACD;qBACtB;wBACS;wBACa;sBAChB;yBACe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EAAE6C,IAAY;IACzD,OAAO7C,SAAS6D,IAAI,CAAC,CAACtC,MAAQA,QAAQsB,QAAQtB,IAAIuC,UAAU,CAAC,GAAGjB,KAAK,CAAC,CAAC;AACzE;AAEA,+DAA+D,GAC/D,SAASrB,kBAAkBqB,OAAO,EAAE;IAClC,OAAOA,KAAKsB,OAAO,CAAC,KAAK,KAAK,GAAG,qCAAqC;AACxE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/install/installExpoPackage.ts"],"sourcesContent":["import * as PackageManager from '@expo/package-manager';\nimport spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\n\nimport * as Log from '../log';\nimport type { Options } from './resolveOptions';\nimport { getRunningProcess } from '../utils/getRunningProcess';\n\n/**\n * Given a list of incompatible packages, installs the correct versions of the packages with the package manager used for the project.\n * This exits immediately after spawning the install command, since the command shouldn't remain running while it is being updated.\n */\nexport async function installExpoPackageAsync(\n projectRoot: string,\n {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall,\n followUpCommandArgs,\n dev,\n }: Pick<Options, 'dev'> & {\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n expoPackageToInstall: string;\n followUpCommandArgs: string[];\n }\n) {\n // Check if there's potentially a dev server running in the current folder and warn about it\n // (not guaranteed to be Expo CLI, and the CLI isn't always running on 8081, but it's a good guess)\n const isExpoMaybeRunningForProject = !!(await getRunningProcess(8081));\n\n if (isExpoMaybeRunningForProject) {\n Log.warn(\n 'The Expo CLI appears to be running this project in another terminal window. Close and restart any Expo CLI instances after the installation to complete the update.'\n );\n }\n\n // Safe to use current process to upgrade Expo package- doesn't affect current process\n try {\n if (dev) {\n await packageManager.addDevAsync([...packageManagerArguments, expoPackageToInstall]);\n } else {\n await packageManager.addAsync([...packageManagerArguments, expoPackageToInstall]);\n }\n } catch (error) {\n Log.error(\n chalk`Cannot install the latest Expo package. Install {bold expo@latest} with ${packageManager.name} and then run {bold npx expo install} again.`\n );\n throw error;\n }\n\n // Spawn a new process to install the rest of the packages if there are any, as only then will the latest Expo package be used\n if (followUpCommandArgs.length) {\n let commandSegments = ['expo', 'install', dev ? '--dev' : '', ...followUpCommandArgs].filter(\n Boolean\n );\n if (packageManagerArguments.length) {\n commandSegments = [...commandSegments, '--', ...packageManagerArguments];\n }\n\n Log.log(chalk`\\u203A Running {bold npx expo install} under the updated expo version`);\n Log.log('> ' + commandSegments.join(' '));\n\n await spawnAsync('npx', commandSegments, {\n stdio: 'inherit',\n cwd: projectRoot,\n env: { ...process.env },\n });\n }\n}\n"],"names":["installExpoPackageAsync","projectRoot","packageManager","packageManagerArguments","expoPackageToInstall","followUpCommandArgs","dev","isExpoMaybeRunningForProject","getRunningProcess","Log","warn","addDevAsync","addAsync","error","chalk","name","length","commandSegments","filter","Boolean","log","join","spawnAsync","stdio","cwd","env","process"],"mappings":";;;;+BAYsBA;;;eAAAA;;;;gEAXC;;;;;;;gEACL;;;;;;6DAEG;mCAEa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM3B,eAAeA,wBACpBC,WAAmB,EACnB,EACEC,cAAc,EACdC,uBAAuB,EACvBC,oBAAoB,EACpBC,mBAAmB,EACnBC,GAAG,EAWJ;IAED,4FAA4F;IAC5F,mGAAmG;IACnG,MAAMC,+BAA+B,CAAC,CAAE,MAAMC,IAAAA,oCAAiB,EAAC;IAEhE,IAAID,8BAA8B;QAChCE,KAAIC,IAAI,CACN;IAEJ;IAEA,sFAAsF;IACtF,IAAI;QACF,IAAIJ,KAAK;YACP,MAAMJ,eAAeS,WAAW,CAAC;mBAAIR;gBAAyBC;aAAqB;QACrF,OAAO;YACL,MAAMF,eAAeU,QAAQ,CAAC;mBAAIT;gBAAyBC;aAAqB;QAClF;IACF,EAAE,OAAOS,OAAO;QACdJ,KAAII,KAAK,CACPC,IAAAA,gBAAK,CAAA,CAAC,wEAAwE,EAAEZ,eAAea,IAAI,CAAC,4CAA4C,CAAC;QAEnJ,MAAMF;IACR;IAEA,8HAA8H;IAC9H,IAAIR,oBAAoBW,MAAM,EAAE;QAC9B,IAAIC,kBAAkB;YAAC;YAAQ;YAAWX,MAAM,UAAU;eAAOD;SAAoB,CAACa,MAAM,CAC1FC;QAEF,IAAIhB,wBAAwBa,MAAM,EAAE;YAClCC,kBAAkB;mBAAIA;gBAAiB;mBAASd;aAAwB;QAC1E;QAEAM,KAAIW,GAAG,CAACN,IAAAA,gBAAK,CAAA,CAAC,qEAAqE,CAAC;QACpFL,KAAIW,GAAG,CAAC,OAAOH,gBAAgBI,IAAI,CAAC;QAEpC,MAAMC,IAAAA,qBAAU,EAAC,OAAOL,iBAAiB;YACvCM,OAAO;YACPC,KAAKvB;YACLwB,KAAK;gBAAE,GAAGC,QAAQD,GAAG;YAAC;QACxB;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/install/installExpoPackage.ts"],"sourcesContent":["import type * as PackageManager from '@expo/package-manager';\nimport spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\n\nimport * as Log from '../log';\nimport type { Options } from './resolveOptions';\nimport { getRunningProcess } from '../utils/getRunningProcess';\n\n/**\n * Given a list of incompatible packages, installs the correct versions of the packages with the package manager used for the project.\n * This exits immediately after spawning the install command, since the command shouldn't remain running while it is being updated.\n */\nexport async function installExpoPackageAsync(\n projectRoot: string,\n {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall,\n followUpCommandArgs,\n dev,\n }: Pick<Options, 'dev'> & {\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n expoPackageToInstall: string;\n followUpCommandArgs: string[];\n }\n) {\n // Check if there's potentially a dev server running in the current folder and warn about it\n // (not guaranteed to be Expo CLI, and the CLI isn't always running on 8081, but it's a good guess)\n const isExpoMaybeRunningForProject = !!(await getRunningProcess(8081));\n\n if (isExpoMaybeRunningForProject) {\n Log.warn(\n 'The Expo CLI appears to be running this project in another terminal window. Close and restart any Expo CLI instances after the installation to complete the update.'\n );\n }\n\n // Safe to use current process to upgrade Expo package- doesn't affect current process\n try {\n if (dev) {\n await packageManager.addDevAsync([...packageManagerArguments, expoPackageToInstall]);\n } else {\n await packageManager.addAsync([...packageManagerArguments, expoPackageToInstall]);\n }\n } catch (error) {\n Log.error(\n chalk`Cannot install the latest Expo package. Install {bold expo@latest} with ${packageManager.name} and then run {bold npx expo install} again.`\n );\n throw error;\n }\n\n // Spawn a new process to install the rest of the packages if there are any, as only then will the latest Expo package be used\n if (followUpCommandArgs.length) {\n let commandSegments = ['expo', 'install', dev ? '--dev' : '', ...followUpCommandArgs].filter(\n Boolean\n );\n if (packageManagerArguments.length) {\n commandSegments = [...commandSegments, '--', ...packageManagerArguments];\n }\n\n Log.log(chalk`\\u203A Running {bold npx expo install} under the updated expo version`);\n Log.log('> ' + commandSegments.join(' '));\n\n await spawnAsync('npx', commandSegments, {\n stdio: 'inherit',\n cwd: projectRoot,\n env: { ...process.env },\n });\n }\n}\n"],"names":["installExpoPackageAsync","projectRoot","packageManager","packageManagerArguments","expoPackageToInstall","followUpCommandArgs","dev","isExpoMaybeRunningForProject","getRunningProcess","Log","warn","addDevAsync","addAsync","error","chalk","name","length","commandSegments","filter","Boolean","log","join","spawnAsync","stdio","cwd","env","process"],"mappings":";;;;+BAYsBA;;;eAAAA;;;;gEAXC;;;;;;;gEACL;;;;;;6DAEG;mCAEa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM3B,eAAeA,wBACpBC,WAAmB,EACnB,EACEC,cAAc,EACdC,uBAAuB,EACvBC,oBAAoB,EACpBC,mBAAmB,EACnBC,GAAG,EAWJ;IAED,4FAA4F;IAC5F,mGAAmG;IACnG,MAAMC,+BAA+B,CAAC,CAAE,MAAMC,IAAAA,oCAAiB,EAAC;IAEhE,IAAID,8BAA8B;QAChCE,KAAIC,IAAI,CACN;IAEJ;IAEA,sFAAsF;IACtF,IAAI;QACF,IAAIJ,KAAK;YACP,MAAMJ,eAAeS,WAAW,CAAC;mBAAIR;gBAAyBC;aAAqB;QACrF,OAAO;YACL,MAAMF,eAAeU,QAAQ,CAAC;mBAAIT;gBAAyBC;aAAqB;QAClF;IACF,EAAE,OAAOS,OAAO;QACdJ,KAAII,KAAK,CACPC,IAAAA,gBAAK,CAAA,CAAC,wEAAwE,EAAEZ,eAAea,IAAI,CAAC,4CAA4C,CAAC;QAEnJ,MAAMF;IACR;IAEA,8HAA8H;IAC9H,IAAIR,oBAAoBW,MAAM,EAAE;QAC9B,IAAIC,kBAAkB;YAAC;YAAQ;YAAWX,MAAM,UAAU;eAAOD;SAAoB,CAACa,MAAM,CAC1FC;QAEF,IAAIhB,wBAAwBa,MAAM,EAAE;YAClCC,kBAAkB;mBAAIA;gBAAiB;mBAASd;aAAwB;QAC1E;QAEAM,KAAIW,GAAG,CAACN,IAAAA,gBAAK,CAAA,CAAC,qEAAqE,CAAC;QACpFL,KAAIW,GAAG,CAAC,OAAOH,gBAAgBI,IAAI,CAAC;QAEpC,MAAMC,IAAAA,qBAAU,EAAC,OAAOL,iBAAiB;YACvCM,OAAO;YACPC,KAAKvB;YACLwB,KAAK;gBAAE,GAAGC,QAAQD,GAAG;YAAC;QACxB;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/install/resolveOptions.ts"],"sourcesContent":["import { NodePackageManagerForProject } from '@expo/package-manager';\n\nimport { CommandError } from '../utils/errors';\nimport { assertUnexpectedVariadicFlags, parseVariadicArguments } from '../utils/variadic';\n\nexport type Options = Pick<NodePackageManagerForProject, 'npm' | 'pnpm' | 'yarn' | 'bun'> & {\n /** Check which packages need to be updated, does not install any provided packages. */\n check?: boolean;\n /** Should the dependencies be fixed automatically. */\n fix?: boolean;\n /** Should disable install output, used for commands like `prebuild` that run install internally. */\n silent?: boolean;\n /** Should be installed as dev dependencies */\n dev?: boolean;\n /** Should output in JSON format (use with --check) */\n json?: boolean;\n};\n\nfunction resolveOptions(options: Options): Options {\n if (options.fix && options.check) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --check, --fix');\n }\n if ([options.npm, options.pnpm, options.yarn, options.bun].filter(Boolean).length > 1) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --npm, --pnpm, --yarn, --bun');\n }\n if (options.json && !options.check) {\n throw new CommandError('BAD_ARGS', 'The --json flag can only be used with --check');\n }\n return {\n ...options,\n };\n}\n\nexport async function resolveArgsAsync(\n argv: string[]\n): Promise<{ variadic: string[]; options: Options; extras: string[] }> {\n const { variadic, extras, flags } = parseVariadicArguments(argv);\n\n assertUnexpectedVariadicFlags(\n ['--check', '--dev', '--fix', '--npm', '--pnpm', '--yarn', '--bun', '--json'],\n { variadic, extras, flags },\n 'npx expo install'\n );\n\n return {\n // Variadic arguments like `npx expo install react react-dom` -> ['react', 'react-dom']\n variadic,\n options: resolveOptions({\n fix: !!flags['--fix'],\n dev: !!flags['--dev'],\n check: !!flags['--check'],\n yarn: !!flags['--yarn'],\n npm: !!flags['--npm'],\n pnpm: !!flags['--pnpm'],\n bun: !!flags['--bun'],\n json: !!flags['--json'],\n }),\n extras,\n };\n}\n"],"names":["resolveArgsAsync","resolveOptions","options","fix","check","CommandError","npm","pnpm","yarn","bun","filter","Boolean","length","json","argv","variadic","extras","flags","parseVariadicArguments","assertUnexpectedVariadicFlags","dev"],"mappings":";;;;+BAiCsBA;;;eAAAA;;;wBA/BO;0BACyC;AAetE,SAASC,eAAeC,OAAgB;IACtC,IAAIA,QAAQC,GAAG,IAAID,QAAQE,KAAK,EAAE;QAChC,MAAM,IAAIC,oBAAY,CAAC,YAAY;IACrC;IACA,IAAI;QAACH,QAAQI,GAAG;QAAEJ,QAAQK,IAAI;QAAEL,QAAQM,IAAI;QAAEN,QAAQO,GAAG;KAAC,CAACC,MAAM,CAACC,SAASC,MAAM,GAAG,GAAG;QACrF,MAAM,IAAIP,oBAAY,CAAC,YAAY;IACrC;IACA,IAAIH,QAAQW,IAAI,IAAI,CAACX,QAAQE,KAAK,EAAE;QAClC,MAAM,IAAIC,oBAAY,CAAC,YAAY;IACrC;IACA,OAAO;QACL,GAAGH,OAAO;IACZ;AACF;AAEO,eAAeF,iBACpBc,IAAc;IAEd,MAAM,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGC,IAAAA,gCAAsB,EAACJ;IAE3DK,IAAAA,uCAA6B,EAC3B;QAAC;QAAW;QAAS;QAAS;QAAS;QAAU;QAAU;QAAS;KAAS,EAC7E;QAAEJ;QAAUC;QAAQC;IAAM,GAC1B;IAGF,OAAO;QACL,uFAAuF;QACvFF;QACAb,SAASD,eAAe;YACtBE,KAAK,CAAC,CAACc,KAAK,CAAC,QAAQ;YACrBG,KAAK,CAAC,CAACH,KAAK,CAAC,QAAQ;YACrBb,OAAO,CAAC,CAACa,KAAK,CAAC,UAAU;YACzBT,MAAM,CAAC,CAACS,KAAK,CAAC,SAAS;YACvBX,KAAK,CAAC,CAACW,KAAK,CAAC,QAAQ;YACrBV,MAAM,CAAC,CAACU,KAAK,CAAC,SAAS;YACvBR,KAAK,CAAC,CAACQ,KAAK,CAAC,QAAQ;YACrBJ,MAAM,CAAC,CAACI,KAAK,CAAC,SAAS;QACzB;QACAD;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/install/resolveOptions.ts"],"sourcesContent":["import type { NodePackageManagerForProject } from '@expo/package-manager';\n\nimport { CommandError } from '../utils/errors';\nimport { assertUnexpectedVariadicFlags, parseVariadicArguments } from '../utils/variadic';\n\nexport type Options = Pick<NodePackageManagerForProject, 'npm' | 'pnpm' | 'yarn' | 'bun'> & {\n /** Check which packages need to be updated, does not install any provided packages. */\n check?: boolean;\n /** Should the dependencies be fixed automatically. */\n fix?: boolean;\n /** Should disable install output, used for commands like `prebuild` that run install internally. */\n silent?: boolean;\n /** Should be installed as dev dependencies */\n dev?: boolean;\n /** Should output in JSON format (use with --check) */\n json?: boolean;\n};\n\nfunction resolveOptions(options: Options): Options {\n if (options.fix && options.check) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --check, --fix');\n }\n if ([options.npm, options.pnpm, options.yarn, options.bun].filter(Boolean).length > 1) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --npm, --pnpm, --yarn, --bun');\n }\n if (options.json && !options.check) {\n throw new CommandError('BAD_ARGS', 'The --json flag can only be used with --check');\n }\n return {\n ...options,\n };\n}\n\nexport async function resolveArgsAsync(\n argv: string[]\n): Promise<{ variadic: string[]; options: Options; extras: string[] }> {\n const { variadic, extras, flags } = parseVariadicArguments(argv);\n\n assertUnexpectedVariadicFlags(\n ['--check', '--dev', '--fix', '--npm', '--pnpm', '--yarn', '--bun', '--json'],\n { variadic, extras, flags },\n 'npx expo install'\n );\n\n return {\n // Variadic arguments like `npx expo install react react-dom` -> ['react', 'react-dom']\n variadic,\n options: resolveOptions({\n fix: !!flags['--fix'],\n dev: !!flags['--dev'],\n check: !!flags['--check'],\n yarn: !!flags['--yarn'],\n npm: !!flags['--npm'],\n pnpm: !!flags['--pnpm'],\n bun: !!flags['--bun'],\n json: !!flags['--json'],\n }),\n extras,\n };\n}\n"],"names":["resolveArgsAsync","resolveOptions","options","fix","check","CommandError","npm","pnpm","yarn","bun","filter","Boolean","length","json","argv","variadic","extras","flags","parseVariadicArguments","assertUnexpectedVariadicFlags","dev"],"mappings":";;;;+BAiCsBA;;;eAAAA;;;wBA/BO;0BACyC;AAetE,SAASC,eAAeC,OAAgB;IACtC,IAAIA,QAAQC,GAAG,IAAID,QAAQE,KAAK,EAAE;QAChC,MAAM,IAAIC,oBAAY,CAAC,YAAY;IACrC;IACA,IAAI;QAACH,QAAQI,GAAG;QAAEJ,QAAQK,IAAI;QAAEL,QAAQM,IAAI;QAAEN,QAAQO,GAAG;KAAC,CAACC,MAAM,CAACC,SAASC,MAAM,GAAG,GAAG;QACrF,MAAM,IAAIP,oBAAY,CAAC,YAAY;IACrC;IACA,IAAIH,QAAQW,IAAI,IAAI,CAACX,QAAQE,KAAK,EAAE;QAClC,MAAM,IAAIC,oBAAY,CAAC,YAAY;IACrC;IACA,OAAO;QACL,GAAGH,OAAO;IACZ;AACF;AAEO,eAAeF,iBACpBc,IAAc;IAEd,MAAM,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGC,IAAAA,gCAAsB,EAACJ;IAE3DK,IAAAA,uCAA6B,EAC3B;QAAC;QAAW;QAAS;QAAS;QAAS;QAAU;QAAU;QAAS;KAAS,EAC7E;QAAEJ;QAAUC;QAAQC;IAAM,GAC1B;IAGF,OAAO;QACL,uFAAuF;QACvFF;QACAb,SAASD,eAAe;YACtBE,KAAK,CAAC,CAACc,KAAK,CAAC,QAAQ;YACrBG,KAAK,CAAC,CAACH,KAAK,CAAC,QAAQ;YACrBb,OAAO,CAAC,CAACa,KAAK,CAAC,UAAU;YACzBT,MAAM,CAAC,CAACS,KAAK,CAAC,SAAS;YACvBX,KAAK,CAAC,CAACW,KAAK,CAAC,QAAQ;YACrBV,MAAM,CAAC,CAACU,KAAK,CAAC,SAAS;YACvBR,KAAK,CAAC,CAACQ,KAAK,CAAC,QAAQ;YACrBJ,MAAM,CAAC,CAACI,KAAK,CAAC,SAAS;QACzB;QACAD;IACF;AACF"}
@@ -5,14 +5,14 @@ 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
- autoAddConfigPluginsAsync: function() {
12
+ get autoAddConfigPluginsAsync () {
13
13
  return autoAddConfigPluginsAsync;
14
14
  },
15
- getNamedPlugins: function() {
15
+ get getNamedPlugins () {
16
16
  return getNamedPlugins;
17
17
  }
18
18
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/install/utils/autoAddConfigPlugins.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport {\n normalizeStaticPlugin,\n resolveConfigPluginFunctionWithInfo,\n} from '@expo/config-plugins/build/utils/plugin-resolver';\nimport { getAutoPlugins } from '@expo/prebuild-config';\n\nimport { attemptAddingPluginsAsync } from '../../utils/modifyConfigPlugins';\n\nconst debug = require('debug')('expo:install:config-plugins') as typeof console.log;\n\nconst AUTO_PLUGINS = getAutoPlugins();\n\n/**\n * Resolve if a package has a config plugin.\n * For sanity, we'll only support config plugins that use the `app.config.js` entry file,\n * this is because a package like `lodash` could be a \"valid\" config plugin and break the prebuild process.\n *\n * @param projectRoot\n * @param packageName\n * @returns\n */\nfunction packageHasConfigPlugin(projectRoot: string, packageName: string) {\n try {\n const info = resolveConfigPluginFunctionWithInfo(projectRoot, packageName);\n if (info.isPluginFile) {\n return info.plugin;\n }\n } catch {}\n return false;\n}\n\n/**\n * Get a list of plugins that were are supplied as string module IDs.\n * @example\n * ```json\n * {\n * \"plugins\": [\n * \"expo-camera\",\n * [\"react-native-firebase\", ...]\n * ]\n * }\n * ```\n * ↓ ↓ ↓ ↓ ↓ ↓\n *\n * `['expo-camera', 'react-native-firebase']`\n *\n */\nexport function getNamedPlugins(plugins: NonNullable<ExpoConfig['plugins']>): string[] {\n const namedPlugins: string[] = [];\n for (const plugin of plugins) {\n try {\n // @ts-ignore\n const [normal] = normalizeStaticPlugin(plugin);\n if (typeof normal === 'string') {\n namedPlugins.push(normal);\n }\n } catch {\n // ignore assertions\n }\n }\n return namedPlugins;\n}\n\n/** Attempts to ensure that non-auto plugins are added to the `app.json` `plugins` array when modules with Expo Config Plugins are installed. */\nexport async function autoAddConfigPluginsAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'plugins'>,\n packages: string[]\n) {\n debug('Checking config plugins...');\n\n const currentPlugins = exp.plugins || [];\n const normalized = getNamedPlugins(currentPlugins);\n\n debug(`Existing plugins: ${normalized.join(', ')}`);\n\n const plugins = packages.filter((pkg) => {\n if (normalized.includes(pkg)) {\n // already included in plugins array\n return false;\n }\n // Check if the package has a valid plugin. Must be a well-made plugin for it to work with this.\n const plugin = packageHasConfigPlugin(projectRoot, pkg);\n\n debug(`Package \"${pkg}\" has plugin: ${!!plugin}` + (plugin ? ` (args: ${plugin.length})` : ''));\n\n if (AUTO_PLUGINS.includes(pkg)) {\n debug(`Package \"${pkg}\" is an auto plugin, skipping...`);\n return false;\n }\n\n return !!plugin;\n });\n\n await attemptAddingPluginsAsync(projectRoot, plugins);\n}\n"],"names":["autoAddConfigPluginsAsync","getNamedPlugins","debug","require","AUTO_PLUGINS","getAutoPlugins","packageHasConfigPlugin","projectRoot","packageName","info","resolveConfigPluginFunctionWithInfo","isPluginFile","plugin","plugins","namedPlugins","normal","normalizeStaticPlugin","push","exp","packages","currentPlugins","normalized","join","filter","pkg","includes","length","attemptAddingPluginsAsync"],"mappings":";;;;;;;;;;;IAiEsBA,yBAAyB;eAAzBA;;IAjBNC,eAAe;eAAfA;;;;yBA5CT;;;;;;;yBACwB;;;;;;qCAEW;AAE1C,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,MAAMC,eAAeC,IAAAA,gCAAc;AAEnC;;;;;;;;CAQC,GACD,SAASC,uBAAuBC,WAAmB,EAAEC,WAAmB;IACtE,IAAI;QACF,MAAMC,OAAOC,IAAAA,qDAAmC,EAACH,aAAaC;QAC9D,IAAIC,KAAKE,YAAY,EAAE;YACrB,OAAOF,KAAKG,MAAM;QACpB;IACF,EAAE,OAAM,CAAC;IACT,OAAO;AACT;AAkBO,SAASX,gBAAgBY,OAA2C;IACzE,MAAMC,eAAyB,EAAE;IACjC,KAAK,MAAMF,UAAUC,QAAS;QAC5B,IAAI;YACF,aAAa;YACb,MAAM,CAACE,OAAO,GAAGC,IAAAA,uCAAqB,EAACJ;YACvC,IAAI,OAAOG,WAAW,UAAU;gBAC9BD,aAAaG,IAAI,CAACF;YACpB;QACF,EAAE,OAAM;QACN,oBAAoB;QACtB;IACF;IACA,OAAOD;AACT;AAGO,eAAed,0BACpBO,WAAmB,EACnBW,GAAgC,EAChCC,QAAkB;IAElBjB,MAAM;IAEN,MAAMkB,iBAAiBF,IAAIL,OAAO,IAAI,EAAE;IACxC,MAAMQ,aAAapB,gBAAgBmB;IAEnClB,MAAM,CAAC,kBAAkB,EAAEmB,WAAWC,IAAI,CAAC,OAAO;IAElD,MAAMT,UAAUM,SAASI,MAAM,CAAC,CAACC;QAC/B,IAAIH,WAAWI,QAAQ,CAACD,MAAM;YAC5B,oCAAoC;YACpC,OAAO;QACT;QACA,gGAAgG;QAChG,MAAMZ,SAASN,uBAAuBC,aAAaiB;QAEnDtB,MAAM,CAAC,SAAS,EAAEsB,IAAI,cAAc,EAAE,CAAC,CAACZ,QAAQ,GAAIA,CAAAA,SAAS,CAAC,QAAQ,EAAEA,OAAOc,MAAM,CAAC,CAAC,CAAC,GAAG,EAAC;QAE5F,IAAItB,aAAaqB,QAAQ,CAACD,MAAM;YAC9BtB,MAAM,CAAC,SAAS,EAAEsB,IAAI,gCAAgC,CAAC;YACvD,OAAO;QACT;QAEA,OAAO,CAAC,CAACZ;IACX;IAEA,MAAMe,IAAAA,8CAAyB,EAACpB,aAAaM;AAC/C"}
1
+ {"version":3,"sources":["../../../../src/install/utils/autoAddConfigPlugins.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config';\nimport {\n normalizeStaticPlugin,\n resolveConfigPluginFunctionWithInfo,\n} from '@expo/config-plugins/build/utils/plugin-resolver';\nimport { getAutoPlugins } from '@expo/prebuild-config';\n\nimport { attemptAddingPluginsAsync } from '../../utils/modifyConfigPlugins';\n\nconst debug = require('debug')('expo:install:config-plugins') as typeof console.log;\n\nconst AUTO_PLUGINS = getAutoPlugins();\n\n/**\n * Resolve if a package has a config plugin.\n * For sanity, we'll only support config plugins that use the `app.config.js` entry file,\n * this is because a package like `lodash` could be a \"valid\" config plugin and break the prebuild process.\n *\n * @param projectRoot\n * @param packageName\n * @returns\n */\nfunction packageHasConfigPlugin(projectRoot: string, packageName: string) {\n try {\n const info = resolveConfigPluginFunctionWithInfo(projectRoot, packageName);\n if (info.isPluginFile) {\n return info.plugin;\n }\n } catch {}\n return false;\n}\n\n/**\n * Get a list of plugins that were are supplied as string module IDs.\n * @example\n * ```json\n * {\n * \"plugins\": [\n * \"expo-camera\",\n * [\"react-native-firebase\", ...]\n * ]\n * }\n * ```\n * ↓ ↓ ↓ ↓ ↓ ↓\n *\n * `['expo-camera', 'react-native-firebase']`\n *\n */\nexport function getNamedPlugins(plugins: NonNullable<ExpoConfig['plugins']>): string[] {\n const namedPlugins: string[] = [];\n for (const plugin of plugins) {\n try {\n // @ts-ignore\n const [normal] = normalizeStaticPlugin(plugin);\n if (typeof normal === 'string') {\n namedPlugins.push(normal);\n }\n } catch {\n // ignore assertions\n }\n }\n return namedPlugins;\n}\n\n/** Attempts to ensure that non-auto plugins are added to the `app.json` `plugins` array when modules with Expo Config Plugins are installed. */\nexport async function autoAddConfigPluginsAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'plugins'>,\n packages: string[]\n) {\n debug('Checking config plugins...');\n\n const currentPlugins = exp.plugins || [];\n const normalized = getNamedPlugins(currentPlugins);\n\n debug(`Existing plugins: ${normalized.join(', ')}`);\n\n const plugins = packages.filter((pkg) => {\n if (normalized.includes(pkg)) {\n // already included in plugins array\n return false;\n }\n // Check if the package has a valid plugin. Must be a well-made plugin for it to work with this.\n const plugin = packageHasConfigPlugin(projectRoot, pkg);\n\n debug(`Package \"${pkg}\" has plugin: ${!!plugin}` + (plugin ? ` (args: ${plugin.length})` : ''));\n\n if (AUTO_PLUGINS.includes(pkg)) {\n debug(`Package \"${pkg}\" is an auto plugin, skipping...`);\n return false;\n }\n\n return !!plugin;\n });\n\n await attemptAddingPluginsAsync(projectRoot, plugins);\n}\n"],"names":["autoAddConfigPluginsAsync","getNamedPlugins","debug","require","AUTO_PLUGINS","getAutoPlugins","packageHasConfigPlugin","projectRoot","packageName","info","resolveConfigPluginFunctionWithInfo","isPluginFile","plugin","plugins","namedPlugins","normal","normalizeStaticPlugin","push","exp","packages","currentPlugins","normalized","join","filter","pkg","includes","length","attemptAddingPluginsAsync"],"mappings":";;;;;;;;;;;QAiEsBA;eAAAA;;QAjBNC;eAAAA;;;;yBA5CT;;;;;;;yBACwB;;;;;;qCAEW;AAE1C,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,MAAMC,eAAeC,IAAAA,gCAAc;AAEnC;;;;;;;;CAQC,GACD,SAASC,uBAAuBC,WAAmB,EAAEC,WAAmB;IACtE,IAAI;QACF,MAAMC,OAAOC,IAAAA,qDAAmC,EAACH,aAAaC;QAC9D,IAAIC,KAAKE,YAAY,EAAE;YACrB,OAAOF,KAAKG,MAAM;QACpB;IACF,EAAE,OAAM,CAAC;IACT,OAAO;AACT;AAkBO,SAASX,gBAAgBY,OAA2C;IACzE,MAAMC,eAAyB,EAAE;IACjC,KAAK,MAAMF,UAAUC,QAAS;QAC5B,IAAI;YACF,aAAa;YACb,MAAM,CAACE,OAAO,GAAGC,IAAAA,uCAAqB,EAACJ;YACvC,IAAI,OAAOG,WAAW,UAAU;gBAC9BD,aAAaG,IAAI,CAACF;YACpB;QACF,EAAE,OAAM;QACN,oBAAoB;QACtB;IACF;IACA,OAAOD;AACT;AAGO,eAAed,0BACpBO,WAAmB,EACnBW,GAAgC,EAChCC,QAAkB;IAElBjB,MAAM;IAEN,MAAMkB,iBAAiBF,IAAIL,OAAO,IAAI,EAAE;IACxC,MAAMQ,aAAapB,gBAAgBmB;IAEnClB,MAAM,CAAC,kBAAkB,EAAEmB,WAAWC,IAAI,CAAC,OAAO;IAElD,MAAMT,UAAUM,SAASI,MAAM,CAAC,CAACC;QAC/B,IAAIH,WAAWI,QAAQ,CAACD,MAAM;YAC5B,oCAAoC;YACpC,OAAO;QACT;QACA,gGAAgG;QAChG,MAAMZ,SAASN,uBAAuBC,aAAaiB;QAEnDtB,MAAM,CAAC,SAAS,EAAEsB,IAAI,cAAc,EAAE,CAAC,CAACZ,QAAQ,GAAIA,CAAAA,SAAS,CAAC,QAAQ,EAAEA,OAAOc,MAAM,CAAC,CAAC,CAAC,GAAG,EAAC;QAE5F,IAAItB,aAAaqB,QAAQ,CAACD,MAAM;YAC9BtB,MAAM,CAAC,SAAS,EAAEsB,IAAI,gCAAgC,CAAC;YACvD,OAAO;QACT;QAEA,OAAO,CAAC,CAACZ;IACX;IAEA,MAAMe,IAAAA,8CAAyB,EAACpB,aAAaM;AAC/C"}
@@ -1,11 +1,19 @@
1
- // note(Simek): https://github.com/react-native-community/directory/blob/main/pages/api/libraries/check.ts
1
+ // note(Simek): reference https://github.com/react-native-community/directory/blob/main/pages/api/libraries/check.ts
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "checkPackagesCompatibility", {
7
- enumerable: true,
8
- get: function() {
6
+ function _export(target, all) {
7
+ for(var name in all)Object.defineProperty(target, name, {
8
+ enumerable: true,
9
+ get: Object.getOwnPropertyDescriptor(all, name).get
10
+ });
11
+ }
12
+ _export(exports, {
13
+ get MAX_PACKAGES_PER_QUERY () {
14
+ return MAX_PACKAGES_PER_QUERY;
15
+ },
16
+ get checkPackagesCompatibility () {
9
17
  return checkPackagesCompatibility;
10
18
  }
11
19
  });
@@ -17,6 +25,7 @@ function _chalk() {
17
25
  return data;
18
26
  }
19
27
  const _log = require("../../log");
28
+ const _array = require("../../utils/array");
20
29
  const _fetch = require("../../utils/fetch");
21
30
  const _link = require("../../utils/link");
22
31
  function _interop_require_default(obj) {
@@ -24,6 +33,7 @@ function _interop_require_default(obj) {
24
33
  default: obj
25
34
  };
26
35
  }
36
+ const MAX_PACKAGES_PER_QUERY = 50;
27
37
  const ERROR_MESSAGE = 'Unable to fetch compatibility data from React Native Directory. Skipping check.';
28
38
  async function checkPackagesCompatibility(packages) {
29
39
  try {
@@ -31,19 +41,25 @@ async function checkPackagesCompatibility(packages) {
31
41
  if (!packagesToCheck.length) {
32
42
  return;
33
43
  }
34
- const response = await (0, _fetch.fetch)('https://reactnative.directory/api/libraries/check', {
35
- method: 'POST',
36
- headers: {
37
- 'Content-Type': 'application/json'
38
- },
39
- body: JSON.stringify({
40
- packages: packagesToCheck
41
- })
42
- });
43
- if (!response.ok) {
44
+ const chunkedPackages = (0, _array.chunk)(packagesToCheck, MAX_PACKAGES_PER_QUERY);
45
+ const results = await Promise.allSettled(chunkedPackages.map((packageChunk)=>(0, _fetch.fetch)(`https://reactnative.directory/api/libraries/check?${new URLSearchParams({
46
+ packages: packageChunk.join(',')
47
+ })}`).then((response)=>{
48
+ if (!response.ok) {
49
+ throw new Error(ERROR_MESSAGE);
50
+ }
51
+ return response.json();
52
+ })));
53
+ const packageMetadata = results.reduce((acc, result)=>{
54
+ if (result.status === 'fulfilled') {
55
+ return {
56
+ ...acc,
57
+ ...result.value
58
+ };
59
+ }
44
60
  _log.Log.log(_chalk().default.gray(ERROR_MESSAGE));
45
- }
46
- const packageMetadata = await response.json();
61
+ return acc;
62
+ }, {});
47
63
  const incompatiblePackages = packagesToCheck.filter((packageName)=>{
48
64
  var _packageMetadata_packageName;
49
65
  return ((_packageMetadata_packageName = packageMetadata[packageName]) == null ? void 0 : _packageMetadata_packageName.newArchitecture) === 'unsupported';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/install/utils/checkPackagesCompatibility.ts"],"sourcesContent":["// note(Simek): https://github.com/react-native-community/directory/blob/main/pages/api/libraries/check.ts\nimport chalk from 'chalk';\n\nimport { Log } from '../../log';\nimport { fetch } from '../../utils/fetch';\nimport { learnMore } from '../../utils/link';\n\nexport type ReactNativeDirectoryCheckResult = {\n unmaintained: boolean;\n newArchitecture: 'supported' | 'unsupported' | 'untested';\n};\n\nconst ERROR_MESSAGE =\n 'Unable to fetch compatibility data from React Native Directory. Skipping check.';\n\nexport async function checkPackagesCompatibility(packages: string[]) {\n try {\n const packagesToCheck = packages.filter(\n (packageName) =>\n !packageName.startsWith('@expo/') && !packageName.startsWith('@expo-google-fonts/')\n );\n\n if (!packagesToCheck.length) {\n return;\n }\n\n const response = await fetch('https://reactnative.directory/api/libraries/check', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ packages: packagesToCheck }),\n });\n\n if (!response.ok) {\n Log.log(chalk.gray(ERROR_MESSAGE));\n }\n\n const packageMetadata = (await response.json()) as Record<\n string,\n ReactNativeDirectoryCheckResult\n >;\n\n const incompatiblePackages = packagesToCheck.filter(\n (packageName) => packageMetadata[packageName]?.newArchitecture === 'unsupported'\n );\n\n if (incompatiblePackages.length) {\n Log.warn(\n chalk.yellow(\n `${chalk.bold('Warning')}: ${formatPackageNames(incompatiblePackages)} do${incompatiblePackages.length > 1 ? '' : 'es'} not support the New Architecture. ${learnMore('https://docs.expo.dev/guides/new-architecture/')}`\n )\n );\n }\n } catch {\n Log.log(chalk.gray(ERROR_MESSAGE));\n }\n}\n\nfunction formatPackageNames(incompatiblePackages: string[]) {\n if (incompatiblePackages.length === 1) {\n return incompatiblePackages.join();\n }\n\n const lastPackage = incompatiblePackages.pop();\n return `${incompatiblePackages.join(', ')} and ${lastPackage}`;\n}\n"],"names":["checkPackagesCompatibility","ERROR_MESSAGE","packages","packagesToCheck","filter","packageName","startsWith","length","response","fetch","method","headers","body","JSON","stringify","ok","Log","log","chalk","gray","packageMetadata","json","incompatiblePackages","newArchitecture","warn","yellow","bold","formatPackageNames","learnMore","join","lastPackage","pop"],"mappings":"AAAA,0GAA0G;;;;;+BAepFA;;;eAAAA;;;;gEAdJ;;;;;;qBAEE;uBACE;sBACI;;;;;;AAO1B,MAAMC,gBACJ;AAEK,eAAeD,2BAA2BE,QAAkB;IACjE,IAAI;QACF,MAAMC,kBAAkBD,SAASE,MAAM,CACrC,CAACC,cACC,CAACA,YAAYC,UAAU,CAAC,aAAa,CAACD,YAAYC,UAAU,CAAC;QAGjE,IAAI,CAACH,gBAAgBI,MAAM,EAAE;YAC3B;QACF;QAEA,MAAMC,WAAW,MAAMC,IAAAA,YAAK,EAAC,qDAAqD;YAChFC,QAAQ;YACRC,SAAS;gBACP,gBAAgB;YAClB;YACAC,MAAMC,KAAKC,SAAS,CAAC;gBAAEZ,UAAUC;YAAgB;QACnD;QAEA,IAAI,CAACK,SAASO,EAAE,EAAE;YAChBC,QAAG,CAACC,GAAG,CAACC,gBAAK,CAACC,IAAI,CAAClB;QACrB;QAEA,MAAMmB,kBAAmB,MAAMZ,SAASa,IAAI;QAK5C,MAAMC,uBAAuBnB,gBAAgBC,MAAM,CACjD,CAACC;gBAAgBe;mBAAAA,EAAAA,+BAAAA,eAAe,CAACf,YAAY,qBAA5Be,6BAA8BG,eAAe,MAAK;;QAGrE,IAAID,qBAAqBf,MAAM,EAAE;YAC/BS,QAAG,CAACQ,IAAI,CACNN,gBAAK,CAACO,MAAM,CACV,GAAGP,gBAAK,CAACQ,IAAI,CAAC,WAAW,EAAE,EAAEC,mBAAmBL,sBAAsB,GAAG,EAAEA,qBAAqBf,MAAM,GAAG,IAAI,KAAK,KAAK,mCAAmC,EAAEqB,IAAAA,eAAS,EAAC,mDAAmD;QAG/N;IACF,EAAE,OAAM;QACNZ,QAAG,CAACC,GAAG,CAACC,gBAAK,CAACC,IAAI,CAAClB;IACrB;AACF;AAEA,SAAS0B,mBAAmBL,oBAA8B;IACxD,IAAIA,qBAAqBf,MAAM,KAAK,GAAG;QACrC,OAAOe,qBAAqBO,IAAI;IAClC;IAEA,MAAMC,cAAcR,qBAAqBS,GAAG;IAC5C,OAAO,GAAGT,qBAAqBO,IAAI,CAAC,MAAM,KAAK,EAAEC,aAAa;AAChE"}
1
+ {"version":3,"sources":["../../../../src/install/utils/checkPackagesCompatibility.ts"],"sourcesContent":["// note(Simek): reference https://github.com/react-native-community/directory/blob/main/pages/api/libraries/check.ts\nimport chalk from 'chalk';\n\nimport { Log } from '../../log';\nimport { chunk } from '../../utils/array';\nimport { fetch } from '../../utils/fetch';\nimport { learnMore } from '../../utils/link';\n\nexport type ReactNativeDirectoryCheckResult = {\n unmaintained: boolean;\n newArchitecture: 'supported' | 'unsupported' | 'untested';\n};\n\nexport type DirectoryCheckResponse = Record<string, ReactNativeDirectoryCheckResult>;\n\nexport const MAX_PACKAGES_PER_QUERY = 50;\nconst ERROR_MESSAGE =\n 'Unable to fetch compatibility data from React Native Directory. Skipping check.';\n\nexport async function checkPackagesCompatibility(packages: string[]) {\n try {\n const packagesToCheck = packages.filter(\n (packageName) =>\n !packageName.startsWith('@expo/') && !packageName.startsWith('@expo-google-fonts/')\n );\n\n if (!packagesToCheck.length) {\n return;\n }\n\n const chunkedPackages = chunk(packagesToCheck, MAX_PACKAGES_PER_QUERY);\n\n const results = await Promise.allSettled<DirectoryCheckResponse>(\n chunkedPackages.map((packageChunk) =>\n fetch(\n `https://reactnative.directory/api/libraries/check?${new URLSearchParams({ packages: packageChunk.join(',') })}`\n ).then((response) => {\n if (!response.ok) {\n throw new Error(ERROR_MESSAGE);\n }\n return response.json();\n })\n )\n );\n\n const packageMetadata = results.reduce<DirectoryCheckResponse>((acc, result) => {\n if (result.status === 'fulfilled') {\n return { ...acc, ...result.value };\n }\n Log.log(chalk.gray(ERROR_MESSAGE));\n return acc;\n }, {});\n\n const incompatiblePackages = packagesToCheck.filter(\n (packageName) => packageMetadata[packageName]?.newArchitecture === 'unsupported'\n );\n\n if (incompatiblePackages.length) {\n Log.warn(\n chalk.yellow(\n `${chalk.bold('Warning')}: ${formatPackageNames(incompatiblePackages)} do${incompatiblePackages.length > 1 ? '' : 'es'} not support the New Architecture. ${learnMore('https://docs.expo.dev/guides/new-architecture/')}`\n )\n );\n }\n } catch {\n Log.log(chalk.gray(ERROR_MESSAGE));\n }\n}\n\nfunction formatPackageNames(incompatiblePackages: string[]) {\n if (incompatiblePackages.length === 1) {\n return incompatiblePackages.join();\n }\n\n const lastPackage = incompatiblePackages.pop();\n return `${incompatiblePackages.join(', ')} and ${lastPackage}`;\n}\n"],"names":["MAX_PACKAGES_PER_QUERY","checkPackagesCompatibility","ERROR_MESSAGE","packages","packagesToCheck","filter","packageName","startsWith","length","chunkedPackages","chunk","results","Promise","allSettled","map","packageChunk","fetch","URLSearchParams","join","then","response","ok","Error","json","packageMetadata","reduce","acc","result","status","value","Log","log","chalk","gray","incompatiblePackages","newArchitecture","warn","yellow","bold","formatPackageNames","learnMore","lastPackage","pop"],"mappings":"AAAA,oHAAoH;;;;;;;;;;;;QAevGA;eAAAA;;QAISC;eAAAA;;;;gEAlBJ;;;;;;qBAEE;uBACE;uBACA;sBACI;;;;;;AASnB,MAAMD,yBAAyB;AACtC,MAAME,gBACJ;AAEK,eAAeD,2BAA2BE,QAAkB;IACjE,IAAI;QACF,MAAMC,kBAAkBD,SAASE,MAAM,CACrC,CAACC,cACC,CAACA,YAAYC,UAAU,CAAC,aAAa,CAACD,YAAYC,UAAU,CAAC;QAGjE,IAAI,CAACH,gBAAgBI,MAAM,EAAE;YAC3B;QACF;QAEA,MAAMC,kBAAkBC,IAAAA,YAAK,EAACN,iBAAiBJ;QAE/C,MAAMW,UAAU,MAAMC,QAAQC,UAAU,CACtCJ,gBAAgBK,GAAG,CAAC,CAACC,eACnBC,IAAAA,YAAK,EACH,CAAC,kDAAkD,EAAE,IAAIC,gBAAgB;gBAAEd,UAAUY,aAAaG,IAAI,CAAC;YAAK,IAAI,EAChHC,IAAI,CAAC,CAACC;gBACN,IAAI,CAACA,SAASC,EAAE,EAAE;oBAChB,MAAM,IAAIC,MAAMpB;gBAClB;gBACA,OAAOkB,SAASG,IAAI;YACtB;QAIJ,MAAMC,kBAAkBb,QAAQc,MAAM,CAAyB,CAACC,KAAKC;YACnE,IAAIA,OAAOC,MAAM,KAAK,aAAa;gBACjC,OAAO;oBAAE,GAAGF,GAAG;oBAAE,GAAGC,OAAOE,KAAK;gBAAC;YACnC;YACAC,QAAG,CAACC,GAAG,CAACC,gBAAK,CAACC,IAAI,CAAC/B;YACnB,OAAOwB;QACT,GAAG,CAAC;QAEJ,MAAMQ,uBAAuB9B,gBAAgBC,MAAM,CACjD,CAACC;gBAAgBkB;mBAAAA,EAAAA,+BAAAA,eAAe,CAAClB,YAAY,qBAA5BkB,6BAA8BW,eAAe,MAAK;;QAGrE,IAAID,qBAAqB1B,MAAM,EAAE;YAC/BsB,QAAG,CAACM,IAAI,CACNJ,gBAAK,CAACK,MAAM,CACV,GAAGL,gBAAK,CAACM,IAAI,CAAC,WAAW,EAAE,EAAEC,mBAAmBL,sBAAsB,GAAG,EAAEA,qBAAqB1B,MAAM,GAAG,IAAI,KAAK,KAAK,mCAAmC,EAAEgC,IAAAA,eAAS,EAAC,mDAAmD;QAG/N;IACF,EAAE,OAAM;QACNV,QAAG,CAACC,GAAG,CAACC,gBAAK,CAACC,IAAI,CAAC/B;IACrB;AACF;AAEA,SAASqC,mBAAmBL,oBAA8B;IACxD,IAAIA,qBAAqB1B,MAAM,KAAK,GAAG;QACrC,OAAO0B,qBAAqBhB,IAAI;IAClC;IAEA,MAAMuB,cAAcP,qBAAqBQ,GAAG;IAC5C,OAAO,GAAGR,qBAAqBhB,IAAI,CAAC,MAAM,KAAK,EAAEuB,aAAa;AAChE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lint/ESlintPrerequisite.ts"],"sourcesContent":["import JsonFile, { JSONObject } from '@expo/json-file';\nimport fs from 'fs/promises';\nimport path from 'path';\n\nimport { Log } from '../log';\nimport { PrerequisiteCommandError, ProjectPrerequisite } from '../start/doctor/Prerequisite';\nimport { ensureDependenciesAsync } from '../start/doctor/dependencies/ensureDependenciesAsync';\nimport { findFileInParents } from '../utils/findUp';\nimport { isInteractive } from '../utils/interactive';\nimport { confirmAsync } from '../utils/prompts';\n\nconst debug = require('debug')('expo:lint') as typeof console.log;\n\n/** Ensure the project has the required ESLint config. */\nexport class ESLintProjectPrerequisite extends ProjectPrerequisite<boolean> {\n async assertImplementation(): Promise<boolean> {\n const hasEslintConfig = await isEslintConfigured(this.projectRoot);\n const hasLegacyConfig = await isLegacyEslintConfigured(this.projectRoot);\n const hasLintScript = await lintScriptIsConfigured(this.projectRoot);\n\n if (hasLegacyConfig) {\n Log.warn(`Using legacy ESLint config. Consider upgrading to flat config.`);\n }\n\n return (hasEslintConfig || hasLegacyConfig) && hasLintScript;\n }\n\n async bootstrapAsync(): Promise<boolean> {\n debug('Setting up ESLint');\n\n const hasEslintConfig = await isEslintConfigured(this.projectRoot);\n if (!hasEslintConfig) {\n if (!isInteractive()) {\n Log.warn(`No ESLint config found. Configuring automatically.`);\n } else {\n const shouldSetupLint = await confirmAsync({\n message: 'No ESLint config found. Install and configure ESLint in this project?',\n });\n if (!shouldSetupLint) {\n throw new PrerequisiteCommandError('ESLint is not configured for this project.');\n }\n }\n\n await this._ensureDependenciesInstalledAsync({ skipPrompt: true, isProjectMutable: true });\n\n await fs.writeFile(\n path.join(this.projectRoot, 'eslint.config.js'),\n await fs.readFile(require.resolve(`@expo/cli/static/template/eslint.config.js`), 'utf8'),\n 'utf8'\n );\n }\n\n const hasLintScript = await lintScriptIsConfigured(this.projectRoot);\n if (!hasLintScript) {\n const scripts = JsonFile.read(path.join(this.projectRoot, 'package.json')).scripts;\n await JsonFile.setAsync(\n path.join(this.projectRoot, 'package.json'),\n 'scripts',\n typeof scripts === 'object' ? { ...scripts, lint: 'expo lint' } : { lint: 'expo lint' },\n { json5: false }\n );\n }\n\n Log.log();\n Log.log('ESLint has been configured 🎉');\n Log.log();\n\n return true;\n }\n\n async _ensureDependenciesInstalledAsync({\n skipPrompt,\n isProjectMutable,\n }: {\n skipPrompt?: boolean;\n isProjectMutable?: boolean;\n }): Promise<boolean> {\n try {\n return await ensureDependenciesAsync(this.projectRoot, {\n skipPrompt,\n isProjectMutable,\n installMessage: 'ESLint is required to lint your project.',\n warningMessage: 'ESLint not installed, unable to set up linting for your project.',\n requiredPackages: [\n { version: '^9.0.0', pkg: 'eslint', file: 'eslint/package.json', dev: true },\n {\n pkg: 'eslint-config-expo',\n file: 'eslint-config-expo/package.json',\n dev: true,\n },\n ],\n });\n } catch (error) {\n this.resetAssertion();\n throw error;\n }\n }\n}\n\nasync function isLegacyEslintConfigured(projectRoot: string) {\n debug('Checking for legacy ESLint configuration', projectRoot);\n\n const packageFile = await JsonFile.readAsync(path.join(projectRoot, 'package.json'));\n if (\n typeof packageFile.eslintConfig === 'object' &&\n Object.keys(packageFile.eslintConfig as JSONObject).length > 0\n ) {\n debug('Found legacy ESLint config in package.json');\n return true;\n }\n\n const eslintConfigFiles = [\n '.eslintrc.js',\n '.eslintrc.cjs',\n '.eslintrc.yaml',\n '.eslintrc.yml',\n '.eslintrc.json',\n ];\n for (const configFile of eslintConfigFiles) {\n const configPath = findFileInParents(projectRoot, configFile);\n\n if (configPath) {\n debug('Found ESLint config file:', configPath);\n return true;\n }\n }\n\n return false;\n}\n\n/** Check for flat config. */\nasync function isEslintConfigured(projectRoot: string) {\n debug('Ensuring ESLint is configured in', projectRoot);\n\n const eslintConfigFiles = ['eslint.config.js', 'eslint.config.mjs', 'eslint.config.cjs'];\n for (const configFile of eslintConfigFiles) {\n const configPath = findFileInParents(projectRoot, configFile);\n\n if (configPath) {\n debug('Found ESLint config file:', configPath);\n return true;\n }\n }\n\n return false;\n}\n\nasync function lintScriptIsConfigured(projectRoot: string) {\n const packageFile = await JsonFile.readAsync(path.join(projectRoot, 'package.json'));\n return typeof (packageFile.scripts as JSONObject | undefined)?.lint === 'string';\n}\n"],"names":["ESLintProjectPrerequisite","debug","require","ProjectPrerequisite","assertImplementation","hasEslintConfig","isEslintConfigured","projectRoot","hasLegacyConfig","isLegacyEslintConfigured","hasLintScript","lintScriptIsConfigured","Log","warn","bootstrapAsync","isInteractive","shouldSetupLint","confirmAsync","message","PrerequisiteCommandError","_ensureDependenciesInstalledAsync","skipPrompt","isProjectMutable","fs","writeFile","path","join","readFile","resolve","scripts","JsonFile","read","setAsync","lint","json5","log","ensureDependenciesAsync","installMessage","warningMessage","requiredPackages","version","pkg","file","dev","error","resetAssertion","packageFile","readAsync","eslintConfig","Object","keys","length","eslintConfigFiles","configFile","configPath","findFileInParents"],"mappings":";;;;+BAcaA;;;eAAAA;;;;gEAdwB;;;;;;;gEACtB;;;;;;;gEACE;;;;;;qBAEG;8BAC0C;yCACtB;wBACN;6BACJ;yBACD;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAGxB,MAAMF,kCAAkCG,iCAAmB;IAChE,MAAMC,uBAAyC;QAC7C,MAAMC,kBAAkB,MAAMC,mBAAmB,IAAI,CAACC,WAAW;QACjE,MAAMC,kBAAkB,MAAMC,yBAAyB,IAAI,CAACF,WAAW;QACvE,MAAMG,gBAAgB,MAAMC,uBAAuB,IAAI,CAACJ,WAAW;QAEnE,IAAIC,iBAAiB;YACnBI,QAAG,CAACC,IAAI,CAAC,CAAC,8DAA8D,CAAC;QAC3E;QAEA,OAAO,AAACR,CAAAA,mBAAmBG,eAAc,KAAME;IACjD;IAEA,MAAMI,iBAAmC;QACvCb,MAAM;QAEN,MAAMI,kBAAkB,MAAMC,mBAAmB,IAAI,CAACC,WAAW;QACjE,IAAI,CAACF,iBAAiB;YACpB,IAAI,CAACU,IAAAA,0BAAa,KAAI;gBACpBH,QAAG,CAACC,IAAI,CAAC,CAAC,kDAAkD,CAAC;YAC/D,OAAO;gBACL,MAAMG,kBAAkB,MAAMC,IAAAA,qBAAY,EAAC;oBACzCC,SAAS;gBACX;gBACA,IAAI,CAACF,iBAAiB;oBACpB,MAAM,IAAIG,sCAAwB,CAAC;gBACrC;YACF;YAEA,MAAM,IAAI,CAACC,iCAAiC,CAAC;gBAAEC,YAAY;gBAAMC,kBAAkB;YAAK;YAExF,MAAMC,mBAAE,CAACC,SAAS,CAChBC,eAAI,CAACC,IAAI,CAAC,IAAI,CAACnB,WAAW,EAAE,qBAC5B,MAAMgB,mBAAE,CAACI,QAAQ,CAACzB,QAAQ0B,OAAO,CAAC,CAAC,0CAA0C,CAAC,GAAG,SACjF;QAEJ;QAEA,MAAMl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B;QACxB;QACA;QACA;QACA;QACA;KACD;IACD,KAAK,MAAMC,cAAcD,kBAAmB;QAC1C,MAAME,aAAaC,IAAAA,yBAAiB,EAAChD,aAAa8C;QAElD,IAAIC,YAAY;YACdrD,MAAM,6BAA6BqD;YACnC,OAAO;QACT;IACF;IAEA,OAAO;AACT;AAEA,2BAA2B,GAC3B,eAAehD,mBAAmBC,WAAmB;IACnDN,MAAM,oCAAoCM;IAE1C,MAAM6C,oBAAoB;QAAC;QAAoB;QAAqB;KAAoB;IACxF,KAAK,MAAMC,cAAcD,kBAAmB;QAC1C,MAAME,aAAaC,IAAAA,yBAAiB,EAAChD,aAAa8C;QAElD,IAAIC,YAAY;YACdrD,MAAM,6BAA6BqD;YACnC,OAAO;QACT;IACF;IAEA,OAAO;AACT;AAEA,eAAe3C,uBAAuBJ,WAAmB;QAExCuC;IADf,MAAMA,cAAc,MAAMhB,mBAAQ,CAACiB,SAAS,CAACtB,eAAI,CAACC,IAAI,CAACnB,aAAa;IACpE,OAAO,SAAQuC,uBAAAA,YAAYjB,OAAO,qBAApB,AAACiB,qBAAgDb,IAAI,MAAK;AAC1E"}
1
+ {"version":3,"sources":["../../../src/lint/ESlintPrerequisite.ts"],"sourcesContent":["import type { JSONObject } from '@expo/json-file';\nimport JsonFile from '@expo/json-file';\nimport fs from 'fs/promises';\nimport path from 'path';\n\nimport { Log } from '../log';\nimport { PrerequisiteCommandError, ProjectPrerequisite } from '../start/doctor/Prerequisite';\nimport { ensureDependenciesAsync } from '../start/doctor/dependencies/ensureDependenciesAsync';\nimport { findFileInParents } from '../utils/findUp';\nimport { isInteractive } from '../utils/interactive';\nimport { confirmAsync } from '../utils/prompts';\n\nconst debug = require('debug')('expo:lint') as typeof console.log;\n\n/** Ensure the project has the required ESLint config. */\nexport class ESLintProjectPrerequisite extends ProjectPrerequisite<boolean> {\n async assertImplementation(): Promise<boolean> {\n const hasEslintConfig = await isEslintConfigured(this.projectRoot);\n const hasLegacyConfig = await isLegacyEslintConfigured(this.projectRoot);\n const hasLintScript = await lintScriptIsConfigured(this.projectRoot);\n\n if (hasLegacyConfig) {\n Log.warn(`Using legacy ESLint config. Consider upgrading to flat config.`);\n }\n\n return (hasEslintConfig || hasLegacyConfig) && hasLintScript;\n }\n\n async bootstrapAsync(): Promise<boolean> {\n debug('Setting up ESLint');\n\n const hasEslintConfig = await isEslintConfigured(this.projectRoot);\n if (!hasEslintConfig) {\n if (!isInteractive()) {\n Log.warn(`No ESLint config found. Configuring automatically.`);\n } else {\n const shouldSetupLint = await confirmAsync({\n message: 'No ESLint config found. Install and configure ESLint in this project?',\n });\n if (!shouldSetupLint) {\n throw new PrerequisiteCommandError('ESLint is not configured for this project.');\n }\n }\n\n await this._ensureDependenciesInstalledAsync({ skipPrompt: true, isProjectMutable: true });\n\n await fs.writeFile(\n path.join(this.projectRoot, 'eslint.config.js'),\n await fs.readFile(require.resolve(`@expo/cli/static/template/eslint.config.js`), 'utf8'),\n 'utf8'\n );\n }\n\n const hasLintScript = await lintScriptIsConfigured(this.projectRoot);\n if (!hasLintScript) {\n const scripts = JsonFile.read(path.join(this.projectRoot, 'package.json')).scripts;\n await JsonFile.setAsync(\n path.join(this.projectRoot, 'package.json'),\n 'scripts',\n typeof scripts === 'object' ? { ...scripts, lint: 'expo lint' } : { lint: 'expo lint' },\n { json5: false }\n );\n }\n\n Log.log();\n Log.log('ESLint has been configured 🎉');\n Log.log();\n\n return true;\n }\n\n async _ensureDependenciesInstalledAsync({\n skipPrompt,\n isProjectMutable,\n }: {\n skipPrompt?: boolean;\n isProjectMutable?: boolean;\n }): Promise<boolean> {\n try {\n return await ensureDependenciesAsync(this.projectRoot, {\n skipPrompt,\n isProjectMutable,\n installMessage: 'ESLint is required to lint your project.',\n warningMessage: 'ESLint not installed, unable to set up linting for your project.',\n requiredPackages: [\n { version: '^9.0.0', pkg: 'eslint', file: 'eslint/package.json', dev: true },\n {\n pkg: 'eslint-config-expo',\n file: 'eslint-config-expo/package.json',\n dev: true,\n },\n ],\n });\n } catch (error) {\n this.resetAssertion();\n throw error;\n }\n }\n}\n\nasync function isLegacyEslintConfigured(projectRoot: string) {\n debug('Checking for legacy ESLint configuration', projectRoot);\n\n const packageFile = await JsonFile.readAsync(path.join(projectRoot, 'package.json'));\n if (\n typeof packageFile.eslintConfig === 'object' &&\n Object.keys(packageFile.eslintConfig as JSONObject).length > 0\n ) {\n debug('Found legacy ESLint config in package.json');\n return true;\n }\n\n const eslintConfigFiles = [\n '.eslintrc.js',\n '.eslintrc.cjs',\n '.eslintrc.yaml',\n '.eslintrc.yml',\n '.eslintrc.json',\n ];\n for (const configFile of eslintConfigFiles) {\n const configPath = findFileInParents(projectRoot, configFile);\n\n if (configPath) {\n debug('Found ESLint config file:', configPath);\n return true;\n }\n }\n\n return false;\n}\n\n/** Check for flat config. */\nasync function isEslintConfigured(projectRoot: string) {\n debug('Ensuring ESLint is configured in', projectRoot);\n\n const eslintConfigFiles = ['eslint.config.js', 'eslint.config.mjs', 'eslint.config.cjs'];\n for (const configFile of eslintConfigFiles) {\n const configPath = findFileInParents(projectRoot, configFile);\n\n if (configPath) {\n debug('Found ESLint config file:', configPath);\n return true;\n }\n }\n\n return false;\n}\n\nasync function lintScriptIsConfigured(projectRoot: string) {\n const packageFile = await JsonFile.readAsync(path.join(projectRoot, 'package.json'));\n return typeof (packageFile.scripts as JSONObject | undefined)?.lint === 'string';\n}\n"],"names":["ESLintProjectPrerequisite","debug","require","ProjectPrerequisite","assertImplementation","hasEslintConfig","isEslintConfigured","projectRoot","hasLegacyConfig","isLegacyEslintConfigured","hasLintScript","lintScriptIsConfigured","Log","warn","bootstrapAsync","isInteractive","shouldSetupLint","confirmAsync","message","PrerequisiteCommandError","_ensureDependenciesInstalledAsync","skipPrompt","isProjectMutable","fs","writeFile","path","join","readFile","resolve","scripts","JsonFile","read","setAsync","lint","json5","log","ensureDependenciesAsync","installMessage","warningMessage","requiredPackages","version","pkg","file","dev","error","resetAssertion","packageFile","readAsync","eslintConfig","Object","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ACD,KAAK,MAAMC,cAAcD,kBAAmB;QAC1C,MAAME,aAAaC,IAAAA,yBAAiB,EAAChD,aAAa8C;QAElD,IAAIC,YAAY;YACdrD,MAAM,6BAA6BqD;YACnC,OAAO;QACT;IACF;IAEA,OAAO;AACT;AAEA,2BAA2B,GAC3B,eAAehD,mBAAmBC,WAAmB;IACnDN,MAAM,oCAAoCM;IAE1C,MAAM6C,oBAAoB;QAAC;QAAoB;QAAqB;KAAoB;IACxF,KAAK,MAAMC,cAAcD,kBAAmB;QAC1C,MAAME,aAAaC,IAAAA,yBAAiB,EAAChD,aAAa8C;QAElD,IAAIC,YAAY;YACdrD,MAAM,6BAA6BqD;YACnC,OAAO;QACT;IACF;IAEA,OAAO;AACT;AAEA,eAAe3C,uBAAuBJ,WAAmB;QAExCuC;IADf,MAAMA,cAAc,MAAMhB,mBAAQ,CAACiB,SAAS,CAACtB,eAAI,CAACC,IAAI,CAACnB,aAAa;IACpE,OAAO,SAAQuC,uBAAAA,YAAYjB,OAAO,qBAApB,AAACiB,qBAAgDb,IAAI,MAAK;AAC1E"}
package/build/src/log.js CHANGED
@@ -5,38 +5,38 @@ 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
- Log: function() {
12
+ get Log () {
13
13
  return Log;
14
14
  },
15
- clear: function() {
15
+ get clear () {
16
16
  return clear;
17
17
  },
18
- debug: function() {
18
+ get debug () {
19
19
  return debug;
20
20
  },
21
- error: function() {
21
+ get error () {
22
22
  return error;
23
23
  },
24
- exception: function() {
24
+ get exception () {
25
25
  return exception;
26
26
  },
27
- exit: function() {
27
+ get exit () {
28
28
  return exit;
29
29
  },
30
- log: function() {
30
+ get log () {
31
31
  return log;
32
32
  },
33
- time: function() {
33
+ get time () {
34
34
  return time;
35
35
  },
36
- timeEnd: function() {
36
+ get timeEnd () {
37
37
  return timeEnd;
38
38
  },
39
- warn: function() {
39
+ get warn () {
40
40
  return warn;
41
41
  }
42
42
  });
@@ -52,6 +52,9 @@ function _interop_require_default(obj) {
52
52
  default: obj
53
53
  };
54
54
  }
55
+ // NOTE(@kitten): LogRespectingTerminal in instantiateMetro regressed on fatal errors and
56
+ // logs may be swallowed before exiting. We redirect them to a direct write when we're about to exit
57
+ let isExiting = false;
55
58
  function time(label) {
56
59
  console.time(label);
57
60
  }
@@ -59,6 +62,14 @@ function timeEnd(label) {
59
62
  console.timeEnd(label);
60
63
  }
61
64
  function error(...message) {
65
+ if (isExiting) {
66
+ // `console.error` may be patched to route through an async stderr queue
67
+ // (see LogRespectingTerminal in instantiateMetro.ts). On the exit path
68
+ // that queue has no chance to drain before `process.exit`, so write
69
+ // synchronously to bypass it.
70
+ process.stderr.write(message.join(' ') + '\n');
71
+ return;
72
+ }
62
73
  console.error(...message);
63
74
  }
64
75
  function exception(e) {
@@ -66,9 +77,17 @@ function exception(e) {
66
77
  error(_chalk().default.red(e.toString()) + (env.EXPO_DEBUG ? '\n' + _chalk().default.gray(e.stack) : ''));
67
78
  }
68
79
  function warn(...message) {
80
+ if (isExiting) {
81
+ process.stderr.write(message.map((value)=>_chalk().default.yellow(value)).join(' ') + '\n');
82
+ return;
83
+ }
69
84
  console.warn(...message.map((value)=>_chalk().default.yellow(value)));
70
85
  }
71
86
  function log(...message) {
87
+ if (isExiting) {
88
+ process.stdout.write(message.join(' ') + '\n');
89
+ return;
90
+ }
72
91
  console.log(...message);
73
92
  }
74
93
  function debug(...message) {
@@ -78,11 +97,10 @@ function clear() {
78
97
  process.stdout.write(process.platform === 'win32' ? '\x1B[2J\x1B[0f' : '\x1B[2J\x1B[3J\x1B[H');
79
98
  }
80
99
  function exit(message, code = 1) {
100
+ isExiting = true;
81
101
  if (message instanceof Error) {
82
102
  exception(message);
83
- process.exit(code);
84
- }
85
- if (message) {
103
+ } else if (message) {
86
104
  if (code === 0) {
87
105
  log(message);
88
106
  } else {