rnxsim 0.1.376 → 0.1.377
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 +28 -25
- package/cli/app-config.ts +9 -12
- package/cli/app-fonts.ts +3 -3
- package/cli/app-project.ts +8 -8
- package/cli/auth.ts +7 -9
- package/cli/bin.ts +16 -31
- package/cli/bridge-flow-runner.ts +3 -3
- package/cli/browser-backend.ts +44 -0
- package/cli/command-contract.ts +221 -0
- package/cli/command-registry.ts +291 -0
- package/cli/commands/agent-wrapper.ts +2 -2
- package/cli/commands/app-fonts.ts +2 -2
- package/cli/commands/assert.ts +3 -3
- package/cli/commands/auth.ts +1 -1
- package/cli/commands/box/cloud-box.ts +1 -1
- package/cli/commands/box/plane-share.ts +2 -2
- package/cli/commands/box.ts +4 -6
- package/cli/commands/compat.ts +1 -1
- package/cli/commands/config.ts +2 -2
- package/cli/commands/control.ts +29 -29
- package/cli/commands/cpu-profile.ts +7 -7
- package/cli/commands/daemon-mac-app.ts +7 -7
- package/cli/commands/daemon.ts +10 -10
- package/cli/commands/debug.ts +11 -11
- package/cli/commands/detox.ts +13 -13
- package/cli/commands/diagnose.ts +6 -6
- package/cli/commands/do-chain.ts +1 -2
- package/cli/commands/electron.ts +1 -3
- package/cli/commands/film.ts +3 -3
- package/cli/commands/flow.ts +43 -43
- package/cli/commands/inspect/count.ts +1 -1
- package/cli/commands/inspect/describe.ts +1 -1
- package/cli/commands/inspect/env.ts +2 -2
- package/cli/commands/inspect/get-layout.ts +1 -1
- package/cli/commands/inspect/keyboard.ts +1 -1
- package/cli/commands/inspect/list.ts +1 -1
- package/cli/commands/inspect/memory.ts +1 -1
- package/cli/commands/inspect/resolve-target.ts +1 -1
- package/cli/commands/inspect/screens.ts +1 -1
- package/cli/commands/inspect/tree.ts +1 -1
- package/cli/commands/inspect/url.ts +1 -1
- package/cli/commands/inspect/wait-event.ts +5 -5
- package/cli/commands/inspect.ts +34 -34
- package/cli/commands/install-desktop.ts +3 -3
- package/cli/commands/login.ts +6 -6
- package/cli/commands/maestro-generate.ts +5 -5
- package/cli/commands/maestro.ts +5 -5
- package/cli/commands/profile.ts +1 -1
- package/cli/commands/record.ts +9 -9
- package/cli/commands/runtime.ts +18 -18
- package/cli/commands/screenshot-command.ts +1 -1
- package/cli/commands/screenshot-layers.ts +5 -5
- package/cli/commands/screenshot-mode.ts +1 -1
- package/cli/commands/screenshot.ts +8 -8
- package/cli/commands/screenshots-capture.ts +5 -5
- package/cli/commands/serve.ts +3 -3
- package/cli/commands/setup.ts +20 -12
- package/cli/commands/skills.ts +5 -5
- package/cli/commands/slides.ts +1 -1
- package/cli/commands/telemetry.ts +1 -1
- package/cli/commands/three-mode.ts +1 -1
- package/cli/commands/timeline.ts +8 -8
- package/cli/commands/upgrade.ts +116 -131
- package/cli/commands/upload.ts +12 -12
- package/cli/commands/version.ts +7 -7
- package/cli/commands/what-happened.ts +9 -9
- package/cli/current-sim.ts +3 -3
- package/cli/desktop-companion.ts +1 -1
- package/cli/drivers/playwright.ts +9 -9
- package/cli/drivers/registry.ts +1 -1
- package/cli/drivers/types.ts +1 -1
- package/cli/flow-file.ts +2 -2
- package/cli/flow-session.ts +1 -1
- package/cli/help-core.ts +136 -0
- package/cli/help.ts +17 -53
- package/cli/hints.ts +5 -5
- package/cli/inspect-notice-state.ts +1 -1
- package/cli/maestro-js.ts +1 -1
- package/cli/outbound-endpoints.ts +23 -5
- package/cli/parse-args.ts +19 -66
- package/cli/recording-access.ts +1 -1
- package/cli/registry.ts +1 -0
- package/cli/run-registry.ts +1 -1
- package/cli/run-rnx-core.ts +148 -0
- package/cli/run-rnx.ts +6 -9
- package/cli/runtime-notes.ts +3 -3
- package/cli/standalone.ts +4 -0
- package/cli/ws-bridge.ts +8 -8
- package/detox/config-loader.ts +2 -2
- package/detox/index.ts +8 -8
- package/detox/jest-preset.cjs +1 -1
- package/detox/navigation.ts +2 -2
- package/dist-lib/agent-daemon-client.cjs +5 -5
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +2 -2
- package/dist-lib/agent-sessions.cjs +10 -10
- package/dist-lib/attached-projects.cjs +6 -6
- package/dist-lib/auth/shared-session.cjs +6 -6
- package/dist-lib/backend-origin.cjs +1 -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-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +25 -25
- package/dist-lib/detox/index.cjs +9 -9
- package/dist-lib/detox/jest-preset.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +29 -29
- package/dist-lib/host/bridge-host.cjs +128 -49
- 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 +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +14 -14
- 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 +8 -8
- package/dist-lib/profiles.cjs +12 -12
- 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 +8 -8
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +262 -135
- package/dist-lib/vite.cjs +9 -9
- package/package.json +4 -11
- package/scripts/dev-server-scanner.ts +2 -2
- package/scripts/optional-demo-registry.ts +1 -1
- package/skills/contrast/SKILL.md +3 -3
- package/skills/rnx-debug/SKILL.md +1 -1
- package/skills/rnx-test/SKILL.md +2 -2
- package/src/agent-identity.ts +1 -1
- package/src/agent-sessions.ts +7 -5
- package/src/cli-version.ts +12 -4
- package/src/config.ts +26 -28
- package/src/disk-cleanup.ts +11 -11
- package/src/home-paths.ts +28 -28
- package/src/host/bridge-host.ts +16 -16
- package/src/metro-plugin.ts +2 -2
- package/src/profiles.ts +2 -2
- package/src/runtime-assets.ts +7 -7
- package/src/runtime-delivery.ts +13 -13
- package/src/screenshots/orchestrate.ts +1 -1
- package/src/screenshots/schema.ts +2 -2
- package/src/skills/builtin/a11y-review.ts +2 -2
- package/src/skills/builtin/compat-check.ts +2 -2
- package/src/skills/builtin/maestro-test.ts +2 -2
- package/src/skills/builtin/perf-profile.ts +2 -2
- package/src/skills/builtin/screenshot-all.ts +2 -2
- package/src/skills/builtin/visual-diff.ts +2 -2
- package/src/skills/registry.ts +8 -8
- package/src/skills/types.ts +1 -1
- package/src/vite-plugin-one.ts +3 -3
- package/src/vite-plugin.ts +15 -2
- package/dist-cli/bin.js +0 -15
- package/dist-cli/chunks/agent-H42FCKFF.js +0 -48
- package/dist-cli/chunks/agent-wrapper-BBZKTZS6.js +0 -17
- package/dist-cli/chunks/app-fonts-43VXIKF4.js +0 -4
- package/dist-cli/chunks/assert-IXOLVO5Z.js +0 -49
- package/dist-cli/chunks/auth-KFMFB6FU.js +0 -12
- package/dist-cli/chunks/beta-5AO3SJB7.js +0 -4
- package/dist-cli/chunks/box-ZHM66L6K.js +0 -1730
- package/dist-cli/chunks/camera-FNJVFCDQ.js +0 -33
- package/dist-cli/chunks/chunk-37MCSPTE.js +0 -71
- package/dist-cli/chunks/chunk-3PEMSUAQ.js +0 -30
- package/dist-cli/chunks/chunk-4TQ5HOK3.js +0 -7
- package/dist-cli/chunks/chunk-5YZYDEMI.js +0 -4
- package/dist-cli/chunks/chunk-6CV3R3XD.js +0 -15
- package/dist-cli/chunks/chunk-7LGK5XU6.js +0 -4
- package/dist-cli/chunks/chunk-7R2TK2NY.js +0 -4
- package/dist-cli/chunks/chunk-7VZZQQEE.js +0 -497
- package/dist-cli/chunks/chunk-AFOVILIL.js +0 -130
- package/dist-cli/chunks/chunk-BEU7CD7E.js +0 -9
- package/dist-cli/chunks/chunk-CE4JQJ6Y.js +0 -6
- package/dist-cli/chunks/chunk-CIE6CZXL.js +0 -142
- package/dist-cli/chunks/chunk-CSJ7L7ZL.js +0 -312
- package/dist-cli/chunks/chunk-CWCQP53A.js +0 -27
- package/dist-cli/chunks/chunk-DCS5FK5N.js +0 -7
- package/dist-cli/chunks/chunk-DEV3E3MV.js +0 -4
- package/dist-cli/chunks/chunk-DGJMIVZM.js +0 -5
- package/dist-cli/chunks/chunk-DGX3MN65.js +0 -5
- package/dist-cli/chunks/chunk-DNPQMTW5.js +0 -4
- package/dist-cli/chunks/chunk-DOVBJBVD.js +0 -5
- package/dist-cli/chunks/chunk-DPBJ3S3J.js +0 -3
- package/dist-cli/chunks/chunk-FVZBGPCU.js +0 -4
- package/dist-cli/chunks/chunk-GDKMOIUT.js +0 -4
- package/dist-cli/chunks/chunk-GIF2NJCS.js +0 -32
- package/dist-cli/chunks/chunk-GZE57ORL.js +0 -4
- package/dist-cli/chunks/chunk-H3U56DKI.js +0 -24
- package/dist-cli/chunks/chunk-HZLOYAPH.js +0 -4
- package/dist-cli/chunks/chunk-J2IKAEU2.js +0 -4
- package/dist-cli/chunks/chunk-JXAXYK7W.js +0 -11
- package/dist-cli/chunks/chunk-KJE2O2GK.js +0 -4
- package/dist-cli/chunks/chunk-KMNVDZZI.js +0 -423
- package/dist-cli/chunks/chunk-LC3QRIRB.js +0 -10
- package/dist-cli/chunks/chunk-LGFTAQYC.js +0 -4
- package/dist-cli/chunks/chunk-LQMUA5IY.js +0 -4
- package/dist-cli/chunks/chunk-MFIQTWC5.js +0 -4
- package/dist-cli/chunks/chunk-MGALNF2F.js +0 -7
- package/dist-cli/chunks/chunk-MLBZZHOY.js +0 -4
- package/dist-cli/chunks/chunk-NNRF7GIB.js +0 -107
- package/dist-cli/chunks/chunk-NORLYTTO.js +0 -7
- package/dist-cli/chunks/chunk-P6KVGV3H.js +0 -14
- package/dist-cli/chunks/chunk-PAJTUK33.js +0 -4
- package/dist-cli/chunks/chunk-QELIC5XP.js +0 -4
- package/dist-cli/chunks/chunk-QRDF33WD.js +0 -11
- package/dist-cli/chunks/chunk-R76BA7C7.js +0 -535
- package/dist-cli/chunks/chunk-RVEB4CZ2.js +0 -4
- package/dist-cli/chunks/chunk-SK4M7NXT.js +0 -5
- package/dist-cli/chunks/chunk-SKMG5DD7.js +0 -5
- package/dist-cli/chunks/chunk-TEESPOYR.js +0 -4
- package/dist-cli/chunks/chunk-TH2UFGVP.js +0 -4
- package/dist-cli/chunks/chunk-TLP3T3VO.js +0 -4
- package/dist-cli/chunks/chunk-TZUABDIJ.js +0 -38
- package/dist-cli/chunks/chunk-UB2W6OQM.js +0 -99
- package/dist-cli/chunks/chunk-UYVXALPB.js +0 -506
- package/dist-cli/chunks/chunk-VQDYFFIG.js +0 -5
- package/dist-cli/chunks/chunk-VWCNJPCJ.js +0 -5
- package/dist-cli/chunks/chunk-VZIK4WIS.js +0 -74
- package/dist-cli/chunks/chunk-W3FNXAQP.js +0 -4
- package/dist-cli/chunks/chunk-XCDNVNP3.js +0 -4
- package/dist-cli/chunks/chunk-XSVILA4Z.js +0 -4
- package/dist-cli/chunks/chunk-XUTJ7ZWD.js +0 -4
- package/dist-cli/chunks/chunk-YTXY3MHW.js +0 -4
- package/dist-cli/chunks/chunk-ZF7PVX44.js +0 -28
- package/dist-cli/chunks/chunk-ZSSG7OR7.js +0 -4
- package/dist-cli/chunks/cleanup-MLOK2OZA.js +0 -25
- package/dist-cli/chunks/cli-version-OBNR366V.js +0 -4
- package/dist-cli/chunks/compat-SHMFSKU7.js +0 -23
- package/dist-cli/chunks/config-TPEAEUJ2.js +0 -13
- package/dist-cli/chunks/connect-3LEXWTE5.js +0 -4
- package/dist-cli/chunks/control-Z3FWA6BO.js +0 -4
- package/dist-cli/chunks/daemon-RSVYSC65.js +0 -4
- package/dist-cli/chunks/debug-GUVAK2KR.js +0 -200
- package/dist-cli/chunks/desktop-OOP2PTKP.js +0 -31
- package/dist-cli/chunks/detox-C2ILVBEC.js +0 -52
- package/dist-cli/chunks/device-NXIQQJWR.js +0 -18
- package/dist-cli/chunks/diagnose-2JBGYE5L.js +0 -43
- package/dist-cli/chunks/disk-cleanup-VURWJYQV.js +0 -4
- package/dist-cli/chunks/do-chain-DJ4UQC7A.js +0 -5
- package/dist-cli/chunks/drivers-JMA2OIKU.js +0 -4
- package/dist-cli/chunks/env-KTNPKEZR.js +0 -4
- package/dist-cli/chunks/film-DCPS7EID.js +0 -74
- package/dist-cli/chunks/flow-4DZ7B2OA.js +0 -4
- package/dist-cli/chunks/help-34CJMQY2.js +0 -4
- package/dist-cli/chunks/hidden-runtime-alias-HHT2C7WE.js +0 -4
- package/dist-cli/chunks/home-paths-KTPGCPMS.js +0 -4
- package/dist-cli/chunks/inspect-JF5WYJRD.js +0 -4
- package/dist-cli/chunks/install-desktop-ZIC4CDXI.js +0 -4
- package/dist-cli/chunks/login-TTJAOI2Q.js +0 -26
- package/dist-cli/chunks/logout-ERAQ6SKW.js +0 -4
- package/dist-cli/chunks/maestro-W46QCF77.js +0 -108
- package/dist-cli/chunks/maestro-generate-VBLM3MTU.js +0 -36
- package/dist-cli/chunks/mode-ZEDZK7R7.js +0 -26
- package/dist-cli/chunks/optional-demo-registry-ZUTPSVYQ.js +0 -4
- package/dist-cli/chunks/perf-YVT2WXT4.js +0 -48
- package/dist-cli/chunks/permissions-L7VVDHFP.js +0 -13
- package/dist-cli/chunks/platform-7TJOU2FB.js +0 -6
- package/dist-cli/chunks/privacy-57UOTB5J.js +0 -4
- package/dist-cli/chunks/record-VXG37P7U.js +0 -72
- package/dist-cli/chunks/report-issue-WNNOBZHC.js +0 -29
- package/dist-cli/chunks/reset-H5NBFE5U.js +0 -4
- package/dist-cli/chunks/resolve-target-57TK5WLE.js +0 -4
- package/dist-cli/chunks/runtime-QU2NIF2K.js +0 -4
- package/dist-cli/chunks/screenshot-command-AN56TTG7.js +0 -159
- package/dist-cli/chunks/screenshot-layers-3W5R7DB2.js +0 -20
- package/dist-cli/chunks/screenshots-capture-6AWJY7XZ.js +0 -42
- package/dist-cli/chunks/serve-GLYO5Q7J.js +0 -56
- package/dist-cli/chunks/setup-UA2HLD7S.js +0 -4
- package/dist-cli/chunks/sim-client-5C2RDQQO.js +0 -4
- package/dist-cli/chunks/skills-EYXWBRNQ.js +0 -50
- package/dist-cli/chunks/state-REJ7W6K3.js +0 -14
- package/dist-cli/chunks/storage-CFMDHI3V.js +0 -37
- package/dist-cli/chunks/store-XMCUA45G.js +0 -4
- package/dist-cli/chunks/telemetry-FBL3NAKB.js +0 -4
- package/dist-cli/chunks/timeline-HMCHN5FO.js +0 -24
- package/dist-cli/chunks/upgrade-2QSPAA3P.js +0 -7
- package/dist-cli/chunks/upload-DUQBKZYV.js +0 -4
- package/dist-cli/chunks/version-IOA6QFGB.js +0 -6
- package/dist-cli/chunks/web-NCGUYVCJ.js +0 -4
- package/dist-cli/chunks/welcome-QYGSQCWQ.js +0 -5
- package/dist-cli/chunks/what-happened-YTOUK4LO.js +0 -25
- package/dist-cli/chunks/ws-bridge-OF4OZARG.js +0 -4
- package/scripts/postinstall.cjs +0 -3
- package/scripts/preuninstall.cjs +0 -118
package/cli/run-rnx.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// call: RAN under miniflare, `process.exit()` cancels the whole request.
|
|
1
|
+
// node/workerd compatibility for command modules that still write through
|
|
2
|
+
// process and console. browser-safe commands use run-rnx-core.ts, whose
|
|
3
|
+
// explicit context carries its writer, cancellation signal, semantic
|
|
4
|
+
// invocations, and artifacts without touching ambient process state.
|
|
6
5
|
//
|
|
7
6
|
// two things stand between the command modules and an in-process call, and
|
|
8
7
|
// this module owns both:
|
|
@@ -18,10 +17,8 @@
|
|
|
18
17
|
// returning a code to its caller. `rnxExit` throws instead, and `runRnx`
|
|
19
18
|
// turns it back into a code at the boundary.
|
|
20
19
|
//
|
|
21
|
-
// AsyncLocalStorage
|
|
22
|
-
//
|
|
23
|
-
// and will need the command modules to take an explicit writer. that is a real
|
|
24
|
-
// remaining seam, named here rather than discovered later.
|
|
20
|
+
// AsyncLocalStorage keeps this compatibility module node/workerd only. migrate
|
|
21
|
+
// a command to the explicit core before exposing it through a browser backend.
|
|
25
22
|
|
|
26
23
|
import { AsyncLocalStorage } from 'node:async_hooks'
|
|
27
24
|
|
package/cli/runtime-notes.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RNX_CHANGELOG_API_URL, RNX_CHANGELOG_URL } from '../src/runtime-delivery'
|
|
2
2
|
import type { ChangelogEntry } from '../../../scripts/changelog/types'
|
|
3
3
|
|
|
4
4
|
function isChangelogEntry(value: unknown): value is ChangelogEntry {
|
|
@@ -29,7 +29,7 @@ export async function fetchRuntimeReleaseNotes(
|
|
|
29
29
|
fetchImpl: typeof fetch = fetch,
|
|
30
30
|
): Promise<ChangelogEntry | null> {
|
|
31
31
|
try {
|
|
32
|
-
const url = new URL(
|
|
32
|
+
const url = new URL(RNX_CHANGELOG_API_URL)
|
|
33
33
|
url.searchParams.set('version', version)
|
|
34
34
|
const response = await fetchImpl(url, {
|
|
35
35
|
headers: { accept: 'application/json' },
|
|
@@ -61,6 +61,6 @@ export function formatRuntimeReleaseNotes(
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
lines.push(` full changelog: ${
|
|
64
|
+
lines.push(` full changelog: ${RNX_CHANGELOG_URL}`)
|
|
65
65
|
return lines.join('\n')
|
|
66
66
|
}
|
package/cli/ws-bridge.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// sootsim CLI ↔ sim WS bridge
|
|
2
2
|
//
|
|
3
|
-
// the
|
|
3
|
+
// the rnx runtime opens a WebSocket server (default port 7668) that
|
|
4
4
|
// accepts JSON commands like `{ type: 'evaluate', code: 'window.__sootsimTest.getNodeCount()' }`
|
|
5
5
|
// or `{ type: 'call', path: 'SootSim.bridges.mainShell.launchApp', args: ['photos'] }`
|
|
6
6
|
// and responds with `{ id, result }` or `{ id, error }`. CLI commands use
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
isDevBridgeLockfileFresh,
|
|
20
20
|
readDaemonLockfile,
|
|
21
21
|
readDevBridgeLockfiles,
|
|
22
|
-
|
|
22
|
+
rnxHomeDir,
|
|
23
23
|
type DevBridgeLockfile,
|
|
24
24
|
} from '../src/home-paths'
|
|
25
25
|
import { clearCurrentSimId, getCliIdentity, readCurrentSimId } from './current-sim'
|
|
@@ -27,8 +27,8 @@ import { clearCurrentSimId, getCliIdentity, readCurrentSimId } from './current-s
|
|
|
27
27
|
// --- bridge world resolution ---------------------------------------------
|
|
28
28
|
//
|
|
29
29
|
// two bridge kinds can coexist on one machine: Vite dev-shell bridges
|
|
30
|
-
// (~/.
|
|
31
|
-
// daemon runtime (~/.
|
|
30
|
+
// (~/.rnx/dev-bridges/<port>.json, shells served by Vite) and the installed
|
|
31
|
+
// daemon runtime (~/.rnx/daemon.json, shell served by the daemon's own
|
|
32
32
|
// http server). every default — the ws port a command connects to AND the
|
|
33
33
|
// shell base URL `open` builds its page from — must come from the SAME
|
|
34
34
|
// world, or `open` polls one bridge while the sim registers on the other
|
|
@@ -144,7 +144,7 @@ function resolveDefaultDevBridgeLockfile(): DevBridgeLockfile | null {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
export function resolveBridgeWorld(): BridgeWorld {
|
|
147
|
-
const homeDir =
|
|
147
|
+
const homeDir = rnxHomeDir()
|
|
148
148
|
if (resolvedWorld?.homeDir === homeDir) return resolvedWorld.world
|
|
149
149
|
const world = resolveBridgeWorldFresh()
|
|
150
150
|
resolvedWorld = { homeDir, world }
|
|
@@ -245,7 +245,7 @@ export function bridgePortForShellBaseUrl(baseUrl: string): number | null {
|
|
|
245
245
|
/** default ws bridge port for CLI commands: the fresh dev bridge when a vite
|
|
246
246
|
* shell is live, else the fresh daemon, else the hardcoded default. one
|
|
247
247
|
* deterministic answer regardless of how the CLI was invoked (global binary
|
|
248
|
-
* vs repo checkout) — invocation-path heuristics made `
|
|
248
|
+
* vs repo checkout) — invocation-path heuristics made `rnx list` flap
|
|
249
249
|
* between worlds. */
|
|
250
250
|
export function resolveDefaultBridgePort(): number {
|
|
251
251
|
return resolveBridgeWorld().bridgePort
|
|
@@ -358,7 +358,7 @@ export interface BridgeSimInfo {
|
|
|
358
358
|
documentFocused?: boolean
|
|
359
359
|
/** registration kind — 'sootsim' (default) or 'contrast'. used by the
|
|
360
360
|
* `contrast` CLI to filter, and by tooling that wants to distinguish a
|
|
361
|
-
* Contrast IDE tab from a regular
|
|
361
|
+
* Contrast IDE tab from a regular rnx runtime. */
|
|
362
362
|
kind?: string
|
|
363
363
|
/** opaque metadata supplied at register time (projectId, route, the
|
|
364
364
|
* attached iOS sim id, etc). free-form by design. */
|
|
@@ -640,7 +640,7 @@ export function createBridge(wsPort: number, opts: WsBridgeOptions = {}): WsBrid
|
|
|
640
640
|
|
|
641
641
|
// re-resolve the saved pin per send for bridges that were not
|
|
642
642
|
// explicitly `--sim`-targeted. a poll loop (`wait ready`) started
|
|
643
|
-
// before a concurrent `
|
|
643
|
+
// before a concurrent `rnx open` finished connecting would
|
|
644
644
|
// otherwise stay on the primary fallback for its whole budget, probing
|
|
645
645
|
// an unrelated (often empty) sim while the intended one connects and
|
|
646
646
|
// pins itself mid-wait. falling back to the startup pin keeps the
|
package/detox/config-loader.ts
CHANGED
|
@@ -121,14 +121,14 @@ export function mapDetoxDevice(config: DetoxConfig | null): string {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
// generate a sootsim-compatible config from detox config
|
|
124
|
-
export function
|
|
124
|
+
export function toRNXConfig(
|
|
125
125
|
projectDir: string,
|
|
126
126
|
config: DetoxConfig | null,
|
|
127
127
|
): SootSimDetoxConfig {
|
|
128
128
|
return {
|
|
129
129
|
testFiles: findDetoxTestFiles(projectDir, config),
|
|
130
130
|
testTimeout: config?.testRunner?.jest?.setupTimeout || 120000,
|
|
131
|
-
sootsimUrl: process.env.
|
|
131
|
+
sootsimUrl: process.env.RNX_URL || 'http://localhost:5173',
|
|
132
132
|
deviceModel: mapDetoxDevice(config),
|
|
133
133
|
maxWorkers: 1,
|
|
134
134
|
}
|
package/detox/index.ts
CHANGED
|
@@ -31,12 +31,12 @@ import type { SootsimEventMap, SootsimEventName } from 'sootsim-engine/sootsim-e
|
|
|
31
31
|
export { by }
|
|
32
32
|
export type { SootSimElement } from './element-types'
|
|
33
33
|
|
|
34
|
-
const BASE_URL = process.env.
|
|
34
|
+
const BASE_URL = process.env.RNX_URL || 'http://localhost:5173'
|
|
35
35
|
const SCREENSHOT_DIR =
|
|
36
|
-
process.env.
|
|
36
|
+
process.env.RNX_SCREENSHOT_DIR ||
|
|
37
37
|
path.join(process.cwd(), 'test', 'detox-driver', 'screenshots')
|
|
38
38
|
const DETOX_PLATFORM =
|
|
39
|
-
process.env.
|
|
39
|
+
process.env.RNX_PLATFORM === 'android' ? ('android' as const) : ('ios' as const)
|
|
40
40
|
|
|
41
41
|
// shared state -- playwright page and browser
|
|
42
42
|
let _browser: Browser | null = null
|
|
@@ -635,7 +635,7 @@ function decodePngDataUrl(dataUrl: string): Buffer {
|
|
|
635
635
|
const match = /^data:image\/png;base64,(.+)$/.exec(dataUrl)
|
|
636
636
|
if (!match) {
|
|
637
637
|
throw new Error(
|
|
638
|
-
`
|
|
638
|
+
`rnx screenshot bridge returned a non-png payload: ${JSON.stringify(dataUrl.slice(0, 120))}`,
|
|
639
639
|
)
|
|
640
640
|
}
|
|
641
641
|
return Buffer.from(match[1], 'base64')
|
|
@@ -682,14 +682,14 @@ async function captureSootsimPngFast(opts?: {
|
|
|
682
682
|
const screenshot = (window as { SootSim?: { bridges?: { screenshot?: unknown } } })
|
|
683
683
|
.SootSim?.bridges?.screenshot as ((opts?: unknown) => Promise<string>) | undefined
|
|
684
684
|
if (typeof screenshot !== 'function') {
|
|
685
|
-
throw new Error('
|
|
685
|
+
throw new Error('rnx screenshot bridge is not installed')
|
|
686
686
|
}
|
|
687
687
|
return screenshot(captureOpts)
|
|
688
688
|
},
|
|
689
689
|
{ crop: opts?.crop, format: 'png' },
|
|
690
690
|
)
|
|
691
691
|
if (!dataUrl) {
|
|
692
|
-
throw new Error('
|
|
692
|
+
throw new Error('rnx screenshot bridge returned an empty image')
|
|
693
693
|
}
|
|
694
694
|
return decodePngDataUrl(dataUrl)
|
|
695
695
|
}
|
|
@@ -729,7 +729,7 @@ async function captureSootsimPng(opts?: {
|
|
|
729
729
|
previous = current
|
|
730
730
|
}
|
|
731
731
|
throw new Error(
|
|
732
|
-
`
|
|
732
|
+
`rnx screenshot did not reach ${REQUIRED_IDENTICAL_PROOF_FRAMES} identical idle frames in ${attempts} captures`,
|
|
733
733
|
)
|
|
734
734
|
} finally {
|
|
735
735
|
await setSootsimCursorCaptureActive(page, false)
|
|
@@ -2209,7 +2209,7 @@ export const device = {
|
|
|
2209
2209
|
| ((opts?: unknown) => Promise<string>)
|
|
2210
2210
|
| undefined
|
|
2211
2211
|
if (typeof screenshot !== 'function') {
|
|
2212
|
-
throw new Error('
|
|
2212
|
+
throw new Error('rnx screenshot bridge is not installed')
|
|
2213
2213
|
}
|
|
2214
2214
|
const start = Date.now()
|
|
2215
2215
|
const out: Array<{
|
package/detox/jest-preset.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// jest preset for running existing detox suites against sootsim.
|
|
2
2
|
//
|
|
3
3
|
// users drop `preset: 'sootsim/detox/jest-preset'` into their jest config
|
|
4
|
-
// (or `
|
|
4
|
+
// (or `rnx-detox.config.cjs`) and their `import { by, device, element,
|
|
5
5
|
// expect, waitFor } from 'detox'` calls resolve to the sootsim driver.
|
|
6
6
|
|
|
7
7
|
const path = require('path')
|
package/detox/navigation.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { by, device, element, waitFor } from './index'
|
|
5
5
|
|
|
6
|
-
const BASE_URL = process.env.
|
|
6
|
+
const BASE_URL = process.env.RNX_URL || 'http://localhost:5173'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* navigate to a kitchen-sink test case in sootsim
|
|
@@ -17,7 +17,7 @@ export async function navigateToTestCase(
|
|
|
17
17
|
|
|
18
18
|
// navigate to the test case directly via URL, preserving any params
|
|
19
19
|
// already on BASE_URL (device=, colorScheme=, etc.) — the conformance
|
|
20
|
-
// runner sets these via
|
|
20
|
+
// runner sets these via RNX_URL and dropping them silently rendered
|
|
21
21
|
// pro max at iphone 16 dimensions.
|
|
22
22
|
const target = new URL(BASE_URL)
|
|
23
23
|
target.searchParams.set('test', testCaseName)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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;
|
|
@@ -88,8 +88,8 @@ var rnxPublicBrand = Object.freeze({
|
|
|
88
88
|
|
|
89
89
|
// src/agent-sessions.ts
|
|
90
90
|
function resolveSootsimInvocation() {
|
|
91
|
-
if (process.env.
|
|
92
|
-
return { cmd: process.env.
|
|
91
|
+
if (process.env.RNX_BIN) {
|
|
92
|
+
return { cmd: process.env.RNX_BIN, prefixArgs: [] };
|
|
93
93
|
}
|
|
94
94
|
if (process.versions.electron) {
|
|
95
95
|
const resourcesPath = process.resourcesPath;
|
|
@@ -112,7 +112,7 @@ function resolveSootsimInvocation() {
|
|
|
112
112
|
}
|
|
113
113
|
if (!argv1 || argv1.includes("/.bin/")) {
|
|
114
114
|
throw new Error(
|
|
115
|
-
"rnx CLI not found. set
|
|
115
|
+
"rnx CLI not found. set RNX_BIN to the path of the rnx binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`."
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
118
|
return { cmd: argv0, prefixArgs: [] };
|
|
@@ -121,7 +121,7 @@ function tryWorkspaceSootsim() {
|
|
|
121
121
|
try {
|
|
122
122
|
const sootsimDir = resolveSootsimPackageDir();
|
|
123
123
|
if (!sootsimDir) return null;
|
|
124
|
-
const binaryName = `
|
|
124
|
+
const binaryName = `rnx-${process.platform === "win32" ? "windows" : process.platform}-${process.arch}${process.platform === "win32" ? ".exe" : ""}`;
|
|
125
125
|
const distBinary = import_node_path2.default.join(sootsimDir, "dist-bin", binaryName);
|
|
126
126
|
if (import_node_fs2.default.existsSync(distBinary)) return { cmd: distBinary, prefixArgs: [] };
|
|
127
127
|
const distBin = import_node_path2.default.join(sootsimDir, "dist-cli", "bin.js");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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;
|
|
@@ -34,7 +34,7 @@ function agentSessionIdFromCliIdentity(identity) {
|
|
|
34
34
|
if (colon < 0) return identity.trim() || null;
|
|
35
35
|
const source = identity.slice(0, colon);
|
|
36
36
|
const value = identity.slice(colon + 1).trim();
|
|
37
|
-
return source === "
|
|
37
|
+
return source === "RNX_CLI_IDENTITY" && value ? value : null;
|
|
38
38
|
}
|
|
39
39
|
function teamMachineSessionIdFromCliIdentity(identity) {
|
|
40
40
|
if (!identity?.startsWith("TM_SESSION:")) return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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;
|
|
@@ -99,14 +99,14 @@ var import_node_path2 = __toESM(require("node:path"), 1);
|
|
|
99
99
|
// src/home-paths.ts
|
|
100
100
|
var import_node_os = require("node:os");
|
|
101
101
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
102
|
-
var
|
|
103
|
-
function
|
|
104
|
-
const override = process.env[
|
|
102
|
+
var RNX_HOME_ENV = "RNX_HOME";
|
|
103
|
+
function rnxHomeDir() {
|
|
104
|
+
const override = process.env[RNX_HOME_ENV];
|
|
105
105
|
if (override && override.length > 0) return import_node_path.default.resolve(override);
|
|
106
|
-
return import_node_path.default.join((0, import_node_os.homedir)(), ".
|
|
106
|
+
return import_node_path.default.join((0, import_node_os.homedir)(), ".rnx");
|
|
107
107
|
}
|
|
108
108
|
function electronDir() {
|
|
109
|
-
return import_node_path.default.join(
|
|
109
|
+
return import_node_path.default.join(rnxHomeDir(), "electron");
|
|
110
110
|
}
|
|
111
111
|
function electronUserDataDir() {
|
|
112
112
|
return import_node_path.default.join(electronDir(), "userData");
|
|
@@ -311,8 +311,8 @@ function pidIsAlive(pid, sessionId) {
|
|
|
311
311
|
return true;
|
|
312
312
|
}
|
|
313
313
|
function resolveSootsimInvocation() {
|
|
314
|
-
if (process.env.
|
|
315
|
-
return { cmd: process.env.
|
|
314
|
+
if (process.env.RNX_BIN) {
|
|
315
|
+
return { cmd: process.env.RNX_BIN, prefixArgs: [] };
|
|
316
316
|
}
|
|
317
317
|
if (process.versions.electron) {
|
|
318
318
|
const resourcesPath = process.resourcesPath;
|
|
@@ -335,7 +335,7 @@ function resolveSootsimInvocation() {
|
|
|
335
335
|
}
|
|
336
336
|
if (!argv1 || argv1.includes("/.bin/")) {
|
|
337
337
|
throw new Error(
|
|
338
|
-
"rnx CLI not found. set
|
|
338
|
+
"rnx CLI not found. set RNX_BIN to the path of the rnx binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`."
|
|
339
339
|
);
|
|
340
340
|
}
|
|
341
341
|
return { cmd: argv0, prefixArgs: [] };
|
|
@@ -344,7 +344,7 @@ function tryWorkspaceSootsim() {
|
|
|
344
344
|
try {
|
|
345
345
|
const sootsimDir = resolveSootsimPackageDir();
|
|
346
346
|
if (!sootsimDir) return null;
|
|
347
|
-
const binaryName = `
|
|
347
|
+
const binaryName = `rnx-${process.platform === "win32" ? "windows" : process.platform}-${process.arch}${process.platform === "win32" ? ".exe" : ""}`;
|
|
348
348
|
const distBinary = import_node_path3.default.join(sootsimDir, "dist-bin", binaryName);
|
|
349
349
|
if (import_node_fs2.default.existsSync(distBinary)) return { cmd: distBinary, prefixArgs: [] };
|
|
350
350
|
const distBin = import_node_path3.default.join(sootsimDir, "dist-cli", "bin.js");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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;
|
|
@@ -132,14 +132,14 @@ var import_node_path3 = __toESM(require("node:path"), 1);
|
|
|
132
132
|
// src/home-paths.ts
|
|
133
133
|
var import_node_os = require("node:os");
|
|
134
134
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
135
|
-
var
|
|
136
|
-
function
|
|
137
|
-
const override = process.env[
|
|
135
|
+
var RNX_HOME_ENV = "RNX_HOME";
|
|
136
|
+
function rnxHomeDir() {
|
|
137
|
+
const override = process.env[RNX_HOME_ENV];
|
|
138
138
|
if (override && override.length > 0) return import_node_path.default.resolve(override);
|
|
139
|
-
return import_node_path.default.join((0, import_node_os.homedir)(), ".
|
|
139
|
+
return import_node_path.default.join((0, import_node_os.homedir)(), ".rnx");
|
|
140
140
|
}
|
|
141
141
|
function electronDir() {
|
|
142
|
-
return import_node_path.default.join(
|
|
142
|
+
return import_node_path.default.join(rnxHomeDir(), "electron");
|
|
143
143
|
}
|
|
144
144
|
function electronUserDataDir() {
|
|
145
145
|
return import_node_path.default.join(electronDir(), "userData");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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;
|
|
@@ -45,14 +45,14 @@ var import_node_path2 = require("node:path");
|
|
|
45
45
|
// src/home-paths.ts
|
|
46
46
|
var import_node_os = require("node:os");
|
|
47
47
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
48
|
-
var
|
|
49
|
-
function
|
|
50
|
-
const override = process.env[
|
|
48
|
+
var RNX_HOME_ENV = "RNX_HOME";
|
|
49
|
+
function rnxHomeDir() {
|
|
50
|
+
const override = process.env[RNX_HOME_ENV];
|
|
51
51
|
if (override && override.length > 0) return import_node_path.default.resolve(override);
|
|
52
|
-
return import_node_path.default.join((0, import_node_os.homedir)(), ".
|
|
52
|
+
return import_node_path.default.join((0, import_node_os.homedir)(), ".rnx");
|
|
53
53
|
}
|
|
54
54
|
function electronDir() {
|
|
55
|
-
return import_node_path.default.join(
|
|
55
|
+
return import_node_path.default.join(rnxHomeDir(), "electron");
|
|
56
56
|
}
|
|
57
57
|
function electronUserDataDir() {
|
|
58
58
|
return import_node_path.default.join(electronDir(), "userData");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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/beta.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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/beta.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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/config.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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;
|
|
@@ -22,29 +22,29 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
// src/config.ts
|
|
23
23
|
var config_exports = {};
|
|
24
24
|
__export(config_exports, {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
RNX_CONFIG_QUERY_PARAM: () => RNX_CONFIG_QUERY_PARAM,
|
|
26
|
+
applyRNXConfigToUrl: () => applyRNXConfigToUrl,
|
|
27
27
|
defineConfig: () => defineConfig,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
hasRNXConfig: () => hasRNXConfig,
|
|
29
|
+
mergeRNXConfig: () => mergeRNXConfig,
|
|
30
|
+
readRNXConfigFromSearchParams: () => readRNXConfigFromSearchParams
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(config_exports);
|
|
33
|
-
var
|
|
33
|
+
var RNX_CONFIG_QUERY_PARAM = "rnxConfig";
|
|
34
34
|
function defineConfig(config) {
|
|
35
35
|
return config;
|
|
36
36
|
}
|
|
37
37
|
function hasOwnKeys(value) {
|
|
38
38
|
return !!value && Object.keys(value).length > 0;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function hasRNXConfig(config) {
|
|
41
41
|
if (!config) return false;
|
|
42
42
|
return typeof config.runtimeVersion === "string" && config.runtimeVersion.length > 0 || hasOwnKeys(config.modules) || hasOwnKeys(config.turboModules) || hasOwnKeys(config.nativeModules) || hasOwnKeys(config.env) || hasOwnKeys(config.network?.remap) || hasOwnKeys(config.settings) || hasOwnKeys(config.initialState);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
if (!
|
|
46
|
-
if (!
|
|
47
|
-
if (!
|
|
44
|
+
function mergeRNXConfig(base, override) {
|
|
45
|
+
if (!hasRNXConfig(base) && !hasRNXConfig(override)) return void 0;
|
|
46
|
+
if (!hasRNXConfig(base)) return override ? { ...override } : void 0;
|
|
47
|
+
if (!hasRNXConfig(override)) return base ? { ...base } : void 0;
|
|
48
48
|
return {
|
|
49
49
|
runtimeVersion: override.runtimeVersion ?? base.runtimeVersion,
|
|
50
50
|
modules: { ...base.modules || {}, ...override.modules || {} },
|
|
@@ -64,33 +64,33 @@ function mergeSootSimConfig(base, override) {
|
|
|
64
64
|
initialState: { ...base.initialState || {}, ...override.initialState || {} }
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const raw = searchParams.get(
|
|
67
|
+
function readRNXConfigFromSearchParams(searchParams) {
|
|
68
|
+
const raw = searchParams.get(RNX_CONFIG_QUERY_PARAM);
|
|
69
69
|
if (!raw) return void 0;
|
|
70
70
|
try {
|
|
71
71
|
const parsed = JSON.parse(raw);
|
|
72
|
-
return
|
|
72
|
+
return hasRNXConfig(parsed) ? parsed : void 0;
|
|
73
73
|
} catch (error) {
|
|
74
74
|
const message = error instanceof Error ? error.message : String(error);
|
|
75
|
-
console.warn(`[rnx] invalid ${
|
|
75
|
+
console.warn(`[rnx] invalid ${RNX_CONFIG_QUERY_PARAM}: ${message}`);
|
|
76
76
|
return void 0;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function applyRNXConfigToUrl(url, config) {
|
|
80
80
|
const parsed = new URL(url);
|
|
81
|
-
if (
|
|
82
|
-
parsed.searchParams.set(
|
|
81
|
+
if (hasRNXConfig(config)) {
|
|
82
|
+
parsed.searchParams.set(RNX_CONFIG_QUERY_PARAM, JSON.stringify(config));
|
|
83
83
|
} else {
|
|
84
|
-
parsed.searchParams.delete(
|
|
84
|
+
parsed.searchParams.delete(RNX_CONFIG_QUERY_PARAM);
|
|
85
85
|
}
|
|
86
86
|
return parsed.toString();
|
|
87
87
|
}
|
|
88
88
|
// Annotate the CommonJS export names for ESM import in node:
|
|
89
89
|
0 && (module.exports = {
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
RNX_CONFIG_QUERY_PARAM,
|
|
91
|
+
applyRNXConfigToUrl,
|
|
92
92
|
defineConfig,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
hasRNXConfig,
|
|
94
|
+
mergeRNXConfig,
|
|
95
|
+
readRNXConfigFromSearchParams
|
|
96
96
|
});
|
package/dist-lib/detox/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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;
|
|
@@ -1453,9 +1453,9 @@ var by = {
|
|
|
1453
1453
|
// detox/index.ts
|
|
1454
1454
|
var import_motion_change = __toESM(require_motion_change(), 1);
|
|
1455
1455
|
var import_proof_frame = __toESM(require_proof_frame(), 1);
|
|
1456
|
-
var BASE_URL = process.env.
|
|
1457
|
-
var SCREENSHOT_DIR = process.env.
|
|
1458
|
-
var DETOX_PLATFORM = process.env.
|
|
1456
|
+
var BASE_URL = process.env.RNX_URL || "http://localhost:5173";
|
|
1457
|
+
var SCREENSHOT_DIR = process.env.RNX_SCREENSHOT_DIR || path.join(process.cwd(), "test", "detox-driver", "screenshots");
|
|
1458
|
+
var DETOX_PLATFORM = process.env.RNX_PLATFORM === "android" ? "android" : "ios";
|
|
1459
1459
|
var _browser = null;
|
|
1460
1460
|
var _reapBrowserNow = null;
|
|
1461
1461
|
var _context = null;
|
|
@@ -1923,7 +1923,7 @@ function decodePngDataUrl(dataUrl) {
|
|
|
1923
1923
|
const match = /^data:image\/png;base64,(.+)$/.exec(dataUrl);
|
|
1924
1924
|
if (!match) {
|
|
1925
1925
|
throw new Error(
|
|
1926
|
-
`
|
|
1926
|
+
`rnx screenshot bridge returned a non-png payload: ${JSON.stringify(dataUrl.slice(0, 120))}`
|
|
1927
1927
|
);
|
|
1928
1928
|
}
|
|
1929
1929
|
return Buffer.from(match[1], "base64");
|
|
@@ -1947,14 +1947,14 @@ async function captureSootsimPngFast(opts) {
|
|
|
1947
1947
|
async (captureOpts) => {
|
|
1948
1948
|
const screenshot = window.SootSim?.bridges?.screenshot;
|
|
1949
1949
|
if (typeof screenshot !== "function") {
|
|
1950
|
-
throw new Error("
|
|
1950
|
+
throw new Error("rnx screenshot bridge is not installed");
|
|
1951
1951
|
}
|
|
1952
1952
|
return screenshot(captureOpts);
|
|
1953
1953
|
},
|
|
1954
1954
|
{ crop: opts?.crop, format: "png" }
|
|
1955
1955
|
);
|
|
1956
1956
|
if (!dataUrl) {
|
|
1957
|
-
throw new Error("
|
|
1957
|
+
throw new Error("rnx screenshot bridge returned an empty image");
|
|
1958
1958
|
}
|
|
1959
1959
|
return decodePngDataUrl(dataUrl);
|
|
1960
1960
|
}
|
|
@@ -1988,7 +1988,7 @@ async function captureSootsimPng(opts) {
|
|
|
1988
1988
|
previous = current;
|
|
1989
1989
|
}
|
|
1990
1990
|
throw new Error(
|
|
1991
|
-
`
|
|
1991
|
+
`rnx screenshot did not reach ${import_proof_frame.REQUIRED_IDENTICAL_PROOF_FRAMES} identical idle frames in ${attempts} captures`
|
|
1992
1992
|
);
|
|
1993
1993
|
} finally {
|
|
1994
1994
|
await setSootsimCursorCaptureActive(page, false);
|
|
@@ -2981,7 +2981,7 @@ var device = {
|
|
|
2981
2981
|
async (input) => {
|
|
2982
2982
|
const screenshot = window.SootSim?.bridges?.screenshot;
|
|
2983
2983
|
if (typeof screenshot !== "function") {
|
|
2984
|
-
throw new Error("
|
|
2984
|
+
throw new Error("rnx screenshot bridge is not installed");
|
|
2985
2985
|
}
|
|
2986
2986
|
const start = Date.now();
|
|
2987
2987
|
const out = [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// jest preset for running existing detox suites against sootsim.
|
|
2
2
|
//
|
|
3
3
|
// users drop `preset: 'sootsim/detox/jest-preset'` into their jest config
|
|
4
|
-
// (or `
|
|
4
|
+
// (or `rnx-detox.config.cjs`) and their `import { by, device, element,
|
|
5
5
|
// expect, waitFor } from 'detox'` calls resolve to the sootsim driver.
|
|
6
6
|
|
|
7
7
|
const path = require('path')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.377 | (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;
|