peachsim 0.1.1406 → 0.1.1465
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/LICENSE +8 -4
- package/README.md +22 -2
- package/cli/app-fonts.ts +50 -44
- package/cli/bin.ts +5 -4
- package/cli/bridge-diagnostics.ts +5 -0
- package/cli/bridge-flow-runner.ts +21 -13
- package/cli/cloud-client.ts +4 -3
- package/cli/commands/control.ts +155 -123
- package/cli/commands/daemon-mac-app.ts +3 -3
- package/cli/commands/daemon.ts +2 -2
- package/cli/commands/do-chain.ts +9 -2
- package/cli/commands/electron.ts +4 -1
- package/cli/commands/inspect/core.ts +1 -1
- package/cli/commands/inspect/settle.ts +19 -7
- package/cli/commands/inspect/settling.ts +92 -56
- package/cli/commands/inspect/wait-idle.ts +21 -9
- package/cli/commands/inspect/wait-ready.ts +22 -8
- package/cli/commands/inspect.ts +101 -134
- package/cli/commands/setup.ts +26 -16
- package/cli/commands/upgrade.ts +53 -9
- package/cli/desktop-companion.ts +1 -1
- package/cli/drivers/playwright-sim-host.ts +32 -13
- package/cli/drivers/playwright.ts +3 -3
- package/cli/main.ts +14 -5
- package/cli/outbound-endpoints.ts +1 -9
- package/detox/index.ts +6 -1
- 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 +3 -3
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +322 -274
- 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 +512 -122
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +69 -33
- 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 +3650 -3528
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +327 -123
- 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 +10 -5
- 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 +49 -47
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +1 -1
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +23 -17
- package/dist-lib/sdk.cjs +99 -61
- package/dist-lib/sdk.mjs +97 -61
- package/dist-lib/skills.cjs +3347 -3051
- package/dist-lib/swift-compile.cjs +26 -12
- package/dist-lib/swift-compile.mjs +26 -12
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +66 -31
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +5 -1
- package/dist-lib/worklet-executable.mjs +5 -1
- package/kotlin/AppSources/android/view/Window.kt +2 -0
- package/kotlin/AppSources/dev/peach/app/PeachApp.kt +1 -1
- package/kotlin/ComposeSources/PeachComposeHost.kt +35 -9
- package/kotlin/ExpoComposeSources/dev/peach/expo/PeachExpoCompose.kt +2 -2
- package/kotlin/ExpoSources/dev/peach/expo/PeachExpoRuntime.kt +9 -6
- package/kotlin/ExpoSources/dev/peach/expo/PeachExpoTypes.kt +4 -4
- package/kotlin/ExpoSources/expo/modules/kotlin/modules/Module.kt +2 -2
- package/kotlin/ExpoSources/expo/modules/kotlin/viewevent/ViewEvent.kt +22 -8
- package/kotlin/ExpoSources/expo/modules/kotlin/views/ExpoView.kt +0 -3
- package/kotlin/ExpoSources/expo/modules/kotlin/views/ViewDefinitionBuilder.kt +10 -9
- package/kotlin/ExpoSources/expo/modules/kotlin/views/ViewProps.kt +6 -5
- package/kotlin/fixtures/import-drawing/Drawing.d.kt.ts +7 -0
- package/kotlin/fixtures/import-drawing/Drawing.kt +101 -0
- package/kotlin/fixtures/import-drawing/ImportDrawing.native.tsx +18 -0
- package/kotlin/fixtures/import-drawing/README.md +34 -0
- package/kotlin/fixtures/import-drawing/app/_layout.tsx +4 -0
- package/kotlin/fixtures/import-drawing/app/index+spa.tsx +1 -0
- package/kotlin/fixtures/import-drawing/package.json +23 -0
- package/kotlin/fixtures/import-drawing/tsconfig.json +20 -0
- package/kotlin/fixtures/import-drawing/vite.config.ts +20 -0
- package/kotlin/fixtures/import-scroll/ImportNested.native.tsx +10 -0
- package/kotlin/fixtures/import-scroll/Nested.d.kt.ts +4 -0
- package/kotlin/fixtures/import-scroll/README.md +15 -0
- package/kotlin/fixtures/import-scroll/app/nested+spa.tsx +1 -0
- package/kotlin/fixtures/import-values/ImportValues.native.tsx +26 -0
- package/kotlin/fixtures/import-values/README.md +6 -1
- package/kotlin/fixtures/import-values/Values.d.kt.ts +4 -0
- package/kotlin/fixtures/import-values/Values.kt +18 -0
- package/kotlin/tools/expo-types.main.kts +17 -5
- package/package.json +2 -1
- package/scripts/dev-server-scanner.ts +33 -23
- package/src/assetCatalogContract.ts +7 -0
- package/src/bridge-contract.ts +21 -3
- package/src/connect.ts +18 -5
- package/src/desktop-host-delivery.ts +33 -3
- package/src/expo-swift-host.ts +6 -3
- package/src/host/bridge-host.ts +2 -0
- package/src/host/fetch-proxy-transport.ts +8 -0
- package/src/kotlin-host.ts +11 -5
- package/src/native-firebase-config.ts +95 -54
- package/src/process-output.ts +16 -0
- package/src/sdk.ts +6 -1
- package/src/sim-client.ts +6 -1
- package/src/swift-compile.ts +36 -15
- package/src/swift-distribution.lock.json +8 -8
- package/src/swift-standin-emit.ts +10 -1
- package/src/swift-standins.ts +21 -7
- package/src/swift-submit.ts +6 -1
- package/src/worklet-executable.ts +7 -2
- /package/kotlin/fixtures/{kotlin-app-variants → import-scroll}/Nested.kt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1465 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -818,7 +818,7 @@ function swiftTargetDependencies(files2, targets) {
|
|
|
818
818
|
}
|
|
819
819
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
820
820
|
const hash = (0, import_node_crypto2.createHash)("sha256");
|
|
821
|
-
hash.update(`swift-compile/
|
|
821
|
+
hash.update(`swift-compile/v24
|
|
822
822
|
${release}
|
|
823
823
|
`);
|
|
824
824
|
if (input.oneModule) hash.update("one-module\n");
|
|
@@ -890,11 +890,24 @@ function emitSwiftPackageManifest(args) {
|
|
|
890
890
|
reachedFrameworks.add("SpriteKit");
|
|
891
891
|
reachedFrameworks.add("PeachBox2D");
|
|
892
892
|
}
|
|
893
|
-
const
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
893
|
+
const distributionLink = args.distributionLink;
|
|
894
|
+
if (distribution && !distributionLink)
|
|
895
|
+
throw new Error(
|
|
896
|
+
"swift-compile: distribution linking requires its object response file"
|
|
897
|
+
);
|
|
898
|
+
if (distribution && distributionLink) {
|
|
899
|
+
const objects = distribution.objects.filter(
|
|
900
|
+
(object) => [...OPTIONAL_FRAMEWORKS, "SpriteKit", "PeachBox2D"].every(
|
|
901
|
+
(name2) => !object.startsWith(`lib/${name2}-`) || reachedFrameworks.has(name2)
|
|
902
|
+
)
|
|
903
|
+
);
|
|
904
|
+
distributionLink.files.set(
|
|
905
|
+
distributionLink.path,
|
|
906
|
+
objects.map(
|
|
907
|
+
(object) => `"${import_node_path2.default.join(moduleRoot, object).replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`
|
|
908
|
+
).join("\n") + "\n"
|
|
909
|
+
);
|
|
910
|
+
}
|
|
898
911
|
const executable = targets.find((target) => target.executable);
|
|
899
912
|
if (!executable) throw new Error("swift-compile: no executable target to emit");
|
|
900
913
|
const stanza = (target) => {
|
|
@@ -923,10 +936,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
923
936
|
(dependency) => OPTIONAL_FRAMEWORKS.has(dependency) && !targets.some((candidate) => candidate.name === dependency) ? distribution ? [] : [`.product(name: "${dependency}", package: "sootsim-swift")`] : [`"${dependency}"`]
|
|
924
937
|
)
|
|
925
938
|
].join(", ");
|
|
926
|
-
const library = distribution ? [
|
|
927
|
-
...(distributionObjects ?? []).map((object) => import_node_path2.default.join(moduleRoot, object)),
|
|
928
|
-
...distribution.link
|
|
929
|
-
].map((flag) => `, ${JSON.stringify(flag)}`).join("") : "";
|
|
939
|
+
const library = distribution && distributionLink ? ["-Xlinker", `@${distributionLink.path}`, ...distribution.link].map((flag) => `, ${JSON.stringify(flag)}`).join("") : "";
|
|
930
940
|
const kind = target.executable ? ".executableTarget" : ".target";
|
|
931
941
|
const link = target.executable ? `,
|
|
932
942
|
linkerSettings: [
|
|
@@ -2226,6 +2236,10 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
2226
2236
|
oneModule: input.oneModule,
|
|
2227
2237
|
spriteKit: importsSpriteKit(input.files),
|
|
2228
2238
|
distribution: distribution ?? void 0,
|
|
2239
|
+
distributionLink: {
|
|
2240
|
+
path: import_node_path2.default.join(layout.root, ".peach-distribution-objects.rsp"),
|
|
2241
|
+
files: files2
|
|
2242
|
+
},
|
|
2229
2243
|
libraries
|
|
2230
2244
|
}) + moduleFiles
|
|
2231
2245
|
);
|
|
@@ -2517,7 +2531,7 @@ var init_swift_compile = __esm({
|
|
|
2517
2531
|
(module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
|
|
2518
2532
|
).join("");
|
|
2519
2533
|
ONE_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "One"';
|
|
2520
|
-
MULTI_MANIFEST_VERSION =
|
|
2534
|
+
MULTI_MANIFEST_VERSION = 19;
|
|
2521
2535
|
DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
|
|
2522
2536
|
OS_IOS = /\bos\(\s*iOS\s*\)/g;
|
|
2523
2537
|
OBJC_ATTRIBUTE = /^@(?:objcMembers\b|objc\b(?:(\s*)\(([^()]*)\))?|IBAction\b)/;
|
|
@@ -2705,12 +2719,12 @@ var swift_distribution_lock_default;
|
|
|
2705
2719
|
var init_swift_distribution_lock = __esm({
|
|
2706
2720
|
"src/swift-distribution.lock.json"() {
|
|
2707
2721
|
swift_distribution_lock_default = {
|
|
2708
|
-
id: "
|
|
2722
|
+
id: "c60899948fe25af8",
|
|
2709
2723
|
release: "swift-6.4.0-RELEASE",
|
|
2710
2724
|
wasmSdkId: "swift-6.4.0-RELEASE_wasm-peach-e4629014",
|
|
2711
2725
|
wasmSdkUrl: "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-e4629014.artifactbundle.tar.gz",
|
|
2712
2726
|
wasmSdkChecksum: "522f3ff98e951872d64751376d45e36394e572ec2aa4e0a52fb0027824bf41f6",
|
|
2713
|
-
source: "
|
|
2727
|
+
source: "22d7666f9c66ec4b558db482661d440e581d84ff",
|
|
2714
2728
|
targets: [
|
|
2715
2729
|
"ExpoModulesCore",
|
|
2716
2730
|
"PeachJSON",
|
|
@@ -2824,16 +2838,16 @@ var init_swift_distribution_lock = __esm({
|
|
|
2824
2838
|
],
|
|
2825
2839
|
hosts: {
|
|
2826
2840
|
"darwin-arm64": {
|
|
2827
|
-
sha256: "
|
|
2828
|
-
size:
|
|
2841
|
+
sha256: "4661b87b8d627792bd28ef41d856bc9abcc913eb816efa448075d48e88abe823",
|
|
2842
|
+
size: 55595616
|
|
2829
2843
|
},
|
|
2830
2844
|
"linux-x64": {
|
|
2831
|
-
sha256: "
|
|
2832
|
-
size:
|
|
2845
|
+
sha256: "85dc5fc24acd33568f5ddccb3d69905c638162f5d5d767eefbbc16f9a4cca845",
|
|
2846
|
+
size: 55601101
|
|
2833
2847
|
},
|
|
2834
2848
|
"linux-arm64": {
|
|
2835
|
-
sha256: "
|
|
2836
|
-
size:
|
|
2849
|
+
sha256: "009f687e2f5a03cf2af277638861543aead3ad907136c2de8e48a6a702040182",
|
|
2850
|
+
size: 55600268
|
|
2837
2851
|
}
|
|
2838
2852
|
}
|
|
2839
2853
|
};
|
|
@@ -3266,6 +3280,7 @@ function enumerateBundleSymbols(paths, readText, bundleForFile) {
|
|
|
3266
3280
|
return table;
|
|
3267
3281
|
}
|
|
3268
3282
|
function isCopiedResource(path18) {
|
|
3283
|
+
if (path18.split("/").some((segment2) => segment2.endsWith(".atlasc"))) return true;
|
|
3269
3284
|
const ext = extOf(path18);
|
|
3270
3285
|
if (ext === ".json" || ext === ".xcstrings") return true;
|
|
3271
3286
|
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !path18.split("/").some((segment2) => NESTED_BUNDLE_DIR.test(segment2));
|
|
@@ -3281,7 +3296,9 @@ function enumerateBundleResources(paths) {
|
|
|
3281
3296
|
return aDepth - bDepth || (a < b ? -1 : a > b ? 1 : 0);
|
|
3282
3297
|
});
|
|
3283
3298
|
for (const file of ordered) {
|
|
3284
|
-
const
|
|
3299
|
+
const parts = file.split("/");
|
|
3300
|
+
const atlas = parts.findIndex((part) => part.endsWith(".atlasc"));
|
|
3301
|
+
const base = atlas < 0 ? baseOf(file) : parts.slice(atlas).join("/");
|
|
3285
3302
|
if (seen.has(base)) continue;
|
|
3286
3303
|
seen.add(base);
|
|
3287
3304
|
found.push({ base, file });
|
|
@@ -4436,6 +4453,257 @@ var init_cli_version = __esm({
|
|
|
4436
4453
|
}
|
|
4437
4454
|
});
|
|
4438
4455
|
|
|
4456
|
+
// ../../node_modules/plist/lib/parse.js
|
|
4457
|
+
var require_parse = __commonJS({
|
|
4458
|
+
"../../node_modules/plist/lib/parse.js"(exports2) {
|
|
4459
|
+
var { DOMParser } = require("@xmldom/xmldom");
|
|
4460
|
+
exports2.parse = parse2;
|
|
4461
|
+
var TEXT_NODE = 3;
|
|
4462
|
+
var CDATA_NODE = 4;
|
|
4463
|
+
var COMMENT_NODE = 8;
|
|
4464
|
+
function shouldIgnoreNode(node) {
|
|
4465
|
+
return node.nodeType === TEXT_NODE || node.nodeType === COMMENT_NODE || node.nodeType === CDATA_NODE;
|
|
4466
|
+
}
|
|
4467
|
+
function isEmptyNode(node) {
|
|
4468
|
+
if (!node.childNodes || node.childNodes.length === 0) {
|
|
4469
|
+
return true;
|
|
4470
|
+
} else {
|
|
4471
|
+
return false;
|
|
4472
|
+
}
|
|
4473
|
+
}
|
|
4474
|
+
function invariant(test, message) {
|
|
4475
|
+
if (!test) {
|
|
4476
|
+
throw new Error(message);
|
|
4477
|
+
}
|
|
4478
|
+
}
|
|
4479
|
+
function parse2(xml) {
|
|
4480
|
+
var doc = new DOMParser().parseFromString(xml, "text/xml");
|
|
4481
|
+
invariant(
|
|
4482
|
+
doc.documentElement.nodeName === "plist",
|
|
4483
|
+
"malformed document. First element should be <plist>"
|
|
4484
|
+
);
|
|
4485
|
+
var plist3 = parsePlistXML(doc.documentElement);
|
|
4486
|
+
if (plist3.length == 1) plist3 = plist3[0];
|
|
4487
|
+
return plist3;
|
|
4488
|
+
}
|
|
4489
|
+
function parsePlistXML(node) {
|
|
4490
|
+
var i, new_obj, key2, val, new_arr, res, counter, type;
|
|
4491
|
+
if (!node) return null;
|
|
4492
|
+
if (node.nodeName === "plist") {
|
|
4493
|
+
new_arr = [];
|
|
4494
|
+
if (isEmptyNode(node)) {
|
|
4495
|
+
return new_arr;
|
|
4496
|
+
}
|
|
4497
|
+
for (i = 0; i < node.childNodes.length; i++) {
|
|
4498
|
+
if (!shouldIgnoreNode(node.childNodes[i])) {
|
|
4499
|
+
new_arr.push(parsePlistXML(node.childNodes[i]));
|
|
4500
|
+
}
|
|
4501
|
+
}
|
|
4502
|
+
return new_arr;
|
|
4503
|
+
} else if (node.nodeName === "dict") {
|
|
4504
|
+
new_obj = {};
|
|
4505
|
+
key2 = null;
|
|
4506
|
+
counter = 0;
|
|
4507
|
+
if (isEmptyNode(node)) {
|
|
4508
|
+
return new_obj;
|
|
4509
|
+
}
|
|
4510
|
+
for (i = 0; i < node.childNodes.length; i++) {
|
|
4511
|
+
if (shouldIgnoreNode(node.childNodes[i])) continue;
|
|
4512
|
+
if (counter % 2 === 0) {
|
|
4513
|
+
invariant(
|
|
4514
|
+
node.childNodes[i].nodeName === "key",
|
|
4515
|
+
"Missing key while parsing <dict/>."
|
|
4516
|
+
);
|
|
4517
|
+
key2 = parsePlistXML(node.childNodes[i]);
|
|
4518
|
+
} else {
|
|
4519
|
+
invariant(
|
|
4520
|
+
node.childNodes[i].nodeName !== "key",
|
|
4521
|
+
'Unexpected key "' + parsePlistXML(node.childNodes[i]) + '" while parsing <dict/>.'
|
|
4522
|
+
);
|
|
4523
|
+
new_obj[key2] = parsePlistXML(node.childNodes[i]);
|
|
4524
|
+
}
|
|
4525
|
+
counter += 1;
|
|
4526
|
+
}
|
|
4527
|
+
if (counter % 2 === 1) {
|
|
4528
|
+
new_obj[key2] = "";
|
|
4529
|
+
}
|
|
4530
|
+
return new_obj;
|
|
4531
|
+
} else if (node.nodeName === "array") {
|
|
4532
|
+
new_arr = [];
|
|
4533
|
+
if (isEmptyNode(node)) {
|
|
4534
|
+
return new_arr;
|
|
4535
|
+
}
|
|
4536
|
+
for (i = 0; i < node.childNodes.length; i++) {
|
|
4537
|
+
if (!shouldIgnoreNode(node.childNodes[i])) {
|
|
4538
|
+
res = parsePlistXML(node.childNodes[i]);
|
|
4539
|
+
if (null != res) new_arr.push(res);
|
|
4540
|
+
}
|
|
4541
|
+
}
|
|
4542
|
+
return new_arr;
|
|
4543
|
+
} else if (node.nodeName === "#text") {
|
|
4544
|
+
} else if (node.nodeName === "key") {
|
|
4545
|
+
if (isEmptyNode(node)) {
|
|
4546
|
+
return "";
|
|
4547
|
+
}
|
|
4548
|
+
invariant(
|
|
4549
|
+
node.childNodes[0].nodeValue !== "__proto__",
|
|
4550
|
+
"__proto__ keys can lead to prototype pollution. More details on CVE-2022-22912"
|
|
4551
|
+
);
|
|
4552
|
+
return node.childNodes[0].nodeValue;
|
|
4553
|
+
} else if (node.nodeName === "string") {
|
|
4554
|
+
res = "";
|
|
4555
|
+
if (isEmptyNode(node)) {
|
|
4556
|
+
return res;
|
|
4557
|
+
}
|
|
4558
|
+
for (i = 0; i < node.childNodes.length; i++) {
|
|
4559
|
+
var type = node.childNodes[i].nodeType;
|
|
4560
|
+
if (type === TEXT_NODE || type === CDATA_NODE) {
|
|
4561
|
+
res += node.childNodes[i].nodeValue;
|
|
4562
|
+
}
|
|
4563
|
+
}
|
|
4564
|
+
return res;
|
|
4565
|
+
} else if (node.nodeName === "integer") {
|
|
4566
|
+
invariant(!isEmptyNode(node), 'Cannot parse "" as integer.');
|
|
4567
|
+
return parseInt(node.childNodes[0].nodeValue, 10);
|
|
4568
|
+
} else if (node.nodeName === "real") {
|
|
4569
|
+
invariant(!isEmptyNode(node), 'Cannot parse "" as real.');
|
|
4570
|
+
res = "";
|
|
4571
|
+
for (i = 0; i < node.childNodes.length; i++) {
|
|
4572
|
+
if (node.childNodes[i].nodeType === TEXT_NODE) {
|
|
4573
|
+
res += node.childNodes[i].nodeValue;
|
|
4574
|
+
}
|
|
4575
|
+
}
|
|
4576
|
+
return parseFloat(res);
|
|
4577
|
+
} else if (node.nodeName === "data") {
|
|
4578
|
+
res = "";
|
|
4579
|
+
if (isEmptyNode(node)) {
|
|
4580
|
+
return Buffer.from(res, "base64");
|
|
4581
|
+
}
|
|
4582
|
+
for (i = 0; i < node.childNodes.length; i++) {
|
|
4583
|
+
if (node.childNodes[i].nodeType === TEXT_NODE) {
|
|
4584
|
+
res += node.childNodes[i].nodeValue.replace(/\s+/g, "");
|
|
4585
|
+
}
|
|
4586
|
+
}
|
|
4587
|
+
return Buffer.from(res, "base64");
|
|
4588
|
+
} else if (node.nodeName === "date") {
|
|
4589
|
+
invariant(!isEmptyNode(node), 'Cannot parse "" as Date.');
|
|
4590
|
+
return new Date(node.childNodes[0].nodeValue);
|
|
4591
|
+
} else if (node.nodeName === "null") {
|
|
4592
|
+
return null;
|
|
4593
|
+
} else if (node.nodeName === "true") {
|
|
4594
|
+
return true;
|
|
4595
|
+
} else if (node.nodeName === "false") {
|
|
4596
|
+
return false;
|
|
4597
|
+
} else {
|
|
4598
|
+
throw new Error("Invalid PLIST tag " + node.nodeName);
|
|
4599
|
+
}
|
|
4600
|
+
}
|
|
4601
|
+
}
|
|
4602
|
+
});
|
|
4603
|
+
|
|
4604
|
+
// ../../node_modules/plist/lib/build.js
|
|
4605
|
+
var require_build = __commonJS({
|
|
4606
|
+
"../../node_modules/plist/lib/build.js"(exports2) {
|
|
4607
|
+
var base64 = require("base64-js");
|
|
4608
|
+
var xmlbuilder = require("xmlbuilder");
|
|
4609
|
+
exports2.build = build;
|
|
4610
|
+
function ISODateString(d) {
|
|
4611
|
+
function pad(n) {
|
|
4612
|
+
return n < 10 ? "0" + n : n;
|
|
4613
|
+
}
|
|
4614
|
+
return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "Z";
|
|
4615
|
+
}
|
|
4616
|
+
var toString = Object.prototype.toString;
|
|
4617
|
+
function type(obj) {
|
|
4618
|
+
var m = toString.call(obj).match(/\[object (.*)\]/);
|
|
4619
|
+
return m ? m[1] : m;
|
|
4620
|
+
}
|
|
4621
|
+
function build(obj, opts) {
|
|
4622
|
+
var XMLHDR = {
|
|
4623
|
+
version: "1.0",
|
|
4624
|
+
encoding: "UTF-8"
|
|
4625
|
+
};
|
|
4626
|
+
var XMLDTD = {
|
|
4627
|
+
pubid: "-//Apple//DTD PLIST 1.0//EN",
|
|
4628
|
+
sysid: "http://www.apple.com/DTDs/PropertyList-1.0.dtd"
|
|
4629
|
+
};
|
|
4630
|
+
var doc = xmlbuilder.create("plist");
|
|
4631
|
+
doc.dec(XMLHDR.version, XMLHDR.encoding, XMLHDR.standalone);
|
|
4632
|
+
doc.dtd(XMLDTD.pubid, XMLDTD.sysid);
|
|
4633
|
+
doc.att("version", "1.0");
|
|
4634
|
+
walk_obj(obj, doc);
|
|
4635
|
+
if (!opts) opts = {};
|
|
4636
|
+
opts.pretty = opts.pretty !== false;
|
|
4637
|
+
return doc.end(opts);
|
|
4638
|
+
}
|
|
4639
|
+
function walk_obj(next, next_child) {
|
|
4640
|
+
var tag_type, i, prop;
|
|
4641
|
+
var name2 = type(next);
|
|
4642
|
+
if ("Undefined" == name2) {
|
|
4643
|
+
return;
|
|
4644
|
+
} else if (Array.isArray(next)) {
|
|
4645
|
+
next_child = next_child.ele("array");
|
|
4646
|
+
for (i = 0; i < next.length; i++) {
|
|
4647
|
+
walk_obj(next[i], next_child);
|
|
4648
|
+
}
|
|
4649
|
+
} else if (Buffer.isBuffer(next)) {
|
|
4650
|
+
next_child.ele("data").raw(next.toString("base64"));
|
|
4651
|
+
} else if ("Object" == name2) {
|
|
4652
|
+
next_child = next_child.ele("dict");
|
|
4653
|
+
for (prop in next) {
|
|
4654
|
+
if (next.hasOwnProperty(prop)) {
|
|
4655
|
+
next_child.ele("key").txt(prop);
|
|
4656
|
+
walk_obj(next[prop], next_child);
|
|
4657
|
+
}
|
|
4658
|
+
}
|
|
4659
|
+
} else if ("Number" == name2) {
|
|
4660
|
+
tag_type = next % 1 === 0 ? "integer" : "real";
|
|
4661
|
+
next_child.ele(tag_type).txt(next.toString());
|
|
4662
|
+
} else if ("BigInt" == name2) {
|
|
4663
|
+
next_child.ele("integer").txt(next);
|
|
4664
|
+
} else if ("Date" == name2) {
|
|
4665
|
+
next_child.ele("date").txt(ISODateString(new Date(next)));
|
|
4666
|
+
} else if ("Boolean" == name2) {
|
|
4667
|
+
next_child.ele(next ? "true" : "false");
|
|
4668
|
+
} else if ("String" == name2) {
|
|
4669
|
+
next_child.ele("string").txt(next);
|
|
4670
|
+
} else if ("ArrayBuffer" == name2) {
|
|
4671
|
+
next_child.ele("data").raw(base64.fromByteArray(next));
|
|
4672
|
+
} else if (next && next.buffer && "ArrayBuffer" == type(next.buffer)) {
|
|
4673
|
+
next_child.ele("data").raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child));
|
|
4674
|
+
} else if ("Null" === name2) {
|
|
4675
|
+
next_child.ele("null").txt("");
|
|
4676
|
+
}
|
|
4677
|
+
}
|
|
4678
|
+
}
|
|
4679
|
+
});
|
|
4680
|
+
|
|
4681
|
+
// ../../node_modules/plist/index.js
|
|
4682
|
+
var require_plist = __commonJS({
|
|
4683
|
+
"../../node_modules/plist/index.js"(exports2) {
|
|
4684
|
+
var parserFunctions = require_parse();
|
|
4685
|
+
Object.keys(parserFunctions).forEach(function(k) {
|
|
4686
|
+
exports2[k] = parserFunctions[k];
|
|
4687
|
+
});
|
|
4688
|
+
var builderFunctions = require_build();
|
|
4689
|
+
Object.keys(builderFunctions).forEach(function(k) {
|
|
4690
|
+
exports2[k] = builderFunctions[k];
|
|
4691
|
+
});
|
|
4692
|
+
}
|
|
4693
|
+
});
|
|
4694
|
+
|
|
4695
|
+
// src/plist.ts
|
|
4696
|
+
function parsePlistSource(source) {
|
|
4697
|
+
return import_plist.default.parse(source);
|
|
4698
|
+
}
|
|
4699
|
+
var import_plist;
|
|
4700
|
+
var init_plist = __esm({
|
|
4701
|
+
"src/plist.ts"() {
|
|
4702
|
+
"use strict";
|
|
4703
|
+
import_plist = __toESM(require_plist(), 1);
|
|
4704
|
+
}
|
|
4705
|
+
});
|
|
4706
|
+
|
|
4439
4707
|
// src/swift-standin-emit.ts
|
|
4440
4708
|
function splitAccessors(core) {
|
|
4441
4709
|
const match = /\{\s*([^}]*)\}\s*$/.exec(core);
|
|
@@ -4969,7 +5237,12 @@ function emitSwiftStandin(graphs, options) {
|
|
|
4969
5237
|
if (fix && !/^(?:prefix|infix|postfix)\b/.test(spelled))
|
|
4970
5238
|
spelled = `${fix} ${spelled}`;
|
|
4971
5239
|
}
|
|
4972
|
-
|
|
5240
|
+
const measured = behavior.get(path18);
|
|
5241
|
+
if (measured) used.add(path18);
|
|
5242
|
+
const overloadBody = /\basync\b/.test(spelled) ? measured?.asyncBody : /\bResult</.test(spelled) ? measured?.resultBody : void 0;
|
|
5243
|
+
emit(
|
|
5244
|
+
`${attrs}public ${spelled} { ${overloadBody ?? measured?.body ?? trap(path18)} }`
|
|
5245
|
+
);
|
|
4973
5246
|
} else if (kind === "swift.var") {
|
|
4974
5247
|
const parsed = splitAccessors(text(symbol).replace(/^let /, "var "));
|
|
4975
5248
|
const measured = behavior.get(path18);
|
|
@@ -5702,10 +5975,17 @@ function crateFor(root, name2) {
|
|
|
5702
5975
|
};
|
|
5703
5976
|
return walk2(root, 4);
|
|
5704
5977
|
}
|
|
5978
|
+
function simulatorLibraryName(dir) {
|
|
5979
|
+
const info = parsePlistSource(import_node_fs12.default.readFileSync(import_node_path12.default.join(dir, "Info.plist"), "utf8"));
|
|
5980
|
+
const libraries = info && typeof info === "object" ? Reflect.get(info, "AvailableLibraries") : void 0;
|
|
5981
|
+
if (!Array.isArray(libraries)) return void 0;
|
|
5982
|
+
return libraries.filter(
|
|
5983
|
+
(entry) => typeof entry === "object" && entry !== null && Reflect.get(entry, "SupportedPlatform") === "ios" && Reflect.get(entry, "SupportedPlatformVariant") === "simulator"
|
|
5984
|
+
).map((entry) => Reflect.get(entry, "LibraryPath")).find((name2) => typeof name2 === "string" && /^lib.+\.a$/.test(name2));
|
|
5985
|
+
}
|
|
5705
5986
|
function standinLibrary(binary, searchRoot) {
|
|
5706
5987
|
const dir = xcframework(binary).dir;
|
|
5707
|
-
const
|
|
5708
|
-
const library = slice ? import_node_fs12.default.readdirSync(import_node_path12.default.join(dir, slice)).find((name2) => /^lib.+\.a$/.test(name2)) : void 0;
|
|
5988
|
+
const library = simulatorLibraryName(dir);
|
|
5709
5989
|
const supplied = import_node_path12.default.join(dir, RUST_TARGET);
|
|
5710
5990
|
if (import_node_fs12.default.existsSync(supplied)) {
|
|
5711
5991
|
const found = import_node_fs12.default.readdirSync(supplied).filter((name2) => name2.endsWith(".a"));
|
|
@@ -5940,6 +6220,7 @@ var init_swift_standins = __esm({
|
|
|
5940
6220
|
import_node_os7 = __toESM(require("node:os"), 1);
|
|
5941
6221
|
import_node_path12 = __toESM(require("node:path"), 1);
|
|
5942
6222
|
init_cli_version();
|
|
6223
|
+
init_plist();
|
|
5943
6224
|
init_swift_compile();
|
|
5944
6225
|
init_swift_standin_emit();
|
|
5945
6226
|
TRIPLE = "wasm32-unknown-wasip1";
|
|
@@ -6105,250 +6386,11 @@ var init_swift_submit = __esm({
|
|
|
6105
6386
|
MAX_SWIFT_COMPILE_IMAGES = 128;
|
|
6106
6387
|
MAX_SWIFT_COMPILE_IMAGE_BYTES = 4 * 1024 * 1024;
|
|
6107
6388
|
MAX_SWIFT_COMPILE_IMAGE_TOTAL_BYTES = 16 * 1024 * 1024;
|
|
6108
|
-
SWIFT_HOST_ABI =
|
|
6389
|
+
SWIFT_HOST_ABI = 45;
|
|
6109
6390
|
POLL_INTERVAL_MS = 1500;
|
|
6110
6391
|
}
|
|
6111
6392
|
});
|
|
6112
6393
|
|
|
6113
|
-
// ../../node_modules/plist/lib/parse.js
|
|
6114
|
-
var require_parse = __commonJS({
|
|
6115
|
-
"../../node_modules/plist/lib/parse.js"(exports2) {
|
|
6116
|
-
var { DOMParser } = require("@xmldom/xmldom");
|
|
6117
|
-
exports2.parse = parse2;
|
|
6118
|
-
var TEXT_NODE = 3;
|
|
6119
|
-
var CDATA_NODE = 4;
|
|
6120
|
-
var COMMENT_NODE = 8;
|
|
6121
|
-
function shouldIgnoreNode(node) {
|
|
6122
|
-
return node.nodeType === TEXT_NODE || node.nodeType === COMMENT_NODE || node.nodeType === CDATA_NODE;
|
|
6123
|
-
}
|
|
6124
|
-
function isEmptyNode(node) {
|
|
6125
|
-
if (!node.childNodes || node.childNodes.length === 0) {
|
|
6126
|
-
return true;
|
|
6127
|
-
} else {
|
|
6128
|
-
return false;
|
|
6129
|
-
}
|
|
6130
|
-
}
|
|
6131
|
-
function invariant(test, message) {
|
|
6132
|
-
if (!test) {
|
|
6133
|
-
throw new Error(message);
|
|
6134
|
-
}
|
|
6135
|
-
}
|
|
6136
|
-
function parse2(xml) {
|
|
6137
|
-
var doc = new DOMParser().parseFromString(xml, "text/xml");
|
|
6138
|
-
invariant(
|
|
6139
|
-
doc.documentElement.nodeName === "plist",
|
|
6140
|
-
"malformed document. First element should be <plist>"
|
|
6141
|
-
);
|
|
6142
|
-
var plist2 = parsePlistXML(doc.documentElement);
|
|
6143
|
-
if (plist2.length == 1) plist2 = plist2[0];
|
|
6144
|
-
return plist2;
|
|
6145
|
-
}
|
|
6146
|
-
function parsePlistXML(node) {
|
|
6147
|
-
var i, new_obj, key2, val, new_arr, res, counter, type;
|
|
6148
|
-
if (!node) return null;
|
|
6149
|
-
if (node.nodeName === "plist") {
|
|
6150
|
-
new_arr = [];
|
|
6151
|
-
if (isEmptyNode(node)) {
|
|
6152
|
-
return new_arr;
|
|
6153
|
-
}
|
|
6154
|
-
for (i = 0; i < node.childNodes.length; i++) {
|
|
6155
|
-
if (!shouldIgnoreNode(node.childNodes[i])) {
|
|
6156
|
-
new_arr.push(parsePlistXML(node.childNodes[i]));
|
|
6157
|
-
}
|
|
6158
|
-
}
|
|
6159
|
-
return new_arr;
|
|
6160
|
-
} else if (node.nodeName === "dict") {
|
|
6161
|
-
new_obj = {};
|
|
6162
|
-
key2 = null;
|
|
6163
|
-
counter = 0;
|
|
6164
|
-
if (isEmptyNode(node)) {
|
|
6165
|
-
return new_obj;
|
|
6166
|
-
}
|
|
6167
|
-
for (i = 0; i < node.childNodes.length; i++) {
|
|
6168
|
-
if (shouldIgnoreNode(node.childNodes[i])) continue;
|
|
6169
|
-
if (counter % 2 === 0) {
|
|
6170
|
-
invariant(
|
|
6171
|
-
node.childNodes[i].nodeName === "key",
|
|
6172
|
-
"Missing key while parsing <dict/>."
|
|
6173
|
-
);
|
|
6174
|
-
key2 = parsePlistXML(node.childNodes[i]);
|
|
6175
|
-
} else {
|
|
6176
|
-
invariant(
|
|
6177
|
-
node.childNodes[i].nodeName !== "key",
|
|
6178
|
-
'Unexpected key "' + parsePlistXML(node.childNodes[i]) + '" while parsing <dict/>.'
|
|
6179
|
-
);
|
|
6180
|
-
new_obj[key2] = parsePlistXML(node.childNodes[i]);
|
|
6181
|
-
}
|
|
6182
|
-
counter += 1;
|
|
6183
|
-
}
|
|
6184
|
-
if (counter % 2 === 1) {
|
|
6185
|
-
new_obj[key2] = "";
|
|
6186
|
-
}
|
|
6187
|
-
return new_obj;
|
|
6188
|
-
} else if (node.nodeName === "array") {
|
|
6189
|
-
new_arr = [];
|
|
6190
|
-
if (isEmptyNode(node)) {
|
|
6191
|
-
return new_arr;
|
|
6192
|
-
}
|
|
6193
|
-
for (i = 0; i < node.childNodes.length; i++) {
|
|
6194
|
-
if (!shouldIgnoreNode(node.childNodes[i])) {
|
|
6195
|
-
res = parsePlistXML(node.childNodes[i]);
|
|
6196
|
-
if (null != res) new_arr.push(res);
|
|
6197
|
-
}
|
|
6198
|
-
}
|
|
6199
|
-
return new_arr;
|
|
6200
|
-
} else if (node.nodeName === "#text") {
|
|
6201
|
-
} else if (node.nodeName === "key") {
|
|
6202
|
-
if (isEmptyNode(node)) {
|
|
6203
|
-
return "";
|
|
6204
|
-
}
|
|
6205
|
-
invariant(
|
|
6206
|
-
node.childNodes[0].nodeValue !== "__proto__",
|
|
6207
|
-
"__proto__ keys can lead to prototype pollution. More details on CVE-2022-22912"
|
|
6208
|
-
);
|
|
6209
|
-
return node.childNodes[0].nodeValue;
|
|
6210
|
-
} else if (node.nodeName === "string") {
|
|
6211
|
-
res = "";
|
|
6212
|
-
if (isEmptyNode(node)) {
|
|
6213
|
-
return res;
|
|
6214
|
-
}
|
|
6215
|
-
for (i = 0; i < node.childNodes.length; i++) {
|
|
6216
|
-
var type = node.childNodes[i].nodeType;
|
|
6217
|
-
if (type === TEXT_NODE || type === CDATA_NODE) {
|
|
6218
|
-
res += node.childNodes[i].nodeValue;
|
|
6219
|
-
}
|
|
6220
|
-
}
|
|
6221
|
-
return res;
|
|
6222
|
-
} else if (node.nodeName === "integer") {
|
|
6223
|
-
invariant(!isEmptyNode(node), 'Cannot parse "" as integer.');
|
|
6224
|
-
return parseInt(node.childNodes[0].nodeValue, 10);
|
|
6225
|
-
} else if (node.nodeName === "real") {
|
|
6226
|
-
invariant(!isEmptyNode(node), 'Cannot parse "" as real.');
|
|
6227
|
-
res = "";
|
|
6228
|
-
for (i = 0; i < node.childNodes.length; i++) {
|
|
6229
|
-
if (node.childNodes[i].nodeType === TEXT_NODE) {
|
|
6230
|
-
res += node.childNodes[i].nodeValue;
|
|
6231
|
-
}
|
|
6232
|
-
}
|
|
6233
|
-
return parseFloat(res);
|
|
6234
|
-
} else if (node.nodeName === "data") {
|
|
6235
|
-
res = "";
|
|
6236
|
-
if (isEmptyNode(node)) {
|
|
6237
|
-
return Buffer.from(res, "base64");
|
|
6238
|
-
}
|
|
6239
|
-
for (i = 0; i < node.childNodes.length; i++) {
|
|
6240
|
-
if (node.childNodes[i].nodeType === TEXT_NODE) {
|
|
6241
|
-
res += node.childNodes[i].nodeValue.replace(/\s+/g, "");
|
|
6242
|
-
}
|
|
6243
|
-
}
|
|
6244
|
-
return Buffer.from(res, "base64");
|
|
6245
|
-
} else if (node.nodeName === "date") {
|
|
6246
|
-
invariant(!isEmptyNode(node), 'Cannot parse "" as Date.');
|
|
6247
|
-
return new Date(node.childNodes[0].nodeValue);
|
|
6248
|
-
} else if (node.nodeName === "null") {
|
|
6249
|
-
return null;
|
|
6250
|
-
} else if (node.nodeName === "true") {
|
|
6251
|
-
return true;
|
|
6252
|
-
} else if (node.nodeName === "false") {
|
|
6253
|
-
return false;
|
|
6254
|
-
} else {
|
|
6255
|
-
throw new Error("Invalid PLIST tag " + node.nodeName);
|
|
6256
|
-
}
|
|
6257
|
-
}
|
|
6258
|
-
}
|
|
6259
|
-
});
|
|
6260
|
-
|
|
6261
|
-
// ../../node_modules/plist/lib/build.js
|
|
6262
|
-
var require_build = __commonJS({
|
|
6263
|
-
"../../node_modules/plist/lib/build.js"(exports2) {
|
|
6264
|
-
var base64 = require("base64-js");
|
|
6265
|
-
var xmlbuilder = require("xmlbuilder");
|
|
6266
|
-
exports2.build = build;
|
|
6267
|
-
function ISODateString(d) {
|
|
6268
|
-
function pad(n) {
|
|
6269
|
-
return n < 10 ? "0" + n : n;
|
|
6270
|
-
}
|
|
6271
|
-
return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "Z";
|
|
6272
|
-
}
|
|
6273
|
-
var toString = Object.prototype.toString;
|
|
6274
|
-
function type(obj) {
|
|
6275
|
-
var m = toString.call(obj).match(/\[object (.*)\]/);
|
|
6276
|
-
return m ? m[1] : m;
|
|
6277
|
-
}
|
|
6278
|
-
function build(obj, opts) {
|
|
6279
|
-
var XMLHDR = {
|
|
6280
|
-
version: "1.0",
|
|
6281
|
-
encoding: "UTF-8"
|
|
6282
|
-
};
|
|
6283
|
-
var XMLDTD = {
|
|
6284
|
-
pubid: "-//Apple//DTD PLIST 1.0//EN",
|
|
6285
|
-
sysid: "http://www.apple.com/DTDs/PropertyList-1.0.dtd"
|
|
6286
|
-
};
|
|
6287
|
-
var doc = xmlbuilder.create("plist");
|
|
6288
|
-
doc.dec(XMLHDR.version, XMLHDR.encoding, XMLHDR.standalone);
|
|
6289
|
-
doc.dtd(XMLDTD.pubid, XMLDTD.sysid);
|
|
6290
|
-
doc.att("version", "1.0");
|
|
6291
|
-
walk_obj(obj, doc);
|
|
6292
|
-
if (!opts) opts = {};
|
|
6293
|
-
opts.pretty = opts.pretty !== false;
|
|
6294
|
-
return doc.end(opts);
|
|
6295
|
-
}
|
|
6296
|
-
function walk_obj(next, next_child) {
|
|
6297
|
-
var tag_type, i, prop;
|
|
6298
|
-
var name2 = type(next);
|
|
6299
|
-
if ("Undefined" == name2) {
|
|
6300
|
-
return;
|
|
6301
|
-
} else if (Array.isArray(next)) {
|
|
6302
|
-
next_child = next_child.ele("array");
|
|
6303
|
-
for (i = 0; i < next.length; i++) {
|
|
6304
|
-
walk_obj(next[i], next_child);
|
|
6305
|
-
}
|
|
6306
|
-
} else if (Buffer.isBuffer(next)) {
|
|
6307
|
-
next_child.ele("data").raw(next.toString("base64"));
|
|
6308
|
-
} else if ("Object" == name2) {
|
|
6309
|
-
next_child = next_child.ele("dict");
|
|
6310
|
-
for (prop in next) {
|
|
6311
|
-
if (next.hasOwnProperty(prop)) {
|
|
6312
|
-
next_child.ele("key").txt(prop);
|
|
6313
|
-
walk_obj(next[prop], next_child);
|
|
6314
|
-
}
|
|
6315
|
-
}
|
|
6316
|
-
} else if ("Number" == name2) {
|
|
6317
|
-
tag_type = next % 1 === 0 ? "integer" : "real";
|
|
6318
|
-
next_child.ele(tag_type).txt(next.toString());
|
|
6319
|
-
} else if ("BigInt" == name2) {
|
|
6320
|
-
next_child.ele("integer").txt(next);
|
|
6321
|
-
} else if ("Date" == name2) {
|
|
6322
|
-
next_child.ele("date").txt(ISODateString(new Date(next)));
|
|
6323
|
-
} else if ("Boolean" == name2) {
|
|
6324
|
-
next_child.ele(next ? "true" : "false");
|
|
6325
|
-
} else if ("String" == name2) {
|
|
6326
|
-
next_child.ele("string").txt(next);
|
|
6327
|
-
} else if ("ArrayBuffer" == name2) {
|
|
6328
|
-
next_child.ele("data").raw(base64.fromByteArray(next));
|
|
6329
|
-
} else if (next && next.buffer && "ArrayBuffer" == type(next.buffer)) {
|
|
6330
|
-
next_child.ele("data").raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child));
|
|
6331
|
-
} else if ("Null" === name2) {
|
|
6332
|
-
next_child.ele("null").txt("");
|
|
6333
|
-
}
|
|
6334
|
-
}
|
|
6335
|
-
}
|
|
6336
|
-
});
|
|
6337
|
-
|
|
6338
|
-
// ../../node_modules/plist/index.js
|
|
6339
|
-
var require_plist = __commonJS({
|
|
6340
|
-
"../../node_modules/plist/index.js"(exports2) {
|
|
6341
|
-
var parserFunctions = require_parse();
|
|
6342
|
-
Object.keys(parserFunctions).forEach(function(k) {
|
|
6343
|
-
exports2[k] = parserFunctions[k];
|
|
6344
|
-
});
|
|
6345
|
-
var builderFunctions = require_build();
|
|
6346
|
-
Object.keys(builderFunctions).forEach(function(k) {
|
|
6347
|
-
exports2[k] = builderFunctions[k];
|
|
6348
|
-
});
|
|
6349
|
-
}
|
|
6350
|
-
});
|
|
6351
|
-
|
|
6352
6394
|
// ../../node_modules/json5/lib/unicode.js
|
|
6353
6395
|
var require_unicode = __commonJS({
|
|
6354
6396
|
"../../node_modules/json5/lib/unicode.js"(exports2, module2) {
|
|
@@ -8477,7 +8519,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
8477
8519
|
return value;
|
|
8478
8520
|
};
|
|
8479
8521
|
const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path14.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
|
|
8480
|
-
const sourceInfo = infoPlistFile ?
|
|
8522
|
+
const sourceInfo = infoPlistFile ? import_plist3.default.parse(import_node_fs13.default.readFileSync(infoPlistFile, "utf8")) : {};
|
|
8481
8523
|
if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
|
|
8482
8524
|
throw new Error(`${module2.name} Info.plist must contain a dictionary`);
|
|
8483
8525
|
}
|
|
@@ -8570,7 +8612,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
8570
8612
|
.../* @__PURE__ */ new Set([...used.map((project) => project.projectFile), ...xcconfigs])
|
|
8571
8613
|
].sort(),
|
|
8572
8614
|
appIconName: settings("ASSETCATALOG_COMPILER_APPICON_NAME"),
|
|
8573
|
-
infoPlist:
|
|
8615
|
+
infoPlist: import_plist3.default.build(info),
|
|
8574
8616
|
infoPlistFile,
|
|
8575
8617
|
frameworks,
|
|
8576
8618
|
linkedProducts,
|
|
@@ -8584,13 +8626,13 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
8584
8626
|
settings
|
|
8585
8627
|
};
|
|
8586
8628
|
}
|
|
8587
|
-
var import_node_fs13, import_node_path14,
|
|
8629
|
+
var import_node_fs13, import_node_path14, import_plist3, APPLICATION, MODULE_PRODUCTS, NEVER_MEMBER, BUNDLE_DIR, CONDITIONS, isDirectory, loaded, targetRefs;
|
|
8588
8630
|
var init_xcode_project = __esm({
|
|
8589
8631
|
"src/xcode-project.ts"() {
|
|
8590
8632
|
"use strict";
|
|
8591
8633
|
import_node_fs13 = __toESM(require("node:fs"), 1);
|
|
8592
8634
|
import_node_path14 = __toESM(require("node:path"), 1);
|
|
8593
|
-
|
|
8635
|
+
import_plist3 = __toESM(require_plist(), 1);
|
|
8594
8636
|
init_xcode_json_project();
|
|
8595
8637
|
init_openstep_plist();
|
|
8596
8638
|
init_openstep_plist();
|
|
@@ -9836,10 +9878,11 @@ let package = Package(name: "PeachExpo", targets: [${targets.map((name2) => `.ta
|
|
|
9836
9878
|
);
|
|
9837
9879
|
if (publishArtifact && (sourceErrors.length === 0 || sourceErrors.length !== errors.length) && !(error instanceof SwiftMissingModulesError))
|
|
9838
9880
|
throw error;
|
|
9839
|
-
|
|
9881
|
+
const missing = error instanceof SwiftMissingModulesError;
|
|
9882
|
+
if ((sourceErrors.length && sourceErrors.length === errors.length || missing) && sourceStamp(packagePath, module2.root) === stamps.get(unit)) {
|
|
9840
9883
|
failedCompilations.set(packagePath, {
|
|
9841
9884
|
stamp: stamps.get(unit),
|
|
9842
|
-
diagnostic: sourceErrors.join("\n")
|
|
9885
|
+
diagnostic: missing ? diagnostic : sourceErrors.join("\n")
|
|
9843
9886
|
});
|
|
9844
9887
|
}
|
|
9845
9888
|
failures.set(
|
|
@@ -10257,9 +10300,14 @@ function readExpoTypes(output) {
|
|
|
10257
10300
|
};
|
|
10258
10301
|
}),
|
|
10259
10302
|
views: row.views.map((view) => {
|
|
10260
|
-
if (!isRecord(view) || typeof view.name !== "string" || typeof view.hidden !== "boolean" || typeof view.props !== "string")
|
|
10303
|
+
if (!isRecord(view) || typeof view.name !== "string" || typeof view.hidden !== "boolean" || typeof view.props !== "string" || typeof view.appContext !== "boolean")
|
|
10261
10304
|
throw new Error("expo-types printed an invalid view");
|
|
10262
|
-
return {
|
|
10305
|
+
return {
|
|
10306
|
+
name: view.name,
|
|
10307
|
+
hidden: view.hidden,
|
|
10308
|
+
props: view.props,
|
|
10309
|
+
appContext: view.appContext
|
|
10310
|
+
};
|
|
10263
10311
|
}),
|
|
10264
10312
|
props: row.props.map((entry) => {
|
|
10265
10313
|
if (!isRecord(entry) || typeof entry.name !== "string" || typeof entry.hidden !== "boolean" || !Array.isArray(entry.states) || !entry.states.every((state) => typeof state === "string"))
|
|
@@ -10271,7 +10319,7 @@ function readExpoTypes(output) {
|
|
|
10271
10319
|
}
|
|
10272
10320
|
function scanExpoTypes(toolchain, script, sources) {
|
|
10273
10321
|
const candidates = sources.filter(
|
|
10274
|
-
(file) => /\bRecord\b|\benum\s+class\b|\bExpoComposeView\b|\bExpoView\b|\bComposeProps\b/.test(
|
|
10322
|
+
(file) => /\bRecord\b|\benum\s+class\b|\bExpoComposeView\b|\bExpoView\b|\bComposeProps\b|:\s*(?:[A-Za-z0-9_.]+\.)?(?:View|FrameLayout|LinearLayout|ViewGroup)\b/.test(
|
|
10275
10323
|
import_node_fs16.default.readFileSync(file, "utf8")
|
|
10276
10324
|
)
|
|
10277
10325
|
);
|
|
@@ -10352,7 +10400,7 @@ function expoTypeSources(files2) {
|
|
|
10352
10400
|
}
|
|
10353
10401
|
const views = [
|
|
10354
10402
|
...file.views.filter((view) => !view.hidden).map(
|
|
10355
|
-
(view) => ` dev.peach.expo.PeachExpoTypes.view(${view.name}::class, ${view.props ? `${view.props}::class` : "null"}) { context, appContext -> ${view.name}(context, appContext) }`
|
|
10403
|
+
(view) => ` dev.peach.expo.PeachExpoTypes.view(${view.name}::class, ${view.props ? `${view.props}::class` : "null"}) { context, appContext -> ${view.name}(${view.appContext ? "context, appContext" : "context"}) }`
|
|
10356
10404
|
),
|
|
10357
10405
|
...file.props.filter((entry) => !entry.hidden).map(
|
|
10358
10406
|
(entry) => [
|