peachsim 0.1.2233 → 0.1.2235
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/command-registry.ts +1 -0
- package/cli/commands/control.ts +12 -0
- package/cli/commands/stream.ts +150 -0
- package/cli/main.ts +6 -0
- package/cli/outbound-endpoints.ts +10 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.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/bundle-channel.cjs +33 -47
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +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 +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +31 -45
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +33 -47
- package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
- 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 +4 -4
- 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 +4 -4
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- 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/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.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/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +54 -53
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +385 -212
- package/dist-lib/swift-compile.cjs +13 -21
- package/dist-lib/swift-compile.mjs +13 -21
- 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 +14 -22
- package/dist-lib/vite.cjs +4 -4
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/native-layout.d.ts +4 -1
- package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/settings/devices.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +8 -0
- package/dist-types/packages/peach-globals/src/globalsContract.d.ts +2 -1
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/skills/contrast/SKILL.md +1 -0
- package/src/expo-native-workspace.ts +16 -21
- package/src/expo-swift-host.ts +2 -2
- package/src/react-native-bridge-modules.ts +6 -6
- package/src/swift-guest-runtime-plan.ts +2 -2
- package/src/swift-shared-sdk.ts +7 -10
- package/src/swift-wasm-prune.ts +3 -8
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2235 | (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;
|
|
@@ -35910,7 +35910,7 @@ var init_openstep_plist = __esm({
|
|
|
35910
35910
|
});
|
|
35911
35911
|
|
|
35912
35912
|
// src/xcode-target-members.ts
|
|
35913
|
-
function xcodePathResolver(objects, projectDir,
|
|
35913
|
+
function xcodePathResolver(objects, projectDir, join33, sourceTreeRoot) {
|
|
35914
35914
|
const parents = /* @__PURE__ */ new Map();
|
|
35915
35915
|
for (const [id, entry] of Object.entries(objects)) {
|
|
35916
35916
|
if (!isDict(entry)) continue;
|
|
@@ -35928,14 +35928,14 @@ function xcodePathResolver(objects, projectDir, join32, sourceTreeRoot) {
|
|
|
35928
35928
|
const own = str(entry.path) ?? "";
|
|
35929
35929
|
const tree3 = str(entry.sourceTree) ?? "<group>";
|
|
35930
35930
|
if (tree3 === "<absolute>") result = own;
|
|
35931
|
-
else if (tree3 === "SOURCE_ROOT") result =
|
|
35931
|
+
else if (tree3 === "SOURCE_ROOT") result = join33(projectDir, own);
|
|
35932
35932
|
else if (tree3 === "<group>") {
|
|
35933
35933
|
const parent = parents.get(id);
|
|
35934
35934
|
const base = parent ? resolve13(parent) : projectDir;
|
|
35935
|
-
if (base !== null) result =
|
|
35935
|
+
if (base !== null) result = join33(base, own);
|
|
35936
35936
|
} else {
|
|
35937
35937
|
const base = sourceTreeRoot?.(tree3);
|
|
35938
|
-
if (base) result =
|
|
35938
|
+
if (base) result = join33(base, own);
|
|
35939
35939
|
}
|
|
35940
35940
|
}
|
|
35941
35941
|
paths.set(id, result);
|
|
@@ -35957,7 +35957,7 @@ function xcodeTargetMemberVisitor(objects) {
|
|
|
35957
35957
|
if (isDict(group) && group.isa === "PBXFileSystemSynchronizedRootGroup")
|
|
35958
35958
|
synchronizedGroups.push({ id, group });
|
|
35959
35959
|
}
|
|
35960
|
-
return (targetId, resolvePath, filesUnder,
|
|
35960
|
+
return (targetId, resolvePath, filesUnder, join33, visit3) => {
|
|
35961
35961
|
const target = objects[targetId];
|
|
35962
35962
|
if (!isDict(target)) return;
|
|
35963
35963
|
for (const phaseId of list(target.buildPhases)) {
|
|
@@ -36004,7 +36004,7 @@ function xcodeTargetMemberVisitor(objects) {
|
|
|
36004
36004
|
for (const relative5 of list(exception.membershipExceptions))
|
|
36005
36005
|
exceptions.add(relative5);
|
|
36006
36006
|
}
|
|
36007
|
-
const members2 = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative5) => filesUnder(
|
|
36007
|
+
const members2 = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative5) => filesUnder(join33(folder, relative5)));
|
|
36008
36008
|
for (const file of members2) {
|
|
36009
36009
|
const relative5 = file.slice(prefix.length);
|
|
36010
36010
|
const excepted = [...exceptions].some(
|
|
@@ -36595,7 +36595,7 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
|
|
|
36595
36595
|
if (resourceUri) {
|
|
36596
36596
|
if (!selectedTarget)
|
|
36597
36597
|
throw new Error("native app icon target membership is unresolved");
|
|
36598
|
-
const
|
|
36598
|
+
const join33 = (base, own) => {
|
|
36599
36599
|
const segments = [];
|
|
36600
36600
|
for (const segment of `${base}/${own}`.split("/")) {
|
|
36601
36601
|
if (segment === "" || segment === ".") continue;
|
|
@@ -36608,14 +36608,14 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
|
|
|
36608
36608
|
const project2 = Object.values(objects).find(
|
|
36609
36609
|
(object6) => isRecord(object6) && object6.isa === "PBXProject"
|
|
36610
36610
|
);
|
|
36611
|
-
const projectDir =
|
|
36611
|
+
const projectDir = join33(
|
|
36612
36612
|
pbxprojPath.replace(/(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/, ""),
|
|
36613
36613
|
isRecord(project2) && typeof project2.projectDirPath === "string" ? project2.projectDirPath : ""
|
|
36614
36614
|
);
|
|
36615
36615
|
const paths = Object.keys(files2);
|
|
36616
36616
|
xcodeTargetMemberVisitor(objects)(
|
|
36617
36617
|
selectedTarget.id,
|
|
36618
|
-
xcodePathResolver(objects, projectDir,
|
|
36618
|
+
xcodePathResolver(objects, projectDir, join33),
|
|
36619
36619
|
(file) => {
|
|
36620
36620
|
if (Object.hasOwn(files2, file)) return [file];
|
|
36621
36621
|
const prefix = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
|
|
@@ -36623,7 +36623,7 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
|
|
|
36623
36623
|
(path141) => path141.startsWith(prefix) && !/(?:^|\/)\./.test(path141.slice(prefix.length))
|
|
36624
36624
|
);
|
|
36625
36625
|
},
|
|
36626
|
-
|
|
36626
|
+
join33,
|
|
36627
36627
|
(file, kind) => {
|
|
36628
36628
|
if (kind === "resource") resources.add(file);
|
|
36629
36629
|
}
|
|
@@ -46447,7 +46447,7 @@ function readULEB(b, o) {
|
|
|
46447
46447
|
}
|
|
46448
46448
|
return [res, p];
|
|
46449
46449
|
}
|
|
46450
|
-
function
|
|
46450
|
+
function weakenFoundationSymbolsInWasmObj(buf) {
|
|
46451
46451
|
let pos = 8;
|
|
46452
46452
|
while (pos < buf.length) {
|
|
46453
46453
|
const id = buf[pos++];
|
|
@@ -46478,7 +46478,7 @@ function weakenBundleSymbolsInWasmObj(buf) {
|
|
|
46478
46478
|
if (!isUndef || isExplicitName) {
|
|
46479
46479
|
const [sLen, c4] = readULEB(buf, cur);
|
|
46480
46480
|
const sName = Buffer.from(buf.subarray(c4, c4 + sLen)).toString("utf8");
|
|
46481
|
-
if (!isUndef && kind === 0 &&
|
|
46481
|
+
if (!isUndef && kind === 0 && WEAKEN_FOUNDATION_SYMS.has(sName)) {
|
|
46482
46482
|
buf[flOffset] = buf[flOffset] & ~3 | 1;
|
|
46483
46483
|
}
|
|
46484
46484
|
cur = c4 + sLen;
|
|
@@ -46505,7 +46505,7 @@ function weakenBundleSymbolsInWasmObj(buf) {
|
|
|
46505
46505
|
pos = end;
|
|
46506
46506
|
}
|
|
46507
46507
|
}
|
|
46508
|
-
function
|
|
46508
|
+
function weakenFoundationOverridesInArchive(arBuf) {
|
|
46509
46509
|
let gnuNames = null;
|
|
46510
46510
|
let pos = 8;
|
|
46511
46511
|
while (pos + 60 <= arBuf.length) {
|
|
@@ -46543,8 +46543,8 @@ function weakenBundleInArchive(arBuf) {
|
|
|
46543
46543
|
} else if (name3.endsWith("/")) {
|
|
46544
46544
|
name3 = name3.slice(0, -1);
|
|
46545
46545
|
}
|
|
46546
|
-
if (name3.endsWith("
|
|
46547
|
-
|
|
46546
|
+
if (name3.endsWith("NSSortDescriptor.o")) {
|
|
46547
|
+
weakenFoundationSymbolsInWasmObj(arBuf.subarray(bodyStart, bodyEnd));
|
|
46548
46548
|
}
|
|
46549
46549
|
pos = bodyEnd + (size & 1);
|
|
46550
46550
|
}
|
|
@@ -46710,7 +46710,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
|
|
|
46710
46710
|
import_node_path34.default.relative(realRoot, foundationArchive)
|
|
46711
46711
|
);
|
|
46712
46712
|
const arBuf = new Uint8Array(import_node_fs37.default.readFileSync(foundationArchive));
|
|
46713
|
-
|
|
46713
|
+
weakenFoundationOverridesInArchive(arBuf);
|
|
46714
46714
|
import_node_fs37.default.writeFileSync(foundationSlot, arBuf);
|
|
46715
46715
|
}
|
|
46716
46716
|
try {
|
|
@@ -46733,7 +46733,7 @@ function swiftSharedSdkInputFiles(moduleRoot) {
|
|
|
46733
46733
|
const root = swiftSharedSdkRoot(moduleRoot, false);
|
|
46734
46734
|
return (0, import_node_fs37.readdirSync)(root, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path34.default.relative(moduleRoot, import_node_path34.default.join(entry.parentPath, entry.name))).sort();
|
|
46735
46735
|
}
|
|
46736
|
-
var import_node_child_process20, import_node_crypto17, import_node_fs37, import_node_path34, distributionHeaderRoots,
|
|
46736
|
+
var import_node_child_process20, import_node_crypto17, import_node_fs37, import_node_path34, distributionHeaderRoots, WEAKEN_FOUNDATION_SYMS, sdkViews;
|
|
46737
46737
|
var init_swift_shared_sdk = __esm({
|
|
46738
46738
|
"src/swift-shared-sdk.ts"() {
|
|
46739
46739
|
"use strict";
|
|
@@ -46744,10 +46744,7 @@ var init_swift_shared_sdk = __esm({
|
|
|
46744
46744
|
import_node_path34 = __toESM(require("node:path"), 1);
|
|
46745
46745
|
init_swift_toolchain();
|
|
46746
46746
|
distributionHeaderRoots = /* @__PURE__ */ new Map();
|
|
46747
|
-
|
|
46748
|
-
"$s10Foundation6BundleC22preferredLocalizations4from14forPreferencesSaySSGAG_AGSgtFZ",
|
|
46749
|
-
"$s10Foundation6BundleC22preferredLocalizations4fromSaySSGAF_tFZ",
|
|
46750
|
-
"$s10Foundation6BundleC22preferredLocalizationsSaySSGvg",
|
|
46747
|
+
WEAKEN_FOUNDATION_SYMS = /* @__PURE__ */ new Set([
|
|
46751
46748
|
"$s10Foundation16NSSortDescriptorC3key9ascendingACSSSg_SbtcfC",
|
|
46752
46749
|
"$s10Foundation16NSSortDescriptorC3key9ascendingACSSSg_Sbtcfc",
|
|
46753
46750
|
"$s10Foundation16NSSortDescriptorC3keySSSgvg",
|
|
@@ -48695,12 +48692,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
48695
48692
|
const def = definedGlobalSyms.get(symName);
|
|
48696
48693
|
if (def) activateSymbolInObj(def.obj, def.symIdx);
|
|
48697
48694
|
}
|
|
48698
|
-
const
|
|
48699
|
-
"$s10Foundation6BundleC22preferredLocalizations4from14forPreferencesSaySSGAG_AGSgtFZ",
|
|
48700
|
-
"$s10Foundation6BundleC22preferredLocalizations4fromSaySSGAF_tFZ",
|
|
48701
|
-
"$s10Foundation6BundleC22preferredLocalizationsSaySSGvg",
|
|
48702
|
-
"$s10Foundation6BundleC22preferredLocalizations4from14forPreferencesSaySSGAG_AGSgtFZTf4nnd_n",
|
|
48703
|
-
"$s10Foundation6BundleC22preferredLocalizations4fromSaySSGAF_tFZTf4nd_n",
|
|
48695
|
+
const WEAKEN_SDK_FOUNDATION_SYMS = /* @__PURE__ */ new Set([
|
|
48704
48696
|
"$s10Foundation16NSSortDescriptorC3key9ascendingACSSSg_SbtcfC",
|
|
48705
48697
|
"$s10Foundation16NSSortDescriptorC3key9ascendingACSSSg_Sbtcfc",
|
|
48706
48698
|
"$s10Foundation16NSSortDescriptorC3keySSSgvg",
|
|
@@ -48733,7 +48725,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
48733
48725
|
} else {
|
|
48734
48726
|
const name3 = obj.symNames[symIdx];
|
|
48735
48727
|
if (!name3) continue;
|
|
48736
|
-
if (
|
|
48728
|
+
if (WEAKEN_SDK_FOUNDATION_SYMS.has(name3)) {
|
|
48737
48729
|
const overrideCand = lazyProviders.get(name3)?.find((c) => !c.file.startsWith(sdkObjsDir));
|
|
48738
48730
|
if (overrideCand) extractObject(overrideCand);
|
|
48739
48731
|
}
|
|
@@ -48951,7 +48943,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
48951
48943
|
newFl = (fl & ~3 | 1) & 127;
|
|
48952
48944
|
} else if (!isUndef && kind === 0 && obj.symElemIdx[i] >= obj.numImportFuncs && fLive[obj.symElemIdx[i] - obj.numImportFuncs] === 0) {
|
|
48953
48945
|
newFl = fl & 64 | 2;
|
|
48954
|
-
} else if (!isUndef && kind === 0 && obj.file.startsWith(sdkObjsDir) &&
|
|
48946
|
+
} else if (!isUndef && kind === 0 && obj.file.startsWith(sdkObjsDir) && WEAKEN_SDK_FOUNDATION_SYMS.has(obj.symNames[i])) {
|
|
48955
48947
|
newFl = (fl & ~3 | 1) & 127;
|
|
48956
48948
|
}
|
|
48957
48949
|
if (flLen === 1) {
|
|
@@ -50863,7 +50855,7 @@ function sdkArtifactBytes(root, artifact) {
|
|
|
50863
50855
|
if (hash(source) !== artifact.sha256)
|
|
50864
50856
|
throw new Error(`SDK product artifact changed ${file}`);
|
|
50865
50857
|
const transformed = Uint8Array.from(source);
|
|
50866
|
-
|
|
50858
|
+
weakenFoundationOverridesInArchive(transformed);
|
|
50867
50859
|
if (!linked.equals(transformed))
|
|
50868
50860
|
throw new Error(`SDK view transformation changed ${file}`);
|
|
50869
50861
|
return { source, linked };
|
|
@@ -59332,7 +59324,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
59332
59324
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
59333
59325
|
MULTI_MANIFEST_VERSION = 68;
|
|
59334
59326
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
59335
|
-
compilerSourceDigest = true ? "
|
|
59327
|
+
compilerSourceDigest = true ? "7c1188b9ba2b81e03391ec670b3e984dbb3a70fccecf681beaa2b8c7a7c36a5c" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
59336
59328
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
59337
59329
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
59338
59330
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
@@ -64765,35 +64757,29 @@ async function hashWorkspaceInputs(app, everyByte, signal, sourceOnly = false, p
|
|
|
64765
64757
|
excluded
|
|
64766
64758
|
};
|
|
64767
64759
|
}
|
|
64768
|
-
const
|
|
64769
|
-
|
|
64770
|
-
|
|
64771
|
-
|
|
64772
|
-
|
|
64773
|
-
env: utf8Env
|
|
64774
|
-
});
|
|
64775
|
-
} catch (cause) {
|
|
64760
|
+
const execFileAsync4 = (0, import_node_util11.promisify)(import_node_child_process37.execFile);
|
|
64761
|
+
const mac = process.platform === "darwin" ? await Promise.all([
|
|
64762
|
+
// runner-toolchain-platform: darwin
|
|
64763
|
+
execFileAsync4("pod", ["--version"], { env: utf8Env, signal }).catch(
|
|
64764
|
+
(cause) => {
|
|
64776
64765
|
throw new Error("CocoaPods is required to install source dependencies", {
|
|
64777
64766
|
cause
|
|
64778
64767
|
});
|
|
64779
64768
|
}
|
|
64780
|
-
|
|
64769
|
+
),
|
|
64781
64770
|
// runner-toolchain-platform: darwin
|
|
64782
|
-
|
|
64783
|
-
|
|
64784
|
-
env: utf8Env
|
|
64785
|
-
})
|
|
64786
|
-
} : {};
|
|
64771
|
+
execFileAsync4("xcodebuild", ["-version"], { env: utf8Env, signal })
|
|
64772
|
+
]).then(([pod, xcode]) => ({ podVersion: pod.stdout, xcode: xcode.stdout })) : {};
|
|
64787
64773
|
const pinnedNode = typeof manifest.engines?.node === "string" && /^\d+(\.\d+){0,2}$/.test(manifest.engines.node) ? `node@${manifest.engines.node}` : null;
|
|
64788
64774
|
const toolchain = JSON.stringify({
|
|
64789
64775
|
preparation: 7,
|
|
64790
64776
|
appRelative,
|
|
64791
64777
|
...mac,
|
|
64792
|
-
node: (
|
|
64778
|
+
node: (await execFileAsync4(
|
|
64793
64779
|
pinnedNode ? "mise" : "node",
|
|
64794
64780
|
pinnedNode ? ["exec", pinnedNode, "--", "node", "--version"] : ["--version"],
|
|
64795
|
-
{ cwd: root,
|
|
64796
|
-
).trim(),
|
|
64781
|
+
{ cwd: root, signal }
|
|
64782
|
+
)).stdout.trim(),
|
|
64797
64783
|
packageManager: workspacePackageManager(root, manifest.packageManager, excluded),
|
|
64798
64784
|
podsEnvironment
|
|
64799
64785
|
});
|
|
@@ -64886,22 +64872,22 @@ function syncChangedFiles(root, work, appRelative, excluded, installed2) {
|
|
|
64886
64872
|
function watchRoot(root) {
|
|
64887
64873
|
const existing = watches.get(root);
|
|
64888
64874
|
if (existing) return existing;
|
|
64889
|
-
const
|
|
64875
|
+
const watch3 = { edits: 0 };
|
|
64890
64876
|
const watcher = import_node_fs64.default.watch(root, { recursive: true }, (_event, filename) => {
|
|
64891
64877
|
const parts = filename?.split(import_node_path62.default.sep) ?? [];
|
|
64892
|
-
const { excluded } =
|
|
64878
|
+
const { excluded } = watch3;
|
|
64893
64879
|
if (excluded && parts.some((_, index) => excluded(parts.slice(0, index + 1).join(import_node_path62.default.sep))))
|
|
64894
64880
|
return;
|
|
64895
|
-
|
|
64881
|
+
watch3.edits += 1;
|
|
64896
64882
|
});
|
|
64897
64883
|
watcher.on("error", () => {
|
|
64898
64884
|
watcher.close();
|
|
64899
64885
|
watches.delete(root);
|
|
64900
|
-
|
|
64886
|
+
watch3.edits += 1;
|
|
64901
64887
|
});
|
|
64902
64888
|
watcher.unref();
|
|
64903
|
-
watches.set(root,
|
|
64904
|
-
return
|
|
64889
|
+
watches.set(root, watch3);
|
|
64890
|
+
return watch3;
|
|
64905
64891
|
}
|
|
64906
64892
|
async function prepareExpoNativeWorkspace(app, signal, target) {
|
|
64907
64893
|
const prepared = await prepare(app, "workspace", signal);
|
|
@@ -65036,8 +65022,8 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
65036
65022
|
const report = (message) => console.error(
|
|
65037
65023
|
`[expo-native-workspace ${Math.round(performance.now() - started)}ms] ${message}`
|
|
65038
65024
|
);
|
|
65039
|
-
const
|
|
65040
|
-
const edits =
|
|
65025
|
+
const watch3 = watchRoot(findWorkspaceRoot(app));
|
|
65026
|
+
const edits = watch3.edits;
|
|
65041
65027
|
const { root, appRelative, nativeHash, excluded } = await hashWorkspaceInputs(
|
|
65042
65028
|
app,
|
|
65043
65029
|
false,
|
|
@@ -65045,7 +65031,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
65045
65031
|
false,
|
|
65046
65032
|
podsEnvironment
|
|
65047
65033
|
);
|
|
65048
|
-
|
|
65034
|
+
watch3.excluded = excluded;
|
|
65049
65035
|
const manifest = JSON.parse(import_node_fs64.default.readFileSync(import_node_path62.default.join(root, "package.json"), "utf8"));
|
|
65050
65036
|
const appManifest = JSON.parse(import_node_fs64.default.readFileSync(import_node_path62.default.join(app, "package.json"), "utf8"));
|
|
65051
65037
|
const work = import_node_path62.default.join(sharedCacheDir(cacheDir()), "expo-native-workspaces", nativeHash);
|
|
@@ -65174,7 +65160,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
65174
65160
|
await pruneExpoNativeWorkspaces(import_node_path62.default.dirname(work), work);
|
|
65175
65161
|
return { app: preparedApp, work };
|
|
65176
65162
|
});
|
|
65177
|
-
current.set(key2, { watch:
|
|
65163
|
+
current.set(key2, { watch: watch3, edits, result });
|
|
65178
65164
|
return result;
|
|
65179
65165
|
}
|
|
65180
65166
|
function declaresNativeDependency(manifest, name3) {
|
|
@@ -65820,7 +65806,7 @@ var init_swift_standin_digest = __esm({
|
|
|
65820
65806
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
65821
65807
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
65822
65808
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
65823
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
65809
|
+
STANDIN_SOURCE_DIGEST = true ? "ae88f21106ce704b52a260a8c3d5bc2c1576fc0beef490d84ca792d99bcedc3f" : standinSourceDigest();
|
|
65824
65810
|
}
|
|
65825
65811
|
});
|
|
65826
65812
|
|
|
@@ -66281,7 +66267,7 @@ var init_package_tree_digest = __esm({
|
|
|
66281
66267
|
|
|
66282
66268
|
// src/expo-native-prebuilt.ts
|
|
66283
66269
|
function expoNativeCompilerDigestValue() {
|
|
66284
|
-
return true ? "
|
|
66270
|
+
return true ? "f069632feb274e7f5eaf8dbf407b0e9c5d4ea672a5c474d7f149564111c5c7ae" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
66285
66271
|
}
|
|
66286
66272
|
function readSources(value) {
|
|
66287
66273
|
const sources = isRecord(value) ? value.sources : null;
|
|
@@ -72531,7 +72517,7 @@ function swiftClassFor(objcName, files2) {
|
|
|
72531
72517
|
}
|
|
72532
72518
|
return fallback;
|
|
72533
72519
|
}
|
|
72534
|
-
function collectBridgeModuleSources(appRoot, signal, installedWorkspace) {
|
|
72520
|
+
async function collectBridgeModuleSources(appRoot, signal, installedWorkspace) {
|
|
72535
72521
|
signal?.throwIfAborted();
|
|
72536
72522
|
const units = [];
|
|
72537
72523
|
const failures = [];
|
|
@@ -72633,7 +72619,7 @@ ${import_node_fs80.default.readFileSync(file, "utf8")}`;
|
|
|
72633
72619
|
if (swiftClass) {
|
|
72634
72620
|
const bridgingHeader = target.objc?.bridgingHeader;
|
|
72635
72621
|
if (bridgingHeader && target.objc && app) {
|
|
72636
|
-
nativeInputs ??=
|
|
72622
|
+
nativeInputs ??= await xcodeObjCInputsAsync(
|
|
72637
72623
|
app,
|
|
72638
72624
|
[],
|
|
72639
72625
|
null,
|
|
@@ -85023,12 +85009,12 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
85023
85009
|
})
|
|
85024
85010
|
))
|
|
85025
85011
|
await ensureSwiftToolchain(signal);
|
|
85026
|
-
let bridge = options.only ? null : collectBridgeModuleSources(import_node_fs95.default.realpathSync(root), signal);
|
|
85012
|
+
let bridge = options.only ? null : await collectBridgeModuleSources(import_node_fs95.default.realpathSync(root), signal);
|
|
85027
85013
|
if (nativeWorkspaceAvailable() && import_node_fs95.default.existsSync(import_node_path92.default.join(root, "ios", "Podfile")) && bridge?.units.some(
|
|
85028
85014
|
(unit2) => unit2.nativeTargets?.some((target) => target.bridgingHeader)
|
|
85029
85015
|
)) {
|
|
85030
85016
|
const prepared = await prepareExpoNativeWorkspace(root, signal, options.iosTarget);
|
|
85031
|
-
bridge = collectBridgeModuleSources(
|
|
85017
|
+
bridge = await collectBridgeModuleSources(
|
|
85032
85018
|
import_node_fs95.default.realpathSync(prepared.app),
|
|
85033
85019
|
signal,
|
|
85034
85020
|
options.installedWorkspace ?? prepared.workspace
|
|
@@ -87016,7 +87002,7 @@ var init_nitro_superset = __esm({
|
|
|
87016
87002
|
init_nitroContract();
|
|
87017
87003
|
init_swift_standin_digest();
|
|
87018
87004
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
87019
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
87005
|
+
NITRO_COMPILER_DIGEST = true ? "35243d992261bdee722d9a986f2a4a1c3872cb6e43a1a40984a0eec51a85353f" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
87020
87006
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
87021
87007
|
nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
|
|
87022
87008
|
published2 = /* @__PURE__ */ new Map();
|
|
@@ -87728,7 +87714,7 @@ var init_one_sdk_bundle = __esm({
|
|
|
87728
87714
|
var runtime_companion_default;
|
|
87729
87715
|
var init_runtime_companion = __esm({
|
|
87730
87716
|
"runtime-companion.json"() {
|
|
87731
|
-
runtime_companion_default = { abi: 1, sha256: "
|
|
87717
|
+
runtime_companion_default = { abi: 1, sha256: "de957e6cfaf58e8388e37c64326c72cd8376936fbe14bbba0fd2c0129ada4335", file: "node/cli-de957e6cfaf58e8388e37c64326c72cd8376936fbe14bbba0fd2c0129ada4335.cjs" };
|
|
87732
87718
|
}
|
|
87733
87719
|
});
|
|
87734
87720
|
|
|
@@ -110229,6 +110215,7 @@ var init_command_registry = __esm({
|
|
|
110229
110215
|
"assert",
|
|
110230
110216
|
"device",
|
|
110231
110217
|
"open",
|
|
110218
|
+
"stream",
|
|
110232
110219
|
"package",
|
|
110233
110220
|
"ios",
|
|
110234
110221
|
"android",
|
|
@@ -111614,6 +111601,7 @@ var init_meta = __esm({
|
|
|
111614
111601
|
"peach ios --remote <app-dir|bundle-path|https-url> [--device <model>]"
|
|
111615
111602
|
],
|
|
111616
111603
|
options: [
|
|
111604
|
+
option("--stream", "stream this local simulator to your team until Ctrl+C"),
|
|
111617
111605
|
option(
|
|
111618
111606
|
"--device <model>",
|
|
111619
111607
|
"pick a specific iOS device model. an Android model here is refused by name rather than silently overriding the platform"
|
|
@@ -111917,6 +111905,7 @@ var init_meta = __esm({
|
|
|
111917
111905
|
"--package-versions <json>",
|
|
111918
111906
|
"native package versions for a prebuilt release bundle"
|
|
111919
111907
|
),
|
|
111908
|
+
option("--stream", "stream this local simulator to your team until Ctrl+C"),
|
|
111920
111909
|
option("--target <name>", "native application target"),
|
|
111921
111910
|
option("--scheme <name>", "Xcode application scheme"),
|
|
111922
111911
|
option("--activity <name>", "Android application activity")
|
|
@@ -111929,6 +111918,23 @@ var init_meta = __esm({
|
|
|
111929
111918
|
],
|
|
111930
111919
|
related: ["open", "desktop", "config"]
|
|
111931
111920
|
},
|
|
111921
|
+
{
|
|
111922
|
+
id: "stream",
|
|
111923
|
+
slug: "stream",
|
|
111924
|
+
navTitle: "stream",
|
|
111925
|
+
title: "peach stream",
|
|
111926
|
+
description: "stream an open simulator to your team",
|
|
111927
|
+
summary: "The simulator runs on this Mac. Teammates watch its display in the web workspace. Start stays in the foreground; Ctrl+C stops the stream.",
|
|
111928
|
+
order: 99,
|
|
111929
|
+
usage: ["peach stream start|stop|status [--sim <id>]"],
|
|
111930
|
+
options: [option("--sim <id>", "select an open simulator")],
|
|
111931
|
+
examples: [
|
|
111932
|
+
example("peach stream start"),
|
|
111933
|
+
example("peach stream stop"),
|
|
111934
|
+
example("peach stream status")
|
|
111935
|
+
],
|
|
111936
|
+
related: ["open", "ios"]
|
|
111937
|
+
},
|
|
111932
111938
|
{
|
|
111933
111939
|
id: "open",
|
|
111934
111940
|
slug: "open",
|
|
@@ -117066,6 +117072,161 @@ var init_metro_bundle_assets = __esm({
|
|
|
117066
117072
|
}
|
|
117067
117073
|
});
|
|
117068
117074
|
|
|
117075
|
+
// cli/commands/stream.ts
|
|
117076
|
+
var stream_exports = {};
|
|
117077
|
+
__export(stream_exports, {
|
|
117078
|
+
STREAM_FLAG: () => STREAM_FLAG,
|
|
117079
|
+
runStreamCommand: () => runStreamCommand
|
|
117080
|
+
});
|
|
117081
|
+
async function runStreamCommand(args, opts = {}) {
|
|
117082
|
+
const parsed = parseBridgeCliArgs(args, { port: opts.port });
|
|
117083
|
+
const action = parsed.positional[0] ?? "status";
|
|
117084
|
+
if (!["start", "stop", "status"].includes(action) || parsed.positional.length > 1)
|
|
117085
|
+
throw new Error("usage: peach stream start|stop|status [--sim <id>]");
|
|
117086
|
+
const bridge = createBridgeFromParsed(parsed);
|
|
117087
|
+
let removeRecord;
|
|
117088
|
+
let endSession2;
|
|
117089
|
+
try {
|
|
117090
|
+
const simId = await bridge.send({
|
|
117091
|
+
type: "evaluate",
|
|
117092
|
+
code: "globalThis.__sootsimBridge?.id ?? globalThis.SootSim?.state?.simId"
|
|
117093
|
+
});
|
|
117094
|
+
if (typeof simId !== "string" || !simId)
|
|
117095
|
+
throw new Error("Could not identify the local simulator.");
|
|
117096
|
+
const directory2 = (0, import_node_path144.join)(rnxHomeDir(), "streams");
|
|
117097
|
+
(0, import_node_fs142.mkdirSync)(directory2, { recursive: true });
|
|
117098
|
+
const file = (0, import_node_path144.join)(directory2, `${encodeURIComponent(simId)}.json`);
|
|
117099
|
+
const state = await callInBridge(bridge, "SootSim.bridges.videoStream.state");
|
|
117100
|
+
if (action === "status") {
|
|
117101
|
+
console.log(` stream: ${state}`);
|
|
117102
|
+
return;
|
|
117103
|
+
}
|
|
117104
|
+
const { auth, header } = authHeaderOrExit("stream");
|
|
117105
|
+
const stopSession = async (record4) => {
|
|
117106
|
+
const url = new URL(
|
|
117107
|
+
`/api/v1/rnx/sessions/${encodeURIComponent(record4.sessionId)}`,
|
|
117108
|
+
record4.origin
|
|
117109
|
+
);
|
|
117110
|
+
url.searchParams.set("accountId", record4.accountId);
|
|
117111
|
+
const response2 = await fetch(url, {
|
|
117112
|
+
method: "DELETE",
|
|
117113
|
+
headers: { authorization: header },
|
|
117114
|
+
signal: AbortSignal.timeout(1e4)
|
|
117115
|
+
});
|
|
117116
|
+
if (!response2.ok && response2.status !== 404)
|
|
117117
|
+
throw new Error(`stream stop failed (${response2.status})`);
|
|
117118
|
+
};
|
|
117119
|
+
if (action === "stop") {
|
|
117120
|
+
await callInBridge(bridge, "SootSim.bridges.videoStream.stop");
|
|
117121
|
+
let record4 = null;
|
|
117122
|
+
try {
|
|
117123
|
+
record4 = recordSchema.parse(JSON.parse((0, import_node_fs142.readFileSync)(file, "utf8")));
|
|
117124
|
+
} catch (error) {
|
|
117125
|
+
if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
|
|
117126
|
+
throw error;
|
|
117127
|
+
}
|
|
117128
|
+
if (record4) await stopSession(record4);
|
|
117129
|
+
(0, import_node_fs142.rmSync)(file, { force: true });
|
|
117130
|
+
console.log(" stream: off");
|
|
117131
|
+
return;
|
|
117132
|
+
}
|
|
117133
|
+
if (state !== "off")
|
|
117134
|
+
throw new Error(
|
|
117135
|
+
"This simulator is already streaming. Use `peach stream stop` first."
|
|
117136
|
+
);
|
|
117137
|
+
const origin = (process.env.PEACH_API_ORIGIN?.trim() || (auth.kind === "session" ? auth.origin : rnxPublicBrand.origin)).replace(/\/+$/, "");
|
|
117138
|
+
const settings = await callInBridge(
|
|
117139
|
+
bridge,
|
|
117140
|
+
"SootSim.bridges.settings.get"
|
|
117141
|
+
);
|
|
117142
|
+
const response = await fetch(new URL("/api/v1/rnx/streams", origin), {
|
|
117143
|
+
method: "POST",
|
|
117144
|
+
headers: { authorization: header, "content-type": "application/json" },
|
|
117145
|
+
body: JSON.stringify({
|
|
117146
|
+
accountId: cloudAccountIdOrExit(auth),
|
|
117147
|
+
device: typeof settings.deviceModel === "string" ? settings.deviceModel : void 0
|
|
117148
|
+
}),
|
|
117149
|
+
signal: AbortSignal.timeout(15e3)
|
|
117150
|
+
});
|
|
117151
|
+
if (!response.ok) throw new Error(`stream registration failed (${response.status})`);
|
|
117152
|
+
const registration = registrationSchema.parse(await response.json());
|
|
117153
|
+
const record3 = {
|
|
117154
|
+
sessionId: registration.session.id,
|
|
117155
|
+
accountId: registration.session.accountId,
|
|
117156
|
+
origin,
|
|
117157
|
+
watchUrl: new URL(registration.session.url, origin).toString()
|
|
117158
|
+
};
|
|
117159
|
+
endSession2 = () => stopSession(record3);
|
|
117160
|
+
await callInBridge(bridge, "SootSim.bridges.videoStream.start", {
|
|
117161
|
+
url: registration.url,
|
|
117162
|
+
token: registration.token
|
|
117163
|
+
});
|
|
117164
|
+
writeSecureJsonAtomic(file, record3);
|
|
117165
|
+
removeRecord = () => (0, import_node_fs142.rmSync)(file, { force: true });
|
|
117166
|
+
console.log(` ${record3.watchUrl}`);
|
|
117167
|
+
console.log(" Press Ctrl+C to stop streaming.");
|
|
117168
|
+
await new Promise((resolve13) => {
|
|
117169
|
+
const finish = () => {
|
|
117170
|
+
watcher.close();
|
|
117171
|
+
process.off("SIGINT", finish);
|
|
117172
|
+
process.off("SIGTERM", finish);
|
|
117173
|
+
resolve13();
|
|
117174
|
+
};
|
|
117175
|
+
const watcher = (0, import_node_fs142.watch)(directory2, (_event, filename) => {
|
|
117176
|
+
if (filename !== `${encodeURIComponent(simId)}.json`) return;
|
|
117177
|
+
try {
|
|
117178
|
+
(0, import_node_fs142.readFileSync)(file);
|
|
117179
|
+
} catch (error) {
|
|
117180
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT")
|
|
117181
|
+
finish();
|
|
117182
|
+
else throw error;
|
|
117183
|
+
}
|
|
117184
|
+
});
|
|
117185
|
+
process.once("SIGINT", finish);
|
|
117186
|
+
process.once("SIGTERM", finish);
|
|
117187
|
+
});
|
|
117188
|
+
} finally {
|
|
117189
|
+
try {
|
|
117190
|
+
if (endSession2) {
|
|
117191
|
+
await callInBridge(bridge, "SootSim.bridges.videoStream.stop").catch(
|
|
117192
|
+
() => void 0
|
|
117193
|
+
);
|
|
117194
|
+
await endSession2();
|
|
117195
|
+
}
|
|
117196
|
+
} finally {
|
|
117197
|
+
removeRecord?.();
|
|
117198
|
+
bridge.close();
|
|
117199
|
+
}
|
|
117200
|
+
}
|
|
117201
|
+
}
|
|
117202
|
+
var import_node_fs142, import_node_path144, import_zod2, STREAM_FLAG, registrationSchema, recordSchema;
|
|
117203
|
+
var init_stream = __esm({
|
|
117204
|
+
"cli/commands/stream.ts"() {
|
|
117205
|
+
"use strict";
|
|
117206
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
117207
|
+
import_node_fs142 = require("node:fs");
|
|
117208
|
+
import_node_path144 = require("node:path");
|
|
117209
|
+
import_zod2 = require("zod");
|
|
117210
|
+
init_home_paths();
|
|
117211
|
+
init_public_brand();
|
|
117212
|
+
init_auth();
|
|
117213
|
+
init_secure_file();
|
|
117214
|
+
init_ws_bridge();
|
|
117215
|
+
STREAM_FLAG = "--stream";
|
|
117216
|
+
registrationSchema = import_zod2.z.object({
|
|
117217
|
+
session: import_zod2.z.object({ id: import_zod2.z.string(), accountId: import_zod2.z.string(), url: import_zod2.z.string() }),
|
|
117218
|
+
url: import_zod2.z.string(),
|
|
117219
|
+
token: import_zod2.z.string()
|
|
117220
|
+
});
|
|
117221
|
+
recordSchema = import_zod2.z.object({
|
|
117222
|
+
sessionId: import_zod2.z.string(),
|
|
117223
|
+
accountId: import_zod2.z.string(),
|
|
117224
|
+
origin: import_zod2.z.string(),
|
|
117225
|
+
watchUrl: import_zod2.z.string()
|
|
117226
|
+
});
|
|
117227
|
+
}
|
|
117228
|
+
});
|
|
117229
|
+
|
|
117069
117230
|
// src/configured-bundle-producer.ts
|
|
117070
117231
|
async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
117071
117232
|
if (!config) return source;
|
|
@@ -117086,14 +117247,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
117086
117247
|
const neededPackages = /* @__PURE__ */ new Set();
|
|
117087
117248
|
const factories = [];
|
|
117088
117249
|
const visit3 = (filePath) => {
|
|
117089
|
-
const real =
|
|
117250
|
+
const real = import_node_fs143.default.realpathSync(filePath);
|
|
117090
117251
|
const previous = files2.get(real);
|
|
117091
117252
|
if (previous !== void 0) return previous;
|
|
117092
117253
|
const id = "peach-config-file:" + files2.size;
|
|
117093
117254
|
files2.set(real, id);
|
|
117094
117255
|
const compiled = compileReplacementModule({
|
|
117095
117256
|
filePath: real,
|
|
117096
|
-
source:
|
|
117257
|
+
source: import_node_fs143.default.readFileSync(real, "utf8"),
|
|
117097
117258
|
runtimePackages,
|
|
117098
117259
|
localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
|
|
117099
117260
|
});
|
|
@@ -117117,7 +117278,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
117117
117278
|
if (!entries || typeof entries !== "object") continue;
|
|
117118
117279
|
for (const resolution of Object.values(entries)) {
|
|
117119
117280
|
if (resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string") {
|
|
117120
|
-
resolution.file = visit3(
|
|
117281
|
+
resolution.file = visit3(import_node_path145.default.resolve(resolution.file));
|
|
117121
117282
|
}
|
|
117122
117283
|
}
|
|
117123
117284
|
}
|
|
@@ -117141,13 +117302,13 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
117141
117302
|
const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
|
|
117142
117303
|
return prefix + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
|
|
117143
117304
|
}
|
|
117144
|
-
var
|
|
117305
|
+
var import_node_fs143, import_node_path145, import_sucrase3, import_terser2, PREFIX_START, PREFIX_END;
|
|
117145
117306
|
var init_configured_bundle_producer = __esm({
|
|
117146
117307
|
"src/configured-bundle-producer.ts"() {
|
|
117147
117308
|
"use strict";
|
|
117148
117309
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
117149
|
-
|
|
117150
|
-
|
|
117310
|
+
import_node_fs143 = __toESM(require("node:fs"), 1);
|
|
117311
|
+
import_node_path145 = __toESM(require("node:path"), 1);
|
|
117151
117312
|
init_bundle_global_footer();
|
|
117152
117313
|
import_sucrase3 = require("sucrase");
|
|
117153
117314
|
import_terser2 = require("terser");
|
|
@@ -117457,9 +117618,9 @@ var init_android_theme = __esm({
|
|
|
117457
117618
|
|
|
117458
117619
|
// src/android-drawables.ts
|
|
117459
117620
|
function readAndroidDrawables(moduleDir, sources) {
|
|
117460
|
-
const res =
|
|
117621
|
+
const res = import_node_path146.default.join(moduleDir, "src/main/res");
|
|
117461
117622
|
const byName = /* @__PURE__ */ new Map();
|
|
117462
|
-
for (const dir of
|
|
117623
|
+
for (const dir of import_node_fs144.default.existsSync(res) ? import_node_fs144.default.readdirSync(res).sort() : []) {
|
|
117463
117624
|
if (!dir.startsWith("drawable")) continue;
|
|
117464
117625
|
const match = DRAWABLE_DIR.exec(dir);
|
|
117465
117626
|
const qualifier = match?.[1];
|
|
@@ -117469,10 +117630,10 @@ function readAndroidDrawables(moduleDir, sources) {
|
|
|
117469
117630
|
`${res}/${dir}: drawables under this qualifier are not resolved by Peach yet`
|
|
117470
117631
|
);
|
|
117471
117632
|
const version2 = Number(match[2] ?? 0);
|
|
117472
|
-
for (const entry of
|
|
117633
|
+
for (const entry of import_node_fs144.default.readdirSync(import_node_path146.default.join(res, dir)).sort()) {
|
|
117473
117634
|
if (!entry.endsWith(".xml") && !BITMAP.test(entry)) continue;
|
|
117474
117635
|
const name3 = entry.replace(BITMAP, "").replace(/\.xml$/, "");
|
|
117475
|
-
const file =
|
|
117636
|
+
const file = import_node_path146.default.join(res, dir, entry);
|
|
117476
117637
|
const files2 = byName.get(name3) ?? [];
|
|
117477
117638
|
byName.set(name3, files2);
|
|
117478
117639
|
if (version2 > DEVICE_API) continue;
|
|
@@ -117485,7 +117646,7 @@ function readAndroidDrawables(moduleDir, sources) {
|
|
|
117485
117646
|
ninePatch: entry.endsWith(".9.png")
|
|
117486
117647
|
});
|
|
117487
117648
|
else {
|
|
117488
|
-
const root = parseXml(
|
|
117649
|
+
const root = parseXml(import_node_fs144.default.readFileSync(file, "utf8"), file).children[0];
|
|
117489
117650
|
files2.push(
|
|
117490
117651
|
root?.name === "vector" ? {
|
|
117491
117652
|
file,
|
|
@@ -117652,13 +117813,13 @@ function readVector(root, file, sources) {
|
|
|
117652
117813
|
calls
|
|
117653
117814
|
};
|
|
117654
117815
|
}
|
|
117655
|
-
var
|
|
117816
|
+
var import_node_fs144, import_node_path146, DEVICE_API, BUCKETS, DRAWABLE_DIR, BITMAP;
|
|
117656
117817
|
var init_android_drawables = __esm({
|
|
117657
117818
|
"src/android-drawables.ts"() {
|
|
117658
117819
|
"use strict";
|
|
117659
117820
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
117660
|
-
|
|
117661
|
-
|
|
117821
|
+
import_node_fs144 = __toESM(require("node:fs"), 1);
|
|
117822
|
+
import_node_path146 = __toESM(require("node:path"), 1);
|
|
117662
117823
|
init_android_theme();
|
|
117663
117824
|
init_android_xml();
|
|
117664
117825
|
DEVICE_API = 37;
|
|
@@ -117680,12 +117841,12 @@ var init_android_drawables = __esm({
|
|
|
117680
117841
|
|
|
117681
117842
|
// src/android-layout-ids.ts
|
|
117682
117843
|
function readAndroidLayoutIds(moduleDir) {
|
|
117683
|
-
const res =
|
|
117844
|
+
const res = import_node_path147.default.join(moduleDir, "src/main/res");
|
|
117684
117845
|
const layouts = /* @__PURE__ */ new Set();
|
|
117685
117846
|
const ids = /* @__PURE__ */ new Set();
|
|
117686
117847
|
const elements = /* @__PURE__ */ new Map();
|
|
117687
|
-
for (const dir of
|
|
117688
|
-
const directory2 =
|
|
117848
|
+
for (const dir of import_node_fs145.default.existsSync(res) ? import_node_fs145.default.readdirSync(res).sort() : []) {
|
|
117849
|
+
const directory2 = import_node_path147.default.join(res, dir);
|
|
117689
117850
|
if (dir === "layout" || dir.startsWith("layout-")) {
|
|
117690
117851
|
const match = LAYOUT_DIR.exec(dir);
|
|
117691
117852
|
if (!match)
|
|
@@ -117695,13 +117856,13 @@ function readAndroidLayoutIds(moduleDir) {
|
|
|
117695
117856
|
const orientation = match[1] === "port" ? 1 : match[1] === "land" ? 2 : 0;
|
|
117696
117857
|
const night = match[2] === "notnight" ? 1 : match[2] === "night" ? 2 : 0;
|
|
117697
117858
|
const version2 = Number(match[3] ?? 0);
|
|
117698
|
-
for (const entry of
|
|
117859
|
+
for (const entry of import_node_fs145.default.readdirSync(directory2).sort()) {
|
|
117699
117860
|
if (!entry.endsWith(".xml")) continue;
|
|
117700
117861
|
const name3 = entry.slice(0, -".xml".length);
|
|
117701
117862
|
layouts.add(name3);
|
|
117702
|
-
const xml =
|
|
117863
|
+
const xml = import_node_fs145.default.readFileSync(import_node_path147.default.join(directory2, entry), "utf8");
|
|
117703
117864
|
for (const reference of xml.matchAll(ID_REFERENCE)) ids.add(reference[1]);
|
|
117704
|
-
const element = parseXml(xml,
|
|
117865
|
+
const element = parseXml(xml, import_node_path147.default.join(directory2, entry)).children[0];
|
|
117705
117866
|
if (!element || version2 > DEVICE_API) continue;
|
|
117706
117867
|
elements.set(name3, [
|
|
117707
117868
|
...elements.get(name3) ?? [],
|
|
@@ -117709,9 +117870,9 @@ function readAndroidLayoutIds(moduleDir) {
|
|
|
117709
117870
|
]);
|
|
117710
117871
|
}
|
|
117711
117872
|
} else if (dir.startsWith("values")) {
|
|
117712
|
-
for (const entry of
|
|
117873
|
+
for (const entry of import_node_fs145.default.readdirSync(directory2).sort()) {
|
|
117713
117874
|
if (!entry.endsWith(".xml")) continue;
|
|
117714
|
-
const xml =
|
|
117875
|
+
const xml = import_node_fs145.default.readFileSync(import_node_path147.default.join(directory2, entry), "utf8");
|
|
117715
117876
|
for (const item of xml.matchAll(ID_ITEM)) {
|
|
117716
117877
|
const name3 = ITEM_NAME.exec(item[0])?.[1];
|
|
117717
117878
|
if (name3) ids.add(name3);
|
|
@@ -117721,13 +117882,13 @@ function readAndroidLayoutIds(moduleDir) {
|
|
|
117721
117882
|
}
|
|
117722
117883
|
return { layouts: [...layouts].sort(), ids: [...ids].sort(), elements };
|
|
117723
117884
|
}
|
|
117724
|
-
var
|
|
117885
|
+
var import_node_fs145, import_node_path147, LAYOUT_DIR, ID_REFERENCE, ID_ITEM, ITEM_NAME;
|
|
117725
117886
|
var init_android_layout_ids = __esm({
|
|
117726
117887
|
"src/android-layout-ids.ts"() {
|
|
117727
117888
|
"use strict";
|
|
117728
117889
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
117729
|
-
|
|
117730
|
-
|
|
117890
|
+
import_node_fs145 = __toESM(require("node:fs"), 1);
|
|
117891
|
+
import_node_path147 = __toESM(require("node:path"), 1);
|
|
117731
117892
|
init_android_drawables();
|
|
117732
117893
|
init_android_xml();
|
|
117733
117894
|
LAYOUT_DIR = /^layout(?:-(port|land))?(?:-(notnight|night))?(?:-v(\d+))?$/;
|
|
@@ -117742,15 +117903,15 @@ function readAndroidStrings(moduleDir) {
|
|
|
117742
117903
|
const strings7 = /* @__PURE__ */ new Map();
|
|
117743
117904
|
const plurals = /* @__PURE__ */ new Map();
|
|
117744
117905
|
const arrays = /* @__PURE__ */ new Map();
|
|
117745
|
-
const res =
|
|
117746
|
-
const dirs =
|
|
117906
|
+
const res = import_node_path148.default.join(moduleDir, "src/main/res");
|
|
117907
|
+
const dirs = import_node_fs146.default.existsSync(res) ? import_node_fs146.default.readdirSync(res).sort() : [];
|
|
117747
117908
|
for (const dir of dirs) {
|
|
117748
117909
|
if (!dir.startsWith("values")) continue;
|
|
117749
117910
|
const qualifier = VALUES_DIR.exec(dir);
|
|
117750
|
-
for (const entry of
|
|
117911
|
+
for (const entry of import_node_fs146.default.readdirSync(import_node_path148.default.join(res, dir)).sort()) {
|
|
117751
117912
|
if (!entry.endsWith(".xml")) continue;
|
|
117752
|
-
const file =
|
|
117753
|
-
const text6 =
|
|
117913
|
+
const file = import_node_path148.default.join(res, dir, entry);
|
|
117914
|
+
const text6 = import_node_fs146.default.readFileSync(file, "utf8").replace(/<!--[\s\S]*?-->/g, "");
|
|
117754
117915
|
for (const match of text6.matchAll(ELEMENT)) {
|
|
117755
117916
|
const kind = match[1] ?? "";
|
|
117756
117917
|
const name3 = NAME.exec(match[2] ?? "")?.[1];
|
|
@@ -117801,13 +117962,13 @@ function compileString(raw2, where) {
|
|
|
117801
117962
|
where
|
|
117802
117963
|
);
|
|
117803
117964
|
}
|
|
117804
|
-
var
|
|
117965
|
+
var import_node_fs146, import_node_path148, VALUES_DIR, ELEMENT, ITEM, NAME, QUANTITY, QUANTITIES, isQuantity, sorted;
|
|
117805
117966
|
var init_android_strings = __esm({
|
|
117806
117967
|
"src/android-strings.ts"() {
|
|
117807
117968
|
"use strict";
|
|
117808
117969
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
117809
|
-
|
|
117810
|
-
|
|
117970
|
+
import_node_fs146 = __toESM(require("node:fs"), 1);
|
|
117971
|
+
import_node_path148 = __toESM(require("node:path"), 1);
|
|
117811
117972
|
init_android_string_value();
|
|
117812
117973
|
init_android_xml();
|
|
117813
117974
|
VALUES_DIR = /^values(?:-([a-z]{2,3})(?:-r([A-Z]{2}))?)?$/;
|
|
@@ -129191,7 +129352,7 @@ function repositories(body, where) {
|
|
|
129191
129352
|
if (name3 === "google") roots.push("https://dl.google.com/dl/android/maven2");
|
|
129192
129353
|
else if (name3 === "mavenCentral") roots.push("https://repo1.maven.org/maven2");
|
|
129193
129354
|
else if (name3 === "mavenLocal")
|
|
129194
|
-
roots.push(
|
|
129355
|
+
roots.push(import_node_path149.default.join(import_node_os26.default.homedir(), ".m2", "repository"));
|
|
129195
129356
|
else {
|
|
129196
129357
|
const declared = direct ?? /["']([^"']+)["']/.exec(block2 ?? "")?.[1];
|
|
129197
129358
|
if (!declared)
|
|
@@ -129206,9 +129367,9 @@ function repositories(body, where) {
|
|
|
129206
129367
|
return roots;
|
|
129207
129368
|
}
|
|
129208
129369
|
function mavenRepositories(projectDir, where) {
|
|
129209
|
-
const file = ["settings.gradle.kts", "settings.gradle"].map((name3) =>
|
|
129370
|
+
const file = ["settings.gradle.kts", "settings.gradle"].map((name3) => import_node_path149.default.join(projectDir, name3)).find((candidate) => import_node_fs147.default.existsSync(candidate));
|
|
129210
129371
|
if (!file) throw new Error(`${where}: ${projectDir} has no settings.gradle`);
|
|
129211
|
-
const text6 =
|
|
129372
|
+
const text6 = import_node_fs147.default.readFileSync(file, "utf8");
|
|
129212
129373
|
const management = text6.search(/\bdependencyResolutionManagement\b/);
|
|
129213
129374
|
if (management < 0)
|
|
129214
129375
|
throw new Error(`${where}: ${file} declares no dependency repositories`);
|
|
@@ -129274,32 +129435,32 @@ function extract(bytes, where) {
|
|
|
129274
129435
|
const cached4 = pending.get(key2);
|
|
129275
129436
|
if (cached4) return cached4;
|
|
129276
129437
|
const request = (async () => {
|
|
129277
|
-
const dest =
|
|
129278
|
-
const marker =
|
|
129279
|
-
if (!
|
|
129438
|
+
const dest = import_node_path149.default.join(import_node_os26.default.tmpdir(), "peach-maven-sources", key2);
|
|
129439
|
+
const marker = import_node_path149.default.join(dest, ".complete");
|
|
129440
|
+
if (!import_node_fs147.default.existsSync(marker)) {
|
|
129280
129441
|
const entries = zipSources(bytes, where);
|
|
129281
129442
|
const java = entries.find((entry) => entry.name.endsWith(".java"));
|
|
129282
129443
|
if (java) throw new Error(`${where}: ${java.name} is a Java source`);
|
|
129283
129444
|
const kotlin = entries.filter((entry) => entry.name.endsWith(".kt"));
|
|
129284
129445
|
if (kotlin.length === 0) throw new Error(`${where}: sources jar has no Kotlin`);
|
|
129285
129446
|
const staging = `${dest}.partial-${process.pid}`;
|
|
129286
|
-
|
|
129447
|
+
import_node_fs147.default.rmSync(staging, { recursive: true, force: true });
|
|
129287
129448
|
for (const entry of kotlin) {
|
|
129288
|
-
const file =
|
|
129289
|
-
|
|
129290
|
-
|
|
129449
|
+
const file = import_node_path149.default.join(staging, entry.name);
|
|
129450
|
+
import_node_fs147.default.mkdirSync(import_node_path149.default.dirname(file), { recursive: true });
|
|
129451
|
+
import_node_fs147.default.writeFileSync(file, entry.data);
|
|
129291
129452
|
}
|
|
129292
|
-
|
|
129453
|
+
import_node_fs147.default.writeFileSync(import_node_path149.default.join(staging, ".complete"), "");
|
|
129293
129454
|
try {
|
|
129294
|
-
|
|
129455
|
+
import_node_fs147.default.renameSync(staging, dest);
|
|
129295
129456
|
} catch (error) {
|
|
129296
|
-
|
|
129297
|
-
if (!
|
|
129457
|
+
import_node_fs147.default.rmSync(staging, { recursive: true, force: true });
|
|
129458
|
+
if (!import_node_fs147.default.existsSync(marker)) throw error;
|
|
129298
129459
|
}
|
|
129299
129460
|
}
|
|
129300
|
-
return
|
|
129461
|
+
return import_node_fs147.default.readdirSync(dest, { recursive: true }).flatMap((entry) => {
|
|
129301
129462
|
const name3 = String(entry);
|
|
129302
|
-
return name3.endsWith(".kt") ? [
|
|
129463
|
+
return name3.endsWith(".kt") ? [import_node_path149.default.join(dest, name3)] : [];
|
|
129303
129464
|
}).sort();
|
|
129304
129465
|
})().catch((error) => {
|
|
129305
129466
|
pending.delete(key2);
|
|
@@ -129322,8 +129483,8 @@ async function sourcesJar(root, group, artifact, version2) {
|
|
|
129322
129483
|
if (!response.ok) throw new Error(`${url} answered ${response.status}`);
|
|
129323
129484
|
return Buffer.from(await response.arrayBuffer());
|
|
129324
129485
|
}
|
|
129325
|
-
const file =
|
|
129326
|
-
return
|
|
129486
|
+
const file = import_node_path149.default.join(root, ...parts);
|
|
129487
|
+
return import_node_fs147.default.existsSync(file) ? import_node_fs147.default.readFileSync(file) : null;
|
|
129327
129488
|
}
|
|
129328
129489
|
async function mavenKotlinSources(projectDir, coordinate, where) {
|
|
129329
129490
|
const { group, artifact, version: version2 } = coordinate;
|
|
@@ -129333,28 +129494,28 @@ async function mavenKotlinSources(projectDir, coordinate, where) {
|
|
|
129333
129494
|
}
|
|
129334
129495
|
return null;
|
|
129335
129496
|
}
|
|
129336
|
-
var import_node_crypto74,
|
|
129497
|
+
var import_node_crypto74, import_node_fs147, import_node_os26, import_node_path149, import_node_zlib4, pending;
|
|
129337
129498
|
var init_kotlin_maven_sources = __esm({
|
|
129338
129499
|
"src/kotlin-maven-sources.ts"() {
|
|
129339
129500
|
"use strict";
|
|
129340
129501
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
129341
129502
|
import_node_crypto74 = require("node:crypto");
|
|
129342
|
-
|
|
129503
|
+
import_node_fs147 = __toESM(require("node:fs"), 1);
|
|
129343
129504
|
import_node_os26 = __toESM(require("node:os"), 1);
|
|
129344
|
-
|
|
129505
|
+
import_node_path149 = __toESM(require("node:path"), 1);
|
|
129345
129506
|
import_node_zlib4 = require("node:zlib");
|
|
129346
129507
|
pending = /* @__PURE__ */ new Map();
|
|
129347
129508
|
}
|
|
129348
129509
|
});
|
|
129349
129510
|
|
|
129350
129511
|
// src/kotlin-version-catalog.ts
|
|
129351
|
-
var
|
|
129512
|
+
var import_node_fs148, import_node_path150, import_smol_toml, accessorName, KotlinVersionCatalog;
|
|
129352
129513
|
var init_kotlin_version_catalog = __esm({
|
|
129353
129514
|
"src/kotlin-version-catalog.ts"() {
|
|
129354
129515
|
"use strict";
|
|
129355
129516
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
129356
|
-
|
|
129357
|
-
|
|
129517
|
+
import_node_fs148 = __toESM(require("node:fs"), 1);
|
|
129518
|
+
import_node_path150 = __toESM(require("node:path"), 1);
|
|
129358
129519
|
import_smol_toml = require("smol-toml");
|
|
129359
129520
|
init_is_record();
|
|
129360
129521
|
accessorName = (name3) => name3.replace(/[-_.]/g, ".");
|
|
@@ -129362,8 +129523,8 @@ var init_kotlin_version_catalog = __esm({
|
|
|
129362
129523
|
file;
|
|
129363
129524
|
tables;
|
|
129364
129525
|
constructor(projectDir) {
|
|
129365
|
-
this.file =
|
|
129366
|
-
this.tables =
|
|
129526
|
+
this.file = import_node_path150.default.join(projectDir, "gradle/libs.versions.toml");
|
|
129527
|
+
this.tables = import_node_fs148.default.existsSync(this.file) ? (0, import_smol_toml.parse)(import_node_fs148.default.readFileSync(this.file, "utf8")) : {};
|
|
129367
129528
|
}
|
|
129368
129529
|
entry(section, accessor, where) {
|
|
129369
129530
|
const table = this.tables[section];
|
|
@@ -129421,7 +129582,7 @@ __export(kotlin_app_exports, {
|
|
|
129421
129582
|
});
|
|
129422
129583
|
function readAndroidPins(moduleRoot) {
|
|
129423
129584
|
const toolchain = JSON.parse(
|
|
129424
|
-
|
|
129585
|
+
import_node_fs149.default.readFileSync(import_node_path151.default.join(moduleRoot, "toolchain.json"), "utf8")
|
|
129425
129586
|
);
|
|
129426
129587
|
if (!isRecord(toolchain))
|
|
129427
129588
|
throw new Error("peachsim kotlin/toolchain.json is not an object");
|
|
@@ -129462,8 +129623,8 @@ function readAndroidPins(moduleRoot) {
|
|
|
129462
129623
|
}
|
|
129463
129624
|
function readGradle(dir) {
|
|
129464
129625
|
for (const name3 of ["build.gradle.kts", "build.gradle"]) {
|
|
129465
|
-
const file =
|
|
129466
|
-
if (
|
|
129626
|
+
const file = import_node_path151.default.join(dir, name3);
|
|
129627
|
+
if (import_node_fs149.default.existsSync(file)) return { file, text: import_node_fs149.default.readFileSync(file, "utf8") };
|
|
129467
129628
|
}
|
|
129468
129629
|
return null;
|
|
129469
129630
|
}
|
|
@@ -129660,15 +129821,15 @@ function themeSources(moduleDir, night) {
|
|
|
129660
129821
|
} : { android, app: read("values") };
|
|
129661
129822
|
}
|
|
129662
129823
|
function valuesFiles(moduleDir, qualifier) {
|
|
129663
|
-
const values =
|
|
129664
|
-
return
|
|
129665
|
-
const file =
|
|
129666
|
-
return { file, text:
|
|
129824
|
+
const values = import_node_path151.default.join(moduleDir, "src/main/res", qualifier);
|
|
129825
|
+
return import_node_fs149.default.existsSync(values) ? import_node_fs149.default.readdirSync(values).filter((entry) => entry.endsWith(".xml")).map((entry) => {
|
|
129826
|
+
const file = import_node_path151.default.join(values, entry);
|
|
129827
|
+
return { file, text: import_node_fs149.default.readFileSync(file, "utf8") };
|
|
129667
129828
|
}) : [];
|
|
129668
129829
|
}
|
|
129669
129830
|
function readAppColors(moduleDir, theme) {
|
|
129670
|
-
const res =
|
|
129671
|
-
for (const dir of
|
|
129831
|
+
const res = import_node_path151.default.join(moduleDir, "src/main/res");
|
|
129832
|
+
for (const dir of import_node_fs149.default.existsSync(res) ? import_node_fs149.default.readdirSync(res).sort() : []) {
|
|
129672
129833
|
if (!dir.startsWith("values") || dir === "values" || dir === "values-night") continue;
|
|
129673
129834
|
const colors = Object.keys(readResourceValues(valuesFiles(moduleDir, dir)).colors);
|
|
129674
129835
|
if (colors.length > 0)
|
|
@@ -129740,17 +129901,17 @@ function isLauncher(element) {
|
|
|
129740
129901
|
);
|
|
129741
129902
|
}
|
|
129742
129903
|
async function readKotlinApp(moduleArg, options) {
|
|
129743
|
-
const moduleDir =
|
|
129744
|
-
const manifestFile =
|
|
129745
|
-
if (!
|
|
129904
|
+
const moduleDir = import_node_fs149.default.realpathSync(import_node_path151.default.resolve(moduleArg));
|
|
129905
|
+
const manifestFile = import_node_path151.default.join(moduleDir, "src/main/AndroidManifest.xml");
|
|
129906
|
+
if (!import_node_fs149.default.existsSync(manifestFile))
|
|
129746
129907
|
throw new Error(
|
|
129747
129908
|
`${moduleDir} is not an Android app module: no src/main/AndroidManifest.xml`
|
|
129748
129909
|
);
|
|
129749
129910
|
let projectDir = moduleDir;
|
|
129750
129911
|
while (!["settings.gradle.kts", "settings.gradle"].some(
|
|
129751
|
-
(name3) =>
|
|
129912
|
+
(name3) => import_node_fs149.default.existsSync(import_node_path151.default.join(projectDir, name3))
|
|
129752
129913
|
)) {
|
|
129753
|
-
const parent =
|
|
129914
|
+
const parent = import_node_path151.default.dirname(projectDir);
|
|
129754
129915
|
if (parent === projectDir)
|
|
129755
129916
|
throw new Error(`${moduleDir} has no settings.gradle above it`);
|
|
129756
129917
|
projectDir = parent;
|
|
@@ -129792,7 +129953,7 @@ async function readKotlinApp(moduleArg, options) {
|
|
|
129792
129953
|
const language = /^(\d+)\.(\d+)/.exec(kotlin)?.slice(1, 3).join(".");
|
|
129793
129954
|
if (!language)
|
|
129794
129955
|
throw new Error(`Kotlin plugin version ${kotlin} names no language version`);
|
|
129795
|
-
const manifest = parseXml(
|
|
129956
|
+
const manifest = parseXml(import_node_fs149.default.readFileSync(manifestFile, "utf8"), manifestFile);
|
|
129796
129957
|
const root = manifest.children.find((element) => element.name === "manifest");
|
|
129797
129958
|
const application = root?.children.find((element) => element.name === "application");
|
|
129798
129959
|
if (!root || !application) throw new Error(`${manifestFile} has no <application>`);
|
|
@@ -129886,11 +130047,11 @@ async function readKotlinApp(moduleArg, options) {
|
|
|
129886
130047
|
const sources = selected ? selected.kotlin : [];
|
|
129887
130048
|
if (!selected)
|
|
129888
130049
|
for (const set2 of ["java", "kotlin"]) {
|
|
129889
|
-
const dir =
|
|
129890
|
-
if (!
|
|
130050
|
+
const dir = import_node_path151.default.join(moduleDir, "src/main", set2);
|
|
130051
|
+
if (!import_node_fs149.default.existsSync(dir)) continue;
|
|
129891
130052
|
const walk3 = (current2) => {
|
|
129892
|
-
for (const entry of
|
|
129893
|
-
const full =
|
|
130053
|
+
for (const entry of import_node_fs149.default.readdirSync(current2, { withFileTypes: true })) {
|
|
130054
|
+
const full = import_node_path151.default.join(current2, entry.name);
|
|
129894
130055
|
if (entry.isDirectory()) walk3(full);
|
|
129895
130056
|
else if (entry.name.endsWith(".java"))
|
|
129896
130057
|
throw new Error(`${full}: Java sources are not supported by peach open`);
|
|
@@ -129935,13 +130096,13 @@ async function readKotlinApp(moduleArg, options) {
|
|
|
129935
130096
|
layoutIds: readAndroidLayoutIds(moduleDir)
|
|
129936
130097
|
};
|
|
129937
130098
|
}
|
|
129938
|
-
var
|
|
130099
|
+
var import_node_fs149, import_node_path151, ANDROID_NS, MAIN, LAUNCHER, PLUGINS, PLATFORM_GROUPS, PLATFORM_ARTIFACTS, ANDROID_PIN;
|
|
129939
130100
|
var init_kotlin_app = __esm({
|
|
129940
130101
|
"src/kotlin-app.ts"() {
|
|
129941
130102
|
"use strict";
|
|
129942
130103
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
129943
|
-
|
|
129944
|
-
|
|
130104
|
+
import_node_fs149 = __toESM(require("node:fs"), 1);
|
|
130105
|
+
import_node_path151 = __toESM(require("node:path"), 1);
|
|
129945
130106
|
init_android_drawables();
|
|
129946
130107
|
init_android_layout_ids();
|
|
129947
130108
|
init_android_strings();
|
|
@@ -129993,24 +130154,24 @@ __export(native_input_exports, {
|
|
|
129993
130154
|
});
|
|
129994
130155
|
function resolveNativeInput(target) {
|
|
129995
130156
|
if (!target || /^\w+:\/\//.test(target) || /^\d+$/.test(target)) return null;
|
|
129996
|
-
const resolved =
|
|
129997
|
-
const stat2 =
|
|
130157
|
+
const resolved = import_node_path152.default.resolve(target);
|
|
130158
|
+
const stat2 = import_node_fs150.default.statSync(resolved, { throwIfNoEntry: false });
|
|
129998
130159
|
if (!stat2) return null;
|
|
129999
130160
|
if (stat2.isFile()) {
|
|
130000
|
-
if (resolved.endsWith(".swift") &&
|
|
130001
|
-
return { kind: "swift-file", path:
|
|
130002
|
-
if (
|
|
130003
|
-
return { kind: "swift-package", path:
|
|
130161
|
+
if (resolved.endsWith(".swift") && import_node_path152.default.basename(resolved) !== "Package.swift")
|
|
130162
|
+
return { kind: "swift-file", path: import_node_fs150.default.realpathSync(resolved) };
|
|
130163
|
+
if (import_node_path152.default.basename(resolved) === "Package.swift")
|
|
130164
|
+
return { kind: "swift-package", path: import_node_fs150.default.realpathSync(import_node_path152.default.dirname(resolved)) };
|
|
130004
130165
|
return null;
|
|
130005
130166
|
}
|
|
130006
130167
|
if (!stat2.isDirectory()) return null;
|
|
130007
|
-
if (
|
|
130008
|
-
return { kind: "swift-package", path:
|
|
130168
|
+
if (import_node_fs150.default.existsSync(import_node_path152.default.join(resolved, "Package.swift")))
|
|
130169
|
+
return { kind: "swift-package", path: import_node_fs150.default.realpathSync(resolved) };
|
|
130009
130170
|
const xcode = findXcodeProject(resolved);
|
|
130010
|
-
if (xcode) return { kind: "xcode", path:
|
|
130011
|
-
if (
|
|
130012
|
-
return { kind: "kotlin", path:
|
|
130013
|
-
if (!
|
|
130171
|
+
if (xcode) return { kind: "xcode", path: import_node_fs150.default.realpathSync(xcode) };
|
|
130172
|
+
if (import_node_fs150.default.existsSync(import_node_path152.default.join(resolved, "src/main/AndroidManifest.xml")))
|
|
130173
|
+
return { kind: "kotlin", path: import_node_fs150.default.realpathSync(resolved) };
|
|
130174
|
+
if (!import_node_fs150.default.existsSync(import_node_path152.default.join(resolved, "package.json")) && import_node_fs150.default.readdirSync(resolved).some((name3) => name3.endsWith(".swift")))
|
|
130014
130175
|
throw new Error(
|
|
130015
130176
|
`${target} holds Swift files but no Package.swift or Xcode project; open one .swift file, a Swift package, or an Xcode project`
|
|
130016
130177
|
);
|
|
@@ -130039,7 +130200,7 @@ async function prepareSwiftInput(input, opts = {}) {
|
|
|
130039
130200
|
module2?.root,
|
|
130040
130201
|
run14?.configuration
|
|
130041
130202
|
) : input.path;
|
|
130042
|
-
const name3 = input.kind === "swift-file" ?
|
|
130203
|
+
const name3 = input.kind === "swift-file" ? import_node_path152.default.basename(input.path, ".swift") : import_node_path152.default.basename(packagePath);
|
|
130043
130204
|
const appProject = resolveAppProject(packagePath);
|
|
130044
130205
|
let appInfo;
|
|
130045
130206
|
try {
|
|
@@ -130094,7 +130255,7 @@ async function prepareNativeInput(input, opts) {
|
|
|
130094
130255
|
const metadata = await host2.kotlinAppArtifact(project2, moduleRoot, opts.origin);
|
|
130095
130256
|
const prefix = new URL(metadata.url).pathname.slice(0, -"app.mjs".length);
|
|
130096
130257
|
return {
|
|
130097
|
-
name:
|
|
130258
|
+
name: import_node_path152.default.basename(project2.projectDir),
|
|
130098
130259
|
guestSource: kotlinGuestBundle(),
|
|
130099
130260
|
guestPath: KOTLIN_GUEST_PATH,
|
|
130100
130261
|
metadataPath: host2.KOTLIN_PACKAGE_PATH,
|
|
@@ -130129,13 +130290,13 @@ async function prepareNativeInput(input, opts) {
|
|
|
130129
130290
|
throw error;
|
|
130130
130291
|
}
|
|
130131
130292
|
}
|
|
130132
|
-
var
|
|
130293
|
+
var import_node_fs150, import_node_path152;
|
|
130133
130294
|
var init_native_input = __esm({
|
|
130134
130295
|
"cli/native-input.ts"() {
|
|
130135
130296
|
"use strict";
|
|
130136
130297
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
130137
|
-
|
|
130138
|
-
|
|
130298
|
+
import_node_fs150 = __toESM(require("node:fs"), 1);
|
|
130299
|
+
import_node_path152 = __toESM(require("node:path"), 1);
|
|
130139
130300
|
init_configured_bundle_producer();
|
|
130140
130301
|
init_guest_bundle();
|
|
130141
130302
|
init_kotlinDiscoveryContract();
|
|
@@ -130273,7 +130434,7 @@ async function runKotlin(args, opts = {}) {
|
|
|
130273
130434
|
throw new Error(`unknown peach open flag for an Android app: ${arg}`);
|
|
130274
130435
|
else if (modulePath)
|
|
130275
130436
|
throw new Error("peach open expects one Android app module directory");
|
|
130276
|
-
else modulePath =
|
|
130437
|
+
else modulePath = import_node_path153.default.resolve(arg);
|
|
130277
130438
|
}
|
|
130278
130439
|
if (!modulePath) throw new Error("usage: peach open <android-app-module>");
|
|
130279
130440
|
const device = opts.device ?? opts.openArgs?.find((_, index) => opts.openArgs?.[index - 1] === "--device") ?? DEFAULT_DEVICE_BY_PLATFORM.android;
|
|
@@ -130296,7 +130457,7 @@ async function runKotlin(args, opts = {}) {
|
|
|
130296
130457
|
let origin = "";
|
|
130297
130458
|
let artifact;
|
|
130298
130459
|
let compileError = "Kotlin compilation is starting";
|
|
130299
|
-
const projectName =
|
|
130460
|
+
const projectName = import_node_path153.default.basename(project2.projectDir);
|
|
130300
130461
|
const routes2 = () => ({
|
|
130301
130462
|
root: project2.projectDir,
|
|
130302
130463
|
moduleRoot,
|
|
@@ -130421,7 +130582,7 @@ async function runKotlin(args, opts = {}) {
|
|
|
130421
130582
|
});
|
|
130422
130583
|
console.log(` Kotlin app: ${project2.launcher.name} in ${project2.moduleDir}`);
|
|
130423
130584
|
console.log(` Kotlin preview host: ${origin}`);
|
|
130424
|
-
watcher =
|
|
130585
|
+
watcher = import_node_fs151.default.watch(project2.projectDir, { recursive: true }, (_event, file) => {
|
|
130425
130586
|
if (file && file.split(/[\\/]/).some((segment) => segment === "build" || segment.startsWith(".")))
|
|
130426
130587
|
return;
|
|
130427
130588
|
void rebuild();
|
|
@@ -130476,14 +130637,14 @@ async function runKotlin(args, opts = {}) {
|
|
|
130476
130637
|
}
|
|
130477
130638
|
return code;
|
|
130478
130639
|
}
|
|
130479
|
-
var
|
|
130640
|
+
var import_node_fs151, import_node_http3, import_node_path153, import_ws5, HMR_PATH;
|
|
130480
130641
|
var init_kotlin = __esm({
|
|
130481
130642
|
"cli/commands/kotlin.ts"() {
|
|
130482
130643
|
"use strict";
|
|
130483
130644
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
130484
|
-
|
|
130645
|
+
import_node_fs151 = __toESM(require("node:fs"), 1);
|
|
130485
130646
|
import_node_http3 = __toESM(require("node:http"), 1);
|
|
130486
|
-
|
|
130647
|
+
import_node_path153 = __toESM(require("node:path"), 1);
|
|
130487
130648
|
import_ws5 = require("ws");
|
|
130488
130649
|
init_device_catalog();
|
|
130489
130650
|
init_guest_bundle();
|
|
@@ -130540,7 +130701,7 @@ async function runSwift(args, opts = {}) {
|
|
|
130540
130701
|
const value = input[++index];
|
|
130541
130702
|
if (!value || value.startsWith("-"))
|
|
130542
130703
|
throw new Error("--swift-sdks-path requires a value");
|
|
130543
|
-
process.env.PEACH_SWIFT_SDKS_PATH =
|
|
130704
|
+
process.env.PEACH_SWIFT_SDKS_PATH = import_node_path154.default.resolve(value);
|
|
130544
130705
|
} else if (arg === "--host-port" || valueFlags.has(arg)) {
|
|
130545
130706
|
const value = input[++index];
|
|
130546
130707
|
if (!value || value.startsWith("-")) throw new Error(`${arg} requires a value`);
|
|
@@ -130554,7 +130715,7 @@ async function runSwift(args, opts = {}) {
|
|
|
130554
130715
|
else if (arg.startsWith("-"))
|
|
130555
130716
|
throw new Error(`unknown peach open flag for a Swift app: ${arg}`);
|
|
130556
130717
|
else if (packagePath) throw new Error("peach open expects one project");
|
|
130557
|
-
else packagePath =
|
|
130718
|
+
else packagePath = import_node_path154.default.resolve(arg);
|
|
130558
130719
|
}
|
|
130559
130720
|
if (!packagePath) {
|
|
130560
130721
|
throw new Error(
|
|
@@ -130729,7 +130890,7 @@ async function runSwift(args, opts = {}) {
|
|
|
130729
130890
|
code = 1;
|
|
130730
130891
|
stop();
|
|
130731
130892
|
});
|
|
130732
|
-
watcher =
|
|
130893
|
+
watcher = import_node_fs152.default.watch(
|
|
130733
130894
|
nativeInput.kind === "swift-file" ? nativeInput.path : packagePath,
|
|
130734
130895
|
{ recursive: nativeInput.kind !== "swift-file" },
|
|
130735
130896
|
(_event, file) => {
|
|
@@ -130797,14 +130958,14 @@ async function runSwift(args, opts = {}) {
|
|
|
130797
130958
|
}
|
|
130798
130959
|
return code;
|
|
130799
130960
|
}
|
|
130800
|
-
var
|
|
130961
|
+
var import_node_fs152, import_node_http4, import_node_path154, import_ws6;
|
|
130801
130962
|
var init_swift = __esm({
|
|
130802
130963
|
"cli/commands/swift.ts"() {
|
|
130803
130964
|
"use strict";
|
|
130804
130965
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
130805
|
-
|
|
130966
|
+
import_node_fs152 = __toESM(require("node:fs"), 1);
|
|
130806
130967
|
import_node_http4 = __toESM(require("node:http"), 1);
|
|
130807
|
-
|
|
130968
|
+
import_node_path154 = __toESM(require("node:path"), 1);
|
|
130808
130969
|
import_ws6 = require("ws");
|
|
130809
130970
|
init_backend_origin();
|
|
130810
130971
|
init_swift_submit();
|
|
@@ -131014,11 +131175,11 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
131014
131175
|
);
|
|
131015
131176
|
}
|
|
131016
131177
|
const { executable, prefixArgs } = rnxSelfInvocation();
|
|
131017
|
-
const bridgeLogPath =
|
|
131178
|
+
const bridgeLogPath = import_node_path155.default.join(
|
|
131018
131179
|
import_node_os27.default.tmpdir(),
|
|
131019
131180
|
`peach-bridge-${Date.now()}-${process.pid}.log`
|
|
131020
131181
|
);
|
|
131021
|
-
const bridgeLogFd =
|
|
131182
|
+
const bridgeLogFd = import_node_fs153.default.openSync(bridgeLogPath, "a");
|
|
131022
131183
|
let child;
|
|
131023
131184
|
try {
|
|
131024
131185
|
child = (0, import_node_child_process62.spawn)(
|
|
@@ -131032,7 +131193,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
131032
131193
|
}
|
|
131033
131194
|
);
|
|
131034
131195
|
} finally {
|
|
131035
|
-
|
|
131196
|
+
import_node_fs153.default.closeSync(bridgeLogFd);
|
|
131036
131197
|
}
|
|
131037
131198
|
if (resources) {
|
|
131038
131199
|
resources.bridge = child;
|
|
@@ -131074,7 +131235,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
131074
131235
|
await sleep2(Math.max(0, Math.min(150, deadline - Date.now())));
|
|
131075
131236
|
}
|
|
131076
131237
|
const reason = childExit ? `peach bridge exited before becoming ready (exit ${childExit})` : `peach bridge did not start within ${Math.round(OPEN_BRIDGE_SPAWN_TIMEOUT_MS / 1e3)}s`;
|
|
131077
|
-
const bridgeLog =
|
|
131238
|
+
const bridgeLog = import_node_fs153.default.readFileSync(bridgeLogPath, "utf8").trim().slice(-2e3);
|
|
131078
131239
|
throw new Error(
|
|
131079
131240
|
`${reason}${bridgeLog ? `
|
|
131080
131241
|
${bridgeLog}` : ""}
|
|
@@ -131086,8 +131247,8 @@ async function retireOutdatedIdleBridge(lock) {
|
|
|
131086
131247
|
const current2 = getCliVersion();
|
|
131087
131248
|
if (isSootsimDevCheckout() || lock.cliVersion === current2) return;
|
|
131088
131249
|
if (lock.cliVersion && compareSemver(current2, lock.cliVersion) <= 0) return;
|
|
131089
|
-
const appRecord =
|
|
131090
|
-
if (
|
|
131250
|
+
const appRecord = import_node_path155.default.join(rnxHomeDir(), "app-runtime.json");
|
|
131251
|
+
if (import_node_fs153.default.existsSync(appRecord)) return;
|
|
131091
131252
|
const bridge = createBridge(lock.bridgePort, { commandTimeoutMs: 2e3 });
|
|
131092
131253
|
const simCount = await bridge.listSims({ includeRetained: true }).then(
|
|
131093
131254
|
(sims) => sims.length,
|
|
@@ -131113,31 +131274,31 @@ function isolateHomeForExplicitPort(preferredPort, explicitPort, lock) {
|
|
|
131113
131274
|
return;
|
|
131114
131275
|
}
|
|
131115
131276
|
const sharedRuntimes = runtimesDir();
|
|
131116
|
-
const home =
|
|
131277
|
+
const home = import_node_path155.default.join(rnxHomeDir(), "port-homes", String(preferredPort));
|
|
131117
131278
|
activatePeachHome(home);
|
|
131118
|
-
const runtimes =
|
|
131279
|
+
const runtimes = import_node_path155.default.join(home, "runtimes");
|
|
131119
131280
|
if (resolveDevCheckoutRuntimeRoot()) {
|
|
131120
131281
|
removePortHomeSharedRuntimesLink(runtimes, sharedRuntimes);
|
|
131121
|
-
} else if (
|
|
131122
|
-
|
|
131282
|
+
} else if (import_node_fs153.default.existsSync(sharedRuntimes) && !import_node_fs153.default.existsSync(runtimes)) {
|
|
131283
|
+
import_node_fs153.default.symlinkSync(sharedRuntimes, runtimes);
|
|
131123
131284
|
}
|
|
131124
131285
|
process.env[PEACH_HOME_ENV] = home;
|
|
131125
131286
|
}
|
|
131126
131287
|
function removePortHomeSharedRuntimesLink(runtimes, sharedRuntimes) {
|
|
131127
131288
|
let stat2;
|
|
131128
131289
|
try {
|
|
131129
|
-
stat2 =
|
|
131290
|
+
stat2 = import_node_fs153.default.lstatSync(runtimes);
|
|
131130
131291
|
} catch {
|
|
131131
131292
|
return;
|
|
131132
131293
|
}
|
|
131133
131294
|
if (!stat2.isSymbolicLink()) return;
|
|
131134
131295
|
let target;
|
|
131135
131296
|
try {
|
|
131136
|
-
target =
|
|
131297
|
+
target = import_node_path155.default.resolve(import_node_path155.default.dirname(runtimes), import_node_fs153.default.readlinkSync(runtimes));
|
|
131137
131298
|
} catch {
|
|
131138
131299
|
return;
|
|
131139
131300
|
}
|
|
131140
|
-
if (target === sharedRuntimes)
|
|
131301
|
+
if (target === sharedRuntimes) import_node_fs153.default.unlinkSync(runtimes);
|
|
131141
131302
|
}
|
|
131142
131303
|
async function ensureRuntimeForOpen() {
|
|
131143
131304
|
if (resolveDevCheckoutRuntimeRoot()) return;
|
|
@@ -131147,12 +131308,12 @@ async function ensureRuntimeForOpen() {
|
|
|
131147
131308
|
);
|
|
131148
131309
|
}
|
|
131149
131310
|
const active = readActiveRuntime();
|
|
131150
|
-
if (active &&
|
|
131311
|
+
if (active && import_node_fs153.default.existsSync(import_node_path155.default.join(runtimeDir(active), "index.html"))) {
|
|
131151
131312
|
await ensureCliCompanion(runtimeDir(active));
|
|
131152
131313
|
return;
|
|
131153
131314
|
}
|
|
131154
131315
|
const directory2 = runtimesDir();
|
|
131155
|
-
if (
|
|
131316
|
+
if (import_node_fs153.default.existsSync(directory2) && import_node_fs153.default.readdirSync(directory2).length > 0) {
|
|
131156
131317
|
throw new Error(
|
|
131157
131318
|
"peach open: runtime staging or selection is incomplete. finish staging and select the runtime with peach runtime use <version> before opening."
|
|
131158
131319
|
);
|
|
@@ -131238,11 +131399,11 @@ async function readSimDevice(bridge, simId) {
|
|
|
131238
131399
|
}
|
|
131239
131400
|
function prebuiltBundleFile(target) {
|
|
131240
131401
|
if (!/\.(js|bundle|jsbundle)$/i.test(target)) return null;
|
|
131241
|
-
const file =
|
|
131242
|
-
return
|
|
131402
|
+
const file = import_node_path155.default.resolve(process.cwd(), target);
|
|
131403
|
+
return import_node_fs153.default.statSync(file, { throwIfNoEntry: false })?.isFile() ? file : null;
|
|
131243
131404
|
}
|
|
131244
131405
|
async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
|
|
131245
|
-
const bytes =
|
|
131406
|
+
const bytes = import_node_fs153.default.readFileSync(file);
|
|
131246
131407
|
const source = bytes.toString("utf8");
|
|
131247
131408
|
const mode = await detectBundleModeFromText(source);
|
|
131248
131409
|
if (!mode) {
|
|
@@ -131260,7 +131421,7 @@ async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
|
|
|
131260
131421
|
stageHostBytes(
|
|
131261
131422
|
prepared === source ? bytes : Buffer.from(prepared, "utf8"),
|
|
131262
131423
|
`http://127.0.0.1:${bridgePort}`,
|
|
131263
|
-
|
|
131424
|
+
import_node_path155.default.extname(file)
|
|
131264
131425
|
)
|
|
131265
131426
|
);
|
|
131266
131427
|
url.searchParams.set("dev", String(mode === "development"));
|
|
@@ -131268,10 +131429,10 @@ async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
|
|
|
131268
131429
|
}
|
|
131269
131430
|
function normalizeReplacementPath(filePath) {
|
|
131270
131431
|
if (filePath.startsWith("~/")) {
|
|
131271
|
-
return
|
|
131432
|
+
return import_node_path155.default.join(import_node_os27.default.homedir(), filePath.slice(2));
|
|
131272
131433
|
}
|
|
131273
|
-
if (
|
|
131274
|
-
return
|
|
131434
|
+
if (import_node_path155.default.isAbsolute(filePath)) return filePath;
|
|
131435
|
+
return import_node_path155.default.resolve(process.cwd(), filePath);
|
|
131275
131436
|
}
|
|
131276
131437
|
function parseOpenRuntimeConfig(args) {
|
|
131277
131438
|
const modules = {};
|
|
@@ -131290,7 +131451,7 @@ function parseOpenRuntimeConfig(args) {
|
|
|
131290
131451
|
}
|
|
131291
131452
|
const moduleName2 = raw2.slice(0, eqIndex).trim();
|
|
131292
131453
|
const filePath = normalizeReplacementPath(raw2.slice(eqIndex + 1).trim());
|
|
131293
|
-
if (!
|
|
131454
|
+
if (!import_node_fs153.default.existsSync(filePath)) {
|
|
131294
131455
|
console.error(` peach open: replacement file not found: ${filePath}`);
|
|
131295
131456
|
peachExit(1);
|
|
131296
131457
|
}
|
|
@@ -131316,7 +131477,7 @@ function parseOpenRuntimeConfig(args) {
|
|
|
131316
131477
|
return config.modules || config.network ? config : void 0;
|
|
131317
131478
|
}
|
|
131318
131479
|
async function ensureConfiguredRuntime(version2) {
|
|
131319
|
-
if (
|
|
131480
|
+
if (import_node_fs153.default.existsSync(import_node_path155.default.join(runtimeDir(version2), "index.html"))) return;
|
|
131320
131481
|
console.error(` installing configured engine runtime ${version2}...`);
|
|
131321
131482
|
const result = await rnxRuntime.install({
|
|
131322
131483
|
version: version2,
|
|
@@ -131396,7 +131557,7 @@ async function waitForSimMatchOrHostExit(wsPort, commandTimeoutMs, predicate, ho
|
|
|
131396
131557
|
const watchHost = !!hostPid && Number.isInteger(hostPid) && hostPid > 1;
|
|
131397
131558
|
const hostExited = () => watchHost && hostPid !== void 0 && !isProcessRunning(hostPid);
|
|
131398
131559
|
if (opts.admittedFile && watchHost) {
|
|
131399
|
-
while (!
|
|
131560
|
+
while (!import_node_fs153.default.existsSync(opts.admittedFile)) {
|
|
131400
131561
|
opts.signal?.throwIfAborted();
|
|
131401
131562
|
if (hostExited()) return { kind: "host-exit" };
|
|
131402
131563
|
await sleep2(intervalMs);
|
|
@@ -131456,7 +131617,7 @@ function playwrightHostPidForSim(sim) {
|
|
|
131456
131617
|
function signalDriverLaunchConnected(result) {
|
|
131457
131618
|
if (!result.connectAckFile) return false;
|
|
131458
131619
|
try {
|
|
131459
|
-
|
|
131620
|
+
import_node_fs153.default.writeFileSync(
|
|
131460
131621
|
result.connectAckFile,
|
|
131461
131622
|
`${JSON.stringify({ connectedAt: Date.now(), pid: result.pid ?? null })}
|
|
131462
131623
|
`,
|
|
@@ -131470,7 +131631,7 @@ function signalDriverLaunchConnected(result) {
|
|
|
131470
131631
|
function readUnservedUrl(result) {
|
|
131471
131632
|
if (!result.diagnosticLogPath) return null;
|
|
131472
131633
|
try {
|
|
131473
|
-
const detail =
|
|
131634
|
+
const detail = import_node_fs153.default.readFileSync(result.diagnosticLogPath, "utf8");
|
|
131474
131635
|
const match = detail.match(/\[unserved\] nothing serves (\S+)/);
|
|
131475
131636
|
return match ? match[1] : null;
|
|
131476
131637
|
} catch {
|
|
@@ -131480,14 +131641,14 @@ function readUnservedUrl(result) {
|
|
|
131480
131641
|
function printDriverDiagnosticLogTail(result) {
|
|
131481
131642
|
if (!result.diagnosticLogPath) return;
|
|
131482
131643
|
try {
|
|
131483
|
-
const detail =
|
|
131644
|
+
const detail = import_node_fs153.default.readFileSync(result.diagnosticLogPath, "utf8").trim();
|
|
131484
131645
|
if (!detail) {
|
|
131485
|
-
console.error(` ${
|
|
131646
|
+
console.error(` ${import_node_path155.default.basename(result.diagnosticLogPath)} was empty`);
|
|
131486
131647
|
return;
|
|
131487
131648
|
}
|
|
131488
131649
|
const shown = detail.length > 4e3 ? `\u2026
|
|
131489
131650
|
${detail.slice(-4e3)}` : detail;
|
|
131490
|
-
console.error(` ${
|
|
131651
|
+
console.error(` ${import_node_path155.default.basename(result.diagnosticLogPath)}:`);
|
|
131491
131652
|
console.error(shown);
|
|
131492
131653
|
if (/No usable sandbox/i.test(detail)) {
|
|
131493
131654
|
console.error(
|
|
@@ -131497,7 +131658,7 @@ ${detail.slice(-4e3)}` : detail;
|
|
|
131497
131658
|
} catch (err) {
|
|
131498
131659
|
const message = err instanceof Error ? err.message : String(err);
|
|
131499
131660
|
console.error(
|
|
131500
|
-
` failed to read ${
|
|
131661
|
+
` failed to read ${import_node_path155.default.basename(result.diagnosticLogPath)}: ${message}`
|
|
131501
131662
|
);
|
|
131502
131663
|
}
|
|
131503
131664
|
}
|
|
@@ -131512,7 +131673,7 @@ async function waitForProcessExit(pid, timeoutMs = 2500) {
|
|
|
131512
131673
|
function isPlaywrightHostProcess(pid) {
|
|
131513
131674
|
if (process.platform === "linux") {
|
|
131514
131675
|
try {
|
|
131515
|
-
return
|
|
131676
|
+
return import_node_fs153.default.readFileSync(`/proc/${pid}/environ`, "utf8").split("\0").some((entry) => entry.startsWith("SOOTSIM_PW_URL="));
|
|
131516
131677
|
} catch {
|
|
131517
131678
|
return false;
|
|
131518
131679
|
}
|
|
@@ -131727,6 +131888,18 @@ async function dispatchAppLink(parsed, liveSettings = {}) {
|
|
|
131727
131888
|
}
|
|
131728
131889
|
}
|
|
131729
131890
|
async function runOpenCommand(args, opts = {}) {
|
|
131891
|
+
const { STREAM_FLAG: STREAM_FLAG2, runStreamCommand: runStreamCommand2 } = await Promise.resolve().then(() => (init_stream(), stream_exports));
|
|
131892
|
+
if (args.includes(STREAM_FLAG2)) {
|
|
131893
|
+
const { authHeaderOrExit: authHeaderOrExit2 } = await Promise.resolve().then(() => (init_auth(), auth_exports));
|
|
131894
|
+
authHeaderOrExit2("stream");
|
|
131895
|
+
const opened = await runOpenCommand(
|
|
131896
|
+
args.filter((arg) => arg !== STREAM_FLAG2),
|
|
131897
|
+
opts
|
|
131898
|
+
);
|
|
131899
|
+
if (opened)
|
|
131900
|
+
await runStreamCommand2(["start", "--sim", opened.simId], { port: opts.port });
|
|
131901
|
+
return opened;
|
|
131902
|
+
}
|
|
131730
131903
|
if (!args.includes("--json")) return openSim(args, opts);
|
|
131731
131904
|
const log = console.log;
|
|
131732
131905
|
console.log = console.error;
|
|
@@ -132813,18 +132986,18 @@ async function runCloseCommand(args, opts = {}) {
|
|
|
132813
132986
|
bridge.close();
|
|
132814
132987
|
}
|
|
132815
132988
|
}
|
|
132816
|
-
var import_node_child_process62,
|
|
132989
|
+
var import_node_child_process62, import_node_fs153, import_node_http5, import_node_https2, import_node_net, import_node_os27, import_node_path155, import_ws7, DEFAULT_DRIVER_CONNECT_TIMEOUT_MS, DRIVER_CONNECT_INTERVAL_MS, DRIVER_CONNECT_HOST_GRACE_MS, OPEN_BRIDGE_SPAWN_TIMEOUT_MS, OPEN_BRIDGE_RUNTIME_TIMEOUT_MS, OPEN_BRIDGE_HEALTH_TIMEOUT_MS, OPEN_BRIDGE_SILENCE_MS, LIVE_BRIDGE_HANDSHAKE_TIMEOUT_MS;
|
|
132817
132990
|
var init_control = __esm({
|
|
132818
132991
|
"cli/commands/control.ts"() {
|
|
132819
132992
|
"use strict";
|
|
132820
132993
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
132821
132994
|
import_node_child_process62 = require("node:child_process");
|
|
132822
|
-
|
|
132995
|
+
import_node_fs153 = __toESM(require("node:fs"), 1);
|
|
132823
132996
|
import_node_http5 = __toESM(require("node:http"), 1);
|
|
132824
132997
|
import_node_https2 = __toESM(require("node:https"), 1);
|
|
132825
132998
|
import_node_net = __toESM(require("node:net"), 1);
|
|
132826
132999
|
import_node_os27 = __toESM(require("node:os"), 1);
|
|
132827
|
-
|
|
133000
|
+
import_node_path155 = __toESM(require("node:path"), 1);
|
|
132828
133001
|
init_src();
|
|
132829
133002
|
import_ws7 = require("ws");
|
|
132830
133003
|
init_agent_identity();
|