rnxsim 0.1.376 → 0.1.378
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 +73 -31
- 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 +329 -160
- 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/commands/control.ts
CHANGED
|
@@ -13,10 +13,10 @@ import { isAppDeepLinkTarget, openAppUrl } from '../../src/app-url'
|
|
|
13
13
|
import { isLoopbackHost } from '../../src/backend-origin'
|
|
14
14
|
import { resolveSootsimShellBaseUrlForBridgePort } from '../../src/bridge-constants'
|
|
15
15
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
type
|
|
16
|
+
applyRNXConfigToUrl,
|
|
17
|
+
mergeRNXConfig,
|
|
18
|
+
RNX_CONFIG_QUERY_PARAM,
|
|
19
|
+
type RNXConfig,
|
|
20
20
|
} from '../../src/config'
|
|
21
21
|
import {
|
|
22
22
|
resolveConnectionInput,
|
|
@@ -37,8 +37,8 @@ import {
|
|
|
37
37
|
resolveDevCheckoutRuntimeRoot,
|
|
38
38
|
runtimeVersionHostname,
|
|
39
39
|
} from '../../src/runtime-assets'
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
40
|
+
import { rnxRuntime } from '../../src/runtime-delivery'
|
|
41
|
+
import { loadRNXAppConfig } from '../app-config'
|
|
42
42
|
import {
|
|
43
43
|
type DiscoveredAppFontSpec,
|
|
44
44
|
discoverNativeLinkedAppFonts,
|
|
@@ -75,7 +75,7 @@ import type { DriverId, DriverLaunchResult } from '../drivers/types'
|
|
|
75
75
|
interface ControlCommandOptions {
|
|
76
76
|
port?: number
|
|
77
77
|
timeoutMs?: number
|
|
78
|
-
runtimeConfig?:
|
|
78
|
+
runtimeConfig?: RNXConfig
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
interface DriverConnectWaitOptions {
|
|
@@ -237,7 +237,7 @@ function assertExplicitBridgeLock(
|
|
|
237
237
|
return
|
|
238
238
|
}
|
|
239
239
|
throw new Error(
|
|
240
|
-
`${rnxPublicBrand.commandName} open: requested bridge port ${preferredPort}, but the active daemon owns port ${lock.bridgePort}. explicit --port never selects another bridge; stop that daemon or use an isolated
|
|
240
|
+
`${rnxPublicBrand.commandName} open: requested bridge port ${preferredPort}, but the active daemon owns port ${lock.bridgePort}. explicit --port never selects another bridge; stop that daemon or use an isolated RNX_HOME.`,
|
|
241
241
|
)
|
|
242
242
|
}
|
|
243
243
|
|
|
@@ -342,7 +342,7 @@ function buildShellPathOpenUrl(target: string, baseUrl: string): string {
|
|
|
342
342
|
// SootSim share/preview/build links (e.g. https://sootsim.com/preview/<id>,
|
|
343
343
|
// https://contrast.dev/build/<owner>/<repo>/<branch>) are full player pages
|
|
344
344
|
// served by the Contrast app — NOT Metro bundles and NOT driveable shell sims.
|
|
345
|
-
// passing one to `
|
|
345
|
+
// passing one to `rnx open` used to fall through to the bundle resolver,
|
|
346
346
|
// which fetched the HTML page and choked with "Unexpected token '<'". two
|
|
347
347
|
// hard reasons they can't become a CLI-driveable sim:
|
|
348
348
|
// 1. the engine only attaches to the local CLI bridge from a localhost /
|
|
@@ -475,8 +475,8 @@ function normalizeReplacementPath(filePath: string): string {
|
|
|
475
475
|
return path.resolve(process.cwd(), filePath)
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
-
function parseOpenRuntimeConfig(args: string[]):
|
|
479
|
-
const modules: NonNullable<
|
|
478
|
+
function parseOpenRuntimeConfig(args: string[]): RNXConfig | undefined {
|
|
479
|
+
const modules: NonNullable<RNXConfig['modules']> = {}
|
|
480
480
|
const remap: Record<string, string> = {}
|
|
481
481
|
|
|
482
482
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -517,7 +517,7 @@ function parseOpenRuntimeConfig(args: string[]): SootSimConfig | undefined {
|
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
-
const config:
|
|
520
|
+
const config: RNXConfig = {}
|
|
521
521
|
if (Object.keys(modules).length > 0) config.modules = modules
|
|
522
522
|
if (Object.keys(remap).length > 0) config.network = { remap }
|
|
523
523
|
return config.modules || config.network ? config : undefined
|
|
@@ -534,7 +534,7 @@ async function resolveOpenAppProject(
|
|
|
534
534
|
async function ensureConfiguredRuntime(version: string): Promise<void> {
|
|
535
535
|
if (fs.existsSync(path.join(runtimeDir(version), 'index.html'))) return
|
|
536
536
|
console.error(` installing configured engine runtime ${version}...`)
|
|
537
|
-
const result = await
|
|
537
|
+
const result = await rnxRuntime.install({
|
|
538
538
|
version,
|
|
539
539
|
setActive: false,
|
|
540
540
|
protectVersions: readLiveRuntimeVersions(),
|
|
@@ -941,7 +941,7 @@ export function printConnectedSims(sims: BridgeSimInfo[], selectedId?: string) {
|
|
|
941
941
|
}
|
|
942
942
|
|
|
943
943
|
// classify which engine a sim is running so dev-vs-published is never ambiguous
|
|
944
|
-
// to agents or humans reading `
|
|
944
|
+
// to agents or humans reading `rnx list`. dev shell serves local source on
|
|
945
945
|
// :5173; the Contrast app embeds sootsim on :3000; the bridge/daemon and the
|
|
946
946
|
// /__soot plugin serve the active runtime dir — which, inside a dev checkout, is
|
|
947
947
|
// the fresh dev-stack build (resolveDevCheckoutRuntimeRoot mode boundary), not a
|
|
@@ -1211,16 +1211,16 @@ export function printOpenedSim(
|
|
|
1211
1211
|
try {
|
|
1212
1212
|
const parsed = new URL(value)
|
|
1213
1213
|
let changed = false
|
|
1214
|
-
if (parsed.searchParams.has(
|
|
1215
|
-
parsed.searchParams.set(
|
|
1214
|
+
if (parsed.searchParams.has(RNX_CONFIG_QUERY_PARAM)) {
|
|
1215
|
+
parsed.searchParams.set(RNX_CONFIG_QUERY_PARAM, '[redacted]')
|
|
1216
1216
|
changed = true
|
|
1217
1217
|
}
|
|
1218
1218
|
const bundle = parsed.searchParams.get('bundle')
|
|
1219
1219
|
if (bundle) {
|
|
1220
1220
|
try {
|
|
1221
1221
|
const parsedBundle = new URL(bundle)
|
|
1222
|
-
if (parsedBundle.searchParams.has(
|
|
1223
|
-
parsedBundle.searchParams.set(
|
|
1222
|
+
if (parsedBundle.searchParams.has(RNX_CONFIG_QUERY_PARAM)) {
|
|
1223
|
+
parsedBundle.searchParams.set(RNX_CONFIG_QUERY_PARAM, '[redacted]')
|
|
1224
1224
|
parsed.searchParams.set('bundle', parsedBundle.toString())
|
|
1225
1225
|
changed = true
|
|
1226
1226
|
}
|
|
@@ -1248,7 +1248,7 @@ export function printOpenedSim(
|
|
|
1248
1248
|
// bounded — a cold guest bundle takes 5-15s to fully route, so we don't
|
|
1249
1249
|
// try to wait for that. instead: settle for a moment to let the first
|
|
1250
1250
|
// paint land, then describe whatever's on screen. for cold loads that's
|
|
1251
|
-
// a splash; the caller can `
|
|
1251
|
+
// a splash; the caller can `rnx describe` again a second later. for
|
|
1252
1252
|
// warm loads it's the real screen. guarded by --no-describe.
|
|
1253
1253
|
async function maybeDescribeAfterOpen(wsPort: number, simId: string, args: string[]) {
|
|
1254
1254
|
if (args.includes('--no-describe')) return
|
|
@@ -1258,7 +1258,7 @@ async function maybeDescribeAfterOpen(wsPort: number, simId: string, args: strin
|
|
|
1258
1258
|
// brief settle, then dump the tree directly. don't go through
|
|
1259
1259
|
// runDescribeSubcommand — its screen-transition wait can block for many
|
|
1260
1260
|
// seconds on a still-routing guest app, which is exactly what we want
|
|
1261
|
-
// to skip for the open-side describe. caller can `
|
|
1261
|
+
// to skip for the open-side describe. caller can `rnx describe`
|
|
1262
1262
|
// again later for post-routing state.
|
|
1263
1263
|
await waitForTreeStable(wsPort, simId, { stableMs: 150, maxMs: 400 })
|
|
1264
1264
|
const bridge = createBridge(wsPort, {
|
|
@@ -1481,10 +1481,10 @@ export async function runOpenCommand(
|
|
|
1481
1481
|
? await resolveConnectionInputForCli(target)
|
|
1482
1482
|
: undefined
|
|
1483
1483
|
const project = await resolveOpenAppProject(resolvedBundle)
|
|
1484
|
-
const appConfig = await
|
|
1484
|
+
const appConfig = await loadRNXAppConfig(project)
|
|
1485
1485
|
const configuredRuntimeVersion = appConfig?.runtimeVersion
|
|
1486
|
-
const runtimeConfig =
|
|
1487
|
-
|
|
1486
|
+
const runtimeConfig = mergeRNXConfig(
|
|
1487
|
+
mergeRNXConfig(
|
|
1488
1488
|
appConfig ? { ...appConfig, runtimeVersion: undefined } : undefined,
|
|
1489
1489
|
opts.runtimeConfig,
|
|
1490
1490
|
),
|
|
@@ -1623,7 +1623,7 @@ export async function runOpenCommand(
|
|
|
1623
1623
|
if (!targetSim && parsed.simIdSource !== 'flag') {
|
|
1624
1624
|
targetShellUrl = await buildShellUrl(
|
|
1625
1625
|
target,
|
|
1626
|
-
|
|
1626
|
+
applyRNXConfigToUrl(baseUrl, runtimeConfig),
|
|
1627
1627
|
buildShellUrlOpts,
|
|
1628
1628
|
)
|
|
1629
1629
|
const normalizedTarget = new URL(targetShellUrl)
|
|
@@ -1662,7 +1662,7 @@ export async function runOpenCommand(
|
|
|
1662
1662
|
targetShellUrl ??
|
|
1663
1663
|
(await buildShellUrl(
|
|
1664
1664
|
target,
|
|
1665
|
-
|
|
1665
|
+
applyRNXConfigToUrl(resolvedBaseUrl, runtimeConfig),
|
|
1666
1666
|
buildShellUrlOpts,
|
|
1667
1667
|
))
|
|
1668
1668
|
bridge
|
|
@@ -1706,7 +1706,7 @@ export async function runOpenCommand(
|
|
|
1706
1706
|
targetShellUrl ??
|
|
1707
1707
|
(await buildShellUrl(
|
|
1708
1708
|
target,
|
|
1709
|
-
|
|
1709
|
+
applyRNXConfigToUrl(resolvedBaseUrl, runtimeConfig),
|
|
1710
1710
|
buildShellUrlOpts,
|
|
1711
1711
|
))
|
|
1712
1712
|
printOpenedSim(shellUrl, { ...targetSim, url: shellUrl }, 'current sim', quiet)
|
|
@@ -1718,7 +1718,7 @@ export async function runOpenCommand(
|
|
|
1718
1718
|
}
|
|
1719
1719
|
}
|
|
1720
1720
|
|
|
1721
|
-
const configuredBaseUrl =
|
|
1721
|
+
const configuredBaseUrl = applyRNXConfigToUrl(baseUrl, runtimeConfig)
|
|
1722
1722
|
const token = `cli-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`
|
|
1723
1723
|
const openUrl = await buildOpenUrl(target, configuredBaseUrl, token, buildShellUrlOpts)
|
|
1724
1724
|
const ownerPid = getStableOwnerPid()
|
|
@@ -1810,7 +1810,7 @@ async function runUseLikeCommand(args: string[], opts: ControlCommandOptions = {
|
|
|
1810
1810
|
// `use`/`focus` retarget the CLI at a sim — silently grabbing one a
|
|
1811
1811
|
// human is actively driving is the same footgun `claim` guards against,
|
|
1812
1812
|
// so honor the lock here too (this command historically did not, which
|
|
1813
|
-
// let `
|
|
1813
|
+
// let `rnx use <id>` steal the user's live tab).
|
|
1814
1814
|
if (target.lockedBy && target.lockExpiresAt && target.lockExpiresAt > Date.now()) {
|
|
1815
1815
|
const secs = Math.max(0, Math.round((target.lockExpiresAt - Date.now()) / 1000))
|
|
1816
1816
|
if (target.lockedByKind === 'user-active') {
|
|
@@ -1831,7 +1831,7 @@ async function runUseLikeCommand(args: string[], opts: ControlCommandOptions = {
|
|
|
1831
1831
|
` refused: ${target.id} is leased by ${target.lockedBy} (${secs}s)`,
|
|
1832
1832
|
)
|
|
1833
1833
|
console.error(
|
|
1834
|
-
` \`
|
|
1834
|
+
` \`rnx use ${target.id} --force\` to take it, or \`rnx open --new\` for a fresh sim`,
|
|
1835
1835
|
)
|
|
1836
1836
|
rnxExit(1)
|
|
1837
1837
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// rnx perf cpu — capture a sampled CPU trace from the tenant worker.
|
|
2
2
|
//
|
|
3
3
|
// the JS Self-Profiler API (`new Profiler()`) cannot be constructed in a
|
|
4
4
|
// dedicated-worker scope, and sootsim runs the guest app in the tenant worker,
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
// it stays driveable over the WS bridge, so you can scroll/navigate while
|
|
16
16
|
// profiling (the playwright driver passes --remote-debugging-port through):
|
|
17
17
|
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
18
|
+
// rnx open <metro-port> --new --driver playwright --cdp-port 9222
|
|
19
|
+
// rnx perf cpu --cdp-port 9222 --match <metro-port> --duration 5
|
|
20
20
|
//
|
|
21
21
|
// (a standalone CDP Chrome also works for profiling a static page, but it
|
|
22
22
|
// does NOT register on the bridge, so it can't be driven — see printNoCdp.)
|
|
@@ -109,13 +109,13 @@ export async function runCpuProfile(
|
|
|
109
109
|
}
|
|
110
110
|
const sampleInterval = Number(valueOf(args, '--sample-interval') ?? '0.1') // ms
|
|
111
111
|
const cdpPort = Number(
|
|
112
|
-
valueOf(args, '--cdp-port') ?? process.env.
|
|
112
|
+
valueOf(args, '--cdp-port') ?? process.env.RNX_CDP_PORT ?? '9222',
|
|
113
113
|
)
|
|
114
114
|
// optional substring filter to pick the right page when several sims share
|
|
115
115
|
// the CDP browser (e.g. `--match 8089` or `--match /rn/8089`).
|
|
116
116
|
const match = valueOf(args, '--match') ?? '/rn/'
|
|
117
117
|
const outputArg = valueOf(args, '--output') ?? valueOf(args, '-o')
|
|
118
|
-
const outputPath = resolve(process.cwd(), outputArg ?? '/tmp/
|
|
118
|
+
const outputPath = resolve(process.cwd(), outputArg ?? '/tmp/rnx.cpuprofile')
|
|
119
119
|
|
|
120
120
|
// locate the page target on the CDP endpoint. NOTE: Chrome's DevTools HTTP
|
|
121
121
|
// `/json` endpoints reject any Host header that isn't `localhost` (a
|
|
@@ -222,7 +222,7 @@ function printNoCdp(cdpPort: number) {
|
|
|
222
222
|
console.error('')
|
|
223
223
|
console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\')
|
|
224
224
|
console.error(
|
|
225
|
-
` --remote-debugging-port=${cdpPort} --user-data-dir=/tmp/
|
|
225
|
+
` --remote-debugging-port=${cdpPort} --user-data-dir=/tmp/rnx-cdp \\`,
|
|
226
226
|
)
|
|
227
227
|
console.error(' --no-sandbox --disable-gpu-sandbox \\')
|
|
228
228
|
// never suggest swiftshader — software rendering pegs every core for the
|
|
@@ -231,7 +231,7 @@ function printNoCdp(cdpPort: number) {
|
|
|
231
231
|
console.error(' --use-gl=angle --use-angle=metal \\')
|
|
232
232
|
console.error(' "http://localhost:5173/rn/<metro-port>" &')
|
|
233
233
|
console.error('')
|
|
234
|
-
console.error(' override the port with --cdp-port or $
|
|
234
|
+
console.error(' override the port with --cdp-port or $RNX_CDP_PORT.')
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
function shortUrl(url: string): string {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// generate + ad-hoc sign the
|
|
1
|
+
// generate + ad-hoc sign the RNX Daemon.app wrapper that the launchd
|
|
2
2
|
// agent points its ProgramArguments at.
|
|
3
3
|
//
|
|
4
4
|
// why this exists: macOS Background Task Management (the "X wants to run in
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
// pointed at bun directly the entry shows "software from Jarred Sumner"
|
|
8
8
|
// because that's bun's code-signing identity. wrapping the real invocation
|
|
9
9
|
// in an ad-hoc-signed `.app` lets BTM read CFBundleDisplayName from the
|
|
10
|
-
// bundle Info.plist instead, so the entry reads "
|
|
10
|
+
// bundle Info.plist instead, so the entry reads "RNX Daemon".
|
|
11
11
|
//
|
|
12
12
|
// the bundle is regenerated every time `daemonInstall` runs — it's tiny
|
|
13
13
|
// (a plist + a shell launcher) and the launcher embeds a snapshot of the
|
|
14
|
-
// invocation, so an `npm update -g sootsim` followed by `
|
|
14
|
+
// invocation, so an `npm update -g sootsim` followed by `rnx daemon
|
|
15
15
|
// install --force` is the documented upgrade path. there's no notarization
|
|
16
16
|
// or Developer ID signing here yet; ad-hoc + hardened runtime is enough to
|
|
17
17
|
// fix the attribution, and a real signed bundle (shipped via the runtime
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from '../../src/home-paths'
|
|
28
28
|
|
|
29
29
|
const BUNDLE_IDENTIFIER = 'dev.sootsim.daemon'
|
|
30
|
-
const BUNDLE_DISPLAY_NAME = '
|
|
30
|
+
const BUNDLE_DISPLAY_NAME = 'RNX Daemon'
|
|
31
31
|
// kept in sync with package.json on release. exact value doesn't matter for
|
|
32
32
|
// BTM display — macOS only reads it for "About this app" surfaces — so we
|
|
33
33
|
// hardcode it rather than reach back into the package.json from a runtime
|
|
@@ -49,7 +49,7 @@ export interface DaemonAppPaths {
|
|
|
49
49
|
launcherPath: string
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
/** rebuild ~/.
|
|
52
|
+
/** rebuild ~/.rnx/daemon-app/RNX Daemon.app/ for the given invocation
|
|
53
53
|
* and re-sign it ad-hoc. safe to call repeatedly; the directory is wiped
|
|
54
54
|
* before write so stale state from earlier installs can't leak through. */
|
|
55
55
|
export function ensureDaemonApp(
|
|
@@ -103,7 +103,7 @@ function renderInfoPlist(): string {
|
|
|
103
103
|
<dict>
|
|
104
104
|
<key>CFBundleDevelopmentRegion</key><string>en</string>
|
|
105
105
|
<key>CFBundleDisplayName</key><string>${BUNDLE_DISPLAY_NAME}</string>
|
|
106
|
-
<key>CFBundleExecutable</key><string>
|
|
106
|
+
<key>CFBundleExecutable</key><string>rnx-daemon</string>
|
|
107
107
|
<key>CFBundleIdentifier</key><string>${BUNDLE_IDENTIFIER}</string>
|
|
108
108
|
<key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
|
|
109
109
|
<key>CFBundleName</key><string>${BUNDLE_DISPLAY_NAME}</string>
|
|
@@ -142,7 +142,7 @@ function renderLauncherScript(
|
|
|
142
142
|
const stdout = shellSingleQuote(logDir.stdout)
|
|
143
143
|
const stderr = shellSingleQuote(logDir.stderr)
|
|
144
144
|
return `#!/bin/sh
|
|
145
|
-
#
|
|
145
|
+
# rnx daemon launcher generated by 'rnx daemon install'.
|
|
146
146
|
# launchd spawns this; we exec the real rnx invocation in place so
|
|
147
147
|
# launchd tracks the daemon process, not the shell wrapper.
|
|
148
148
|
#
|
package/cli/commands/daemon.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
//
|
|
1
|
+
// rnx daemon — manage the persistent sootsim bridge daemon
|
|
2
2
|
//
|
|
3
|
-
// wraps `
|
|
3
|
+
// wraps `rnx serve` so it starts automatically on login and restarts if
|
|
4
4
|
// it crashes. the agent is tied to whichever `sootsim` binary resolves at
|
|
5
|
-
// registration time, so `npm update -g sootsim` + `
|
|
5
|
+
// registration time, so `npm update -g sootsim` + `rnx daemon restart`
|
|
6
6
|
// picks up the upgrade without touching the plist/unit file.
|
|
7
7
|
//
|
|
8
8
|
// `daemonInstall` is shared by `rnx setup` and the explicit
|
|
9
|
-
// `
|
|
9
|
+
// `rnx daemon install` machine-bootstrap path.
|
|
10
10
|
//
|
|
11
11
|
// macOS: ~/Library/LaunchAgents/dev.sootsim.daemon.plist (launchd)
|
|
12
12
|
// linux: ~/.config/systemd/user/sootsim-daemon.service (systemd --user)
|
|
13
|
-
// win: not yet supported — use `
|
|
13
|
+
// win: not yet supported — use `rnx serve` in a persistent shell.
|
|
14
14
|
//
|
|
15
15
|
// the macOS launchd Label is `dev.sootsim.daemon` (matching the .app
|
|
16
16
|
// CFBundleIdentifier).
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
isDaemonLockfileFresh,
|
|
34
34
|
readDaemonLockfile,
|
|
35
35
|
shouldSkipPersistentDaemon,
|
|
36
|
-
|
|
36
|
+
rnxHomeDir,
|
|
37
37
|
} from '../../src/home-paths'
|
|
38
38
|
import { rnxPublicBrand } from '../../src/public-brand'
|
|
39
39
|
import { printCommandHelp } from '../help'
|
|
@@ -511,7 +511,7 @@ export function teardownLegacyMacDaemonArtifacts(
|
|
|
511
511
|
|
|
512
512
|
/** stop + disable + remove the persistent launchd / systemd registration
|
|
513
513
|
* and its support files (mac .app bundle, log dir). does NOT touch user
|
|
514
|
-
* data under ~/.
|
|
514
|
+
* data under ~/.rnx. idempotent: each entry is checked before remove.
|
|
515
515
|
* exported for reuse by the npm preuninstall hook (scripts/preuninstall.cjs)
|
|
516
516
|
* via the bundled CLI so a `npm rm -g sootsim` tears down the daemon before
|
|
517
517
|
* the bin disappears. */
|
|
@@ -571,12 +571,12 @@ export function teardownDaemonService(): TeardownReport {
|
|
|
571
571
|
return { removed, missing: true }
|
|
572
572
|
}
|
|
573
573
|
|
|
574
|
-
/** remove the user-data cache under ~/.
|
|
575
|
-
* profiles, lockfile, config). idempotent. honors $
|
|
574
|
+
/** remove the user-data cache under ~/.rnx (runtimes, electron support,
|
|
575
|
+
* profiles, lockfile, config). idempotent. honors $RNX_HOME. exported
|
|
576
576
|
* for reuse by the npm preuninstall hook. */
|
|
577
577
|
export function teardownSootsimHome(): TeardownReport {
|
|
578
578
|
const removed: string[] = []
|
|
579
|
-
const home =
|
|
579
|
+
const home = rnxHomeDir()
|
|
580
580
|
if (existsSync(home)) {
|
|
581
581
|
rmSync(home, { recursive: true, force: true })
|
|
582
582
|
removed.push(home)
|
package/cli/commands/debug.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
//
|
|
1
|
+
// rnx debug — drive __sootsimDebug.* from the terminal
|
|
2
2
|
//
|
|
3
3
|
// connects to a running sootsim instance via the WebSocket bridge and forwards
|
|
4
4
|
// debug channel management, tree snapshots, and on-demand inspectors without
|
|
5
5
|
// requiring a browser console.
|
|
6
6
|
//
|
|
7
7
|
// usage examples:
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
8
|
+
// rnx debug enable sheets,portals,onlayout
|
|
9
|
+
// rnx debug status
|
|
10
|
+
// rnx debug snapshot before
|
|
11
11
|
// # ... tap something in the UI ...
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
12
|
+
// rnx debug snapshot after
|
|
13
|
+
// rnx debug diff before after
|
|
14
|
+
// rnx debug find sheets
|
|
15
|
+
// rnx debug find portals
|
|
16
|
+
// rnx debug recent portals
|
|
17
|
+
// rnx debug flags
|
|
18
18
|
//
|
|
19
19
|
// all commands print JSON by default so they pipe cleanly into jq.
|
|
20
20
|
|
|
@@ -320,7 +320,7 @@ function readNumberFlag(args: string[], flag: string): number | null {
|
|
|
320
320
|
|
|
321
321
|
// enable the audit, force one real frame, then read and stop. the screenshot
|
|
322
322
|
// request is what forces the frame: it runs the same publish-and-paint pass
|
|
323
|
-
// `
|
|
323
|
+
// `rnx screenshot` does, so the rows describe pixels that were actually
|
|
324
324
|
// produced rather than a tree walk's guess about them.
|
|
325
325
|
async function runImageAudit(bridge: WsBridge): Promise<ImageAuditReportView> {
|
|
326
326
|
await call(
|
package/cli/commands/detox.ts
CHANGED
|
@@ -45,7 +45,7 @@ rnx detox — run detox-style tests against an rnx shell
|
|
|
45
45
|
usage:
|
|
46
46
|
rnx detox [testFiles...] run all tests under e2e/, test/e2e/, or detox/
|
|
47
47
|
rnx detox --config <path> use a specific jest config
|
|
48
|
-
rnx detox init scaffold
|
|
48
|
+
rnx detox init scaffold rnx-detox.config.cjs + sample test
|
|
49
49
|
rnx detox --watch jest watch mode
|
|
50
50
|
rnx detox --headed keep the rnx shell window visible
|
|
51
51
|
rnx detox -t <pattern> pass a jest --testNamePattern
|
|
@@ -106,11 +106,11 @@ export async function runDetox(args: string[], opts: RunDetoxOpts = {}): Promise
|
|
|
106
106
|
return []
|
|
107
107
|
})
|
|
108
108
|
|
|
109
|
-
// test dir discovery. external test suites set
|
|
109
|
+
// test dir discovery. external test suites set RNX_TEST_DIR; otherwise
|
|
110
110
|
// we auto-detect the conventional locations.
|
|
111
111
|
const detoxDirs = ['e2e', 'test/e2e', 'detox']
|
|
112
|
-
let testDir: string | null = process.env.
|
|
113
|
-
? resolve(process.cwd(), process.env.
|
|
112
|
+
let testDir: string | null = process.env.RNX_TEST_DIR
|
|
113
|
+
? resolve(process.cwd(), process.env.RNX_TEST_DIR)
|
|
114
114
|
: null
|
|
115
115
|
if (!testDir) {
|
|
116
116
|
for (const dir of detoxDirs) {
|
|
@@ -131,18 +131,18 @@ export async function runDetox(args: string[], opts: RunDetoxOpts = {}): Promise
|
|
|
131
131
|
|
|
132
132
|
// auto-launch: make sure a sootsim shell is reachable before running jest.
|
|
133
133
|
// Reuse the Maestro discovery path: scan local dev servers.
|
|
134
|
-
// and `
|
|
134
|
+
// and `rnx open` the first match.
|
|
135
135
|
if (!noLaunch) {
|
|
136
136
|
await ensureShellRunning(port)
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
// build the jest command. prefer the user's config if they passed --config
|
|
140
|
-
// or if a
|
|
140
|
+
// or if a rnx-detox.config.cjs exists in cwd. otherwise point at our
|
|
141
141
|
// preset directly via --preset-free inline config.
|
|
142
142
|
const jestArgs: string[] = ['jest']
|
|
143
143
|
const localConfig =
|
|
144
144
|
configFlag ||
|
|
145
|
-
firstExisting(['
|
|
145
|
+
firstExisting(['rnx-detox.config.cjs', 'jest.config.cjs', 'jest.config.js'])
|
|
146
146
|
|
|
147
147
|
let tempConfig: string | null = null
|
|
148
148
|
if (localConfig) {
|
|
@@ -154,7 +154,7 @@ export async function runDetox(args: string[], opts: RunDetoxOpts = {}): Promise
|
|
|
154
154
|
// scope roots + testMatch to the discovered test dir so jest doesn't
|
|
155
155
|
// scan the entire repo (which causes haste collisions in monorepos).
|
|
156
156
|
const presetPath = resolve(resolveDetoxDir(), 'jest-preset.cjs')
|
|
157
|
-
tempConfig = join(tmpdir(), `
|
|
157
|
+
tempConfig = join(tmpdir(), `rnx-detox-${process.pid}.config.cjs`)
|
|
158
158
|
const cfg = {
|
|
159
159
|
rootDir: testDir,
|
|
160
160
|
roots: ['<rootDir>'],
|
|
@@ -183,7 +183,7 @@ export async function runDetox(args: string[], opts: RunDetoxOpts = {}): Promise
|
|
|
183
183
|
if (process.env.SOOTSIM_JEST_OUTPUT_FILE) {
|
|
184
184
|
jestArgs.push('--outputFile', process.env.SOOTSIM_JEST_OUTPUT_FILE)
|
|
185
185
|
} else if (wantsRegistration) {
|
|
186
|
-
resultsFile = join(tmpdir(), `
|
|
186
|
+
resultsFile = join(tmpdir(), `rnx-detox-results-${process.pid}.json`)
|
|
187
187
|
jestArgs.push('--json', '--outputFile', resultsFile)
|
|
188
188
|
}
|
|
189
189
|
|
|
@@ -218,10 +218,10 @@ export async function runDetox(args: string[], opts: RunDetoxOpts = {}): Promise
|
|
|
218
218
|
stdio: 'inherit',
|
|
219
219
|
env: {
|
|
220
220
|
...process.env,
|
|
221
|
-
|
|
221
|
+
RNX_TEST_DIR: testDir,
|
|
222
222
|
SOOTSIM_PORT: String(port),
|
|
223
223
|
SOOTSIM_HEADED: headed ? '1' : '',
|
|
224
|
-
|
|
224
|
+
RNX_URL: process.env.RNX_URL || `http://localhost:${port}`,
|
|
225
225
|
},
|
|
226
226
|
})
|
|
227
227
|
|
|
@@ -355,7 +355,7 @@ async function ensureShellRunning(port: number): Promise<void> {
|
|
|
355
355
|
|
|
356
356
|
function initDetoxProject(): void {
|
|
357
357
|
const cwd = process.cwd()
|
|
358
|
-
const configPath = resolve(cwd, '
|
|
358
|
+
const configPath = resolve(cwd, 'rnx-detox.config.cjs')
|
|
359
359
|
if (existsSync(configPath)) {
|
|
360
360
|
console.log(` skip: ${configPath} already exists`)
|
|
361
361
|
} else {
|
|
@@ -385,7 +385,7 @@ module.exports = {
|
|
|
385
385
|
writeFileSync(
|
|
386
386
|
samplePath,
|
|
387
387
|
`// sample rnx detox test. resolve \`detox\` via the jest preset in
|
|
388
|
-
//
|
|
388
|
+
// rnx-detox.config.cjs — no extra imports required.
|
|
389
389
|
|
|
390
390
|
import { by, device, element, expect, waitFor } from 'detox'
|
|
391
391
|
|
package/cli/commands/diagnose.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// rnx get diagnosis — composed read commands for "what just went wrong?"
|
|
2
2
|
//
|
|
3
3
|
// the demo-friendly compact diagnostic surface called out in
|
|
4
4
|
// plans/expensify-sootsim-agent-device-demo.md. one command, one round
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
// sed/grep workflow in both speed and information density.
|
|
7
7
|
//
|
|
8
8
|
// usage:
|
|
9
|
-
//
|
|
10
|
-
//
|
|
9
|
+
// rnx get diagnosis [--since 90s] [--include react,network,console,screen,fetch,alert]
|
|
10
|
+
// rnx get diagnosis --json
|
|
11
11
|
//
|
|
12
12
|
// the output is grouped by source (timeline, network, react, console)
|
|
13
13
|
// rather than chronological. for chronological order use
|
|
14
|
-
// `
|
|
14
|
+
// `rnx what-happened` directly. `recent` is the only subcommand
|
|
15
15
|
// today; `diagnose <something-else>` may be added later (e.g. boot,
|
|
16
16
|
// scrolling-jank, idle-burn).
|
|
17
17
|
//
|
|
@@ -315,7 +315,7 @@ function formatNetworkRow(entry: NetworkEntry): string {
|
|
|
315
315
|
const dur = entry.durationMs != null ? `${entry.durationMs.toFixed(0)}ms` : '...'
|
|
316
316
|
const url = entry.displayUrl ?? entry.url
|
|
317
317
|
// shorten long urls to 96 chars in the diagnose report — full
|
|
318
|
-
// detail is one `
|
|
318
|
+
// detail is one `rnx network get <id>` away.
|
|
319
319
|
const shortUrl = url.length > 96 ? `${url.slice(0, 92)}…` : url
|
|
320
320
|
return ` ${status.padStart(3)} ${method} ${dur.padStart(7)} ${shortUrl} (${entry.id})`
|
|
321
321
|
}
|
|
@@ -575,7 +575,7 @@ export async function runDiagnose(
|
|
|
575
575
|
// a bridge call rejecting (most commonly "no sim connected") must not
|
|
576
576
|
// escape as a raw stack trace with a 0 exit code — `get diagnosis` is the
|
|
577
577
|
// "what just went wrong" command; failing it should read cleanly and
|
|
578
|
-
// exit non-zero so `
|
|
578
|
+
// exit non-zero so `rnx get diagnosis && …` chains behave.
|
|
579
579
|
const msg = err instanceof Error ? err.message : String(err)
|
|
580
580
|
if (/no sim connected/i.test(msg)) {
|
|
581
581
|
console.error(' no sim connected — open one first: rnx open <metroPort>')
|
package/cli/commands/do-chain.ts
CHANGED
|
@@ -318,8 +318,7 @@ export async function runDoChain(
|
|
|
318
318
|
const { isAgentEnv } = envModule
|
|
319
319
|
const { resolveTargetCoords } = targetModule
|
|
320
320
|
const wantsJson = args.includes('--json')
|
|
321
|
-
const skipSettle =
|
|
322
|
-
args.includes('--no-wait') || process.env.SOOTSIM_NO_AUTO_WAIT === '1'
|
|
321
|
+
const skipSettle = args.includes('--no-wait') || process.env.RNX_NO_AUTO_WAIT === '1'
|
|
323
322
|
const parsed = parseBridgeCliArgs(args, {
|
|
324
323
|
port: opts.port,
|
|
325
324
|
commandTimeoutMs: 30_000,
|
package/cli/commands/electron.ts
CHANGED
|
@@ -68,9 +68,7 @@ examples:
|
|
|
68
68
|
if (!install) {
|
|
69
69
|
printMissingCompanionHint()
|
|
70
70
|
const canPrompt =
|
|
71
|
-
process.stdin.isTTY &&
|
|
72
|
-
process.env.CI !== '1' &&
|
|
73
|
-
process.env.SOOTSIM_NO_PROMPT !== '1'
|
|
71
|
+
process.stdin.isTTY && process.env.CI !== '1' && process.env.RNX_NO_PROMPT !== '1'
|
|
74
72
|
if (canPrompt && (await confirm('run rnx desktop install now?', true))) {
|
|
75
73
|
console.log()
|
|
76
74
|
const { runInstallDesktop } = await import('./install-desktop')
|
package/cli/commands/film.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// rnx film — record a flow on the flat canvas, then re-play that
|
|
2
2
|
// recording on the 3d device stage under a camera cinematic and capture the
|
|
3
3
|
// stage as video.
|
|
4
4
|
//
|
|
@@ -82,7 +82,7 @@ how it works:
|
|
|
82
82
|
|
|
83
83
|
options:
|
|
84
84
|
--out <path> output file (.webm, or .mp4 when ffmpeg is
|
|
85
|
-
installed). default: ~/Desktop/
|
|
85
|
+
installed). default: ~/Desktop/rnx-films/<flow>.webm
|
|
86
86
|
--script <id> camera script to animate during playback
|
|
87
87
|
(default: hero-arc)
|
|
88
88
|
--fps <n> stage capture framerate (default: 30)
|
|
@@ -116,7 +116,7 @@ examples:
|
|
|
116
116
|
const flowName = flowPath.replace(/^.*\//, '').replace(/\.ya?ml$/, '')
|
|
117
117
|
const outArg = flagValue(args, '--out')
|
|
118
118
|
const outPath = resolve(
|
|
119
|
-
outArg ?? join(homedir(), 'Desktop', '
|
|
119
|
+
outArg ?? join(homedir(), 'Desktop', 'rnx-films', `${flowName}.webm`),
|
|
120
120
|
)
|
|
121
121
|
const wantsMp4 = extname(outPath).toLowerCase() === '.mp4'
|
|
122
122
|
if (wantsMp4 && spawnSync('ffmpeg', ['-version']).status !== 0) {
|