peachsim 0.1.655 → 0.1.657
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 +1 -1
- package/cli/app-config.ts +9 -6
- package/cli/app-project.ts +6 -6
- package/cli/commands/control.ts +20 -20
- package/cli/commands/flow.ts +3 -3
- package/detox/config-loader.ts +1 -1
- 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 +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/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +25 -25
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +14 -14
- 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 +2 -2
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +6 -13
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.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 +2 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- 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 +13 -15
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +144 -116
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +1 -1
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +1 -1
- package/dist-lib/vite.cjs +6 -13
- package/package.json +1 -1
- package/scripts/dev-server-scanner.ts +3 -3
- package/scripts/optional-demo-registry.ts +1 -1
- package/src/config.ts +26 -26
- package/src/dev-server-open.ts +4 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.657 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.657 | (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.657 | (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/swift.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.657 | (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/vite-swift.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.657 | (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;
|
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.657 | (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;
|
|
@@ -54,7 +54,6 @@ var import_node_child_process = require("node:child_process");
|
|
|
54
54
|
var import_node_crypto = require("node:crypto");
|
|
55
55
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
56
56
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
57
|
-
var import_node_url = require("node:url");
|
|
58
57
|
function resolveRnxDesktopAppName(open, projectRoot) {
|
|
59
58
|
if (!open) return null;
|
|
60
59
|
if (typeof open === "object") {
|
|
@@ -112,17 +111,11 @@ function observeRnxDesktopLaunch(child, appName) {
|
|
|
112
111
|
});
|
|
113
112
|
}
|
|
114
113
|
function launchRnxDesktop(bundleUrl, appName) {
|
|
115
|
-
const packageRoot = import_node_path.default.resolve(import_node_path.default.dirname((0, import_node_url.fileURLToPath)(__sootsim_import_meta_url)), "..");
|
|
116
|
-
const binPath = import_node_path.default.join(packageRoot, "dist-cli", "bin.js");
|
|
117
114
|
console.log(`[peach] opening ${appName} in the desktop simulator`);
|
|
118
|
-
const child = (0, import_node_child_process.spawn)(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
stdio: ["ignore", "ignore", "pipe"],
|
|
123
|
-
windowsHide: true
|
|
124
|
-
}
|
|
125
|
-
);
|
|
115
|
+
const child = (0, import_node_child_process.spawn)("peach", buildRnxDesktopOpenArgs(bundleUrl), {
|
|
116
|
+
stdio: ["ignore", "ignore", "pipe"],
|
|
117
|
+
windowsHide: true
|
|
118
|
+
});
|
|
126
119
|
observeRnxDesktopLaunch(child, appName);
|
|
127
120
|
}
|
|
128
121
|
|
|
@@ -325,7 +318,7 @@ function isContrastKitSpecifier(specifier) {
|
|
|
325
318
|
}
|
|
326
319
|
function unsupportedSpecifier(specifier) {
|
|
327
320
|
return new Error(
|
|
328
|
-
`replacement modules may only import react, react-native, contrast-kit, and the packages rnx stubs for this app; '${specifier}' is none of those. vendor the code into the replacement file, or add the package to
|
|
321
|
+
`replacement modules may only import react, react-native, contrast-kit, and the packages rnx stubs for this app; '${specifier}' is none of those. vendor the code into the replacement file, or add the package to peach.config so the simulator bridges it.`
|
|
329
322
|
);
|
|
330
323
|
}
|
|
331
324
|
function bridgeDeclaration(name, specifier) {
|
package/package.json
CHANGED
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
// pid changes. before any HTTP, a TCP connect gate skips unreachable ports.
|
|
15
15
|
|
|
16
16
|
import { spawn } from 'child_process'
|
|
17
|
-
import { terminateProcessGroup } from '../../contrast/src/runtime/process-group'
|
|
18
17
|
import { readlink } from 'fs/promises'
|
|
19
18
|
import http from 'http'
|
|
20
19
|
import net from 'net'
|
|
21
20
|
import { realpathSync } from 'node:fs'
|
|
22
21
|
import { resolve } from 'node:path'
|
|
22
|
+
import { terminateProcessGroup } from '../../contrast/src/runtime/process-group'
|
|
23
23
|
import {
|
|
24
24
|
buildLoopbackProbeBaseUrl,
|
|
25
25
|
isLoopbackHost,
|
|
26
26
|
LOOPBACK_PROBE_HOSTNAMES,
|
|
27
27
|
normalizeHostname,
|
|
28
28
|
} from '../src/backend-origin.ts'
|
|
29
|
-
import {
|
|
29
|
+
import { applyPeachConfigToUrl } from '../src/config.ts'
|
|
30
30
|
import {
|
|
31
31
|
alignLoopbackBundleUrlWithProbe,
|
|
32
32
|
normalizeNativeDevBundleUrl,
|
|
@@ -611,7 +611,7 @@ function withRuntimeConfig(port: number, bundleUrl: string, projectCwd?: string)
|
|
|
611
611
|
? knownApps[0]
|
|
612
612
|
: undefined
|
|
613
613
|
const configured = knownApp?.runtimeConfig
|
|
614
|
-
?
|
|
614
|
+
? applyPeachConfigToUrl(bundleUrl, knownApp.runtimeConfig)
|
|
615
615
|
: bundleUrl
|
|
616
616
|
return normalizeNativeDevBundleUrl(configured)
|
|
617
617
|
}
|
|
@@ -63,7 +63,7 @@ export interface OptionalDemoApp {
|
|
|
63
63
|
dir: string
|
|
64
64
|
preferredPort: number
|
|
65
65
|
framework: 'expo' | 'one' | 'rock'
|
|
66
|
-
runtimeConfig?: import('../src/config.ts').
|
|
66
|
+
runtimeConfig?: import('../src/config.ts').PeachConfig
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
let cached: OptionalDemoApp[] | null = null
|
package/src/config.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// peach.config.ts — per-app module resolution, turbo modules, env, state, and settings.
|
|
2
2
|
//
|
|
3
3
|
// usage:
|
|
4
4
|
// import { defineConfig } from 'peachsim/config'
|
|
@@ -17,7 +17,7 @@ export type ModuleResolution =
|
|
|
17
17
|
|
|
18
18
|
export type NativeModuleResolution = ModuleResolution | Record<string, any> // direct native module object for non-url configs
|
|
19
19
|
|
|
20
|
-
export interface
|
|
20
|
+
export interface PeachConfig<Settings extends Record<string, any> = Record<string, any>> {
|
|
21
21
|
// host-only engine selection. omitted means the current stable runtime.
|
|
22
22
|
runtimeVersion?: string
|
|
23
23
|
modules?: Record<string, ModuleResolution>
|
|
@@ -46,11 +46,11 @@ export interface RNXConfig<Settings extends Record<string, any> = Record<string,
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export const
|
|
49
|
+
export const PEACH_CONFIG_QUERY_PARAM = 'peachConfig'
|
|
50
50
|
|
|
51
51
|
export function defineConfig<Settings extends Record<string, any> = Record<string, any>>(
|
|
52
|
-
config:
|
|
53
|
-
):
|
|
52
|
+
config: PeachConfig<Settings>,
|
|
53
|
+
): PeachConfig<Settings> {
|
|
54
54
|
return config
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -58,9 +58,9 @@ function hasOwnKeys(value: Record<string, unknown> | undefined): boolean {
|
|
|
58
58
|
return !!value && Object.keys(value).length > 0
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export function
|
|
62
|
-
|
|
63
|
-
): config is
|
|
61
|
+
export function hasPeachConfig<
|
|
62
|
+
Settings extends Record<string, any> = Record<string, any>,
|
|
63
|
+
>(config?: PeachConfig<Settings> | null): config is PeachConfig<Settings> {
|
|
64
64
|
if (!config) return false
|
|
65
65
|
return (
|
|
66
66
|
(typeof config.runtimeVersion === 'string' && config.runtimeVersion.length > 0) ||
|
|
@@ -74,15 +74,15 @@ export function hasRNXConfig<Settings extends Record<string, any> = Record<strin
|
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
export function
|
|
77
|
+
export function mergePeachConfig<
|
|
78
78
|
Settings extends Record<string, any> = Record<string, any>,
|
|
79
79
|
>(
|
|
80
|
-
base?:
|
|
81
|
-
override?:
|
|
82
|
-
):
|
|
83
|
-
if (!
|
|
84
|
-
if (!
|
|
85
|
-
if (!
|
|
80
|
+
base?: PeachConfig<Settings> | null,
|
|
81
|
+
override?: PeachConfig<Settings> | null,
|
|
82
|
+
): PeachConfig<Settings> | undefined {
|
|
83
|
+
if (!hasPeachConfig(base) && !hasPeachConfig(override)) return undefined
|
|
84
|
+
if (!hasPeachConfig(base)) return override ? { ...override } : undefined
|
|
85
|
+
if (!hasPeachConfig(override)) return base ? { ...base } : undefined
|
|
86
86
|
|
|
87
87
|
return {
|
|
88
88
|
runtimeVersion: override.runtimeVersion ?? base.runtimeVersion,
|
|
@@ -104,29 +104,29 @@ export function mergeRNXConfig<
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
export function
|
|
107
|
+
export function readPeachConfigFromSearchParams<
|
|
108
108
|
Settings extends Record<string, any> = Record<string, any>,
|
|
109
|
-
>(searchParams: URLSearchParams):
|
|
110
|
-
const raw = searchParams.get(
|
|
109
|
+
>(searchParams: URLSearchParams): PeachConfig<Settings> | undefined {
|
|
110
|
+
const raw = searchParams.get(PEACH_CONFIG_QUERY_PARAM)
|
|
111
111
|
if (!raw) return undefined
|
|
112
112
|
try {
|
|
113
|
-
const parsed = JSON.parse(raw) as
|
|
114
|
-
return
|
|
113
|
+
const parsed = JSON.parse(raw) as PeachConfig<Settings>
|
|
114
|
+
return hasPeachConfig(parsed) ? parsed : undefined
|
|
115
115
|
} catch (error) {
|
|
116
116
|
const message = error instanceof Error ? error.message : String(error)
|
|
117
|
-
console.warn(`[peach] invalid ${
|
|
117
|
+
console.warn(`[peach] invalid ${PEACH_CONFIG_QUERY_PARAM}: ${message}`)
|
|
118
118
|
return undefined
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
export function
|
|
122
|
+
export function applyPeachConfigToUrl<
|
|
123
123
|
Settings extends Record<string, any> = Record<string, any>,
|
|
124
|
-
>(url: string, config?:
|
|
124
|
+
>(url: string, config?: PeachConfig<Settings> | null): string {
|
|
125
125
|
const parsed = new URL(url)
|
|
126
|
-
if (
|
|
127
|
-
parsed.searchParams.set(
|
|
126
|
+
if (hasPeachConfig(config)) {
|
|
127
|
+
parsed.searchParams.set(PEACH_CONFIG_QUERY_PARAM, JSON.stringify(config))
|
|
128
128
|
} else {
|
|
129
|
-
parsed.searchParams.delete(
|
|
129
|
+
parsed.searchParams.delete(PEACH_CONFIG_QUERY_PARAM)
|
|
130
130
|
}
|
|
131
131
|
return parsed.toString()
|
|
132
132
|
}
|
package/src/dev-server-open.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { spawn, type ChildProcess } from 'node:child_process'
|
|
|
2
2
|
import { createHash } from 'node:crypto'
|
|
3
3
|
import fs from 'node:fs'
|
|
4
4
|
import path from 'node:path'
|
|
5
|
-
import { fileURLToPath } from 'node:url'
|
|
6
5
|
|
|
7
6
|
export type RnxDesktopOpenOption = boolean | { appName: string }
|
|
8
7
|
|
|
@@ -84,16 +83,10 @@ export function observeRnxDesktopLaunch(child: ChildProcess, appName: string): v
|
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
export function launchRnxDesktop(bundleUrl: string, appName: string): void {
|
|
87
|
-
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
|
88
|
-
const binPath = path.join(packageRoot, 'dist-cli', 'bin.js')
|
|
89
86
|
console.log(`[peach] opening ${appName} in the desktop simulator`)
|
|
90
|
-
const child = spawn(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
stdio: ['ignore', 'ignore', 'pipe'],
|
|
95
|
-
windowsHide: true,
|
|
96
|
-
},
|
|
97
|
-
)
|
|
87
|
+
const child = spawn('peach', buildRnxDesktopOpenArgs(bundleUrl), {
|
|
88
|
+
stdio: ['ignore', 'ignore', 'pipe'],
|
|
89
|
+
windowsHide: true,
|
|
90
|
+
})
|
|
98
91
|
observeRnxDesktopLaunch(child, appName)
|
|
99
92
|
}
|