vxrn 0.1.97 → 0.1.98

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 (194) hide show
  1. package/dist/cjs/exports/build.js.map +1 -1
  2. package/dist/cjs/exports/build.native.js.map +1 -1
  3. package/dist/cjs/exports/dev.js +1 -1
  4. package/dist/cjs/exports/dev.js.map +1 -1
  5. package/dist/cjs/exports/dev.native.js +4 -4
  6. package/dist/cjs/exports/dev.native.js.map +1 -1
  7. package/dist/cjs/index.js +1 -0
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/index.native.js +2 -0
  10. package/dist/cjs/index.native.js.map +1 -1
  11. package/dist/cjs/plugins/clientInjectPlugin.js +3 -3
  12. package/dist/cjs/plugins/clientInjectPlugin.js.map +1 -1
  13. package/dist/cjs/plugins/clientInjectPlugin.native.js +3 -3
  14. package/dist/cjs/plugins/clientInjectPlugin.native.js.map +2 -2
  15. package/dist/cjs/plugins/reactNativeCommonJsPlugin.js +116 -48
  16. package/dist/cjs/plugins/reactNativeCommonJsPlugin.js.map +1 -1
  17. package/dist/cjs/plugins/reactNativeCommonJsPlugin.native.js +208 -147
  18. package/dist/cjs/plugins/reactNativeCommonJsPlugin.native.js.map +2 -2
  19. package/dist/cjs/plugins/reactNativeHMRPlugin.js +2 -0
  20. package/dist/cjs/plugins/reactNativeHMRPlugin.js.map +1 -1
  21. package/dist/cjs/plugins/reactNativeHMRPlugin.native.js +111 -107
  22. package/dist/cjs/plugins/reactNativeHMRPlugin.native.js.map +1 -1
  23. package/dist/cjs/{exports/isWithin.js → utils/environmentUtils.js} +19 -9
  24. package/dist/cjs/utils/environmentUtils.js.map +6 -0
  25. package/dist/cjs/utils/environmentUtils.native.js +43 -0
  26. package/dist/cjs/utils/environmentUtils.native.js.map +6 -0
  27. package/dist/cjs/utils/getBaseViteConfig.js +17 -2
  28. package/dist/cjs/utils/getBaseViteConfig.js.map +1 -1
  29. package/dist/cjs/utils/getBaseViteConfig.native.js +32 -3
  30. package/dist/cjs/utils/getBaseViteConfig.native.js.map +2 -2
  31. package/dist/cjs/utils/getOptimizeDeps.js +3 -2
  32. package/dist/cjs/utils/getOptimizeDeps.js.map +1 -1
  33. package/dist/cjs/utils/getOptimizeDeps.native.js +3 -2
  34. package/dist/cjs/utils/getOptimizeDeps.native.js.map +1 -1
  35. package/dist/cjs/utils/getReactNativeBundle.js +1 -1
  36. package/dist/cjs/utils/getReactNativeBundle.js.map +1 -1
  37. package/dist/cjs/utils/getReactNativeBundle.native.js +8 -3
  38. package/dist/cjs/utils/getReactNativeBundle.native.js.map +2 -2
  39. package/dist/esm/exports/build.js.map +1 -1
  40. package/dist/esm/exports/build.native.js.map +1 -1
  41. package/dist/esm/exports/dev.js +1 -1
  42. package/dist/esm/exports/dev.js.map +1 -1
  43. package/dist/esm/exports/dev.mjs +1 -1
  44. package/dist/esm/exports/dev.native.js +4 -4
  45. package/dist/esm/exports/dev.native.js.map +1 -1
  46. package/dist/esm/index.js +1 -0
  47. package/dist/esm/index.js.map +1 -1
  48. package/dist/esm/index.mjs +1 -0
  49. package/dist/esm/index.native.js +1 -0
  50. package/dist/esm/index.native.js.map +1 -1
  51. package/dist/esm/plugins/clientInjectPlugin.js +3 -2
  52. package/dist/esm/plugins/clientInjectPlugin.js.map +1 -1
  53. package/dist/esm/plugins/clientInjectPlugin.mjs +3 -2
  54. package/dist/esm/plugins/clientInjectPlugin.native.js +3 -2
  55. package/dist/esm/plugins/clientInjectPlugin.native.js.map +2 -2
  56. package/dist/esm/plugins/reactNativeCommonJsPlugin.js +117 -48
  57. package/dist/esm/plugins/reactNativeCommonJsPlugin.js.map +1 -1
  58. package/dist/esm/plugins/reactNativeCommonJsPlugin.mjs +107 -41
  59. package/dist/esm/plugins/reactNativeCommonJsPlugin.native.js +209 -147
  60. package/dist/esm/plugins/reactNativeCommonJsPlugin.native.js.map +2 -2
  61. package/dist/esm/plugins/reactNativeHMRPlugin.js +2 -0
  62. package/dist/esm/plugins/reactNativeHMRPlugin.js.map +1 -1
  63. package/dist/esm/plugins/reactNativeHMRPlugin.mjs +2 -0
  64. package/dist/esm/plugins/reactNativeHMRPlugin.native.js +111 -107
  65. package/dist/esm/plugins/reactNativeHMRPlugin.native.js.map +1 -1
  66. package/dist/esm/utils/environmentUtils.js +19 -0
  67. package/dist/esm/utils/environmentUtils.js.map +6 -0
  68. package/dist/esm/utils/environmentUtils.mjs +13 -0
  69. package/dist/esm/utils/environmentUtils.native.js +19 -0
  70. package/dist/esm/utils/environmentUtils.native.js.map +6 -0
  71. package/dist/esm/utils/getBaseViteConfig.js +17 -2
  72. package/dist/esm/utils/getBaseViteConfig.js.map +1 -1
  73. package/dist/esm/utils/getBaseViteConfig.mjs +17 -2
  74. package/dist/esm/utils/getBaseViteConfig.native.js +32 -3
  75. package/dist/esm/utils/getBaseViteConfig.native.js.map +2 -2
  76. package/dist/esm/utils/getOptimizeDeps.js +3 -2
  77. package/dist/esm/utils/getOptimizeDeps.js.map +1 -1
  78. package/dist/esm/utils/getOptimizeDeps.mjs +1 -1
  79. package/dist/esm/utils/getOptimizeDeps.native.js +3 -2
  80. package/dist/esm/utils/getOptimizeDeps.native.js.map +1 -1
  81. package/dist/esm/utils/getReactNativeBundle.js +6 -2
  82. package/dist/esm/utils/getReactNativeBundle.js.map +1 -1
  83. package/dist/esm/utils/getReactNativeBundle.mjs +3 -2
  84. package/dist/esm/utils/getReactNativeBundle.native.js +9 -4
  85. package/dist/esm/utils/getReactNativeBundle.native.js.map +2 -2
  86. package/package.json +5 -5
  87. package/src/exports/build.ts +0 -1
  88. package/src/exports/dev.ts +4 -2
  89. package/src/index.ts +2 -0
  90. package/src/plugins/clientInjectPlugin.ts +6 -3
  91. package/src/plugins/reactNativeCommonJsPlugin.ts +159 -146
  92. package/src/plugins/reactNativeHMRPlugin.ts +4 -1
  93. package/src/utils/environmentUtils.ts +17 -0
  94. package/src/utils/getBaseViteConfig.ts +19 -1
  95. package/src/utils/getOptimizeDeps.ts +3 -2
  96. package/src/utils/getReactNativeBundle.ts +11 -2
  97. package/types/index.d.ts +1 -0
  98. package/types/plugins/reactNativeCommonJsPlugin.d.ts +1 -1
  99. package/types/plugins/reactNativeHMRPlugin.d.ts +1 -5
  100. package/types/utils/environmentUtils.d.ts +6 -0
  101. package/dist/cjs/exports/bindKeypressInput.js +0 -58
  102. package/dist/cjs/exports/bindKeypressInput.js.map +0 -6
  103. package/dist/cjs/exports/bindKeypressInput.native.js +0 -63
  104. package/dist/cjs/exports/bindKeypressInput.native.js.map +0 -6
  105. package/dist/cjs/exports/coerceToArray.js +0 -23
  106. package/dist/cjs/exports/coerceToArray.js.map +0 -6
  107. package/dist/cjs/exports/connectedNativeClients.js +0 -21
  108. package/dist/cjs/exports/connectedNativeClients.js.map +0 -6
  109. package/dist/cjs/exports/empty.js +0 -1
  110. package/dist/cjs/exports/empty.js.map +0 -6
  111. package/dist/cjs/exports/empty.native.js +0 -2
  112. package/dist/cjs/exports/empty.native.js.map +0 -6
  113. package/dist/cjs/exports/entryRoot.js +0 -69
  114. package/dist/cjs/exports/entryRoot.js.map +0 -6
  115. package/dist/cjs/exports/getIndexJsonResponse.js +0 -71
  116. package/dist/cjs/exports/getIndexJsonResponse.js.map +0 -6
  117. package/dist/cjs/exports/getIndexJsonResponse.native.js +0 -99
  118. package/dist/cjs/exports/getIndexJsonResponse.native.js.map +0 -6
  119. package/dist/cjs/exports/getReactNativeBundle.js +0 -160
  120. package/dist/cjs/exports/getReactNativeBundle.js.map +0 -6
  121. package/dist/cjs/exports/getViteServerConfig.js +0 -77
  122. package/dist/cjs/exports/getViteServerConfig.js.map +0 -6
  123. package/dist/cjs/exports/getViteServerConfig.native.js +0 -253
  124. package/dist/cjs/exports/getViteServerConfig.native.js.map +0 -6
  125. package/dist/cjs/exports/hotUpdateCache.js +0 -21
  126. package/dist/cjs/exports/hotUpdateCache.js.map +0 -6
  127. package/dist/cjs/exports/isBuildingNativeBundle.js +0 -21
  128. package/dist/cjs/exports/isBuildingNativeBundle.js.map +0 -6
  129. package/dist/cjs/exports/isWithin.js.map +0 -6
  130. package/dist/cjs/exports/reactNativeHMRPlugin.js +0 -69
  131. package/dist/cjs/exports/reactNativeHMRPlugin.js.map +0 -6
  132. package/dist/cjs/exports/swapPrebuiltReactModules.js +0 -100
  133. package/dist/cjs/exports/swapPrebuiltReactModules.js.map +0 -6
  134. package/dist/cjs/exports/uniq.js +0 -23
  135. package/dist/cjs/exports/uniq.js.map +0 -6
  136. package/dist/cjs/utils/getHtml.js +0 -49
  137. package/dist/cjs/utils/getHtml.js.map +0 -6
  138. package/dist/cjs/utils/getHtml.native.js +0 -76
  139. package/dist/cjs/utils/getHtml.native.js.map +0 -6
  140. package/dist/esm/exports/bindKeypressInput.js +0 -34
  141. package/dist/esm/exports/bindKeypressInput.js.map +0 -6
  142. package/dist/esm/exports/bindKeypressInput.mjs +0 -31
  143. package/dist/esm/exports/bindKeypressInput.native.js +0 -34
  144. package/dist/esm/exports/bindKeypressInput.native.js.map +0 -6
  145. package/dist/esm/exports/coerceToArray.js +0 -7
  146. package/dist/esm/exports/coerceToArray.js.map +0 -6
  147. package/dist/esm/exports/coerceToArray.mjs +0 -4
  148. package/dist/esm/exports/connectedNativeClients.js +0 -5
  149. package/dist/esm/exports/connectedNativeClients.js.map +0 -6
  150. package/dist/esm/exports/connectedNativeClients.mjs +0 -2
  151. package/dist/esm/exports/empty.js +0 -1
  152. package/dist/esm/exports/empty.js.map +0 -6
  153. package/dist/esm/exports/empty.mjs +0 -0
  154. package/dist/esm/exports/empty.native.js +0 -1
  155. package/dist/esm/exports/empty.native.js.map +0 -6
  156. package/dist/esm/exports/entryRoot.js +0 -58
  157. package/dist/esm/exports/entryRoot.js.map +0 -6
  158. package/dist/esm/exports/entryRoot.mjs +0 -62
  159. package/dist/esm/exports/getIndexJsonResponse.js +0 -55
  160. package/dist/esm/exports/getIndexJsonResponse.js.map +0 -6
  161. package/dist/esm/exports/getIndexJsonResponse.mjs +0 -71
  162. package/dist/esm/exports/getIndexJsonResponse.native.js +0 -78
  163. package/dist/esm/exports/getIndexJsonResponse.native.js.map +0 -6
  164. package/dist/esm/exports/getReactNativeBundle.js +0 -146
  165. package/dist/esm/exports/getReactNativeBundle.js.map +0 -6
  166. package/dist/esm/exports/getReactNativeBundle.mjs +0 -136
  167. package/dist/esm/exports/getViteServerConfig.js +0 -64
  168. package/dist/esm/exports/getViteServerConfig.js.map +0 -6
  169. package/dist/esm/exports/getViteServerConfig.mjs +0 -44
  170. package/dist/esm/exports/getViteServerConfig.native.js +0 -235
  171. package/dist/esm/exports/getViteServerConfig.native.js.map +0 -6
  172. package/dist/esm/exports/hotUpdateCache.js +0 -5
  173. package/dist/esm/exports/hotUpdateCache.js.map +0 -6
  174. package/dist/esm/exports/hotUpdateCache.mjs +0 -2
  175. package/dist/esm/exports/isBuildingNativeBundle.js +0 -5
  176. package/dist/esm/exports/isBuildingNativeBundle.js.map +0 -6
  177. package/dist/esm/exports/isBuildingNativeBundle.mjs +0 -2
  178. package/dist/esm/exports/isWithin.js +0 -9
  179. package/dist/esm/exports/isWithin.js.map +0 -6
  180. package/dist/esm/exports/isWithin.mjs +0 -6
  181. package/dist/esm/exports/reactNativeHMRPlugin.js +0 -58
  182. package/dist/esm/exports/reactNativeHMRPlugin.js.map +0 -6
  183. package/dist/esm/exports/reactNativeHMRPlugin.mjs +0 -62
  184. package/dist/esm/exports/swapPrebuiltReactModules.js +0 -87
  185. package/dist/esm/exports/swapPrebuiltReactModules.js.map +0 -6
  186. package/dist/esm/exports/swapPrebuiltReactModules.mjs +0 -73
  187. package/dist/esm/exports/uniq.js +0 -7
  188. package/dist/esm/exports/uniq.js.map +0 -6
  189. package/dist/esm/exports/uniq.mjs +0 -4
  190. package/dist/esm/utils/getHtml.js +0 -33
  191. package/dist/esm/utils/getHtml.js.map +0 -6
  192. package/dist/esm/utils/getHtml.mjs +0 -23
  193. package/dist/esm/utils/getHtml.native.js +0 -55
  194. package/dist/esm/utils/getHtml.native.js.map +0 -6
@@ -1,58 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
- var bindKeypressInput_exports = {};
24
- __export(bindKeypressInput_exports, {
25
- bindKeypressInput: () => bindKeypressInput
26
- });
27
- module.exports = __toCommonJS(bindKeypressInput_exports);
28
- var import_node_readline = __toESM(require("node:readline"), 1);
29
- function bindKeypressInput() {
30
- if (!process.stdin.setRawMode) {
31
- console.warn({
32
- msg: "Interactive mode is not supported in this environment"
33
- });
34
- return;
35
- }
36
- import_node_readline.default.emitKeypressEvents(process.stdin), process.stdin.setRawMode(!0), process.stdin.on("keypress", (_key, data) => {
37
- const { ctrl, name } = data;
38
- if (ctrl === !0)
39
- switch (name) {
40
- case "c":
41
- process.exit();
42
- case "z":
43
- process.emit("SIGTSTP", "SIGTSTP");
44
- break;
45
- }
46
- else
47
- switch (name) {
48
- case "r":
49
- break;
50
- case "d":
51
- break;
52
- case "c":
53
- process.stdout.write("\x1B[2J\x1B[0;0H");
54
- break;
55
- }
56
- });
57
- }
58
- //# sourceMappingURL=bindKeypressInput.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/exports/bindKeypressInput.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAqB;AAEd,SAAS,oBAAoB;AAClC,MAAI,CAAC,QAAQ,MAAM,YAAY;AAC7B,YAAQ,KAAK;AAAA,MACX,KAAK;AAAA,IACP,CAAC;AACD;AAAA,EACF;AAEA,uBAAAA,QAAS,mBAAmB,QAAQ,KAAK,GACzC,QAAQ,MAAM,WAAW,EAAI,GAE7B,QAAQ,MAAM,GAAG,YAAY,CAAC,MAAM,SAAS;AAC3C,UAAM,EAAE,MAAM,KAAK,IAAI;AACvB,QAAI,SAAS;AACX,cAAQ,MAAM;AAAA,QAEZ,KAAK;AACH,kBAAQ,KAAK;AAAA,QACf,KAAK;AACH,kBAAQ,KAAK,WAAW,SAAS;AACjC;AAAA,MACJ;AAAA;AAEA,cAAQ,MAAM;AAAA,QACZ,KAAK;AAKH;AAAA,QACF,KAAK;AAKH;AAAA,QACF,KAAK;AACH,kBAAQ,OAAO,MAAM,kBAAsB;AAE3C;AAAA,MACJ;AAAA,EAEJ,CAAC;AACH;",
5
- "names": ["readline"]
6
- }
@@ -1,63 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: !0 });
10
- }, __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from == "object" || typeof from == "function")
12
- for (let key of __getOwnPropNames(from))
13
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
- mod
23
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
- var bindKeypressInput_exports = {};
25
- __export(bindKeypressInput_exports, {
26
- bindKeypressInput: () => bindKeypressInput
27
- });
28
- module.exports = __toCommonJS(bindKeypressInput_exports);
29
- var import_node_readline = __toESM(require("node:readline"), 1);
30
- function bindKeypressInput() {
31
- if (!process.stdin.setRawMode) {
32
- console.warn({
33
- msg: "Interactive mode is not supported in this environment"
34
- });
35
- return;
36
- }
37
- import_node_readline.default.emitKeypressEvents(process.stdin), process.stdin.setRawMode(!0), process.stdin.on("keypress", function(_key, data) {
38
- var ctrl = data.ctrl, name = data.name;
39
- if (ctrl === !0)
40
- switch (name) {
41
- case "c":
42
- process.exit();
43
- case "z":
44
- process.emit("SIGTSTP", "SIGTSTP");
45
- break;
46
- }
47
- else
48
- switch (name) {
49
- case "r":
50
- break;
51
- case "d":
52
- break;
53
- case "c":
54
- process.stdout.write("\x1B[2J\x1B[0;0H");
55
- break;
56
- }
57
- });
58
- }
59
- // Annotate the CommonJS export names for ESM import in node:
60
- 0 && (module.exports = {
61
- bindKeypressInput
62
- });
63
- //# sourceMappingURL=bindKeypressInput.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/exports/Users/n8/vxrn/packages/vxrn/src/exports/bindKeypressInput.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;2BAAqB;AAEd,SAASA,oBAAAA;AACd,MAAI,CAACC,QAAQC,MAAMC,YAAY;AAC7BC,YAAQC,KAAK;MACXC,KAAK;IACP,CAAA;AACA;EACF;AAEAC,uBAAAA,QAASC,mBAAmBP,QAAQC,KAAK,GACzCD,QAAQC,MAAMC,WAAW,EAAA,GAEzBF,QAAQC,MAAMO,GAAG,YAAY,SAACC,MAAMC,MAAAA;AAClC,QAAQC,OAAeD,KAAfC,MAAMC,OAASF,KAATE;AACd,QAAID,SAAS;AACX,cAAQC,MAAAA;QAEN,KAAK;AACHZ,kBAAQa,KAAI;QACd,KAAK;AACHb,kBAAQc,KAAK,WAAW,SAAA;AACxB;MACJ;;AAEA,cAAQF,MAAAA;QACN,KAAK;AAKH;QACF,KAAK;AAKH;QACF,KAAK;AACHZ,kBAAQe,OAAOC,MAAM,kBAAA;AAErB;MACJ;EAEJ,CAAA;AACF;",
5
- "names": ["bindKeypressInput", "process", "stdin", "setRawMode", "console", "warn", "msg", "readline", "emitKeypressEvents", "on", "_key", "data", "ctrl", "name", "exit", "emit", "stdout", "write"]
6
- }
@@ -1,23 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var coerceToArray_exports = {};
16
- __export(coerceToArray_exports, {
17
- coerceToArray: () => coerceToArray
18
- });
19
- module.exports = __toCommonJS(coerceToArray_exports);
20
- function coerceToArray(thing) {
21
- return Array.isArray(thing) ? thing : [thing];
22
- }
23
- //# sourceMappingURL=coerceToArray.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/exports/coerceToArray.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,cAAiB,OAAqB;AACpD,SAAO,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK;AAC9C;",
5
- "names": []
6
- }
@@ -1,21 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var connectedNativeClients_exports = {};
16
- __export(connectedNativeClients_exports, {
17
- connectedNativeClients: () => connectedNativeClients
18
- });
19
- module.exports = __toCommonJS(connectedNativeClients_exports);
20
- let connectedNativeClients = 0;
21
- //# sourceMappingURL=connectedNativeClients.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/exports/connectedNativeClients.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAI,yBAAyB;",
5
- "names": []
6
- }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=empty.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "mappings": "",
5
- "names": []
6
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=empty.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "mappings": "",
5
- "names": []
6
- }
@@ -1,69 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var entryRoot_exports = {};
16
- __export(entryRoot_exports, {
17
- entryRoot: () => entryRoot,
18
- reactNativeHMRPlugin: () => reactNativeHMRPlugin
19
- });
20
- module.exports = __toCommonJS(entryRoot_exports);
21
- var import_vite_native_swc = require("@vxrn/vite-native-swc"), import_es_module_lexer = require("es-module-lexer"), import_getVitePath = require("../utils/getVitePath"), import_connectedNativeClients = require("./connectedNativeClients"), import_hotUpdateCache = require("./hotUpdateCache"), import_isWithin = require("./isWithin");
22
- let entryRoot = "";
23
- function reactNativeHMRPlugin({ root }) {
24
- return {
25
- name: "client-transform",
26
- async handleHotUpdate({ read, modules, file }) {
27
- try {
28
- if (!(0, import_isWithin.isWithin)(root, file) || !import_connectedNativeClients.connectedNativeClients)
29
- return;
30
- const [module2] = modules;
31
- if (!module2)
32
- return;
33
- const id = module2?.url || file.replace(root, ""), code = await read();
34
- if (code.startsWith("'use strict';") || !code)
35
- return;
36
- let source = code;
37
- source = (await (0, import_vite_native_swc.transformForBuild)(id, source))?.code || "";
38
- const importsMap = {}, [imports] = (0, import_es_module_lexer.parse)(source);
39
- let accumulatedSliceOffset = 0;
40
- for (const specifier of imports) {
41
- const { n: importName, s: start } = specifier;
42
- if (importName) {
43
- const id2 = await (0, import_getVitePath.getVitePath)(entryRoot, file, importName);
44
- if (!id2) {
45
- console.warn("???");
46
- continue;
47
- }
48
- importsMap[id2] = id2.replace(/^(\.\.\/)+/, "");
49
- const len = importName.length, extraLen = id2.length - len;
50
- source = source.slice(0, start + accumulatedSliceOffset) + id2 + source.slice(start + accumulatedSliceOffset + len), accumulatedSliceOffset += extraLen;
51
- }
52
- }
53
- if (source = (await (0, import_vite_native_swc.swcTransform)(id, source, {
54
- mode: "serve-cjs"
55
- }))?.code || "", !source)
56
- throw "\u274C no source";
57
- importsMap.currentPath = id;
58
- const hotUpdateSource = `exports = ((exports) => {
59
- const require = createRequire(${JSON.stringify(importsMap, null, 2)})
60
- ${source.replace("import.meta.hot.accept(() => {})", "").replaceAll(/import.meta.glob\(.*\)/gi, "globalThis['__importMetaGlobbed'] || {}")};
61
- return exports })({})`;
62
- process.env.DEBUG && console.info("Sending hot update", hotUpdateSource), import_hotUpdateCache.hotUpdateCache.set(id, hotUpdateSource);
63
- } catch (err) {
64
- console.error("Error processing hmr update:", err);
65
- }
66
- }
67
- };
68
- }
69
- //# sourceMappingURL=entryRoot.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/exports/entryRoot.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAgD,kCAChD,yBAAsB,4BAEtB,qBAA4B,iCAC5B,gCAAuC,qCACvC,wBAA+B,6BAC/B,kBAAyB;AAGlB,IAAI,YAAY;AAEhB,SAAS,qBAAqB,EAAE,KAAK,GAAqB;AAC/D,SAAO;AAAA,IACL,MAAM;AAAA,IAEN,MAAM,gBAAgB,EAAE,MAAM,SAAS,KAAK,GAAG;AAC7C,UAAI;AAIF,YAHI,KAAC,0BAAS,MAAM,IAAI,KAGpB,CAAC;AACH;AAGF,cAAM,CAACA,OAAM,IAAI;AACjB,YAAI,CAACA;AAAQ;AAEb,cAAM,KAAKA,SAAQ,OAAO,KAAK,QAAQ,MAAM,EAAE,GAEzC,OAAO,MAAM,KAAK;AAKxB,YAFI,KAAK,WAAW,eAAe,KAE/B,CAAC;AACH;AAGF,YAAI,SAAS;AAGb,kBAAU,UAAM,0CAAkB,IAAI,MAAM,IAAI,QAAQ;AAExD,cAAM,aAAa,CAAC,GAId,CAAC,OAAO,QAAI,8BAAM,MAAM;AAE9B,YAAI,yBAAyB;AAE7B,mBAAW,aAAa,SAAS;AAC/B,gBAAM,EAAE,GAAG,YAAY,GAAG,MAAM,IAAI;AAEpC,cAAI,YAAY;AACd,kBAAMC,MAAK,UAAM,gCAAY,WAAW,MAAM,UAAU;AACxD,gBAAI,CAACA,KAAI;AACP,sBAAQ,KAAK,KAAK;AAClB;AAAA,YACF;AAEA,uBAAWA,GAAE,IAAIA,IAAG,QAAQ,cAAc,EAAE;AAG5C,kBAAM,MAAM,WAAW,QACjB,WAAWA,IAAG,SAAS;AAC7B,qBACE,OAAO,MAAM,GAAG,QAAQ,sBAAsB,IAC9CA,MACA,OAAO,MAAM,QAAQ,yBAAyB,GAAG,GACnD,0BAA0B;AAAA,UAC5B;AAAA,QACF;AAUA,YAPA,UAEI,UAAM,qCAAa,IAAI,QAAQ;AAAA,UAC7B,MAAM;AAAA,QACR,CAAC,IACA,QAAQ,IAET,CAAC;AACH,gBAAM;AAGR,mBAAW,cAAiB;AAE5B,cAAM,kBAAkB;AAAA,0CACU,KAAK,UAAU,YAAY,MAAM,CAAC,CAAC;AAAA,YACjE,OACC,QAAQ,oCAAoC,EAAE,EAE9C,WAAW,4BAA4B,yCAAyC,CAAC;AAAA;AAGtF,QAAI,QAAQ,IAAI,SACd,QAAQ,KAAK,sBAAsB,eAAe,GAGpD,qCAAe,IAAI,IAAI,eAAe;AAAA,MACxC,SAAS,KAAK;AACZ,gBAAQ,MAAM,gCAAgC,GAAG;AAAA,MACnD;AAAA,IACF;AAAA,EACF;AACF;",
5
- "names": ["module", "id"]
6
- }
@@ -1,71 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var getIndexJsonResponse_exports = {};
16
- __export(getIndexJsonResponse_exports, {
17
- getIndexJsonResponse: () => getIndexJsonResponse
18
- });
19
- module.exports = __toCommonJS(getIndexJsonResponse_exports);
20
- var import_node_path = require("node:path");
21
- function getIndexJsonResponse({ port, root }) {
22
- return {
23
- name: "myapp",
24
- slug: "myapp",
25
- scheme: "myapp",
26
- version: "1.0.0",
27
- jsEngine: "jsc",
28
- orientation: "portrait",
29
- icon: "./assets/icon.png",
30
- userInterfaceStyle: "light",
31
- splash: {
32
- image: "./assets/splash.png",
33
- resizeMode: "contain",
34
- backgroundColor: "#ffffff",
35
- imageUrl: "http://127.0.0.1:8081/assets/./assets/splash.png"
36
- },
37
- updates: { fallbackToCacheTimeout: 0 },
38
- assetBundlePatterns: ["**/*"],
39
- ios: { supportsTablet: !0, bundleIdentifier: "com.natew.myapp" },
40
- android: {
41
- package: "com.tamagui.myapp",
42
- adaptiveIcon: {
43
- foregroundImage: "./assets/adaptive-icon.png",
44
- backgroundColor: "#FFFFFF",
45
- foregroundImageUrl: "http://127.0.0.1:8081/assets/./assets/adaptive-icon.png"
46
- }
47
- },
48
- web: { favicon: "./assets/favicon.png" },
49
- extra: { eas: { projectId: "061b4470-78c7-4d6a-b850-8167fb0a3434" } },
50
- _internal: {
51
- isDebug: !1,
52
- projectRoot: root,
53
- dynamicConfigPath: null,
54
- staticConfigPath: (0, import_node_path.join)(root, "app.json"),
55
- packageJsonPath: (0, import_node_path.join)(root, "package.json")
56
- },
57
- sdkVersion: "50.0.0",
58
- platforms: ["ios", "android", "web"],
59
- iconUrl: `http://127.0.0.1:${port}/assets/./assets/icon.png`,
60
- debuggerHost: `127.0.0.1:${port}`,
61
- logUrl: `http://127.0.0.1:${port}/logs`,
62
- developer: { tool: "expo-cli", projectRoot: root },
63
- packagerOpts: { dev: !0 },
64
- mainModuleName: "index",
65
- __flipperHack: "React Native packager is running",
66
- hostUri: `127.0.0.1:${port}`,
67
- bundleUrl: `http://127.0.0.1:${port}/index.bundle?platform=ios&dev=true&hot=false&lazy=true`,
68
- id: "@anonymous/myapp-473c4543-3c36-4786-9db1-c66a62ac9b78"
69
- };
70
- }
71
- //# sourceMappingURL=getIndexJsonResponse.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/exports/getIndexJsonResponse.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAqB;AAEd,SAAS,qBAAqB,EAAE,MAAM,KAAK,GAAoC;AACpF,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,IACb,MAAM;AAAA,IACN,oBAAoB;AAAA,IACpB,QAAQ;AAAA,MACN,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,iBAAiB;AAAA,MACjB,UAAU;AAAA,IACZ;AAAA,IACA,SAAS,EAAE,wBAAwB,EAAE;AAAA,IACrC,qBAAqB,CAAC,MAAM;AAAA,IAC5B,KAAK,EAAE,gBAAgB,IAAM,kBAAkB,kBAAkB;AAAA,IACjE,SAAS;AAAA,MACP,SAAS;AAAA,MACT,cAAc;AAAA,QACZ,iBAAiB;AAAA,QACjB,iBAAiB;AAAA,QACjB,oBAAoB;AAAA,MACtB;AAAA,IACF;AAAA,IACA,KAAK,EAAE,SAAS,uBAAuB;AAAA,IACvC,OAAO,EAAE,KAAK,EAAE,WAAW,uCAAuC,EAAE;AAAA,IACpE,WAAW;AAAA,MACT,SAAS;AAAA,MACT,aAAa;AAAA,MACb,mBAAmB;AAAA,MACnB,sBAAkB,uBAAK,MAAM,UAAU;AAAA,MACvC,qBAAiB,uBAAK,MAAM,cAAc;AAAA,IAC5C;AAAA,IACA,YAAY;AAAA,IACZ,WAAW,CAAC,OAAO,WAAW,KAAK;AAAA,IACnC,SAAS,oBAAoB,IAAI;AAAA,IACjC,cAAc,aAAa,IAAI;AAAA,IAC/B,QAAQ,oBAAoB,IAAI;AAAA,IAChC,WAAW,EAAE,MAAM,YAAY,aAAa,KAAK;AAAA,IACjD,cAAc,EAAE,KAAK,GAAK;AAAA,IAC1B,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,SAAS,aAAa,IAAI;AAAA,IAC1B,WAAW,oBAAoB,IAAI;AAAA,IACnC,IAAI;AAAA,EACN;AACF;",
5
- "names": []
6
- }
@@ -1,99 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
- var getIndexJsonResponse_exports = {};
17
- __export(getIndexJsonResponse_exports, {
18
- getIndexJsonResponse: () => getIndexJsonResponse
19
- });
20
- module.exports = __toCommonJS(getIndexJsonResponse_exports);
21
- var import_node_path = require("node:path");
22
- function getIndexJsonResponse(param) {
23
- var port = param.port, root = param.root;
24
- return {
25
- name: "myapp",
26
- slug: "myapp",
27
- scheme: "myapp",
28
- version: "1.0.0",
29
- jsEngine: "jsc",
30
- orientation: "portrait",
31
- icon: "./assets/icon.png",
32
- userInterfaceStyle: "light",
33
- splash: {
34
- image: "./assets/splash.png",
35
- resizeMode: "contain",
36
- backgroundColor: "#ffffff",
37
- imageUrl: "http://127.0.0.1:8081/assets/./assets/splash.png"
38
- },
39
- updates: {
40
- fallbackToCacheTimeout: 0
41
- },
42
- assetBundlePatterns: [
43
- "**/*"
44
- ],
45
- ios: {
46
- supportsTablet: !0,
47
- bundleIdentifier: "com.natew.myapp"
48
- },
49
- android: {
50
- package: "com.tamagui.myapp",
51
- adaptiveIcon: {
52
- foregroundImage: "./assets/adaptive-icon.png",
53
- backgroundColor: "#FFFFFF",
54
- foregroundImageUrl: "http://127.0.0.1:8081/assets/./assets/adaptive-icon.png"
55
- }
56
- },
57
- web: {
58
- favicon: "./assets/favicon.png"
59
- },
60
- extra: {
61
- eas: {
62
- projectId: "061b4470-78c7-4d6a-b850-8167fb0a3434"
63
- }
64
- },
65
- _internal: {
66
- isDebug: !1,
67
- projectRoot: root,
68
- dynamicConfigPath: null,
69
- staticConfigPath: (0, import_node_path.join)(root, "app.json"),
70
- packageJsonPath: (0, import_node_path.join)(root, "package.json")
71
- },
72
- sdkVersion: "50.0.0",
73
- platforms: [
74
- "ios",
75
- "android",
76
- "web"
77
- ],
78
- iconUrl: "http://127.0.0.1:".concat(port, "/assets/./assets/icon.png"),
79
- debuggerHost: "127.0.0.1:".concat(port),
80
- logUrl: "http://127.0.0.1:".concat(port, "/logs"),
81
- developer: {
82
- tool: "expo-cli",
83
- projectRoot: root
84
- },
85
- packagerOpts: {
86
- dev: !0
87
- },
88
- mainModuleName: "index",
89
- __flipperHack: "React Native packager is running",
90
- hostUri: "127.0.0.1:".concat(port),
91
- bundleUrl: "http://127.0.0.1:".concat(port, "/index.bundle?platform=ios&dev=true&hot=false&lazy=true"),
92
- id: "@anonymous/myapp-473c4543-3c36-4786-9db1-c66a62ac9b78"
93
- };
94
- }
95
- // Annotate the CommonJS export names for ESM import in node:
96
- 0 && (module.exports = {
97
- getIndexJsonResponse
98
- });
99
- //# sourceMappingURL=getIndexJsonResponse.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/exports/Users/n8/vxrn/packages/vxrn/src/exports/getIndexJsonResponse.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;;;;;uBAAqB;AAEd,SAASA,qBAAqB,OAA+C;MAA7CC,OAAF,MAAEA,MAAMC,OAAR,MAAQA;AAC3C,SAAO;IACLC,MAAM;IACNC,MAAM;IACNC,QAAQ;IACRC,SAAS;IACTC,UAAU;IACVC,aAAa;IACbC,MAAM;IACNC,oBAAoB;IACpBC,QAAQ;MACNC,OAAO;MACPC,YAAY;MACZC,iBAAiB;MACjBC,UAAU;IACZ;IACAC,SAAS;MAAEC,wBAAwB;IAAE;IACrCC,qBAAqB;MAAC;;IACtBC,KAAK;MAAEC,gBAAgB;MAAMC,kBAAkB;IAAkB;IACjEC,SAAS;MACPC,SAAS;MACTC,cAAc;QACZC,iBAAiB;QACjBX,iBAAiB;QACjBY,oBAAoB;MACtB;IACF;IACAC,KAAK;MAAEC,SAAS;IAAuB;IACvCC,OAAO;MAAEC,KAAK;QAAEC,WAAW;MAAuC;IAAE;IACpEC,WAAW;MACTC,SAAS;MACTC,aAAahC;MACbiC,mBAAmB;MACnBC,sBAAkBC,uBAAKnC,MAAM,UAAA;MAC7BoC,qBAAiBD,uBAAKnC,MAAM,cAAA;IAC9B;IACAqC,YAAY;IACZC,WAAW;MAAC;MAAO;MAAW;;IAC9BC,SAAU,oBAAwB,OAALxC,MAAK,2BAAA;IAClCyC,cAAe,aAAiB,OAALzC,IAAAA;IAC3B0C,QAAS,oBAAwB,OAAL1C,MAAK,OAAA;IACjC2C,WAAW;MAAEC,MAAM;MAAYX,aAAahC;IAAK;IACjD4C,cAAc;MAAEC,KAAK;IAAK;IAC1BC,gBAAgB;IAChBC,eAAe;IACfC,SAAU,aAAiB,OAALjD,IAAAA;IACtBkD,WAAY,oBAAwB,OAALlD,MAAK,yDAAA;IACpCmD,IAAI;EACN;AACF;",
5
- "names": ["getIndexJsonResponse", "port", "root", "name", "slug", "scheme", "version", "jsEngine", "orientation", "icon", "userInterfaceStyle", "splash", "image", "resizeMode", "backgroundColor", "imageUrl", "updates", "fallbackToCacheTimeout", "assetBundlePatterns", "ios", "supportsTablet", "bundleIdentifier", "android", "package", "adaptiveIcon", "foregroundImage", "foregroundImageUrl", "web", "favicon", "extra", "eas", "projectId", "_internal", "isDebug", "projectRoot", "dynamicConfigPath", "staticConfigPath", "join", "packageJsonPath", "sdkVersion", "platforms", "iconUrl", "debuggerHost", "logUrl", "developer", "tool", "packagerOpts", "dev", "mainModuleName", "__flipperHack", "hostUri", "bundleUrl", "id"]
6
- }
@@ -1,160 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
- var getReactNativeBundle_exports = {};
24
- __export(getReactNativeBundle_exports, {
25
- getReactNativeBundle: () => getReactNativeBundle
26
- });
27
- module.exports = __toCommonJS(getReactNativeBundle_exports);
28
- var import_promises = require("node:fs/promises"), import_node_path = require("node:path"), babel = __toESM(require("@babel/core"), 1), import_vite_native_swc = __toESM(require("@vxrn/vite-native-swc"), 1), import_vite = require("vite"), import_vite_flow = __toESM(require("@vxrn/vite-flow"), 1), import_constants = require("../constants"), import_reactNativeCommonJsPlugin = require("../plugins/reactNativeCommonJsPlugin"), import_getOptimizeDeps = require("../utils/getOptimizeDeps"), import_reactNativeHMRPlugin = require("../plugins/reactNativeHMRPlugin"), import_dev = require("./dev");
29
- async function getReactNativeBundle(options, viteRNClientPlugin) {
30
- const { root, port, cacheDir } = options, { depsToOptimize } = (0, import_getOptimizeDeps.getOptimizeDeps)("build");
31
- if (process.env.LOAD_TMP_BUNDLE) {
32
- const tmpBundle = (0, import_node_path.join)(process.cwd(), "bundle.tmp.js");
33
- if (await pathExists(tmpBundle))
34
- return 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), await (0, import_promises.readFile)(tmpBundle, "utf-8");
35
- }
36
- if (import_dev.isBuildingNativeBundle)
37
- return await import_dev.isBuildingNativeBundle;
38
- let done;
39
- import_dev.isBuildingNativeBundle = new Promise((res) => {
40
- done = res;
41
- });
42
- async function babelReanimated(input, filename) {
43
- return await new Promise((res, rej) => {
44
- babel.transform(
45
- input,
46
- {
47
- plugins: ["react-native-reanimated/plugin"],
48
- filename
49
- },
50
- (err, result) => {
51
- (!result || err) && rej(err || "no res"), res(result.code);
52
- }
53
- );
54
- });
55
- }
56
- let nativeBuildConfig = {
57
- plugins: [
58
- options.flow ? (0, import_vite_flow.default)(options.flow) : null,
59
- (0, import_dev.swapPrebuiltReactModules)(cacheDir),
60
- {
61
- name: "reanimated",
62
- async transform(code, id) {
63
- if (code.includes("worklet"))
64
- return await babelReanimated(code, id);
65
- }
66
- },
67
- viteRNClientPlugin,
68
- (0, import_reactNativeCommonJsPlugin.reactNativeCommonJsPlugin)({
69
- root,
70
- port,
71
- mode: "build"
72
- }),
73
- (0, import_vite_native_swc.default)({
74
- tsDecorators: !0,
75
- mode: "build"
76
- }),
77
- {
78
- name: "treat-js-files-as-jsx",
79
- async transform(code, id) {
80
- return id.includes("expo-status-bar") ? (0, import_vite.transformWithEsbuild)(code, id, {
81
- loader: "jsx",
82
- jsx: "automatic"
83
- }) : null;
84
- }
85
- }
86
- ].filter(Boolean),
87
- appType: "custom",
88
- root,
89
- clearScreen: !1,
90
- optimizeDeps: {
91
- include: depsToOptimize,
92
- esbuildOptions: {
93
- jsx: "automatic"
94
- }
95
- },
96
- resolve: {
97
- extensions: import_constants.nativeExtensions
98
- },
99
- mode: "development",
100
- define: {
101
- "process.env.NODE_ENV": '"development"'
102
- },
103
- build: {
104
- ssr: !1,
105
- minify: !1,
106
- commonjsOptions: {
107
- transformMixedEsModules: !0
108
- },
109
- rollupOptions: {
110
- input: options.entries.native,
111
- treeshake: !1,
112
- preserveEntrySignatures: "strict",
113
- output: {
114
- preserveModules: !0,
115
- format: "cjs"
116
- }
117
- }
118
- }
119
- };
120
- options.nativeConfig && (nativeBuildConfig = (0, import_vite.mergeConfig)(nativeBuildConfig, options.nativeConfig)), await (0, import_vite.resolveConfig)(nativeBuildConfig, "build");
121
- const buildOutput = await (0, import_vite.build)(nativeBuildConfig);
122
- if (!("output" in buildOutput))
123
- throw "\u274C";
124
- let appCode = buildOutput.output.sort((a, b) => a.isEntry ? 1 : -1).map((outputModule) => {
125
- if (outputModule.type == "chunk") {
126
- const importsMap = {
127
- currentPath: outputModule.fileName
128
- };
129
- for (const imp of outputModule.imports) {
130
- const relativePath = (0, import_node_path.relative)((0, import_node_path.dirname)(outputModule.fileName), imp);
131
- importsMap[relativePath[0] === "." ? relativePath : "./" + relativePath] = imp;
132
- }
133
- return outputModule.isEntry && (import_reactNativeHMRPlugin.entryRoot = (0, import_node_path.dirname)(outputModule.fileName)), `
134
- ___modules___["${outputModule.fileName}"] = ((exports, module) => {
135
- const require = createRequire(${JSON.stringify(importsMap, null, 2)})
136
-
137
- ${outputModule.code}
138
- })
139
-
140
- ${outputModule.isEntry ? `
141
- // run entry
142
- const __require = createRequire({})
143
- __require("react-native-web")
144
- __require("${outputModule.fileName}")
145
- ` : ""}
146
- `;
147
- }
148
- }).join(`
149
- `);
150
- if (!appCode)
151
- throw "\u274C";
152
- appCode = appCode.replaceAll('dist/esm/index.mjs"', 'dist/esm/index.js"');
153
- const appRootParent = (0, import_node_path.join)(root, "..", ".."), prebuilds = {
154
- reactJSX: (0, import_node_path.join)(cacheDir, "react-jsx-runtime.js"),
155
- react: (0, import_node_path.join)(cacheDir, "react.js"),
156
- reactNative: (0, import_node_path.join)(cacheDir, "react-native.js")
157
- }, templateFile = (0, import_dev.resolveFile)("vxrn/react-native-template.js"), out = (await (0, import_promises.readFile)(templateFile, "utf-8")).replace("_virtual/virtual_react-native.js", (0, import_node_path.relative)(appRootParent, prebuilds.reactNative)).replace("_virtual/virtual_react.js", (0, import_node_path.relative)(appRootParent, prebuilds.react)).replaceAll("_virtual/virtual_react-jsx.js", (0, import_node_path.relative)(appRootParent, prebuilds.reactJSX)) + appCode;
158
- return done(out), import_dev.isBuildingNativeBundle = null, out;
159
- }
160
- //# sourceMappingURL=getReactNativeBundle.js.map