rnxsim 0.1.344 → 0.1.346
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/README.md +59 -31
- package/cli/app-fonts.ts +8 -28
- package/cli/app-project.ts +12 -184
- package/cli/app-splash.ts +3 -17
- package/cli/bin.ts +15 -28
- package/cli/commands/control.ts +20 -30
- package/cli/commands/daemon.ts +19 -44
- package/cli/commands/flow.ts +0 -27
- package/cli/commands/install-desktop.ts +2 -16
- package/cli/commands/login.ts +3 -43
- package/cli/commands/logout.ts +0 -7
- package/cli/commands/serve.ts +2 -32
- package/cli/commands/setup.ts +20 -194
- package/cli/commands/telemetry.ts +7 -5
- package/cli/commands/upload.ts +1 -48
- package/cli/commands/welcome.ts +64 -0
- package/cli/outbound-endpoints.ts +586 -0
- package/cli/privacy.ts +53 -0
- package/cli/runtime-notes.ts +2 -2
- package/cli/telemetry.ts +46 -149
- package/dist-cli/bin.js +6 -6
- package/dist-cli/chunks/{agent-HTSE5FA4.js → agent-U6HZUHAQ.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-L6X2AEZL.js → agent-wrapper-IM2VL6XP.js} +2 -2
- package/dist-cli/chunks/{app-fonts-FGF3ETYH.js → app-fonts-LHVTPWCN.js} +2 -2
- package/dist-cli/chunks/{assert-HA2ZYVDN.js → assert-UMGCZXWN.js} +2 -2
- package/dist-cli/chunks/{auth-HONDAV75.js → auth-PQY57FPY.js} +2 -2
- package/dist-cli/chunks/{beta-U7EE4GMR.js → beta-3MMNRHL7.js} +2 -2
- package/dist-cli/chunks/{camera-RTKNUTIX.js → camera-UKISEHMH.js} +2 -2
- package/dist-cli/chunks/{chunk-CNLPLCO2.js → chunk-36P343FE.js} +2 -2
- package/dist-cli/chunks/{chunk-IWR4HFC4.js → chunk-3KPJVR63.js} +2 -2
- package/dist-cli/chunks/chunk-54Y5IXWQ.js +15 -0
- package/dist-cli/chunks/{chunk-EPEZZ6YS.js → chunk-5KMV7NAJ.js} +2 -2
- package/dist-cli/chunks/{chunk-NDGAF5OF.js → chunk-5WIYZI5H.js} +2 -2
- package/dist-cli/chunks/{chunk-KBSVSAAE.js → chunk-6GXUQ3DM.js} +2 -2
- package/dist-cli/chunks/{chunk-KT6WMCUS.js → chunk-6MUEKKJ4.js} +1 -1
- package/dist-cli/chunks/{chunk-TOHQI2II.js → chunk-6Q6S53R7.js} +1 -1
- package/dist-cli/chunks/{chunk-63NZGJ4A.js → chunk-6SQCDLTJ.js} +1 -1
- package/dist-cli/chunks/{chunk-Q2B6EQPB.js → chunk-6UW6O575.js} +2 -2
- package/dist-cli/chunks/chunk-6VH3UUYQ.js +4 -0
- package/dist-cli/chunks/{chunk-BGLWR43R.js → chunk-6XJGGFMD.js} +1 -1
- package/dist-cli/chunks/{chunk-TZNRKIS3.js → chunk-75LMZXF5.js} +2 -2
- package/dist-cli/chunks/{chunk-FZ5DRZJE.js → chunk-7CJNUNQA.js} +3 -3
- package/dist-cli/chunks/{chunk-UCVQOQCY.js → chunk-BQDGFR4B.js} +2 -2
- package/dist-cli/chunks/{chunk-H4J7EWZC.js → chunk-BSIVS2SQ.js} +1 -1
- package/dist-cli/chunks/{chunk-6E6SBYIO.js → chunk-CD2LITQX.js} +1 -1
- package/dist-cli/chunks/{chunk-PNMCALX5.js → chunk-DGH3D6WS.js} +2 -2
- package/dist-cli/chunks/chunk-EP6XBKPM.js +11 -0
- package/dist-cli/chunks/{chunk-OCUXAA6O.js → chunk-EVX6Y7ZM.js} +2 -2
- package/dist-cli/chunks/chunk-EYRKIWHE.js +4 -0
- package/dist-cli/chunks/{chunk-N5PFDTFL.js → chunk-FSYB2S6Q.js} +17 -17
- package/dist-cli/chunks/{chunk-6PEZSVIG.js → chunk-HPCTBEAP.js} +1 -1
- package/dist-cli/chunks/chunk-HS2BME6V.js +6 -0
- package/dist-cli/chunks/{chunk-G6IPT2PS.js → chunk-I3GUDHG2.js} +2 -2
- package/dist-cli/chunks/{chunk-MWUXQIA3.js → chunk-I4HVFKLM.js} +2 -2
- package/dist-cli/chunks/{chunk-ZPTFL5FQ.js → chunk-IBNK7SWL.js} +2 -2
- package/dist-cli/chunks/chunk-IUG4GWQC.js +25 -0
- package/dist-cli/chunks/{chunk-XQFDEY3F.js → chunk-IUIKD2YI.js} +1 -1
- package/dist-cli/chunks/{chunk-JFUVWIJT.js → chunk-JPVXLY7X.js} +1 -1
- package/dist-cli/chunks/{chunk-JLUEQPEF.js → chunk-K4PZLT2K.js} +1 -1
- package/dist-cli/chunks/{chunk-CRWYKW67.js → chunk-KNIKUJPD.js} +1 -1
- package/dist-cli/chunks/{chunk-EZLLZDYX.js → chunk-L6GWDWGZ.js} +2 -2
- package/dist-cli/chunks/chunk-LAVDDUQR.js +4 -0
- package/dist-cli/chunks/{chunk-22WJPMTQ.js → chunk-LPXKPZ4B.js} +1 -1
- package/dist-cli/chunks/{chunk-IPC45HTT.js → chunk-LYLK5VRP.js} +2 -2
- package/dist-cli/chunks/{chunk-S6LBAUWH.js → chunk-ME46FC4L.js} +1 -1
- package/dist-cli/chunks/chunk-NNXSLD76.js +99 -0
- package/dist-cli/chunks/{chunk-7V4ULF3U.js → chunk-PNH3YBZ4.js} +2 -2
- package/dist-cli/chunks/{chunk-GRX6NSBG.js → chunk-PPEJMNRO.js} +2 -2
- package/dist-cli/chunks/{chunk-K3VNCCEJ.js → chunk-SEWGXJG6.js} +3 -3
- package/dist-cli/chunks/{chunk-R3UYHE6G.js → chunk-T4JPZI32.js} +1 -1
- package/dist-cli/chunks/{chunk-NRTHFEPM.js → chunk-TAQYETRH.js} +2 -2
- package/dist-cli/chunks/{chunk-7JEEO33Y.js → chunk-TBVBWJJL.js} +2 -2
- package/dist-cli/chunks/{chunk-HRBMD2FS.js → chunk-UA54YLWR.js} +26 -26
- package/dist-cli/chunks/{chunk-G3UAFZE2.js → chunk-UV3TXNMG.js} +1 -1
- package/dist-cli/chunks/{chunk-EH35QQG4.js → chunk-VZ6YFPIN.js} +45 -45
- package/dist-cli/chunks/chunk-W54SRZ5K.js +14 -0
- package/dist-cli/chunks/chunk-WAC75WN6.js +4 -0
- package/dist-cli/chunks/{chunk-S7CSBQ6G.js → chunk-X2WIEZ7Q.js} +1 -1
- package/dist-cli/chunks/{chunk-EN32LN2B.js → chunk-XWTYFWZ3.js} +2 -2
- package/dist-cli/chunks/chunk-Y2C3CZVD.js +4 -0
- package/dist-cli/chunks/chunk-YM4L2CFB.js +4 -0
- package/dist-cli/chunks/{chunk-ZZSBCGHC.js → chunk-YXDR4CAQ.js} +1 -1
- package/dist-cli/chunks/{chunk-6NLWKL7Y.js → chunk-Z6P427WC.js} +2 -2
- package/dist-cli/chunks/{cleanup-EMYD5WZG.js → cleanup-KXPS5VSK.js} +2 -2
- package/dist-cli/chunks/cli-version-LJ6NFLBP.js +4 -0
- package/dist-cli/chunks/{compat-W2N5QTVG.js → compat-JWF7N3VO.js} +2 -2
- package/dist-cli/chunks/config-M42VJXNK.js +13 -0
- package/dist-cli/chunks/{control-4SFBROUE.js → control-HMZDIS6P.js} +2 -2
- package/dist-cli/chunks/daemon-MQ4UYKNQ.js +4 -0
- package/dist-cli/chunks/{debug-HCR2KFUA.js → debug-F44GWYMF.js} +3 -3
- package/dist-cli/chunks/{desktop-T2KS5PBJ.js → desktop-YJMWW6MW.js} +3 -3
- package/dist-cli/chunks/{detox-5S7EHINH.js → detox-5B4ASTJO.js} +2 -2
- package/dist-cli/chunks/{device-LVM3MZRJ.js → device-2544YZNY.js} +2 -2
- package/dist-cli/chunks/{diagnose-WK37XKLI.js → diagnose-LS4245JR.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-X7VJOXMS.js → disk-cleanup-XYL2HQQY.js} +2 -2
- package/dist-cli/chunks/drivers-P5CRSKH6.js +4 -0
- package/dist-cli/chunks/{film-7KLTI3ER.js → film-LS3TIZRM.js} +3 -3
- package/dist-cli/chunks/flow-7V77GXAB.js +4 -0
- package/dist-cli/chunks/help-HRESIFZX.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-4RVGUVFO.js → hidden-runtime-alias-HGN2EEQR.js} +2 -2
- package/dist-cli/chunks/{home-paths-5DHSAEGZ.js → home-paths-T3NTXE4U.js} +2 -2
- package/dist-cli/chunks/inspect-UC44UH4M.js +4 -0
- package/dist-cli/chunks/install-desktop-RDV66JHG.js +4 -0
- package/dist-cli/chunks/login-WVP5H5NQ.js +26 -0
- package/dist-cli/chunks/logout-GXX5OY6X.js +4 -0
- package/dist-cli/chunks/{maestro-HTRLQDJE.js → maestro-MQMGBNOB.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-GX2QNA3F.js → maestro-generate-CO355QV2.js} +3 -3
- package/dist-cli/chunks/{mode-GM6KZHQP.js → mode-QFB3M2AA.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-B4TD7JQP.js → optional-demo-registry-UIPVSBHV.js} +2 -2
- package/dist-cli/chunks/{perf-3PRXJQIC.js → perf-TDOSW3LD.js} +2 -2
- package/dist-cli/chunks/{permissions-TJZIRF2S.js → permissions-TEVQLCGJ.js} +2 -2
- package/dist-cli/chunks/privacy-DVHAMHR6.js +4 -0
- package/dist-cli/chunks/{record-LI55DTPE.js → record-OFEQLSWA.js} +3 -3
- package/dist-cli/chunks/{report-issue-TBGJVQIQ.js → report-issue-B2UPOERJ.js} +2 -2
- package/dist-cli/chunks/reset-XQQYM55B.js +4 -0
- package/dist-cli/chunks/runtime-GN6HITVB.js +4 -0
- package/dist-cli/chunks/{screenshot-command-BEN7YYIF.js → screenshot-command-NTLAY7QN.js} +3 -3
- package/dist-cli/chunks/{screenshot-layers-3IU4KYNO.js → screenshot-layers-BBLKNRQU.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-ZRC54ST6.js → screenshots-capture-6GHIRCTG.js} +2 -2
- package/dist-cli/chunks/serve-H6GJ4OHW.js +118 -0
- package/dist-cli/chunks/setup-6YLKSMWS.js +30 -0
- package/dist-cli/chunks/{skills-GKBR2HQB.js → skills-FUL7D6C7.js} +2 -2
- package/dist-cli/chunks/{state-LIHZJSL7.js → state-O2HE7XSR.js} +2 -2
- package/dist-cli/chunks/{storage-4TPN3NFB.js → storage-WIZTF7RN.js} +4 -4
- package/dist-cli/chunks/store-NJ2MBZC2.js +4 -0
- package/dist-cli/chunks/telemetry-BEC6W5WP.js +4 -0
- package/dist-cli/chunks/{timeline-EX63UNWU.js → timeline-MA4JT7UJ.js} +2 -2
- package/dist-cli/chunks/{upgrade-O6Y6EINE.js → upgrade-H5LSDXBH.js} +2 -2
- package/dist-cli/chunks/upload-Q4DWKIA4.js +4 -0
- package/dist-cli/chunks/{version-HLNL3NFB.js → version-4UWEEDVP.js} +2 -2
- package/dist-cli/chunks/{web-4EDPYPW7.js → web-F3LXRN3K.js} +2 -2
- package/dist-cli/chunks/welcome-AZBOSIG2.js +5 -0
- package/dist-cli/chunks/{what-happened-77VNUEPK.js → what-happened-6OSNLOAY.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +13 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +43 -13
- package/dist-lib/home-paths.cjs +145 -11
- package/dist-lib/host/bridge-host.cjs +326 -78
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +71 -4
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +337 -37
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +484 -14
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +120 -50
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +493 -439
- package/dist-lib/vite.cjs +193 -37
- package/package.json +2 -1
- package/scripts/dev-server-scanner.ts +112 -51
- package/skills/rnx-test/SKILL.md +4 -0
- package/src/backend-origin.ts +15 -1
- package/src/dev-bundle-resolution.ts +42 -18
- package/src/dev-server-open.ts +197 -0
- package/src/home-paths.ts +168 -15
- package/src/host/bridge-host.ts +2 -2
- package/src/host/replacement-module-handler.ts +68 -2
- package/src/metro-plugin.ts +83 -5
- package/src/native-dev-bundle-url.ts +22 -0
- package/src/vite-plugin-one.ts +42 -28
- package/dist-cli/chunks/chunk-3JC7H4PR.js +0 -25
- package/dist-cli/chunks/chunk-6DLIC7BZ.js +0 -4
- package/dist-cli/chunks/chunk-7TNPO2OJ.js +0 -9
- package/dist-cli/chunks/chunk-AMF5KTOI.js +0 -4
- package/dist-cli/chunks/chunk-BX5VXTOQ.js +0 -101
- package/dist-cli/chunks/chunk-D73H7ACZ.js +0 -4
- package/dist-cli/chunks/chunk-DY4O7KYI.js +0 -4
- package/dist-cli/chunks/chunk-GU2V4JDG.js +0 -15
- package/dist-cli/chunks/chunk-POOCKX5B.js +0 -14
- package/dist-cli/chunks/chunk-Z2HMSVSN.js +0 -4
- package/dist-cli/chunks/cli-version-CN3NTKLH.js +0 -4
- package/dist-cli/chunks/config-SELKGT4F.js +0 -13
- package/dist-cli/chunks/daemon-V2SFCU2E.js +0 -4
- package/dist-cli/chunks/drivers-3YFTJ5WA.js +0 -4
- package/dist-cli/chunks/flow-36ANTMJU.js +0 -4
- package/dist-cli/chunks/help-ZGL26SPK.js +0 -4
- package/dist-cli/chunks/inspect-R3B55RTS.js +0 -4
- package/dist-cli/chunks/install-desktop-TZ3H3VWK.js +0 -4
- package/dist-cli/chunks/login-4DFULI7S.js +0 -28
- package/dist-cli/chunks/logout-QMCVYMBB.js +0 -4
- package/dist-cli/chunks/reset-O6MW6X7X.js +0 -4
- package/dist-cli/chunks/runtime-JESXBHRQ.js +0 -4
- package/dist-cli/chunks/serve-QGKTWPNF.js +0 -118
- package/dist-cli/chunks/setup-3WPWATCX.js +0 -32
- package/dist-cli/chunks/store-VBX3L46S.js +0 -4
- package/dist-cli/chunks/telemetry-ACNNIQIG.js +0 -4
- package/dist-cli/chunks/upload-OD2UQHMM.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.346 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -53,6 +53,21 @@ var import_net = __toESM(require("net"), 1);
|
|
|
53
53
|
var import_node_path3 = require("node:path");
|
|
54
54
|
var import_util = require("util");
|
|
55
55
|
|
|
56
|
+
// src/backend-origin.ts
|
|
57
|
+
var LOOPBACK_PROBE_HOSTNAMES = ["::1", "127.0.0.1"];
|
|
58
|
+
function normalizeHostname(hostname) {
|
|
59
|
+
return hostname.replace(/^\[|\]$/g, "").toLowerCase();
|
|
60
|
+
}
|
|
61
|
+
function buildLoopbackProbeBaseUrl(protocol, hostname, port) {
|
|
62
|
+
const normalizedHostname = normalizeHostname(hostname);
|
|
63
|
+
const urlHost = normalizedHostname.includes(":") ? `[${normalizedHostname}]` : normalizedHostname;
|
|
64
|
+
return `${protocol}//${urlHost}:${port}`;
|
|
65
|
+
}
|
|
66
|
+
function isLoopbackHost(hostname) {
|
|
67
|
+
const normalized = normalizeHostname(hostname);
|
|
68
|
+
return normalized === "localhost" || normalized.endsWith(".localhost") || normalized === "0.0.0.0" || normalized === "::1" || /^127(?:\.\d{1,3}){3}$/.test(normalized);
|
|
69
|
+
}
|
|
70
|
+
|
|
56
71
|
// src/config.ts
|
|
57
72
|
var SOOTSIM_CONFIG_QUERY_PARAM = "sootsimConfig";
|
|
58
73
|
function hasOwnKeys(value) {
|
|
@@ -79,6 +94,19 @@ function isAbsoluteHttpUrl(url) {
|
|
|
79
94
|
function isNativeDevBundlePath(pathname) {
|
|
80
95
|
return pathname.endsWith(".bundle");
|
|
81
96
|
}
|
|
97
|
+
function alignLoopbackBundleUrlWithProbe(bundleUrl, probeBaseUrl) {
|
|
98
|
+
try {
|
|
99
|
+
const bundle = new URL(bundleUrl);
|
|
100
|
+
const probe = new URL(probeBaseUrl);
|
|
101
|
+
if (!isLoopbackHost(bundle.hostname) || !isLoopbackHost(probe.hostname)) {
|
|
102
|
+
return bundleUrl;
|
|
103
|
+
}
|
|
104
|
+
bundle.hostname = probe.hostname;
|
|
105
|
+
return bundle.toString();
|
|
106
|
+
} catch {
|
|
107
|
+
return bundleUrl;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
82
110
|
function applyPreviewProdBundle(parsed) {
|
|
83
111
|
if (!process.env.SOOTSIM_PREVIEW_PROD_BUNDLE) return;
|
|
84
112
|
parsed.searchParams.set("dev", "false");
|
|
@@ -494,27 +522,36 @@ var execP = (0, import_util.promisify)(import_child_process.exec);
|
|
|
494
522
|
var TIMEOUT_MS = 250;
|
|
495
523
|
var MANIFEST_TIMEOUT_MS = 1500;
|
|
496
524
|
var TCP_GATE_MS = 120;
|
|
497
|
-
function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
525
|
+
async function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
526
|
+
try {
|
|
527
|
+
return await Promise.any(
|
|
528
|
+
LOOPBACK_PROBE_HOSTNAMES.map(
|
|
529
|
+
(hostname) => new Promise((resolve2, reject) => {
|
|
530
|
+
const sock = new import_net.default.Socket();
|
|
531
|
+
let settled = false;
|
|
532
|
+
const done = (reachable) => {
|
|
533
|
+
if (settled) return;
|
|
534
|
+
settled = true;
|
|
535
|
+
sock.destroy();
|
|
536
|
+
if (reachable) resolve2(hostname);
|
|
537
|
+
else reject(new Error(`unreachable loopback host ${hostname}`));
|
|
538
|
+
};
|
|
539
|
+
sock.setTimeout(timeout);
|
|
540
|
+
sock.once("connect", () => done(true));
|
|
541
|
+
sock.once("timeout", () => done(false));
|
|
542
|
+
sock.once("error", () => done(false));
|
|
543
|
+
sock.connect(port, hostname);
|
|
544
|
+
})
|
|
545
|
+
)
|
|
546
|
+
);
|
|
547
|
+
} catch {
|
|
548
|
+
return null;
|
|
549
|
+
}
|
|
513
550
|
}
|
|
514
|
-
function httpGet(port, path, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
|
|
551
|
+
function httpGet(hostname, port, path, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
|
|
515
552
|
return new Promise((resolve2) => {
|
|
516
553
|
const req = import_http.default.request(
|
|
517
|
-
{ hostname
|
|
554
|
+
{ hostname, port, path, method, timeout, headers },
|
|
518
555
|
(res) => {
|
|
519
556
|
let body = "";
|
|
520
557
|
res.on("data", (c) => body += c.toString());
|
|
@@ -526,7 +563,12 @@ function httpGet(port, path, method = "GET", timeout = TIMEOUT_MS, headers = {})
|
|
|
526
563
|
})();
|
|
527
564
|
res.on(
|
|
528
565
|
"end",
|
|
529
|
-
() => resolve2({
|
|
566
|
+
() => resolve2({
|
|
567
|
+
statusCode: res.statusCode || 0,
|
|
568
|
+
body,
|
|
569
|
+
contentType,
|
|
570
|
+
hostname
|
|
571
|
+
})
|
|
530
572
|
);
|
|
531
573
|
}
|
|
532
574
|
);
|
|
@@ -682,16 +724,16 @@ async function resolveProcessCwd(pid) {
|
|
|
682
724
|
}
|
|
683
725
|
return null;
|
|
684
726
|
}
|
|
685
|
-
function makeResult(port, framework, owner) {
|
|
727
|
+
function makeResult(hostname, port, framework, owner) {
|
|
686
728
|
return {
|
|
687
729
|
port,
|
|
688
730
|
framework,
|
|
689
731
|
bundleUrl: withRuntimeConfig(
|
|
690
732
|
port,
|
|
691
|
-
|
|
733
|
+
`${buildLoopbackProbeBaseUrl("http:", hostname, port)}/index.bundle?platform=ios&dev=true&hot=true&minify=false`,
|
|
692
734
|
owner.cwd
|
|
693
735
|
),
|
|
694
|
-
hmrUrl:
|
|
736
|
+
hmrUrl: `${buildLoopbackProbeBaseUrl("ws:", hostname, port)}/hot`,
|
|
695
737
|
lastSeen: Date.now(),
|
|
696
738
|
...owner
|
|
697
739
|
};
|
|
@@ -722,7 +764,11 @@ function applyManifest(result, manifestRes, buildIconProxyUrl) {
|
|
|
722
764
|
if (client.name) result.projectName = client.name;
|
|
723
765
|
if (client.ios?.bundleIdentifier) result.bundleId = client.ios.bundleIdentifier;
|
|
724
766
|
if (result.framework === "metro" && client.sdkVersion) result.framework = "expo";
|
|
725
|
-
const
|
|
767
|
+
const rawLaunchUrl = manifest?.launchAsset?.url;
|
|
768
|
+
const launchUrl = typeof rawLaunchUrl === "string" ? alignLoopbackBundleUrlWithProbe(
|
|
769
|
+
rawLaunchUrl,
|
|
770
|
+
buildLoopbackProbeBaseUrl("http:", manifestRes.hostname, result.port)
|
|
771
|
+
) : rawLaunchUrl;
|
|
726
772
|
if (launchUrl && !result.patched && !isDirectOneBundleUrl(result.bundleUrl)) {
|
|
727
773
|
result.bundleUrl = withRuntimeConfig(result.port, launchUrl, result.cwd);
|
|
728
774
|
}
|
|
@@ -735,11 +781,11 @@ function applyManifest(result, manifestRes, buildIconProxyUrl) {
|
|
|
735
781
|
} else {
|
|
736
782
|
const cleanPath = rawIconUrl.replace(/^\.\//, "");
|
|
737
783
|
result.iconUrl = buildIconProxyUrl(
|
|
738
|
-
|
|
784
|
+
`${buildLoopbackProbeBaseUrl("http:", manifestRes.hostname, result.port)}/assets/${cleanPath}`
|
|
739
785
|
);
|
|
740
786
|
}
|
|
741
787
|
} else {
|
|
742
|
-
result.iconUrl = rawIconUrl.startsWith("http") ? rawIconUrl :
|
|
788
|
+
result.iconUrl = rawIconUrl.startsWith("http") ? rawIconUrl : `${buildLoopbackProbeBaseUrl("http:", manifestRes.hostname, result.port)}/assets/${rawIconUrl.replace(/^\.\//, "")}`;
|
|
743
789
|
}
|
|
744
790
|
}
|
|
745
791
|
} catch {
|
|
@@ -747,7 +793,11 @@ function applyManifest(result, manifestRes, buildIconProxyUrl) {
|
|
|
747
793
|
return result;
|
|
748
794
|
}
|
|
749
795
|
function __applyManifestForTests(result, manifestBody) {
|
|
750
|
-
return applyManifest(result, {
|
|
796
|
+
return applyManifest(result, {
|
|
797
|
+
statusCode: 200,
|
|
798
|
+
body: manifestBody,
|
|
799
|
+
hostname: new URL(result.bundleUrl).hostname
|
|
800
|
+
});
|
|
751
801
|
}
|
|
752
802
|
var ENRICH_TIMEOUT_MS = 2e4;
|
|
753
803
|
var enrichmentCache = /* @__PURE__ */ new Map();
|
|
@@ -766,38 +816,51 @@ function enrichWithManifest(result, buildIconProxyUrl) {
|
|
|
766
816
|
}
|
|
767
817
|
if (!enrichmentInFlight.has(result.port)) {
|
|
768
818
|
enrichmentInFlight.add(result.port);
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
() => enrichmentInFlight.delete(port)
|
|
819
|
+
void fetchManifestEnrichment(result, buildIconProxyUrl).finally(
|
|
820
|
+
() => enrichmentInFlight.delete(result.port)
|
|
772
821
|
);
|
|
773
822
|
}
|
|
774
823
|
return result;
|
|
775
824
|
}
|
|
776
|
-
async function fetchManifestEnrichment(
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
|
|
825
|
+
async function fetchManifestEnrichment(result, buildIconProxyUrl) {
|
|
826
|
+
const hostname = normalizeHostname(new URL(result.bundleUrl).hostname);
|
|
827
|
+
const manifestRes = await httpGet(
|
|
828
|
+
hostname,
|
|
829
|
+
result.port,
|
|
830
|
+
"/",
|
|
831
|
+
"GET",
|
|
832
|
+
ENRICH_TIMEOUT_MS,
|
|
833
|
+
{
|
|
834
|
+
"expo-platform": "ios"
|
|
835
|
+
}
|
|
836
|
+
);
|
|
780
837
|
if (!manifestRes || manifestRes.statusCode !== 200) return;
|
|
781
838
|
const parsed = applyManifest(
|
|
782
|
-
{
|
|
839
|
+
{
|
|
840
|
+
port: result.port,
|
|
841
|
+
framework: "one",
|
|
842
|
+
bundleUrl: `${buildLoopbackProbeBaseUrl("http:", hostname, result.port)}/index.bundle`,
|
|
843
|
+
lastSeen: 0
|
|
844
|
+
},
|
|
783
845
|
manifestRes,
|
|
784
846
|
buildIconProxyUrl
|
|
785
847
|
);
|
|
786
848
|
if (!parsed.projectName && !parsed.iconUrl) return;
|
|
787
|
-
enrichmentCache.set(port, {
|
|
849
|
+
enrichmentCache.set(result.port, {
|
|
788
850
|
projectName: parsed.projectName,
|
|
789
851
|
iconUrl: parsed.iconUrl,
|
|
790
852
|
iconPath: parsed.iconPath,
|
|
791
853
|
bundleId: parsed.bundleId
|
|
792
854
|
});
|
|
793
|
-
portCache.delete(port);
|
|
855
|
+
portCache.delete(result.port);
|
|
794
856
|
}
|
|
795
857
|
var knownNonPatched = /* @__PURE__ */ new Set();
|
|
796
858
|
var knownNonExpo = /* @__PURE__ */ new Set();
|
|
797
859
|
var knownOne = /* @__PURE__ */ new Set();
|
|
798
860
|
async function probePort(port, buildIconProxyUrl, listeningProcess) {
|
|
799
861
|
await loadOptionalDemoApps();
|
|
800
|
-
|
|
862
|
+
const probeHostname = await tcpPing(port);
|
|
863
|
+
if (!probeHostname) return null;
|
|
801
864
|
const suppliedPid = listeningProcess?.pid;
|
|
802
865
|
const ownerPid = suppliedPid && suppliedPid > 0 ? suppliedPid : await resolveListeningPid(port);
|
|
803
866
|
const ownerCwd = ownerPid ? await resolveProcessCwd(ownerPid) : null;
|
|
@@ -807,10 +870,12 @@ async function probePort(port, buildIconProxyUrl, listeningProcess) {
|
|
|
807
870
|
};
|
|
808
871
|
const onePath = `/node_modules/one/metro-entry.bundle?platform=ios&dev=true`;
|
|
809
872
|
const [sootsimRes, statusRes, manifestRes, expoRes] = await Promise.all([
|
|
810
|
-
knownNonPatched.has(port) ? Promise.resolve(null) : httpGet(port, "/__soot/"),
|
|
811
|
-
httpGet(port, "/status"),
|
|
812
|
-
knownOne.has(port) ? Promise.resolve(null) : httpGet(port, "/", "GET", MANIFEST_TIMEOUT_MS, {
|
|
813
|
-
|
|
873
|
+
knownNonPatched.has(port) ? Promise.resolve(null) : httpGet(probeHostname, port, "/__soot/"),
|
|
874
|
+
httpGet(probeHostname, port, "/status"),
|
|
875
|
+
knownOne.has(port) ? Promise.resolve(null) : httpGet(probeHostname, port, "/", "GET", MANIFEST_TIMEOUT_MS, {
|
|
876
|
+
"expo-platform": "ios"
|
|
877
|
+
}),
|
|
878
|
+
knownNonExpo.has(port) ? Promise.resolve(null) : httpGet(probeHostname, port, "/_expo/status")
|
|
814
879
|
]);
|
|
815
880
|
if (expoRes && expoRes.statusCode === 200) {
|
|
816
881
|
knownNonExpo.delete(port);
|
|
@@ -822,7 +887,7 @@ async function probePort(port, buildIconProxyUrl, listeningProcess) {
|
|
|
822
887
|
const manifestClient = manifestParsed?.extra?.expoClient || manifestParsed?.extra || {};
|
|
823
888
|
if (manifestParsed && (manifestLaunchUrl || typeof manifestClient.name === "string")) {
|
|
824
889
|
knownNonPatched.add(port);
|
|
825
|
-
const launchUrl = manifestLaunchUrl ||
|
|
890
|
+
const launchUrl = manifestLaunchUrl || `${buildLoopbackProbeBaseUrl("http:", probeHostname, port)}/index.bundle?platform=ios&dev=true&hot=true&minify=false`;
|
|
826
891
|
const framework = launchUrl.includes(
|
|
827
892
|
"/one/metro-entry.bundle"
|
|
828
893
|
) ? "one" : "expo";
|
|
@@ -831,7 +896,7 @@ async function probePort(port, buildIconProxyUrl, listeningProcess) {
|
|
|
831
896
|
port,
|
|
832
897
|
framework,
|
|
833
898
|
bundleUrl: withRuntimeConfig(port, launchUrl, owner.cwd),
|
|
834
|
-
hmrUrl:
|
|
899
|
+
hmrUrl: `${buildLoopbackProbeBaseUrl("ws:", probeHostname, port)}/hot`,
|
|
835
900
|
lastSeen: Date.now(),
|
|
836
901
|
...owner
|
|
837
902
|
},
|
|
@@ -843,7 +908,12 @@ async function probePort(port, buildIconProxyUrl, listeningProcess) {
|
|
|
843
908
|
knownNonPatched.add(port);
|
|
844
909
|
return enrichWithManifest(
|
|
845
910
|
applyManifest(
|
|
846
|
-
makeResult(
|
|
911
|
+
makeResult(
|
|
912
|
+
probeHostname,
|
|
913
|
+
port,
|
|
914
|
+
expoRes && expoRes.statusCode === 200 ? "expo" : "metro",
|
|
915
|
+
owner
|
|
916
|
+
),
|
|
847
917
|
manifestRes,
|
|
848
918
|
buildIconProxyUrl
|
|
849
919
|
),
|
|
@@ -859,10 +929,10 @@ async function probePort(port, buildIconProxyUrl, listeningProcess) {
|
|
|
859
929
|
framework: "one",
|
|
860
930
|
bundleUrl: withRuntimeConfig(
|
|
861
931
|
port,
|
|
862
|
-
|
|
932
|
+
`${buildLoopbackProbeBaseUrl("http:", probeHostname, port)}/__soot/bundle.js`,
|
|
863
933
|
owner.cwd
|
|
864
934
|
),
|
|
865
|
-
hmrUrl:
|
|
935
|
+
hmrUrl: `${buildLoopbackProbeBaseUrl("ws:", probeHostname, port)}/hot`,
|
|
866
936
|
lastSeen: Date.now(),
|
|
867
937
|
patched: true,
|
|
868
938
|
...owner
|
|
@@ -877,7 +947,7 @@ async function probePort(port, buildIconProxyUrl, listeningProcess) {
|
|
|
877
947
|
if (looksLikeMetroPackager) {
|
|
878
948
|
return null;
|
|
879
949
|
}
|
|
880
|
-
const oneRes = await httpGet(port, onePath, "HEAD");
|
|
950
|
+
const oneRes = await httpGet(probeHostname, port, onePath, "HEAD");
|
|
881
951
|
if (oneRes && oneRes.statusCode > 0 && oneRes.statusCode < 400 && /application\/javascript/i.test(oneRes.contentType || "")) {
|
|
882
952
|
knownNonPatched.add(port);
|
|
883
953
|
knownOne.add(port);
|
|
@@ -888,10 +958,10 @@ async function probePort(port, buildIconProxyUrl, listeningProcess) {
|
|
|
888
958
|
framework: "one",
|
|
889
959
|
bundleUrl: withRuntimeConfig(
|
|
890
960
|
port,
|
|
891
|
-
|
|
961
|
+
`${buildLoopbackProbeBaseUrl("http:", probeHostname, port)}${onePath}&minify=false`,
|
|
892
962
|
owner.cwd
|
|
893
963
|
),
|
|
894
|
-
hmrUrl:
|
|
964
|
+
hmrUrl: `${buildLoopbackProbeBaseUrl("ws:", probeHostname, port)}/hot`,
|
|
895
965
|
lastSeen: Date.now(),
|
|
896
966
|
...owner
|
|
897
967
|
},
|
package/dist-lib/sdk.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.346 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/sdk.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.346 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|