vxrn 1.27.1 → 2.0.0-beta.45.1

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 (456) hide show
  1. package/dist/cli.mjs +212 -261
  2. package/dist/cli.mjs.map +1 -1
  3. package/dist/cli.native.js +216 -265
  4. package/dist/cli.native.js.map +1 -1
  5. package/dist/config/getAdditionalViteConfig.mjs +33 -62
  6. package/dist/config/getAdditionalViteConfig.mjs.map +1 -1
  7. package/dist/config/getAdditionalViteConfig.native.js +33 -62
  8. package/dist/config/getAdditionalViteConfig.native.js.map +1 -1
  9. package/dist/config/getBaseViteConfigOnly.mjs +84 -77
  10. package/dist/config/getBaseViteConfigOnly.mjs.map +1 -1
  11. package/dist/config/getBaseViteConfigOnly.native.js +86 -79
  12. package/dist/config/getBaseViteConfigOnly.native.js.map +1 -1
  13. package/dist/config/getBaseViteConfigWithPlugins.mjs +6 -4
  14. package/dist/config/getBaseViteConfigWithPlugins.mjs.map +1 -1
  15. package/dist/config/getBaseViteConfigWithPlugins.native.js +6 -4
  16. package/dist/config/getBaseViteConfigWithPlugins.native.js.map +1 -1
  17. package/dist/config/getBaseVitePlugins.mjs +102 -130
  18. package/dist/config/getBaseVitePlugins.mjs.map +1 -1
  19. package/dist/config/getBaseVitePlugins.native.js +123 -152
  20. package/dist/config/getBaseVitePlugins.native.js.map +1 -1
  21. package/dist/config/getNonCliModeOnlyVitePlugins.mjs +3 -3
  22. package/dist/config/getNonCliModeOnlyVitePlugins.mjs.map +1 -1
  23. package/dist/config/getNonCliModeOnlyVitePlugins.native.js +3 -1
  24. package/dist/config/getNonCliModeOnlyVitePlugins.native.js.map +1 -1
  25. package/dist/config/getOptimizeDeps.mjs +138 -42
  26. package/dist/config/getOptimizeDeps.mjs.map +1 -1
  27. package/dist/config/getOptimizeDeps.native.js +138 -42
  28. package/dist/config/getOptimizeDeps.native.js.map +1 -1
  29. package/dist/config/getOptionsFilled.mjs +48 -52
  30. package/dist/config/getOptionsFilled.mjs.map +1 -1
  31. package/dist/config/getOptionsFilled.native.js +51 -55
  32. package/dist/config/getOptionsFilled.native.js.map +1 -1
  33. package/dist/config/getReactNativePlugins.mjs +23 -15
  34. package/dist/config/getReactNativePlugins.mjs.map +1 -1
  35. package/dist/config/getReactNativePlugins.native.js +25 -16
  36. package/dist/config/getReactNativePlugins.native.js.map +1 -1
  37. package/dist/config/getServerOptionsFilled.mjs +33 -35
  38. package/dist/config/getServerOptionsFilled.mjs.map +1 -1
  39. package/dist/config/getServerOptionsFilled.native.js +35 -38
  40. package/dist/config/getServerOptionsFilled.native.js.map +1 -1
  41. package/dist/config/getViteServerConfig.mjs +34 -45
  42. package/dist/config/getViteServerConfig.mjs.map +1 -1
  43. package/dist/config/getViteServerConfig.native.js +35 -46
  44. package/dist/config/getViteServerConfig.native.js.map +1 -1
  45. package/dist/config/mergeUserConfig.mjs +50 -28
  46. package/dist/config/mergeUserConfig.mjs.map +1 -1
  47. package/dist/config/mergeUserConfig.native.js +60 -38
  48. package/dist/config/mergeUserConfig.native.js.map +1 -1
  49. package/dist/constants/defaults.mjs +29 -12
  50. package/dist/constants/defaults.mjs.map +1 -1
  51. package/dist/constants/defaults.native.js +29 -12
  52. package/dist/constants/defaults.native.js.map +1 -1
  53. package/dist/constants.mjs +41 -6
  54. package/dist/constants.mjs.map +1 -1
  55. package/dist/constants.native.js +41 -6
  56. package/dist/constants.native.js.map +1 -1
  57. package/dist/exports/build.mjs +218 -270
  58. package/dist/exports/build.mjs.map +1 -1
  59. package/dist/exports/build.native.js +226 -283
  60. package/dist/exports/build.native.js.map +1 -1
  61. package/dist/exports/clean.mjs +71 -78
  62. package/dist/exports/clean.mjs.map +1 -1
  63. package/dist/exports/clean.native.js +76 -90
  64. package/dist/exports/clean.native.js.map +1 -1
  65. package/dist/exports/createServer.mjs +43 -46
  66. package/dist/exports/createServer.mjs.map +1 -1
  67. package/dist/exports/createServer.native.js +45 -48
  68. package/dist/exports/createServer.native.js.map +1 -1
  69. package/dist/exports/dev.mjs +177 -201
  70. package/dist/exports/dev.mjs.map +1 -1
  71. package/dist/exports/dev.native.js +191 -215
  72. package/dist/exports/dev.native.js.map +1 -1
  73. package/dist/exports/loadEnv.mjs +51 -48
  74. package/dist/exports/loadEnv.mjs.map +1 -1
  75. package/dist/exports/loadEnv.native.js +59 -57
  76. package/dist/exports/loadEnv.native.js.map +1 -1
  77. package/dist/exports/patch.mjs +9 -7
  78. package/dist/exports/patch.mjs.map +1 -1
  79. package/dist/exports/patch.native.js +9 -7
  80. package/dist/exports/patch.native.js.map +1 -1
  81. package/dist/exports/prebuild.mjs +177 -157
  82. package/dist/exports/prebuild.mjs.map +1 -1
  83. package/dist/exports/prebuild.native.js +197 -160
  84. package/dist/exports/prebuild.native.js.map +1 -1
  85. package/dist/exports/prebuildWithoutExpo.mjs +46 -44
  86. package/dist/exports/prebuildWithoutExpo.mjs.map +1 -1
  87. package/dist/exports/prebuildWithoutExpo.native.js +48 -46
  88. package/dist/exports/prebuildWithoutExpo.native.js.map +1 -1
  89. package/dist/exports/runAndroid.mjs +9 -10
  90. package/dist/exports/runAndroid.mjs.map +1 -1
  91. package/dist/exports/runAndroid.native.js +10 -11
  92. package/dist/exports/runAndroid.native.js.map +1 -1
  93. package/dist/exports/runIos.mjs +9 -10
  94. package/dist/exports/runIos.mjs.map +1 -1
  95. package/dist/exports/runIos.native.js +10 -11
  96. package/dist/exports/runIos.native.js.map +1 -1
  97. package/dist/exports/serve.mjs +23 -31
  98. package/dist/exports/serve.mjs.map +1 -1
  99. package/dist/exports/serve.native.js +26 -34
  100. package/dist/exports/serve.native.js.map +1 -1
  101. package/dist/exports/serveStaticAssets.mjs +109 -113
  102. package/dist/exports/serveStaticAssets.mjs.map +1 -1
  103. package/dist/exports/serveStaticAssets.native.js +180 -192
  104. package/dist/exports/serveStaticAssets.native.js.map +1 -1
  105. package/dist/index.js +25 -14
  106. package/dist/index.mjs +25 -14
  107. package/dist/index.native.js +25 -14
  108. package/dist/patches/builtInDepPatches.mjs +346 -435
  109. package/dist/patches/builtInDepPatches.mjs.map +1 -1
  110. package/dist/patches/builtInDepPatches.native.js +349 -438
  111. package/dist/patches/builtInDepPatches.native.js.map +1 -1
  112. package/dist/plugins/applyBuiltInPatchesPlugin.mjs +11 -11
  113. package/dist/plugins/applyBuiltInPatchesPlugin.mjs.map +1 -1
  114. package/dist/plugins/applyBuiltInPatchesPlugin.native.js +11 -11
  115. package/dist/plugins/applyBuiltInPatchesPlugin.native.js.map +1 -1
  116. package/dist/plugins/autoDepOptimizePlugin.mjs +87 -90
  117. package/dist/plugins/autoDepOptimizePlugin.mjs.map +1 -1
  118. package/dist/plugins/autoDepOptimizePlugin.native.js +99 -102
  119. package/dist/plugins/autoDepOptimizePlugin.native.js.map +1 -1
  120. package/dist/plugins/clientInjectPlugin.mjs +13 -11
  121. package/dist/plugins/clientInjectPlugin.mjs.map +1 -1
  122. package/dist/plugins/clientInjectPlugin.native.js +13 -11
  123. package/dist/plugins/clientInjectPlugin.native.js.map +1 -1
  124. package/dist/plugins/defaultDepOptimizePlugin.mjs +15 -23
  125. package/dist/plugins/defaultDepOptimizePlugin.mjs.map +1 -1
  126. package/dist/plugins/defaultDepOptimizePlugin.native.js +15 -23
  127. package/dist/plugins/defaultDepOptimizePlugin.native.js.map +1 -1
  128. package/dist/plugins/expoManifestRequestHandlerPlugin.mjs +163 -179
  129. package/dist/plugins/expoManifestRequestHandlerPlugin.mjs.map +1 -1
  130. package/dist/plugins/expoManifestRequestHandlerPlugin.native.js +169 -191
  131. package/dist/plugins/expoManifestRequestHandlerPlugin.native.js.map +1 -1
  132. package/dist/plugins/getResolvedConfigSubset.mjs +6 -5
  133. package/dist/plugins/getResolvedConfigSubset.mjs.map +1 -1
  134. package/dist/plugins/getResolvedConfigSubset.native.js +6 -5
  135. package/dist/plugins/getResolvedConfigSubset.native.js.map +1 -1
  136. package/dist/plugins/reactNativeCommonJsPlugin.mjs +210 -178
  137. package/dist/plugins/reactNativeCommonJsPlugin.mjs.map +1 -1
  138. package/dist/plugins/reactNativeCommonJsPlugin.native.js +283 -259
  139. package/dist/plugins/reactNativeCommonJsPlugin.native.js.map +1 -1
  140. package/dist/plugins/reactNativeDevAssetPlugin.mjs +72 -83
  141. package/dist/plugins/reactNativeDevAssetPlugin.mjs.map +1 -1
  142. package/dist/plugins/reactNativeDevAssetPlugin.native.js +75 -92
  143. package/dist/plugins/reactNativeDevAssetPlugin.native.js.map +1 -1
  144. package/dist/plugins/reactNativeDevServer.mjs +283 -328
  145. package/dist/plugins/reactNativeDevServer.mjs.map +1 -1
  146. package/dist/plugins/reactNativeDevServer.native.js +332 -391
  147. package/dist/plugins/reactNativeDevServer.native.js.map +1 -1
  148. package/dist/plugins/rnCodegenPlugin.mjs +13 -12
  149. package/dist/plugins/rnCodegenPlugin.mjs.map +1 -1
  150. package/dist/plugins/rnCodegenPlugin.native.js +13 -12
  151. package/dist/plugins/rnCodegenPlugin.native.js.map +1 -1
  152. package/dist/plugins/rollupRemoveUnusedImports.mjs +8 -7
  153. package/dist/plugins/rollupRemoveUnusedImports.mjs.map +1 -1
  154. package/dist/plugins/rollupRemoveUnusedImports.native.js +8 -7
  155. package/dist/plugins/rollupRemoveUnusedImports.native.js.map +1 -1
  156. package/dist/plugins/workletImportsPlugin.mjs +127 -132
  157. package/dist/plugins/workletImportsPlugin.mjs.map +1 -1
  158. package/dist/plugins/workletImportsPlugin.native.js +192 -203
  159. package/dist/plugins/workletImportsPlugin.native.js.map +1 -1
  160. package/dist/rn-commands/bundle/buildBundle.mjs +45 -79
  161. package/dist/rn-commands/bundle/buildBundle.mjs.map +1 -1
  162. package/dist/rn-commands/bundle/buildBundle.native.js +45 -85
  163. package/dist/rn-commands/bundle/buildBundle.native.js.map +1 -1
  164. package/dist/runtime/hmr-client.mjs +133 -140
  165. package/dist/runtime/hmr-client.mjs.map +1 -1
  166. package/dist/runtime/hmr-client.native.js +223 -222
  167. package/dist/runtime/hmr-client.native.js.map +1 -1
  168. package/dist/runtime/hmr-runtime.mjs +192 -194
  169. package/dist/runtime/hmr-runtime.mjs.map +1 -1
  170. package/dist/runtime/hmr-runtime.native.js +424 -411
  171. package/dist/runtime/hmr-runtime.native.js.map +1 -1
  172. package/dist/runtime/hmr-types.mjs +0 -2
  173. package/dist/runtime/hmr-types.native.js +0 -2
  174. package/dist/runtime/native-prelude.mjs +2 -1
  175. package/dist/runtime/native-prelude.mjs.map +1 -1
  176. package/dist/runtime/native-prelude.native.js +2 -1
  177. package/dist/runtime/native-prelude.native.js.map +1 -1
  178. package/dist/runtime/react-refresh-utils.mjs +23 -22
  179. package/dist/runtime/react-refresh-utils.mjs.map +1 -1
  180. package/dist/runtime/react-refresh-utils.native.js +23 -27
  181. package/dist/runtime/react-refresh-utils.native.js.map +1 -1
  182. package/dist/serve/node.mjs +49 -49
  183. package/dist/serve/node.mjs.map +1 -1
  184. package/dist/serve/node.native.js +92 -96
  185. package/dist/serve/node.native.js.map +1 -1
  186. package/dist/types.mjs +0 -2
  187. package/dist/types.native.js +0 -2
  188. package/dist/user-interface/index.mjs +245 -262
  189. package/dist/user-interface/index.mjs.map +1 -1
  190. package/dist/user-interface/index.native.js +274 -298
  191. package/dist/user-interface/index.native.js.map +1 -1
  192. package/dist/utils/assert.mjs +7 -6
  193. package/dist/utils/assert.mjs.map +1 -1
  194. package/dist/utils/assert.native.js +7 -18
  195. package/dist/utils/assert.native.js.map +1 -1
  196. package/dist/utils/bindKeypressInput.mjs +36 -38
  197. package/dist/utils/bindKeypressInput.mjs.map +1 -1
  198. package/dist/utils/bindKeypressInput.native.js +36 -38
  199. package/dist/utils/bindKeypressInput.native.js.map +1 -1
  200. package/dist/utils/coerceToArray.mjs +2 -1
  201. package/dist/utils/coerceToArray.mjs.map +1 -1
  202. package/dist/utils/coerceToArray.native.js +2 -1
  203. package/dist/utils/coerceToArray.native.js.map +1 -1
  204. package/dist/utils/connectedNativeClients.mjs +3 -2
  205. package/dist/utils/connectedNativeClients.mjs.map +1 -1
  206. package/dist/utils/connectedNativeClients.native.js +3 -2
  207. package/dist/utils/connectedNativeClients.native.js.map +1 -1
  208. package/dist/utils/createNativeDevEngine.mjs +992 -966
  209. package/dist/utils/createNativeDevEngine.mjs.map +1 -1
  210. package/dist/utils/createNativeDevEngine.native.js +1184 -1179
  211. package/dist/utils/createNativeDevEngine.native.js.map +1 -1
  212. package/dist/utils/dispose.mjs +4 -3
  213. package/dist/utils/dispose.mjs.map +1 -1
  214. package/dist/utils/dispose.native.js +6 -5
  215. package/dist/utils/dispose.native.js.map +1 -1
  216. package/dist/utils/environmentUtils.mjs +5 -4
  217. package/dist/utils/environmentUtils.mjs.map +1 -1
  218. package/dist/utils/environmentUtils.native.js +5 -4
  219. package/dist/utils/environmentUtils.native.js.map +1 -1
  220. package/dist/utils/execSync.mjs +7 -5
  221. package/dist/utils/execSync.mjs.map +1 -1
  222. package/dist/utils/execSync.native.js +8 -6
  223. package/dist/utils/execSync.native.js.map +1 -1
  224. package/dist/utils/expoRun.mjs +27 -35
  225. package/dist/utils/expoRun.mjs.map +1 -1
  226. package/dist/utils/expoRun.native.js +27 -35
  227. package/dist/utils/expoRun.native.js.map +1 -1
  228. package/dist/utils/filterViteServerResolvedUrls.mjs +24 -22
  229. package/dist/utils/filterViteServerResolvedUrls.mjs.map +1 -1
  230. package/dist/utils/filterViteServerResolvedUrls.native.js +61 -63
  231. package/dist/utils/filterViteServerResolvedUrls.native.js.map +1 -1
  232. package/dist/utils/getBoundPort.mjs +6 -5
  233. package/dist/utils/getBoundPort.mjs.map +1 -1
  234. package/dist/utils/getBoundPort.native.js +8 -12
  235. package/dist/utils/getBoundPort.native.js.map +1 -1
  236. package/dist/utils/getCacheDir.mjs +3 -1
  237. package/dist/utils/getCacheDir.mjs.map +1 -1
  238. package/dist/utils/getCacheDir.native.js +3 -1
  239. package/dist/utils/getCacheDir.native.js.map +1 -1
  240. package/dist/utils/getServerEntry.mjs +6 -4
  241. package/dist/utils/getServerEntry.mjs.map +1 -1
  242. package/dist/utils/getServerEntry.native.js +8 -11
  243. package/dist/utils/getServerEntry.native.js.map +1 -1
  244. package/dist/utils/getVitePath.mjs +42 -42
  245. package/dist/utils/getVitePath.mjs.map +1 -1
  246. package/dist/utils/getVitePath.native.js +43 -41
  247. package/dist/utils/getVitePath.native.js.map +1 -1
  248. package/dist/utils/globDir.mjs +7 -11
  249. package/dist/utils/globDir.mjs.map +1 -1
  250. package/dist/utils/globDir.native.js +10 -14
  251. package/dist/utils/globDir.native.js.map +1 -1
  252. package/dist/utils/isWithin.mjs +4 -2
  253. package/dist/utils/isWithin.mjs.map +1 -1
  254. package/dist/utils/isWithin.native.js +4 -2
  255. package/dist/utils/isWithin.native.js.map +1 -1
  256. package/dist/utils/patches.mjs +233 -255
  257. package/dist/utils/patches.mjs.map +1 -1
  258. package/dist/utils/patches.native.js +415 -460
  259. package/dist/utils/patches.native.js.map +1 -1
  260. package/dist/utils/printServerUrls.mjs +9 -7
  261. package/dist/utils/printServerUrls.mjs.map +1 -1
  262. package/dist/utils/printServerUrls.native.js +48 -51
  263. package/dist/utils/printServerUrls.native.js.map +1 -1
  264. package/dist/utils/removeUndefined.mjs +8 -7
  265. package/dist/utils/removeUndefined.mjs.map +1 -1
  266. package/dist/utils/removeUndefined.native.js +8 -7
  267. package/dist/utils/removeUndefined.native.js.map +1 -1
  268. package/dist/utils/scanDepsToOptimize.mjs +194 -161
  269. package/dist/utils/scanDepsToOptimize.mjs.map +1 -1
  270. package/dist/utils/scanDepsToOptimize.native.js +227 -197
  271. package/dist/utils/scanDepsToOptimize.native.js.map +1 -1
  272. package/dist/utils/state.mjs +18 -18
  273. package/dist/utils/state.mjs.map +1 -1
  274. package/dist/utils/state.native.js +18 -18
  275. package/dist/utils/state.native.js.map +1 -1
  276. package/dist/utils/symbolicateNativeStack.mjs +54 -54
  277. package/dist/utils/symbolicateNativeStack.mjs.map +1 -1
  278. package/dist/utils/symbolicateNativeStack.native.js +58 -58
  279. package/dist/utils/symbolicateNativeStack.native.js.map +1 -1
  280. package/dist/utils/uniq.mjs +2 -1
  281. package/dist/utils/uniq.mjs.map +1 -1
  282. package/dist/utils/uniq.native.js +2 -1
  283. package/dist/utils/uniq.native.js.map +1 -1
  284. package/dist/utils/utils.mjs +19 -19
  285. package/dist/utils/utils.mjs.map +1 -1
  286. package/dist/utils/utils.native.js +38 -40
  287. package/dist/utils/utils.native.js.map +1 -1
  288. package/dist/vendor/debugger-app/index.mjs +0 -2
  289. package/dist/vendor/debugger-app/index.native.js +0 -2
  290. package/dist/vendor/debugger-app/src/debuggerWorker.mjs +0 -2
  291. package/dist/vendor/debugger-app/src/debuggerWorker.native.js +0 -2
  292. package/dist/vendor/debugger-app/src/index.mjs +0 -2
  293. package/dist/vendor/debugger-app/src/index.native.js +0 -2
  294. package/dist/vxrn-vite-plugin.mjs +34 -33
  295. package/dist/vxrn-vite-plugin.mjs.map +1 -1
  296. package/dist/vxrn-vite-plugin.native.js +35 -34
  297. package/dist/vxrn-vite-plugin.native.js.map +1 -1
  298. package/expo-plugin.cjs +12 -6
  299. package/package.json +12 -13
  300. package/src/config/getBaseViteConfigOnly.ts +6 -0
  301. package/src/exports/prebuild.ts +40 -12
  302. package/src/patches/builtInDepPatches.ts +24 -48
  303. package/src/utils/createNativeDevEngine.test.ts +1 -1
  304. package/src/utils/createNativeDevEngine.ts +15 -9
  305. package/src/utils/scanDepsToOptimize.ts +0 -3
  306. package/types/config/getBaseViteConfigOnly.d.ts.map +1 -1
  307. package/types/config/getOptimizeDeps.d.ts.map +1 -1
  308. package/types/config/getOptionsFilled.d.ts +15 -15
  309. package/types/config/getOptionsFilled.d.ts.map +1 -1
  310. package/types/exports/build.d.ts +11 -11
  311. package/types/exports/build.d.ts.map +1 -1
  312. package/types/exports/clean.d.ts +1 -1
  313. package/types/exports/clean.d.ts.map +1 -1
  314. package/types/exports/createServer.d.ts.map +1 -1
  315. package/types/exports/dev.d.ts.map +1 -1
  316. package/types/exports/patch.d.ts.map +1 -1
  317. package/types/exports/prebuild.d.ts +3 -3
  318. package/types/exports/prebuild.d.ts.map +1 -1
  319. package/types/exports/prebuildWithoutExpo.d.ts +1 -1
  320. package/types/exports/prebuildWithoutExpo.d.ts.map +1 -1
  321. package/types/exports/runAndroid.d.ts.map +1 -1
  322. package/types/exports/runIos.d.ts.map +1 -1
  323. package/types/exports/serve.d.ts.map +1 -1
  324. package/types/patches/builtInDepPatches.d.ts.map +1 -1
  325. package/types/plugins/autoDepOptimizePlugin.d.ts.map +1 -1
  326. package/types/plugins/rollupRemoveUnusedImports.d.ts.map +1 -1
  327. package/types/runtime/hmr-client.d.ts.map +1 -1
  328. package/types/runtime/hmr-runtime.d.ts.map +1 -1
  329. package/types/runtime/hmr-types.d.ts.map +1 -1
  330. package/types/utils/createNativeDevEngine.d.ts +1 -1
  331. package/types/utils/createNativeDevEngine.d.ts.map +1 -1
  332. package/types/utils/execSync.d.ts.map +1 -1
  333. package/types/utils/getServerEntry.d.ts.map +1 -1
  334. package/types/utils/scanDepsToOptimize.d.ts.map +1 -1
  335. package/types/vxrn-vite-plugin.d.ts.map +1 -1
  336. package/dist/config/getOptimizeDeps.test.mjs +0 -20
  337. package/dist/config/getOptimizeDeps.test.mjs.map +0 -1
  338. package/dist/config/getOptimizeDeps.test.native.js +0 -39
  339. package/dist/config/getOptimizeDeps.test.native.js.map +0 -1
  340. package/dist/config/getServerOptionsFilled.test.mjs +0 -20
  341. package/dist/config/getServerOptionsFilled.test.mjs.map +0 -1
  342. package/dist/config/getServerOptionsFilled.test.native.js +0 -20
  343. package/dist/config/getServerOptionsFilled.test.native.js.map +0 -1
  344. package/dist/config/getViteServerConfig.test.mjs +0 -26
  345. package/dist/config/getViteServerConfig.test.mjs.map +0 -1
  346. package/dist/config/getViteServerConfig.test.native.js +0 -26
  347. package/dist/config/getViteServerConfig.test.native.js.map +0 -1
  348. package/dist/config/mergeUserConfig.test.mjs +0 -108
  349. package/dist/config/mergeUserConfig.test.mjs.map +0 -1
  350. package/dist/config/mergeUserConfig.test.native.js +0 -108
  351. package/dist/config/mergeUserConfig.test.native.js.map +0 -1
  352. package/dist/exports/clean.test.mjs +0 -81
  353. package/dist/exports/clean.test.mjs.map +0 -1
  354. package/dist/exports/clean.test.native.js +0 -88
  355. package/dist/exports/clean.test.native.js.map +0 -1
  356. package/dist/exports/loadEnv.test.mjs +0 -65
  357. package/dist/exports/loadEnv.test.mjs.map +0 -1
  358. package/dist/exports/loadEnv.test.native.js +0 -65
  359. package/dist/exports/loadEnv.test.native.js.map +0 -1
  360. package/dist/index.js.map +0 -1
  361. package/dist/index.mjs.map +0 -1
  362. package/dist/index.native.js.map +0 -1
  363. package/dist/plugins/autoDepOptimizePlugin.test.mjs +0 -31
  364. package/dist/plugins/autoDepOptimizePlugin.test.mjs.map +0 -1
  365. package/dist/plugins/autoDepOptimizePlugin.test.native.js +0 -39
  366. package/dist/plugins/autoDepOptimizePlugin.test.native.js.map +0 -1
  367. package/dist/plugins/resolveIdScan.test.mjs +0 -31
  368. package/dist/plugins/resolveIdScan.test.mjs.map +0 -1
  369. package/dist/plugins/resolveIdScan.test.native.js +0 -38
  370. package/dist/plugins/resolveIdScan.test.native.js.map +0 -1
  371. package/dist/plugins/rnCodegenPlugin.test.mjs +0 -239
  372. package/dist/plugins/rnCodegenPlugin.test.mjs.map +0 -1
  373. package/dist/plugins/rnCodegenPlugin.test.native.js +0 -242
  374. package/dist/plugins/rnCodegenPlugin.test.native.js.map +0 -1
  375. package/dist/plugins/serverExtensions.test.mjs +0 -106
  376. package/dist/plugins/serverExtensions.test.mjs.map +0 -1
  377. package/dist/plugins/serverExtensions.test.native.js +0 -117
  378. package/dist/plugins/serverExtensions.test.native.js.map +0 -1
  379. package/dist/runtime/hmr-types.mjs.map +0 -1
  380. package/dist/runtime/hmr-types.native.js.map +0 -1
  381. package/dist/serve/node.test.mjs +0 -60
  382. package/dist/serve/node.test.mjs.map +0 -1
  383. package/dist/serve/node.test.native.js +0 -72
  384. package/dist/serve/node.test.native.js.map +0 -1
  385. package/dist/types.mjs.map +0 -1
  386. package/dist/types.native.js.map +0 -1
  387. package/dist/utils/bindKeypressInput.test.mjs +0 -48
  388. package/dist/utils/bindKeypressInput.test.mjs.map +0 -1
  389. package/dist/utils/bindKeypressInput.test.native.js +0 -48
  390. package/dist/utils/bindKeypressInput.test.native.js.map +0 -1
  391. package/dist/utils/createNativeDevEngine.test.mjs +0 -1788
  392. package/dist/utils/createNativeDevEngine.test.mjs.map +0 -1
  393. package/dist/utils/createNativeDevEngine.test.native.js +0 -1942
  394. package/dist/utils/createNativeDevEngine.test.native.js.map +0 -1
  395. package/dist/utils/createNativeDevEngineFailure.test.mjs +0 -44
  396. package/dist/utils/createNativeDevEngineFailure.test.mjs.map +0 -1
  397. package/dist/utils/createNativeDevEngineFailure.test.native.js +0 -54
  398. package/dist/utils/createNativeDevEngineFailure.test.native.js.map +0 -1
  399. package/dist/utils/getBoundPort.test.mjs +0 -71
  400. package/dist/utils/getBoundPort.test.mjs.map +0 -1
  401. package/dist/utils/getBoundPort.test.native.js +0 -82
  402. package/dist/utils/getBoundPort.test.native.js.map +0 -1
  403. package/dist/utils/imageSizePatch.test.mjs +0 -29
  404. package/dist/utils/imageSizePatch.test.mjs.map +0 -1
  405. package/dist/utils/imageSizePatch.test.native.js +0 -30
  406. package/dist/utils/imageSizePatch.test.native.js.map +0 -1
  407. package/dist/utils/patches.test.mjs +0 -242
  408. package/dist/utils/patches.test.mjs.map +0 -1
  409. package/dist/utils/patches.test.native.js +0 -271
  410. package/dist/utils/patches.test.native.js.map +0 -1
  411. package/dist/utils/symbolicateNativeStack.test.mjs +0 -96
  412. package/dist/utils/symbolicateNativeStack.test.mjs.map +0 -1
  413. package/dist/utils/symbolicateNativeStack.test.native.js +0 -96
  414. package/dist/utils/symbolicateNativeStack.test.native.js.map +0 -1
  415. package/dist/vendor/debugger-app/index.mjs.map +0 -1
  416. package/dist/vendor/debugger-app/index.native.js.map +0 -1
  417. package/dist/vendor/debugger-app/src/debuggerWorker.mjs.map +0 -1
  418. package/dist/vendor/debugger-app/src/debuggerWorker.native.js.map +0 -1
  419. package/dist/vendor/debugger-app/src/index.mjs.map +0 -1
  420. package/dist/vendor/debugger-app/src/index.native.js.map +0 -1
  421. package/types/config/getOptimizeDeps.test.d.ts +0 -2
  422. package/types/config/getOptimizeDeps.test.d.ts.map +0 -1
  423. package/types/config/getServerOptionsFilled.test.d.ts +0 -2
  424. package/types/config/getServerOptionsFilled.test.d.ts.map +0 -1
  425. package/types/config/getViteServerConfig.test.d.ts +0 -2
  426. package/types/config/getViteServerConfig.test.d.ts.map +0 -1
  427. package/types/config/mergeUserConfig.test.d.ts +0 -2
  428. package/types/config/mergeUserConfig.test.d.ts.map +0 -1
  429. package/types/exports/clean.test.d.ts +0 -2
  430. package/types/exports/clean.test.d.ts.map +0 -1
  431. package/types/exports/loadEnv.test.d.ts +0 -2
  432. package/types/exports/loadEnv.test.d.ts.map +0 -1
  433. package/types/plugins/autoDepOptimizePlugin.test.d.ts +0 -2
  434. package/types/plugins/autoDepOptimizePlugin.test.d.ts.map +0 -1
  435. package/types/plugins/resolveIdScan.test.d.ts +0 -2
  436. package/types/plugins/resolveIdScan.test.d.ts.map +0 -1
  437. package/types/plugins/rnCodegenPlugin.test.d.ts +0 -2
  438. package/types/plugins/rnCodegenPlugin.test.d.ts.map +0 -1
  439. package/types/plugins/serverExtensions.test.d.ts +0 -2
  440. package/types/plugins/serverExtensions.test.d.ts.map +0 -1
  441. package/types/serve/node.test.d.ts +0 -2
  442. package/types/serve/node.test.d.ts.map +0 -1
  443. package/types/utils/bindKeypressInput.test.d.ts +0 -2
  444. package/types/utils/bindKeypressInput.test.d.ts.map +0 -1
  445. package/types/utils/createNativeDevEngine.test.d.ts +0 -2
  446. package/types/utils/createNativeDevEngine.test.d.ts.map +0 -1
  447. package/types/utils/createNativeDevEngineFailure.test.d.ts +0 -2
  448. package/types/utils/createNativeDevEngineFailure.test.d.ts.map +0 -1
  449. package/types/utils/getBoundPort.test.d.ts +0 -2
  450. package/types/utils/getBoundPort.test.d.ts.map +0 -1
  451. package/types/utils/imageSizePatch.test.d.ts +0 -2
  452. package/types/utils/imageSizePatch.test.d.ts.map +0 -1
  453. package/types/utils/patches.test.d.ts +0 -2
  454. package/types/utils/patches.test.d.ts.map +0 -1
  455. package/types/utils/symbolicateNativeStack.test.d.ts +0 -2
  456. package/types/utils/symbolicateNativeStack.test.d.ts.map +0 -1
@@ -3,347 +3,323 @@ import module from "module";
3
3
  import { pathToFileURL } from "url";
4
4
  import { filterViteServerResolvedUrls } from "../utils/filterViteServerResolvedUrls.native.js";
5
5
  import { getBoundPort } from "../utils/getBoundPort.native.js";
6
- function _instanceof(left, right) {
7
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
8
- return !!right[Symbol.hasInstance](left);
9
- } else {
10
- return left instanceof right;
11
- }
12
- }
13
- var COMMANDS = [{
14
- keys: "ow",
15
- label: "open web",
16
- terminalLabel: "\x1B[1mo\x1B[0mpen \x1B[1mw\x1B[0meb",
17
- action: function (ctx) {
18
- var _ctx_server_resolvedUrls;
19
- var url = (_ctx_server_resolvedUrls = ctx.server.resolvedUrls) === null || _ctx_server_resolvedUrls === void 0 ? void 0 : _ctx_server_resolvedUrls.local[0];
20
- if (!url) {
21
- console.warn("Cannot get the local server URL.");
22
- return;
23
- }
24
- nativeOpen(url);
25
- }
26
- }, {
27
- keys: "oi",
28
- label: "open app in iOS Simulator",
29
- terminalLabel: "\x1B[1mo\x1B[0mpen app in \x1B[1mi\x1B[0mOS Simulator",
30
- action: function (ctx) {
31
- openIos(ctx);
32
- }
33
- }, {
34
- keys: "oa",
35
- label: "open app in Android Emulator",
36
- terminalLabel: "\x1B[1mo\x1B[0mpen app in \x1B[1mA\x1B[0mndroid Emulator",
37
- action: function (ctx) {
38
- openAndroid(ctx);
39
- }
40
- }, {
41
- keys: "oe",
42
- label: "open editor",
43
- terminalLabel: "\x1B[1mo\x1B[0mpen \x1B[1me\x1B[0mditor",
44
- action: async function (ctx) {
45
- var {
46
- defaultEditor
47
- } = await import("env-editor");
48
- exec(`${defaultEditor().binary} .`);
49
- }
50
- }, {
51
- keys: "qr",
52
- label: "show Expo Go QR code",
53
- terminalLabel: "show Expo Go \x1B[1mQR\x1B[0m code",
54
- action: function (ctx) {
55
- var url = getExpoGoUrl(ctx);
56
- if (!url) {
57
- return;
58
- }
59
- printNativeQrCodeAndInstructions(url);
60
- }
61
- },
62
- // TODO this would need to be per-platform
63
- {
64
- keys: "dt",
65
- label: "open React Native DevTools",
66
- terminalLabel: "open React Native \x1B[1mD\x1B[0mev\x1B[1mT\x1B[0mools",
67
- action: function (ctx) {
68
- var {
69
- host,
70
- port
71
- } = ctx.server.config.server;
72
- var serverUrl = `http://${typeof host === "string" && !!host ? host : "localhost"}:${port}`;
73
- var url = new URL("/open-debugger", serverUrl);
74
- (async function () {
75
- var response = await fetch(url, {
76
- method: "POST",
77
- signal: AbortSignal.timeout(3e3)
78
- }).catch(function (error) {
79
- if (error.name === "TimeoutError") {
80
- return null;
81
- }
82
- throw error;
83
- });
84
- if (!response) {} else if (response.ok === false) {
85
- var responseText = await response.text();
86
- if (responseText.includes("Unable to find debugger target")) {
87
- return;
88
- }
89
- console.warn(`Failed to open React Native DevTools, ${url} returns ${response.status}: ${responseText}.`);
90
- }
91
- })();
92
- }
93
- }, {
94
- keys: "?",
95
- label: "open editor",
96
- terminalLabel: "show this menu",
97
- action: async function (ctx) {}
98
- }];
6
+
7
+ var COMMANDS = [
8
+ {
9
+ keys: "ow",
10
+ label: "open web",
11
+ terminalLabel: "\x1B[1mo\x1B[0mpen \x1B[1mw\x1B[0meb",
12
+ action: function(ctx) {
13
+ var _ctx_server_resolvedUrls;
14
+ var url = (_ctx_server_resolvedUrls = ctx.server.resolvedUrls) === null || _ctx_server_resolvedUrls === void 0 ? void 0 : _ctx_server_resolvedUrls.local[0];
15
+ if (!url) {
16
+ console.warn("Cannot get the local server URL.");
17
+ return;
18
+ }
19
+ nativeOpen(url);
20
+ }
21
+ },
22
+ {
23
+ keys: "oi",
24
+ label: "open app in iOS Simulator",
25
+ terminalLabel: "\x1B[1mo\x1B[0mpen app in \x1B[1mi\x1B[0mOS Simulator",
26
+ action: function(ctx) {
27
+ openIos(ctx);
28
+ }
29
+ },
30
+ {
31
+ keys: "oa",
32
+ label: "open app in Android Emulator",
33
+ terminalLabel: "\x1B[1mo\x1B[0mpen app in \x1B[1mA\x1B[0mndroid Emulator",
34
+ action: function(ctx) {
35
+ openAndroid(ctx);
36
+ }
37
+ },
38
+ {
39
+ keys: "oe",
40
+ label: "open editor",
41
+ terminalLabel: "\x1B[1mo\x1B[0mpen \x1B[1me\x1B[0mditor",
42
+ action: async function(ctx) {
43
+ var { defaultEditor } = await import("env-editor");
44
+ exec(`${defaultEditor().binary} .`);
45
+ }
46
+ },
47
+ {
48
+ keys: "qr",
49
+ label: "show Expo Go QR code",
50
+ terminalLabel: "show Expo Go \x1B[1mQR\x1B[0m code",
51
+ action: function(ctx) {
52
+ var url = getExpoGoUrl(ctx);
53
+ if (!url) {
54
+ return;
55
+ }
56
+ printNativeQrCodeAndInstructions(url);
57
+ }
58
+ },
59
+ {
60
+ keys: "dt",
61
+ label: "open React Native DevTools",
62
+ terminalLabel: "open React Native \x1B[1mD\x1B[0mev\x1B[1mT\x1B[0mools",
63
+ action: function(ctx) {
64
+ var { host, port } = ctx.server.config.server;
65
+ var serverUrl = `http://${typeof host === "string" && !!host ? host : "localhost"}:${port}`;
66
+ var url = new URL("/open-debugger", serverUrl);
67
+ (async function() {
68
+ var response = await fetch(url, {
69
+ method: "POST",
70
+ signal: AbortSignal.timeout(3e3)
71
+ }).catch(function(error) {
72
+ if (error.name === "TimeoutError") {
73
+ return null;
74
+ }
75
+ throw error;
76
+ });
77
+ if (!response) {} else if (response.ok === false) {
78
+ var responseText = await response.text();
79
+ if (responseText.includes("Unable to find debugger target")) {
80
+ return;
81
+ }
82
+ console.warn(`Failed to open React Native DevTools, ${url} returns ${response.status}: ${responseText}.`);
83
+ }
84
+ })();
85
+ }
86
+ },
87
+ {
88
+ keys: "?",
89
+ label: "open editor",
90
+ terminalLabel: "show this menu",
91
+ action: async function(ctx) {}
92
+ }
93
+ ];
99
94
  async function startUserInterface(context) {
100
- if (!supportsKeyboardCommands()) {
101
- return;
102
- }
103
- printCommandsTable(context);
104
- startInterceptingKeyStrokes(context);
95
+ if (!supportsKeyboardCommands()) {
96
+ return;
97
+ }
98
+ printCommandsTable(context);
99
+ startInterceptingKeyStrokes(context);
105
100
  }
106
101
  function printCommandsTable(context) {
107
- var longestKeyLength = COMMANDS.reduce(function (max, command) {
108
- return Math.max(max, command.keys.length);
109
- }, 0);
110
- var commandsInfo = COMMANDS.map(function (cmd) {
111
- return getCommandInfoInTerminal(cmd, {
112
- longestKeyLength
113
- });
114
- }).join("\n");
115
- console.info(`
102
+ var longestKeyLength = COMMANDS.reduce(function(max, command) {
103
+ return Math.max(max, command.keys.length);
104
+ }, 0);
105
+ var commandsInfo = COMMANDS.map(function(cmd) {
106
+ return getCommandInfoInTerminal(cmd, { longestKeyLength });
107
+ }).join("\n");
108
+ console.info(`
116
109
  ${commandsInfo}
117
110
  `);
118
111
  }
119
112
  function getCommandInfoInTerminal(command) {
120
- var {
121
- longestKeyLength = 0
122
- } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
123
- return `\x1B[90m\u203A\x1B[0m Press \x1B[1m${longestKeyLength ? command.keys.padEnd(longestKeyLength, " ") : command.keys}\x1B[0m \x1B[90m\u2502\x1B[0m ${command.terminalLabel}`;
113
+ var { longestKeyLength = 0 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
114
+ return `\x1B[90m\u203A\x1B[0m Press \x1B[1m${longestKeyLength ? command.keys.padEnd(longestKeyLength, " ") : command.keys}\x1B[0m \x1B[90m\u2502\x1B[0m ${command.terminalLabel}`;
124
115
  }
125
116
  function restoreTerminal() {
126
- var {
127
- stdin
128
- } = process;
129
- if (stdin.isTTY && stdin.setRawMode) {
130
- try {
131
- stdin.setRawMode(false);
132
- } catch (unused) {}
133
- }
134
- process.stdout.write("\x1B[0m");
117
+ var { stdin } = process;
118
+ if (stdin.isTTY && stdin.setRawMode) {
119
+ try {
120
+ stdin.setRawMode(false);
121
+ } catch (unused) {}
122
+ }
123
+ process.stdout.write("\x1B[0m");
135
124
  }
136
125
  function supportsKeyboardCommands() {
137
- var {
138
- stdin
139
- } = process;
140
- return Boolean(stdin.isTTY && stdin.setRawMode);
126
+ var { stdin } = process;
127
+ return Boolean(stdin.isTTY && stdin.setRawMode);
141
128
  }
142
129
  function startInterceptingKeyStrokes(context) {
143
- var {
144
- stdin
145
- } = process;
146
- if (!supportsKeyboardCommands()) {
147
- return;
148
- }
149
- stdin.setRawMode(true);
150
- stdin.resume();
151
- stdin.setEncoding("utf8");
152
- stdin.on("data", handleKeypress.bind(null, context));
153
- stdin.unref();
154
- process.on("exit", restoreTerminal);
155
- process.on("SIGINT", function () {
156
- restoreTerminal();
157
- process.exit(0);
158
- });
159
- process.on("SIGTERM", function () {
160
- restoreTerminal();
161
- process.exit(0);
162
- });
130
+ var { stdin } = process;
131
+ if (!supportsKeyboardCommands()) {
132
+ return;
133
+ }
134
+ stdin.setRawMode(true);
135
+ stdin.resume();
136
+ stdin.setEncoding("utf8");
137
+ stdin.on("data", handleKeypress.bind(null, context));
138
+ stdin.unref();
139
+ process.on("exit", restoreTerminal);
140
+ process.on("SIGINT", function() {
141
+ restoreTerminal();
142
+ process.exit(0);
143
+ });
144
+ process.on("SIGTERM", function() {
145
+ restoreTerminal();
146
+ process.exit(0);
147
+ });
163
148
  }
164
149
  var pressedKeys = "";
165
150
  var clearPressedKeysTimer = null;
166
151
  function clearPressedKeys() {
167
- pressedKeys = "";
168
- clearPrintedInfo();
152
+ pressedKeys = "";
153
+ clearPrintedInfo();
169
154
  }
170
155
  function resetClearPressedKeysTimer() {
171
- if (clearPressedKeysTimer) {
172
- clearTimeout(clearPressedKeysTimer);
173
- }
174
- clearPressedKeysTimer = setTimeout(clearPressedKeys, 3e3);
175
- clearPressedKeysTimer.unref();
156
+ if (clearPressedKeysTimer) {
157
+ clearTimeout(clearPressedKeysTimer);
158
+ }
159
+ clearPressedKeysTimer = setTimeout(clearPressedKeys, 3e3);
160
+ clearPressedKeysTimer.unref();
176
161
  }
177
162
  function handleKeypress(context, key) {
178
- if (key === "\x1B") {
179
- clearPrintedInfo();
180
- pressedKeys = "";
181
- return;
182
- }
183
- if (key === "?" || key === "/") {
184
- clearPrintedInfo();
185
- console.info("> ?\n\u21D2 Available commands:");
186
- printCommandsTable(context);
187
- return;
188
- }
189
- resetClearPressedKeysTimer();
190
- if (key === "\x7F") {
191
- pressedKeys = pressedKeys.slice(0, -1);
192
- } else {
193
- key = key.toLowerCase();
194
- if (/^[a-z]$/.test(key)) {
195
- pressedKeys += key;
196
- }
197
- }
198
- if (pressedKeys.length === 0) {
199
- clearPrintedInfo();
200
- return;
201
- }
202
- var matchedCommand = COMMANDS.find(function (command) {
203
- return command.keys === pressedKeys;
204
- });
205
- if (matchedCommand) {
206
- clearPrintedInfo();
207
- console.info(`> ${matchedCommand.keys}
163
+ if (key === "\x1B") {
164
+ clearPrintedInfo();
165
+ pressedKeys = "";
166
+ return;
167
+ }
168
+ if (key === "?" || key === "/") {
169
+ clearPrintedInfo();
170
+ console.info("> ?\n⇒ Available commands:");
171
+ printCommandsTable(context);
172
+ return;
173
+ }
174
+ resetClearPressedKeysTimer();
175
+ if (key === "") {
176
+ pressedKeys = pressedKeys.slice(0, -1);
177
+ } else {
178
+ key = key.toLowerCase();
179
+ if (/^[a-z]$/.test(key)) {
180
+ pressedKeys += key;
181
+ }
182
+ }
183
+ if (pressedKeys.length === 0) {
184
+ clearPrintedInfo();
185
+ return;
186
+ }
187
+ var matchedCommand = COMMANDS.find(function(command) {
188
+ return command.keys === pressedKeys;
189
+ });
190
+ if (matchedCommand) {
191
+ clearPrintedInfo();
192
+ console.info(`> ${matchedCommand.keys}
208
193
  \u21D2 ${matchedCommand.label}...`);
209
- pressedKeys = "";
210
- setTimeout(function () {
211
- var _matchedCommand_action;
212
- return (_matchedCommand_action = matchedCommand.action) === null || _matchedCommand_action === void 0 ? void 0 : _matchedCommand_action.call(matchedCommand, context);
213
- }, 500);
214
- return;
215
- }
216
- if (pressedKeys.length >= 3) {
217
- clearPrintedInfo();
218
- console.info(`> ${pressedKeys}
194
+ pressedKeys = "";
195
+ setTimeout(function() {
196
+ var _matchedCommand_action;
197
+ return (_matchedCommand_action = matchedCommand.action) === null || _matchedCommand_action === void 0 ? void 0 : _matchedCommand_action.call(matchedCommand, context);
198
+ }, 500);
199
+ return;
200
+ }
201
+ if (pressedKeys.length >= 3) {
202
+ clearPrintedInfo();
203
+ console.info(`> ${pressedKeys}
219
204
  No matching command for "${pressedKeys}"! Press "?" for help.`);
220
- pressedKeys = "";
221
- return;
222
- }
223
- var possibleCommands = COMMANDS.filter(function (command) {
224
- return command.keys.startsWith(pressedKeys);
225
- });
226
- var commandsInfo = possibleCommands.map(function (command) {
227
- var matchedPart = command.keys.slice(0, pressedKeys.length);
228
- var remainingPart = command.keys.slice(pressedKeys.length);
229
- return ` \x1B[4m${matchedPart}\x1B[0m\x1B[1m${remainingPart}\x1B[0m\x1B[90m - \x1B[0m${command.terminalLabel}`;
230
- }).join("\n");
231
- var infoToPrint = `
205
+ pressedKeys = "";
206
+ return;
207
+ }
208
+ var possibleCommands = COMMANDS.filter(function(command) {
209
+ return command.keys.startsWith(pressedKeys);
210
+ });
211
+ var commandsInfo = possibleCommands.map(function(command) {
212
+ var matchedPart = command.keys.slice(0, pressedKeys.length);
213
+ var remainingPart = command.keys.slice(pressedKeys.length);
214
+ return ` \x1B[4m${matchedPart}\x1B[0m\x1B[1m${remainingPart}\x1B[0m\x1B[90m - \x1B[0m${command.terminalLabel}`;
215
+ }).join("\n");
216
+ var infoToPrint = `
232
217
  ${commandsInfo}
233
218
  > ${pressedKeys}`;
234
- printInfo(infoToPrint);
219
+ printInfo(infoToPrint);
235
220
  }
236
221
  var lastPrintedInfo = "";
237
222
  function printInfo(info) {
238
- clearPrintedInfo();
239
- lastPrintedInfo = info;
240
- process.stdout.write(info);
223
+ clearPrintedInfo();
224
+ lastPrintedInfo = info;
225
+ process.stdout.write(info);
241
226
  }
242
227
  function clearPrintedInfo() {
243
- if (lastPrintedInfo) {
244
- process.stdout.write("\x1B[2K");
245
- process.stdout.write("\x1B[1A\x1B[2K".repeat(lastPrintedInfo.split("\n").length - 1));
246
- process.stdout.write("\x1B[2K");
247
- process.stdout.write("\x1B[G");
248
- }
249
- lastPrintedInfo = "";
228
+ if (lastPrintedInfo) {
229
+ process.stdout.write("\x1B[2K");
230
+ process.stdout.write("\x1B[1A\x1B[2K".repeat(lastPrintedInfo.split("\n").length - 1));
231
+ process.stdout.write("\x1B[2K");
232
+ process.stdout.write("\x1B[G");
233
+ }
234
+ lastPrintedInfo = "";
250
235
  }
251
236
  async function printNativeQrCodeAndInstructions(url) {
252
- var qrcode = await import("qrcode-terminal");
253
- (qrcode.default || qrcode).generate(url, {
254
- small: true
255
- }, function (code) {
256
- console.info(`To open the app on your iPhone, install the Expo Go app and scan the QR code below with your iPhone camera:
237
+ var qrcode = await import("qrcode-terminal");
238
+ (qrcode.default || qrcode).generate(url, { small: true }, function(code) {
239
+ console.info(`To open the app on your iPhone, install the Expo Go app and scan the QR code below with your iPhone camera:
257
240
  ${code}`);
258
- });
241
+ });
259
242
  }
260
243
  function nativeOpen(url) {
261
- var start = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
262
- exec(`${start} ${url}`);
244
+ var start = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
245
+ exec(`${start} ${url}`);
263
246
  }
264
247
  async function openIos(ctx) {
265
- var projectRoot = ctx.server.config.root;
266
- var port = getBoundPort(ctx.server);
267
- try {
268
- var require2 = module.createRequire(projectRoot);
269
- var applePlatformManagerModuleImportPath = require2.resolve("@expo/cli/build/src/start/platforms/ios/ApplePlatformManager.js", {
270
- paths: [projectRoot]
271
- });
272
- var applePlatformManagerModule = await import(pathToFileURL(applePlatformManagerModuleImportPath).href);
273
- var PlatformManager = applePlatformManagerModule.default.ApplePlatformManager;
274
- var platformManager = new PlatformManager(projectRoot, port, {
275
- /** Expo Go URL. */
276
- getExpoGoUrl: function () {
277
- return getExpoGoUrl(ctx);
278
- },
279
- /** Get the base URL for the dev server hosting this platform manager. */
280
- getDevServerUrl: function () {
281
- return null;
282
- },
283
- /** Get redirect URL for native disambiguation. */
284
- getRedirectUrl: function () {
285
- return null;
286
- },
287
- /** Dev Client */
288
- getCustomRuntimeUrl: function (props) {
289
- return null;
290
- }
291
- });
292
- await platformManager.openAsync({
293
- runtime: "expo"
294
- });
295
- } catch (e) {
296
- var stack = _instanceof(e, Error) ? e.stack : null;
297
- console.error(`Failed to open app in iOS Simulator: ${e}${stack ? `
248
+ var projectRoot = ctx.server.config.root;
249
+ var port = getBoundPort(ctx.server);
250
+ try {
251
+ var require2 = module.createRequire(projectRoot);
252
+ var applePlatformManagerModuleImportPath = require2.resolve("@expo/cli/build/src/start/platforms/ios/ApplePlatformManager.js", { paths: [projectRoot] });
253
+ var applePlatformManagerModule = await import(pathToFileURL(applePlatformManagerModuleImportPath).href);
254
+ var PlatformManager = applePlatformManagerModule.default.ApplePlatformManager;
255
+ var platformManager = new PlatformManager(projectRoot, port, {
256
+ /** Expo Go URL. */
257
+ getExpoGoUrl: function() {
258
+ return getExpoGoUrl(ctx);
259
+ },
260
+ /** Get the base URL for the dev server hosting this platform manager. */
261
+ getDevServerUrl: function() {
262
+ return null;
263
+ },
264
+ /** Get redirect URL for native disambiguation. */
265
+ getRedirectUrl: function() {
266
+ return null;
267
+ },
268
+ /** Dev Client */
269
+ getCustomRuntimeUrl: function(props) {
270
+ return null;
271
+ }
272
+ });
273
+ await platformManager.openAsync({ runtime: "expo" });
274
+ } catch (e) {
275
+ var stack = e instanceof Error ? e.stack : null;
276
+ console.error(`Failed to open app in iOS Simulator: ${e}${stack ? `
298
277
  ${stack}` : ""}`);
299
- }
278
+ }
300
279
  }
301
280
  async function openAndroid(ctx) {
302
- var projectRoot = ctx.server.config.root;
303
- var port = getBoundPort(ctx.server);
304
- try {
305
- var require2 = module.createRequire(projectRoot);
306
- var androidPlatformManagerModuleImportPath = require2.resolve("@expo/cli/build/src/start/platforms/android/AndroidPlatformManager.js", {
307
- paths: [projectRoot]
308
- });
309
- var androidPlatformManagerModule = await import(pathToFileURL(androidPlatformManagerModuleImportPath).href);
310
- var PlatformManager = androidPlatformManagerModule.default.AndroidPlatformManager;
311
- var platformManager = new PlatformManager(projectRoot, port, {
312
- /** Expo Go URL. */
313
- getExpoGoUrl: function () {
314
- return getExpoGoUrl(ctx);
315
- },
316
- /** Get the base URL for the dev server hosting this platform manager. */
317
- getDevServerUrl: function () {
318
- return null;
319
- },
320
- /** Get redirect URL for native disambiguation. */
321
- getRedirectUrl: function () {
322
- return null;
323
- },
324
- /** Dev Client */
325
- getCustomRuntimeUrl: function (props) {
326
- return null;
327
- }
328
- });
329
- await platformManager.openAsync({
330
- runtime: "expo"
331
- });
332
- } catch (e) {
333
- var stack = _instanceof(e, Error) ? e.stack : null;
334
- console.error(`Failed to open app in Android Emulator: ${e}${stack ? `
281
+ var projectRoot = ctx.server.config.root;
282
+ var port = getBoundPort(ctx.server);
283
+ try {
284
+ var require2 = module.createRequire(projectRoot);
285
+ var androidPlatformManagerModuleImportPath = require2.resolve("@expo/cli/build/src/start/platforms/android/AndroidPlatformManager.js", { paths: [projectRoot] });
286
+ var androidPlatformManagerModule = await import(pathToFileURL(androidPlatformManagerModuleImportPath).href);
287
+ var PlatformManager = androidPlatformManagerModule.default.AndroidPlatformManager;
288
+ var platformManager = new PlatformManager(projectRoot, port, {
289
+ /** Expo Go URL. */
290
+ getExpoGoUrl: function() {
291
+ return getExpoGoUrl(ctx);
292
+ },
293
+ /** Get the base URL for the dev server hosting this platform manager. */
294
+ getDevServerUrl: function() {
295
+ return null;
296
+ },
297
+ /** Get redirect URL for native disambiguation. */
298
+ getRedirectUrl: function() {
299
+ return null;
300
+ },
301
+ /** Dev Client */
302
+ getCustomRuntimeUrl: function(props) {
303
+ return null;
304
+ }
305
+ });
306
+ await platformManager.openAsync({ runtime: "expo" });
307
+ } catch (e) {
308
+ var stack = e instanceof Error ? e.stack : null;
309
+ console.error(`Failed to open app in Android Emulator: ${e}${stack ? `
335
310
  ${stack}` : ""}`);
336
- }
311
+ }
337
312
  }
338
313
  function getExpoGoUrl(ctx) {
339
- var _filterViteServerResolvedUrls;
340
- var urls = (_filterViteServerResolvedUrls = filterViteServerResolvedUrls(ctx.server.resolvedUrls)) === null || _filterViteServerResolvedUrls === void 0 ? void 0 : _filterViteServerResolvedUrls.network;
341
- var url = urls === null || urls === void 0 ? void 0 : urls[urls.length - 1];
342
- if (!url) {
343
- console.warn("Cannot get the local server URL.");
344
- return;
345
- }
346
- return url.replace(/^https?/, "exp");
314
+ var _filterViteServerResolvedUrls;
315
+ var urls = (_filterViteServerResolvedUrls = filterViteServerResolvedUrls(ctx.server.resolvedUrls)) === null || _filterViteServerResolvedUrls === void 0 ? void 0 : _filterViteServerResolvedUrls.network;
316
+ var url = urls === null || urls === void 0 ? void 0 : urls[urls.length - 1];
317
+ if (!url) {
318
+ console.warn("Cannot get the local server URL.");
319
+ return;
320
+ }
321
+ return url.replace(/^https?/, "exp");
347
322
  }
323
+
348
324
  export { startUserInterface };
349
325
  //# sourceMappingURL=index.native.js.map