vxrn 0.1.83 → 0.1.84
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/.depcheckrc +1 -0
- package/dist/cjs/cli.native.js +53 -58
- package/dist/cjs/cli.native.js.map +1 -1
- package/dist/cjs/exports/build.native.js +53 -58
- package/dist/cjs/exports/build.native.js.map +1 -1
- package/dist/cjs/exports/createServer.native.js +53 -58
- package/dist/cjs/exports/createServer.native.js.map +1 -1
- package/dist/cjs/exports/dev.native.js +65 -79
- package/dist/cjs/exports/dev.native.js.map +1 -1
- package/dist/cjs/exports/serve.native.js +53 -58
- package/dist/cjs/exports/serve.native.js.map +1 -1
- package/dist/cjs/plugins/clientInjectPlugin.native.js +53 -58
- package/dist/cjs/plugins/clientInjectPlugin.native.js.map +1 -1
- package/dist/cjs/plugins/reactNativeCommonJsPlugin.js +1 -2
- package/dist/cjs/plugins/reactNativeCommonJsPlugin.js.map +1 -1
- package/dist/cjs/plugins/reactNativeCommonJsPlugin.native.js +60 -72
- package/dist/cjs/plugins/reactNativeCommonJsPlugin.native.js.map +1 -1
- package/dist/cjs/plugins/reactNativeHMRPlugin.js +1 -2
- package/dist/cjs/plugins/reactNativeHMRPlugin.js.map +1 -1
- package/dist/cjs/plugins/reactNativeHMRPlugin.native.js +59 -70
- package/dist/cjs/plugins/reactNativeHMRPlugin.native.js.map +1 -1
- package/dist/cjs/utils/getBaseViteConfig.js +10 -1
- package/dist/cjs/utils/getBaseViteConfig.js.map +1 -1
- package/dist/cjs/utils/getBaseViteConfig.native.js +10 -1
- package/dist/cjs/utils/getBaseViteConfig.native.js.map +2 -2
- package/dist/cjs/utils/getOptimizeDeps.native.js +6 -12
- package/dist/cjs/utils/getOptimizeDeps.native.js.map +1 -1
- package/dist/cjs/utils/getOptionsFilled.native.js +59 -70
- package/dist/cjs/utils/getOptionsFilled.native.js.map +1 -1
- package/dist/cjs/utils/getReactNativeBundle.native.js +53 -58
- package/dist/cjs/utils/getReactNativeBundle.native.js.map +1 -1
- package/dist/cjs/utils/getVitePath.native.js +53 -58
- package/dist/cjs/utils/getVitePath.native.js.map +1 -1
- package/dist/cjs/utils/getViteServerConfig.native.js +59 -70
- package/dist/cjs/utils/getViteServerConfig.native.js.map +1 -1
- package/dist/cjs/utils/patches.native.js +59 -70
- package/dist/cjs/utils/patches.native.js.map +1 -1
- package/dist/cjs/utils/readVXRNConfig.native.js +53 -58
- package/dist/cjs/utils/readVXRNConfig.native.js.map +1 -1
- package/dist/cjs/utils/swapPrebuiltReactModules.js +1 -2
- package/dist/cjs/utils/swapPrebuiltReactModules.js.map +1 -1
- package/dist/cjs/utils/swapPrebuiltReactModules.native.js +54 -60
- package/dist/cjs/utils/swapPrebuiltReactModules.native.js.map +1 -1
- package/dist/cjs/utils/uniq.native.js +6 -12
- package/dist/cjs/utils/uniq.native.js.map +1 -1
- package/dist/cjs/vendor/debugger-app/index.js +0 -22
- package/dist/cjs/vendor/debugger-app/index.js.map +2 -2
- package/dist/cjs/vendor/debugger-app/index.native.js +0 -22
- package/dist/cjs/vendor/debugger-app/index.native.js.map +3 -3
- package/dist/cjs/vendor/debugger-app/src/debuggerWorker.js +0 -46
- package/dist/cjs/vendor/debugger-app/src/debuggerWorker.js.map +3 -3
- package/dist/cjs/vendor/debugger-app/src/debuggerWorker.native.js +0 -54
- package/dist/cjs/vendor/debugger-app/src/debuggerWorker.native.js.map +3 -3
- package/dist/cjs/vendor/debugger-app/src/index.js +0 -104
- package/dist/cjs/vendor/debugger-app/src/index.js.map +3 -3
- package/dist/cjs/vendor/debugger-app/src/index.native.js +0 -132
- package/dist/cjs/vendor/debugger-app/src/index.native.js.map +3 -3
- package/dist/esm/cli.native.js +53 -58
- package/dist/esm/cli.native.js.map +1 -1
- package/dist/esm/exports/build.native.js +53 -58
- package/dist/esm/exports/build.native.js.map +1 -1
- package/dist/esm/exports/createServer.native.js +53 -58
- package/dist/esm/exports/createServer.native.js.map +1 -1
- package/dist/esm/exports/dev.native.js +65 -79
- package/dist/esm/exports/dev.native.js.map +1 -1
- package/dist/esm/exports/serve.native.js +53 -58
- package/dist/esm/exports/serve.native.js.map +1 -1
- package/dist/esm/plugins/clientInjectPlugin.native.js +53 -58
- package/dist/esm/plugins/clientInjectPlugin.native.js.map +1 -1
- package/dist/esm/plugins/reactNativeCommonJsPlugin.js +1 -2
- package/dist/esm/plugins/reactNativeCommonJsPlugin.js.map +1 -1
- package/dist/esm/plugins/reactNativeCommonJsPlugin.native.js +60 -72
- package/dist/esm/plugins/reactNativeCommonJsPlugin.native.js.map +1 -1
- package/dist/esm/plugins/reactNativeHMRPlugin.js +1 -2
- package/dist/esm/plugins/reactNativeHMRPlugin.js.map +1 -1
- package/dist/esm/plugins/reactNativeHMRPlugin.native.js +59 -70
- package/dist/esm/plugins/reactNativeHMRPlugin.native.js.map +1 -1
- package/dist/esm/utils/getBaseViteConfig.js +10 -1
- package/dist/esm/utils/getBaseViteConfig.js.map +1 -1
- package/dist/esm/utils/getBaseViteConfig.mjs +3 -1
- package/dist/esm/utils/getBaseViteConfig.native.js +10 -1
- package/dist/esm/utils/getBaseViteConfig.native.js.map +2 -2
- package/dist/esm/utils/getOptimizeDeps.native.js +6 -12
- package/dist/esm/utils/getOptimizeDeps.native.js.map +1 -1
- package/dist/esm/utils/getOptionsFilled.native.js +59 -70
- package/dist/esm/utils/getOptionsFilled.native.js.map +1 -1
- package/dist/esm/utils/getReactNativeBundle.native.js +53 -58
- package/dist/esm/utils/getReactNativeBundle.native.js.map +1 -1
- package/dist/esm/utils/getVitePath.native.js +53 -58
- package/dist/esm/utils/getVitePath.native.js.map +1 -1
- package/dist/esm/utils/getViteServerConfig.native.js +59 -70
- package/dist/esm/utils/getViteServerConfig.native.js.map +1 -1
- package/dist/esm/utils/patches.native.js +59 -70
- package/dist/esm/utils/patches.native.js.map +1 -1
- package/dist/esm/utils/readVXRNConfig.native.js +53 -58
- package/dist/esm/utils/readVXRNConfig.native.js.map +1 -1
- package/dist/esm/utils/swapPrebuiltReactModules.js +1 -2
- package/dist/esm/utils/swapPrebuiltReactModules.js.map +1 -1
- package/dist/esm/utils/swapPrebuiltReactModules.native.js +54 -60
- package/dist/esm/utils/swapPrebuiltReactModules.native.js.map +1 -1
- package/dist/esm/utils/uniq.native.js +6 -12
- package/dist/esm/utils/uniq.native.js.map +1 -1
- package/dist/esm/vendor/debugger-app/index.js +0 -5
- package/dist/esm/vendor/debugger-app/index.js.map +2 -2
- package/dist/esm/vendor/debugger-app/index.mjs +0 -3
- package/dist/esm/vendor/debugger-app/index.native.js +0 -5
- package/dist/esm/vendor/debugger-app/index.native.js.map +3 -3
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.js +0 -46
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.js.map +3 -3
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.mjs +0 -47
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.native.js +0 -54
- package/dist/esm/vendor/debugger-app/src/debuggerWorker.native.js.map +3 -3
- package/dist/esm/vendor/debugger-app/src/index.js +0 -86
- package/dist/esm/vendor/debugger-app/src/index.js.map +2 -2
- package/dist/esm/vendor/debugger-app/src/index.mjs +0 -125
- package/dist/esm/vendor/debugger-app/src/index.native.js +0 -115
- package/dist/esm/vendor/debugger-app/src/index.native.js.map +3 -3
- package/package.json +10 -26
- package/src/utils/getBaseViteConfig.ts +10 -0
- package/src/vendor/debugger-app/index.js +2 -2
- package/src/vendor/debugger-app/src/debuggerWorker.js +77 -77
- package/src/vendor/debugger-app/src/index.js +199 -199
- package/src/vendor/debugger-app/webpack.config.cjs +70 -70
- package/src/vendor/debugger-app/index.d.ts +0 -2
|
@@ -1,47 +1 @@
|
|
|
1
|
-
onmessage = /* @__PURE__ */ function() {
|
|
2
|
-
var visibilityState, showVisibilityWarning = /* @__PURE__ */ function() {
|
|
3
|
-
var hasWarned = !1;
|
|
4
|
-
return function() {
|
|
5
|
-
hasWarned || console.warn.toString().includes("[native code]") || (hasWarned = !0, console.warn(
|
|
6
|
-
"Remote debugger is in a background tab which may cause apps to perform slowly. Fix this by foregrounding the tab (or opening it in a separate window)."
|
|
7
|
-
));
|
|
8
|
-
};
|
|
9
|
-
}(), messageHandlers = {
|
|
10
|
-
executeApplicationScript: function(message, sendReply) {
|
|
11
|
-
for (var key in message.inject)
|
|
12
|
-
self[key] = JSON.parse(message.inject[key]);
|
|
13
|
-
var error;
|
|
14
|
-
try {
|
|
15
|
-
importScripts(message.url);
|
|
16
|
-
} catch (err) {
|
|
17
|
-
error = err.message;
|
|
18
|
-
}
|
|
19
|
-
sendReply(null, error);
|
|
20
|
-
},
|
|
21
|
-
setDebuggerVisibility: function(message) {
|
|
22
|
-
visibilityState = message.visibilityState;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
return function(message) {
|
|
26
|
-
visibilityState === "hidden" && showVisibilityWarning();
|
|
27
|
-
var object = message.data, sendReply = function(result, error2) {
|
|
28
|
-
postMessage({ replyID: object.id, result, error: error2 });
|
|
29
|
-
}, handler = messageHandlers[object.method];
|
|
30
|
-
if (handler)
|
|
31
|
-
handler(object, sendReply);
|
|
32
|
-
else {
|
|
33
|
-
var returnValue = [[], [], [], 0], error;
|
|
34
|
-
try {
|
|
35
|
-
typeof __fbBatchedBridge == "object" ? returnValue = __fbBatchedBridge[object.method].apply(
|
|
36
|
-
null,
|
|
37
|
-
object.arguments
|
|
38
|
-
) : error = "Failed to call function, __fbBatchedBridge is undefined";
|
|
39
|
-
} catch (err) {
|
|
40
|
-
error = err.message;
|
|
41
|
-
} finally {
|
|
42
|
-
sendReply(JSON.stringify(returnValue), error);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}();
|
|
47
1
|
//# sourceMappingURL=debuggerWorker.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": [
|
|
3
|
+
"sources": [],
|
|
4
|
+
"mappings": "",
|
|
5
|
+
"names": []
|
|
6
6
|
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
onmessage = /* @__PURE__ */function () {
|
|
2
|
-
var visibilityState,
|
|
3
|
-
showVisibilityWarning = /* @__PURE__ */function () {
|
|
4
|
-
var hasWarned = !1;
|
|
5
|
-
return function () {
|
|
6
|
-
hasWarned || console.warn.toString().includes("[native code]") || (hasWarned = !0, console.warn("Remote debugger is in a background tab which may cause apps to perform slowly. Fix this by foregrounding the tab (or opening it in a separate window)."));
|
|
7
|
-
};
|
|
8
|
-
}(),
|
|
9
|
-
messageHandlers = {
|
|
10
|
-
executeApplicationScript: function (message, sendReply) {
|
|
11
|
-
for (var key in message.inject) self[key] = JSON.parse(message.inject[key]);
|
|
12
|
-
var error;
|
|
13
|
-
try {
|
|
14
|
-
importScripts(message.url);
|
|
15
|
-
} catch (err) {
|
|
16
|
-
error = err.message;
|
|
17
|
-
}
|
|
18
|
-
sendReply(null, error);
|
|
19
|
-
},
|
|
20
|
-
setDebuggerVisibility: function (message) {
|
|
21
|
-
visibilityState = message.visibilityState;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
return function (message) {
|
|
25
|
-
visibilityState === "hidden" && showVisibilityWarning();
|
|
26
|
-
var object = message.data,
|
|
27
|
-
sendReply = function (result, error2) {
|
|
28
|
-
postMessage({
|
|
29
|
-
replyID: object.id,
|
|
30
|
-
result,
|
|
31
|
-
error: error2
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
handler = messageHandlers[object.method];
|
|
35
|
-
if (handler) handler(object, sendReply);else {
|
|
36
|
-
var returnValue = [[], [], [], 0],
|
|
37
|
-
error;
|
|
38
|
-
try {
|
|
39
|
-
typeof __fbBatchedBridge == "object" ? returnValue = __fbBatchedBridge[object.method].apply(null, object.arguments) : error = "Failed to call function, __fbBatchedBridge is undefined";
|
|
40
|
-
} catch (err) {
|
|
41
|
-
error = err.message;
|
|
42
|
-
} finally {
|
|
43
|
-
sendReply(JSON.stringify(returnValue), error);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}();
|
|
@@ -1,55 +1 @@
|
|
|
1
|
-
onmessage = /* @__PURE__ */ function() {
|
|
2
|
-
var visibilityState, showVisibilityWarning = /* @__PURE__ */ function() {
|
|
3
|
-
var hasWarned = !1;
|
|
4
|
-
return function() {
|
|
5
|
-
hasWarned || console.warn.toString().includes("[native code]") || (hasWarned = !0, console.warn("Remote debugger is in a background tab which may cause apps to perform slowly. Fix this by foregrounding the tab (or opening it in a separate window)."));
|
|
6
|
-
};
|
|
7
|
-
}(), messageHandlers = {
|
|
8
|
-
executeApplicationScript: function(message, sendReply) {
|
|
9
|
-
for (var key in message.inject)
|
|
10
|
-
self[key] = JSON.parse(message.inject[key]);
|
|
11
|
-
var error;
|
|
12
|
-
try {
|
|
13
|
-
importScripts(message.url);
|
|
14
|
-
} catch (err) {
|
|
15
|
-
error = err.message;
|
|
16
|
-
}
|
|
17
|
-
sendReply(
|
|
18
|
-
null,
|
|
19
|
-
/* result */
|
|
20
|
-
error
|
|
21
|
-
);
|
|
22
|
-
},
|
|
23
|
-
setDebuggerVisibility: function(message) {
|
|
24
|
-
visibilityState = message.visibilityState;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
return function(message) {
|
|
28
|
-
visibilityState === "hidden" && showVisibilityWarning();
|
|
29
|
-
var object = message.data, sendReply = function(result, error2) {
|
|
30
|
-
postMessage({
|
|
31
|
-
replyID: object.id,
|
|
32
|
-
result,
|
|
33
|
-
error: error2
|
|
34
|
-
});
|
|
35
|
-
}, handler = messageHandlers[object.method];
|
|
36
|
-
if (handler)
|
|
37
|
-
handler(object, sendReply);
|
|
38
|
-
else {
|
|
39
|
-
var returnValue = [
|
|
40
|
-
[],
|
|
41
|
-
[],
|
|
42
|
-
[],
|
|
43
|
-
0
|
|
44
|
-
], error;
|
|
45
|
-
try {
|
|
46
|
-
typeof __fbBatchedBridge == "object" ? returnValue = __fbBatchedBridge[object.method].apply(null, object.arguments) : error = "Failed to call function, __fbBatchedBridge is undefined";
|
|
47
|
-
} catch (err) {
|
|
48
|
-
error = err.message;
|
|
49
|
-
} finally {
|
|
50
|
-
sendReply(JSON.stringify(returnValue), error);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}();
|
|
55
1
|
//# sourceMappingURL=debuggerWorker.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": [
|
|
3
|
+
"sources": [],
|
|
4
|
+
"mappings": "",
|
|
5
|
+
"names": []
|
|
6
6
|
}
|
|
@@ -1,87 +1 @@
|
|
|
1
|
-
import "./index.css";
|
|
2
|
-
import DebuggerWorker from "./debuggerWorker.js";
|
|
3
|
-
const blueIcon = "", grayIcon = "", orangeIcon = "", isMacLike = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform), refreshShortcut = isMacLike ? "\u2318R" : "Ctrl R";
|
|
4
|
-
window.onload = function() {
|
|
5
|
-
isMacLike || (document.getElementById("shortcut").innerHTML = "Ctrl\u21E7J"), Page.render();
|
|
6
|
-
};
|
|
7
|
-
window.onReloadClicked = function() {
|
|
8
|
-
var xhr = new XMLHttpRequest();
|
|
9
|
-
xhr.open("GET", `${window.location.origin}/reload`, !0), xhr.send();
|
|
10
|
-
};
|
|
11
|
-
const Page = window.Page = {
|
|
12
|
-
state: {
|
|
13
|
-
isDark: localStorage.getItem("darkTheme") === null ? window.matchMedia("(prefers-color-scheme: dark)").matches : localStorage.getItem("darkTheme") === "on",
|
|
14
|
-
isPriorityMaintained: localStorage.getItem("maintainPriority") === "on",
|
|
15
|
-
status: { type: "disconnected" },
|
|
16
|
-
visibilityState: document.visibilityState
|
|
17
|
-
},
|
|
18
|
-
setState(partialState) {
|
|
19
|
-
Page.state = Object.assign({}, Page.state, partialState), Page.render();
|
|
20
|
-
},
|
|
21
|
-
render() {
|
|
22
|
-
const { isDark, isPriorityMaintained, status, visibilityState } = Page.state, statusNode = document.getElementById("status");
|
|
23
|
-
switch (status.type) {
|
|
24
|
-
case "connected":
|
|
25
|
-
statusNode.innerHTML = "Debugger session #" + status.id + " active.";
|
|
26
|
-
break;
|
|
27
|
-
case "error":
|
|
28
|
-
statusNode.innerHTML = status.error.reason || "Disconnected from proxy. Attempting reconnection. Is node server running?";
|
|
29
|
-
break;
|
|
30
|
-
case "connecting":
|
|
31
|
-
case "disconnected":
|
|
32
|
-
default:
|
|
33
|
-
statusNode.innerHTML = 'Waiting, press <span class="shortcut">' + refreshShortcut + "</span> in simulator to reload and connect.";
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
const linkNode = document.querySelector("link[rel=icon]");
|
|
37
|
-
status.type === "disconnected" || status.type === "error" ? linkNode.href = grayIcon : visibilityState === "visible" || isPriorityMaintained ? linkNode.href = blueIcon : linkNode.href = orangeIcon;
|
|
38
|
-
const darkCheckbox = document.getElementById("dark");
|
|
39
|
-
document.body.classList.toggle("dark", isDark), darkCheckbox.checked = isDark, localStorage.setItem("darkTheme", isDark ? "on" : "");
|
|
40
|
-
const maintainPriorityCheckbox = document.getElementById("maintain-priority");
|
|
41
|
-
maintainPriorityCheckbox.checked = isPriorityMaintained, localStorage.setItem("maintainPriority", isPriorityMaintained ? "on" : "");
|
|
42
|
-
},
|
|
43
|
-
toggleDarkTheme() {
|
|
44
|
-
Page.setState({ isDark: !Page.state.isDark });
|
|
45
|
-
},
|
|
46
|
-
togglePriorityMaintenance() {
|
|
47
|
-
Page.setState({ isPriorityMaintained: !Page.state.isPriorityMaintained });
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
function connectToDebuggerProxy() {
|
|
51
|
-
const ws = new WebSocket(
|
|
52
|
-
"ws://" + window.location.host + "/debugger-proxy?role=debugger&name=Chrome"
|
|
53
|
-
);
|
|
54
|
-
let worker;
|
|
55
|
-
function createJSRuntime() {
|
|
56
|
-
worker = new DebuggerWorker(), worker.onmessage = function(message) {
|
|
57
|
-
ws.send(JSON.stringify(message.data));
|
|
58
|
-
}, window.onbeforeunload = function() {
|
|
59
|
-
return "If you reload this page, it is going to break the debugging session. Press " + refreshShortcut + " on the device to reload.";
|
|
60
|
-
}, updateVisibility();
|
|
61
|
-
}
|
|
62
|
-
function shutdownJSRuntime() {
|
|
63
|
-
worker && (worker.terminate(), worker = null, window.onbeforeunload = null);
|
|
64
|
-
}
|
|
65
|
-
function updateVisibility() {
|
|
66
|
-
worker && !Page.state.isPriorityMaintained && worker.postMessage({
|
|
67
|
-
method: "setDebuggerVisibility",
|
|
68
|
-
visibilityState: document.visibilityState
|
|
69
|
-
}), Page.setState({ visibilityState: document.visibilityState });
|
|
70
|
-
}
|
|
71
|
-
ws.onopen = function() {
|
|
72
|
-
Page.setState({ status: { type: "connecting" } });
|
|
73
|
-
}, ws.onmessage = function(message) {
|
|
74
|
-
if (!message.data)
|
|
75
|
-
return;
|
|
76
|
-
const object = JSON.parse(message.data);
|
|
77
|
-
if (object.$event === "client-disconnected") {
|
|
78
|
-
shutdownJSRuntime(), Page.setState({ status: { type: "disconnected" } });
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
object.method && (object.method === "prepareJSRuntime" ? (shutdownJSRuntime(), console.clear(), createJSRuntime(), ws.send(JSON.stringify({ replyID: object.id })), Page.setState({ status: { type: "connected", id: object.id } })) : object.method === "$disconnected" ? (shutdownJSRuntime(), Page.setState({ status: { type: "disconnected" } })) : worker.postMessage(object));
|
|
82
|
-
}, ws.onclose = function(error) {
|
|
83
|
-
shutdownJSRuntime(), Page.setState({ status: { type: "error", error } }), error.reason && console.warn(error.reason), setTimeout(connectToDebuggerProxy, 500);
|
|
84
|
-
}, document.addEventListener("visibilitychange", updateVisibility, !1);
|
|
85
|
-
}
|
|
86
|
-
connectToDebuggerProxy();
|
|
87
1
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"mappings": "
|
|
3
|
+
"sources": [],
|
|
4
|
+
"mappings": "",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import "./index.css";
|
|
2
|
-
import DebuggerWorker from "./debuggerWorker.js";
|
|
3
|
-
const blueIcon = "",
|
|
4
|
-
grayIcon = "",
|
|
5
|
-
orangeIcon = "",
|
|
6
|
-
isMacLike = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),
|
|
7
|
-
refreshShortcut = isMacLike ? "\u2318R" : "Ctrl R";
|
|
8
|
-
window.onload = function () {
|
|
9
|
-
isMacLike || (document.getElementById("shortcut").innerHTML = "Ctrl\u21E7J"), Page.render();
|
|
10
|
-
};
|
|
11
|
-
window.onReloadClicked = function () {
|
|
12
|
-
var xhr = new XMLHttpRequest();
|
|
13
|
-
xhr.open("GET", `${window.location.origin}/reload`, !0), xhr.send();
|
|
14
|
-
};
|
|
15
|
-
const Page = window.Page = {
|
|
16
|
-
state: {
|
|
17
|
-
isDark: localStorage.getItem("darkTheme") === null ? window.matchMedia("(prefers-color-scheme: dark)").matches : localStorage.getItem("darkTheme") === "on",
|
|
18
|
-
isPriorityMaintained: localStorage.getItem("maintainPriority") === "on",
|
|
19
|
-
status: {
|
|
20
|
-
type: "disconnected"
|
|
21
|
-
},
|
|
22
|
-
visibilityState: document.visibilityState
|
|
23
|
-
},
|
|
24
|
-
setState(partialState) {
|
|
25
|
-
Page.state = Object.assign({}, Page.state, partialState), Page.render();
|
|
26
|
-
},
|
|
27
|
-
render() {
|
|
28
|
-
const {
|
|
29
|
-
isDark,
|
|
30
|
-
isPriorityMaintained,
|
|
31
|
-
status,
|
|
32
|
-
visibilityState
|
|
33
|
-
} = Page.state,
|
|
34
|
-
statusNode = document.getElementById("status");
|
|
35
|
-
switch (status.type) {
|
|
36
|
-
case "connected":
|
|
37
|
-
statusNode.innerHTML = "Debugger session #" + status.id + " active.";
|
|
38
|
-
break;
|
|
39
|
-
case "error":
|
|
40
|
-
statusNode.innerHTML = status.error.reason || "Disconnected from proxy. Attempting reconnection. Is node server running?";
|
|
41
|
-
break;
|
|
42
|
-
case "connecting":
|
|
43
|
-
case "disconnected":
|
|
44
|
-
default:
|
|
45
|
-
statusNode.innerHTML = 'Waiting, press <span class="shortcut">' + refreshShortcut + "</span> in simulator to reload and connect.";
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
const linkNode = document.querySelector("link[rel=icon]");
|
|
49
|
-
status.type === "disconnected" || status.type === "error" ? linkNode.href = grayIcon : visibilityState === "visible" || isPriorityMaintained ? linkNode.href = blueIcon : linkNode.href = orangeIcon;
|
|
50
|
-
const darkCheckbox = document.getElementById("dark");
|
|
51
|
-
document.body.classList.toggle("dark", isDark), darkCheckbox.checked = isDark, localStorage.setItem("darkTheme", isDark ? "on" : "");
|
|
52
|
-
const maintainPriorityCheckbox = document.getElementById("maintain-priority");
|
|
53
|
-
maintainPriorityCheckbox.checked = isPriorityMaintained, localStorage.setItem("maintainPriority", isPriorityMaintained ? "on" : "");
|
|
54
|
-
},
|
|
55
|
-
toggleDarkTheme() {
|
|
56
|
-
Page.setState({
|
|
57
|
-
isDark: !Page.state.isDark
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
togglePriorityMaintenance() {
|
|
61
|
-
Page.setState({
|
|
62
|
-
isPriorityMaintained: !Page.state.isPriorityMaintained
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
function connectToDebuggerProxy() {
|
|
67
|
-
const ws = new WebSocket("ws://" + window.location.host + "/debugger-proxy?role=debugger&name=Chrome");
|
|
68
|
-
let worker;
|
|
69
|
-
function createJSRuntime() {
|
|
70
|
-
worker = new DebuggerWorker(), worker.onmessage = function (message) {
|
|
71
|
-
ws.send(JSON.stringify(message.data));
|
|
72
|
-
}, window.onbeforeunload = function () {
|
|
73
|
-
return "If you reload this page, it is going to break the debugging session. Press " + refreshShortcut + " on the device to reload.";
|
|
74
|
-
}, updateVisibility();
|
|
75
|
-
}
|
|
76
|
-
function shutdownJSRuntime() {
|
|
77
|
-
worker && (worker.terminate(), worker = null, window.onbeforeunload = null);
|
|
78
|
-
}
|
|
79
|
-
function updateVisibility() {
|
|
80
|
-
worker && !Page.state.isPriorityMaintained && worker.postMessage({
|
|
81
|
-
method: "setDebuggerVisibility",
|
|
82
|
-
visibilityState: document.visibilityState
|
|
83
|
-
}), Page.setState({
|
|
84
|
-
visibilityState: document.visibilityState
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
ws.onopen = function () {
|
|
88
|
-
Page.setState({
|
|
89
|
-
status: {
|
|
90
|
-
type: "connecting"
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}, ws.onmessage = function (message) {
|
|
94
|
-
if (!message.data) return;
|
|
95
|
-
const object = JSON.parse(message.data);
|
|
96
|
-
if (object.$event === "client-disconnected") {
|
|
97
|
-
shutdownJSRuntime(), Page.setState({
|
|
98
|
-
status: {
|
|
99
|
-
type: "disconnected"
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
object.method && (object.method === "prepareJSRuntime" ? (shutdownJSRuntime(), console.clear(), createJSRuntime(), ws.send(JSON.stringify({
|
|
105
|
-
replyID: object.id
|
|
106
|
-
})), Page.setState({
|
|
107
|
-
status: {
|
|
108
|
-
type: "connected",
|
|
109
|
-
id: object.id
|
|
110
|
-
}
|
|
111
|
-
})) : object.method === "$disconnected" ? (shutdownJSRuntime(), Page.setState({
|
|
112
|
-
status: {
|
|
113
|
-
type: "disconnected"
|
|
114
|
-
}
|
|
115
|
-
})) : worker.postMessage(object));
|
|
116
|
-
}, ws.onclose = function (error) {
|
|
117
|
-
shutdownJSRuntime(), Page.setState({
|
|
118
|
-
status: {
|
|
119
|
-
type: "error",
|
|
120
|
-
error
|
|
121
|
-
}
|
|
122
|
-
}), error.reason && console.warn(error.reason), setTimeout(connectToDebuggerProxy, 500);
|
|
123
|
-
}, document.addEventListener("visibilitychange", updateVisibility, !1);
|
|
124
|
-
}
|
|
125
|
-
connectToDebuggerProxy();
|
|
@@ -1,116 +1 @@
|
|
|
1
|
-
import "./index.css";
|
|
2
|
-
import DebuggerWorker from "./debuggerWorker.js";
|
|
3
|
-
var blueIcon = "", grayIcon = "", orangeIcon = "", isMacLike = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform), refreshShortcut = isMacLike ? "\u2318R" : "Ctrl R";
|
|
4
|
-
window.onload = function() {
|
|
5
|
-
isMacLike || (document.getElementById("shortcut").innerHTML = "Ctrl\u21E7J"), Page.render();
|
|
6
|
-
};
|
|
7
|
-
window.onReloadClicked = function() {
|
|
8
|
-
var xhr = new XMLHttpRequest();
|
|
9
|
-
xhr.open("GET", "".concat(window.location.origin, "/reload"), !0), xhr.send();
|
|
10
|
-
};
|
|
11
|
-
var Page = window.Page = {
|
|
12
|
-
state: {
|
|
13
|
-
isDark: localStorage.getItem("darkTheme") === null ? window.matchMedia("(prefers-color-scheme: dark)").matches : localStorage.getItem("darkTheme") === "on",
|
|
14
|
-
isPriorityMaintained: localStorage.getItem("maintainPriority") === "on",
|
|
15
|
-
status: {
|
|
16
|
-
type: "disconnected"
|
|
17
|
-
},
|
|
18
|
-
visibilityState: document.visibilityState
|
|
19
|
-
},
|
|
20
|
-
setState: function(partialState) {
|
|
21
|
-
Page.state = Object.assign({}, Page.state, partialState), Page.render();
|
|
22
|
-
},
|
|
23
|
-
render: function() {
|
|
24
|
-
var _Page_state = Page.state, isDark = _Page_state.isDark, isPriorityMaintained = _Page_state.isPriorityMaintained, status = _Page_state.status, visibilityState = _Page_state.visibilityState, statusNode = document.getElementById("status");
|
|
25
|
-
switch (status.type) {
|
|
26
|
-
case "connected":
|
|
27
|
-
statusNode.innerHTML = "Debugger session #" + status.id + " active.";
|
|
28
|
-
break;
|
|
29
|
-
case "error":
|
|
30
|
-
statusNode.innerHTML = status.error.reason || "Disconnected from proxy. Attempting reconnection. Is node server running?";
|
|
31
|
-
break;
|
|
32
|
-
case "connecting":
|
|
33
|
-
case "disconnected":
|
|
34
|
-
default:
|
|
35
|
-
statusNode.innerHTML = 'Waiting, press <span class="shortcut">' + refreshShortcut + "</span> in simulator to reload and connect.";
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
var linkNode = document.querySelector("link[rel=icon]");
|
|
39
|
-
status.type === "disconnected" || status.type === "error" ? linkNode.href = grayIcon : visibilityState === "visible" || isPriorityMaintained ? linkNode.href = blueIcon : linkNode.href = orangeIcon;
|
|
40
|
-
var darkCheckbox = document.getElementById("dark");
|
|
41
|
-
document.body.classList.toggle("dark", isDark), darkCheckbox.checked = isDark, localStorage.setItem("darkTheme", isDark ? "on" : "");
|
|
42
|
-
var maintainPriorityCheckbox = document.getElementById("maintain-priority");
|
|
43
|
-
maintainPriorityCheckbox.checked = isPriorityMaintained, localStorage.setItem("maintainPriority", isPriorityMaintained ? "on" : "");
|
|
44
|
-
},
|
|
45
|
-
toggleDarkTheme: function() {
|
|
46
|
-
Page.setState({
|
|
47
|
-
isDark: !Page.state.isDark
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
togglePriorityMaintenance: function() {
|
|
51
|
-
Page.setState({
|
|
52
|
-
isPriorityMaintained: !Page.state.isPriorityMaintained
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
function connectToDebuggerProxy() {
|
|
57
|
-
var ws = new WebSocket("ws://" + window.location.host + "/debugger-proxy?role=debugger&name=Chrome"), worker;
|
|
58
|
-
function createJSRuntime() {
|
|
59
|
-
worker = new DebuggerWorker(), worker.onmessage = function(message) {
|
|
60
|
-
ws.send(JSON.stringify(message.data));
|
|
61
|
-
}, window.onbeforeunload = function() {
|
|
62
|
-
return "If you reload this page, it is going to break the debugging session. Press " + refreshShortcut + " on the device to reload.";
|
|
63
|
-
}, updateVisibility();
|
|
64
|
-
}
|
|
65
|
-
function shutdownJSRuntime() {
|
|
66
|
-
worker && (worker.terminate(), worker = null, window.onbeforeunload = null);
|
|
67
|
-
}
|
|
68
|
-
function updateVisibility() {
|
|
69
|
-
worker && !Page.state.isPriorityMaintained && worker.postMessage({
|
|
70
|
-
method: "setDebuggerVisibility",
|
|
71
|
-
visibilityState: document.visibilityState
|
|
72
|
-
}), Page.setState({
|
|
73
|
-
visibilityState: document.visibilityState
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
ws.onopen = function() {
|
|
77
|
-
Page.setState({
|
|
78
|
-
status: {
|
|
79
|
-
type: "connecting"
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}, ws.onmessage = function(message) {
|
|
83
|
-
if (message.data) {
|
|
84
|
-
var object = JSON.parse(message.data);
|
|
85
|
-
if (object.$event === "client-disconnected") {
|
|
86
|
-
shutdownJSRuntime(), Page.setState({
|
|
87
|
-
status: {
|
|
88
|
-
type: "disconnected"
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
object.method && (object.method === "prepareJSRuntime" ? (shutdownJSRuntime(), console.clear(), createJSRuntime(), ws.send(JSON.stringify({
|
|
94
|
-
replyID: object.id
|
|
95
|
-
})), Page.setState({
|
|
96
|
-
status: {
|
|
97
|
-
type: "connected",
|
|
98
|
-
id: object.id
|
|
99
|
-
}
|
|
100
|
-
})) : object.method === "$disconnected" ? (shutdownJSRuntime(), Page.setState({
|
|
101
|
-
status: {
|
|
102
|
-
type: "disconnected"
|
|
103
|
-
}
|
|
104
|
-
})) : worker.postMessage(object));
|
|
105
|
-
}
|
|
106
|
-
}, ws.onclose = function(error) {
|
|
107
|
-
shutdownJSRuntime(), Page.setState({
|
|
108
|
-
status: {
|
|
109
|
-
type: "error",
|
|
110
|
-
error
|
|
111
|
-
}
|
|
112
|
-
}), error.reason && console.warn(error.reason), setTimeout(connectToDebuggerProxy, 500);
|
|
113
|
-
}, document.addEventListener("visibilitychange", updateVisibility, !1);
|
|
114
|
-
}
|
|
115
|
-
connectToDebuggerProxy();
|
|
116
1
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": [
|
|
3
|
+
"sources": [],
|
|
4
|
+
"mappings": "",
|
|
5
|
+
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxrn",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.84",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "tamagui-build",
|
|
14
14
|
"watch": "yarn build --watch",
|
|
15
|
+
"check": "yarn depcheck",
|
|
15
16
|
"clean": "tamagui-build clean",
|
|
16
17
|
"clean:build": "tamagui-build clean:build"
|
|
17
18
|
},
|
|
@@ -31,52 +32,35 @@
|
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"@babel/
|
|
35
|
+
"@babel/core": "^7.21.8",
|
|
35
36
|
"@hono/node-server": "^1.11.1",
|
|
36
|
-
"@vitejs/plugin-react": "^4.2.1",
|
|
37
37
|
"@vitejs/plugin-react-swc": "^3.6.0",
|
|
38
|
-
"@vxrn/react-native-prebuilt": "0.1.
|
|
39
|
-
"@vxrn/safe-area": "0.1.
|
|
40
|
-
"@vxrn/vite-flow": "0.1.
|
|
41
|
-
"@vxrn/vite-native-
|
|
42
|
-
"@vxrn/vite-native-hmr": "0.1.83",
|
|
43
|
-
"@vxrn/vite-native-swc": "0.1.83",
|
|
38
|
+
"@vxrn/react-native-prebuilt": "0.1.84",
|
|
39
|
+
"@vxrn/safe-area": "0.1.84",
|
|
40
|
+
"@vxrn/vite-flow": "0.1.84",
|
|
41
|
+
"@vxrn/vite-native-swc": "0.1.84",
|
|
44
42
|
"citty": "^0.1.6",
|
|
45
43
|
"crossws": "^0.2.4",
|
|
46
44
|
"es-module-lexer": "^1.3.0",
|
|
47
45
|
"esbuild": "~0.19.3",
|
|
48
|
-
"esm-resolve": "^1.0.8",
|
|
49
|
-
"fast-glob": "^3.2.11",
|
|
50
46
|
"find-node-modules": "^2.1.3",
|
|
51
47
|
"fs-extra": "^11.2.0",
|
|
52
48
|
"get-port-please": "^3.1.2",
|
|
53
49
|
"h3": "^1.11.1",
|
|
54
|
-
"h3-compression": "^0.3.2",
|
|
55
50
|
"h3-proxy": "^1.13.0",
|
|
56
51
|
"hono": "^4.3.10",
|
|
57
|
-
"import-meta-resolve": "^4.
|
|
58
|
-
"jiti": "^1.21.0",
|
|
59
|
-
"metro-inspector-proxy": "^0.71.0",
|
|
60
|
-
"mime": "^3.0.0",
|
|
61
|
-
"open-editor": "^4.1.1",
|
|
52
|
+
"import-meta-resolve": "^4.1.0",
|
|
62
53
|
"pkg-types": "^1.0.3",
|
|
63
|
-
"pretty-format": "^28.1.0",
|
|
64
|
-
"prompts": "^2.4.2",
|
|
65
|
-
"readline": "^1.3.0",
|
|
66
|
-
"rollup-plugin-node-externals": "^7.1.2",
|
|
67
|
-
"sirv": "^2.0.4",
|
|
68
|
-
"source-map": "^0.7.3",
|
|
69
|
-
"url": "^0.11.0",
|
|
70
54
|
"vite": "6.0.0-alpha.17",
|
|
71
55
|
"vite-bundle-analyzer": "^0.9.4",
|
|
72
|
-
"vxs": "0.1.83",
|
|
73
56
|
"ws": "^8.7.0"
|
|
74
57
|
},
|
|
75
58
|
"devDependencies": {
|
|
76
59
|
"@biomejs/biome": "^1.6.3",
|
|
77
|
-
"@tamagui/build": "^1.
|
|
60
|
+
"@tamagui/build": "^1.100.0",
|
|
78
61
|
"@types/find-node-modules": "^2.1.2",
|
|
79
62
|
"@types/ws": "^8.5.10",
|
|
63
|
+
"depcheck": "^1.4.7",
|
|
80
64
|
"rollup": "^3.29.4"
|
|
81
65
|
}
|
|
82
66
|
}
|
|
@@ -19,6 +19,16 @@ export function getBaseViteConfig({ mode }: { mode: 'development' | 'production'
|
|
|
19
19
|
'react-native': 'react-native-web',
|
|
20
20
|
'react-native-safe-area-context': '@vxrn/safe-area',
|
|
21
21
|
},
|
|
22
|
+
|
|
23
|
+
// TODO auto dedupe all include optimize deps?
|
|
24
|
+
dedupe: [
|
|
25
|
+
'react',
|
|
26
|
+
'react-dom',
|
|
27
|
+
'react-dom/client',
|
|
28
|
+
'react-native-web',
|
|
29
|
+
'@tamagui/core',
|
|
30
|
+
'@tamagui/web',
|
|
31
|
+
],
|
|
22
32
|
},
|
|
23
33
|
|
|
24
34
|
build: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { URL, fileURLToPath } from 'url';
|
|
1
|
+
// import { URL, fileURLToPath } from 'url';
|
|
2
2
|
|
|
3
|
-
export default fileURLToPath(new URL('./dist', import.meta.url));
|
|
3
|
+
// export default fileURLToPath(new URL('./dist', import.meta.url));
|