vxrn 0.1.19 → 0.1.21
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.
- package/dist/cjs/build.js +57 -8
- package/dist/cjs/build.js.map +2 -2
- package/dist/cjs/build.native.js +180 -8
- package/dist/cjs/build.native.js.map +2 -2
- package/dist/cjs/cli.js +77 -3
- package/dist/cjs/cli.js.map +2 -2
- package/dist/cjs/cli.native.js +268 -2
- package/dist/cjs/cli.native.js.map +2 -2
- package/dist/cjs/constants.js +21 -0
- package/dist/cjs/constants.js.map +6 -0
- package/dist/cjs/constants.native.js +26 -0
- package/dist/cjs/constants.native.js.map +6 -0
- package/dist/cjs/createDevServer.js +9 -10
- package/dist/cjs/createDevServer.js.map +1 -1
- package/dist/cjs/createDevServer.native.js +9 -11
- package/dist/cjs/createDevServer.native.js.map +2 -2
- package/dist/cjs/createExpoServer.js +34 -0
- package/dist/cjs/createExpoServer.js.map +6 -0
- package/dist/cjs/createExpoServer.native.js +42 -0
- package/dist/cjs/createExpoServer.native.js.map +6 -0
- package/dist/cjs/{getBaseViteConfig.js → dispose.js} +12 -24
- package/dist/cjs/dispose.js.map +6 -0
- package/dist/cjs/{getBaseViteConfig.native.js → dispose.native.js} +16 -26
- package/dist/cjs/dispose.native.js.map +6 -0
- package/dist/cjs/exports/build.js +145 -0
- package/dist/cjs/exports/build.js.map +6 -0
- package/dist/cjs/exports/build.native.js +409 -0
- package/dist/cjs/exports/build.native.js.map +6 -0
- package/dist/cjs/exports/checkPatches.js +62 -0
- package/dist/cjs/exports/checkPatches.js.map +6 -0
- package/dist/cjs/{getOptionsFIlled.native.js → exports/checkPatches.native.js} +106 -124
- package/dist/cjs/exports/checkPatches.native.js.map +6 -0
- package/dist/cjs/{create.js → exports/dev.js} +90 -168
- package/dist/cjs/exports/dev.js.map +6 -0
- package/dist/cjs/{create.native.js → exports/dev.native.js} +148 -357
- package/dist/cjs/exports/dev.native.js.map +6 -0
- package/dist/cjs/{dev/bindKeypressInput.js → exports/serve.js} +31 -40
- package/dist/cjs/exports/serve.js.map +6 -0
- package/dist/cjs/{getVitePath.native.js → exports/serve.native.js} +99 -60
- package/dist/cjs/exports/serve.native.js.map +6 -0
- package/dist/cjs/index.js +2 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +3 -5
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/plugins/clientBundleTreeShakePlugin.js +69 -0
- package/dist/cjs/plugins/clientBundleTreeShakePlugin.js.map +6 -0
- package/dist/cjs/plugins/clientBundleTreeShakePlugin.native.js +97 -0
- package/dist/cjs/plugins/clientBundleTreeShakePlugin.native.js.map +6 -0
- package/dist/cjs/plugins/clientInjectPlugin.js +66 -0
- package/dist/cjs/plugins/clientInjectPlugin.js.map +6 -0
- package/dist/cjs/plugins/clientInjectPlugin.native.js +190 -0
- package/dist/cjs/plugins/clientInjectPlugin.native.js.map +6 -0
- package/dist/cjs/plugins/reactNativeCommonJsPlugin.js +89 -0
- package/dist/cjs/plugins/reactNativeCommonJsPlugin.js.map +6 -0
- package/dist/cjs/plugins/reactNativeCommonJsPlugin.native.js +346 -0
- package/dist/cjs/plugins/reactNativeCommonJsPlugin.native.js.map +6 -0
- package/dist/cjs/utils/checkPatches.js +62 -0
- package/dist/cjs/utils/checkPatches.js.map +6 -0
- package/dist/cjs/{VXRNConfigFilled.native.js → utils/checkPatches.native.js} +106 -124
- package/dist/cjs/utils/checkPatches.native.js.map +6 -0
- package/dist/cjs/utils/dispose.js +28 -0
- package/dist/cjs/utils/dispose.js.map +6 -0
- package/dist/cjs/utils/dispose.native.js +36 -0
- package/dist/cjs/utils/dispose.native.js.map +6 -0
- package/dist/cjs/utils/getBaseViteConfig.js +2 -2
- package/dist/cjs/utils/getBaseViteConfig.js.map +1 -1
- package/dist/cjs/utils/getBaseViteConfig.native.js +2 -2
- package/dist/cjs/utils/getBaseViteConfig.native.js.map +1 -1
- package/dist/cjs/utils/getOptionsFilled.js +3 -3
- package/dist/cjs/utils/getOptionsFilled.js.map +2 -2
- package/dist/cjs/utils/getOptionsFilled.native.js +4 -3
- package/dist/cjs/utils/getOptionsFilled.native.js.map +2 -2
- package/dist/cjs/utils/patches.js +62 -0
- package/dist/cjs/utils/patches.js.map +6 -0
- package/dist/cjs/utils/patches.native.js +289 -0
- package/dist/cjs/utils/patches.native.js.map +6 -0
- package/dist/cjs/utils/prerender.js +1 -0
- package/dist/cjs/utils/prerender.js.map +6 -0
- package/dist/cjs/utils/prerender.native.js +2 -0
- package/dist/cjs/utils/prerender.native.js.map +6 -0
- package/dist/cjs/vendor/createExpoServer.js +34 -0
- package/dist/cjs/vendor/createExpoServer.js.map +6 -0
- package/dist/cjs/vendor/createExpoServer.native.js +42 -0
- package/dist/cjs/vendor/createExpoServer.native.js.map +6 -0
- package/dist/esm/build.js +51 -6
- package/dist/esm/build.js.map +2 -2
- package/dist/esm/build.mjs +68 -5
- package/dist/esm/build.native.js +174 -6
- package/dist/esm/build.native.js.map +2 -2
- package/dist/esm/cli.js +58 -3
- package/dist/esm/cli.js.map +2 -2
- package/dist/esm/cli.mjs +81 -9
- package/dist/esm/cli.native.js +249 -3
- package/dist/esm/cli.native.js.map +2 -2
- package/dist/esm/constants.js +5 -0
- package/dist/esm/constants.js.map +6 -0
- package/dist/esm/constants.mjs +2 -0
- package/dist/esm/constants.native.js +5 -0
- package/dist/esm/constants.native.js.map +6 -0
- package/dist/esm/createDevServer.js +10 -9
- package/dist/esm/createDevServer.js.map +1 -1
- package/dist/esm/createDevServer.mjs +8 -12
- package/dist/esm/createDevServer.native.js +10 -10
- package/dist/esm/createDevServer.native.js.map +2 -2
- package/dist/esm/createExpoServer.js +20 -0
- package/dist/esm/createExpoServer.js.map +6 -0
- package/dist/esm/createExpoServer.mjs +17 -0
- package/dist/esm/createExpoServer.native.js +22 -0
- package/dist/esm/createExpoServer.native.js.map +6 -0
- package/dist/esm/dispose.js +12 -0
- package/dist/esm/dispose.js.map +6 -0
- package/dist/esm/dispose.mjs +8 -0
- package/dist/esm/dispose.native.js +14 -0
- package/dist/esm/dispose.native.js.map +6 -0
- package/dist/esm/exports/build.js +128 -0
- package/dist/esm/exports/build.js.map +6 -0
- package/dist/esm/exports/build.mjs +119 -0
- package/dist/esm/exports/build.native.js +385 -0
- package/dist/esm/exports/build.native.js.map +6 -0
- package/dist/esm/exports/checkPatches.js +40 -0
- package/dist/esm/exports/checkPatches.js.map +6 -0
- package/dist/esm/exports/checkPatches.mjs +31 -0
- package/dist/esm/exports/checkPatches.native.js +262 -0
- package/dist/esm/exports/checkPatches.native.js.map +6 -0
- package/dist/esm/{create.js → exports/dev.js} +94 -171
- package/dist/esm/exports/dev.js.map +6 -0
- package/dist/esm/exports/dev.mjs +543 -0
- package/dist/esm/{create.native.js → exports/dev.native.js} +150 -359
- package/dist/esm/exports/dev.native.js.map +6 -0
- package/dist/esm/exports/serve.js +33 -0
- package/dist/esm/exports/serve.js.map +6 -0
- package/dist/esm/exports/serve.mjs +38 -0
- package/dist/esm/exports/serve.native.js +209 -0
- package/dist/esm/exports/serve.native.js.map +6 -0
- package/dist/esm/index.js +3 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +3 -4
- package/dist/esm/index.native.js +3 -5
- package/dist/esm/index.native.js.map +2 -2
- package/dist/esm/plugins/clientBundleTreeShakePlugin.js +46 -0
- package/dist/esm/plugins/clientBundleTreeShakePlugin.js.map +6 -0
- package/dist/esm/plugins/clientBundleTreeShakePlugin.mjs +41 -0
- package/dist/esm/plugins/clientBundleTreeShakePlugin.native.js +70 -0
- package/dist/esm/plugins/clientBundleTreeShakePlugin.native.js.map +6 -0
- package/dist/esm/plugins/clientInjectPlugin.js +42 -0
- package/dist/esm/plugins/clientInjectPlugin.js.map +6 -0
- package/dist/esm/plugins/clientInjectPlugin.mjs +56 -0
- package/dist/esm/plugins/clientInjectPlugin.native.js +161 -0
- package/dist/esm/plugins/clientInjectPlugin.native.js.map +6 -0
- package/dist/esm/plugins/reactNativeCommonJsPlugin.js +75 -0
- package/dist/esm/plugins/reactNativeCommonJsPlugin.js.map +6 -0
- package/dist/esm/plugins/reactNativeCommonJsPlugin.mjs +55 -0
- package/dist/esm/plugins/reactNativeCommonJsPlugin.native.js +327 -0
- package/dist/esm/plugins/reactNativeCommonJsPlugin.native.js.map +6 -0
- package/dist/esm/utils/checkPatches.js +40 -0
- package/dist/esm/utils/checkPatches.js.map +6 -0
- package/dist/esm/utils/checkPatches.mjs +31 -0
- package/dist/esm/utils/checkPatches.native.js +262 -0
- package/dist/esm/utils/checkPatches.native.js.map +6 -0
- package/dist/esm/utils/dispose.js +12 -0
- package/dist/esm/utils/dispose.js.map +6 -0
- package/dist/esm/utils/dispose.mjs +8 -0
- package/dist/esm/utils/dispose.native.js +14 -0
- package/dist/esm/utils/dispose.native.js.map +6 -0
- package/dist/esm/utils/getBaseViteConfig.js +1 -1
- package/dist/esm/utils/getBaseViteConfig.mjs +1 -1
- package/dist/esm/utils/getBaseViteConfig.native.js +1 -1
- package/dist/esm/utils/getOptionsFilled.js +3 -1
- package/dist/esm/utils/getOptionsFilled.js.map +2 -2
- package/dist/esm/utils/getOptionsFilled.mjs +3 -1
- package/dist/esm/utils/getOptionsFilled.native.js +4 -2
- package/dist/esm/utils/getOptionsFilled.native.js.map +2 -2
- package/dist/esm/utils/patches.js +40 -0
- package/dist/esm/utils/patches.js.map +6 -0
- package/dist/esm/utils/patches.mjs +31 -0
- package/dist/esm/utils/patches.native.js +262 -0
- package/dist/esm/utils/patches.native.js.map +6 -0
- package/dist/esm/utils/prerender.js +1 -0
- package/dist/esm/utils/prerender.js.map +6 -0
- package/dist/esm/utils/prerender.mjs +0 -0
- package/dist/esm/utils/prerender.native.js +1 -0
- package/dist/esm/utils/prerender.native.js.map +6 -0
- package/dist/esm/vendor/createExpoServer.js +20 -0
- package/dist/esm/vendor/createExpoServer.js.map +6 -0
- package/dist/esm/vendor/createExpoServer.mjs +17 -0
- package/dist/esm/vendor/createExpoServer.native.js +22 -0
- package/dist/esm/vendor/createExpoServer.native.js.map +6 -0
- package/package.json +9 -6
- package/react-native-template.js +11 -0
- package/src/cli.ts +78 -2
- package/src/exports/build.ts +197 -0
- package/src/{createDevServer.ts → exports/dev.ts} +25 -72
- package/src/exports/serve.ts +51 -0
- package/src/index.ts +3 -3
- package/src/plugins/clientBundleTreeShakePlugin.tsx +105 -0
- package/src/{dev → plugins}/clientInjectPlugin.ts +1 -12
- package/src/{nativePlugin.ts → plugins/reactNativeCommonJsPlugin.ts} +3 -26
- package/src/utils/getBaseViteConfig.ts +1 -1
- package/src/utils/getOptionsFilled.ts +6 -1
- package/src/utils/patches.ts +54 -0
- package/src/vendor/createExpoServer.ts +27 -0
- package/types/build.d.ts +4 -4
- package/types/constants.d.ts +2 -0
- package/types/createExpoServer.d.ts +4 -0
- package/types/dispose.d.ts +3 -0
- package/types/exports/build.d.ts +4 -0
- package/types/exports/dev.d.ts +13 -0
- package/types/exports/serve.d.ts +3 -0
- package/types/index.d.ts +2 -3
- package/types/plugins/clientBundleTreeShakePlugin.d.ts +13 -0
- package/types/plugins/clientBundleTreeShakePlugni.d.ts +13 -0
- package/types/plugins/clientInjectPlugin.d.ts +7 -0
- package/types/plugins/reactNativeCommonJsPlugin.d.ts +7 -0
- package/types/plugins/server-tree-shake.d.ts +13 -0
- package/types/utils/checkPatches.d.ts +3 -0
- package/types/utils/dispose.d.ts +3 -0
- package/types/utils/patches.d.ts +3 -0
- package/types/utils/prerender.d.ts +1 -0
- package/types/vendor/createExpoServer.d.ts +4 -0
- package/dist/cjs/VXRNConfigFilled.js +0 -53
- package/dist/cjs/VXRNConfigFilled.js.map +0 -6
- package/dist/cjs/VXRNConfigFilled.native.js.map +0 -6
- package/dist/cjs/create.js.map +0 -6
- package/dist/cjs/create.native.js.map +0 -6
- package/dist/cjs/dev/bindKeypressInput.js.map +0 -6
- package/dist/cjs/dev/bindKeypressInput.native.js +0 -73
- package/dist/cjs/dev/bindKeypressInput.native.js.map +0 -6
- package/dist/cjs/getBaseViteConfig.js.map +0 -6
- package/dist/cjs/getBaseViteConfig.native.js.map +0 -6
- package/dist/cjs/getOptionsFIlled.js +0 -53
- package/dist/cjs/getOptionsFIlled.js.map +0 -6
- package/dist/cjs/getOptionsFIlled.native.js.map +0 -6
- package/dist/cjs/getVitePath.js +0 -50
- package/dist/cjs/getVitePath.js.map +0 -6
- package/dist/cjs/getVitePath.native.js.map +0 -6
- package/dist/esm/VXRNConfigFilled.js +0 -30
- package/dist/esm/VXRNConfigFilled.js.map +0 -6
- package/dist/esm/VXRNConfigFilled.mjs +0 -34
- package/dist/esm/VXRNConfigFilled.native.js +0 -279
- package/dist/esm/VXRNConfigFilled.native.js.map +0 -6
- package/dist/esm/create.js.map +0 -6
- package/dist/esm/create.mjs +0 -624
- package/dist/esm/create.native.js.map +0 -6
- package/dist/esm/dev/bindKeypressInput.js +0 -40
- package/dist/esm/dev/bindKeypressInput.js.map +0 -6
- package/dist/esm/dev/bindKeypressInput.mjs +0 -41
- package/dist/esm/dev/bindKeypressInput.native.js +0 -44
- package/dist/esm/dev/bindKeypressInput.native.js.map +0 -6
- package/dist/esm/getBaseViteConfig.js +0 -24
- package/dist/esm/getBaseViteConfig.js.map +0 -6
- package/dist/esm/getBaseViteConfig.mjs +0 -23
- package/dist/esm/getBaseViteConfig.native.js +0 -25
- package/dist/esm/getBaseViteConfig.native.js.map +0 -6
- package/dist/esm/getOptionsFIlled.js +0 -30
- package/dist/esm/getOptionsFIlled.js.map +0 -6
- package/dist/esm/getOptionsFIlled.mjs +0 -34
- package/dist/esm/getOptionsFIlled.native.js +0 -279
- package/dist/esm/getOptionsFIlled.native.js.map +0 -6
- package/dist/esm/getVitePath.js +0 -28
- package/dist/esm/getVitePath.js.map +0 -6
- package/dist/esm/getVitePath.mjs +0 -21
- package/dist/esm/getVitePath.native.js +0 -170
- package/dist/esm/getVitePath.native.js.map +0 -6
- package/src/build.ts +0 -96
- package/src/commands/cli-build.ts +0 -25
- package/src/commands/cli-dev.ts +0 -47
- package/src/commands/index.ts +0 -10
- package/src/dev/createDevServer.ts +0 -234
- /package/src/{utils/constants.ts → constants.ts} +0 -0
- /package/src/{utils.ts → utils/dispose.ts} +0 -0
|
@@ -21,22 +21,21 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
22
|
mod
|
|
23
23
|
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
-
var
|
|
25
|
-
__export(
|
|
26
|
-
|
|
24
|
+
var checkPatches_exports = {};
|
|
25
|
+
__export(checkPatches_exports, {
|
|
26
|
+
checkPatches: () => checkPatches
|
|
27
27
|
});
|
|
28
|
-
module.exports = __toCommonJS(
|
|
29
|
-
var
|
|
30
|
-
const import_meta = {};
|
|
28
|
+
module.exports = __toCommonJS(checkPatches_exports);
|
|
29
|
+
var import_find_node_modules = __toESM(require("find-node-modules"), 1), import_node_path = require("node:path"), import_fs_extra = __toESM(require("fs-extra"), 1);
|
|
31
30
|
function _array_like_to_array(arr, len) {
|
|
32
31
|
(len == null || len > arr.length) && (len = arr.length);
|
|
33
32
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
34
33
|
arr2[i] = arr[i];
|
|
35
34
|
return arr2;
|
|
36
35
|
}
|
|
37
|
-
function
|
|
36
|
+
function _array_without_holes(arr) {
|
|
38
37
|
if (Array.isArray(arr))
|
|
39
|
-
return arr;
|
|
38
|
+
return _array_like_to_array(arr);
|
|
40
39
|
}
|
|
41
40
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
42
41
|
try {
|
|
@@ -62,65 +61,15 @@ function _async_to_generator(fn) {
|
|
|
62
61
|
});
|
|
63
62
|
};
|
|
64
63
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
enumerable: !0,
|
|
69
|
-
configurable: !0,
|
|
70
|
-
writable: !0
|
|
71
|
-
}) : obj[key] = value, obj;
|
|
64
|
+
function _iterable_to_array(iter) {
|
|
65
|
+
if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
66
|
+
return Array.from(iter);
|
|
72
67
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
if (_i != null) {
|
|
76
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
77
|
-
try {
|
|
78
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
79
|
-
;
|
|
80
|
-
} catch (err) {
|
|
81
|
-
_d = !0, _e = err;
|
|
82
|
-
} finally {
|
|
83
|
-
try {
|
|
84
|
-
!_n && _i.return != null && _i.return();
|
|
85
|
-
} finally {
|
|
86
|
-
if (_d)
|
|
87
|
-
throw _e;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return _arr;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function _non_iterable_rest() {
|
|
94
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
95
|
-
}
|
|
96
|
-
function _object_spread(target) {
|
|
97
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
98
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
99
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
100
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
101
|
-
}))), ownKeys2.forEach(function(key) {
|
|
102
|
-
_define_property(target, key, source[key]);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
return target;
|
|
106
|
-
}
|
|
107
|
-
function ownKeys(object, enumerableOnly) {
|
|
108
|
-
var keys = Object.keys(object);
|
|
109
|
-
if (Object.getOwnPropertySymbols) {
|
|
110
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
111
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
112
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
113
|
-
})), keys.push.apply(keys, symbols);
|
|
114
|
-
}
|
|
115
|
-
return keys;
|
|
68
|
+
function _non_iterable_spread() {
|
|
69
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
116
70
|
}
|
|
117
|
-
function
|
|
118
|
-
return
|
|
119
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
120
|
-
}), target;
|
|
121
|
-
}
|
|
122
|
-
function _sliced_to_array(arr, i) {
|
|
123
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
71
|
+
function _to_consumable_array(arr) {
|
|
72
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
124
73
|
}
|
|
125
74
|
function _unsupported_iterable_to_array(o, minLen) {
|
|
126
75
|
if (o) {
|
|
@@ -224,84 +173,117 @@ function _ts_generator(thisArg, body) {
|
|
|
224
173
|
};
|
|
225
174
|
}
|
|
226
175
|
}
|
|
227
|
-
|
|
228
|
-
|
|
176
|
+
var patches = [
|
|
177
|
+
{
|
|
178
|
+
module: "react-native-screens",
|
|
179
|
+
patchFile: "react-native-screens+3.22.1.patch"
|
|
180
|
+
}
|
|
181
|
+
];
|
|
182
|
+
function checkPatches(options) {
|
|
183
|
+
return _checkPatches.apply(this, arguments);
|
|
229
184
|
}
|
|
230
|
-
function
|
|
231
|
-
return
|
|
232
|
-
var
|
|
185
|
+
function _checkPatches() {
|
|
186
|
+
return _checkPatches = _async_to_generator(function(options) {
|
|
187
|
+
var nodeModulesDirs, patchesToCopy, didCopy, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, patch, dest, src, err;
|
|
233
188
|
return _ts_generator(this, function(_state) {
|
|
234
189
|
switch (_state.label) {
|
|
235
190
|
case 0:
|
|
236
|
-
return
|
|
191
|
+
return options.state.applyPatches === !1 ? [
|
|
192
|
+
2
|
|
193
|
+
] : (nodeModulesDirs = (0, import_find_node_modules.default)({
|
|
194
|
+
cwd: options.root
|
|
195
|
+
}).map(function(relativePath) {
|
|
196
|
+
return (0, import_node_path.join)(options.root, relativePath);
|
|
197
|
+
}), patchesToCopy = /* @__PURE__ */ new Set(), [
|
|
237
198
|
4,
|
|
238
|
-
Promise.all(
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
199
|
+
Promise.all(patches.flatMap(function(patch2) {
|
|
200
|
+
return nodeModulesDirs.flatMap(function() {
|
|
201
|
+
var _ref = _async_to_generator(function(dir) {
|
|
202
|
+
return _ts_generator(this, function(_state2) {
|
|
203
|
+
switch (_state2.label) {
|
|
204
|
+
case 0:
|
|
205
|
+
return [
|
|
206
|
+
4,
|
|
207
|
+
import_fs_extra.default.pathExists((0, import_node_path.join)(dir, patch2.module))
|
|
208
|
+
];
|
|
209
|
+
case 1:
|
|
210
|
+
return _state2.sent() && patchesToCopy.add(patch2), [
|
|
211
|
+
2
|
|
212
|
+
];
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
return function(dir) {
|
|
217
|
+
return _ref.apply(this, arguments);
|
|
218
|
+
};
|
|
219
|
+
}());
|
|
220
|
+
}))
|
|
221
|
+
]);
|
|
244
222
|
case 1:
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
]), state = _ref[0], packageJSON = _ref[1], [
|
|
223
|
+
_state.sent(), didCopy = !1, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0, _state.label = 2;
|
|
224
|
+
case 2:
|
|
225
|
+
_state.trys.push([
|
|
249
226
|
2,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
port
|
|
260
|
-
})
|
|
261
|
-
];
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
}), _getOptionsFilled.apply(this, arguments);
|
|
265
|
-
}
|
|
266
|
-
function readState(cacheDir) {
|
|
267
|
-
return _readState.apply(this, arguments);
|
|
268
|
-
}
|
|
269
|
-
function _readState() {
|
|
270
|
-
return _readState = _async_to_generator(function(cacheDir) {
|
|
271
|
-
var statePath, state, _tmp;
|
|
272
|
-
return _ts_generator(this, function(_state) {
|
|
273
|
-
switch (_state.label) {
|
|
274
|
-
case 0:
|
|
275
|
-
return statePath = (0, import_node_path.join)(cacheDir, "state.json"), [
|
|
227
|
+
8,
|
|
228
|
+
9,
|
|
229
|
+
10
|
|
230
|
+
]), _iterator = _to_consumable_array(patchesToCopy)[Symbol.iterator](), _state.label = 3;
|
|
231
|
+
case 3:
|
|
232
|
+
return (_iteratorNormalCompletion = (_step = _iterator.next()).done) ? [
|
|
233
|
+
3,
|
|
234
|
+
7
|
|
235
|
+
] : (patch = _step.value, dest = (0, import_node_path.join)(options.userPatchesDir, patch.patchFile), [
|
|
276
236
|
4,
|
|
277
|
-
|
|
278
|
-
];
|
|
279
|
-
case
|
|
237
|
+
pathExists(dest)
|
|
238
|
+
]);
|
|
239
|
+
case 4:
|
|
280
240
|
return _state.sent() ? [
|
|
241
|
+
3,
|
|
242
|
+
6
|
|
243
|
+
] : (didCopy = !0, console.info("Copying patch ".concat(patch.module)), src = (0, import_node_path.join)(options.internalPatchesDir, patch.patchFile), [
|
|
281
244
|
4,
|
|
282
|
-
import_fs_extra.default.
|
|
283
|
-
]
|
|
245
|
+
import_fs_extra.default.copy(src, dest)
|
|
246
|
+
]);
|
|
247
|
+
case 5:
|
|
248
|
+
_state.sent(), _state.label = 6;
|
|
249
|
+
case 6:
|
|
250
|
+
return _iteratorNormalCompletion = !0, [
|
|
284
251
|
3,
|
|
285
252
|
3
|
|
286
253
|
];
|
|
287
|
-
case
|
|
288
|
-
return
|
|
254
|
+
case 7:
|
|
255
|
+
return [
|
|
289
256
|
3,
|
|
290
|
-
|
|
257
|
+
10
|
|
291
258
|
];
|
|
292
|
-
case
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
259
|
+
case 8:
|
|
260
|
+
return err = _state.sent(), _didIteratorError = !0, _iteratorError = err, [
|
|
261
|
+
3,
|
|
262
|
+
10
|
|
263
|
+
];
|
|
264
|
+
case 9:
|
|
265
|
+
try {
|
|
266
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
267
|
+
} finally {
|
|
268
|
+
if (_didIteratorError)
|
|
269
|
+
throw _iteratorError;
|
|
270
|
+
}
|
|
271
|
+
return [
|
|
272
|
+
7
|
|
273
|
+
];
|
|
274
|
+
case 10:
|
|
275
|
+
return didCopy && (console.info(`
|
|
276
|
+
Please restart after applying the patch by running "npx patch-package".
|
|
277
|
+
Ideally add it to your devDependencies and as a postinstall script.
|
|
278
|
+
`), process.exit(0)), [
|
|
279
|
+
2
|
|
298
280
|
];
|
|
299
281
|
}
|
|
300
282
|
});
|
|
301
|
-
}),
|
|
283
|
+
}), _checkPatches.apply(this, arguments);
|
|
302
284
|
}
|
|
303
285
|
// Annotate the CommonJS export names for ESM import in node:
|
|
304
286
|
0 && (module.exports = {
|
|
305
|
-
|
|
287
|
+
checkPatches
|
|
306
288
|
});
|
|
307
|
-
//# sourceMappingURL=
|
|
289
|
+
//# sourceMappingURL=checkPatches.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/exports/Users/n8/vxrn/packages/vxrn/src/exports/checkPatches.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4B,0CAC5B,mBAAqB,sBACrB,kBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGpB,IAAMA,UAAU;EACd;IACEC,QAAQ;IACRC,WAAW;EACb;;AAGF,SAAsBC,aAAaC,SAAyB;SAAtCD,cAAAA,MAAAA,MAAAA,SAAAA;;SAAAA,gBAAAA;AAAAA,yBAAf,oBAAA,SAA4BC,SAAyB;QAKpDC,iBAIAC,eAYFC,SAEC,2BAAA,mBAAA,gBAAA,WAAA,OAAMC,OACHC,MAIEC,KAAAA;;;;AA3BV,iBAAIN,QAAQO,MAAMC,iBAAiB,KACjC;;eAGIP,sBAAkBQ,yBAAAA,SAAgB;YACtCC,KAAKV,QAAQW;UACf,CAAA,EAAGC,IAAI,SAACC,cAAAA;uBAAiBC,uBAAKd,QAAQW,MAAME,YAAAA;cAEtCX,gBAAgB,oBAAIa,IAAAA,GAE1B;;YAAMC,QAAQC,IACZrB,QAAQsB,QAAQ,SAACd,QAAAA;AACf,qBAAOH,gBAAgBiB,QAAO,WAAA;2BAAC,oBAAA,SAAOC,KAAAA;;;;AAChC,+BAAA;;0BAAMC,gBAAAA,QAAQC,eAAWP,uBAAKK,KAAKf,OAAMP,MAAM,CAAA;;;AAAnD,+BAAIyB,QAAA,KAAA,KACFpB,cAAcqB,IAAInB,MAAAA;;;;;gBAEtB,CAAA;gCAJsCe,KAAAA;;;;YAKxC,CAAA,CAAA;;;AAPF,iBAAA,KAAA,GAUIhB,UAAU,IAET,4BAAA,IAAA,oBAAA,IAAA,iBAAA;;;;;;;cAAA,YAAgB,qBAAGD,aAAAA,EAAAA,OAAAA,QAAAA,EAAAA;;kBAAnB,6BAAA,QAAA,UAAA,KAAA,GAAA,QAAA;;;eAAME,QAAN,MAAA,OACGC,WAAOS,uBAAKd,QAAQwB,gBAAgBpB,MAAMN,SAAS,GACnD;;YAAMuB,WAAWhB,IAAAA;;;iBAAjB,OAAA,KAAA,IAAF;;;eACFF,UAAU,IACVsB,QAAQC,KAAM,iBAA6B,OAAbtB,MAAMP,MAAM,CAAA,GACpCS,UAAMQ,uBAAKd,QAAQ2B,oBAAoBvB,MAAMN,SAAS,GAC5D;;YAAMsB,gBAAAA,QAAQQ,KAAKtB,KAAKD,IAAAA;;;AAAxB,iBAAA,KAAA;;AANC,6CAAA;;;;;;;;;;sCAAA,oBAAA,IAAA,iBAAA;;;;;;aAAA,6BAAA,UAAA,UAAA,QAAA,UAAA,OAAA;;gBAAA;oBAAA;;;;;;AAUL,iBAAIF,YACFsB,QAAQC,KACL;;;CAAA,GAGHG,QAAQC,KAAK,CAAA;;;;;EAEjB,CAAA,GAxCsB/B,cAAAA,MAAAA,MAAAA,SAAAA;;",
|
|
5
|
+
"names": ["patches", "module", "patchFile", "checkPatches", "options", "nodeModulesDirs", "patchesToCopy", "didCopy", "patch", "dest", "src", "state", "applyPatches", "findNodeModules", "cwd", "root", "map", "relativePath", "join", "Set", "Promise", "all", "flatMap", "dir", "FSExtra", "pathExists", "_state", "add", "userPatchesDir", "console", "info", "internalPatchesDir", "copy", "process", "exit"]
|
|
6
|
+
}
|
|
@@ -20,13 +20,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
20
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
21
|
mod
|
|
22
22
|
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var
|
|
24
|
-
__export(
|
|
23
|
+
var dev_exports = {};
|
|
24
|
+
__export(dev_exports, {
|
|
25
25
|
bindKeypressInput: () => bindKeypressInput,
|
|
26
|
-
|
|
26
|
+
dev: () => dev,
|
|
27
|
+
resolveFile: () => resolveFile
|
|
27
28
|
});
|
|
28
|
-
module.exports = __toCommonJS(
|
|
29
|
-
var import_node = __toESM(require("crossws/adapters/node"), 1),
|
|
29
|
+
module.exports = __toCommonJS(dev_exports);
|
|
30
|
+
var import_node = __toESM(require("crossws/adapters/node"), 1), import_h3 = require("h3"), import_h3_proxy = require("h3-proxy"), import_promises = require("node:fs/promises"), import_node_http = require("node:http"), import_node_path = require("node:path"), import_node_readline = __toESM(require("node:readline"), 1), import_ws = require("ws"), babel = __toESM(require("@babel/core"), 1), import_react_native_prebuilt = require("@vxrn/react-native-prebuilt"), import_vite_native_swc = __toESM(require("@vxrn/vite-native-swc"), 1), import_es_module_lexer = require("es-module-lexer"), import_fs_extra = __toESM(require("fs-extra"), 1), import_vite = require("vite"), import_vite_flow = __toESM(require("@vxrn/vite-flow"), 1), import_import_meta_resolve = require("import-meta-resolve"), import_clientBundleTreeShakePlugin = require("../plugins/clientBundleTreeShakePlugin"), import_clientInjectPlugin = require("../plugins/clientInjectPlugin"), import_reactNativeCommonJsPlugin = require("../plugins/reactNativeCommonJsPlugin"), import_getBaseViteConfig = require("../utils/getBaseViteConfig"), import_getOptionsFilled = require("../utils/getOptionsFilled"), import_getVitePath = require("../utils/getVitePath"), import_patches = require("../utils/patches"), import_createExpoServer = require("../vendor/createExpoServer");
|
|
30
31
|
const import_meta = {}, resolveFile = (path) => {
|
|
31
32
|
try {
|
|
32
33
|
return (0, import_import_meta_resolve.resolve)(path, import_meta.url).replace("file://", "");
|
|
@@ -53,68 +54,11 @@ const import_meta = {}, resolveFile = (path) => {
|
|
|
53
54
|
".js",
|
|
54
55
|
".css",
|
|
55
56
|
".json"
|
|
56
|
-
]
|
|
57
|
-
|
|
58
|
-
const statePath = (0, import_node_path.join)(cacheDir, "state.json");
|
|
59
|
-
return await import_fs_extra.default.pathExists(statePath) ? await import_fs_extra.default.readJSON(statePath) : {};
|
|
60
|
-
}
|
|
61
|
-
async function getOptionsFilled(options) {
|
|
62
|
-
const { host = "127.0.0.1", root = process.cwd(), port = 8081 } = options, packageRootDir = (0, import_node_path.join)(import_meta.url ?? __filename, "..", "..", "..").replace("file:", ""), cacheDir = (0, import_node_path.join)(root, "node_modules", ".cache", "vxrn"), internalPatchesDir = (0, import_node_path.join)(packageRootDir, "patches"), userPatchesDir = (0, import_node_path.join)(root, "patches"), [state, packageJSON] = await Promise.all([
|
|
63
|
-
//
|
|
64
|
-
readState(cacheDir),
|
|
65
|
-
(0, import_pkg_types.readPackageJSON)()
|
|
66
|
-
]);
|
|
67
|
-
return {
|
|
68
|
-
...options,
|
|
69
|
-
packageJSON,
|
|
70
|
-
state,
|
|
71
|
-
packageRootDir,
|
|
72
|
-
cacheDir,
|
|
73
|
-
userPatchesDir,
|
|
74
|
-
internalPatchesDir,
|
|
75
|
-
host,
|
|
76
|
-
root,
|
|
77
|
-
port
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
const { ensureDir, pathExists, pathExistsSync } = import_fs_extra.default, patches = [
|
|
81
|
-
{
|
|
82
|
-
module: "react-native-screens",
|
|
83
|
-
patchFile: "react-native-screens+3.22.1.patch"
|
|
84
|
-
}
|
|
85
|
-
];
|
|
86
|
-
async function checkPatches(options) {
|
|
87
|
-
if (options.state.applyPatches === !1)
|
|
88
|
-
return;
|
|
89
|
-
const nodeModulesDirs = (0, import_find_node_modules.default)({
|
|
90
|
-
cwd: options.root
|
|
91
|
-
}).map((relativePath) => (0, import_node_path.join)(options.root, relativePath)), patchesToCopy = /* @__PURE__ */ new Set();
|
|
92
|
-
await Promise.all(
|
|
93
|
-
patches.flatMap((patch) => nodeModulesDirs.flatMap(async (dir) => {
|
|
94
|
-
await import_fs_extra.default.pathExists((0, import_node_path.join)(dir, patch.module)) && patchesToCopy.add(patch);
|
|
95
|
-
}))
|
|
96
|
-
);
|
|
97
|
-
let didCopy = !1;
|
|
98
|
-
for (const patch of [...patchesToCopy]) {
|
|
99
|
-
const dest = (0, import_node_path.join)(options.userPatchesDir, patch.patchFile);
|
|
100
|
-
if (!await pathExists(dest)) {
|
|
101
|
-
didCopy = !0, console.info(`Copying patch ${patch.module}`);
|
|
102
|
-
const src = (0, import_node_path.join)(options.internalPatchesDir, patch.patchFile);
|
|
103
|
-
await import_fs_extra.default.copy(src, dest);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
didCopy && (console.info(
|
|
107
|
-
`
|
|
108
|
-
Please restart after applying the patch by running "npx patch-package".
|
|
109
|
-
Ideally add it to your devDependencies and as a postinstall script.
|
|
110
|
-
`
|
|
111
|
-
), process.exit(0));
|
|
112
|
-
}
|
|
113
|
-
const create = async (optionsIn) => {
|
|
114
|
-
const options = await getOptionsFilled(optionsIn), { host, port, root, cacheDir } = options;
|
|
57
|
+
], { ensureDir, pathExists, pathExistsSync } = import_fs_extra.default, dev = async (optionsIn) => {
|
|
58
|
+
const options = await (0, import_getOptionsFilled.getOptionsFilled)(optionsIn), { host, port, root, cacheDir } = options;
|
|
115
59
|
bindKeypressInput();
|
|
116
60
|
let entryRoot = "";
|
|
117
|
-
checkPatches(options).catch((err) => {
|
|
61
|
+
(0, import_patches.checkPatches)(options).catch((err) => {
|
|
118
62
|
console.error(`
|
|
119
63
|
\u{1F97A} couldn't patch`, err);
|
|
120
64
|
}), await ensureDir(cacheDir);
|
|
@@ -193,97 +137,78 @@ const create = async (optionsIn) => {
|
|
|
193
137
|
return info.contents;
|
|
194
138
|
}
|
|
195
139
|
}
|
|
196
|
-
}, depsToOptimize = ["react", "react-dom", "@react-native/normalize-color"]
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
},
|
|
220
|
-
build: {
|
|
221
|
-
commonjsOptions: {
|
|
222
|
-
transformMixedEsModules: !0
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
plugins: [
|
|
226
|
-
// this breaks web, but for native maybe we need to manually run in the native handleHotUpdate below
|
|
227
|
-
// swapRnPlugin,
|
|
228
|
-
viteFlow,
|
|
229
|
-
(0, import_plugin_react_swc.default)(),
|
|
230
|
-
// viteReactPlugin({
|
|
231
|
-
// tsDecorators: true,
|
|
232
|
-
// mode: 'serve',
|
|
233
|
-
// }),
|
|
234
|
-
{
|
|
235
|
-
name: "client-transform",
|
|
236
|
-
async handleHotUpdate({ read, modules, file }) {
|
|
237
|
-
try {
|
|
238
|
-
if (!isWithin(root, file))
|
|
239
|
-
return;
|
|
240
|
-
const [module2] = modules;
|
|
241
|
-
if (!module2)
|
|
242
|
-
return;
|
|
243
|
-
const id = module2?.url || file.replace(root, ""), code = await read();
|
|
244
|
-
if (code.startsWith("'use strict';") || !code)
|
|
245
|
-
return;
|
|
246
|
-
let source = code;
|
|
247
|
-
source = (await (0, import_vite_native_swc.transformForBuild)(id, source))?.code || "";
|
|
248
|
-
const importsMap = {}, [imports] = (0, import_es_module_lexer.parse)(source);
|
|
249
|
-
let accumulatedSliceOffset = 0;
|
|
250
|
-
for (const specifier of imports) {
|
|
251
|
-
const { n: importName, s: start } = specifier;
|
|
252
|
-
if (importName) {
|
|
253
|
-
const id2 = await (0, import_getVitePath.getVitePath)(entryRoot, file, importName);
|
|
254
|
-
if (!id2) {
|
|
255
|
-
console.warn("???");
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
importsMap[id2] = id2.replace(/^(\.\.\/)+/, "");
|
|
259
|
-
const len = importName.length, extraLen = id2.length - len;
|
|
260
|
-
source = source.slice(0, start + accumulatedSliceOffset) + id2 + source.slice(start + accumulatedSliceOffset + len), accumulatedSliceOffset += extraLen;
|
|
261
|
-
}
|
|
140
|
+
}, depsToOptimize = ["react", "react-dom", "@react-native/normalize-color"], reactNativeHMRPlugin = {
|
|
141
|
+
name: "client-transform",
|
|
142
|
+
async handleHotUpdate({ read, modules, file }) {
|
|
143
|
+
try {
|
|
144
|
+
if (!isWithin(root, file))
|
|
145
|
+
return;
|
|
146
|
+
const [module2] = modules;
|
|
147
|
+
if (!module2)
|
|
148
|
+
return;
|
|
149
|
+
const id = module2?.url || file.replace(root, ""), code = await read();
|
|
150
|
+
if (code.startsWith("'use strict';") || !code)
|
|
151
|
+
return;
|
|
152
|
+
let source = code;
|
|
153
|
+
source = (await (0, import_vite_native_swc.transformForBuild)(id, source))?.code || "";
|
|
154
|
+
const importsMap = {}, [imports] = (0, import_es_module_lexer.parse)(source);
|
|
155
|
+
let accumulatedSliceOffset = 0;
|
|
156
|
+
for (const specifier of imports) {
|
|
157
|
+
const { n: importName, s: start } = specifier;
|
|
158
|
+
if (importName) {
|
|
159
|
+
const id2 = await (0, import_getVitePath.getVitePath)(entryRoot, file, importName);
|
|
160
|
+
if (!id2) {
|
|
161
|
+
console.warn("???");
|
|
162
|
+
continue;
|
|
262
163
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
throw "\u274C no source";
|
|
267
|
-
importsMap.currentPath = id;
|
|
268
|
-
const hotUpdateSource = `exports = ((exports) => {
|
|
269
|
-
const require = createRequire(${JSON.stringify(importsMap, null, 2)})
|
|
270
|
-
${source.replace("import.meta.hot.accept(() => {})", "").replaceAll(/import.meta.glob\(.*\)/gi, "globalThis['__importMetaGlobbed'] || {}")};
|
|
271
|
-
return exports })({})`;
|
|
272
|
-
process.env.DEBUG && console.info("Sending hot update", hotUpdateSource), hotUpdatedCJSFiles.set(id, hotUpdateSource);
|
|
273
|
-
} catch (err) {
|
|
274
|
-
console.error("Error processing hmr update:", err);
|
|
164
|
+
importsMap[id2] = id2.replace(/^(\.\.\/)+/, "");
|
|
165
|
+
const len = importName.length, extraLen = id2.length - len;
|
|
166
|
+
source = source.slice(0, start + accumulatedSliceOffset) + id2 + source.slice(start + accumulatedSliceOffset + len), accumulatedSliceOffset += extraLen;
|
|
275
167
|
}
|
|
276
168
|
}
|
|
169
|
+
if (source = (await (0, import_vite_native_swc.swcTransform)(id, source, {
|
|
170
|
+
mode: "serve-cjs"
|
|
171
|
+
}))?.code || "", !source)
|
|
172
|
+
throw "\u274C no source";
|
|
173
|
+
importsMap.currentPath = id;
|
|
174
|
+
const hotUpdateSource = `exports = ((exports) => {
|
|
175
|
+
const require = createRequire(${JSON.stringify(importsMap, null, 2)})
|
|
176
|
+
${source.replace("import.meta.hot.accept(() => {})", "").replaceAll(/import.meta.glob\(.*\)/gi, "globalThis['__importMetaGlobbed'] || {}")};
|
|
177
|
+
return exports })({})`;
|
|
178
|
+
process.env.DEBUG && console.info("Sending hot update", hotUpdateSource), hotUpdatedCJSFiles.set(id, hotUpdateSource);
|
|
179
|
+
} catch (err) {
|
|
180
|
+
console.error("Error processing hmr update:", err);
|
|
277
181
|
}
|
|
278
|
-
],
|
|
279
|
-
server: {
|
|
280
|
-
hmr: {
|
|
281
|
-
path: "/__vxrnhmr"
|
|
282
|
-
},
|
|
283
|
-
cors: !0,
|
|
284
|
-
host
|
|
285
182
|
}
|
|
286
183
|
};
|
|
184
|
+
let serverConfig = (0, import_vite.mergeConfig)(
|
|
185
|
+
(0, import_getBaseViteConfig.getBaseViteConfig)({
|
|
186
|
+
mode: "development"
|
|
187
|
+
}),
|
|
188
|
+
{
|
|
189
|
+
root,
|
|
190
|
+
clearScreen: !1,
|
|
191
|
+
plugins: [
|
|
192
|
+
reactNativeHMRPlugin,
|
|
193
|
+
(0, import_clientBundleTreeShakePlugin.clientBundleTreeShakePlugin)({})
|
|
194
|
+
],
|
|
195
|
+
optimizeDeps: {
|
|
196
|
+
include: depsToOptimize,
|
|
197
|
+
exclude: Object.values(virtualModules).map((v) => v.alias),
|
|
198
|
+
force: !0,
|
|
199
|
+
esbuildOptions: {
|
|
200
|
+
resolveExtensions: extensions
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
server: {
|
|
204
|
+
hmr: {
|
|
205
|
+
path: "/__vxrnhmr"
|
|
206
|
+
},
|
|
207
|
+
cors: !0,
|
|
208
|
+
host
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
);
|
|
287
212
|
options.webConfig && (serverConfig = (0, import_vite.mergeConfig)(serverConfig, options.webConfig));
|
|
288
213
|
const resolvedConfig = await (0, import_vite.resolveConfig)(serverConfig, "serve"), viteRNClientPlugin = (0, import_clientInjectPlugin.clientInjectionsPlugin)(resolvedConfig);
|
|
289
214
|
serverConfig = {
|
|
@@ -312,7 +237,7 @@ const create = async (optionsIn) => {
|
|
|
312
237
|
console.info(" \u2192", event.path);
|
|
313
238
|
}
|
|
314
239
|
});
|
|
315
|
-
router.get(
|
|
240
|
+
(0, import_createExpoServer.createExpoServer)(root, app), router.get(
|
|
316
241
|
"/file",
|
|
317
242
|
(0, import_h3.defineEventHandler)((e) => {
|
|
318
243
|
const query = (0, import_h3.getQuery)(e);
|
|
@@ -419,7 +344,7 @@ const create = async (optionsIn) => {
|
|
|
419
344
|
app.use((0, import_h3.eventHandler)(proxyEventHandler));
|
|
420
345
|
const server = (0, import_node_http.createServer)((0, import_h3.toNodeListener)(app));
|
|
421
346
|
return server.on("upgrade", handleUpgrade), {
|
|
422
|
-
|
|
347
|
+
server,
|
|
423
348
|
viteServer,
|
|
424
349
|
async start() {
|
|
425
350
|
return server.listen(port), console.info(`Server running on http://localhost:${port}`), {
|
|
@@ -467,8 +392,9 @@ const create = async (optionsIn) => {
|
|
|
467
392
|
return await babelReanimated(code, id);
|
|
468
393
|
}
|
|
469
394
|
},
|
|
395
|
+
(0, import_clientBundleTreeShakePlugin.clientBundleTreeShakePlugin)({}),
|
|
470
396
|
viteRNClientPlugin,
|
|
471
|
-
(0,
|
|
397
|
+
(0, import_reactNativeCommonJsPlugin.reactNativeCommonJsPlugin)({
|
|
472
398
|
root,
|
|
473
399
|
port,
|
|
474
400
|
mode: "build"
|
|
@@ -477,10 +403,6 @@ const create = async (optionsIn) => {
|
|
|
477
403
|
tsDecorators: !0,
|
|
478
404
|
mode: "build"
|
|
479
405
|
}),
|
|
480
|
-
(0, import_vite_plugin_inspect.default)({
|
|
481
|
-
build: !0,
|
|
482
|
-
outputDir: ".vite-inspect"
|
|
483
|
-
}),
|
|
484
406
|
{
|
|
485
407
|
name: "treat-js-files-as-jsx",
|
|
486
408
|
async transform(code, id) {
|
|
@@ -490,7 +412,7 @@ const create = async (optionsIn) => {
|
|
|
490
412
|
}) : null;
|
|
491
413
|
}
|
|
492
414
|
}
|
|
493
|
-
],
|
|
415
|
+
].filter(Boolean),
|
|
494
416
|
appType: "custom",
|
|
495
417
|
root,
|
|
496
418
|
clearScreen: !1,
|
|
@@ -500,6 +422,13 @@ const create = async (optionsIn) => {
|
|
|
500
422
|
jsx: "automatic"
|
|
501
423
|
}
|
|
502
424
|
},
|
|
425
|
+
resolve: {
|
|
426
|
+
extensions: nativeExtensions
|
|
427
|
+
},
|
|
428
|
+
mode: "development",
|
|
429
|
+
define: {
|
|
430
|
+
"process.env.NODE_ENV": '"development"'
|
|
431
|
+
},
|
|
503
432
|
build: {
|
|
504
433
|
ssr: !1,
|
|
505
434
|
minify: !1,
|
|
@@ -514,13 +443,6 @@ const create = async (optionsIn) => {
|
|
|
514
443
|
format: "cjs"
|
|
515
444
|
}
|
|
516
445
|
}
|
|
517
|
-
},
|
|
518
|
-
resolve: {
|
|
519
|
-
extensions: nativeExtensions
|
|
520
|
-
},
|
|
521
|
-
mode: "development",
|
|
522
|
-
define: {
|
|
523
|
-
"process.env.NODE_ENV": '"development"'
|
|
524
446
|
}
|
|
525
447
|
};
|
|
526
448
|
options.buildConfig && (buildConfig = (0, import_vite.mergeConfig)(buildConfig, options.buildConfig)), await (0, import_vite.resolveConfig)(buildConfig, "build");
|
|
@@ -555,7 +477,7 @@ __require("${outputModule.fileName}")
|
|
|
555
477
|
`);
|
|
556
478
|
if (!appCode)
|
|
557
479
|
throw "\u274C";
|
|
558
|
-
appCode = appCode.replaceAll("undefined.accept(() => {})", "").replaceAll("undefined.accept(function() {});", "").replaceAll("(void 0).accept(() => {})", "").replaceAll("(void 0).accept(function() {});", "");
|
|
480
|
+
appCode = appCode.replaceAll("undefined.accept(() => {})", "").replaceAll("undefined.accept(function() {});", "").replaceAll("(void 0).accept(() => {})", "").replaceAll("(void 0).accept(function() {});", "").replaceAll('dist/esm/index.mjs"', 'dist/esm/index.js"');
|
|
559
481
|
const appRootParent = (0, import_node_path.join)(root, "..", ".."), 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;
|
|
560
482
|
return done(out), isBuilding = null, out;
|
|
561
483
|
}
|
|
@@ -596,7 +518,7 @@ function getIndexJsonResponse({ port, root }) {
|
|
|
596
518
|
staticConfigPath: (0, import_node_path.join)(root, "app.json"),
|
|
597
519
|
packageJsonPath: (0, import_node_path.join)(root, "package.json")
|
|
598
520
|
},
|
|
599
|
-
sdkVersion: "
|
|
521
|
+
sdkVersion: "50.0.0",
|
|
600
522
|
platforms: ["ios", "android", "web"],
|
|
601
523
|
iconUrl: `http://127.0.0.1:${port}/assets/./assets/icon.png`,
|
|
602
524
|
debuggerHost: `127.0.0.1:${port}`,
|
|
@@ -643,4 +565,4 @@ function isWithin(outer, inner) {
|
|
|
643
565
|
const rel = (0, import_node_path.relative)(outer, inner);
|
|
644
566
|
return !rel.startsWith("../") && rel !== "..";
|
|
645
567
|
}
|
|
646
|
-
//# sourceMappingURL=
|
|
568
|
+
//# sourceMappingURL=dev.js.map
|