peachsim 0.1.755 → 0.1.756
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/cli/app-config.ts +4 -29
- 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 +88 -1
- 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 +47 -36
- 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 +13 -5
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +2551 -2220
- 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 +914 -584
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.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 +4 -4
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +94 -69
- 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-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +1 -1
- package/dist-lib/vite.cjs +10 -4
- package/package.json +1 -1
- package/src/config.ts +92 -0
- package/src/configured-bundle-producer.ts +110 -0
- package/src/host/replacement-module-handler.ts +8 -2
- package/src/metro-plugin.ts +27 -0
package/cli/app-config.ts
CHANGED
|
@@ -1,40 +1,12 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'
|
|
2
2
|
import path from 'node:path'
|
|
3
|
-
import { isValidRuntimeVersion } from '@contrast/runtime-delivery'
|
|
4
3
|
import { createJiti } from 'jiti'
|
|
4
|
+
import { isPeachConfig, type PeachConfig } from '../src/config'
|
|
5
5
|
import { rnxPublicBrand } from '../src/public-brand'
|
|
6
6
|
import { resolveAppProject, type ResolvedAppProject } from './app-project'
|
|
7
|
-
import type { PeachConfig } from '../src/config'
|
|
8
7
|
|
|
9
8
|
const require = createRequire(import.meta.url)
|
|
10
9
|
|
|
11
|
-
function isOptionalRecord(value: unknown): boolean {
|
|
12
|
-
return (
|
|
13
|
-
value === undefined ||
|
|
14
|
-
(value !== null && typeof value === 'object' && !Array.isArray(value))
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function isPeachConfig(value: unknown): value is PeachConfig {
|
|
19
|
-
if (!value || typeof value !== 'object' || Array.isArray(value)) return false
|
|
20
|
-
const runtimeVersion = Reflect.get(value, 'runtimeVersion')
|
|
21
|
-
const network = Reflect.get(value, 'network')
|
|
22
|
-
return (
|
|
23
|
-
(runtimeVersion === undefined ||
|
|
24
|
-
(typeof runtimeVersion === 'string' &&
|
|
25
|
-
runtimeVersion === runtimeVersion.trim() &&
|
|
26
|
-
isValidRuntimeVersion(runtimeVersion))) &&
|
|
27
|
-
isOptionalRecord(Reflect.get(value, 'modules')) &&
|
|
28
|
-
isOptionalRecord(Reflect.get(value, 'turboModules')) &&
|
|
29
|
-
isOptionalRecord(Reflect.get(value, 'nativeModules')) &&
|
|
30
|
-
isOptionalRecord(Reflect.get(value, 'nativeViews')) &&
|
|
31
|
-
isOptionalRecord(Reflect.get(value, 'env')) &&
|
|
32
|
-
isOptionalRecord(network) &&
|
|
33
|
-
isOptionalRecord(Reflect.get(value, 'settings')) &&
|
|
34
|
-
isOptionalRecord(Reflect.get(value, 'initialState'))
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
10
|
// `{ file }` entries are relative to the config file; the engine loads them by
|
|
39
11
|
// absolute path from the runtime's replacement-module endpoint.
|
|
40
12
|
function resolveFileEntries<T>(
|
|
@@ -76,6 +48,9 @@ export async function loadRNXAppConfig(
|
|
|
76
48
|
try {
|
|
77
49
|
const jiti = createJiti(import.meta.url, {
|
|
78
50
|
interopDefault: true,
|
|
51
|
+
// metro serializes repeatedly in one process; edits must reload the config.
|
|
52
|
+
moduleCache: false,
|
|
53
|
+
tryNative: false,
|
|
79
54
|
alias: {
|
|
80
55
|
[`${rnxPublicBrand.packageName}/config`]: require.resolve(
|
|
81
56
|
`${rnxPublicBrand.packageName}/config`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.756 | (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.756 | (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.756 | (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.756 | (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.756 | (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.756 | (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.756 | (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.756 | (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.756 | (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.756 | (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.756 | (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.756 | (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.756 | (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.756 | (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.756 | (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/cloud.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.756 | (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/cloud.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.756 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
package/dist-lib/config.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.756 | (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,15 +22,95 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
// src/config.ts
|
|
23
23
|
var config_exports = {};
|
|
24
24
|
__export(config_exports, {
|
|
25
|
+
PEACH_CONFIGURED_FILES_HOOK: () => PEACH_CONFIGURED_FILES_HOOK,
|
|
25
26
|
PEACH_CONFIG_QUERY_PARAM: () => PEACH_CONFIG_QUERY_PARAM,
|
|
26
27
|
applyPeachConfigToUrl: () => applyPeachConfigToUrl,
|
|
28
|
+
collectConfiguredFileModules: () => collectConfiguredFileModules,
|
|
29
|
+
createPeachBundleConfigFooter: () => createPeachBundleConfigFooter,
|
|
27
30
|
defineConfig: () => defineConfig,
|
|
31
|
+
detachPeachBundleConfigFooter: () => detachPeachBundleConfigFooter,
|
|
28
32
|
hasPeachConfig: () => hasPeachConfig,
|
|
33
|
+
isPeachConfig: () => isPeachConfig,
|
|
29
34
|
mergePeachConfig: () => mergePeachConfig,
|
|
35
|
+
readPeachBundleConfig: () => readPeachBundleConfig,
|
|
36
|
+
readPeachBundleConfigFooter: () => readPeachBundleConfigFooter,
|
|
30
37
|
readPeachConfigFromSearchParams: () => readPeachConfigFromSearchParams
|
|
31
38
|
});
|
|
32
39
|
module.exports = __toCommonJS(config_exports);
|
|
40
|
+
|
|
41
|
+
// ../contrast-runtime-delivery/src/version.ts
|
|
42
|
+
function isValidRuntimeVersion(value) {
|
|
43
|
+
return value.length <= 100 && /^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(value);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// src/is-record.ts
|
|
47
|
+
function isRecord(value) {
|
|
48
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/config.ts
|
|
33
52
|
var PEACH_CONFIG_QUERY_PARAM = "peachConfig";
|
|
53
|
+
function collectConfiguredFileModules(config) {
|
|
54
|
+
return [
|
|
55
|
+
...new Set(
|
|
56
|
+
["modules", "turboModules", "nativeModules", "nativeViews"].flatMap((key) => {
|
|
57
|
+
const entries = config && Reflect.get(config, key);
|
|
58
|
+
if (!isRecord(entries)) return [];
|
|
59
|
+
return Object.values(entries).flatMap(
|
|
60
|
+
(entry) => isRecord(entry) && typeof entry.file === "string" ? [entry.file] : []
|
|
61
|
+
);
|
|
62
|
+
})
|
|
63
|
+
)
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
function isPeachConfig(value) {
|
|
67
|
+
if (!isRecord(value)) return false;
|
|
68
|
+
return (value.runtimeVersion === void 0 || typeof value.runtimeVersion === "string" && value.runtimeVersion === value.runtimeVersion.trim() && isValidRuntimeVersion(value.runtimeVersion)) && [
|
|
69
|
+
"modules",
|
|
70
|
+
"turboModules",
|
|
71
|
+
"nativeModules",
|
|
72
|
+
"nativeViews",
|
|
73
|
+
"env",
|
|
74
|
+
"network",
|
|
75
|
+
"settings",
|
|
76
|
+
"initialState"
|
|
77
|
+
].every((key) => value[key] === void 0 || isRecord(value[key]));
|
|
78
|
+
}
|
|
79
|
+
var BUNDLE_CONFIG_PREFIX = "globalThis.__peachBundleConfig=";
|
|
80
|
+
var PEACH_CONFIGURED_FILES_HOOK = "__peachInstallConfiguredFiles";
|
|
81
|
+
function readPeachBundleConfig(value) {
|
|
82
|
+
if (value === void 0 || value === null) return null;
|
|
83
|
+
if (!isRecord(value) || !isPeachConfig(value.config) || !Array.isArray(value.runtimePackages) || !value.runtimePackages.every((name) => typeof name === "string")) {
|
|
84
|
+
throw new Error("configured bundle metadata is malformed");
|
|
85
|
+
}
|
|
86
|
+
return { config: value.config, runtimePackages: [...value.runtimePackages] };
|
|
87
|
+
}
|
|
88
|
+
function readPeachBundleConfigFooter(source) {
|
|
89
|
+
const start = source.lastIndexOf("\n" + BUNDLE_CONFIG_PREFIX);
|
|
90
|
+
if (start < 0) return null;
|
|
91
|
+
const end = source.indexOf("\n", start + 1);
|
|
92
|
+
const line = source.slice(start + 1, end < 0 ? void 0 : end);
|
|
93
|
+
if (!line.endsWith(";")) throw new Error("configured bundle footer is truncated");
|
|
94
|
+
const result = readPeachBundleConfig(
|
|
95
|
+
JSON.parse(line.slice(BUNDLE_CONFIG_PREFIX.length, -1))
|
|
96
|
+
);
|
|
97
|
+
if (!result) throw new Error("configured bundle footer is empty");
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
function createPeachBundleConfigFooter(config) {
|
|
101
|
+
const json = JSON.stringify(config).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/<\//g, "<\\/");
|
|
102
|
+
return "\n" + BUNDLE_CONFIG_PREFIX + json + ";";
|
|
103
|
+
}
|
|
104
|
+
function detachPeachBundleConfigFooter(source) {
|
|
105
|
+
const configuredBundle = readPeachBundleConfigFooter(source);
|
|
106
|
+
if (!configuredBundle) return { source, configuredBundle };
|
|
107
|
+
const start = source.lastIndexOf("\n" + BUNDLE_CONFIG_PREFIX);
|
|
108
|
+
const end = source.indexOf("\n", start + 1);
|
|
109
|
+
return {
|
|
110
|
+
source: source.slice(0, start) + source.slice(end < 0 ? source.length : end),
|
|
111
|
+
configuredBundle
|
|
112
|
+
};
|
|
113
|
+
}
|
|
34
114
|
function defineConfig(config) {
|
|
35
115
|
return config;
|
|
36
116
|
}
|
|
@@ -88,10 +168,17 @@ function applyPeachConfigToUrl(url, config) {
|
|
|
88
168
|
}
|
|
89
169
|
// Annotate the CommonJS export names for ESM import in node:
|
|
90
170
|
0 && (module.exports = {
|
|
171
|
+
PEACH_CONFIGURED_FILES_HOOK,
|
|
91
172
|
PEACH_CONFIG_QUERY_PARAM,
|
|
92
173
|
applyPeachConfigToUrl,
|
|
174
|
+
collectConfiguredFileModules,
|
|
175
|
+
createPeachBundleConfigFooter,
|
|
93
176
|
defineConfig,
|
|
177
|
+
detachPeachBundleConfigFooter,
|
|
94
178
|
hasPeachConfig,
|
|
179
|
+
isPeachConfig,
|
|
95
180
|
mergePeachConfig,
|
|
181
|
+
readPeachBundleConfig,
|
|
182
|
+
readPeachBundleConfigFooter,
|
|
96
183
|
readPeachConfigFromSearchParams
|
|
97
184
|
});
|
package/dist-lib/detox/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.756 | (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.756 | (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/home-paths.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.756 | (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.756 | (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;
|
|
@@ -77,6 +77,16 @@ var init_backend_origin = __esm({
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
+
// src/is-record.ts
|
|
81
|
+
function isRecord(value) {
|
|
82
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
83
|
+
}
|
|
84
|
+
var init_is_record = __esm({
|
|
85
|
+
"src/is-record.ts"() {
|
|
86
|
+
"use strict";
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
80
90
|
// ../../node_modules/plist/lib/parse.js
|
|
81
91
|
var require_parse = __commonJS({
|
|
82
92
|
"../../node_modules/plist/lib/parse.js"(exports2) {
|
|
@@ -753,16 +763,6 @@ var init_public_brand = __esm({
|
|
|
753
763
|
}
|
|
754
764
|
});
|
|
755
765
|
|
|
756
|
-
// src/is-record.ts
|
|
757
|
-
function isRecord2(value) {
|
|
758
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
759
|
-
}
|
|
760
|
-
var init_is_record = __esm({
|
|
761
|
-
"src/is-record.ts"() {
|
|
762
|
-
"use strict";
|
|
763
|
-
}
|
|
764
|
-
});
|
|
765
|
-
|
|
766
766
|
// src/auth/shared-session.ts
|
|
767
767
|
function sharedDesktopAuthAccounts(user) {
|
|
768
768
|
return [
|
|
@@ -3032,7 +3032,8 @@ async function readOrInferModuleIdentity(bundle, mode, inferModuleIdentity) {
|
|
|
3032
3032
|
}
|
|
3033
3033
|
async function buildRnxCloudArtifact(bundle, options = {}) {
|
|
3034
3034
|
const mode = options.mode ?? "production";
|
|
3035
|
-
const
|
|
3035
|
+
const configured = (0, import_config2.detachPeachBundleConfigFooter)(bundle);
|
|
3036
|
+
const firebase = (0, import_native_firebase_metadata.detachNativeFirebaseFooter)(configured.source);
|
|
3036
3037
|
const nativeIdentity = (0, import_native_app_identity.detachNativeAppIdentityFooter)(firebase.source);
|
|
3037
3038
|
const identity = await readOrInferModuleIdentity(
|
|
3038
3039
|
nativeIdentity.source,
|
|
@@ -3061,7 +3062,7 @@ async function buildRnxCloudArtifact(bundle, options = {}) {
|
|
|
3061
3062
|
})
|
|
3062
3063
|
]);
|
|
3063
3064
|
const body = pieces.map((piece) => piece.code).join("\n");
|
|
3064
|
-
const code = body + (nativeIdentity.identity ? (0, import_native_app_identity.createNativeAppIdentityFooter)(nativeIdentity.identity) : "") + (firebase.config ? (0, import_native_firebase_metadata.createNativeFirebaseFooter)(firebase.config) : "") + (0, import_metro_production_bundle.createRNXMetroModuleIdentityFooter)({
|
|
3065
|
+
const code = body + (nativeIdentity.identity ? (0, import_native_app_identity.createNativeAppIdentityFooter)(nativeIdentity.identity) : "") + (firebase.config ? (0, import_native_firebase_metadata.createNativeFirebaseFooter)(firebase.config) : "") + (configured.configuredBundle ? (0, import_config2.createPeachBundleConfigFooter)(configured.configuredBundle) : "") + (0, import_metro_production_bundle.createRNXMetroModuleIdentityFooter)({
|
|
3065
3066
|
version: identity.version,
|
|
3066
3067
|
identitySource: identity.identitySource,
|
|
3067
3068
|
modulePaths: identity.modulePaths,
|
|
@@ -3124,10 +3125,11 @@ async function buildRnxCloudArtifact(bundle, options = {}) {
|
|
|
3124
3125
|
}
|
|
3125
3126
|
};
|
|
3126
3127
|
}
|
|
3127
|
-
var import_metro_production_bundle, import_native_app_identity, import_native_firebase_metadata, import_terser, MODULE_PATHS_REQUIRED, SOURCE_MAP_REQUIRED, MINIFY_OPTIONS;
|
|
3128
|
+
var import_config2, import_metro_production_bundle, import_native_app_identity, import_native_firebase_metadata, import_terser, MODULE_PATHS_REQUIRED, SOURCE_MAP_REQUIRED, MINIFY_OPTIONS;
|
|
3128
3129
|
var init_metroCloudArtifact = __esm({
|
|
3129
3130
|
"../contrast-bundler/src/metroCloudArtifact.ts"() {
|
|
3130
3131
|
"use strict";
|
|
3132
|
+
import_config2 = require("peachsim/config");
|
|
3131
3133
|
import_metro_production_bundle = require("peachsim/metro-production-bundle");
|
|
3132
3134
|
import_native_app_identity = require("peachsim/native-app-identity");
|
|
3133
3135
|
import_native_firebase_metadata = require("peachsim/native-firebase-metadata");
|
|
@@ -4346,8 +4348,8 @@ function failureSentence(text) {
|
|
|
4346
4348
|
} catch {
|
|
4347
4349
|
return null;
|
|
4348
4350
|
}
|
|
4349
|
-
if (!
|
|
4350
|
-
if (
|
|
4351
|
+
if (!isRecord(parsed)) return null;
|
|
4352
|
+
if (isRecord(parsed.error) && typeof parsed.error.message === "string") {
|
|
4351
4353
|
const code = typeof parsed.error.code === "string" && parsed.error.code ? ` [${parsed.error.code}]` : "";
|
|
4352
4354
|
return `${parsed.error.message}${code}`;
|
|
4353
4355
|
}
|
|
@@ -4792,16 +4794,16 @@ async function produceArtifact(bundlePath, maxBytes, command, assetPolicy) {
|
|
|
4792
4794
|
};
|
|
4793
4795
|
}
|
|
4794
4796
|
function readCreateResponse(value, expectedBytes, expectedSha256) {
|
|
4795
|
-
if (!
|
|
4797
|
+
if (!isRecord(value)) throw new Error("remote simulator create returned invalid JSON");
|
|
4796
4798
|
const artifactId = `sha256:${expectedSha256}`;
|
|
4797
|
-
const isExpectedArtifact = (artifact) =>
|
|
4799
|
+
const isExpectedArtifact = (artifact) => isRecord(artifact) && artifact.id === artifactId && typeof artifact.bytes === "number" && Number.isInteger(artifact.bytes) && artifact.bytes === expectedBytes;
|
|
4798
4800
|
const boxId = value.boxId;
|
|
4799
4801
|
const boxToken = value.token;
|
|
4800
4802
|
const simulator = value.simulator;
|
|
4801
|
-
const simId =
|
|
4802
|
-
const claim =
|
|
4803
|
-
const simulatorToken =
|
|
4804
|
-
if (typeof boxId !== "string" || !boxId || value.size !== "nano" || typeof boxToken !== "string" || !boxToken || !isExpectedArtifact(value.artifact) || !
|
|
4803
|
+
const simId = isRecord(simulator) ? simulator.simId : null;
|
|
4804
|
+
const claim = isRecord(simulator) ? simulator.claim : null;
|
|
4805
|
+
const simulatorToken = isRecord(simulator) ? simulator.token : null;
|
|
4806
|
+
if (typeof boxId !== "string" || !boxId || value.size !== "nano" || typeof boxToken !== "string" || !boxToken || !isExpectedArtifact(value.artifact) || !isRecord(simulator) || typeof simId !== "string" || !simId || !isExpectedArtifact(simulator.artifact) || !isRecord(claim) || typeof claim.id !== "string" || !claim.id || typeof claim.expiresAt !== "number" || typeof simulatorToken !== "string" || !simulatorToken) {
|
|
4805
4807
|
throw new Error("remote simulator create returned an invalid receipt");
|
|
4806
4808
|
}
|
|
4807
4809
|
return {
|
|
@@ -4947,8 +4949,8 @@ async function sendToBox(options) {
|
|
|
4947
4949
|
simId: options.simId,
|
|
4948
4950
|
code: '(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'
|
|
4949
4951
|
});
|
|
4950
|
-
const bundleUrl =
|
|
4951
|
-
if (!
|
|
4952
|
+
const bundleUrl = isRecord(captured) ? captured.bundleUrl : null;
|
|
4953
|
+
if (!isRecord(captured) || typeof bundleUrl !== "string" || !bundleUrl) {
|
|
4952
4954
|
throw new Error(
|
|
4953
4955
|
"send to box needs a simulator running an app: this one has no bundle loaded"
|
|
4954
4956
|
);
|
|
@@ -4964,7 +4966,7 @@ async function sendToBox(options) {
|
|
|
4964
4966
|
const storage = dumped;
|
|
4965
4967
|
const created = await createCloudBox({
|
|
4966
4968
|
bundlePath: toRNXProductionBundleUrl(bundleUrl),
|
|
4967
|
-
device: options.device ?? cloudDevice(
|
|
4969
|
+
device: options.device ?? cloudDevice(isRecord(captured.deviceSpec) ? captured.deviceSpec.model : null),
|
|
4968
4970
|
authorization: options.authorization,
|
|
4969
4971
|
accountId: options.accountId,
|
|
4970
4972
|
apiOrigin: options.apiOrigin,
|
|
@@ -5172,7 +5174,13 @@ async function terminateProcessGroup(child, signal = "SIGTERM", gracefulTimeoutM
|
|
|
5172
5174
|
// scripts/dev-server-scanner.ts
|
|
5173
5175
|
init_backend_origin();
|
|
5174
5176
|
|
|
5177
|
+
// ../contrast-runtime-delivery/src/version.ts
|
|
5178
|
+
function isValidRuntimeVersion(value) {
|
|
5179
|
+
return value.length <= 100 && /^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(value);
|
|
5180
|
+
}
|
|
5181
|
+
|
|
5175
5182
|
// src/config.ts
|
|
5183
|
+
init_is_record();
|
|
5176
5184
|
var PEACH_CONFIG_QUERY_PARAM = "peachConfig";
|
|
5177
5185
|
function hasOwnKeys(value) {
|
|
5178
5186
|
return !!value && Object.keys(value).length > 0;
|
|
@@ -5252,7 +5260,7 @@ var MAX_CHILD_DEPTH = 8;
|
|
|
5252
5260
|
var MAX_PLIST_FILES = 32;
|
|
5253
5261
|
var MAX_SPECIFIERS = 512;
|
|
5254
5262
|
var settingsBundleCache = /* @__PURE__ */ new Map();
|
|
5255
|
-
function
|
|
5263
|
+
function isRecord2(value) {
|
|
5256
5264
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5257
5265
|
}
|
|
5258
5266
|
function optionalString(value) {
|
|
@@ -5381,7 +5389,7 @@ async function parsePlistRecord(path20) {
|
|
|
5381
5389
|
if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
|
|
5382
5390
|
const source = await (0, import_promises.readFile)(path20, "utf8");
|
|
5383
5391
|
const parsed = parsePlistSource(source);
|
|
5384
|
-
return
|
|
5392
|
+
return isRecord2(parsed) ? parsed : null;
|
|
5385
5393
|
} catch {
|
|
5386
5394
|
return null;
|
|
5387
5395
|
}
|
|
@@ -5417,7 +5425,7 @@ function normalizeMultiValue(raw2, key, title) {
|
|
|
5417
5425
|
};
|
|
5418
5426
|
}
|
|
5419
5427
|
async function normalizeSpecifier(raw2, context) {
|
|
5420
|
-
if (!
|
|
5428
|
+
if (!isRecord2(raw2)) return null;
|
|
5421
5429
|
if (context.budget.specifiers >= MAX_SPECIFIERS) return null;
|
|
5422
5430
|
const type = requiredString(raw2.Type);
|
|
5423
5431
|
if (!type) return null;
|
|
@@ -6365,7 +6373,7 @@ function swiftDistributionHost(platform, arch) {
|
|
|
6365
6373
|
}
|
|
6366
6374
|
var isStrings = (value) => Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
6367
6375
|
function parseSwiftDistributionManifest(value) {
|
|
6368
|
-
if (!
|
|
6376
|
+
if (!isRecord(value) || typeof value.id !== "string" || typeof value.release !== "string" || typeof value.wasmSdkId !== "string" || typeof value.wasmSdkUrl !== "string" || typeof value.wasmSdkChecksum !== "string" || !isStrings(value.modules) || !isStrings(value.objects) || !isStrings(value.link) || !isRecord(value.files) || !Object.values(value.files).every((sha) => typeof sha === "string") || typeof value.host !== "string" || !isStrings(value.plugins)) {
|
|
6369
6377
|
throw new Error(`invalid Swift distribution ${SWIFT_DISTRIBUTION_MANIFEST}`);
|
|
6370
6378
|
}
|
|
6371
6379
|
const host2 = SWIFT_DISTRIBUTION_HOSTS.find((candidate) => candidate === value.host);
|
|
@@ -6387,13 +6395,13 @@ function parseSwiftDistributionManifest(value) {
|
|
|
6387
6395
|
};
|
|
6388
6396
|
}
|
|
6389
6397
|
function parseSwiftDistributionLock(value) {
|
|
6390
|
-
if (!
|
|
6398
|
+
if (!isRecord(value) || typeof value.id !== "string" || !/^[a-f0-9]{16}$/.test(value.id) || typeof value.release !== "string" || typeof value.wasmSdkId !== "string" || typeof value.wasmSdkUrl !== "string" || typeof value.wasmSdkChecksum !== "string" || typeof value.source !== "string" || !isRecord(value.hosts)) {
|
|
6391
6399
|
throw new Error("invalid Swift distribution lock");
|
|
6392
6400
|
}
|
|
6393
6401
|
const hosts = value.hosts;
|
|
6394
6402
|
const entry = (host2) => {
|
|
6395
6403
|
const item = hosts[host2];
|
|
6396
|
-
if (!
|
|
6404
|
+
if (!isRecord(item) || typeof item.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(item.sha256) || typeof item.size !== "number") {
|
|
6397
6405
|
throw new Error(`invalid Swift distribution lock entry for ${host2}`);
|
|
6398
6406
|
}
|
|
6399
6407
|
return { sha256: item.sha256, size: item.size };
|
|
@@ -8037,9 +8045,6 @@ var import_promises3 = require("node:stream/promises");
|
|
|
8037
8045
|
// ../contrast-runtime-delivery/src/product.ts
|
|
8038
8046
|
var import_node_fs8 = __toESM(require("node:fs"), 1);
|
|
8039
8047
|
var import_node_path8 = __toESM(require("node:path"), 1);
|
|
8040
|
-
function isValidRuntimeVersion(value) {
|
|
8041
|
-
return value.length <= 100 && /^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(value);
|
|
8042
|
-
}
|
|
8043
8048
|
function listInstalledRuntimes(product) {
|
|
8044
8049
|
try {
|
|
8045
8050
|
return import_node_fs8.default.readdirSync(product.runtimesDir(), { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort(compareSemver);
|
|
@@ -13576,6 +13581,7 @@ function compileReplacementModule(input) {
|
|
|
13576
13581
|
return code.slice(token.start + 1, token.end - 1);
|
|
13577
13582
|
};
|
|
13578
13583
|
const bridgeNames = /* @__PURE__ */ new Map();
|
|
13584
|
+
const bareSpecifiers = /* @__PURE__ */ new Set();
|
|
13579
13585
|
const declarations = [];
|
|
13580
13586
|
let needsDefaultInterop = false;
|
|
13581
13587
|
const bridgeFor = (specifier) => {
|
|
@@ -13676,6 +13682,7 @@ function compileReplacementModule(input) {
|
|
|
13676
13682
|
if (specifier !== "react" && specifier !== "react-native" && !JSX_RUNTIME_SPECIFIERS.has(specifier) && !isPeachKitSpecifier(specifier) && !input.runtimePackages.has(specifier)) {
|
|
13677
13683
|
throw unsupportedSpecifier(specifier);
|
|
13678
13684
|
}
|
|
13685
|
+
bareSpecifiers.add(specifier);
|
|
13679
13686
|
const bridge = bindings.length > 0 ? bridgeFor(specifier) : null;
|
|
13680
13687
|
const replacement = bindings.map((binding) => {
|
|
13681
13688
|
if (binding.imported === null) return `const ${binding.local} = ${bridge};`;
|
|
@@ -13698,6 +13705,7 @@ function compileReplacementModule(input) {
|
|
|
13698
13705
|
const preamble = declarations.join(" ");
|
|
13699
13706
|
return {
|
|
13700
13707
|
code: preamble ? `${preamble} ${out}` : out,
|
|
13708
|
+
bareSpecifiers: [...bareSpecifiers],
|
|
13701
13709
|
sourceMap: { ...sourceMap, sourcesContent: [input.source] }
|
|
13702
13710
|
};
|
|
13703
13711
|
}
|
|
@@ -13721,7 +13729,7 @@ function sendJavaScript(req, res, source) {
|
|
|
13721
13729
|
});
|
|
13722
13730
|
res.end(req.method === "HEAD" ? void 0 : source);
|
|
13723
13731
|
}
|
|
13724
|
-
function
|
|
13732
|
+
function resolveReplacementModuleFile(fromFile, specifier) {
|
|
13725
13733
|
const base = import_node_path23.default.resolve(import_node_path23.default.dirname(fromFile), specifier);
|
|
13726
13734
|
const candidates = [
|
|
13727
13735
|
...REPLACEMENT_MODULE_EXTENSIONS.some(
|
|
@@ -13835,7 +13843,10 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
13835
13843
|
// so the token, cache key and runtime packages carry over.
|
|
13836
13844
|
localModuleUrl: (specifier) => {
|
|
13837
13845
|
const local = new URL(url.href);
|
|
13838
|
-
local.searchParams.set(
|
|
13846
|
+
local.searchParams.set(
|
|
13847
|
+
"path",
|
|
13848
|
+
resolveReplacementModuleFile(targetPath, specifier)
|
|
13849
|
+
);
|
|
13839
13850
|
return `${local.pathname}${local.search}`;
|
|
13840
13851
|
}
|
|
13841
13852
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.756 | (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.756 | (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;
|