peachsim 0.1.2180 → 0.1.2185
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/commands/shell-url.ts +28 -22
- package/cli/outbound-endpoints.ts +11 -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 +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +457 -96
- 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 +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +352 -58
- 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 +415 -85
- package/dist-lib/host/fetch-proxy-handler.cjs +7 -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 +7 -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 +7 -4
- package/dist-lib/native-app-identity-project.cjs +6 -3
- package/dist-lib/native-app-identity-project.mjs +6 -3
- 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 +25 -24
- package/dist-lib/public-origins-lib.json +63 -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 +447 -93
- package/dist-lib/swift-compile.cjs +13 -4
- package/dist-lib/swift-compile.mjs +13 -4
- package/dist-lib/swift-package.cjs +26 -1
- package/dist-lib/swift-package.mjs +25 -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 +298 -27
- package/dist-lib/vite.cjs +7 -4
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +14 -0
- package/package.json +1 -1
- package/sdk/ios/System/Library/Frameworks/ActivityKit.framework/Headers/ActivityKit.h +1 -0
- package/sdk/ios/System/Library/Frameworks/ActivityKit.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/usr/lib/swift/ActivityKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +14 -0
- package/sdk/ios/usr/lib/swift/CoreGraphics.swiftmodule/arm64-apple-ios-simulator.swiftinterface +14 -0
- package/sdk/ios/usr/lib/swift/Dispatch.swiftmodule/arm64-apple-ios-simulator.swiftinterface +3 -0
- package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +147 -16
- package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +5 -0
- package/src/expo-native-workspace.ts +19 -21
- package/src/expo-swift-bundle.ts +6 -1
- package/src/expo-swift-host.ts +35 -6
- package/src/expoSwiftContract.ts +3 -0
- package/src/native-bundles.ts +30 -10
- package/src/one-sdk/source.ts +10 -4
- package/src/one-sdk-bundle.ts +56 -24
- package/src/swift-compile.ts +3 -1
- package/src/swift-interface-bodies.ts +165 -0
- package/src/swift-objc-standin.ts +73 -13
- package/src/swift-package.ts +26 -0
- package/src/swift-source-pods.ts +27 -4
- package/src/swift-standin-emit.ts +30 -3
- package/src/swift-standins.ts +75 -12
- package/src/swift-submit.ts +2 -1
- package/src/wasm-optimize.ts +11 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2185 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -39,7 +39,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
39
39
|
var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
|
|
40
40
|
var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
|
|
41
41
|
"<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
|
|
42
|
-
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "
|
|
42
|
+
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "65a0698bf022ace2f4254f3f891828dedf403d61c102238e242084a2279e04eb", "home-paths.ts": "f5583b61f8bdd81823b3b29ff519a48daf9993719f194ddb7de22218472e90f9", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "5f41cd0bd86cb0cffbfb0047348b963f81d5e51cb0e8dd574c739b1a27aa56de", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -11233,6 +11233,29 @@ function moduleMapName(text6) {
|
|
|
11233
11233
|
);
|
|
11234
11234
|
return index < 0 ? void 0 : tokens2[index + 1];
|
|
11235
11235
|
}
|
|
11236
|
+
function moduleMapModules(text6) {
|
|
11237
|
+
const modules = [];
|
|
11238
|
+
const token = /\/\*[\s\S]*?\*\/|\/\/[^\n]*|"[^"]*"|\{|\}|\bmodule\s+([\w.]+)/g;
|
|
11239
|
+
let depth = 0;
|
|
11240
|
+
let start = -1;
|
|
11241
|
+
let name3 = "";
|
|
11242
|
+
for (const match of text6.matchAll(token)) {
|
|
11243
|
+
if (match[0] === "{") depth++;
|
|
11244
|
+
else if (match[0] === "}") {
|
|
11245
|
+
depth--;
|
|
11246
|
+
if (depth === 0 && start >= 0) {
|
|
11247
|
+
modules.push({ name: name3, text: text6.slice(start, match.index + 1) });
|
|
11248
|
+
start = -1;
|
|
11249
|
+
}
|
|
11250
|
+
} else if (match[1] !== void 0 && depth === 0) {
|
|
11251
|
+
const before = text6.slice(0, match.index).trimEnd();
|
|
11252
|
+
if (/\bextern$/.test(before)) continue;
|
|
11253
|
+
start = match.index;
|
|
11254
|
+
name3 = match[1];
|
|
11255
|
+
}
|
|
11256
|
+
}
|
|
11257
|
+
return modules;
|
|
11258
|
+
}
|
|
11236
11259
|
function swiftTargetModuleName(name3) {
|
|
11237
11260
|
return name3.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
|
|
11238
11261
|
}
|
|
@@ -15560,6 +15583,143 @@ var init_swift_objc_runtime = __esm({
|
|
|
15560
15583
|
}
|
|
15561
15584
|
});
|
|
15562
15585
|
|
|
15586
|
+
// src/swift-interface-bodies.ts
|
|
15587
|
+
function declarationKind(head) {
|
|
15588
|
+
const words2 = head.replace(/@\w+(?:\((?:[^()]|\([^()]*\))*\))?/g, " ").match(/[A-Za-z_]\w*/g);
|
|
15589
|
+
for (const word of words2 ?? []) {
|
|
15590
|
+
if (word === "func" || word === "init" || word === "deinit") return "function";
|
|
15591
|
+
if (word === "var" || word === "let" || word === "subscript") return "property";
|
|
15592
|
+
if (word === "struct" || word === "class" || word === "enum" || word === "protocol" || word === "extension" || word === "actor" || word === "precedencegroup")
|
|
15593
|
+
return "container";
|
|
15594
|
+
}
|
|
15595
|
+
return "container";
|
|
15596
|
+
}
|
|
15597
|
+
function skipLiteral(text6, i) {
|
|
15598
|
+
if (text6.startsWith("//", i)) {
|
|
15599
|
+
const end = text6.indexOf("\n", i);
|
|
15600
|
+
return end < 0 ? text6.length : end;
|
|
15601
|
+
}
|
|
15602
|
+
if (text6.startsWith("/*", i)) {
|
|
15603
|
+
const end = text6.indexOf("*/", i + 2);
|
|
15604
|
+
return end < 0 ? text6.length : end + 2;
|
|
15605
|
+
}
|
|
15606
|
+
if (text6[i] !== '"' && text6[i] !== "#") return i;
|
|
15607
|
+
let hashes = 0;
|
|
15608
|
+
let j = i;
|
|
15609
|
+
while (text6[j] === "#") {
|
|
15610
|
+
hashes++;
|
|
15611
|
+
j++;
|
|
15612
|
+
}
|
|
15613
|
+
if (text6[j] !== '"') return i;
|
|
15614
|
+
const multiline = text6.startsWith('"""', j);
|
|
15615
|
+
const open = multiline ? '"""' : '"';
|
|
15616
|
+
j += open.length;
|
|
15617
|
+
const close = `${open}${"#".repeat(hashes)}`;
|
|
15618
|
+
const escape2 = `\\${"#".repeat(hashes)}`;
|
|
15619
|
+
while (j < text6.length) {
|
|
15620
|
+
if (text6.startsWith(escape2, j)) j += escape2.length + 1;
|
|
15621
|
+
else if (text6.startsWith(close, j)) return j + close.length;
|
|
15622
|
+
else j++;
|
|
15623
|
+
}
|
|
15624
|
+
return text6.length;
|
|
15625
|
+
}
|
|
15626
|
+
function skipBlock(text6, open) {
|
|
15627
|
+
let depth = 0;
|
|
15628
|
+
for (let i = open; i < text6.length; ) {
|
|
15629
|
+
const after = skipLiteral(text6, i);
|
|
15630
|
+
if (after !== i) {
|
|
15631
|
+
i = after;
|
|
15632
|
+
continue;
|
|
15633
|
+
}
|
|
15634
|
+
if (text6[i] === "{") depth++;
|
|
15635
|
+
else if (text6[i] === "}" && --depth === 0) return i + 1;
|
|
15636
|
+
i++;
|
|
15637
|
+
}
|
|
15638
|
+
return text6.length;
|
|
15639
|
+
}
|
|
15640
|
+
function skipExpression(text6, start) {
|
|
15641
|
+
let depth = 0;
|
|
15642
|
+
for (let i = start; i < text6.length; ) {
|
|
15643
|
+
const after = skipLiteral(text6, i);
|
|
15644
|
+
if (after !== i) {
|
|
15645
|
+
i = after;
|
|
15646
|
+
continue;
|
|
15647
|
+
}
|
|
15648
|
+
const char = text6[i];
|
|
15649
|
+
if (char === "(" || char === "[" || char === "{" || char === "<") depth++;
|
|
15650
|
+
else if (char === ">" && text6[i - 1] !== "-") depth--;
|
|
15651
|
+
else if (char === ")" || char === "]" || char === "}") {
|
|
15652
|
+
if (depth === 0) return i;
|
|
15653
|
+
depth--;
|
|
15654
|
+
} else if (char === "," && depth === 0) return i;
|
|
15655
|
+
i++;
|
|
15656
|
+
}
|
|
15657
|
+
return text6.length;
|
|
15658
|
+
}
|
|
15659
|
+
function swiftInterfaceWithoutBodies(text6, keepDefaults = false) {
|
|
15660
|
+
let out = "";
|
|
15661
|
+
const frames = [];
|
|
15662
|
+
let parens = 0;
|
|
15663
|
+
let lineStart = 0;
|
|
15664
|
+
for (let i = 0; i < text6.length; ) {
|
|
15665
|
+
const after = skipLiteral(text6, i);
|
|
15666
|
+
if (after !== i) {
|
|
15667
|
+
out += text6.slice(i, after);
|
|
15668
|
+
i = after;
|
|
15669
|
+
continue;
|
|
15670
|
+
}
|
|
15671
|
+
const char = text6[i];
|
|
15672
|
+
if (char === "=" && parens > 0 && text6[i - 1] === " " && text6[i + 1] === " ") {
|
|
15673
|
+
out = out.trimEnd();
|
|
15674
|
+
i = skipExpression(text6, i + 1);
|
|
15675
|
+
continue;
|
|
15676
|
+
}
|
|
15677
|
+
if (char === "\n") lineStart = out.length + 1;
|
|
15678
|
+
else if (char === "(") parens++;
|
|
15679
|
+
else if (char === ")") parens--;
|
|
15680
|
+
else if (char === "}") {
|
|
15681
|
+
frames.pop();
|
|
15682
|
+
} else if (char === "{") {
|
|
15683
|
+
const parent = frames.at(-1);
|
|
15684
|
+
const head = out.slice(lineStart);
|
|
15685
|
+
if (parens > 0 || parent === "expression") frames.push("expression");
|
|
15686
|
+
else if (parent === "accessors") {
|
|
15687
|
+
out = `${out.slice(0, lineStart)}${head.replace(INLINE_ATTRIBUTE, "")}`.trimEnd();
|
|
15688
|
+
i = skipBlock(text6, i);
|
|
15689
|
+
continue;
|
|
15690
|
+
} else {
|
|
15691
|
+
const kind = declarationKind(head);
|
|
15692
|
+
const body = text6.slice(i + 1, skipBlock(text6, i) - 1);
|
|
15693
|
+
if (kind === "function") {
|
|
15694
|
+
out = `${out.slice(0, lineStart)}${head.replace(INLINE_ATTRIBUTE, "")}`.trimEnd();
|
|
15695
|
+
i = skipBlock(text6, i);
|
|
15696
|
+
continue;
|
|
15697
|
+
}
|
|
15698
|
+
const bare = body.split(/\s+/).every((word) => word === "" || ACCESSOR.test(word));
|
|
15699
|
+
frames.push(kind === "property" && !bare ? "accessors" : "container");
|
|
15700
|
+
if (kind === "property" && bare) {
|
|
15701
|
+
out += `{${body}}`;
|
|
15702
|
+
i = skipBlock(text6, i);
|
|
15703
|
+
frames.pop();
|
|
15704
|
+
continue;
|
|
15705
|
+
}
|
|
15706
|
+
}
|
|
15707
|
+
}
|
|
15708
|
+
out += char;
|
|
15709
|
+
i++;
|
|
15710
|
+
}
|
|
15711
|
+
return out.replace(INLINE_ATTRIBUTE, "");
|
|
15712
|
+
}
|
|
15713
|
+
var INLINE_ATTRIBUTE, ACCESSOR;
|
|
15714
|
+
var init_swift_interface_bodies = __esm({
|
|
15715
|
+
"src/swift-interface-bodies.ts"() {
|
|
15716
|
+
"use strict";
|
|
15717
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
15718
|
+
INLINE_ATTRIBUTE = /@(?:inlinable|_alwaysEmitIntoClient|_transparent|inline\(__always\)|_effects\([^()]*\)|_specialize\((?:[^()]|\([^()]*\))*\))\s*/g;
|
|
15719
|
+
ACCESSOR = /^(?:mutating|nonmutating|async|throws|rethrows|get|set|_modify|_read)$/;
|
|
15720
|
+
}
|
|
15721
|
+
});
|
|
15722
|
+
|
|
15563
15723
|
// src/swift-objc-sdk.ts
|
|
15564
15724
|
var import_node_path22, IOS_SDK_TARGET, OVERLAY_PATH, tree, IOS_SDK_HEADERS, IOS_SDK_OVERLAYS;
|
|
15565
15725
|
var init_swift_objc_sdk = __esm({
|
|
@@ -15605,7 +15765,7 @@ function restoreSwiftInterfaceSPI(interfaceText, module2, graphs) {
|
|
|
15605
15765
|
let depth = 0;
|
|
15606
15766
|
for (const line of interfaceText.split("\n")) {
|
|
15607
15767
|
const enclosing = scopes.at(-1)?.path ?? [];
|
|
15608
|
-
const declaration = /^\s*(?:@[\w.]+(?:\([^)]*\))?\s+|\w+\s+)*?(class(?!\s+(?:func|var|subscript)\b)|struct|enum|protocol|actor|extension|func|var|let|init|subscript|typealias|case)\b\s*([\w.`]*)/.exec(
|
|
15768
|
+
const declaration = /^\s*(?:@[\w.]+(?:\([^)]*\))?\s+|\w+\s+)*?(class(?!\s+(?:func|var|subscript)\b)|struct|enum|protocol|actor|extension|func|var|let|init|subscript|typealias|case)\b\s*([/=\-+!*%<>&|^~?]+|[\w.`]*)/.exec(
|
|
15609
15769
|
line.replace(/::/g, ".")
|
|
15610
15770
|
);
|
|
15611
15771
|
if (declaration) {
|
|
@@ -16527,7 +16687,12 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16527
16687
|
const list2 = [
|
|
16528
16688
|
...parent ? [parent] : [],
|
|
16529
16689
|
...(conforms.get(id) ?? []).filter(
|
|
16530
|
-
(name3) => !ancestors.has(name3) && !inherited.has(conformanceTargets.get(id).get(name3)) && !(parent && objectConformers.has(id) && [
|
|
16690
|
+
(name3) => !ancestors.has(name3) && !inherited.has(conformanceTargets.get(id).get(name3)) && !(parent && objectConformers.has(id) && [
|
|
16691
|
+
"Hashable",
|
|
16692
|
+
"Equatable",
|
|
16693
|
+
"CustomStringConvertible",
|
|
16694
|
+
"CustomDebugStringConvertible"
|
|
16695
|
+
].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options.unconformed?.get(path94)?.has(name3)
|
|
16531
16696
|
)
|
|
16532
16697
|
].filter((name3, at, all2) => all2.indexOf(name3) === at);
|
|
16533
16698
|
const parentSymbol = superId.has(id) ? byId.get(superId.get(id)) : void 0;
|
|
@@ -17034,7 +17199,26 @@ var init_swift_standin_emit = __esm({
|
|
|
17034
17199
|
["s:SE", "Encodable"],
|
|
17035
17200
|
["s:Se", "Decodable"],
|
|
17036
17201
|
["s:s23CustomStringConvertibleP", "CustomStringConvertible"],
|
|
17037
|
-
["s:s9CodingKeyP", "CodingKey"]
|
|
17202
|
+
["s:s9CodingKeyP", "CodingKey"],
|
|
17203
|
+
["s:SL", "Comparable"],
|
|
17204
|
+
["s:ST", "Sequence"],
|
|
17205
|
+
["s:St", "IteratorProtocol"],
|
|
17206
|
+
["s:Sl", "Collection"],
|
|
17207
|
+
["s:SK", "BidirectionalCollection"],
|
|
17208
|
+
["s:Sk", "RandomAccessCollection"],
|
|
17209
|
+
["s:SM", "MutableCollection"],
|
|
17210
|
+
["s:Sm", "RangeReplaceableCollection"],
|
|
17211
|
+
["s:s28CustomDebugStringConvertibleP", "CustomDebugStringConvertible"],
|
|
17212
|
+
["s:s25LosslessStringConvertibleP", "LosslessStringConvertible"],
|
|
17213
|
+
["s:s20TextOutputStreamableP", "TextOutputStreamable"],
|
|
17214
|
+
["s:Sx", "Strideable"],
|
|
17215
|
+
["s:s18AdditiveArithmeticP", "AdditiveArithmetic"],
|
|
17216
|
+
["s:s25ExpressibleByArrayLiteralP", "ExpressibleByArrayLiteral"],
|
|
17217
|
+
["s:s30ExpressibleByDictionaryLiteralP", "ExpressibleByDictionaryLiteral"],
|
|
17218
|
+
["s:s26ExpressibleByStringLiteralP", "ExpressibleByStringLiteral"],
|
|
17219
|
+
["s:s27ExpressibleByIntegerLiteralP", "ExpressibleByIntegerLiteral"],
|
|
17220
|
+
["s:s25ExpressibleByFloatLiteralP", "ExpressibleByFloatLiteral"],
|
|
17221
|
+
["s:s27ExpressibleByBooleanLiteralP", "ExpressibleByBooleanLiteral"]
|
|
17038
17222
|
]);
|
|
17039
17223
|
LEADING_ATTRS = /^((?:@\w+(?:\([^)]*\))?\s*|nonisolated\s+)*)(.*)$/s;
|
|
17040
17224
|
OBJC_ONLY = /@(?:objcMembers|objc|IBOutlet|IBInspectable|IBAction|IBSegueAction|GKInspectable|nonobjc|NSCopying|NSManaged)(?:\([^)]*\))?\s*|\bdynamic\s+/g;
|
|
@@ -17348,6 +17532,43 @@ function sdkDeclaration(name3) {
|
|
|
17348
17532
|
}
|
|
17349
17533
|
return sdkDeclarations.get(name3) ?? null;
|
|
17350
17534
|
}
|
|
17535
|
+
function intakeInterface(text6, keepDefaults = false) {
|
|
17536
|
+
return swiftInterfaceWithoutBodies(text6, keepDefaults).replace(/^((?:@_exported[ \t]+)?import[ \t]+)(\w+)\.[\w.]+[ \t]*$/gm, "$1$2").replace(/\bCoreFoundation\.(?=CG)/g, "CoreGraphics.").replace(/\bCoreFoundation\.(?=\w)/g, "Foundation.").replace(/\bDarwin\.OSStatus\b/g, "Swift.Int32").replace(
|
|
17537
|
+
/\bFoundation\.Data\.(?=Base64(?:En|De)codingOptions\b)/g,
|
|
17538
|
+
"Foundation.NSData."
|
|
17539
|
+
);
|
|
17540
|
+
}
|
|
17541
|
+
function stageVendorFrameworks(dir, stage) {
|
|
17542
|
+
import_node_fs24.default.mkdirSync(stage, { recursive: true });
|
|
17543
|
+
for (const entry of import_node_fs24.default.readdirSync(dir)) {
|
|
17544
|
+
if (!entry.endsWith(".framework")) continue;
|
|
17545
|
+
const source = import_node_path23.default.join(dir, entry);
|
|
17546
|
+
const target = import_node_path23.default.join(stage, entry);
|
|
17547
|
+
import_node_fs24.default.mkdirSync(target, { recursive: true });
|
|
17548
|
+
for (const child of import_node_fs24.default.readdirSync(source)) {
|
|
17549
|
+
if (child !== "Modules") {
|
|
17550
|
+
import_node_fs24.default.symlinkSync(import_node_path23.default.join(source, child), import_node_path23.default.join(target, child));
|
|
17551
|
+
continue;
|
|
17552
|
+
}
|
|
17553
|
+
for (const file of import_node_fs24.default.readdirSync(import_node_path23.default.join(source, child), {
|
|
17554
|
+
recursive: true,
|
|
17555
|
+
encoding: "utf8"
|
|
17556
|
+
})) {
|
|
17557
|
+
const from = import_node_path23.default.join(source, child, file);
|
|
17558
|
+
const to = import_node_path23.default.join(target, child, file);
|
|
17559
|
+
if (import_node_fs24.default.statSync(from).isDirectory()) {
|
|
17560
|
+
import_node_fs24.default.mkdirSync(to, { recursive: true });
|
|
17561
|
+
continue;
|
|
17562
|
+
}
|
|
17563
|
+
import_node_fs24.default.mkdirSync(import_node_path23.default.dirname(to), { recursive: true });
|
|
17564
|
+
if (file.endsWith(".swiftinterface"))
|
|
17565
|
+
import_node_fs24.default.writeFileSync(to, intakeInterface(import_node_fs24.default.readFileSync(from, "utf8")));
|
|
17566
|
+
else import_node_fs24.default.copyFileSync(from, to);
|
|
17567
|
+
}
|
|
17568
|
+
}
|
|
17569
|
+
}
|
|
17570
|
+
return stage;
|
|
17571
|
+
}
|
|
17351
17572
|
function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vendorFrameworks = []) {
|
|
17352
17573
|
if (!import_node_fs24.default.existsSync(stdlib))
|
|
17353
17574
|
throw new Error(
|
|
@@ -17375,6 +17596,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
17375
17596
|
import_node_fs24.default.writeFileSync(file, text6);
|
|
17376
17597
|
}
|
|
17377
17598
|
const interfaceCopies = [];
|
|
17599
|
+
let keepDefaults = true;
|
|
17378
17600
|
if (framework) {
|
|
17379
17601
|
import_node_fs24.default.mkdirSync(import_node_path23.default.join(frameworks, `${surface.module}.framework`, "Modules"), {
|
|
17380
17602
|
recursive: true
|
|
@@ -17401,10 +17623,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
17401
17623
|
interfaceCopies.push(import_node_path23.default.join(to, name3));
|
|
17402
17624
|
import_node_fs24.default.writeFileSync(
|
|
17403
17625
|
import_node_path23.default.join(to, name3),
|
|
17404
|
-
import_node_fs24.default.readFileSync(import_node_path23.default.join(from, name3), "utf8")
|
|
17405
|
-
/\bFoundation\.Data\.(?=Base64(?:En|De)codingOptions\b)/g,
|
|
17406
|
-
"Foundation.NSData."
|
|
17407
|
-
)
|
|
17626
|
+
intakeInterface(import_node_fs24.default.readFileSync(import_node_path23.default.join(from, name3), "utf8"), true)
|
|
17408
17627
|
);
|
|
17409
17628
|
}
|
|
17410
17629
|
}
|
|
@@ -17466,7 +17685,10 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
17466
17685
|
stubs,
|
|
17467
17686
|
"-I",
|
|
17468
17687
|
stubIncludes,
|
|
17469
|
-
...vendorFrameworks.flatMap((dir) => [
|
|
17688
|
+
...vendorFrameworks.flatMap((dir, index) => [
|
|
17689
|
+
"-F",
|
|
17690
|
+
stageVendorFrameworks(dir, import_node_path23.default.join(work, "vendor-frameworks", String(index)))
|
|
17691
|
+
])
|
|
17470
17692
|
];
|
|
17471
17693
|
const missing2 = /* @__PURE__ */ new Map();
|
|
17472
17694
|
const stubbed = /* @__PURE__ */ new Set();
|
|
@@ -17672,6 +17894,13 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
17672
17894
|
);
|
|
17673
17895
|
}
|
|
17674
17896
|
}
|
|
17897
|
+
if ((!progress || round === ROUNDS) && keepDefaults && interfaceCopies.length > 0) {
|
|
17898
|
+
keepDefaults = false;
|
|
17899
|
+
for (const file of interfaceCopies)
|
|
17900
|
+
import_node_fs24.default.writeFileSync(file, swiftInterfaceWithoutBodies(import_node_fs24.default.readFileSync(file, "utf8")));
|
|
17901
|
+
writeHeaders();
|
|
17902
|
+
continue;
|
|
17903
|
+
}
|
|
17675
17904
|
if (!progress || round === ROUNDS)
|
|
17676
17905
|
throw new Error(
|
|
17677
17906
|
`its headers do not import as Swift: ${errors.length > 0 ? [...new Set(errors.map((match) => match[4]))].slice(0, 10).join("; ") : `swift-symbolgraph-extract ${run11.signal ?? `exit ${run11.status}`}: ${(run11.stderr.trim() || run11.stdout.trim() || "no diagnostic").slice(0, 4e3)}`}`
|
|
@@ -18236,6 +18465,7 @@ var init_swift_objc_standin = __esm({
|
|
|
18236
18465
|
import_node_fs24 = __toESM(require("node:fs"), 1);
|
|
18237
18466
|
import_node_path23 = __toESM(require("node:path"), 1);
|
|
18238
18467
|
init_is_record();
|
|
18468
|
+
init_swift_interface_bodies();
|
|
18239
18469
|
init_swift_objc_platform();
|
|
18240
18470
|
init_swift_objc_sdk();
|
|
18241
18471
|
init_swift_package();
|
|
@@ -24546,6 +24776,13 @@ var init_swift_guest_source_inputs = __esm({
|
|
|
24546
24776
|
|
|
24547
24777
|
// src/wasm-optimize.ts
|
|
24548
24778
|
async function runWasmOpt(file, output2, skipPasses, binary2) {
|
|
24779
|
+
const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
|
|
24780
|
+
const requestedCores = Number(process.env.BINARYEN_CORES);
|
|
24781
|
+
const environment = { ...process.env, WASM_OPT_PATH: binary2 };
|
|
24782
|
+
if (Number.isInteger(admittedCores) && admittedCores > 0)
|
|
24783
|
+
environment.BINARYEN_CORES = String(
|
|
24784
|
+
Number.isInteger(requestedCores) && requestedCores > 0 ? Math.min(admittedCores, requestedCores) : admittedCores
|
|
24785
|
+
);
|
|
24549
24786
|
const result = await (0, import_wasm_opt.wasmOpt)(
|
|
24550
24787
|
[
|
|
24551
24788
|
"-Oz",
|
|
@@ -24555,7 +24792,7 @@ async function runWasmOpt(file, output2, skipPasses, binary2) {
|
|
|
24555
24792
|
"-o",
|
|
24556
24793
|
output2
|
|
24557
24794
|
],
|
|
24558
|
-
{ env:
|
|
24795
|
+
{ env: environment }
|
|
24559
24796
|
);
|
|
24560
24797
|
if (result.status !== 0)
|
|
24561
24798
|
throw new Error(`wasm-opt exited ${result.status}: ${result.stderr}`);
|
|
@@ -24591,6 +24828,7 @@ var init_wasm_optimize = __esm({
|
|
|
24591
24828
|
import_node_path32 = require("node:path");
|
|
24592
24829
|
init_src();
|
|
24593
24830
|
import_wasm_opt = require("wasm-opt");
|
|
24831
|
+
init_admitted_mac_build();
|
|
24594
24832
|
init_home_paths();
|
|
24595
24833
|
FEATURES = [
|
|
24596
24834
|
"threads",
|
|
@@ -29283,7 +29521,7 @@ function readCompiledArtifact(directory2, hash) {
|
|
|
29283
29521
|
return null;
|
|
29284
29522
|
const bytes = (0, import_node_fs42.readFileSync)(import_node_path41.default.join(directory2, "app.wasm"));
|
|
29285
29523
|
const gzip2 = (0, import_node_fs42.readFileSync)(import_node_path41.default.join(directory2, "icu.gz"));
|
|
29286
|
-
if ((0, import_node_crypto20.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto20.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length
|
|
29524
|
+
if ((0, import_node_crypto20.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto20.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length <= 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
|
|
29287
29525
|
return null;
|
|
29288
29526
|
return { hash, bytes, icu: { sha256: receipt.icu, gzip: gzip2 } };
|
|
29289
29527
|
} catch (error) {
|
|
@@ -30336,6 +30574,8 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
30336
30574
|
bytes: (0, import_node_fs42.readFileSync)(executable),
|
|
30337
30575
|
icu: await icu
|
|
30338
30576
|
};
|
|
30577
|
+
if (artifact.bytes.length <= 8)
|
|
30578
|
+
throw new Error("swift-compile: deferred linker produced no executable");
|
|
30339
30579
|
if (!options.project) saveCompiledArtifact(root, artifact);
|
|
30340
30580
|
saveSharedArtifact(sharedRoot, artifact);
|
|
30341
30581
|
report("compiled artifact verified");
|
|
@@ -30514,7 +30754,7 @@ var init_swift_compile = __esm({
|
|
|
30514
30754
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
30515
30755
|
MULTI_MANIFEST_VERSION = 68;
|
|
30516
30756
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
30517
|
-
compilerSourceDigest = true ? "
|
|
30757
|
+
compilerSourceDigest = true ? "e48d05f659c020e9d4ddc0f6a17da7924aae807faacd6bef7cbed911c43d08cc" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
30518
30758
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
30519
30759
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
30520
30760
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
@@ -35524,7 +35764,7 @@ var init_swift_submit = __esm({
|
|
|
35524
35764
|
MAX_SWIFT_COMPILE_IMAGES = 256;
|
|
35525
35765
|
MAX_SWIFT_COMPILE_IMAGE_BYTES = 4 * 1024 * 1024;
|
|
35526
35766
|
MAX_SWIFT_COMPILE_IMAGE_TOTAL_BYTES = 16 * 1024 * 1024;
|
|
35527
|
-
SWIFT_HOST_ABI =
|
|
35767
|
+
SWIFT_HOST_ABI = 70;
|
|
35528
35768
|
POLL_INTERVAL_MS = 1500;
|
|
35529
35769
|
}
|
|
35530
35770
|
});
|
|
@@ -37534,7 +37774,7 @@ function initializeWorkspaceGit(root, work) {
|
|
|
37534
37774
|
});
|
|
37535
37775
|
const tracked = trackedSourceFiles(root, work);
|
|
37536
37776
|
if (tracked.length > 0)
|
|
37537
|
-
(0, import_node_child_process32.execFileSync)("git", ["
|
|
37777
|
+
(0, import_node_child_process32.execFileSync)("git", ["update-index", "--add", "-z", "--stdin"], {
|
|
37538
37778
|
cwd: work,
|
|
37539
37779
|
env: { ...process.env, ...isolatedGitEnv },
|
|
37540
37780
|
input: tracked.join("\0"),
|
|
@@ -37634,6 +37874,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
37634
37874
|
const nodeVersion = typeof manifest.engines?.node === "string" && /^\d+(\.\d+){0,2}$/.test(manifest.engines.node) ? manifest.engines.node : null;
|
|
37635
37875
|
const prefix = nodeVersion ? ["mise", "exec", `node@${nodeVersion}`, "--"] : [];
|
|
37636
37876
|
const bunPrefix = import_node_path57.default.join(cacheDir(), "package-managers", manager);
|
|
37877
|
+
const bunExecutable = import_node_path57.default.join(bunPrefix, "node_modules/.bin/bun");
|
|
37637
37878
|
const install = manager === "pnpm" || manager.startsWith("pnpm@") ? [
|
|
37638
37879
|
"npx",
|
|
37639
37880
|
"--yes",
|
|
@@ -37642,11 +37883,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
37642
37883
|
"--frozen-lockfile",
|
|
37643
37884
|
// the copied node_modules link into the store pnpm chose on the app's volume
|
|
37644
37885
|
...pnpmStoreArgs(root)
|
|
37645
|
-
] : manager === "yarn" || manager.startsWith("yarn@") ? ["corepack", "yarn", "install", "--immutable"] : manager === "bun" || manager.startsWith("bun@") ? manager === "bun" ? ["bun", "install", "--frozen-lockfile"] : [
|
|
37646
|
-
import_node_path57.default.join(bunPrefix, "node_modules/.bin/bun"),
|
|
37647
|
-
"install",
|
|
37648
|
-
"--frozen-lockfile"
|
|
37649
|
-
] : (
|
|
37886
|
+
] : manager === "yarn" || manager.startsWith("yarn@") ? ["corepack", "yarn", "install", "--immutable"] : manager === "bun" || manager.startsWith("bun@") ? manager === "bun" ? ["bun", "install", "--frozen-lockfile"] : [bunExecutable, "install", "--frozen-lockfile"] : (
|
|
37650
37887
|
// npm ci would delete the cloned tree before installing it again
|
|
37651
37888
|
["npm", "install", "--no-audit", "--no-fund"]
|
|
37652
37889
|
);
|
|
@@ -37655,22 +37892,22 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
37655
37892
|
const command = [...prefix, ...args];
|
|
37656
37893
|
await run11(command[0], command.slice(1), cwd, env);
|
|
37657
37894
|
};
|
|
37895
|
+
if (manager.startsWith("bun@") && (!projectReady || !import_node_fs57.default.existsSync(bunExecutable)))
|
|
37896
|
+
await execute(
|
|
37897
|
+
[
|
|
37898
|
+
"npm",
|
|
37899
|
+
"install",
|
|
37900
|
+
"--prefix",
|
|
37901
|
+
bunPrefix,
|
|
37902
|
+
// the bun package ships a placeholder binary its postinstall replaces
|
|
37903
|
+
"--ignore-scripts=false",
|
|
37904
|
+
"--no-audit",
|
|
37905
|
+
"--no-fund",
|
|
37906
|
+
manager
|
|
37907
|
+
],
|
|
37908
|
+
work
|
|
37909
|
+
);
|
|
37658
37910
|
if (!projectReady) {
|
|
37659
|
-
if (manager.startsWith("bun@"))
|
|
37660
|
-
await execute(
|
|
37661
|
-
[
|
|
37662
|
-
"npm",
|
|
37663
|
-
"install",
|
|
37664
|
-
"--prefix",
|
|
37665
|
-
bunPrefix,
|
|
37666
|
-
// the bun package ships a placeholder binary its postinstall replaces
|
|
37667
|
-
"--ignore-scripts=false",
|
|
37668
|
-
"--no-audit",
|
|
37669
|
-
"--no-fund",
|
|
37670
|
-
manager
|
|
37671
|
-
],
|
|
37672
|
-
work
|
|
37673
|
-
);
|
|
37674
37911
|
if (install[0] === "npm" && import_node_fs57.default.existsSync(import_node_path57.default.join(work, "package-lock.json"))) {
|
|
37675
37912
|
await execute(
|
|
37676
37913
|
["npm", "ci", "--dry-run", "--ignore-scripts", "--no-audit", "--no-fund"],
|
|
@@ -42712,7 +42949,7 @@ var init_swift_standin_digest = __esm({
|
|
|
42712
42949
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
42713
42950
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
42714
42951
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
42715
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
42952
|
+
STANDIN_SOURCE_DIGEST = true ? "0981767eef4ad46fe5cb602ee15f1de9ea06dac3a2edb4dab0f6d5279b018a3b" : standinSourceDigest();
|
|
42716
42953
|
}
|
|
42717
42954
|
});
|
|
42718
42955
|
|
|
@@ -43584,6 +43821,19 @@ function cxxOnly(surface) {
|
|
|
43584
43821
|
return false;
|
|
43585
43822
|
});
|
|
43586
43823
|
}
|
|
43824
|
+
function mapSurfaces(modulemap) {
|
|
43825
|
+
const text6 = import_node_fs74.default.readFileSync(modulemap, "utf8");
|
|
43826
|
+
const headers = import_node_path73.default.dirname(modulemap);
|
|
43827
|
+
const modules = moduleMapModules(text6);
|
|
43828
|
+
if (modules.length <= 1) {
|
|
43829
|
+
const module2 = moduleMapName(text6);
|
|
43830
|
+
return module2 ? [headerSurface(module2, modulemap, headers)] : [];
|
|
43831
|
+
}
|
|
43832
|
+
return modules.map(
|
|
43833
|
+
(module2) => headerSurface(module2.name, generatedModuleMap(`${module2.text}
|
|
43834
|
+
`, false), headers)
|
|
43835
|
+
);
|
|
43836
|
+
}
|
|
43587
43837
|
function simulatorSlice(xcframeworkDir) {
|
|
43588
43838
|
const slice = import_node_fs74.default.readdirSync(xcframeworkDir).filter((name3) => /^ios-.+-simulator$/.test(name3)).sort()[0];
|
|
43589
43839
|
return slice ? import_node_path73.default.join(xcframeworkDir, slice) : null;
|
|
@@ -43647,8 +43897,7 @@ function surfaces(xcframeworkDir, target, slice = simulatorSlice(xcframeworkDir)
|
|
|
43647
43897
|
const headers = import_node_path73.default.join(root, "Headers");
|
|
43648
43898
|
for (const map2 of files(headers, (name3) => name3 === "module.modulemap")) {
|
|
43649
43899
|
const modulemap = import_node_path73.default.join(headers, map2);
|
|
43650
|
-
|
|
43651
|
-
if (module2) found.push(headerSurface(module2, modulemap, import_node_path73.default.dirname(modulemap)));
|
|
43900
|
+
found.push(...mapSurfaces(modulemap));
|
|
43652
43901
|
}
|
|
43653
43902
|
if (found.length === 0 && files(headers, (name3) => name3.endsWith(".h")).length) {
|
|
43654
43903
|
const module2 = swiftTargetModuleName(target);
|
|
@@ -43782,9 +44031,13 @@ function swiftInterfaceForWasm(text6, cFlags) {
|
|
|
43782
44031
|
]);
|
|
43783
44032
|
return `${interop} ${xcc.join(" ")}`;
|
|
43784
44033
|
});
|
|
43785
|
-
|
|
43786
|
-
|
|
43787
|
-
|
|
44034
|
+
const lines = retargeted.split("\n");
|
|
44035
|
+
const required = lines.filter((line) => OPTIONAL_REQUIREMENT.test(line)).join("\n");
|
|
44036
|
+
return lines.map((line) => {
|
|
44037
|
+
if (/\benum\s/.test(line) && TYPE_DECLARATION.test(line)) {
|
|
44038
|
+
const name3 = /\benum\s+(\w+)/.exec(line)?.[1];
|
|
44039
|
+
return name3 && new RegExp(`\\b${name3}\\b`).test(required) && !/\bSwift\.Error\b/.test(line) ? line : line.replace(/@objc(?:\s*\([^()]*\))?\s+/g, "");
|
|
44040
|
+
}
|
|
43788
44041
|
if (TYPE_DECLARATION.test(line)) return line.replace(/@objcMembers\b/g, "");
|
|
43789
44042
|
if (OPTIONAL_REQUIREMENT.test(line)) return line;
|
|
43790
44043
|
return line.replace(OBJC_ATTRIBUTE, "");
|
|
@@ -44202,6 +44455,14 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
44202
44455
|
const plain = /* @__PURE__ */ new Set();
|
|
44203
44456
|
const unobjc = /* @__PURE__ */ new Set();
|
|
44204
44457
|
const trapped = /* @__PURE__ */ new Set();
|
|
44458
|
+
const unconformed = /* @__PURE__ */ new Map();
|
|
44459
|
+
const objcProtocols = new Set(
|
|
44460
|
+
graphs.flatMap(
|
|
44461
|
+
(graph) => graph.symbols.filter(
|
|
44462
|
+
(symbol2) => symbol2.kind.identifier === "swift.protocol" && symbol2.identifier.precise.startsWith("c:")
|
|
44463
|
+
).map((symbol2) => symbol2.pathComponents.join("."))
|
|
44464
|
+
)
|
|
44465
|
+
);
|
|
44205
44466
|
const file = import_node_path73.default.join(work, `${module2}.swift`);
|
|
44206
44467
|
const inert = binary2.placeholder !== void 0 || binary2.publicHeaders !== void 0 && binary2.assemblySources === void 0;
|
|
44207
44468
|
for (; ; ) {
|
|
@@ -44214,6 +44475,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
44214
44475
|
omit,
|
|
44215
44476
|
plain,
|
|
44216
44477
|
unobjc,
|
|
44478
|
+
unconformed,
|
|
44217
44479
|
trapped,
|
|
44218
44480
|
inert,
|
|
44219
44481
|
imports: [...placeholder?.peachImports ?? [], ...imports2],
|
|
@@ -44261,7 +44523,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
44261
44523
|
files: { [`${module2}.swift`]: source },
|
|
44262
44524
|
...imports2.length ? { dependencies: imports2 } : {}
|
|
44263
44525
|
};
|
|
44264
|
-
const before = omit.size + plain.size + unobjc.size + trapped.size;
|
|
44526
|
+
const before = omit.size + plain.size + unobjc.size + trapped.size + unconformed.size;
|
|
44265
44527
|
const elsewhere = [];
|
|
44266
44528
|
for (const match of check2.stderr.matchAll(/^(\S+?):(\d+):\d+: error: (.*)$/gm)) {
|
|
44267
44529
|
const owner = match[1] === file ? owners[Number(match[2]) - 1] : void 0;
|
|
@@ -44269,6 +44531,13 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
44269
44531
|
unobjc.add(owner);
|
|
44270
44532
|
continue;
|
|
44271
44533
|
}
|
|
44534
|
+
const conformance = /^type '\w+' does not conform to protocol '(\w+)'$/.exec(
|
|
44535
|
+
match[3]
|
|
44536
|
+
)?.[1];
|
|
44537
|
+
if (owner && conformance && objcProtocols.has(conformance)) {
|
|
44538
|
+
unconformed.set(owner, /* @__PURE__ */ new Set([...unconformed.get(owner) ?? [], conformance]));
|
|
44539
|
+
continue;
|
|
44540
|
+
}
|
|
44272
44541
|
if (owner && swiftPaths.has(owner))
|
|
44273
44542
|
throw new Error(
|
|
44274
44543
|
`Swift declaration ${module2}.${owner} does not typecheck: ${match[3]}`
|
|
@@ -44284,7 +44553,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
44284
44553
|
else if (owner) omit.set(owner, `rejected by swiftc: ${match[3]}`);
|
|
44285
44554
|
else elsewhere.push(match[3]);
|
|
44286
44555
|
}
|
|
44287
|
-
if (omit.size + plain.size + unobjc.size + trapped.size === before)
|
|
44556
|
+
if (omit.size + plain.size + unobjc.size + trapped.size + unconformed.size === before)
|
|
44288
44557
|
throw new Error(
|
|
44289
44558
|
`its generated source does not typecheck: ${elsewhere.slice(0, 3).join("; ") || check2.stderr.trim().slice(0, 400)}`
|
|
44290
44559
|
);
|
|
@@ -44409,7 +44678,16 @@ function splitDeclarators(statement, names) {
|
|
|
44409
44678
|
);
|
|
44410
44679
|
}
|
|
44411
44680
|
function cStandin(surface, binary2, toolchain, work) {
|
|
44412
|
-
const
|
|
44681
|
+
const everyHeader = files(surface.headers, (name3) => name3.endsWith(".h"));
|
|
44682
|
+
const moduleRoots = moduleMapHeaders(surface.modulemap, everyHeader);
|
|
44683
|
+
const headers = [...moduleRoots];
|
|
44684
|
+
for (let at = 0; at < headers.length; at++)
|
|
44685
|
+
for (const [, local] of import_node_fs74.default.readFileSync(import_node_path73.default.join(surface.headers, headers[at]), "utf8").matchAll(/^\s*#\s*(?:include|import)\s*["<]([^">]+)[">]/gm)) {
|
|
44686
|
+
const file = import_node_path73.default.posix.normalize(
|
|
44687
|
+
import_node_path73.default.posix.join(import_node_path73.default.posix.dirname(headers[at]), local)
|
|
44688
|
+
);
|
|
44689
|
+
if (everyHeader.includes(file) && !headers.includes(file)) headers.push(file);
|
|
44690
|
+
}
|
|
44413
44691
|
const framework = import_node_path73.default.basename(import_node_path73.default.dirname(surface.modulemap)) === "Modules";
|
|
44414
44692
|
const headerDirectory = framework ? `${surface.module}.framework/Headers` : ".";
|
|
44415
44693
|
const texts = new Map(
|
|
@@ -44424,9 +44702,7 @@ function cStandin(surface, binary2, toolchain, work) {
|
|
|
44424
44702
|
import_node_fs74.default.mkdirSync(import_node_path73.default.dirname(import_node_path73.default.join(include, file)), { recursive: true });
|
|
44425
44703
|
import_node_fs74.default.writeFileSync(import_node_path73.default.join(include, file), text6);
|
|
44426
44704
|
}
|
|
44427
|
-
const roots =
|
|
44428
|
-
(file) => import_node_path73.default.posix.join(headerDirectory, file)
|
|
44429
|
-
);
|
|
44705
|
+
const roots = moduleRoots.map((file) => import_node_path73.default.posix.join(headerDirectory, file));
|
|
44430
44706
|
const frameworkMap = `${surface.module}.framework/Modules/module.modulemap`;
|
|
44431
44707
|
const modulemap = `module ${surface.module} {
|
|
44432
44708
|
${roots.map((file) => ` header "${file}"
|
|
@@ -45160,7 +45436,7 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
|
|
|
45160
45436
|
return error instanceof Error ? error.message : String(error);
|
|
45161
45437
|
}
|
|
45162
45438
|
const found = all.filter(
|
|
45163
|
-
(surface) => !provided.has(surface.module) && !(binary2.cxxHeaders === void 0 && cxxOnly(surface))
|
|
45439
|
+
(surface) => !provided.has(surface.module) && (surface.kind === "swift" || surface.kind === "mixed" || surface.kind === "source" || files(surface.headers, (name3) => name3.endsWith(".h")).length > 0) && !(binary2.cxxHeaders === void 0 && cxxOnly(surface))
|
|
45164
45440
|
);
|
|
45165
45441
|
if (found.length === 0) {
|
|
45166
45442
|
import_node_fs74.default.rmSync(work, { recursive: true, force: true });
|
|
@@ -49663,20 +49939,41 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
|
|
|
49663
49939
|
"specifications",
|
|
49664
49940
|
`${checksum}.json`
|
|
49665
49941
|
);
|
|
49942
|
+
const sha1 = (value) => (0, import_node_crypto41.createHash)("sha1").update(value).digest("hex");
|
|
49666
49943
|
let text6;
|
|
49667
49944
|
if (import_node_fs81.default.existsSync(file)) text6 = import_node_fs81.default.readFileSync(file, "utf8");
|
|
49668
49945
|
else {
|
|
49669
49946
|
const shard = (0, import_node_crypto41.createHash)("md5").update(root).digest("hex").slice(0, 3).split("").join("/");
|
|
49670
|
-
const
|
|
49671
|
-
|
|
49672
|
-
);
|
|
49947
|
+
const specPath = `Specs/${shard}/${root}/${version2}/${root}.podspec.json`;
|
|
49948
|
+
const response = await fetch(`https://cdn.cocoapods.org/${specPath}`);
|
|
49673
49949
|
if (!response.ok)
|
|
49674
49950
|
throw new Error(
|
|
49675
49951
|
`CocoaPods specification ${root} ${version2}: HTTP ${response.status}`
|
|
49676
49952
|
);
|
|
49677
49953
|
text6 = await response.text();
|
|
49954
|
+
if (sha1(text6) !== checksum) {
|
|
49955
|
+
const history = await fetch(
|
|
49956
|
+
`https://api.github.com/repos/CocoaPods/Specs/commits?path=${specPath}&per_page=100`
|
|
49957
|
+
);
|
|
49958
|
+
if (!history.ok)
|
|
49959
|
+
throw new Error(`CocoaPods specification ${root} history: HTTP ${history.status}`);
|
|
49960
|
+
const commits = await history.json();
|
|
49961
|
+
for (const commit of Array.isArray(commits) ? commits : []) {
|
|
49962
|
+
const sha = record2(commit) ? commit.sha : void 0;
|
|
49963
|
+
if (typeof sha !== "string") continue;
|
|
49964
|
+
const revision = await fetch(
|
|
49965
|
+
`https://raw.githubusercontent.com/CocoaPods/Specs/${sha}/${specPath}`
|
|
49966
|
+
);
|
|
49967
|
+
if (!revision.ok) continue;
|
|
49968
|
+
const revisionText = await revision.text();
|
|
49969
|
+
if (sha1(revisionText) === checksum) {
|
|
49970
|
+
text6 = revisionText;
|
|
49971
|
+
break;
|
|
49972
|
+
}
|
|
49973
|
+
}
|
|
49974
|
+
}
|
|
49678
49975
|
}
|
|
49679
|
-
if (
|
|
49976
|
+
if (sha1(text6) !== checksum)
|
|
49680
49977
|
throw new Error(`${root} podspec checksum differs from ${lockFile}`);
|
|
49681
49978
|
const spec = JSON.parse(text6);
|
|
49682
49979
|
if (!record2(spec) || spec.name !== root || spec.version !== version2)
|
|
@@ -54691,7 +54988,7 @@ var init_nitro_superset = __esm({
|
|
|
54691
54988
|
init_nitroContract();
|
|
54692
54989
|
init_swift_standin_digest();
|
|
54693
54990
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
54694
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
54991
|
+
NITRO_COMPILER_DIGEST = true ? "f02c3ec3fd9a77d144224ecf36dbf177c3878f12158689dcd8dcd6347e72ca55" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
54695
54992
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
54696
54993
|
nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
|
|
54697
54994
|
published = /* @__PURE__ */ new Map();
|
|
@@ -54909,7 +55206,7 @@ var init_nitro_bundle = __esm({
|
|
|
54909
55206
|
});
|
|
54910
55207
|
|
|
54911
55208
|
// src/one-sdk/source.ts
|
|
54912
|
-
var oneSDKModule, oneSDKApp, oneSDKTransport;
|
|
55209
|
+
var oneSDKModule, oneSDKHost, oneSDKApp, oneSDKTransport;
|
|
54913
55210
|
var init_source = __esm({
|
|
54914
55211
|
"src/one-sdk/source.ts"() {
|
|
54915
55212
|
"use strict";
|
|
@@ -54945,12 +55242,11 @@ extension OneNativeComposable {
|
|
|
54945
55242
|
public func propagateActive(_ active: Bool) {}
|
|
54946
55243
|
}
|
|
54947
55244
|
`;
|
|
54948
|
-
|
|
55245
|
+
oneSDKHost = String.raw`import SwiftUI
|
|
54949
55246
|
@_spi(Peach) import UIKit
|
|
54950
55247
|
import One
|
|
54951
|
-
import OneSDKBindings
|
|
54952
55248
|
|
|
54953
|
-
|
|
55249
|
+
struct OneSDKUIKitHost: UIViewRepresentable {
|
|
54954
55250
|
let props: JSON
|
|
54955
55251
|
func makeUIView(context: Context) -> OneNativeUIKitHostView { OneNativeUIKitHostView() }
|
|
54956
55252
|
func updateUIView(_ view: OneNativeUIKitHostView, context: Context) {
|
|
@@ -54962,10 +55258,14 @@ private struct UIKitHost: UIViewRepresentable {
|
|
|
54962
55258
|
}
|
|
54963
55259
|
static func dismantleUIView(_ view: OneNativeUIKitHostView, coordinator: Coordinator) { view.reset() }
|
|
54964
55260
|
}
|
|
55261
|
+
`;
|
|
55262
|
+
oneSDKApp = String.raw`import SwiftUI
|
|
55263
|
+
import One
|
|
55264
|
+
import OneSDKBindings
|
|
54965
55265
|
|
|
54966
55266
|
@main
|
|
54967
55267
|
struct SDKGuest: PeachPackage {
|
|
54968
|
-
func view(props: JSON) -> some View {
|
|
55268
|
+
func view(props: JSON) -> some View { OneSDKUIKitHost(props: props) }
|
|
54969
55269
|
}
|
|
54970
55270
|
`;
|
|
54971
55271
|
oneSDKTransport = String.raw`import Foundation
|
|
@@ -55260,10 +55560,12 @@ public func peachOneSDK(_ pointer: UnsafePointer<UInt8>, _ length: Int32) -> Uns
|
|
|
55260
55560
|
var one_sdk_bundle_exports = {};
|
|
55261
55561
|
__export(one_sdk_bundle_exports, {
|
|
55262
55562
|
ONE_SDK_ROUTE: () => ONE_SDK_ROUTE,
|
|
55563
|
+
appOneSDKLinkSources: () => appOneSDKLinkSources,
|
|
55263
55564
|
buildOneSDKBundle: () => buildOneSDKBundle,
|
|
55264
55565
|
compileOneSDKApp: () => compileOneSDKApp,
|
|
55265
55566
|
compilePreparedOneSDKApp: () => compilePreparedOneSDKApp,
|
|
55266
|
-
handleOneSDKRequest: () => handleOneSDKRequest
|
|
55567
|
+
handleOneSDKRequest: () => handleOneSDKRequest,
|
|
55568
|
+
oneSDKLinkSources: () => oneSDKLinkSources
|
|
55267
55569
|
});
|
|
55268
55570
|
async function compileOneSDKApp(appRoot, origin, moduleRootOverride) {
|
|
55269
55571
|
const selected = await selectOneSDK(appRoot);
|
|
@@ -55271,7 +55573,7 @@ async function compileOneSDKApp(appRoot, origin, moduleRootOverride) {
|
|
|
55271
55573
|
const prepared = await prepareExpoNativeProject(appRoot);
|
|
55272
55574
|
return compilePreparedOneSDKApp(appRoot, prepared.app, origin, moduleRootOverride);
|
|
55273
55575
|
}
|
|
55274
|
-
async function
|
|
55576
|
+
async function oneSDKLinkSources(appRoot, preparedRoot) {
|
|
55275
55577
|
const selected = await selectOneSDK(appRoot);
|
|
55276
55578
|
if (!selected) throw new Error("prepared app has no One SDK imports");
|
|
55277
55579
|
const { one, frameworks } = selected;
|
|
@@ -55286,6 +55588,39 @@ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRoo
|
|
|
55286
55588
|
throw new Error(
|
|
55287
55589
|
"prepared One SDK sources differ from the installed facades or app imports"
|
|
55288
55590
|
);
|
|
55591
|
+
const targets = /* @__PURE__ */ new Map();
|
|
55592
|
+
targets.set("Sources/One/One.swift", oneSDKModule);
|
|
55593
|
+
for (const source of [
|
|
55594
|
+
"SDK/OneSDKRuntime.swift",
|
|
55595
|
+
"OneNativeUIKitHostView.swift",
|
|
55596
|
+
"OneNativeContent.swift",
|
|
55597
|
+
"OneNativeAccessibility.swift",
|
|
55598
|
+
"SDKViews/OneNativeViewsTable.swift"
|
|
55599
|
+
])
|
|
55600
|
+
targets.set(
|
|
55601
|
+
`Sources/One/${import_node_path88.default.basename(source)}`,
|
|
55602
|
+
import_node_fs89.default.readFileSync(import_node_path88.default.join(one, "ios", source), "utf8")
|
|
55603
|
+
);
|
|
55604
|
+
for (const name3 of generated.files)
|
|
55605
|
+
targets.set(
|
|
55606
|
+
`Sources/OneSDKBindings/${name3}`,
|
|
55607
|
+
import_node_fs89.default.readFileSync(import_node_path88.default.join(sourceRoot, name3), "utf8")
|
|
55608
|
+
);
|
|
55609
|
+
return {
|
|
55610
|
+
targets,
|
|
55611
|
+
entry: /* @__PURE__ */ new Map([
|
|
55612
|
+
["OneSDKHost.swift", oneSDKHost],
|
|
55613
|
+
["OneSDKTransport.swift", oneSDKTransport]
|
|
55614
|
+
]),
|
|
55615
|
+
modules: frameworks.map((name3) => `${name3}_${generated.generation}`)
|
|
55616
|
+
};
|
|
55617
|
+
}
|
|
55618
|
+
async function appOneSDKLinkSources(appRoot) {
|
|
55619
|
+
if (!await selectOneSDK(appRoot)) return null;
|
|
55620
|
+
return oneSDKLinkSources(appRoot, (await prepareExpoNativeProject(appRoot)).app);
|
|
55621
|
+
}
|
|
55622
|
+
async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRootOverride) {
|
|
55623
|
+
const sources = await oneSDKLinkSources(appRoot, preparedRoot);
|
|
55289
55624
|
const moduleRoot = moduleRootOverride ?? (await resolveSwiftModule()).root;
|
|
55290
55625
|
const packagePath = import_node_path88.default.join(
|
|
55291
55626
|
swiftCacheDir(),
|
|
@@ -55305,25 +55640,9 @@ let package = Package(name: "OneSDKGuest", targets: [
|
|
|
55305
55640
|
])
|
|
55306
55641
|
`
|
|
55307
55642
|
);
|
|
55308
|
-
files2.set(
|
|
55309
|
-
for (const source of
|
|
55310
|
-
"SDK/OneSDKRuntime.swift",
|
|
55311
|
-
"OneNativeUIKitHostView.swift",
|
|
55312
|
-
"OneNativeContent.swift",
|
|
55313
|
-
"OneNativeAccessibility.swift",
|
|
55314
|
-
"SDKViews/OneNativeViewsTable.swift"
|
|
55315
|
-
])
|
|
55316
|
-
files2.set(
|
|
55317
|
-
`Sources/One/${import_node_path88.default.basename(source)}`,
|
|
55318
|
-
import_node_fs89.default.readFileSync(import_node_path88.default.join(one, "ios", source), "utf8")
|
|
55319
|
-
);
|
|
55320
|
-
for (const name3 of generated.files)
|
|
55321
|
-
files2.set(
|
|
55322
|
-
`Sources/OneSDKBindings/${name3}`,
|
|
55323
|
-
import_node_fs89.default.readFileSync(import_node_path88.default.join(sourceRoot, name3), "utf8")
|
|
55324
|
-
);
|
|
55643
|
+
for (const [name3, source] of sources.targets) files2.set(name3, source);
|
|
55644
|
+
for (const [name3, source] of sources.entry) files2.set(`Sources/App/${name3}`, source);
|
|
55325
55645
|
files2.set("Sources/App/App.swift", oneSDKApp);
|
|
55326
|
-
files2.set("Sources/App/Transport.swift", oneSDKTransport);
|
|
55327
55646
|
import_node_fs89.default.mkdirSync(packagePath, { recursive: true });
|
|
55328
55647
|
syncSwiftTree(
|
|
55329
55648
|
packagePath,
|
|
@@ -55339,7 +55658,7 @@ let package = Package(name: "OneSDKGuest", targets: [
|
|
|
55339
55658
|
icuUrl: icuUrl(origin, artifact),
|
|
55340
55659
|
rootId: `one-sdk-${artifact.hash.slice(0, 16)}`,
|
|
55341
55660
|
bundleFiles: artifact.package.bundleFiles.files,
|
|
55342
|
-
modules:
|
|
55661
|
+
modules: sources.modules
|
|
55343
55662
|
};
|
|
55344
55663
|
return { metadata, artifact };
|
|
55345
55664
|
}
|
|
@@ -55894,7 +56213,7 @@ var init_expo_native_compiler_digest = __esm({
|
|
|
55894
56213
|
|
|
55895
56214
|
// src/expo-native-prebuilt.ts
|
|
55896
56215
|
function expoNativeCompilerDigestValue() {
|
|
55897
|
-
return true ? "
|
|
56216
|
+
return true ? "5096ba1e78a0087b6e56f15c4b37fcbd9bcabb2acde17a257d8add357efd462c" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
55898
56217
|
}
|
|
55899
56218
|
function readSources(value) {
|
|
55900
56219
|
const sources = isRecord(value) ? value.sources : null;
|
|
@@ -58280,7 +58599,15 @@ function targetSettings2(units) {
|
|
|
58280
58599
|
}
|
|
58281
58600
|
return settings;
|
|
58282
58601
|
}
|
|
58283
|
-
function
|
|
58602
|
+
function oneSDKStamp(oneSDK) {
|
|
58603
|
+
if (!oneSDK) return "";
|
|
58604
|
+
const hash = (0, import_node_crypto50.createHash)("sha256");
|
|
58605
|
+
for (const files2 of [oneSDK.targets, oneSDK.entry])
|
|
58606
|
+
for (const [name3, source] of [...files2].sort(([a], [b]) => a.localeCompare(b)))
|
|
58607
|
+
hash.update(`${name3}\0${source}\0`);
|
|
58608
|
+
return hash.digest("hex");
|
|
58609
|
+
}
|
|
58610
|
+
function expoEntry(units, oneSDK = false) {
|
|
58284
58611
|
const namespaces = [...new Set(units.map((unit2) => unit2.namespace))].filter((namespace) => namespace !== "PeachExpoApp").filter(
|
|
58285
58612
|
(namespace) => units.some(
|
|
58286
58613
|
(unit2) => Object.keys(unit2.files).some((file) => file.startsWith(`Sources/${namespace}/`))
|
|
@@ -58290,13 +58617,14 @@ function expoEntry(units) {
|
|
|
58290
58617
|
const subscribers = units.flatMap((unit2) => unit2.appDelegateSubscribers);
|
|
58291
58618
|
const handlers = units.flatMap((unit2) => unit2.reactDelegateHandlers);
|
|
58292
58619
|
const delegates = subscribers.length + handlers.length > 0 ? `; PeachExpoRuntime.registerDelegates(subscribers: [${subscribers.join(", ")}], handlers: [${handlers.join(", ")}])` : "";
|
|
58620
|
+
const view = oneSDK ? '@ViewBuilder func view(props: JSON) -> some View {\n if props["oneSDKHost"] != nil { OneSDKUIKitHost(props: props) } else { PeachExpoNativeView(props: props) }\n }' : "func view(props: JSON) -> PeachExpoNativeView { PeachExpoNativeView(props: props) }";
|
|
58293
58621
|
return `import SwiftUI
|
|
58294
58622
|
internal import ExpoModulesCore
|
|
58295
|
-
${bridgeModules.length ? "import React\n" : ""}${namespaces.map((namespace) => `import ${namespace}`).join("\n")}
|
|
58623
|
+
${bridgeModules.length ? "import React\n" : ""}${oneSDK ? "import One\nimport OneSDKBindings\n" : ""}${namespaces.map((namespace) => `import ${namespace}`).join("\n")}
|
|
58296
58624
|
|
|
58297
58625
|
@main struct PeachExpoApp: PeachPackage {
|
|
58298
58626
|
init() { MainActor.assumeIsolated { PeachExpoRuntime.register([${units.flatMap((unit2) => unit2.classes).join(", ")}])${delegates}${bridgeModules.length ? `; RCTModuleHost.register([${bridgeModules.join(", ")}])` : ""} } }
|
|
58299
|
-
|
|
58627
|
+
${view}
|
|
58300
58628
|
}
|
|
58301
58629
|
|
|
58302
58630
|
@_expose(wasm, "peach_expo_call")
|
|
@@ -58388,7 +58716,7 @@ async function compileExpoSwiftModules(root, base, publishArtifact, options = {}
|
|
|
58388
58716
|
installSwiftInputTrace();
|
|
58389
58717
|
let key2;
|
|
58390
58718
|
try {
|
|
58391
|
-
key2 = `${await discoveryKey(root, options.installedWorkspace, true, options.iosTarget, options.moduleRoot)}\0${options.only?.join(",") ?? ""}`;
|
|
58719
|
+
key2 = `${await discoveryKey(root, options.installedWorkspace, true, options.iosTarget, options.moduleRoot)}\0${options.only?.join(",") ?? ""}\0${oneSDKStamp(options.oneSDK)}`;
|
|
58392
58720
|
} catch {
|
|
58393
58721
|
return compileExpoSwiftModulesTraced(root, base, publishArtifact, options);
|
|
58394
58722
|
}
|
|
@@ -58425,11 +58753,23 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
58425
58753
|
throw new Error(`conflicting Expo Swift binary source ${name3}`);
|
|
58426
58754
|
files2[name3] = source;
|
|
58427
58755
|
}
|
|
58428
|
-
|
|
58756
|
+
const settings = targetSettings2(linked2);
|
|
58757
|
+
if (options.oneSDK) {
|
|
58758
|
+
for (const [name3, source] of options.oneSDK.targets) files2[name3] = source;
|
|
58759
|
+
for (const [name3, source] of options.oneSDK.entry)
|
|
58760
|
+
files2[`Sources/PeachExpoApp/${name3}`] = source;
|
|
58761
|
+
settings.set("OneSDKBindings", {
|
|
58762
|
+
languageMode: 5,
|
|
58763
|
+
mainActorIsolation: false,
|
|
58764
|
+
swiftFlags: ["-suppress-warnings"],
|
|
58765
|
+
dependencies: [{ kind: "target", name: "One" }]
|
|
58766
|
+
});
|
|
58767
|
+
}
|
|
58768
|
+
files2[EXPO_SWIFT_ENTRY] = expoEntry(linked2, options.oneSDK !== void 0);
|
|
58429
58769
|
files2["Package.swift"] = expoManifest(
|
|
58430
58770
|
files2,
|
|
58431
58771
|
linked2.map((unit2) => generations.get(unit2) ?? "").join(","),
|
|
58432
|
-
|
|
58772
|
+
settings
|
|
58433
58773
|
);
|
|
58434
58774
|
const provider = linked2.some((unit2) => unit2.reactNativeProvider) ? reactProvider : void 0;
|
|
58435
58775
|
if (provider) {
|
|
@@ -58790,7 +59130,11 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
58790
59130
|
stamps.set(unit2, stamp);
|
|
58791
59131
|
candidates.push(unit2);
|
|
58792
59132
|
}
|
|
58793
|
-
const preparedKey = expoSwiftPreparedKey(
|
|
59133
|
+
const preparedKey = expoSwiftPreparedKey(
|
|
59134
|
+
base,
|
|
59135
|
+
units,
|
|
59136
|
+
reactProviderStamp + oneSDKStamp(options.oneSDK)
|
|
59137
|
+
);
|
|
58794
59138
|
if (!publishArtifact) {
|
|
58795
59139
|
const prepared = preparedExpoSwift.get(preparedKey);
|
|
58796
59140
|
if (prepared) {
|
|
@@ -59046,7 +59390,7 @@ var expo_swift_bundle_exports = {};
|
|
|
59046
59390
|
__export(expo_swift_bundle_exports, {
|
|
59047
59391
|
buildExpoSwiftBundle: () => buildExpoSwiftBundle
|
|
59048
59392
|
});
|
|
59049
|
-
async function buildExpoSwiftBundle(appRoot) {
|
|
59393
|
+
async function buildExpoSwiftBundle(appRoot, oneSDK) {
|
|
59050
59394
|
const assets2 = [];
|
|
59051
59395
|
const metadata = await compileExpoSwiftModules(
|
|
59052
59396
|
appRoot,
|
|
@@ -59059,7 +59403,8 @@ async function buildExpoSwiftBundle(appRoot) {
|
|
|
59059
59403
|
contentType: "application/wasm"
|
|
59060
59404
|
});
|
|
59061
59405
|
if ("gzip" in artifact.icu) assets2.push(await swiftIcuBundleAsset(artifact.icu));
|
|
59062
|
-
}
|
|
59406
|
+
},
|
|
59407
|
+
{ oneSDK }
|
|
59063
59408
|
);
|
|
59064
59409
|
if (!metadata) return null;
|
|
59065
59410
|
return { metadata, assets: assets2 };
|
|
@@ -65761,13 +66106,29 @@ function getRuntimePlatformAdapter(platform2) {
|
|
|
65761
66106
|
// src/native-bundles.ts
|
|
65762
66107
|
async function buildNativeBundles(projectRoot, platform2, configuration) {
|
|
65763
66108
|
return getRuntimePlatformAdapter(platform2).select({
|
|
65764
|
-
ios: async () =>
|
|
65765
|
-
|
|
65766
|
-
|
|
65767
|
-
|
|
65768
|
-
|
|
65769
|
-
|
|
65770
|
-
|
|
66109
|
+
ios: async () => {
|
|
66110
|
+
const { appOneSDKLinkSources: appOneSDKLinkSources2, buildOneSDKBundle: buildOneSDKBundle2 } = await Promise.resolve().then(() => (init_one_sdk_bundle(), one_sdk_bundle_exports));
|
|
66111
|
+
const oneSDK = await appOneSDKLinkSources2(projectRoot);
|
|
66112
|
+
const expoSwift = await (await Promise.resolve().then(() => (init_expo_swift_bundle(), expo_swift_bundle_exports))).buildExpoSwiftBundle(projectRoot, oneSDK ?? void 0);
|
|
66113
|
+
const linked = oneSDK && expoSwift?.metadata.modules[0];
|
|
66114
|
+
return {
|
|
66115
|
+
oneSDK: linked ? {
|
|
66116
|
+
metadata: {
|
|
66117
|
+
url: linked.url,
|
|
66118
|
+
hash: linked.hash,
|
|
66119
|
+
icuUrl: linked.icuUrl,
|
|
66120
|
+
rootId: `${linked.rootId.split("/")[0]}/OneSDK`,
|
|
66121
|
+
bundleFiles: linked.bundleFiles ?? {},
|
|
66122
|
+
modules: oneSDK.modules
|
|
66123
|
+
},
|
|
66124
|
+
assets: []
|
|
66125
|
+
} : await buildOneSDKBundle2(projectRoot),
|
|
66126
|
+
expoSwift,
|
|
66127
|
+
nitro: await (await Promise.resolve().then(() => (init_nitro_bundle(), nitro_bundle_exports))).buildNitroBundle(projectRoot, configuration),
|
|
66128
|
+
turbo: await (await Promise.resolve().then(() => (init_turbo_bundle(), turbo_bundle_exports))).buildTurboBundle(projectRoot),
|
|
66129
|
+
expoKotlin: null
|
|
66130
|
+
};
|
|
66131
|
+
},
|
|
65771
66132
|
android: async () => ({
|
|
65772
66133
|
oneSDK: null,
|
|
65773
66134
|
expoSwift: null,
|