vxrn 0.1.50 → 0.1.52

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 (330) hide show
  1. package/dist/cjs/exports/bindKeypressInput.js +58 -0
  2. package/dist/cjs/exports/bindKeypressInput.js.map +6 -0
  3. package/dist/cjs/exports/bindKeypressInput.native.js +63 -0
  4. package/dist/cjs/exports/bindKeypressInput.native.js.map +6 -0
  5. package/dist/cjs/exports/build.js +26 -93
  6. package/dist/cjs/exports/build.js.map +2 -2
  7. package/dist/cjs/exports/build.native.js +70 -360
  8. package/dist/cjs/exports/build.native.js.map +2 -2
  9. package/dist/cjs/exports/coerceToArray.js +23 -0
  10. package/dist/cjs/exports/coerceToArray.js.map +6 -0
  11. package/dist/cjs/exports/connectedNativeClients.js +21 -0
  12. package/dist/cjs/exports/connectedNativeClients.js.map +6 -0
  13. package/dist/cjs/exports/dev.js +10 -416
  14. package/dist/cjs/exports/dev.js.map +2 -2
  15. package/dist/cjs/exports/dev.native.js +16 -732
  16. package/dist/cjs/exports/dev.native.js.map +2 -2
  17. package/dist/cjs/exports/entryRoot.js +69 -0
  18. package/dist/cjs/exports/entryRoot.js.map +6 -0
  19. package/dist/cjs/exports/getIndexJsonResponse.js +71 -0
  20. package/dist/cjs/exports/getIndexJsonResponse.js.map +6 -0
  21. package/dist/cjs/exports/getIndexJsonResponse.native.js +99 -0
  22. package/dist/cjs/exports/getIndexJsonResponse.native.js.map +6 -0
  23. package/dist/cjs/exports/getReactNativeBundle.js +160 -0
  24. package/dist/cjs/exports/getReactNativeBundle.js.map +6 -0
  25. package/dist/cjs/exports/getViteServerConfig.js +77 -0
  26. package/dist/cjs/exports/getViteServerConfig.js.map +6 -0
  27. package/dist/cjs/exports/getViteServerConfig.native.js +253 -0
  28. package/dist/cjs/exports/getViteServerConfig.native.js.map +6 -0
  29. package/dist/cjs/exports/hotUpdateCache.js +21 -0
  30. package/dist/cjs/exports/hotUpdateCache.js.map +6 -0
  31. package/dist/cjs/exports/isBuildingNativeBundle.js +21 -0
  32. package/dist/cjs/exports/isBuildingNativeBundle.js.map +6 -0
  33. package/dist/cjs/exports/isWithin.js +25 -0
  34. package/dist/cjs/exports/isWithin.js.map +6 -0
  35. package/dist/cjs/exports/reactNativeHMRPlugin.js +69 -0
  36. package/dist/cjs/exports/reactNativeHMRPlugin.js.map +6 -0
  37. package/dist/cjs/exports/resolveFile.js +28 -0
  38. package/dist/cjs/exports/resolveFile.js.map +6 -0
  39. package/dist/cjs/exports/resolveFile.native.js +34 -0
  40. package/dist/cjs/exports/resolveFile.native.js.map +6 -0
  41. package/dist/cjs/exports/serve.js +1 -1
  42. package/dist/cjs/exports/serve.js.map +1 -1
  43. package/dist/cjs/exports/serve.native.js +1 -1
  44. package/dist/cjs/exports/serve.native.js.map +1 -1
  45. package/dist/cjs/exports/swapPrebuiltReactModules.js +100 -0
  46. package/dist/cjs/exports/swapPrebuiltReactModules.js.map +6 -0
  47. package/dist/cjs/exports/uniq.js +23 -0
  48. package/dist/cjs/exports/uniq.js.map +6 -0
  49. package/dist/cjs/index.js +4 -0
  50. package/dist/cjs/index.js.map +1 -1
  51. package/dist/cjs/index.native.js +8 -0
  52. package/dist/cjs/index.native.js.map +1 -1
  53. package/dist/cjs/plugins/reactNativeCommonJsPlugin.js.map +1 -1
  54. package/dist/cjs/plugins/reactNativeCommonJsPlugin.native.js.map +1 -1
  55. package/dist/cjs/plugins/reactNativeHMRPlugin.js +67 -0
  56. package/dist/cjs/plugins/reactNativeHMRPlugin.js.map +6 -0
  57. package/dist/cjs/plugins/reactNativeHMRPlugin.native.js +307 -0
  58. package/dist/cjs/plugins/reactNativeHMRPlugin.native.js.map +6 -0
  59. package/dist/cjs/types.native.js.map +1 -1
  60. package/dist/cjs/utils/bindKeypressInput.js +58 -0
  61. package/dist/cjs/utils/bindKeypressInput.js.map +6 -0
  62. package/dist/cjs/utils/bindKeypressInput.native.js +63 -0
  63. package/dist/cjs/utils/bindKeypressInput.native.js.map +6 -0
  64. package/dist/cjs/utils/coerceToArray.js +23 -0
  65. package/dist/cjs/utils/coerceToArray.js.map +6 -0
  66. package/dist/cjs/utils/coerceToArray.native.js +30 -0
  67. package/dist/cjs/utils/coerceToArray.native.js.map +6 -0
  68. package/dist/cjs/utils/connectedNativeClients.js +29 -0
  69. package/dist/cjs/utils/connectedNativeClients.js.map +6 -0
  70. package/dist/cjs/utils/connectedNativeClients.native.js +36 -0
  71. package/dist/cjs/utils/connectedNativeClients.native.js.map +6 -0
  72. package/dist/cjs/utils/getIndexJsonResponse.js +71 -0
  73. package/dist/cjs/utils/getIndexJsonResponse.js.map +6 -0
  74. package/dist/cjs/utils/getIndexJsonResponse.native.js +99 -0
  75. package/dist/cjs/utils/getIndexJsonResponse.native.js.map +6 -0
  76. package/dist/cjs/utils/getOptimizeDeps.js +8 -7
  77. package/dist/cjs/utils/getOptimizeDeps.js.map +1 -1
  78. package/dist/cjs/utils/getOptimizeDeps.native.js +8 -7
  79. package/dist/cjs/utils/getOptimizeDeps.native.js.map +1 -1
  80. package/dist/cjs/utils/getOptionsFilled.js.map +1 -1
  81. package/dist/cjs/utils/getOptionsFilled.native.js.map +1 -1
  82. package/dist/cjs/utils/getReactNativeBundle.js +165 -0
  83. package/dist/cjs/utils/getReactNativeBundle.js.map +6 -0
  84. package/dist/cjs/utils/getReactNativeBundle.native.js +389 -0
  85. package/dist/cjs/utils/getReactNativeBundle.native.js.map +6 -0
  86. package/dist/cjs/utils/getVitePath.js +2 -2
  87. package/dist/cjs/utils/getVitePath.js.map +2 -2
  88. package/dist/cjs/utils/getVitePath.native.js +8 -8
  89. package/dist/cjs/utils/getVitePath.native.js.map +2 -2
  90. package/dist/cjs/utils/getViteServerConfig.js +80 -0
  91. package/dist/cjs/utils/getViteServerConfig.js.map +6 -0
  92. package/dist/cjs/utils/getViteServerConfig.native.js +256 -0
  93. package/dist/cjs/utils/getViteServerConfig.native.js.map +6 -0
  94. package/dist/cjs/utils/hotUpdateCache.js +21 -0
  95. package/dist/cjs/utils/hotUpdateCache.js.map +6 -0
  96. package/dist/cjs/utils/hotUpdateCache.native.js +26 -0
  97. package/dist/cjs/utils/hotUpdateCache.native.js.map +6 -0
  98. package/dist/cjs/utils/isBuildingNativeBundle.js +25 -0
  99. package/dist/cjs/utils/isBuildingNativeBundle.js.map +6 -0
  100. package/dist/cjs/utils/isBuildingNativeBundle.native.js +32 -0
  101. package/dist/cjs/utils/isBuildingNativeBundle.native.js.map +6 -0
  102. package/dist/cjs/utils/isWithin.js +25 -0
  103. package/dist/cjs/utils/isWithin.js.map +6 -0
  104. package/dist/cjs/utils/isWithin.native.js +30 -0
  105. package/dist/cjs/utils/isWithin.native.js.map +6 -0
  106. package/dist/cjs/utils/readVXRNConfig.js +15 -18
  107. package/dist/cjs/utils/readVXRNConfig.js.map +2 -2
  108. package/dist/cjs/utils/readVXRNConfig.native.js +104 -49
  109. package/dist/cjs/utils/readVXRNConfig.native.js.map +2 -2
  110. package/dist/cjs/utils/resolveFile.js +28 -0
  111. package/dist/cjs/utils/resolveFile.js.map +6 -0
  112. package/dist/cjs/utils/resolveFile.native.js +34 -0
  113. package/dist/cjs/utils/resolveFile.native.js.map +6 -0
  114. package/dist/cjs/utils/swapPrebuiltReactModules.js +108 -0
  115. package/dist/cjs/utils/swapPrebuiltReactModules.js.map +6 -0
  116. package/dist/cjs/utils/swapPrebuiltReactModules.native.js +272 -0
  117. package/dist/cjs/utils/swapPrebuiltReactModules.native.js.map +6 -0
  118. package/dist/cjs/utils/uniq.js +23 -0
  119. package/dist/cjs/utils/uniq.js.map +6 -0
  120. package/dist/cjs/utils/uniq.native.js +59 -0
  121. package/dist/cjs/utils/uniq.native.js.map +6 -0
  122. package/dist/esm/exports/bindKeypressInput.js +34 -0
  123. package/dist/esm/exports/bindKeypressInput.js.map +6 -0
  124. package/dist/esm/exports/bindKeypressInput.mjs +31 -0
  125. package/dist/esm/exports/bindKeypressInput.native.js +34 -0
  126. package/dist/esm/exports/bindKeypressInput.native.js.map +6 -0
  127. package/dist/esm/exports/build.js +27 -98
  128. package/dist/esm/exports/build.js.map +1 -1
  129. package/dist/esm/exports/build.mjs +38 -135
  130. package/dist/esm/exports/build.native.js +71 -366
  131. package/dist/esm/exports/build.native.js.map +2 -2
  132. package/dist/esm/exports/coerceToArray.js +7 -0
  133. package/dist/esm/exports/coerceToArray.js.map +6 -0
  134. package/dist/esm/exports/coerceToArray.mjs +4 -0
  135. package/dist/esm/exports/connectedNativeClients.js +5 -0
  136. package/dist/esm/exports/connectedNativeClients.js.map +6 -0
  137. package/dist/esm/exports/connectedNativeClients.mjs +2 -0
  138. package/dist/esm/exports/dev.js +17 -431
  139. package/dist/esm/exports/dev.js.map +2 -2
  140. package/dist/esm/exports/dev.mjs +15 -430
  141. package/dist/esm/exports/dev.native.js +19 -738
  142. package/dist/esm/exports/dev.native.js.map +2 -2
  143. package/dist/esm/exports/entryRoot.js +58 -0
  144. package/dist/esm/exports/entryRoot.js.map +6 -0
  145. package/dist/esm/exports/entryRoot.mjs +62 -0
  146. package/dist/esm/exports/getIndexJsonResponse.js +55 -0
  147. package/dist/esm/exports/getIndexJsonResponse.js.map +6 -0
  148. package/dist/esm/exports/getIndexJsonResponse.mjs +71 -0
  149. package/dist/esm/exports/getIndexJsonResponse.native.js +78 -0
  150. package/dist/esm/exports/getIndexJsonResponse.native.js.map +6 -0
  151. package/dist/esm/exports/getReactNativeBundle.js +146 -0
  152. package/dist/esm/exports/getReactNativeBundle.js.map +6 -0
  153. package/dist/esm/exports/getReactNativeBundle.mjs +136 -0
  154. package/dist/esm/exports/getViteServerConfig.js +64 -0
  155. package/dist/esm/exports/getViteServerConfig.js.map +6 -0
  156. package/dist/esm/exports/getViteServerConfig.mjs +44 -0
  157. package/dist/esm/exports/getViteServerConfig.native.js +235 -0
  158. package/dist/esm/exports/getViteServerConfig.native.js.map +6 -0
  159. package/dist/esm/exports/hotUpdateCache.js +5 -0
  160. package/dist/esm/exports/hotUpdateCache.js.map +6 -0
  161. package/dist/esm/exports/hotUpdateCache.mjs +2 -0
  162. package/dist/esm/exports/isBuildingNativeBundle.js +5 -0
  163. package/dist/esm/exports/isBuildingNativeBundle.js.map +6 -0
  164. package/dist/esm/exports/isBuildingNativeBundle.mjs +2 -0
  165. package/dist/esm/exports/isWithin.js +9 -0
  166. package/dist/esm/exports/isWithin.js.map +6 -0
  167. package/dist/esm/exports/isWithin.mjs +6 -0
  168. package/dist/esm/exports/reactNativeHMRPlugin.js +58 -0
  169. package/dist/esm/exports/reactNativeHMRPlugin.js.map +6 -0
  170. package/dist/esm/exports/reactNativeHMRPlugin.mjs +62 -0
  171. package/dist/esm/exports/resolveFile.js +12 -0
  172. package/dist/esm/exports/resolveFile.js.map +6 -0
  173. package/dist/esm/exports/resolveFile.mjs +9 -0
  174. package/dist/esm/exports/resolveFile.native.js +12 -0
  175. package/dist/esm/exports/resolveFile.native.js.map +6 -0
  176. package/dist/esm/exports/serve.js +1 -1
  177. package/dist/esm/exports/serve.js.map +1 -1
  178. package/dist/esm/exports/serve.mjs +1 -1
  179. package/dist/esm/exports/serve.native.js +1 -1
  180. package/dist/esm/exports/serve.native.js.map +1 -1
  181. package/dist/esm/exports/swapPrebuiltReactModules.js +87 -0
  182. package/dist/esm/exports/swapPrebuiltReactModules.js.map +6 -0
  183. package/dist/esm/exports/swapPrebuiltReactModules.mjs +73 -0
  184. package/dist/esm/exports/uniq.js +7 -0
  185. package/dist/esm/exports/uniq.js.map +6 -0
  186. package/dist/esm/exports/uniq.mjs +4 -0
  187. package/dist/esm/index.js +4 -0
  188. package/dist/esm/index.js.map +1 -1
  189. package/dist/esm/index.mjs +4 -0
  190. package/dist/esm/index.native.js +4 -0
  191. package/dist/esm/index.native.js.map +1 -1
  192. package/dist/esm/plugins/reactNativeCommonJsPlugin.js.map +1 -1
  193. package/dist/esm/plugins/reactNativeCommonJsPlugin.native.js.map +1 -1
  194. package/dist/esm/plugins/reactNativeHMRPlugin.js +57 -0
  195. package/dist/esm/plugins/reactNativeHMRPlugin.js.map +6 -0
  196. package/dist/esm/plugins/reactNativeHMRPlugin.mjs +62 -0
  197. package/dist/esm/plugins/reactNativeHMRPlugin.native.js +292 -0
  198. package/dist/esm/plugins/reactNativeHMRPlugin.native.js.map +6 -0
  199. package/dist/esm/utils/bindKeypressInput.js +34 -0
  200. package/dist/esm/utils/bindKeypressInput.js.map +6 -0
  201. package/dist/esm/utils/bindKeypressInput.mjs +31 -0
  202. package/dist/esm/utils/bindKeypressInput.native.js +34 -0
  203. package/dist/esm/utils/bindKeypressInput.native.js.map +6 -0
  204. package/dist/esm/utils/coerceToArray.js +7 -0
  205. package/dist/esm/utils/coerceToArray.js.map +6 -0
  206. package/dist/esm/utils/coerceToArray.mjs +4 -0
  207. package/dist/esm/utils/coerceToArray.native.js +9 -0
  208. package/dist/esm/utils/coerceToArray.native.js.map +6 -0
  209. package/dist/esm/utils/connectedNativeClients.js +13 -0
  210. package/dist/esm/utils/connectedNativeClients.js.map +6 -0
  211. package/dist/esm/utils/connectedNativeClients.mjs +8 -0
  212. package/dist/esm/utils/connectedNativeClients.native.js +13 -0
  213. package/dist/esm/utils/connectedNativeClients.native.js.map +6 -0
  214. package/dist/esm/utils/getIndexJsonResponse.js +55 -0
  215. package/dist/esm/utils/getIndexJsonResponse.js.map +6 -0
  216. package/dist/esm/utils/getIndexJsonResponse.mjs +71 -0
  217. package/dist/esm/utils/getIndexJsonResponse.native.js +78 -0
  218. package/dist/esm/utils/getIndexJsonResponse.native.js.map +6 -0
  219. package/dist/esm/utils/getOptimizeDeps.js +8 -7
  220. package/dist/esm/utils/getOptimizeDeps.js.map +1 -1
  221. package/dist/esm/utils/getOptimizeDeps.mjs +2 -2
  222. package/dist/esm/utils/getOptimizeDeps.native.js +8 -7
  223. package/dist/esm/utils/getOptimizeDeps.native.js.map +1 -1
  224. package/dist/esm/utils/getOptionsFilled.js.map +1 -1
  225. package/dist/esm/utils/getOptionsFilled.native.js.map +1 -1
  226. package/dist/esm/utils/getReactNativeBundle.js +153 -0
  227. package/dist/esm/utils/getReactNativeBundle.js.map +6 -0
  228. package/dist/esm/utils/getReactNativeBundle.mjs +142 -0
  229. package/dist/esm/utils/getReactNativeBundle.native.js +371 -0
  230. package/dist/esm/utils/getReactNativeBundle.native.js.map +6 -0
  231. package/dist/esm/utils/getVitePath.js +2 -2
  232. package/dist/esm/utils/getVitePath.js.map +1 -1
  233. package/dist/esm/utils/getVitePath.mjs +2 -2
  234. package/dist/esm/utils/getVitePath.native.js +8 -8
  235. package/dist/esm/utils/getVitePath.native.js.map +2 -2
  236. package/dist/esm/utils/getViteServerConfig.js +69 -0
  237. package/dist/esm/utils/getViteServerConfig.js.map +6 -0
  238. package/dist/esm/utils/getViteServerConfig.mjs +49 -0
  239. package/dist/esm/utils/getViteServerConfig.native.js +240 -0
  240. package/dist/esm/utils/getViteServerConfig.native.js.map +6 -0
  241. package/dist/esm/utils/hotUpdateCache.js +5 -0
  242. package/dist/esm/utils/hotUpdateCache.js.map +6 -0
  243. package/dist/esm/utils/hotUpdateCache.mjs +2 -0
  244. package/dist/esm/utils/hotUpdateCache.native.js +5 -0
  245. package/dist/esm/utils/hotUpdateCache.native.js.map +6 -0
  246. package/dist/esm/utils/isBuildingNativeBundle.js +9 -0
  247. package/dist/esm/utils/isBuildingNativeBundle.js.map +6 -0
  248. package/dist/esm/utils/isBuildingNativeBundle.mjs +5 -0
  249. package/dist/esm/utils/isBuildingNativeBundle.native.js +10 -0
  250. package/dist/esm/utils/isBuildingNativeBundle.native.js.map +6 -0
  251. package/dist/esm/utils/isWithin.js +9 -0
  252. package/dist/esm/utils/isWithin.js.map +6 -0
  253. package/dist/esm/utils/isWithin.mjs +6 -0
  254. package/dist/esm/utils/isWithin.native.js +9 -0
  255. package/dist/esm/utils/isWithin.native.js.map +6 -0
  256. package/dist/esm/utils/readVXRNConfig.js +16 -19
  257. package/dist/esm/utils/readVXRNConfig.js.map +1 -1
  258. package/dist/esm/utils/readVXRNConfig.mjs +17 -21
  259. package/dist/esm/utils/readVXRNConfig.native.js +105 -50
  260. package/dist/esm/utils/readVXRNConfig.native.js.map +2 -2
  261. package/dist/esm/utils/resolveFile.js +12 -0
  262. package/dist/esm/utils/resolveFile.js.map +6 -0
  263. package/dist/esm/utils/resolveFile.mjs +9 -0
  264. package/dist/esm/utils/resolveFile.native.js +12 -0
  265. package/dist/esm/utils/resolveFile.native.js.map +6 -0
  266. package/dist/esm/utils/swapPrebuiltReactModules.js +89 -0
  267. package/dist/esm/utils/swapPrebuiltReactModules.js.map +6 -0
  268. package/dist/esm/utils/swapPrebuiltReactModules.mjs +75 -0
  269. package/dist/esm/utils/swapPrebuiltReactModules.native.js +248 -0
  270. package/dist/esm/utils/swapPrebuiltReactModules.native.js.map +6 -0
  271. package/dist/esm/utils/uniq.js +7 -0
  272. package/dist/esm/utils/uniq.js.map +6 -0
  273. package/dist/esm/utils/uniq.mjs +4 -0
  274. package/dist/esm/utils/uniq.native.js +38 -0
  275. package/dist/esm/utils/uniq.native.js.map +6 -0
  276. package/package.json +8 -8
  277. package/src/exports/build.ts +46 -183
  278. package/src/exports/dev.ts +18 -646
  279. package/src/exports/serve.ts +4 -0
  280. package/src/index.ts +5 -0
  281. package/src/plugins/reactNativeCommonJsPlugin.ts +0 -2
  282. package/src/plugins/reactNativeHMRPlugin.ts +105 -0
  283. package/src/types.ts +9 -0
  284. package/src/utils/bindKeypressInput.ts +46 -0
  285. package/src/utils/coerceToArray.ts +3 -0
  286. package/src/utils/connectedNativeClients.ts +9 -0
  287. package/src/utils/getIndexJsonResponse.ts +52 -0
  288. package/src/utils/getOptimizeDeps.ts +9 -8
  289. package/src/utils/getOptionsFilled.ts +0 -1
  290. package/src/utils/getReactNativeBundle.ts +228 -0
  291. package/src/utils/getVitePath.ts +3 -3
  292. package/src/utils/getViteServerConfig.ts +104 -0
  293. package/src/utils/hotUpdateCache.ts +1 -0
  294. package/src/utils/isBuildingNativeBundle.ts +7 -0
  295. package/src/utils/isWithin.ts +6 -0
  296. package/src/utils/readVXRNConfig.ts +81 -25
  297. package/src/utils/resolveFile.ts +9 -0
  298. package/src/utils/swapPrebuiltReactModules.ts +126 -0
  299. package/src/utils/uniq.ts +3 -0
  300. package/types/exports/bindKeypressInput.d.ts +2 -0
  301. package/types/exports/coerceToArray.d.ts +2 -0
  302. package/types/exports/connectedNativeClients.d.ts +2 -0
  303. package/types/exports/dev.d.ts +0 -2
  304. package/types/exports/entryRoot.d.ts +11 -0
  305. package/types/exports/getIndexJsonResponse.d.ts +68 -0
  306. package/types/exports/getReactNativeBundle.d.ts +3 -0
  307. package/types/exports/getViteServerConfig.d.ts +4 -0
  308. package/types/exports/hotUpdateCache.d.ts +2 -0
  309. package/types/exports/isBuildingNativeBundle.d.ts +2 -0
  310. package/types/exports/isWithin.d.ts +2 -0
  311. package/types/exports/reactNativeHMRPlugin.d.ts +11 -0
  312. package/types/exports/resolveFile.d.ts +2 -0
  313. package/types/exports/swapPrebuiltReactModules.d.ts +7 -0
  314. package/types/exports/uniq.d.ts +2 -0
  315. package/types/index.d.ts +4 -0
  316. package/types/plugins/reactNativeHMRPlugin.d.ts +10 -0
  317. package/types/types.d.ts +4 -0
  318. package/types/utils/bindKeypressInput.d.ts +2 -0
  319. package/types/utils/coerceToArray.d.ts +2 -0
  320. package/types/utils/connectedNativeClients.d.ts +4 -0
  321. package/types/utils/getIndexJsonResponse.d.ts +68 -0
  322. package/types/utils/getOptionsFilled.d.ts +2 -0
  323. package/types/utils/getReactNativeBundle.d.ts +4 -0
  324. package/types/utils/getViteServerConfig.d.ts +4 -0
  325. package/types/utils/hotUpdateCache.d.ts +2 -0
  326. package/types/utils/isBuildingNativeBundle.d.ts +3 -0
  327. package/types/utils/isWithin.d.ts +2 -0
  328. package/types/utils/resolveFile.d.ts +2 -0
  329. package/types/utils/swapPrebuiltReactModules.d.ts +7 -0
  330. package/types/utils/uniq.d.ts +2 -0
@@ -1,73 +1,55 @@
1
1
  import wsAdapter from "crossws/adapters/node";
2
+ import FSExtra from "fs-extra";
2
3
  import { createApp, createRouter, defineEventHandler, eventHandler, getQuery, toNodeListener } from "h3";
3
4
  import { createProxyEventHandler } from "h3-proxy";
4
- import { readFile, rm } from "node:fs/promises";
5
+ import { rm } from "node:fs/promises";
5
6
  import { createServer as nodeCreateServer } from "node:http";
6
- import { dirname, join, relative, resolve } from "node:path";
7
- import readline from "node:readline";
7
+ import { join } from "node:path";
8
+ import { createServer, resolveConfig } from "vite";
8
9
  import { WebSocket } from "ws";
9
- import * as babel from "@babel/core";
10
- import { buildReact, buildReactJSX, buildReactNative } from "@vxrn/react-native-prebuilt";
11
- import viteReactPlugin, { swcTransform, transformForBuild } from "@vxrn/vite-native-swc";
12
- import { parse } from "es-module-lexer";
13
- import FSExtra from "fs-extra";
14
- import { build, createServer, mergeConfig, resolveConfig, transformWithEsbuild } from "vite";
15
- import createViteFlow from "@vxrn/vite-flow";
16
- import { resolve as importMetaResolve } from "import-meta-resolve";
17
- import { nativeExtensions } from "../constants";
18
10
  import { clientInjectionsPlugin } from "../plugins/clientInjectPlugin";
19
- import { reactNativeCommonJsPlugin } from "../plugins/reactNativeCommonJsPlugin";
20
- import { getBaseViteConfig } from "../utils/getBaseViteConfig";
11
+ import { bindKeypressInput } from "../utils/bindKeypressInput";
12
+ import { addConnectedNativeClient, removeConnectedNativeClient } from "../utils/connectedNativeClients";
13
+ import { getIndexJsonResponse } from "../utils/getIndexJsonResponse";
21
14
  import { getOptionsFilled } from "../utils/getOptionsFilled";
22
- import { getVitePath } from "../utils/getVitePath";
15
+ import { getReactNativeBundle } from "../utils/getReactNativeBundle";
16
+ import { getViteServerConfig } from "../utils/getViteServerConfig";
17
+ import { hotUpdateCache } from "../utils/hotUpdateCache";
23
18
  import { checkPatches } from "../utils/patches";
24
- import { getOptimizeDeps } from "../utils/getOptimizeDeps";
25
19
  function _array_like_to_array(arr, len) {
26
20
  (len == null || len > arr.length) && (len = arr.length);
27
21
  for (var i = 0, arr2 = new Array(len); i < len; i++)
28
22
  arr2[i] = arr[i];
29
23
  return arr2;
30
24
  }
31
- function _array_with_holes(arr) {
32
- if (Array.isArray(arr))
33
- return arr;
34
- }
35
25
  function _array_without_holes(arr) {
36
26
  if (Array.isArray(arr))
37
27
  return _array_like_to_array(arr);
38
28
  }
39
- function asyncGeneratorStep(gen, resolve2, reject, _next, _throw, key, arg) {
29
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
40
30
  try {
41
31
  var info = gen[key](arg), value = info.value;
42
32
  } catch (error) {
43
33
  reject(error);
44
34
  return;
45
35
  }
46
- info.done ? resolve2(value) : Promise.resolve(value).then(_next, _throw);
36
+ info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw);
47
37
  }
48
38
  function _async_to_generator(fn) {
49
39
  return function() {
50
40
  var self = this, args = arguments;
51
- return new Promise(function(resolve2, reject) {
41
+ return new Promise(function(resolve, reject) {
52
42
  var gen = fn.apply(self, args);
53
43
  function _next(value) {
54
- asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value);
44
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
55
45
  }
56
46
  function _throw(err) {
57
- asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "throw", err);
47
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
58
48
  }
59
49
  _next(void 0);
60
50
  });
61
51
  };
62
52
  }
63
- function _define_property(obj, key, value) {
64
- return key in obj ? Object.defineProperty(obj, key, {
65
- value,
66
- enumerable: !0,
67
- configurable: !0,
68
- writable: !0
69
- }) : obj[key] = value, obj;
70
- }
71
53
  function _instanceof(left, right) {
72
54
  return right != null && typeof Symbol < "u" && right[Symbol.hasInstance] ? !!right[Symbol.hasInstance](left) : left instanceof right;
73
55
  }
@@ -75,58 +57,9 @@ function _iterable_to_array(iter) {
75
57
  if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
76
58
  return Array.from(iter);
77
59
  }
78
- function _iterable_to_array_limit(arr, i) {
79
- var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
80
- if (_i != null) {
81
- var _arr = [], _n = !0, _d = !1, _s, _e;
82
- try {
83
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
84
- ;
85
- } catch (err) {
86
- _d = !0, _e = err;
87
- } finally {
88
- try {
89
- !_n && _i.return != null && _i.return();
90
- } finally {
91
- if (_d)
92
- throw _e;
93
- }
94
- }
95
- return _arr;
96
- }
97
- }
98
- function _non_iterable_rest() {
99
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
100
- }
101
60
  function _non_iterable_spread() {
102
61
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
103
62
  }
104
- function _object_spread(target) {
105
- for (var i = 1; i < arguments.length; i++) {
106
- var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
107
- typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
108
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
109
- }))), ownKeys2.forEach(function(key) {
110
- _define_property(target, key, source[key]);
111
- });
112
- }
113
- return target;
114
- }
115
- function ownKeys(object, enumerableOnly) {
116
- var keys = Object.keys(object);
117
- if (Object.getOwnPropertySymbols) {
118
- var symbols = Object.getOwnPropertySymbols(object);
119
- enumerableOnly && (symbols = symbols.filter(function(sym) {
120
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
121
- })), keys.push.apply(keys, symbols);
122
- }
123
- return keys;
124
- }
125
- function _object_spread_props(target, source) {
126
- return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
127
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
128
- }), target;
129
- }
130
63
  function _object_without_properties(source, excluded) {
131
64
  if (source == null)
132
65
  return {};
@@ -146,9 +79,6 @@ function _object_without_properties_loose(source, excluded) {
146
79
  key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
147
80
  return target;
148
81
  }
149
- function _sliced_to_array(arr, i) {
150
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
151
- }
152
82
  function _to_consumable_array(arr) {
153
83
  return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
154
84
  }
@@ -254,13 +184,7 @@ function _ts_generator(thisArg, body) {
254
184
  };
255
185
  }
256
186
  }
257
- var isBuildingNativeBundle = null, hotUpdateCache = /* @__PURE__ */ new Map(), connectedNativeClients = 0, resolveFile = function(path) {
258
- try {
259
- return importMetaResolve(path, import.meta.url).replace("file://", "");
260
- } catch {
261
- return require.resolve(path);
262
- }
263
- }, ensureDir = FSExtra.ensureDir, pathExists = FSExtra.pathExists, pathExistsSync = FSExtra.pathExistsSync, dev = function() {
187
+ var ensureDir = FSExtra.ensureDir, dev = function() {
264
188
  var _ref = _async_to_generator(function(_param) {
265
189
  var clean, rest, _process_env_DEBUG, options, host, port, root, cacheDir, err, serverConfig, viteServer, resolvedConfig, viteRNClientPlugin, vitePort, router, app, clients, socket, handleUpgrade, server;
266
190
  return _ts_generator(this, function(_state) {
@@ -446,13 +370,13 @@ var isBuildingNativeBundle = null, hotUpdateCache = /* @__PURE__ */ new Map(), c
446
370
  // avoid errors
447
371
  websocket: {
448
372
  open: function(peer) {
449
- console.debug("[hmr] open", peer), connectedNativeClients++;
373
+ console.debug("[hmr] open", peer), addConnectedNativeClient();
450
374
  },
451
375
  message: function(peer, message) {
452
376
  console.info("[hmr] message", peer, message), message.text().includes("ping") && peer.send("pong");
453
377
  },
454
378
  close: function(peer, event) {
455
- console.info("[hmr] close", peer, event), connectedNativeClients--;
379
+ console.info("[hmr] close", peer, event), removeConnectedNativeClient();
456
380
  },
457
381
  error: function(peer, error) {
458
382
  console.error("[hmr] error", peer, error);
@@ -560,650 +484,7 @@ var isBuildingNativeBundle = null, hotUpdateCache = /* @__PURE__ */ new Map(), c
560
484
  return _ref.apply(this, arguments);
561
485
  };
562
486
  }();
563
- function getReactNativeBundle(options, viteRNClientPlugin) {
564
- return _getReactNativeBundle.apply(this, arguments);
565
- }
566
- function _getReactNativeBundle() {
567
- return _getReactNativeBundle = _async_to_generator(function(options, viteRNClientPlugin) {
568
- var root, port, cacheDir, depsToOptimize, tmpBundle, res, done, viteFlow, nativeBuildConfig, buildOutput, appCode, appRootParent, prebuilds, templateFile, template, out;
569
- function babelReanimated(input, filename) {
570
- return _babelReanimated.apply(this, arguments);
571
- }
572
- function _babelReanimated() {
573
- return _babelReanimated = _async_to_generator(function(input, filename) {
574
- return _ts_generator(this, function(_state) {
575
- switch (_state.label) {
576
- case 0:
577
- return [
578
- 4,
579
- new Promise(function(res2, rej) {
580
- babel.transform(input, {
581
- plugins: [
582
- "react-native-reanimated/plugin"
583
- ],
584
- filename
585
- }, function(err, result) {
586
- (!result || err) && rej(err || "no res"), res2(result.code);
587
- });
588
- })
589
- ];
590
- case 1:
591
- return [
592
- 2,
593
- _state.sent()
594
- ];
595
- }
596
- });
597
- }), _babelReanimated.apply(this, arguments);
598
- }
599
- return _ts_generator(this, function(_state) {
600
- switch (_state.label) {
601
- case 0:
602
- return root = options.root, port = options.port, cacheDir = options.cacheDir, depsToOptimize = getOptimizeDeps("build").depsToOptimize, process.env.LOAD_TMP_BUNDLE ? (tmpBundle = join(process.cwd(), "bundle.tmp.js"), [
603
- 4,
604
- pathExists(tmpBundle)
605
- ]) : [
606
- 3,
607
- 3
608
- ];
609
- case 1:
610
- return _state.sent() ? (console.info("\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F returning temp bundle \u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F", tmpBundle), [
611
- 4,
612
- readFile(tmpBundle, "utf-8")
613
- ]) : [
614
- 3,
615
- 3
616
- ];
617
- case 2:
618
- return [
619
- 2,
620
- _state.sent()
621
- ];
622
- case 3:
623
- return isBuildingNativeBundle ? [
624
- 4,
625
- isBuildingNativeBundle
626
- ] : [
627
- 3,
628
- 5
629
- ];
630
- case 4:
631
- return res = _state.sent(), [
632
- 2,
633
- res
634
- ];
635
- case 5:
636
- return isBuildingNativeBundle = new Promise(function(res2) {
637
- done = res2;
638
- }), viteFlow = options.flow ? createViteFlow(options.flow) : null, nativeBuildConfig = {
639
- plugins: [
640
- viteFlow,
641
- swapPrebuiltReactModules(cacheDir),
642
- {
643
- name: "reanimated",
644
- transform: function(code, id) {
645
- return _async_to_generator(function() {
646
- var out2;
647
- return _ts_generator(this, function(_state2) {
648
- switch (_state2.label) {
649
- case 0:
650
- return code.includes("worklet") ? [
651
- 4,
652
- babelReanimated(code, id)
653
- ] : [
654
- 3,
655
- 2
656
- ];
657
- case 1:
658
- return out2 = _state2.sent(), [
659
- 2,
660
- out2
661
- ];
662
- case 2:
663
- return [
664
- 2
665
- ];
666
- }
667
- });
668
- })();
669
- }
670
- },
671
- viteRNClientPlugin,
672
- reactNativeCommonJsPlugin({
673
- root,
674
- port,
675
- mode: "build"
676
- }),
677
- viteReactPlugin({
678
- tsDecorators: !0,
679
- mode: "build"
680
- }),
681
- {
682
- name: "treat-js-files-as-jsx",
683
- transform: function(code, id) {
684
- return _async_to_generator(function() {
685
- return _ts_generator(this, function(_state2) {
686
- return id.includes("expo-status-bar") ? [
687
- 2,
688
- transformWithEsbuild(code, id, {
689
- loader: "jsx",
690
- jsx: "automatic"
691
- })
692
- ] : [
693
- 2,
694
- null
695
- ];
696
- });
697
- })();
698
- }
699
- }
700
- ].filter(Boolean),
701
- appType: "custom",
702
- root,
703
- clearScreen: !1,
704
- optimizeDeps: {
705
- include: depsToOptimize,
706
- esbuildOptions: {
707
- jsx: "automatic"
708
- }
709
- },
710
- resolve: {
711
- extensions: nativeExtensions
712
- },
713
- mode: "development",
714
- define: {
715
- "process.env.NODE_ENV": '"development"'
716
- },
717
- build: {
718
- ssr: !1,
719
- minify: !1,
720
- commonjsOptions: {
721
- transformMixedEsModules: !0
722
- },
723
- rollupOptions: {
724
- input: options.entries.native,
725
- treeshake: !1,
726
- preserveEntrySignatures: "strict",
727
- output: {
728
- preserveModules: !0,
729
- format: "cjs"
730
- }
731
- }
732
- }
733
- }, options.nativeConfig && (nativeBuildConfig = mergeConfig(nativeBuildConfig, options.nativeConfig)), [
734
- 4,
735
- resolveConfig(nativeBuildConfig, "build")
736
- ];
737
- case 6:
738
- return _state.sent(), [
739
- 4,
740
- build(nativeBuildConfig)
741
- ];
742
- case 7:
743
- if (buildOutput = _state.sent(), !("output" in buildOutput) || (appCode = buildOutput.output.sort(function(a, b) {
744
- return a.isEntry ? 1 : -1;
745
- }).map(function(outputModule) {
746
- if (outputModule.type == "chunk") {
747
- var importsMap = {
748
- currentPath: outputModule.fileName
749
- }, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
750
- try {
751
- for (var _iterator = outputModule.imports[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
752
- var imp = _step.value, relativePath = relative(dirname(outputModule.fileName), imp);
753
- importsMap[relativePath[0] === "." ? relativePath : "./" + relativePath] = imp;
754
- }
755
- } catch (err) {
756
- _didIteratorError = !0, _iteratorError = err;
757
- } finally {
758
- try {
759
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
760
- } finally {
761
- if (_didIteratorError)
762
- throw _iteratorError;
763
- }
764
- }
765
- return outputModule.isEntry && (entryRoot = dirname(outputModule.fileName)), `
766
- ___modules___["`.concat(outputModule.fileName, `"] = ((exports, module) => {
767
- const require = createRequire(`).concat(JSON.stringify(importsMap, null, 2), `)
768
-
769
- `).concat(outputModule.code, `
770
- })
771
-
772
- `).concat(outputModule.isEntry ? `
773
- // run entry
774
- const __require = createRequire({})
775
- __require("react-native")
776
- __require("`.concat(outputModule.fileName, `")
777
- `) : "", `
778
- `);
779
- }
780
- }).join(`
781
- `), !appCode))
782
- throw "\u274C";
783
- return appCode = appCode.replaceAll('dist/esm/index.mjs"', 'dist/esm/index.js"'), appRootParent = join(root, "..", ".."), prebuilds = {
784
- reactJSX: join(cacheDir, "react-jsx-runtime.js"),
785
- react: join(cacheDir, "react.js"),
786
- reactNative: join(cacheDir, "react-native.js")
787
- }, templateFile = resolveFile("vxrn/react-native-template.js"), [
788
- 4,
789
- readFile(templateFile, "utf-8")
790
- ];
791
- case 8:
792
- return template = _state.sent().replace("_virtual/virtual_react-native.js", relative(appRootParent, prebuilds.reactNative)).replace("_virtual/virtual_react.js", relative(appRootParent, prebuilds.react)).replaceAll("_virtual/virtual_react-jsx.js", relative(appRootParent, prebuilds.reactJSX)), out = template + appCode, done(out), isBuildingNativeBundle = null, [
793
- 2,
794
- out
795
- ];
796
- }
797
- });
798
- }), _getReactNativeBundle.apply(this, arguments);
799
- }
800
- function swapPrebuiltReactModules(cacheDir) {
801
- return _swapPrebuiltReactModules.apply(this, arguments);
802
- }
803
- function _swapPrebuiltReactModules() {
804
- return _swapPrebuiltReactModules = // we should just detect or whitelist and use flow to convert instead of this but i did a
805
- // few things to the prebuilts to make them work, we may need to account for
806
- _async_to_generator(function(cacheDir) {
807
- var prebuilds, jsxRuntime, _tmp, virtualModules, _tmp1, _, _tmp2, _tmp3;
808
- return _ts_generator(this, function(_state) {
809
- switch (_state.label) {
810
- case 0:
811
- return prebuilds = {
812
- reactJSX: join(cacheDir, "react-jsx-runtime.js"),
813
- react: join(cacheDir, "react.js"),
814
- reactNative: join(cacheDir, "react-native.js")
815
- }, [
816
- 4,
817
- pathExists(prebuilds.reactNative)
818
- ];
819
- case 1:
820
- return _state.sent() ? [
821
- 3,
822
- 3
823
- ] : (console.info("Pre-building react, react-native react/jsx-runtime (one time cost)..."), [
824
- 4,
825
- Promise.all([
826
- buildReactNative({
827
- entryPoints: [
828
- resolveFile("react-native")
829
- ],
830
- outfile: prebuilds.reactNative
831
- }),
832
- buildReact({
833
- entryPoints: [
834
- resolveFile("react")
835
- ],
836
- outfile: prebuilds.react
837
- }),
838
- buildReactJSX({
839
- entryPoints: [
840
- resolveFile("react/jsx-dev-runtime")
841
- ],
842
- outfile: prebuilds.reactJSX
843
- })
844
- ])
845
- ]);
846
- case 2:
847
- _state.sent(), _state.label = 3;
848
- case 3:
849
- return _tmp = {
850
- // alias: 'virtual:react-jsx',
851
- alias: prebuilds.reactJSX
852
- }, [
853
- 4,
854
- readFile(prebuilds.reactJSX, "utf-8")
855
- ];
856
- case 4:
857
- return jsxRuntime = (_tmp.contents = _state.sent(), _tmp), _tmp1 = {}, _ = "react-native", _tmp2 = {
858
- // alias: 'virtual:react-native',
859
- alias: prebuilds.reactNative
860
- }, [
861
- 4,
862
- readFile(prebuilds.reactNative, "utf-8")
863
- ];
864
- case 5:
865
- return _tmp1[_] = (_tmp2.contents = _state.sent(), _tmp2), _tmp3 = {
866
- // alias: 'virtual:react',
867
- alias: prebuilds.react
868
- }, [
869
- 4,
870
- readFile(prebuilds.react, "utf-8")
871
- ];
872
- case 6:
873
- return virtualModules = (_tmp1.react = (_tmp3.contents = _state.sent(), _tmp3), _tmp1["react/jsx-runtime"] = jsxRuntime, _tmp1["react/jsx-dev-runtime"] = jsxRuntime, _tmp1), [
874
- 2,
875
- {
876
- name: "swap-react-native",
877
- enforce: "pre",
878
- resolveId: function(id) {
879
- var importer = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
880
- if (id.startsWith("react-native/Libraries"))
881
- return "virtual:rn-internals:".concat(id);
882
- if (id === "react-native-web")
883
- return prebuilds.reactNative;
884
- for (var targetId in virtualModules)
885
- if (id === targetId || id.includes("node_modules/".concat(targetId, "/"))) {
886
- var info = virtualModules[targetId];
887
- return info.alias;
888
- }
889
- if (isBuildingNativeBundle && id[0] === ".") {
890
- var absolutePath = resolve(dirname(importer), id), nativePath = absolutePath.replace(/(.m?js)/, ".native.js");
891
- if (nativePath === id)
892
- return;
893
- try {
894
- var directoryPath = absolutePath + "/index.native.js", directoryNonNativePath = absolutePath + "/index.js";
895
- if (pathExistsSync(directoryPath))
896
- return directoryPath;
897
- if (pathExistsSync(directoryNonNativePath))
898
- return directoryNonNativePath;
899
- if (pathExistsSync(nativePath))
900
- return nativePath;
901
- } catch (err) {
902
- console.warn("error probably fine", err);
903
- }
904
- }
905
- },
906
- load: function(id) {
907
- if (id.startsWith("virtual:rn-internals")) {
908
- var idOut = id.replace("virtual:rn-internals:", ""), out = 'const ___val = __cachedModules["'.concat(idOut, `"]
909
- const ___defaultVal = ___val ? ___val.default || ___val : ___val
910
- export default ___defaultVal`);
911
- return out;
912
- }
913
- for (var targetId in virtualModules) {
914
- var info = virtualModules[targetId];
915
- if (id === info.alias)
916
- return info.contents;
917
- }
918
- }
919
- }
920
- ];
921
- }
922
- });
923
- }), _swapPrebuiltReactModules.apply(this, arguments);
924
- }
925
- function getIndexJsonResponse(param) {
926
- var port = param.port, root = param.root;
927
- return {
928
- name: "myapp",
929
- slug: "myapp",
930
- scheme: "myapp",
931
- version: "1.0.0",
932
- jsEngine: "jsc",
933
- orientation: "portrait",
934
- icon: "./assets/icon.png",
935
- userInterfaceStyle: "light",
936
- splash: {
937
- image: "./assets/splash.png",
938
- resizeMode: "contain",
939
- backgroundColor: "#ffffff",
940
- imageUrl: "http://127.0.0.1:8081/assets/./assets/splash.png"
941
- },
942
- updates: {
943
- fallbackToCacheTimeout: 0
944
- },
945
- assetBundlePatterns: [
946
- "**/*"
947
- ],
948
- ios: {
949
- supportsTablet: !0,
950
- bundleIdentifier: "com.natew.myapp"
951
- },
952
- android: {
953
- package: "com.tamagui.myapp",
954
- adaptiveIcon: {
955
- foregroundImage: "./assets/adaptive-icon.png",
956
- backgroundColor: "#FFFFFF",
957
- foregroundImageUrl: "http://127.0.0.1:8081/assets/./assets/adaptive-icon.png"
958
- }
959
- },
960
- web: {
961
- favicon: "./assets/favicon.png"
962
- },
963
- extra: {
964
- eas: {
965
- projectId: "061b4470-78c7-4d6a-b850-8167fb0a3434"
966
- }
967
- },
968
- _internal: {
969
- isDebug: !1,
970
- projectRoot: root,
971
- dynamicConfigPath: null,
972
- staticConfigPath: join(root, "app.json"),
973
- packageJsonPath: join(root, "package.json")
974
- },
975
- sdkVersion: "50.0.0",
976
- platforms: [
977
- "ios",
978
- "android",
979
- "web"
980
- ],
981
- iconUrl: "http://127.0.0.1:".concat(port, "/assets/./assets/icon.png"),
982
- debuggerHost: "127.0.0.1:".concat(port),
983
- logUrl: "http://127.0.0.1:".concat(port, "/logs"),
984
- developer: {
985
- tool: "expo-cli",
986
- projectRoot: root
987
- },
988
- packagerOpts: {
989
- dev: !0
990
- },
991
- mainModuleName: "index",
992
- __flipperHack: "React Native packager is running",
993
- hostUri: "127.0.0.1:".concat(port),
994
- bundleUrl: "http://127.0.0.1:".concat(port, "/index.bundle?platform=ios&dev=true&hot=false&lazy=true"),
995
- id: "@anonymous/myapp-473c4543-3c36-4786-9db1-c66a62ac9b78"
996
- };
997
- }
998
- function bindKeypressInput() {
999
- if (!process.stdin.setRawMode) {
1000
- console.warn({
1001
- msg: "Interactive mode is not supported in this environment"
1002
- });
1003
- return;
1004
- }
1005
- readline.emitKeypressEvents(process.stdin), process.stdin.setRawMode(!0), process.stdin.on("keypress", function(_key, data) {
1006
- var ctrl = data.ctrl, name = data.name;
1007
- if (ctrl === !0)
1008
- switch (name) {
1009
- case "c":
1010
- process.exit();
1011
- case "z":
1012
- process.emit("SIGTSTP", "SIGTSTP");
1013
- break;
1014
- }
1015
- else
1016
- switch (name) {
1017
- case "r":
1018
- break;
1019
- case "d":
1020
- break;
1021
- case "c":
1022
- process.stdout.write("\x1B[2J\x1B[0;0H");
1023
- break;
1024
- }
1025
- });
1026
- }
1027
- function isWithin(outer, inner) {
1028
- var rel = relative(outer, inner);
1029
- return !rel.startsWith("../") && rel !== "..";
1030
- }
1031
- var entryRoot = "";
1032
- function getViteServerConfig(config) {
1033
- return _getViteServerConfig.apply(this, arguments);
1034
- }
1035
- function _getViteServerConfig() {
1036
- return _getViteServerConfig = _async_to_generator(function(config) {
1037
- var root, host, webConfig, optimizeDeps, serverConfig, _webConfig_ssr, theirNoExternal;
1038
- return _ts_generator(this, function(_state) {
1039
- return root = config.root, host = config.host, webConfig = config.webConfig, optimizeDeps = getOptimizeDeps("serve").optimizeDeps, serverConfig = mergeConfig(getBaseViteConfig({
1040
- mode: "development"
1041
- }), {
1042
- root,
1043
- clearScreen: !1,
1044
- plugins: [
1045
- reactNativeHMRPlugin(config),
1046
- {
1047
- name: "process-env-ssr",
1048
- transform: function(code, id, options) {
1049
- if (!id.includes("node_modules") && code.includes("process.env.TAMAGUI_IS_SERVER"))
1050
- return code.replaceAll("process.env.TAMAGUI_IS_SERVER", "".concat(!!(options != null && options.ssr)));
1051
- }
1052
- }
1053
- ],
1054
- optimizeDeps,
1055
- ssr: {
1056
- // noExternal true causes many incompat issues because we need things on disk to work
1057
- // eg generally node uses .cjs extensions to "switch" back to cjs mode on import, but once bundled
1058
- // this wont happen, breaking many things
1059
- // but we need react related things always so they dont duplicate
1060
- noExternal: _to_consumable_array(optimizeDeps.include).concat([
1061
- "react",
1062
- "react-dom",
1063
- "react-dom/server",
1064
- "react-dom/client"
1065
- ]),
1066
- optimizeDeps
1067
- },
1068
- server: {
1069
- hmr: {
1070
- path: "/__vxrnhmr"
1071
- },
1072
- cors: !0,
1073
- host
1074
- }
1075
- }), webConfig && (serverConfig = mergeConfig(serverConfig, webConfig), theirNoExternal = (_webConfig_ssr = webConfig.ssr) === null || _webConfig_ssr === void 0 ? void 0 : _webConfig_ssr.noExternal, theirNoExternal != null && theirNoExternal !== !0 && (serverConfig.ssr.noExternal = theirNoExternal)), process.env.DEBUG && (console.debug("server config is", serverConfig), console.debug(`server ssr
1076
- `, JSON.stringify(serverConfig.ssr, null, 2))), serverConfig = _object_spread_props(_object_spread({}, serverConfig), {
1077
- plugins: _to_consumable_array(serverConfig.plugins)
1078
- }), [
1079
- 2,
1080
- serverConfig
1081
- ];
1082
- });
1083
- }), _getViteServerConfig.apply(this, arguments);
1084
- }
1085
- function reactNativeHMRPlugin(param) {
1086
- var root = param.root;
1087
- return {
1088
- name: "client-transform",
1089
- handleHotUpdate: function(param2) {
1090
- var read = param2.read, modules = param2.modules, file = param2.file;
1091
- return _async_to_generator(function() {
1092
- var _this, _this1, _modules, module, id, code, source, importsMap, _parse, imports, accumulatedSliceOffset, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, specifier, importName, start, id1, len, extraLen, err, hotUpdateSource, err1;
1093
- return _ts_generator(this, function(_state) {
1094
- switch (_state.label) {
1095
- case 0:
1096
- return _state.trys.push([
1097
- 0,
1098
- 12,
1099
- ,
1100
- 13
1101
- ]), isWithin(root, file) ? connectedNativeClients ? (_modules = _sliced_to_array(modules, 1), module = _modules[0], module ? (id = (module == null ? void 0 : module.url) || file.replace(root, ""), [
1102
- 4,
1103
- read()
1104
- ]) : [
1105
- 2
1106
- ]) : [
1107
- 2
1108
- ] : [
1109
- 2
1110
- ];
1111
- case 1:
1112
- return code = _state.sent(), code.startsWith("'use strict';") ? [
1113
- 2
1114
- ] : code ? (source = code, [
1115
- 4,
1116
- transformForBuild(id, source)
1117
- ]) : [
1118
- 2
1119
- ];
1120
- case 2:
1121
- source = ((_this = _state.sent()) === null || _this === void 0 ? void 0 : _this.code) || "", importsMap = {}, _parse = _sliced_to_array(parse(source), 1), imports = _parse[0], accumulatedSliceOffset = 0, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0, _state.label = 3;
1122
- case 3:
1123
- _state.trys.push([
1124
- 3,
1125
- 8,
1126
- 9,
1127
- 10
1128
- ]), _iterator = imports[Symbol.iterator](), _state.label = 4;
1129
- case 4:
1130
- return (_iteratorNormalCompletion = (_step = _iterator.next()).done) ? [
1131
- 3,
1132
- 7
1133
- ] : (specifier = _step.value, importName = specifier.n, start = specifier.s, importName ? [
1134
- 4,
1135
- getVitePath(entryRoot, file, importName)
1136
- ] : [
1137
- 3,
1138
- 6
1139
- ]);
1140
- case 5:
1141
- if (id1 = _state.sent(), !id1)
1142
- return console.warn("???"), [
1143
- 3,
1144
- 6
1145
- ];
1146
- importsMap[id1] = id1.replace(/^(\.\.\/)+/, ""), len = importName.length, extraLen = id1.length - len, source = source.slice(0, start + accumulatedSliceOffset) + id1 + source.slice(start + accumulatedSliceOffset + len), accumulatedSliceOffset += extraLen, _state.label = 6;
1147
- case 6:
1148
- return _iteratorNormalCompletion = !0, [
1149
- 3,
1150
- 4
1151
- ];
1152
- case 7:
1153
- return [
1154
- 3,
1155
- 10
1156
- ];
1157
- case 8:
1158
- return err = _state.sent(), _didIteratorError = !0, _iteratorError = err, [
1159
- 3,
1160
- 10
1161
- ];
1162
- case 9:
1163
- try {
1164
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
1165
- } finally {
1166
- if (_didIteratorError)
1167
- throw _iteratorError;
1168
- }
1169
- return [
1170
- 7
1171
- ];
1172
- case 10:
1173
- return [
1174
- 4,
1175
- swcTransform(id, source, {
1176
- mode: "serve-cjs"
1177
- })
1178
- ];
1179
- case 11:
1180
- if (source = ((_this1 = _state.sent()) === null || _this1 === void 0 ? void 0 : _this1.code) || "", !source)
1181
- throw "\u274C no source";
1182
- return importsMap.currentPath = id, hotUpdateSource = `exports = ((exports) => {
1183
- const require = createRequire(`.concat(JSON.stringify(importsMap, null, 2), `)
1184
- `).concat(source.replace("import.meta.hot.accept(() => {})", "").replaceAll(/import.meta.glob\(.*\)/gi, "globalThis['__importMetaGlobbed'] || {}"), `;
1185
- return exports })({})`), process.env.DEBUG && console.info("Sending hot update", hotUpdateSource), hotUpdateCache.set(id, hotUpdateSource), [
1186
- 3,
1187
- 13
1188
- ];
1189
- case 12:
1190
- return err1 = _state.sent(), console.error("Error processing hmr update:", err1), [
1191
- 3,
1192
- 13
1193
- ];
1194
- case 13:
1195
- return [
1196
- 2
1197
- ];
1198
- }
1199
- });
1200
- })();
1201
- }
1202
- };
1203
- }
1204
487
  export {
1205
- bindKeypressInput,
1206
- dev,
1207
- resolveFile
488
+ dev
1208
489
  };
1209
490
  //# sourceMappingURL=dev.js.map