peachsim 0.1.2438 → 0.1.2440
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 +30 -98
- package/cli/app-catalog.ts +4 -73
- package/cli/catalog/content.ts +1 -1
- package/cli/cloud-box-artifact.ts +26 -39
- package/cli/cloud-client.ts +69 -117
- package/cli/cloud-session.ts +2 -9
- package/cli/commands/box.ts +6 -6
- package/cli/commands/control.ts +4 -11
- package/cli/commands/flow.ts +5 -9
- package/cli/commands/kotlin.ts +2 -1
- package/cli/commands/platform.ts +21 -39
- package/cli/commands/record-three.ts +1 -1
- package/cli/commands/shell-url.ts +29 -23
- package/cli/dev-build-freshness.ts +4 -3
- package/cli/native-input.ts +2 -2
- package/cli/outbound-endpoints.ts +20 -45
- package/cli/remote-project-bundle.ts +8 -14
- package/cli/remote-simulators.ts +1 -1
- package/cli/send-to-box.ts +2 -1
- package/detox/jest-preset.cjs +1 -1
- package/detox/jest-transform.cjs +40 -2
- package/dist-lib/agent-daemon-client.cjs +34 -24
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +19 -17
- package/dist-lib/auth/shared-session.cjs +18 -16
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -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 +20 -583
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +17 -99
- package/dist-lib/bundle-channel.cjs +8743 -5562
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +13 -363
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +34 -155
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +26 -155
- package/dist-lib/config.cjs +1 -4
- package/dist-lib/config.mjs +11 -30
- package/dist-lib/detox/index.cjs +2554 -230
- package/dist-lib/detox/jest-preset.cjs +1 -1
- package/dist-lib/detox/jest-transform.cjs +40 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/acorn-B27MTHKJ.mjs +50 -0
- package/dist-lib/esm-chunks/chunk-4U7IGWPB.mjs +42 -0
- package/dist-lib/esm-chunks/chunk-5CZQZKYU.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-6HFWZJ6C.mjs +115 -0
- package/dist-lib/esm-chunks/chunk-6JGALQD5.mjs +12 -0
- package/dist-lib/esm-chunks/chunk-ADE23YGG.mjs +30 -0
- package/dist-lib/esm-chunks/chunk-D4Z36DQQ.mjs +186 -0
- package/dist-lib/esm-chunks/chunk-EATI62W3.mjs +188 -0
- package/dist-lib/esm-chunks/chunk-H6QIEJRC.mjs +10992 -0
- package/dist-lib/esm-chunks/chunk-HIK3VREC.mjs +1353 -0
- package/dist-lib/esm-chunks/chunk-HP7DHONL.mjs +598 -0
- package/dist-lib/esm-chunks/chunk-PRZI3CFF.mjs +5719 -0
- package/dist-lib/esm-chunks/chunk-QECVPSP3.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-R5FNLCBO.mjs +17 -0
- package/dist-lib/esm-chunks/chunk-RVMUQQWC.mjs +664 -0
- package/dist-lib/esm-chunks/chunk-SJFNKW3W.mjs +57 -0
- package/dist-lib/esm-chunks/chunk-WQISIGIX.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-X6UKJ5AX.mjs +375 -0
- package/dist-lib/esm-chunks/chunk-ZXNBC3PZ.mjs +18959 -0
- package/dist-lib/esm-chunks/metro-layout-parser-ZOI5PO4E.mjs +58 -0
- package/dist-lib/expo-swift-bundle.cjs +7881 -4717
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +16 -165
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +15685 -11414
- package/dist-lib/host/fetch-proxy-handler.cjs +3928 -343
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -1
- package/dist-lib/host/replacement-module-handler.cjs +4 -4
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +9145 -32150
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +2 -2
- package/dist-lib/kotlin-host.cjs +260 -253
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +5 -13
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +5 -6
- package/dist-lib/metro-production-bundle.cjs +22 -3
- package/dist-lib/metro-production-bundle.mjs +26 -92
- package/dist-lib/native-app-identity-project.cjs +664 -452
- package/dist-lib/native-app-identity-project.mjs +509 -2318
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +27 -1340
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +5 -18
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -1
- package/dist-lib/plist.cjs +2 -2
- package/dist-lib/plist.mjs +5 -7
- package/dist-lib/profiles.cjs +2 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +246 -187
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +1059 -1238
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -1
- package/dist-lib/reap-browser.cjs +18 -7
- package/dist-lib/scripts/dev-server-scanner.cjs +6 -230
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +22 -78
- package/dist-lib/skills.cjs +21694 -17393
- package/dist-lib/swift-compile.cjs +1355 -1322
- package/dist-lib/swift-compile.mjs +68 -19013
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +35 -630
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +9 -24
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +18061 -0
- package/dist-lib/vendor/acorn.cjs +5699 -0
- package/dist-lib/vendor/bplist-parser.cjs +1589 -0
- package/dist-lib/vendor/ignore.cjs +455 -0
- package/dist-lib/vendor/magic-string.cjs +1693 -0
- package/dist-lib/vendor/plist.cjs +10978 -0
- package/dist-lib/vendor/smol-toml.cjs +768 -0
- package/dist-lib/vendor/stream-json.cjs +1997 -0
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +23593 -0
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +15750 -0
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +11316 -0
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +482 -0
- package/dist-lib/vendor/sucrase.cjs +23593 -0
- package/dist-lib/vendor/terser.cjs +36874 -0
- package/dist-lib/vendor/valibot.cjs +6253 -0
- package/dist-lib/vendor/zod.cjs +23262 -0
- package/dist-lib/worklet-executable.cjs +3 -3
- package/dist-lib/worklet-executable.mjs +11 -16
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/config.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +9 -0
- package/kotlin/fork/NOTICE +3 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/kotlin/toolchain.json +6 -6
- package/package.json +17 -121
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +13 -223
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSDateComponentsFormatter.h +1 -1
- package/src/android-autolinking.ts +2 -2
- package/src/bundle-channel.mjs +3 -15
- package/src/cloud-contract.ts +3 -4
- package/src/config.ts +0 -5
- package/src/host/bridge-host.ts +21 -1
- package/src/host/server-scan-handler.ts +1 -9
- package/src/index.ts +0 -2
- package/src/kotlin-host.ts +1 -2
- package/src/kotlinDiscoveryContract.ts +1 -0
- package/src/metro-production-bundle.ts +28 -6
- package/src/native-seam-manifest.ts +0 -13
- package/src/native-slices.ts +1 -1
- package/src/one-native-app-catalog.ts +8 -27
- package/src/one-native-app-config.ts +95 -0
- package/src/one-native-source.ts +250 -0
- package/src/one-widget-metadata.ts +45 -126
- package/src/oneWidgetContract.ts +80 -117
- package/src/serverDiscoveryContract.ts +0 -1
- package/src/simulator-route.ts +8 -0
- package/src/swift-compile.ts +13 -7
- package/src/swift-host.ts +2 -0
- package/src/swift-package-manifest.ts +13 -8
- package/src/vite-plugin.ts +2 -2
- package/src/xcode-project.ts +1 -1
- package/dist-lib/metro.cjs +0 -27984
- package/dist-lib/vite-swift.cjs +0 -43376
- package/dist-lib/vite.cjs +0 -21456
- package/src/androidAutolinkingContract.ts +0 -48
- package/src/androidRootModuleContract.ts +0 -39
- package/src/dev-server-open.ts +0 -92
- package/src/metro-plugin.ts +0 -578
- package/src/one-widget-discovery.ts +0 -23
- package/src/swift-vite-lifetime.ts +0 -42
- package/src/vite-plugin-one.ts +0 -746
- package/src/vite-plugin-swift.ts +0 -225
- package/src/vite.d.ts +0 -10
package/dist-lib/menu.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2440 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/menu.mjs
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2440 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
|
+
import {
|
|
3
|
+
rnxPublicBrand
|
|
4
|
+
} from "./esm-chunks/chunk-R5FNLCBO.mjs";
|
|
5
|
+
import "./esm-chunks/chunk-4U7IGWPB.mjs";
|
|
2
6
|
|
|
3
7
|
// src/menuContract.ts
|
|
4
8
|
var SOOTSIM_ENGINE_EVENT_NAME = "sootsim:engine-event";
|
|
@@ -50,18 +54,6 @@ var SOOTSIM_SCREEN_EFFECT_LABELS = {
|
|
|
50
54
|
green: "Green"
|
|
51
55
|
};
|
|
52
56
|
|
|
53
|
-
// src/public-brand.ts
|
|
54
|
-
var name = "Peach";
|
|
55
|
-
var peachPublicBrand = Object.freeze({
|
|
56
|
-
name,
|
|
57
|
-
packageName: "peachsim",
|
|
58
|
-
commandName: "peach",
|
|
59
|
-
domain: "peachsim.com",
|
|
60
|
-
origin: "https://peachsim.com",
|
|
61
|
-
boxOrigin: "https://rnx-box.contrast.dev"
|
|
62
|
-
});
|
|
63
|
-
var rnxPublicBrand = peachPublicBrand;
|
|
64
|
-
|
|
65
57
|
// src/menu.ts
|
|
66
58
|
function buildSootSimMenuDefs(state, deviceChoices) {
|
|
67
59
|
return [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2440 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
/*! peach v0.1.2440 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
|
+
import {
|
|
3
|
+
isRecord
|
|
4
|
+
} from "./esm-chunks/chunk-WQISIGIX.mjs";
|
|
5
|
+
import "./esm-chunks/chunk-4U7IGWPB.mjs";
|
|
7
6
|
|
|
8
7
|
// src/metro-fingerprint-registry.ts
|
|
9
8
|
var RNX_METRO_FINGERPRINT_SCHEMA_VERSION = 2;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2440 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -39,7 +39,7 @@ __export(metro_layout_parser_exports, {
|
|
|
39
39
|
});
|
|
40
40
|
async function loadMetroLayoutParser() {
|
|
41
41
|
if (metroLayoutParser) return metroLayoutParser;
|
|
42
|
-
const { Parser } = await import("acorn");
|
|
42
|
+
const { Parser } = await import("peachsim/vendor/acorn");
|
|
43
43
|
metroLayoutParser = Parser.extend(
|
|
44
44
|
(Base) => {
|
|
45
45
|
const parseFunctionBody = Reflect.get(Base.prototype, "parseFunctionBody");
|
|
@@ -104,6 +104,7 @@ __export(metro_production_bundle_exports, {
|
|
|
104
104
|
detachRNXMetroSourceMapUrl: () => detachRNXMetroSourceMapUrl,
|
|
105
105
|
detectBundleModeFromText: () => detectBundleModeFromText,
|
|
106
106
|
readRNXMetroBundleLayout: () => readRNXMetroBundleLayout,
|
|
107
|
+
readRNXMetroDeclaredModulePaths: () => readRNXMetroDeclaredModulePaths,
|
|
107
108
|
readRNXMetroModuleIdentity: () => readRNXMetroModuleIdentity,
|
|
108
109
|
toPeachDevelopmentBundleUrl: () => toPeachDevelopmentBundleUrl,
|
|
109
110
|
toPeachProductionBundleUrl: () => toPeachProductionBundleUrl,
|
|
@@ -305,7 +306,13 @@ async function readRNXMetroBundleLayout(source) {
|
|
|
305
306
|
endLineIndex,
|
|
306
307
|
factory: { start: source.indexOf("(", start) + 1, end: factoryEnd },
|
|
307
308
|
dependencies: dependencies && readableDependencies ? { start: dependencies.start, end: dependencies.end } : null,
|
|
308
|
-
...verboseName
|
|
309
|
+
...verboseName?.type === "Literal" && typeof verboseName.value === "string" ? {
|
|
310
|
+
verboseName: {
|
|
311
|
+
start: verboseName.start,
|
|
312
|
+
end: verboseName.end,
|
|
313
|
+
value: verboseName.value
|
|
314
|
+
}
|
|
315
|
+
} : {}
|
|
309
316
|
});
|
|
310
317
|
}
|
|
311
318
|
return {
|
|
@@ -317,6 +324,17 @@ async function readRNXMetroBundleLayout(source) {
|
|
|
317
324
|
async function validateRNXMetroModulePaths(source, modulePaths) {
|
|
318
325
|
checkRNXMetroModulePaths(await readRNXMetroBundleLayout(source), modulePaths);
|
|
319
326
|
}
|
|
327
|
+
function readRNXMetroDeclaredModulePaths(layout) {
|
|
328
|
+
if (layout.moduleIdFailures > 0) return null;
|
|
329
|
+
const modulePaths = {};
|
|
330
|
+
for (const statement of layout.statements) {
|
|
331
|
+
if (statement.kind !== "define") continue;
|
|
332
|
+
const name = statement.verboseName?.value;
|
|
333
|
+
if (!name) return null;
|
|
334
|
+
modulePaths[String(statement.moduleId)] = name;
|
|
335
|
+
}
|
|
336
|
+
return modulePaths;
|
|
337
|
+
}
|
|
320
338
|
function checkRNXMetroModulePaths(layout, modulePaths) {
|
|
321
339
|
if (layout.moduleIdFailures > 0) {
|
|
322
340
|
throw new Error(
|
|
@@ -395,6 +413,7 @@ async function detectBundleModeFromText(bundleText) {
|
|
|
395
413
|
detachRNXMetroSourceMapUrl,
|
|
396
414
|
detectBundleModeFromText,
|
|
397
415
|
readRNXMetroBundleLayout,
|
|
416
|
+
readRNXMetroDeclaredModulePaths,
|
|
398
417
|
readRNXMetroModuleIdentity,
|
|
399
418
|
toPeachDevelopmentBundleUrl,
|
|
400
419
|
toPeachProductionBundleUrl,
|
|
@@ -1,92 +1,8 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// src/metro-layout-parser.ts
|
|
13
|
-
var metro_layout_parser_exports = {};
|
|
14
|
-
__export(metro_layout_parser_exports, {
|
|
15
|
-
loadMetroLayoutParser: () => loadMetroLayoutParser
|
|
16
|
-
});
|
|
17
|
-
async function loadMetroLayoutParser() {
|
|
18
|
-
if (metroLayoutParser) return metroLayoutParser;
|
|
19
|
-
const { Parser } = await import("acorn");
|
|
20
|
-
metroLayoutParser = Parser.extend(
|
|
21
|
-
(Base) => {
|
|
22
|
-
const parseFunctionBody = Reflect.get(Base.prototype, "parseFunctionBody");
|
|
23
|
-
return class extends Base {
|
|
24
|
-
// layout reads factory ranges, never their bodies. release each body
|
|
25
|
-
// after acorn validates it, before parsing the rest of the graph.
|
|
26
|
-
parseFunctionBody(node, isArrowFunction, isMethod, forInit) {
|
|
27
|
-
Reflect.apply(parseFunctionBody, this, [
|
|
28
|
-
node,
|
|
29
|
-
isArrowFunction,
|
|
30
|
-
isMethod,
|
|
31
|
-
forInit
|
|
32
|
-
]);
|
|
33
|
-
node.body = null;
|
|
34
|
-
}
|
|
35
|
-
// preserve acorn's directive and automatic-semicolon rules. the ordinary
|
|
36
|
-
// parser still validates every factory and owns all source positions.
|
|
37
|
-
strictDirective(start) {
|
|
38
|
-
if (this.options.ecmaVersion !== "latest" && this.options.ecmaVersion < 5)
|
|
39
|
-
return false;
|
|
40
|
-
for (; ; ) {
|
|
41
|
-
whitespace.lastIndex = start;
|
|
42
|
-
const leading = whitespace.exec(this.input);
|
|
43
|
-
if (!leading) return false;
|
|
44
|
-
start += leading[0].length;
|
|
45
|
-
literal.lastIndex = start;
|
|
46
|
-
const match = literal.exec(this.input);
|
|
47
|
-
if (!match) return false;
|
|
48
|
-
whitespace.lastIndex = start + match[0].length;
|
|
49
|
-
const trailing = whitespace.exec(this.input);
|
|
50
|
-
if (!trailing) return false;
|
|
51
|
-
const end = trailing.index + trailing[0].length;
|
|
52
|
-
const next = this.input.charAt(end);
|
|
53
|
-
if ((match[1] || match[2]) === "use strict") {
|
|
54
|
-
return next === ";" || next === "}" || lineBreak.test(trailing[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=");
|
|
55
|
-
}
|
|
56
|
-
start = next === ";" ? end + 1 : end;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
return metroLayoutParser;
|
|
63
|
-
}
|
|
64
|
-
var whitespace, literal, lineBreak, metroLayoutParser;
|
|
65
|
-
var init_metro_layout_parser = __esm({
|
|
66
|
-
"src/metro-layout-parser.ts"() {
|
|
67
|
-
"use strict";
|
|
68
|
-
whitespace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/y;
|
|
69
|
-
literal = /(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/y;
|
|
70
|
-
lineBreak = /[\r\n\u2028\u2029]/;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// ../peach-globals/src/bundle-global-footer.ts
|
|
75
|
-
function findBundleFooter(source, prefix) {
|
|
76
|
-
let end = source.length;
|
|
77
|
-
while (end > 0) {
|
|
78
|
-
const newline = source.lastIndexOf("\n", end - 1);
|
|
79
|
-
if (newline < 0) return -1;
|
|
80
|
-
const line = newline + 1;
|
|
81
|
-
if (source.startsWith(prefix, line)) return newline;
|
|
82
|
-
if (!isFooterBlockLine(source, line, end)) return -1;
|
|
83
|
-
end = newline;
|
|
84
|
-
}
|
|
85
|
-
return -1;
|
|
86
|
-
}
|
|
87
|
-
function isFooterBlockLine(source, line, end) {
|
|
88
|
-
return line === end || source.startsWith("globalThis.", line) || source.startsWith("//", line);
|
|
89
|
-
}
|
|
1
|
+
/*! peach v0.1.2440 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
|
+
import {
|
|
3
|
+
findBundleFooter
|
|
4
|
+
} from "./esm-chunks/chunk-SJFNKW3W.mjs";
|
|
5
|
+
import "./esm-chunks/chunk-4U7IGWPB.mjs";
|
|
90
6
|
|
|
91
7
|
// src/metro-production-bundle.ts
|
|
92
8
|
var RNXSIM_METRO_MODULE_PATHS_PREFIX = "globalThis.__sootsimModulePaths=";
|
|
@@ -215,8 +131,8 @@ function metroCalls(expression) {
|
|
|
215
131
|
return [];
|
|
216
132
|
}
|
|
217
133
|
async function readRNXMetroBundleLayout(source) {
|
|
218
|
-
const { loadMetroLayoutParser
|
|
219
|
-
const MetroLayoutParser = await
|
|
134
|
+
const { loadMetroLayoutParser } = await import("./esm-chunks/metro-layout-parser-ZOI5PO4E.mjs");
|
|
135
|
+
const MetroLayoutParser = await loadMetroLayoutParser();
|
|
220
136
|
const program = MetroLayoutParser.parse(source, {
|
|
221
137
|
ecmaVersion: "latest",
|
|
222
138
|
allowImportExportEverywhere: true
|
|
@@ -264,7 +180,13 @@ async function readRNXMetroBundleLayout(source) {
|
|
|
264
180
|
endLineIndex,
|
|
265
181
|
factory: { start: source.indexOf("(", start) + 1, end: factoryEnd },
|
|
266
182
|
dependencies: dependencies && readableDependencies ? { start: dependencies.start, end: dependencies.end } : null,
|
|
267
|
-
...verboseName
|
|
183
|
+
...verboseName?.type === "Literal" && typeof verboseName.value === "string" ? {
|
|
184
|
+
verboseName: {
|
|
185
|
+
start: verboseName.start,
|
|
186
|
+
end: verboseName.end,
|
|
187
|
+
value: verboseName.value
|
|
188
|
+
}
|
|
189
|
+
} : {}
|
|
268
190
|
});
|
|
269
191
|
}
|
|
270
192
|
return {
|
|
@@ -276,6 +198,17 @@ async function readRNXMetroBundleLayout(source) {
|
|
|
276
198
|
async function validateRNXMetroModulePaths(source, modulePaths) {
|
|
277
199
|
checkRNXMetroModulePaths(await readRNXMetroBundleLayout(source), modulePaths);
|
|
278
200
|
}
|
|
201
|
+
function readRNXMetroDeclaredModulePaths(layout) {
|
|
202
|
+
if (layout.moduleIdFailures > 0) return null;
|
|
203
|
+
const modulePaths = {};
|
|
204
|
+
for (const statement of layout.statements) {
|
|
205
|
+
if (statement.kind !== "define") continue;
|
|
206
|
+
const name = statement.verboseName?.value;
|
|
207
|
+
if (!name) return null;
|
|
208
|
+
modulePaths[String(statement.moduleId)] = name;
|
|
209
|
+
}
|
|
210
|
+
return modulePaths;
|
|
211
|
+
}
|
|
279
212
|
function checkRNXMetroModulePaths(layout, modulePaths) {
|
|
280
213
|
if (layout.moduleIdFailures > 0) {
|
|
281
214
|
throw new Error(
|
|
@@ -353,6 +286,7 @@ export {
|
|
|
353
286
|
detachRNXMetroSourceMapUrl,
|
|
354
287
|
detectBundleModeFromText,
|
|
355
288
|
readRNXMetroBundleLayout,
|
|
289
|
+
readRNXMetroDeclaredModulePaths,
|
|
356
290
|
readRNXMetroModuleIdentity,
|
|
357
291
|
toPeachDevelopmentBundleUrl,
|
|
358
292
|
toPeachProductionBundleUrl,
|