vxrn 1.25.3 → 1.25.5

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 (446) hide show
  1. package/package.json +11 -11
  2. package/src/plugins/reactNativeDevServer.ts +57 -17
  3. package/src/utils/createNativeDevEngine.test.ts +95 -0
  4. package/src/utils/createNativeDevEngine.ts +157 -80
  5. package/types/utils/createNativeDevEngine.d.ts +17 -6
  6. package/dist/cli.mjs +0 -288
  7. package/dist/cli.mjs.map +0 -1
  8. package/dist/cli.native.js +0 -292
  9. package/dist/cli.native.js.map +0 -1
  10. package/dist/config/getAdditionalViteConfig.mjs +0 -67
  11. package/dist/config/getAdditionalViteConfig.mjs.map +0 -1
  12. package/dist/config/getAdditionalViteConfig.native.js +0 -67
  13. package/dist/config/getAdditionalViteConfig.native.js.map +0 -1
  14. package/dist/config/getBaseViteConfigOnly.mjs +0 -84
  15. package/dist/config/getBaseViteConfigOnly.mjs.map +0 -1
  16. package/dist/config/getBaseViteConfigOnly.native.js +0 -86
  17. package/dist/config/getBaseViteConfigOnly.native.js.map +0 -1
  18. package/dist/config/getBaseViteConfigWithPlugins.mjs +0 -10
  19. package/dist/config/getBaseViteConfigWithPlugins.mjs.map +0 -1
  20. package/dist/config/getBaseViteConfigWithPlugins.native.js +0 -10
  21. package/dist/config/getBaseViteConfigWithPlugins.native.js.map +0 -1
  22. package/dist/config/getBaseVitePlugins.mjs +0 -141
  23. package/dist/config/getBaseVitePlugins.mjs.map +0 -1
  24. package/dist/config/getBaseVitePlugins.native.js +0 -163
  25. package/dist/config/getBaseVitePlugins.native.js.map +0 -1
  26. package/dist/config/getNonCliModeOnlyVitePlugins.mjs +0 -8
  27. package/dist/config/getNonCliModeOnlyVitePlugins.mjs.map +0 -1
  28. package/dist/config/getNonCliModeOnlyVitePlugins.native.js +0 -6
  29. package/dist/config/getNonCliModeOnlyVitePlugins.native.js.map +0 -1
  30. package/dist/config/getOptimizeDeps.mjs +0 -47
  31. package/dist/config/getOptimizeDeps.mjs.map +0 -1
  32. package/dist/config/getOptimizeDeps.native.js +0 -47
  33. package/dist/config/getOptimizeDeps.native.js.map +0 -1
  34. package/dist/config/getOptimizeDeps.test.mjs +0 -20
  35. package/dist/config/getOptimizeDeps.test.mjs.map +0 -1
  36. package/dist/config/getOptimizeDeps.test.native.js +0 -39
  37. package/dist/config/getOptimizeDeps.test.native.js.map +0 -1
  38. package/dist/config/getOptionsFilled.mjs +0 -69
  39. package/dist/config/getOptionsFilled.mjs.map +0 -1
  40. package/dist/config/getOptionsFilled.native.js +0 -73
  41. package/dist/config/getOptionsFilled.native.js.map +0 -1
  42. package/dist/config/getReactNativePlugins.mjs +0 -23
  43. package/dist/config/getReactNativePlugins.mjs.map +0 -1
  44. package/dist/config/getReactNativePlugins.native.js +0 -25
  45. package/dist/config/getReactNativePlugins.native.js.map +0 -1
  46. package/dist/config/getServerOptionsFilled.mjs +0 -40
  47. package/dist/config/getServerOptionsFilled.mjs.map +0 -1
  48. package/dist/config/getServerOptionsFilled.native.js +0 -43
  49. package/dist/config/getServerOptionsFilled.native.js.map +0 -1
  50. package/dist/config/getServerOptionsFilled.test.mjs +0 -20
  51. package/dist/config/getServerOptionsFilled.test.mjs.map +0 -1
  52. package/dist/config/getServerOptionsFilled.test.native.js +0 -20
  53. package/dist/config/getServerOptionsFilled.test.native.js.map +0 -1
  54. package/dist/config/getViteServerConfig.mjs +0 -51
  55. package/dist/config/getViteServerConfig.mjs.map +0 -1
  56. package/dist/config/getViteServerConfig.native.js +0 -52
  57. package/dist/config/getViteServerConfig.native.js.map +0 -1
  58. package/dist/config/mergeUserConfig.mjs +0 -37
  59. package/dist/config/mergeUserConfig.mjs.map +0 -1
  60. package/dist/config/mergeUserConfig.native.js +0 -47
  61. package/dist/config/mergeUserConfig.native.js.map +0 -1
  62. package/dist/config/mergeUserConfig.test.mjs +0 -108
  63. package/dist/config/mergeUserConfig.test.mjs.map +0 -1
  64. package/dist/config/mergeUserConfig.test.native.js +0 -108
  65. package/dist/config/mergeUserConfig.test.native.js.map +0 -1
  66. package/dist/constants/defaults.mjs +0 -15
  67. package/dist/constants/defaults.mjs.map +0 -1
  68. package/dist/constants/defaults.native.js +0 -15
  69. package/dist/constants/defaults.native.js.map +0 -1
  70. package/dist/constants.mjs +0 -10
  71. package/dist/constants.mjs.map +0 -1
  72. package/dist/constants.native.js +0 -10
  73. package/dist/constants.native.js.map +0 -1
  74. package/dist/exports/build.mjs +0 -294
  75. package/dist/exports/build.mjs.map +0 -1
  76. package/dist/exports/build.native.js +0 -307
  77. package/dist/exports/build.native.js.map +0 -1
  78. package/dist/exports/clean.mjs +0 -99
  79. package/dist/exports/clean.mjs.map +0 -1
  80. package/dist/exports/clean.native.js +0 -111
  81. package/dist/exports/clean.native.js.map +0 -1
  82. package/dist/exports/clean.test.mjs +0 -81
  83. package/dist/exports/clean.test.mjs.map +0 -1
  84. package/dist/exports/clean.test.native.js +0 -88
  85. package/dist/exports/clean.test.native.js.map +0 -1
  86. package/dist/exports/createServer.mjs +0 -56
  87. package/dist/exports/createServer.mjs.map +0 -1
  88. package/dist/exports/createServer.native.js +0 -57
  89. package/dist/exports/createServer.native.js.map +0 -1
  90. package/dist/exports/dev.mjs +0 -204
  91. package/dist/exports/dev.mjs.map +0 -1
  92. package/dist/exports/dev.native.js +0 -218
  93. package/dist/exports/dev.native.js.map +0 -1
  94. package/dist/exports/loadEnv.mjs +0 -65
  95. package/dist/exports/loadEnv.mjs.map +0 -1
  96. package/dist/exports/loadEnv.native.js +0 -74
  97. package/dist/exports/loadEnv.native.js.map +0 -1
  98. package/dist/exports/loadEnv.test.mjs +0 -65
  99. package/dist/exports/loadEnv.test.mjs.map +0 -1
  100. package/dist/exports/loadEnv.test.native.js +0 -65
  101. package/dist/exports/loadEnv.test.native.js.map +0 -1
  102. package/dist/exports/patch.mjs +0 -12
  103. package/dist/exports/patch.mjs.map +0 -1
  104. package/dist/exports/patch.native.js +0 -12
  105. package/dist/exports/patch.native.js.map +0 -1
  106. package/dist/exports/prebuild.mjs +0 -212
  107. package/dist/exports/prebuild.mjs.map +0 -1
  108. package/dist/exports/prebuild.native.js +0 -215
  109. package/dist/exports/prebuild.native.js.map +0 -1
  110. package/dist/exports/prebuildWithoutExpo.mjs +0 -53
  111. package/dist/exports/prebuildWithoutExpo.mjs.map +0 -1
  112. package/dist/exports/prebuildWithoutExpo.native.js +0 -54
  113. package/dist/exports/prebuildWithoutExpo.native.js.map +0 -1
  114. package/dist/exports/runAndroid.mjs +0 -14
  115. package/dist/exports/runAndroid.mjs.map +0 -1
  116. package/dist/exports/runAndroid.native.js +0 -15
  117. package/dist/exports/runAndroid.native.js.map +0 -1
  118. package/dist/exports/runIos.mjs +0 -14
  119. package/dist/exports/runIos.mjs.map +0 -1
  120. package/dist/exports/runIos.native.js +0 -15
  121. package/dist/exports/runIos.native.js.map +0 -1
  122. package/dist/exports/serve.mjs +0 -37
  123. package/dist/exports/serve.mjs.map +0 -1
  124. package/dist/exports/serve.native.js +0 -40
  125. package/dist/exports/serve.native.js.map +0 -1
  126. package/dist/exports/serveStaticAssets.mjs +0 -133
  127. package/dist/exports/serveStaticAssets.mjs.map +0 -1
  128. package/dist/exports/serveStaticAssets.native.js +0 -213
  129. package/dist/exports/serveStaticAssets.native.js.map +0 -1
  130. package/dist/index.js +0 -22
  131. package/dist/index.js.map +0 -1
  132. package/dist/index.mjs +0 -22
  133. package/dist/index.mjs.map +0 -1
  134. package/dist/index.native.js +0 -22
  135. package/dist/index.native.js.map +0 -1
  136. package/dist/patches/builtInDepPatches.mjs +0 -483
  137. package/dist/patches/builtInDepPatches.mjs.map +0 -1
  138. package/dist/patches/builtInDepPatches.native.js +0 -486
  139. package/dist/patches/builtInDepPatches.native.js.map +0 -1
  140. package/dist/plugins/applyBuiltInPatchesPlugin.mjs +0 -17
  141. package/dist/plugins/applyBuiltInPatchesPlugin.mjs.map +0 -1
  142. package/dist/plugins/applyBuiltInPatchesPlugin.native.js +0 -17
  143. package/dist/plugins/applyBuiltInPatchesPlugin.native.js.map +0 -1
  144. package/dist/plugins/autoDepOptimizePlugin.mjs +0 -108
  145. package/dist/plugins/autoDepOptimizePlugin.mjs.map +0 -1
  146. package/dist/plugins/autoDepOptimizePlugin.native.js +0 -121
  147. package/dist/plugins/autoDepOptimizePlugin.native.js.map +0 -1
  148. package/dist/plugins/autoDepOptimizePlugin.test.mjs +0 -31
  149. package/dist/plugins/autoDepOptimizePlugin.test.mjs.map +0 -1
  150. package/dist/plugins/autoDepOptimizePlugin.test.native.js +0 -39
  151. package/dist/plugins/autoDepOptimizePlugin.test.native.js.map +0 -1
  152. package/dist/plugins/clientInjectPlugin.mjs +0 -16
  153. package/dist/plugins/clientInjectPlugin.mjs.map +0 -1
  154. package/dist/plugins/clientInjectPlugin.native.js +0 -16
  155. package/dist/plugins/clientInjectPlugin.native.js.map +0 -1
  156. package/dist/plugins/defaultDepOptimizePlugin.mjs +0 -30
  157. package/dist/plugins/defaultDepOptimizePlugin.mjs.map +0 -1
  158. package/dist/plugins/defaultDepOptimizePlugin.native.js +0 -30
  159. package/dist/plugins/defaultDepOptimizePlugin.native.js.map +0 -1
  160. package/dist/plugins/expoManifestRequestHandlerPlugin.mjs +0 -189
  161. package/dist/plugins/expoManifestRequestHandlerPlugin.mjs.map +0 -1
  162. package/dist/plugins/expoManifestRequestHandlerPlugin.native.js +0 -202
  163. package/dist/plugins/expoManifestRequestHandlerPlugin.native.js.map +0 -1
  164. package/dist/plugins/getResolvedConfigSubset.mjs +0 -12
  165. package/dist/plugins/getResolvedConfigSubset.mjs.map +0 -1
  166. package/dist/plugins/getResolvedConfigSubset.native.js +0 -12
  167. package/dist/plugins/getResolvedConfigSubset.native.js.map +0 -1
  168. package/dist/plugins/reactNativeCommonJsPlugin.mjs +0 -194
  169. package/dist/plugins/reactNativeCommonJsPlugin.mjs.map +0 -1
  170. package/dist/plugins/reactNativeCommonJsPlugin.native.js +0 -275
  171. package/dist/plugins/reactNativeCommonJsPlugin.native.js.map +0 -1
  172. package/dist/plugins/reactNativeDevAssetPlugin.mjs +0 -99
  173. package/dist/plugins/reactNativeDevAssetPlugin.mjs.map +0 -1
  174. package/dist/plugins/reactNativeDevAssetPlugin.native.js +0 -108
  175. package/dist/plugins/reactNativeDevAssetPlugin.native.js.map +0 -1
  176. package/dist/plugins/reactNativeDevServer.mjs +0 -190
  177. package/dist/plugins/reactNativeDevServer.mjs.map +0 -1
  178. package/dist/plugins/reactNativeDevServer.native.js +0 -232
  179. package/dist/plugins/reactNativeDevServer.native.js.map +0 -1
  180. package/dist/plugins/resolveIdScan.test.mjs +0 -31
  181. package/dist/plugins/resolveIdScan.test.mjs.map +0 -1
  182. package/dist/plugins/resolveIdScan.test.native.js +0 -38
  183. package/dist/plugins/resolveIdScan.test.native.js.map +0 -1
  184. package/dist/plugins/rollupRemoveUnusedImports.mjs +0 -11
  185. package/dist/plugins/rollupRemoveUnusedImports.mjs.map +0 -1
  186. package/dist/plugins/rollupRemoveUnusedImports.native.js +0 -11
  187. package/dist/plugins/rollupRemoveUnusedImports.native.js.map +0 -1
  188. package/dist/plugins/serverExtensions.test.mjs +0 -106
  189. package/dist/plugins/serverExtensions.test.mjs.map +0 -1
  190. package/dist/plugins/serverExtensions.test.native.js +0 -117
  191. package/dist/plugins/serverExtensions.test.native.js.map +0 -1
  192. package/dist/rn-commands/bundle/buildBundle.mjs +0 -68
  193. package/dist/rn-commands/bundle/buildBundle.mjs.map +0 -1
  194. package/dist/rn-commands/bundle/buildBundle.native.js +0 -75
  195. package/dist/rn-commands/bundle/buildBundle.native.js.map +0 -1
  196. package/dist/runtime/hmr-client.mjs +0 -145
  197. package/dist/runtime/hmr-client.mjs.map +0 -1
  198. package/dist/runtime/hmr-client.native.js +0 -237
  199. package/dist/runtime/hmr-client.native.js.map +0 -1
  200. package/dist/runtime/hmr-runtime.mjs +0 -200
  201. package/dist/runtime/hmr-runtime.mjs.map +0 -1
  202. package/dist/runtime/hmr-runtime.native.js +0 -441
  203. package/dist/runtime/hmr-runtime.native.js.map +0 -1
  204. package/dist/runtime/hmr-types.mjs +0 -2
  205. package/dist/runtime/hmr-types.mjs.map +0 -1
  206. package/dist/runtime/hmr-types.native.js +0 -2
  207. package/dist/runtime/hmr-types.native.js.map +0 -1
  208. package/dist/runtime/native-prelude.mjs +0 -94
  209. package/dist/runtime/native-prelude.mjs.map +0 -1
  210. package/dist/runtime/native-prelude.native.js +0 -94
  211. package/dist/runtime/native-prelude.native.js.map +0 -1
  212. package/dist/runtime/react-refresh-utils.mjs +0 -29
  213. package/dist/runtime/react-refresh-utils.mjs.map +0 -1
  214. package/dist/runtime/react-refresh-utils.native.js +0 -34
  215. package/dist/runtime/react-refresh-utils.native.js.map +0 -1
  216. package/dist/serve/node.mjs +0 -62
  217. package/dist/serve/node.mjs.map +0 -1
  218. package/dist/serve/node.native.js +0 -107
  219. package/dist/serve/node.native.js.map +0 -1
  220. package/dist/serve/node.test.mjs +0 -60
  221. package/dist/serve/node.test.mjs.map +0 -1
  222. package/dist/serve/node.test.native.js +0 -72
  223. package/dist/serve/node.test.native.js.map +0 -1
  224. package/dist/types.mjs +0 -2
  225. package/dist/types.mjs.map +0 -1
  226. package/dist/types.native.js +0 -2
  227. package/dist/types.native.js.map +0 -1
  228. package/dist/user-interface/index.mjs +0 -312
  229. package/dist/user-interface/index.mjs.map +0 -1
  230. package/dist/user-interface/index.native.js +0 -349
  231. package/dist/user-interface/index.native.js.map +0 -1
  232. package/dist/utils/assert.mjs +0 -12
  233. package/dist/utils/assert.mjs.map +0 -1
  234. package/dist/utils/assert.native.js +0 -24
  235. package/dist/utils/assert.native.js.map +0 -1
  236. package/dist/utils/bindKeypressInput.mjs +0 -47
  237. package/dist/utils/bindKeypressInput.mjs.map +0 -1
  238. package/dist/utils/bindKeypressInput.native.js +0 -47
  239. package/dist/utils/bindKeypressInput.native.js.map +0 -1
  240. package/dist/utils/bindKeypressInput.test.mjs +0 -48
  241. package/dist/utils/bindKeypressInput.test.mjs.map +0 -1
  242. package/dist/utils/bindKeypressInput.test.native.js +0 -48
  243. package/dist/utils/bindKeypressInput.test.native.js.map +0 -1
  244. package/dist/utils/coerceToArray.mjs +0 -5
  245. package/dist/utils/coerceToArray.mjs.map +0 -1
  246. package/dist/utils/coerceToArray.native.js +0 -5
  247. package/dist/utils/coerceToArray.native.js.map +0 -1
  248. package/dist/utils/connectedNativeClients.mjs +0 -9
  249. package/dist/utils/connectedNativeClients.mjs.map +0 -1
  250. package/dist/utils/connectedNativeClients.native.js +0 -9
  251. package/dist/utils/connectedNativeClients.native.js.map +0 -1
  252. package/dist/utils/createNativeDevEngine.mjs +0 -875
  253. package/dist/utils/createNativeDevEngine.mjs.map +0 -1
  254. package/dist/utils/createNativeDevEngine.native.js +0 -932
  255. package/dist/utils/createNativeDevEngine.native.js.map +0 -1
  256. package/dist/utils/createNativeDevEngine.test.mjs +0 -93
  257. package/dist/utils/createNativeDevEngine.test.mjs.map +0 -1
  258. package/dist/utils/createNativeDevEngine.test.native.js +0 -106
  259. package/dist/utils/createNativeDevEngine.test.native.js.map +0 -1
  260. package/dist/utils/dispose.mjs +0 -9
  261. package/dist/utils/dispose.mjs.map +0 -1
  262. package/dist/utils/dispose.native.js +0 -11
  263. package/dist/utils/dispose.native.js.map +0 -1
  264. package/dist/utils/environmentUtils.mjs +0 -14
  265. package/dist/utils/environmentUtils.mjs.map +0 -1
  266. package/dist/utils/environmentUtils.native.js +0 -14
  267. package/dist/utils/environmentUtils.native.js.map +0 -1
  268. package/dist/utils/execSync.mjs +0 -9
  269. package/dist/utils/execSync.mjs.map +0 -1
  270. package/dist/utils/execSync.native.js +0 -9
  271. package/dist/utils/execSync.native.js.map +0 -1
  272. package/dist/utils/expoRun.mjs +0 -48
  273. package/dist/utils/expoRun.mjs.map +0 -1
  274. package/dist/utils/expoRun.native.js +0 -49
  275. package/dist/utils/expoRun.native.js.map +0 -1
  276. package/dist/utils/filterViteServerResolvedUrls.mjs +0 -29
  277. package/dist/utils/filterViteServerResolvedUrls.mjs.map +0 -1
  278. package/dist/utils/filterViteServerResolvedUrls.native.js +0 -70
  279. package/dist/utils/filterViteServerResolvedUrls.native.js.map +0 -1
  280. package/dist/utils/getBoundPort.mjs +0 -9
  281. package/dist/utils/getBoundPort.mjs.map +0 -1
  282. package/dist/utils/getBoundPort.native.js +0 -16
  283. package/dist/utils/getBoundPort.native.js.map +0 -1
  284. package/dist/utils/getBoundPort.test.mjs +0 -71
  285. package/dist/utils/getBoundPort.test.mjs.map +0 -1
  286. package/dist/utils/getBoundPort.test.native.js +0 -82
  287. package/dist/utils/getBoundPort.test.native.js.map +0 -1
  288. package/dist/utils/getCacheDir.mjs +0 -6
  289. package/dist/utils/getCacheDir.mjs.map +0 -1
  290. package/dist/utils/getCacheDir.native.js +0 -6
  291. package/dist/utils/getCacheDir.native.js.map +0 -1
  292. package/dist/utils/getServerEntry.mjs +0 -10
  293. package/dist/utils/getServerEntry.mjs.map +0 -1
  294. package/dist/utils/getServerEntry.native.js +0 -17
  295. package/dist/utils/getServerEntry.native.js.map +0 -1
  296. package/dist/utils/getVitePath.mjs +0 -49
  297. package/dist/utils/getVitePath.mjs.map +0 -1
  298. package/dist/utils/getVitePath.native.js +0 -48
  299. package/dist/utils/getVitePath.native.js.map +0 -1
  300. package/dist/utils/globDir.mjs +0 -18
  301. package/dist/utils/globDir.mjs.map +0 -1
  302. package/dist/utils/globDir.native.js +0 -21
  303. package/dist/utils/globDir.native.js.map +0 -1
  304. package/dist/utils/imageSizePatch.test.mjs +0 -29
  305. package/dist/utils/imageSizePatch.test.mjs.map +0 -1
  306. package/dist/utils/imageSizePatch.test.native.js +0 -30
  307. package/dist/utils/imageSizePatch.test.native.js.map +0 -1
  308. package/dist/utils/isWithin.mjs +0 -7
  309. package/dist/utils/isWithin.mjs.map +0 -1
  310. package/dist/utils/isWithin.native.js +0 -7
  311. package/dist/utils/isWithin.native.js.map +0 -1
  312. package/dist/utils/patches.mjs +0 -279
  313. package/dist/utils/patches.mjs.map +0 -1
  314. package/dist/utils/patches.native.js +0 -508
  315. package/dist/utils/patches.native.js.map +0 -1
  316. package/dist/utils/patches.test.mjs +0 -214
  317. package/dist/utils/patches.test.mjs.map +0 -1
  318. package/dist/utils/patches.test.native.js +0 -224
  319. package/dist/utils/patches.test.native.js.map +0 -1
  320. package/dist/utils/printServerUrls.mjs +0 -12
  321. package/dist/utils/printServerUrls.mjs.map +0 -1
  322. package/dist/utils/printServerUrls.native.js +0 -56
  323. package/dist/utils/printServerUrls.native.js.map +0 -1
  324. package/dist/utils/removeUndefined.mjs +0 -11
  325. package/dist/utils/removeUndefined.mjs.map +0 -1
  326. package/dist/utils/removeUndefined.native.js +0 -11
  327. package/dist/utils/removeUndefined.native.js.map +0 -1
  328. package/dist/utils/scanDepsToOptimize.mjs +0 -176
  329. package/dist/utils/scanDepsToOptimize.mjs.map +0 -1
  330. package/dist/utils/scanDepsToOptimize.native.js +0 -212
  331. package/dist/utils/scanDepsToOptimize.native.js.map +0 -1
  332. package/dist/utils/state.mjs +0 -28
  333. package/dist/utils/state.mjs.map +0 -1
  334. package/dist/utils/state.native.js +0 -28
  335. package/dist/utils/state.native.js.map +0 -1
  336. package/dist/utils/uniq.mjs +0 -5
  337. package/dist/utils/uniq.mjs.map +0 -1
  338. package/dist/utils/uniq.native.js +0 -5
  339. package/dist/utils/uniq.native.js.map +0 -1
  340. package/dist/utils/utils.mjs +0 -32
  341. package/dist/utils/utils.mjs.map +0 -1
  342. package/dist/utils/utils.native.js +0 -53
  343. package/dist/utils/utils.native.js.map +0 -1
  344. package/dist/vendor/debugger-app/index.mjs +0 -2
  345. package/dist/vendor/debugger-app/index.mjs.map +0 -1
  346. package/dist/vendor/debugger-app/index.native.js +0 -2
  347. package/dist/vendor/debugger-app/index.native.js.map +0 -1
  348. package/dist/vendor/debugger-app/src/debuggerWorker.mjs +0 -2
  349. package/dist/vendor/debugger-app/src/debuggerWorker.mjs.map +0 -1
  350. package/dist/vendor/debugger-app/src/debuggerWorker.native.js +0 -2
  351. package/dist/vendor/debugger-app/src/debuggerWorker.native.js.map +0 -1
  352. package/dist/vendor/debugger-app/src/index.css +0 -41
  353. package/dist/vendor/debugger-app/src/index.css.map +0 -6
  354. package/dist/vendor/debugger-app/src/index.mjs +0 -2
  355. package/dist/vendor/debugger-app/src/index.mjs.map +0 -1
  356. package/dist/vendor/debugger-app/src/index.native.js +0 -2
  357. package/dist/vendor/debugger-app/src/index.native.js.map +0 -1
  358. package/dist/vxrn-vite-plugin.mjs +0 -44
  359. package/dist/vxrn-vite-plugin.mjs.map +0 -1
  360. package/dist/vxrn-vite-plugin.native.js +0 -45
  361. package/dist/vxrn-vite-plugin.native.js.map +0 -1
  362. package/types/cli.d.ts.map +0 -1
  363. package/types/config/getAdditionalViteConfig.d.ts.map +0 -1
  364. package/types/config/getBaseViteConfigOnly.d.ts.map +0 -1
  365. package/types/config/getBaseViteConfigWithPlugins.d.ts.map +0 -1
  366. package/types/config/getBaseVitePlugins.d.ts.map +0 -1
  367. package/types/config/getNonCliModeOnlyVitePlugins.d.ts.map +0 -1
  368. package/types/config/getOptimizeDeps.d.ts.map +0 -1
  369. package/types/config/getOptimizeDeps.test.d.ts.map +0 -1
  370. package/types/config/getOptionsFilled.d.ts.map +0 -1
  371. package/types/config/getReactNativePlugins.d.ts.map +0 -1
  372. package/types/config/getServerOptionsFilled.d.ts.map +0 -1
  373. package/types/config/getServerOptionsFilled.test.d.ts.map +0 -1
  374. package/types/config/getViteServerConfig.d.ts.map +0 -1
  375. package/types/config/mergeUserConfig.d.ts.map +0 -1
  376. package/types/config/mergeUserConfig.test.d.ts.map +0 -1
  377. package/types/constants/defaults.d.ts.map +0 -1
  378. package/types/constants.d.ts.map +0 -1
  379. package/types/exports/build.d.ts.map +0 -1
  380. package/types/exports/clean.d.ts.map +0 -1
  381. package/types/exports/clean.test.d.ts.map +0 -1
  382. package/types/exports/createServer.d.ts.map +0 -1
  383. package/types/exports/dev.d.ts.map +0 -1
  384. package/types/exports/loadEnv.d.ts.map +0 -1
  385. package/types/exports/loadEnv.test.d.ts.map +0 -1
  386. package/types/exports/patch.d.ts.map +0 -1
  387. package/types/exports/prebuild.d.ts.map +0 -1
  388. package/types/exports/prebuildWithoutExpo.d.ts.map +0 -1
  389. package/types/exports/runAndroid.d.ts.map +0 -1
  390. package/types/exports/runIos.d.ts.map +0 -1
  391. package/types/exports/serve.d.ts.map +0 -1
  392. package/types/exports/serveStaticAssets.d.ts.map +0 -1
  393. package/types/index.d.ts.map +0 -1
  394. package/types/patches/builtInDepPatches.d.ts.map +0 -1
  395. package/types/plugins/applyBuiltInPatchesPlugin.d.ts.map +0 -1
  396. package/types/plugins/autoDepOptimizePlugin.d.ts.map +0 -1
  397. package/types/plugins/autoDepOptimizePlugin.test.d.ts.map +0 -1
  398. package/types/plugins/clientInjectPlugin.d.ts.map +0 -1
  399. package/types/plugins/defaultDepOptimizePlugin.d.ts.map +0 -1
  400. package/types/plugins/expoManifestRequestHandlerPlugin.d.ts.map +0 -1
  401. package/types/plugins/getResolvedConfigSubset.d.ts.map +0 -1
  402. package/types/plugins/reactNativeCommonJsPlugin.d.ts.map +0 -1
  403. package/types/plugins/reactNativeDevAssetPlugin.d.ts.map +0 -1
  404. package/types/plugins/reactNativeDevServer.d.ts.map +0 -1
  405. package/types/plugins/resolveIdScan.test.d.ts.map +0 -1
  406. package/types/plugins/rollupRemoveUnusedImports.d.ts.map +0 -1
  407. package/types/plugins/serverExtensions.test.d.ts.map +0 -1
  408. package/types/rn-commands/bundle/buildBundle.d.ts.map +0 -1
  409. package/types/runtime/hmr-client.d.ts.map +0 -1
  410. package/types/runtime/hmr-runtime.d.ts.map +0 -1
  411. package/types/runtime/hmr-types.d.ts.map +0 -1
  412. package/types/runtime/native-prelude.d.ts.map +0 -1
  413. package/types/runtime/react-refresh-utils.d.ts.map +0 -1
  414. package/types/serve/node.d.ts.map +0 -1
  415. package/types/serve/node.test.d.ts.map +0 -1
  416. package/types/types.d.ts.map +0 -1
  417. package/types/user-interface/index.d.ts.map +0 -1
  418. package/types/utils/assert.d.ts.map +0 -1
  419. package/types/utils/bindKeypressInput.d.ts.map +0 -1
  420. package/types/utils/bindKeypressInput.test.d.ts.map +0 -1
  421. package/types/utils/coerceToArray.d.ts.map +0 -1
  422. package/types/utils/connectedNativeClients.d.ts.map +0 -1
  423. package/types/utils/createNativeDevEngine.d.ts.map +0 -1
  424. package/types/utils/createNativeDevEngine.test.d.ts.map +0 -1
  425. package/types/utils/dispose.d.ts.map +0 -1
  426. package/types/utils/environmentUtils.d.ts.map +0 -1
  427. package/types/utils/execSync.d.ts.map +0 -1
  428. package/types/utils/expoRun.d.ts.map +0 -1
  429. package/types/utils/filterViteServerResolvedUrls.d.ts.map +0 -1
  430. package/types/utils/getBoundPort.d.ts.map +0 -1
  431. package/types/utils/getBoundPort.test.d.ts.map +0 -1
  432. package/types/utils/getCacheDir.d.ts.map +0 -1
  433. package/types/utils/getServerEntry.d.ts.map +0 -1
  434. package/types/utils/getVitePath.d.ts.map +0 -1
  435. package/types/utils/globDir.d.ts.map +0 -1
  436. package/types/utils/imageSizePatch.test.d.ts.map +0 -1
  437. package/types/utils/isWithin.d.ts.map +0 -1
  438. package/types/utils/patches.d.ts.map +0 -1
  439. package/types/utils/patches.test.d.ts.map +0 -1
  440. package/types/utils/printServerUrls.d.ts.map +0 -1
  441. package/types/utils/removeUndefined.d.ts.map +0 -1
  442. package/types/utils/scanDepsToOptimize.d.ts.map +0 -1
  443. package/types/utils/state.d.ts.map +0 -1
  444. package/types/utils/uniq.d.ts.map +0 -1
  445. package/types/utils/utils.d.ts.map +0 -1
  446. package/types/vxrn-vite-plugin.d.ts.map +0 -1
@@ -1,932 +0,0 @@
1
- import { basename, dirname, extname, join, relative, resolve } from "path";
2
- import { copyFileSync, existsSync, mkdirSync, readFileSync } from "fs";
3
- import { pathToFileURL } from "url";
4
- import { normalizePath } from "vite";
5
- import { DEFAULT_ASSET_EXTS } from "../constants/defaults.native.js";
6
- import { getNativePrelude } from "../runtime/native-prelude.native.js";
7
- function _instanceof(left, right) {
8
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);else return left instanceof right;
9
- }
10
- var FLOW_FILE_PATTERN = /node_modules[\\/](?:react-native|@react-native)[\\/].*\.js$/;
11
- var HERMES_CLASS_TRANSFORMS = ["transform-classes", "transform-class-properties", "transform-class-static-block", "transform-private-methods", "transform-private-property-in-object"];
12
- var HERMES_PROD_TRANSFORMS = ["transform-async-to-generator"];
13
- function getHermesSWCIncludes(dev) {
14
- return [...HERMES_CLASS_TRANSFORMS, ...(dev ? [] : HERMES_PROD_TRANSFORMS)];
15
- }
16
- function getResolveExtensions(platform) {
17
- var platformExts = platform === "ios" ? [".ios.tsx", ".ios.ts", ".ios.jsx", ".ios.js"] : [".android.tsx", ".android.ts", ".android.jsx", ".android.js"];
18
- var nativeExts = [".native.tsx", ".native.ts", ".native.jsx", ".native.js"];
19
- var defaultExts = [".tsx", ".ts", ".jsx", ".js", ".mjs", ".cjs", ".json"];
20
- return [...platformExts, ...nativeExts, ...defaultExts];
21
- }
22
- function getNativeResolveConfig(platform) {
23
- return {
24
- extensions: getResolveExtensions(platform),
25
- conditionNames: ["react-native", "import", "require", "default"],
26
- mainFields: ["react-native", "module", "main"]
27
- };
28
- }
29
- function getNativeTransformConfig(platform, dev, root) {
30
- var entryConfig = globalThis.__vxrnNativeEntryConfig || {};
31
- var setupFileDefines = function () {
32
- var sf = entryConfig.setupFile;
33
- if (!sf) return {};
34
- var files = typeof sf === "string" ? {
35
- client: sf,
36
- server: sf,
37
- ios: sf,
38
- android: sf
39
- } : "native" in sf ? {
40
- client: sf.client,
41
- server: sf.server,
42
- ios: sf.native,
43
- android: sf.native
44
- } : sf;
45
- return {
46
- ...(files.client && {
47
- "process.env.ONE_SETUP_FILE_CLIENT": JSON.stringify(files.client)
48
- }),
49
- ...(files.server && {
50
- "process.env.ONE_SETUP_FILE_SERVER": JSON.stringify(files.server)
51
- }),
52
- ...(files.ios && {
53
- "process.env.ONE_SETUP_FILE_IOS": JSON.stringify(files.ios)
54
- }),
55
- ...(files.android && {
56
- "process.env.ONE_SETUP_FILE_ANDROID": JSON.stringify(files.android)
57
- })
58
- };
59
- }();
60
- var envDefines = function () {
61
- var defines = {};
62
- try {
63
- var mode2 = dev ? "development" : "production";
64
- for (var _i = 0, _iter = [".env", ".env.local", `.env.${mode2}`, `.env.${mode2}.local`]; _i < _iter.length; _i++) {
65
- var envFile = _iter[_i];
66
- var envPath = join(root, envFile);
67
- if (!existsSync(envPath)) continue;
68
- var content = readFileSync(envPath, "utf8");
69
- var _iteratorNormalCompletion2 = true,
70
- _didIteratorError2 = false,
71
- _iteratorError2 = void 0;
72
- try {
73
- for (var _iterator2 = content.split("\n")[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
74
- var match2 = _step2.value.match(/^\s*(VITE_\w+)\s*=\s*(.*)$/);
75
- if (match2) {
76
- var [, key2, rawVal] = match2;
77
- var val2 = rawVal.replace(/^['"]|['"]$/g, "").trim();
78
- defines[`import.meta.env.${key2}`] = JSON.stringify(val2);
79
- defines[`process.env.${key2}`] = JSON.stringify(val2);
80
- }
81
- }
82
- } catch (err) {
83
- _didIteratorError2 = true;
84
- _iteratorError2 = err;
85
- } finally {
86
- try {
87
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
88
- } finally {
89
- if (_didIteratorError2) throw _iteratorError2;
90
- }
91
- }
92
- }
93
- } catch (unused) {}
94
- return defines;
95
- }();
96
- var mode = dev ? "development" : "production";
97
- var envObject = {
98
- MODE: mode,
99
- DEV: dev,
100
- PROD: !dev,
101
- SSR: false,
102
- VITE_ENVIRONMENT: platform,
103
- VITE_NATIVE: "1",
104
- EXPO_OS: platform,
105
- TAMAGUI_TARGET: "native",
106
- TAMAGUI_ENVIRONMENT: platform
107
- };
108
- var _iteratorNormalCompletion = true,
109
- _didIteratorError = false,
110
- _iteratorError = void 0;
111
- try {
112
- for (var _iterator = Object.entries(envDefines)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
113
- var [key, val] = _step.value;
114
- var match = key.match(/^import\.meta\.env\.(.+)$/);
115
- if (match) try {
116
- envObject[match[1]] = JSON.parse(val);
117
- } catch (unused) {
118
- envObject[match[1]] = val;
119
- }
120
- }
121
- } catch (err) {
122
- _didIteratorError = true;
123
- _iteratorError = err;
124
- } finally {
125
- try {
126
- if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
127
- } finally {
128
- if (_didIteratorError) throw _iteratorError;
129
- }
130
- }
131
- return {
132
- jsx: {
133
- runtime: "classic"
134
- },
135
- define: {
136
- "process.env.NODE_ENV": JSON.stringify(mode),
137
- "process.env.VXRN_REACT_19": "false",
138
- "process.env.VITE_ENVIRONMENT": JSON.stringify(platform),
139
- "process.env.VITE_NATIVE": "\"1\"",
140
- "process.env.EXPO_OS": JSON.stringify(platform),
141
- "process.env.TAMAGUI_TARGET": "\"native\"",
142
- "process.env.TAMAGUI_ENVIRONMENT": JSON.stringify(platform),
143
- __DEV__: dev ? "true" : "false",
144
- "import.meta.env": JSON.stringify(envObject),
145
- "import.meta.env.MODE": JSON.stringify(mode),
146
- "import.meta.env.DEV": dev ? "true" : "false",
147
- "import.meta.env.PROD": dev ? "false" : "true",
148
- "import.meta.env.SSR": "false",
149
- "import.meta.env.VITE_ENVIRONMENT": JSON.stringify(platform),
150
- "import.meta.env.VITE_NATIVE": "\"1\"",
151
- "import.meta.env.EXPO_OS": JSON.stringify(platform),
152
- "import.meta.env.TAMAGUI_TARGET": "\"native\"",
153
- "import.meta.env.TAMAGUI_ENVIRONMENT": JSON.stringify(platform),
154
- ...envDefines,
155
- ...setupFileDefines
156
- },
157
- inject: {
158
- React: "react"
159
- }
160
- };
161
- }
162
- function getNativePlugins(root, platform, viteImportGlobPlugin, dev, assetsDest) {
163
- return [...(globalThis.__vxrnAddNativePlugins || []), serverFileExclusionPlugin(), environmentGuardPlugin(), hmrClientNoopPlugin(), cssStubPlugin(), viteImportGlobPlugin({
164
- root
165
- }), vxrnCompilerPlugin(platform, dev), flowStripPlugin(), nativeAnimatedGuardPlugin(), assetPlugin({
166
- root,
167
- platform,
168
- assetsDest
169
- }), hermesCompatSWCPlugin(dev)];
170
- }
171
- function getNativeOutputOptions(prelude, sourcemap) {
172
- return {
173
- format: "esm",
174
- sourcemap,
175
- intro: prelude,
176
- codeSplitting: false,
177
- strictExecutionOrder: true
178
- };
179
- }
180
- function postProcessNativeBundle(code) {
181
- code = code.replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm, "");
182
- code = code.replace(/^\s*export\s+default\s+([^;\n]+);?\s*$/gm, "$1;");
183
- code = code.replace(/^if \(import\.meta\.hot\).*$/gm, "");
184
- var idx = code.indexOf("NativeAnimatedModule_default ?? NativeAnimatedTurboModule_default;");
185
- if (idx !== -1) {
186
- var beforeMarker = code.lastIndexOf("NativeAnimatedModule = ", idx);
187
- if (beforeMarker !== -1) {
188
- var lineStart = code.lastIndexOf("\n", beforeMarker);
189
- var snippet = code.slice(lineStart + 1, beforeMarker + 50);
190
- if (snippet.includes("(function()") || snippet.includes("new Proxy")) {
191
- var afterMarker = code.indexOf("})();", idx);
192
- if (afterMarker !== -1) {
193
- var end = afterMarker + 5;
194
- code = code.slice(0, beforeMarker) + "NativeAnimatedModule = NativeAnimatedModule_default ?? NativeAnimatedTurboModule_default;" + code.slice(end);
195
- }
196
- }
197
- }
198
- }
199
- return code;
200
- }
201
- function wrapNativeBundleModuleScope(code) {
202
- var idx = code.indexOf("//#region \\0rolldown/runtime.js");
203
- if (idx === -1) return code;
204
- return code.slice(0, idx) + ";(function() {\n" + code.slice(idx) + "\n})();\n";
205
- }
206
- async function downlevelClassFieldsInBundle(code) {
207
- var startMarker = "//#region \\0rolldown/runtime.js";
208
- var endMarker = "//#endregion";
209
- var startIdx = code.indexOf(startMarker);
210
- if (startIdx === -1) return code;
211
- var endIdx = code.indexOf(endMarker, startIdx);
212
- if (endIdx === -1) return code;
213
- var runtimeEnd = endIdx + endMarker.length;
214
- var runtimeSection = code.slice(startIdx, runtimeEnd);
215
- try {
216
- var result = await (await import("@swc/core")).transform(runtimeSection, {
217
- filename: "rolldown-runtime.js",
218
- configFile: false,
219
- swcrc: false,
220
- sourceMaps: false,
221
- inputSourceMap: false,
222
- isModule: false,
223
- env: {
224
- targets: {
225
- node: 9999
226
- },
227
- include: [...HERMES_CLASS_TRANSFORMS]
228
- },
229
- jsc: {
230
- parser: {
231
- syntax: "ecmascript"
232
- },
233
- transform: {
234
- react: {
235
- runtime: "preserve"
236
- }
237
- },
238
- externalHelpers: false,
239
- assumptions: {
240
- setPublicClassFields: true,
241
- privateFieldsAsProperties: true
242
- }
243
- }
244
- });
245
- return code.slice(0, startIdx) + result.code + code.slice(runtimeEnd);
246
- } catch (err) {
247
- console.warn("[vxrn] downlevelClassFieldsInBundle failed, returning original:", err);
248
- return code;
249
- }
250
- }
251
- async function createNativeDevEngine(options) {
252
- var {
253
- root,
254
- port,
255
- host = "localhost",
256
- platform,
257
- serverUrl,
258
- plugins: userPlugins = [],
259
- onHmrUpdate
260
- } = options;
261
- var {
262
- dev,
263
- viteImportGlobPlugin
264
- } = await import("rolldown/experimental");
265
- var hmrRuntimeSource = getHmrRuntimeSource();
266
- var prelude = getNativePrelude({
267
- dev: true,
268
- platform,
269
- serverUrl: serverUrl || `http://${host}:${port}`
270
- });
271
- var currentBundle = null;
272
- var bundleResolve = null;
273
- var bundlePromise = null;
274
- var resolvedHost = host === "0.0.0.0" ? "localhost" : host;
275
- var engine = await dev({
276
- input: VIRTUAL_NATIVE_ENTRY,
277
- cwd: root,
278
- platform: "neutral",
279
- resolve: getNativeResolveConfig(platform),
280
- transform: getNativeTransformConfig(platform, true, root),
281
- experimental: {
282
- devMode: {
283
- implement: hmrRuntimeSource,
284
- host,
285
- port
286
- },
287
- incrementalBuild: true,
288
- lazyBarrel: true
289
- },
290
- treeshake: false,
291
- shimMissingExports: true,
292
- moduleTypes: {
293
- ".js": "jsx"
294
- },
295
- plugins: [nativeVirtualEntryPlugin(root, {
296
- dev: true
297
- }), ...getNativePlugins(root, platform, viteImportGlobPlugin, true), ...userPlugins]
298
- }, {
299
- ...getNativeOutputOptions(prelude, false),
300
- outro: `
301
- try {
302
- var __WS = (init_WebSocket(), __toCommonJS(WebSocket_exports)).default;
303
- var __hmrUrl = 'ws://${resolvedHost}:${port}/hot';
304
- var __hmrWS = new __WS(__hmrUrl);
305
- __hmrWS.onmessage = function(event) {
306
- try {
307
- var msg = JSON.parse(event.data);
308
- var g = typeof global !== 'undefined' ? global : globalThis;
309
- if (msg.type === 'hmr:update' && msg.code) {
310
- if (g.globalEvalWithSourceUrl) g.globalEvalWithSourceUrl(msg.code);
311
- else (0, eval)(msg.code);
312
- setTimeout(function() {
313
- try { if (g.__ReactRefresh) g.__ReactRefresh.performReactRefresh(); } catch(e) {}
314
- }, 50);
315
- } else if (msg.type === 'hmr:reload') {
316
- var ds = g.__turboModuleProxy ? g.__turboModuleProxy('DevSettings') : null;
317
- if (ds && ds.reload) ds.reload();
318
- }
319
- } catch(e) { console.error('[vxrn] HMR eval error:', e); }
320
- };
321
- __hmrWS.onopen = function() {
322
- if (typeof __rolldown_runtime__ !== 'undefined' && __rolldown_runtime__.setup) {
323
- __rolldown_runtime__.setup(__hmrWS, __hmrUrl.replace('ws://', 'http://'));
324
- }
325
- };
326
- __hmrWS.onerror = function(e) { console.warn('[vxrn] HMR connection error:', e.message || e); };
327
- } catch(e) {}
328
- `
329
- }, {
330
- onOutput: async function (result) {
331
- if (_instanceof(result, Error)) {
332
- console.error("[vxrn] native bundle error:", result.message);
333
- return;
334
- }
335
- var chunk = result.output.find(function (o) {
336
- return o.type === "chunk" && o.isEntry;
337
- });
338
- if (chunk && "code" in chunk) {
339
- var code = postProcessNativeBundle(chunk.code);
340
- code = await downlevelClassFieldsInBundle(code);
341
- code = wrapNativeBundleModuleScope(code);
342
- currentBundle = {
343
- code
344
- };
345
- console.info(`[vxrn] native bundle ready (${Math.round(code.length / 1024)}KB)`);
346
- if (bundleResolve) {
347
- bundleResolve(currentBundle);
348
- bundleResolve = null;
349
- bundlePromise = null;
350
- }
351
- }
352
- },
353
- onHmrUpdates: async function (result) {
354
- if (_instanceof(result, Error)) {
355
- console.error("[vxrn] HMR error:", result.message);
356
- onHmrUpdate === null || onHmrUpdate === void 0 || onHmrUpdate({
357
- type: "hmr:error"
358
- });
359
- return;
360
- }
361
- var updates = result.updates || [];
362
- var _iteratorNormalCompletion = true,
363
- _didIteratorError = false,
364
- _iteratorError = void 0;
365
- try {
366
- for (var _iterator = updates[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
367
- var item = _step.value;
368
- var update = item.update || item;
369
- if (update.type === "Patch" && update.code) onHmrUpdate === null || onHmrUpdate === void 0 || onHmrUpdate({
370
- type: "hmr:update",
371
- code: update.code
372
- });else if (update.type === "FullReload") onHmrUpdate === null || onHmrUpdate === void 0 || onHmrUpdate({
373
- type: "hmr:reload"
374
- });
375
- }
376
- } catch (err) {
377
- _didIteratorError = true;
378
- _iteratorError = err;
379
- } finally {
380
- try {
381
- if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
382
- } finally {
383
- if (_didIteratorError) throw _iteratorError;
384
- }
385
- }
386
- if (updates.length === 0) onHmrUpdate === null || onHmrUpdate === void 0 || onHmrUpdate({
387
- type: "hmr:reload"
388
- });
389
- },
390
- rebuildStrategy: "never",
391
- watch: {}
392
- });
393
- await engine.run();
394
- return {
395
- engine,
396
- async getBundle() {
397
- if (currentBundle) return currentBundle;
398
- if (!bundlePromise) {
399
- var timeoutId;
400
- bundlePromise = new Promise(function (resolve2, reject) {
401
- bundleResolve = function (value) {
402
- clearTimeout(timeoutId);
403
- resolve2(value);
404
- };
405
- timeoutId = setTimeout(function () {
406
- return reject(/* @__PURE__ */new Error("[vxrn] bundle build timed out after 120s"));
407
- }, 12e4);
408
- });
409
- }
410
- await engine.ensureLatestBuildOutput();
411
- if (currentBundle) return currentBundle;
412
- return bundlePromise;
413
- },
414
- async close() {
415
- await engine.close();
416
- }
417
- };
418
- }
419
- async function buildNativeBundle(options) {
420
- var _chunk_map;
421
- var {
422
- root,
423
- platform,
424
- dev = false,
425
- serverUrl,
426
- entryFile,
427
- assetsDest,
428
- plugins: userPlugins = [],
429
- sourcemap = false
430
- } = options;
431
- var {
432
- build
433
- } = await import("rolldown");
434
- var {
435
- viteImportGlobPlugin
436
- } = await import("rolldown/experimental");
437
- var prelude = getNativePrelude({
438
- dev,
439
- platform,
440
- serverUrl
441
- });
442
- var chunk = (await build({
443
- input: entryFile ? normalizePath(resolve(root, entryFile)) : VIRTUAL_NATIVE_ENTRY,
444
- cwd: root,
445
- platform: "neutral",
446
- resolve: getNativeResolveConfig(platform),
447
- transform: getNativeTransformConfig(platform, dev, root),
448
- treeshake: !dev,
449
- experimental: {
450
- lazyBarrel: false
451
- },
452
- shimMissingExports: true,
453
- moduleTypes: {
454
- ".js": "jsx"
455
- },
456
- plugins: [...(entryFile ? [] : [nativeVirtualEntryPlugin(root, {
457
- dev
458
- })]), ...getNativePlugins(root, platform, viteImportGlobPlugin, dev, assetsDest), ...userPlugins],
459
- output: getNativeOutputOptions(prelude, sourcemap)
460
- })).output.find(function (o) {
461
- return o.type === "chunk" && o.isEntry;
462
- });
463
- if (!chunk || !("code" in chunk)) throw new Error("[vxrn] production build produced no output");
464
- var code = postProcessNativeBundle(chunk.code);
465
- code = await downlevelClassFieldsInBundle(code);
466
- return {
467
- code,
468
- map: sourcemap ? (_chunk_map = chunk.map) === null || _chunk_map === void 0 ? void 0 : _chunk_map.toString() : void 0
469
- };
470
- }
471
- var VIRTUAL_NATIVE_ENTRY = "virtual:native-entry";
472
- function nativeVirtualEntryPlugin(root, opts) {
473
- var isDev = (opts === null || opts === void 0 ? void 0 : opts.dev) !== false;
474
- var resolvedId = normalizePath(resolve(root, "__virtual-native-entry.tsx"));
475
- var entryConfig = globalThis.__vxrnNativeEntryConfig || {};
476
- var routerRoot = entryConfig.routerRoot || "app";
477
- var flags = entryConfig.flags || {};
478
- var linking = entryConfig.linking;
479
- var setupFileImport = function () {
480
- var sf = entryConfig.setupFile;
481
- if (!sf) return "";
482
- var file = typeof sf === "string" ? sf : "native" in sf ? sf.native : sf.ios;
483
- if (!file) return "";
484
- var resolved = pathToFileURL(resolve(root, file)).href;
485
- return `import ${JSON.stringify(resolved)};`;
486
- }();
487
- var routeGlobs = [`./${routerRoot}/**/*.tsx`, `./${routerRoot}/**/*.ts`, `!./${routerRoot}/**/*+api.*`, `!./${routerRoot}/**/*.test.*`, `!./${routerRoot}/**/*.d.ts`, `!./${routerRoot}/**/*.server.*`, `!./${routerRoot}/**/_middleware.*`, `!./${routerRoot}/**/*.web.*`, ...(entryConfig.ignoredRouteFiles || []).map(function (pattern) {
488
- return `!./${routerRoot}/${pattern}`;
489
- })];
490
- var entryCode = `
491
- ${isDev ? `
492
- // react-refresh/runtime MUST initialize before React loads
493
- import RefreshRuntime from 'react-refresh/runtime';
494
- RefreshRuntime.injectIntoGlobalHook(globalThis);
495
- globalThis.__ReactRefresh = RefreshRuntime;
496
- globalThis.$RefreshReg$ = function(type, id) {
497
- RefreshRuntime.register(type, id);
498
- };
499
- globalThis.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform;
500
- ` : ""}
501
- import * as ReactNativeInitializeCore from 'react-native/Libraries/Core/InitializeCore';
502
- import NativeWebSocket from 'react-native/Libraries/WebSocket/WebSocket';
503
- ${setupFileImport}
504
- import { createApp } from 'one';
505
-
506
- void ReactNativeInitializeCore;
507
- globalThis.WebSocket = NativeWebSocket;
508
-
509
- var _routes = import.meta.glob(${JSON.stringify(routeGlobs)}, { exhaustive: true });
510
- // fix route keys: One expects '/${routerRoot}/...' prefix but import.meta.glob returns './${routerRoot}/...'
511
- var routes = {};
512
- Object.keys(_routes).forEach(function(key) {
513
- var normalizedKey = key.replace(/^\\.\\//, '');
514
- routes['/' + normalizedKey] = _routes[key];
515
- });
516
-
517
- createApp({
518
- routes: routes,
519
- routerRoot: ${JSON.stringify(routerRoot)},
520
- flags: ${JSON.stringify(flags)},
521
- linking: ${JSON.stringify(linking)},
522
- });
523
- `;
524
- return {
525
- name: "vxrn:native-virtual-entry",
526
- resolveId(id) {
527
- if (id === VIRTUAL_NATIVE_ENTRY) return resolvedId;
528
- },
529
- load(id) {
530
- if (id === resolvedId) return entryCode;
531
- }
532
- };
533
- }
534
- function nativeAnimatedGuardPlugin() {
535
- return {
536
- name: "vxrn:native-animated-guard",
537
- transform(code, id) {
538
- if (!id.includes("animated/NativeAnimatedHelper")) return;
539
- var target = "const method = nullthrows(NativeAnimatedModule)[methodName];";
540
- if (!code.includes(target)) return;
541
- return {
542
- code: code.replace(target, `const method = nullthrows(NativeAnimatedModule)[methodName];
543
- if (typeof method !== 'function') return;`)
544
- };
545
- }
546
- };
547
- }
548
- function serverFileExclusionPlugin() {
549
- return {
550
- name: "vxrn:server-file-exclusion",
551
- load(id) {
552
- if (/\.server\.\w+$/.test(id)) return {
553
- code: "export default undefined;",
554
- moduleType: "js"
555
- };
556
- if (/[\\/]_middleware\.\w+$/.test(id)) return {
557
- code: "export default undefined;",
558
- moduleType: "js"
559
- };
560
- }
561
- };
562
- }
563
- function environmentGuardPlugin() {
564
- var THROWING = ["server-only", "client-only", "web-only"];
565
- var NOOP = ["native-only"];
566
- return {
567
- name: "vxrn:environment-guard",
568
- resolveId(source) {
569
- if (THROWING.includes(source)) return {
570
- id: `\0env-guard-throw:${source}`,
571
- external: false
572
- };
573
- if (NOOP.includes(source)) return {
574
- id: `\0env-guard-noop:${source}`,
575
- external: false
576
- };
577
- },
578
- load(id) {
579
- if (id.startsWith("\0env-guard-throw:")) return {
580
- code: `throw new Error("Cannot import '${id.slice(17)}' in a native bundle.");`,
581
- moduleType: "js"
582
- };
583
- if (id.startsWith("\0env-guard-noop:")) return {
584
- code: "",
585
- moduleType: "js"
586
- };
587
- }
588
- };
589
- }
590
- function hmrClientNoopPlugin() {
591
- var RN_HMR_CLIENT_RE = /(^|[\\/])Utilities[\\/]HMRClient(\.[cm]?[jt]sx?)?$/;
592
- return {
593
- name: "vxrn:hmr-client-noop",
594
- resolveId(source, importer) {
595
- if ((source.startsWith("react-native/") || importer != null && /(^|[\\/])react-native[\\/]/.test(importer)) && RN_HMR_CLIENT_RE.test(source)) return {
596
- id: "\0vxrn-hmr-client-noop",
597
- external: false
598
- };
599
- },
600
- load(id) {
601
- if (id === "\0vxrn-hmr-client-noop") return {
602
- code: `const HMRClient = { setup() {}, enable() {}, disable() {}, registerBundle() {}, log() {}, isEnabled() { return false } }
603
- export default HMRClient`,
604
- moduleType: "js"
605
- };
606
- }
607
- };
608
- }
609
- function cssStubPlugin() {
610
- return {
611
- name: "vxrn:css-stub",
612
- load: {
613
- handler(id) {
614
- if (id.endsWith(".css")) return {
615
- code: "",
616
- moduleType: "js"
617
- };
618
- }
619
- }
620
- };
621
- }
622
- function vxrnCompilerPlugin(platform, dev) {
623
- var compiler = null;
624
- var isRefreshCandidate = function (id) {
625
- return dev && !id.includes("node_modules") && !id.includes("__virtual-native-entry") && /\.[tj]sx?$/.test(id);
626
- };
627
- return {
628
- name: "vxrn:compiler",
629
- async transform(code, id) {
630
- if (!/\.[cm]?[jt]sx?$/.test(id)) return;
631
- if (id.includes("\0") || id.includes("virtual:")) return;
632
- var needsRefresh = isRefreshCandidate(id);
633
- try {
634
- if (!compiler) compiler = await import("@vxrn/compiler");
635
- var props = {
636
- id,
637
- code,
638
- development: dev,
639
- environment: platform,
640
- reactForRNVersion: "19"
641
- };
642
- var babelOptions = compiler.getBabelOptions(props);
643
- if (needsRefresh) {
644
- var existingPlugins = (babelOptions === null || babelOptions === void 0 ? void 0 : babelOptions.plugins) || [];
645
- babelOptions = {
646
- ...babelOptions,
647
- plugins: [...existingPlugins, ["react-refresh/babel", {
648
- skipEnvCheck: true,
649
- refreshReg: "__vxrnRefreshReg",
650
- refreshSig: "__vxrnRefreshSig"
651
- }]]
652
- };
653
- }
654
- if (!babelOptions) return;
655
- var result = await compiler.transformBabel(id, code, babelOptions);
656
- if (result === null || result === void 0 ? void 0 : result.code) {
657
- var out = result.code;
658
- if (needsRefresh) out = `
659
- var __prevRefreshReg = globalThis.$RefreshReg$;
660
- var __prevRefreshSig = globalThis.$RefreshSig$;
661
- if (globalThis.__ReactRefresh) {
662
- globalThis.$RefreshReg$ = function(type, id) {
663
- globalThis.__ReactRefresh.register(type, "${id.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}" + " " + id);
664
- };
665
- globalThis.$RefreshSig$ = globalThis.__ReactRefresh.createSignatureFunctionForTransform;
666
- }
667
- // keep registration calls local so rolldown retains them in the initial bundle.
668
- var __vxrnRefreshReg = globalThis.$RefreshReg$;
669
- var __vxrnRefreshSig = globalThis.$RefreshSig$;
670
-
671
- ${out}
672
-
673
- globalThis.$RefreshReg$ = __prevRefreshReg;
674
- globalThis.$RefreshSig$ = __prevRefreshSig;
675
- if (import.meta.hot) {
676
- import.meta.hot.accept(function() {
677
- if (globalThis.__ReactRefresh) {
678
- setTimeout(function() { globalThis.__ReactRefresh.performReactRefresh(); }, 30);
679
- }
680
- });
681
- }
682
- `;
683
- return {
684
- code: out
685
- };
686
- }
687
- } catch (err) {
688
- if (dev) console.warn(`[vxrn:compiler] ${id}: ${err.message || err}`);
689
- if (needsRefresh) return {
690
- code: code + `
691
- if (import.meta.hot) { import.meta.hot.accept(); }
692
- `
693
- };
694
- }
695
- }
696
- };
697
- }
698
- function flowStripPlugin() {
699
- return {
700
- name: "vxrn:flow-strip",
701
- transform: {
702
- async handler(code, id) {
703
- if (!FLOW_FILE_PATTERN.test(id)) return;
704
- try {
705
- var result = await (await import("fast-flow-transform")).default({
706
- filename: id,
707
- source: code,
708
- sourcemap: true,
709
- dialect: "flow",
710
- format: "pretty"
711
- });
712
- return {
713
- code: result.code,
714
- map: result.map
715
- };
716
- } catch (err) {
717
- console.warn(`[vxrn:flow-strip] ${id}: ${err.message}`);
718
- }
719
- }
720
- }
721
- };
722
- }
723
- function assetPlugin(opts) {
724
- var assetRegex = new RegExp(`\\.(?:${DEFAULT_ASSET_EXTS.join("|")})$`);
725
- return {
726
- name: "vxrn:asset",
727
- load: {
728
- async handler(id) {
729
- if (!assetRegex.test(id)) return;
730
- var ext = extname(id).slice(1);
731
- var name = basename(id, `.${ext}`);
732
- var dir = dirname(id);
733
- var relativePath = relative(opts.root, id);
734
- var assetData = {
735
- __packager_asset: true,
736
- name,
737
- type: ext,
738
- scales: [1],
739
- httpServerLocation: "/assets/" + dirname(relativePath).replace(/\\/g, "/"),
740
- fileSystemLocation: dir,
741
- hash: "",
742
- width: void 0,
743
- height: void 0
744
- };
745
- if (["png", "jpg", "jpeg", "gif", "webp", "bmp"].includes(ext)) try {
746
- var {
747
- imageSize
748
- } = await import("image-size");
749
- var dims = imageSize(id);
750
- assetData.width = dims.width;
751
- assetData.height = dims.height;
752
- } catch (unused) {}
753
- if (opts.assetsDest) {
754
- var relativeAssetDir = dirname(relativePath).replace(/\\/g, "/");
755
- var assetDestDir = join(opts.assetsDest, "assets", relativeAssetDir);
756
- mkdirSync(assetDestDir, {
757
- recursive: true
758
- });
759
- copyFileSync(id, join(assetDestDir, `${name}.${ext}`));
760
- }
761
- return {
762
- code: `module.exports = require('react-native/Libraries/Image/AssetRegistry').registerAsset(${JSON.stringify(assetData)});`,
763
- moduleType: "js"
764
- };
765
- }
766
- }
767
- };
768
- }
769
- function hermesCompatSWCPlugin(dev) {
770
- var swc = null;
771
- return {
772
- name: "vxrn:hermes-compat",
773
- async transform(code, id) {
774
- if (!/\.[cm]?[jt]sx?$/.test(id)) return;
775
- if (id.includes("\0") || id.includes("virtual:")) return;
776
- var hasClass = code.includes("class ") || code.includes("class{");
777
- var hasAsync = !dev && code.includes("async ");
778
- if (!hasClass && !hasAsync) return;
779
- if (code.length > 5e5) return;
780
- try {
781
- if (!swc) swc = await import("@swc/core");
782
- var envIncludes = getHermesSWCIncludes(dev);
783
- return {
784
- code: (await swc.transform(code, {
785
- filename: id,
786
- configFile: false,
787
- swcrc: false,
788
- sourceMaps: false,
789
- inputSourceMap: false,
790
- env: {
791
- targets: {
792
- node: 9999
793
- },
794
- include: envIncludes
795
- },
796
- jsc: {
797
- parser: {
798
- syntax: "typescript",
799
- tsx: true
800
- },
801
- transform: {
802
- react: {
803
- runtime: "preserve"
804
- }
805
- },
806
- externalHelpers: false,
807
- assumptions: {
808
- setPublicClassFields: true,
809
- privateFieldsAsProperties: true
810
- }
811
- },
812
- isModule: !id.endsWith(".cjs")
813
- })).code
814
- };
815
- } catch (err) {}
816
- }
817
- };
818
- }
819
- function getHmrRuntimeSource() {
820
- return `
821
- // vxrn HMR runtime for rolldown devMode
822
- var BaseDevRuntime = DevRuntime;
823
-
824
- class ReactNativeDevRuntime extends BaseDevRuntime {
825
- constructor() {
826
- var _shared = { _socket: null, _queue: [] };
827
- var clientId = 'rn-' + Date.now() + '-' + Math.random().toString(36).slice(2);
828
- super({ send: function(msg) {
829
- var s = JSON.stringify(msg);
830
- if (_shared._socket && _shared._socket.readyState === 1) { _shared._socket.send(s); }
831
- else { _shared._queue.push(s); }
832
- }}, clientId);
833
- this._shared = _shared;
834
- this._socket = null;
835
- this._queue = [];
836
- this.moduleHotContexts = {};
837
- }
838
-
839
- createModuleHotContext(moduleId) {
840
- var ctx = {
841
- acceptCallbacks: [],
842
- accept: function(cb) {
843
- if (cb) ctx.acceptCallbacks.push({ deps: [moduleId], fn: cb });
844
- },
845
- invalidate: function() {},
846
- on: function() {},
847
- off: function() {},
848
- send: function() {},
849
- get refresh() { return globalThis.__ReactRefresh; },
850
- get refreshUtils() {
851
- return {
852
- isReactRefreshBoundary: function(exports) {
853
- if (!globalThis.__ReactRefresh) return false;
854
- if (globalThis.__ReactRefresh.isLikelyComponentType(exports)) return true;
855
- if (!exports || typeof exports !== 'object') return false;
856
- var hasExports = false, allComponents = true;
857
- for (var key in exports) {
858
- hasExports = true;
859
- if (key === '__esModule') continue;
860
- if (!globalThis.__ReactRefresh.isLikelyComponentType(exports[key])) allComponents = false;
861
- }
862
- return hasExports && allComponents;
863
- },
864
- enqueueUpdate: function() {
865
- if (globalThis.__ReactRefresh) {
866
- setTimeout(function() { globalThis.__ReactRefresh.performReactRefresh(); }, 50);
867
- }
868
- }
869
- };
870
- }
871
- };
872
- this.moduleHotContexts[moduleId] = ctx;
873
- return ctx;
874
- }
875
-
876
- applyUpdates(boundaries) {
877
- for (var i = 0; i < boundaries.length; i++) {
878
- var moduleId = boundaries[i][0];
879
- var ctx = this.moduleHotContexts[moduleId];
880
- if (ctx && ctx.acceptCallbacks) {
881
- for (var j = 0; j < ctx.acceptCallbacks.length; j++) {
882
- ctx.acceptCallbacks[j].fn(this.modules[moduleId].exports);
883
- }
884
- }
885
- // surface each committed module id to the framework hot-update hook (if one
886
- // is registered). RN's React Refresh can't repaint frameworks that re-wrap
887
- // route components away from the edited module's Refresh family (e.g. One),
888
- // and the web route-update event has no equivalent on the native /hot
889
- // socket, so this generic vxrn global is the bridge.
890
- try {
891
- if (globalThis.__VXRN_ON_MODULE_UPDATED__ && moduleId) globalThis.__VXRN_ON_MODULE_UPDATED__(moduleId);
892
- } catch (error) {
893
- console.error('[vxrn HMR]: module update hook failed', error);
894
- }
895
- }
896
- }
897
-
898
- setup(socket, origin) {
899
- if (this._socket) return;
900
- this._socket = socket;
901
- // also set the shared messenger socket so queued messages can flush
902
- if (this._shared) this._shared._socket = socket;
903
-
904
- var flushQueues = function() {
905
- // flush messenger queue
906
- if (this._shared && this._shared._queue.length) {
907
- for (var i = 0; i < this._shared._queue.length; i++) socket.send(this._shared._queue[i]);
908
- this._shared._queue = [];
909
- }
910
- // flush instance queue
911
- for (var i = 0; i < this._queue.length; i++) socket.send(this._queue[i]);
912
- this._queue = [];
913
- }.bind(this);
914
-
915
- if (socket.readyState === 1) {
916
- flushQueues();
917
- } else {
918
- socket.addEventListener('open', function() {
919
- flushQueues();
920
- }, { once: true });
921
- }
922
-
923
- // HMR message handling is done by the outro WebSocket handler
924
- // the runtime's setup() only needs to flush queued messages
925
- }
926
- }
927
-
928
- globalThis.__rolldown_runtime__ = new ReactNativeDevRuntime();
929
- `;
930
- }
931
- export { buildNativeBundle, createNativeDevEngine, getHermesSWCIncludes, getNativeTransformConfig, hmrClientNoopPlugin, vxrnCompilerPlugin, wrapNativeBundleModuleScope };
932
- //# sourceMappingURL=createNativeDevEngine.native.js.map