peachsim 0.1.2209 → 0.1.2213
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/command-registry.ts +1 -0
- package/cli/commands/inspect/settling.ts +1 -1
- package/cli/commands/map.ts +576 -0
- package/cli/commands/runtime.ts +1 -1
- package/cli/main.ts +6 -0
- package/cli/outbound-endpoints.ts +11 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +282 -53
- 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 +6 -3
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +280 -51
- 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 +1264 -856
- package/dist-lib/host/fetch-proxy-handler.cjs +21 -5
- 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 +1966 -752
- 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 +1806 -593
- package/dist-lib/native-app-identity-project.cjs +19 -3
- package/dist-lib/native-app-identity-project.mjs +19 -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 +83 -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 +2 -2
- package/dist-lib/sdk.mjs +2 -2
- package/dist-lib/skills.cjs +1800 -1334
- package/dist-lib/swift-compile.cjs +58 -12
- package/dist-lib/swift-compile.mjs +57 -12
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +257 -47
- package/dist-lib/vite.cjs +1530 -303
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes +35 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/CoreData.h +8 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSAttributeDescription.h +30 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h +14 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSExpressionDescription.h +10 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchIndexDescription.h +13 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchIndexElementDescription.h +18 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObject.h +11 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectContext.h +19 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectID.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectModel.h +3 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSMergePolicy.h +17 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStore.h +8 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreCoordinator.h +6 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPropertyDescription.h +13 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSRelationshipDescription.h +21 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h +2 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIImage.h +1 -10
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes +21 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UINibLoading.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +11 -0
- package/sdk/ios/usr/lib/swift/Combine.swiftmodule/arm64-apple-ios-simulator.swiftinterface +18 -0
- package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
- package/sdk/ios/usr/lib/swift/SwiftUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +19 -0
- package/sdk/ios/usr/lib/swift/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
- package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
- package/sdk/ios/wasm/include/pthread.h +1 -0
- package/sdk/ios/wasm/include/signal.h +2 -2
- package/sdk/native-hashes.json +3 -3
- package/skills/contrast/SKILL.md +1 -0
- package/src/home-paths.ts +1 -1
- package/src/host/bridge-host.ts +101 -97
- package/src/metro-plugin.ts +4 -1
- package/src/native-static-libraries.ts +7 -0
- package/src/react-native-coverage/native-source-ranges-file.ts +1 -1
- package/src/runtime-assets.ts +0 -1
- package/src/runtime-delivery.ts +1 -1
- package/src/runtime-packs.ts +212 -0
- package/src/swift-compile.ts +48 -10
- package/src/swift-host.ts +22 -3
- package/src/swift-objc-compile.ts +1 -1
- package/src/swift-objc-import.ts +32 -2
- package/src/swift-objc-standin.ts +1 -1
- package/src/swift-packages.ts +53 -28
- package/src/swift-pdf-raster.ts +60 -4
- package/src/swift-shipped-archives.json +44 -0
- package/src/swift-shipped-binaries.ts +12 -0
- package/src/swift-standin-config.ts +4 -2
- package/src/swift-standin-emit.ts +9 -3
- package/src/swift-standins.ts +75 -8
- package/src/vite-plugin-one.ts +4 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2213 | (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": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "25505683ca29a0b380413bf2a5026d4967eacf886e35bc11ece6e15317e5bb02", "home-paths.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": "25505683ca29a0b380413bf2a5026d4967eacf886e35bc11ece6e15317e5bb02", "home-paths.ts": "d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "86f79e98323ec065e0e5195324c75ca608f490efbd95dcc25c53d5aa0b9aecc9", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -2897,6 +2897,14 @@ var init_product = __esm({
|
|
|
2897
2897
|
}
|
|
2898
2898
|
});
|
|
2899
2899
|
|
|
2900
|
+
// ../contrast-runtime-delivery/src/packs.ts
|
|
2901
|
+
var init_packs = __esm({
|
|
2902
|
+
"../contrast-runtime-delivery/src/packs.ts"() {
|
|
2903
|
+
"use strict";
|
|
2904
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2905
|
+
}
|
|
2906
|
+
});
|
|
2907
|
+
|
|
2900
2908
|
// ../contrast-runtime-delivery/src/index.ts
|
|
2901
2909
|
async function installVerifiedTarball(tarball) {
|
|
2902
2910
|
const { destDir, installedMarker, signal } = tarball;
|
|
@@ -3115,6 +3123,7 @@ var init_src = __esm({
|
|
|
3115
3123
|
import_node_zlib = __toESM(require("node:zlib"), 1);
|
|
3116
3124
|
init_process_group();
|
|
3117
3125
|
init_product();
|
|
3126
|
+
init_packs();
|
|
3118
3127
|
init_product();
|
|
3119
3128
|
}
|
|
3120
3129
|
});
|
|
@@ -9732,7 +9741,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
9732
9741
|
const coder = members2.some((member) => leaf(member) === "init(coder:)");
|
|
9733
9742
|
if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
9734
9743
|
emit(
|
|
9735
|
-
`${inner}public required init?(coder: NSCoder) { ${options.inert ? "return nil" : trap(`${path74}.init(coder:)`)} }`
|
|
9744
|
+
`${inner}public required init${options.coderNonfailable?.has(path74) ? "" : "?"}(coder: NSCoder) { ${options.inert && !options.coderNonfailable?.has(path74) ? "return nil" : trap(`${path74}.init(coder:)`)} }`
|
|
9736
9745
|
);
|
|
9737
9746
|
if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
|
|
9738
9747
|
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
@@ -9913,15 +9922,18 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
9913
9922
|
const { 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
9914
9923
|
const decl = rest.replace(/^(?:weak |unowned )/, "").replace(/^((?:static )?)let /, "$1var ");
|
|
9915
9924
|
const witness = `${owner2}.${leaf(member)}`;
|
|
9925
|
+
if (options.forcedOverride?.has(witness)) return;
|
|
9916
9926
|
const body = options.inert ? inertBody(member) : trap(witness);
|
|
9917
9927
|
if (member.kind.identifier === "swift.property" || member.kind.identifier === "swift.type.property") {
|
|
9918
9928
|
const parsed = splitAccessors(decl);
|
|
9919
9929
|
const setter = parsed.settable ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${body} }` : "";
|
|
9920
|
-
|
|
9930
|
+
emitAt(
|
|
9931
|
+
witness,
|
|
9921
9932
|
`${indent2}${visibility} ${parsed.decl} { get${parsed.effects} { ${body} }${setter} }`
|
|
9922
9933
|
);
|
|
9923
9934
|
} else
|
|
9924
|
-
|
|
9935
|
+
emitAt(
|
|
9936
|
+
witness,
|
|
9925
9937
|
`${indent2}${member.kind.identifier === "swift.init" ? "public required " : visibility + " "}${stripDefaults(decl)} { ${body} }`
|
|
9926
9938
|
);
|
|
9927
9939
|
};
|
|
@@ -11483,7 +11495,7 @@ var init_swift_objc_standin = __esm({
|
|
|
11483
11495
|
};
|
|
11484
11496
|
NATIVE_GRAPH_ID = (0, import_node_crypto12.createHash)("sha256").update(JSON.stringify(NATIVE_GRAPH_INPUTS)).digest("hex");
|
|
11485
11497
|
ROUNDS = 12;
|
|
11486
|
-
headerFiles = (dir) => import_node_fs32.default.readdirSync(dir, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".h")).sort();
|
|
11498
|
+
headerFiles = (dir) => import_node_fs32.default.readdirSync(dir, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".h") || file.endsWith(".hh")).sort();
|
|
11487
11499
|
MISSING_IMPORT = "#import <PeachMissing/PeachMissing.h>\n";
|
|
11488
11500
|
FRAMEWORK_HEADER = /^System\/Library\/Frameworks\/([^/]+)\.framework\/Headers\/(.+)$/;
|
|
11489
11501
|
FRAMEWORK_MODULEMAP = /^System\/Library\/Frameworks\/([^/]+)\.framework\/Modules\/module\.modulemap$/;
|
|
@@ -18622,16 +18634,30 @@ function swiftClangImporterFlags(flags) {
|
|
|
18622
18634
|
(flag) => flag !== "-fobjc-arc" && flag !== "-fno-objc-arc" && !/^-std=(?:c(?!\+\+)|gnu(?!\+\+)|iso9899:)/.test(flag)
|
|
18623
18635
|
);
|
|
18624
18636
|
}
|
|
18625
|
-
function
|
|
18637
|
+
function swiftSubmoduleImports(sources) {
|
|
18638
|
+
const imports2 = /* @__PURE__ */ new Map();
|
|
18639
|
+
for (const source of sources)
|
|
18640
|
+
for (const [, module2, submodule] of source.matchAll(SWIFT_SUBMODULE_IMPORT)) {
|
|
18641
|
+
const names = imports2.get(module2) ?? /* @__PURE__ */ new Set();
|
|
18642
|
+
names.add(submodule);
|
|
18643
|
+
imports2.set(module2, names);
|
|
18644
|
+
}
|
|
18645
|
+
return imports2;
|
|
18646
|
+
}
|
|
18647
|
+
function swiftObjCModuleMap(module2, headers, submodules = /* @__PURE__ */ new Set()) {
|
|
18648
|
+
const header = (file) => `header ${JSON.stringify(file)}`;
|
|
18649
|
+
const stem = (file) => file.slice(file.lastIndexOf("/") + 1).replace(/\.[^.]*$/, "");
|
|
18626
18650
|
return [
|
|
18627
18651
|
`module ${module2} {`,
|
|
18628
|
-
...headers.map(
|
|
18652
|
+
...headers.map(
|
|
18653
|
+
(file) => submodules.has(stem(file)) ? ` module ${stem(file)} { ${header(file)} export * }` : ` ${header(file)}`
|
|
18654
|
+
),
|
|
18629
18655
|
" export *",
|
|
18630
18656
|
"}",
|
|
18631
18657
|
""
|
|
18632
18658
|
].join("\n");
|
|
18633
18659
|
}
|
|
18634
|
-
var SWIFT_OBJC_INTEROP_FLAGS;
|
|
18660
|
+
var SWIFT_OBJC_INTEROP_FLAGS, SWIFT_SUBMODULE_IMPORT;
|
|
18635
18661
|
var init_swift_objc_import = __esm({
|
|
18636
18662
|
"src/swift-objc-import.ts"() {
|
|
18637
18663
|
"use strict";
|
|
@@ -18646,6 +18672,7 @@ var init_swift_objc_import = __esm({
|
|
|
18646
18672
|
"-Xcc",
|
|
18647
18673
|
"-fblocks"
|
|
18648
18674
|
];
|
|
18675
|
+
SWIFT_SUBMODULE_IMPORT = /^[ \t]*(?:@\w+(?:\([^)]*\))?[ \t]+)*import[ \t]+([A-Za-z_]\w*)\.([A-Za-z_]\w*)[ \t]*(?:\/\/.*)?$/gm;
|
|
18649
18676
|
}
|
|
18650
18677
|
});
|
|
18651
18678
|
|
|
@@ -21000,6 +21027,12 @@ function stripCCode(source) {
|
|
|
21000
21027
|
}
|
|
21001
21028
|
return code;
|
|
21002
21029
|
}
|
|
21030
|
+
function swiftCTakesReturnAddress(source) {
|
|
21031
|
+
if (!source.includes("__builtin_return_address")) return false;
|
|
21032
|
+
return /\b__builtin_return_address\s*\(/.test(
|
|
21033
|
+
cActiveCode(stripCCode(source), wasmMacroEnvironment)
|
|
21034
|
+
);
|
|
21035
|
+
}
|
|
21003
21036
|
function swiftCMainEntry(file, source, env = emptyMacroEnvironment) {
|
|
21004
21037
|
if (!isSwiftNativeTranslationUnit(file)) return false;
|
|
21005
21038
|
const code = cActiveCode(stripCCode(source), env);
|
|
@@ -21274,6 +21307,11 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
21274
21307
|
clangImportedModules.add(name3);
|
|
21275
21308
|
}
|
|
21276
21309
|
}
|
|
21310
|
+
const submoduleImports = swiftSubmoduleImports(
|
|
21311
|
+
Object.entries(input.files).flatMap(
|
|
21312
|
+
([file, contents]) => file.endsWith(".swift") ? [contents] : []
|
|
21313
|
+
)
|
|
21314
|
+
);
|
|
21277
21315
|
const headerDirectory = import_node_path47.default.join(layout2.root, ".build", "peach-cxx-headers");
|
|
21278
21316
|
const flattenedHeaders = /* @__PURE__ */ new Set();
|
|
21279
21317
|
if ((0, import_node_fs50.existsSync)(headerDirectory)) {
|
|
@@ -21659,7 +21697,8 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
21659
21697
|
);
|
|
21660
21698
|
const moduleContents = originalModuleMap ? input.files[originalModuleMap[1]] : swiftpmModuleMap?.contents ?? packageModuleMap?.[1] ?? swiftObjCModuleMap(
|
|
21661
21699
|
swiftTargetModuleName(target.name),
|
|
21662
|
-
roots2.map((file) => import_node_path47.default.join(layout2.root, file))
|
|
21700
|
+
roots2.map((file) => import_node_path47.default.join(layout2.root, file)),
|
|
21701
|
+
submoduleImports.get(swiftTargetModuleName(target.name))
|
|
21663
21702
|
);
|
|
21664
21703
|
if (moduleContents === void 0)
|
|
21665
21704
|
throw new Error("missing original module map " + modulemap);
|
|
@@ -21984,10 +22023,14 @@ module ${moduleName}.Swift {
|
|
|
21984
22023
|
header ${JSON.stringify(import_node_path47.default.join(headerDirectory, name3 + "-Swift.h"))}
|
|
21985
22024
|
requires objc
|
|
21986
22025
|
}
|
|
21987
|
-
` : swiftObjCModuleMap(
|
|
21988
|
-
|
|
21989
|
-
|
|
21990
|
-
|
|
22026
|
+
` : swiftObjCModuleMap(
|
|
22027
|
+
moduleName,
|
|
22028
|
+
[
|
|
22029
|
+
...(input.nativeTargets?.find((target) => target.name === name3)?.publicHeaders ?? []).map((header) => import_node_path47.default.join(layout2.root, header)),
|
|
22030
|
+
import_node_path47.default.join(headerDirectory, name3 + "-Swift.h")
|
|
22031
|
+
],
|
|
22032
|
+
submoduleImports.get(moduleName)
|
|
22033
|
+
)
|
|
21991
22034
|
);
|
|
21992
22035
|
nativeHeaderFlags.push("-fmodule-map-file=" + modulemap);
|
|
21993
22036
|
}
|
|
@@ -22970,8 +23013,12 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
22970
23013
|
const linked = frameworkLinkClosure(scratch2, linkedTargets.targets);
|
|
22971
23014
|
const objects = linked.objects;
|
|
22972
23015
|
if (linked.modules.has("UniformTypeIdentifiers")) {
|
|
22973
|
-
const
|
|
22974
|
-
|
|
23016
|
+
const constantsDir = import_node_path47.default.join(scratch2, "uniform-type-constants");
|
|
23017
|
+
const constantsStamp = import_node_path47.default.join(constantsDir, ".complete");
|
|
23018
|
+
const object6 = import_node_path47.default.join(constantsDir, "UniformTypeIdentifiers-NativeConstants.o");
|
|
23019
|
+
if (!(0, import_node_fs50.existsSync)(constantsStamp) || (0, import_node_fs50.readFileSync)(constantsStamp, "utf8") !== args.frameworkKey) {
|
|
23020
|
+
(0, import_node_fs50.rmSync)(constantsDir, { recursive: true, force: true });
|
|
23021
|
+
(0, import_node_fs50.mkdirSync)(constantsDir);
|
|
22975
23022
|
const sdkPaths2 = swiftSdkPaths(args.moduleRoot, args.toolchainBin);
|
|
22976
23023
|
compileUniformTypeConstants({
|
|
22977
23024
|
bin: args.toolchainBin,
|
|
@@ -22979,8 +23026,9 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
22979
23026
|
darwin: sdkPaths2.darwin,
|
|
22980
23027
|
packageRoot: args.moduleRoot,
|
|
22981
23028
|
minimum: darwinRecordsMinimum(),
|
|
22982
|
-
out:
|
|
23029
|
+
out: constantsDir
|
|
22983
23030
|
});
|
|
23031
|
+
(0, import_node_fs50.writeFileSync)(constantsStamp, args.frameworkKey);
|
|
22984
23032
|
}
|
|
22985
23033
|
objects.push(object6);
|
|
22986
23034
|
linked.owners.set(object6, "UniformTypeIdentifiers");
|
|
@@ -23665,7 +23713,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
23665
23713
|
options.signal
|
|
23666
23714
|
);
|
|
23667
23715
|
}
|
|
23668
|
-
var import_node_child_process27, import_node_crypto21, import_node_fs50, import_node_os11, import_node_path47, v5, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, SWIFT_BUILDER_TRANSPORT_MARGIN_MS, SWIFT_BUILDER_DEFAULT_COMPILE_MS, clangInterfaceHeader, swiftInterfaceDeclarations, linkedModuleDigests, SYSTEM_MODULE_LIBRARIES, SYSTEM_MODULE_IMPORT, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, kleeneNot, kleeneAnd, kleeneOr, sdkPaths, availableModules, sdkOverlayFrameworks, DISTRIBUTION_CLANG_MODULES, ONE_PRODUCT, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_MODULES, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, DIRECTIVE, OS_IOS, DELEGATE_CLASS, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, emptyMacroEnvironment, HIDDEN_UNITS, LIBXML_REFERENCE, LIBXML_SOURCE, ROOT_LOCKS, host, rootLocks, SHARED_ARTIFACT_BUDGET_BYTES, SHARED_ARTIFACT_GRACE_MS, RETIRED_PREFIX, retainedArtifacts, FRAMEWORK_LINK_TARGET, SWIFT_LINK_STAMP, SWIFT_FRAMEWORK_SLOTS, SWIFT_FRAMEWORK_SLOT_KEY, SWIFT_FRAMEWORK_SLOT_ORIGIN;
|
|
23716
|
+
var import_node_child_process27, import_node_crypto21, import_node_fs50, import_node_os11, import_node_path47, v5, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, SWIFT_BUILDER_TRANSPORT_MARGIN_MS, SWIFT_BUILDER_DEFAULT_COMPILE_MS, clangInterfaceHeader, swiftInterfaceDeclarations, linkedModuleDigests, SYSTEM_MODULE_LIBRARIES, SYSTEM_MODULE_IMPORT, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, kleeneNot, kleeneAnd, kleeneOr, sdkPaths, availableModules, sdkOverlayFrameworks, DISTRIBUTION_CLANG_MODULES, ONE_PRODUCT, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_MODULES, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, DIRECTIVE, OS_IOS, DELEGATE_CLASS, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, emptyMacroEnvironment, wasmMacroEnvironment, HIDDEN_UNITS, LIBXML_REFERENCE, LIBXML_SOURCE, ROOT_LOCKS, host, rootLocks, SHARED_ARTIFACT_BUDGET_BYTES, SHARED_ARTIFACT_GRACE_MS, RETIRED_PREFIX, retainedArtifacts, FRAMEWORK_LINK_TARGET, SWIFT_LINK_STAMP, SWIFT_FRAMEWORK_SLOTS, SWIFT_FRAMEWORK_SLOT_KEY, SWIFT_FRAMEWORK_SLOT_ORIGIN;
|
|
23669
23717
|
var init_swift_compile = __esm({
|
|
23670
23718
|
"src/swift-compile.ts"() {
|
|
23671
23719
|
"use strict";
|
|
@@ -23878,7 +23926,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
23878
23926
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
23879
23927
|
MULTI_MANIFEST_VERSION = 68;
|
|
23880
23928
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
23881
|
-
compilerSourceDigest = true ? "
|
|
23929
|
+
compilerSourceDigest = true ? "4646bbe2e0cd2e48e498f51fd3d0d5ea29ecd5e6163fdf3afe8d64d4368022d7" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
23882
23930
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
23883
23931
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
23884
23932
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
@@ -24403,6 +24451,14 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
24403
24451
|
predefines: /* @__PURE__ */ new Map(),
|
|
24404
24452
|
targetDefined: /* @__PURE__ */ new Set()
|
|
24405
24453
|
};
|
|
24454
|
+
wasmMacroEnvironment = {
|
|
24455
|
+
...emptyMacroEnvironment,
|
|
24456
|
+
defines: /* @__PURE__ */ new Map([
|
|
24457
|
+
["__wasm__", "1"],
|
|
24458
|
+
["__wasm32__", "1"],
|
|
24459
|
+
["__wasi__", "1"]
|
|
24460
|
+
])
|
|
24461
|
+
};
|
|
24406
24462
|
HIDDEN_UNITS = "PeachHiddenUnits";
|
|
24407
24463
|
LIBXML_REFERENCE = /(?:^|\n)[ \t]*#[ \t]*(?:include|import)[ \t]*["<][ \t]*libxml\/|@import[ \t]+libxml2[ \t]*;|(?:^|\n)[ \t]*import[ \t]+libxml2(?![\w.])/;
|
|
24408
24464
|
LIBXML_SOURCE = /\.(?:c|m|mm|cc|cpp|cxx|h|hh|hpp|hxx|swift)$/;
|
|
@@ -27987,7 +28043,7 @@ var init_swift_standin_digest = __esm({
|
|
|
27987
28043
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
27988
28044
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
27989
28045
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
27990
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
28046
|
+
STANDIN_SOURCE_DIGEST = true ? "f077081111b09ca27482cd53be422dae6cd1bd3a5fd2b2bdef48a83a9c0d6ca8" : standinSourceDigest();
|
|
27991
28047
|
}
|
|
27992
28048
|
});
|
|
27993
28049
|
|
|
@@ -28536,6 +28592,13 @@ var init_native_static_libraries = __esm({
|
|
|
28536
28592
|
upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
|
|
28537
28593
|
recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
|
|
28538
28594
|
archive: "libsksg.a"
|
|
28595
|
+
},
|
|
28596
|
+
{
|
|
28597
|
+
name: "webgpu_dawn",
|
|
28598
|
+
nativeSha256: "95078993275bccc969b1dfa1ad0934cbacc05ae59e8aa2a6cc46ce93e97d4f69",
|
|
28599
|
+
upstream: "3d786993a7ded64c4ebb4884b9b079db9ad0e580",
|
|
28600
|
+
recipe: "c55468cc976e837ad894133f2231beb7d1ed64633af7b457b8a2610d7df45994",
|
|
28601
|
+
archive: "libwebgpu_dawn.a"
|
|
28539
28602
|
}
|
|
28540
28603
|
];
|
|
28541
28604
|
}
|
|
@@ -28630,6 +28693,72 @@ var init_numbered_lock = __esm({
|
|
|
28630
28693
|
}
|
|
28631
28694
|
});
|
|
28632
28695
|
|
|
28696
|
+
// src/swift-shipped-archives.json
|
|
28697
|
+
var swift_shipped_archives_default;
|
|
28698
|
+
var init_swift_shipped_archives = __esm({
|
|
28699
|
+
"src/swift-shipped-archives.json"() {
|
|
28700
|
+
swift_shipped_archives_default = {
|
|
28701
|
+
AppCheckCore: "a18d4e5aff27ff4b9bce8d6e73e55ccf1d11515311e219aa4473319cdff3187b",
|
|
28702
|
+
AppLovinSDK: "c00f052c4b15766a6a2734e2b3685234e6bd28dbc47fbe7cbc3edbf56f701d5c",
|
|
28703
|
+
AppsFlyerLib: "13bae495e63e22579dd9525a1c9e88d8eedc78b4586979b7e2d492cfd3efbe1f",
|
|
28704
|
+
FBAEMKit: "ceaf685683c6a23ae4893150d0d770aeeaec34811ac8c146b3aa351beade5fa0",
|
|
28705
|
+
FBAudienceNetwork: "4d84bf1e404a83852a93af2ae73e22e45bb2b11e0a9a445c3b461173a5d6aec3",
|
|
28706
|
+
FBLPromises: "3544fb457e7f60c69740cdd26617a75bdd613943e948becca643022c7edd76c0",
|
|
28707
|
+
FBSDKCoreKit: "1577edd62ec0c172928befed3b309dc59ae8915d2aaad091460d9d1be5ddc13d",
|
|
28708
|
+
FBSDKCoreKit_Basics: "c780833f204f9ec6eab70a3758a45c5c78bfb6f4e590289ccf395497f204cac1",
|
|
28709
|
+
FirebaseAnalytics: "e3253a494375c5174d20cb81925e20afa1ff6b1419125cb608d39b092b53ff2a",
|
|
28710
|
+
FirebaseAppCheck: "af82d72727d55d14f65eee96845d4d9495e4e603b4673709d6f3448b9595cc63",
|
|
28711
|
+
FirebaseAppCheckInterop: "7ffd54e6fe187bf8cd714e3d863e0095f7cbbb0fb802adb87a40c552de7cffcc",
|
|
28712
|
+
FirebaseAuth: "fcde09db8d45ffba67802e81c17b8046db6b56568226ace3fca898983b08c968",
|
|
28713
|
+
FirebaseAuthInterop: "e8e6f4fb42b3fa76c2bade7a522ab0f224558d27d2321175c791d307541787a8",
|
|
28714
|
+
FirebaseCore: "30e3505c715e17682c1dc20bb26ba475e99e6981a9a0dba3cf9352eea632fc1d",
|
|
28715
|
+
FirebaseCoreExtension: "e37ce2abcd4c218ab5426da78cbe7ab41f79ee7eba1d02dd4b0cde952ed2c4a0",
|
|
28716
|
+
FirebaseCoreInternal: "72a15c0c63585faf93e9ffa91e8a8c1c50b24749405804ffae19a29ec05b07ab",
|
|
28717
|
+
FirebaseCrashlytics: "e03c71913efd97678b895abb1e968c83e58b3fbd7955a81ec6e6581b95db16e3",
|
|
28718
|
+
FirebaseFirestore: "f7a1bb7fc4a2fb09298b514114d6aaca9a4f00fd8868667524a05bc4563bf1fd",
|
|
28719
|
+
FirebaseFirestoreInternal: "d9595a1784beaf5cd4a8e0dda0f4364ddfa6b536ad60f82746d81d14dce037a3",
|
|
28720
|
+
FirebaseInstallations: "141e313325bab001f2dbb79dc8a433f884f4c4a12a5feb665e6958098d637f7b",
|
|
28721
|
+
FirebaseRemoteConfig: "e0ae6d626a423d535bc67216f9f0cd66f98f1c0fb4b5bf88074d4496733e2db1",
|
|
28722
|
+
FirebaseRemoteConfigInterop: "794f599eb4232058715b606fa671639c8cc5d821655a0f739651d17c5ef65c37",
|
|
28723
|
+
FirebaseSessions: "1781d72e47dac0fc7a532412641021730bd5b659135633cd9ef7b97ccd31b0ce",
|
|
28724
|
+
FirebaseSharedSwift: "8d63b09a517733ef3a58390bf1e8cf054f058bdd618bb4f19a1f4b5a0b4f09e5",
|
|
28725
|
+
FirebaseStorage: "636b33180dd5ad60b4878357691fe6472cf3bd57ec691e9d661c5444f523df66",
|
|
28726
|
+
GTMSessionFetcher: "f58dc2bd9db39defd73f0f67e7a11893a0c6e6f0ba45cd83cf420b2b3c15f1bd",
|
|
28727
|
+
GoogleAdsOnDeviceConversion: "31a5a1f5204f4844a480d3889b6ebe2e69473ef32b868935c51812c0483cb08b",
|
|
28728
|
+
GoogleAppMeasurement: "5741e6334392e0345f1b5896111ffef4d5a78859970f5e197fa0b7d881165305",
|
|
28729
|
+
GoogleAppMeasurementIdentitySupport: "b70cb033eeb002ed1c5a8140953ccb3be0221ca754c05fe450ed9c9c6547f274",
|
|
28730
|
+
GoogleDataTransport: "7d08050419e0906f13039cc4d2dd69be075234c0bf5bbb34df9dd4891e48831d",
|
|
28731
|
+
GoogleMobileAds: "f2c09c60ee331ce029f563304ad73a481d57ace0d4bc11ce33a2bf59497c59bf",
|
|
28732
|
+
GoogleUtilities: "37a9d3d3810dad763a8a79bd4c7cc4c37b386240725aca07f45dba1826676c8c",
|
|
28733
|
+
Intercom: "fc8251f24b305b91f83304d4dffaf1a90c424a7bc37be8b595dd1fc5cff566ea",
|
|
28734
|
+
Promises: "6d8f1a4b3d561d67adfc2026834779b05685d1cdacea6e83c70d0641c39f24de",
|
|
28735
|
+
RecaptchaInterop: "cf5cc62ebc237b34d5267c1190d18f33b424dbc7f81713f127108d0ad8a592cf",
|
|
28736
|
+
RiveRuntime: "72b6ff5c5a1d153c9cdbea9a917c09be557cfcb1fafa02853fa06b0268551710",
|
|
28737
|
+
absl: "fff0388cf074c69a2da4bc197a005da0b8e5c23ebdcfa383600c540a342f9df1",
|
|
28738
|
+
grpc: "918737c9f8f93e14127b3894e31c7a0522475f2247b74f87d8166dff3a6bafb0",
|
|
28739
|
+
grpcpp: "b83f85e0256cf06df00cf0ed728b5c0d68373ca401742877935771447450b90a",
|
|
28740
|
+
leveldb: "5521a6e6e4cd01b2e31b099d4341f1bccae7e8ba43de648b028928573daf8bb4",
|
|
28741
|
+
nanopb: "a7fafe2e4e16d99de4c58f72e22dcc53221885aa6d678d1270123e4b01badfa3",
|
|
28742
|
+
openssl_grpc: "b2aaede82457cdd15915762a4f57b38e28ba0f47b9b48556a7e0c46881973096"
|
|
28743
|
+
};
|
|
28744
|
+
}
|
|
28745
|
+
});
|
|
28746
|
+
|
|
28747
|
+
// src/swift-shipped-binaries.ts
|
|
28748
|
+
function shippedBinaryDiffers(target, checksum) {
|
|
28749
|
+
const shipped = SHIPPED_ARCHIVES.get(target);
|
|
28750
|
+
return shipped !== void 0 && checksum !== null && checksum !== shipped;
|
|
28751
|
+
}
|
|
28752
|
+
var SHIPPED_ARCHIVES;
|
|
28753
|
+
var init_swift_shipped_binaries = __esm({
|
|
28754
|
+
"src/swift-shipped-binaries.ts"() {
|
|
28755
|
+
"use strict";
|
|
28756
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
28757
|
+
init_swift_shipped_archives();
|
|
28758
|
+
SHIPPED_ARCHIVES = new Map(Object.entries(swift_shipped_archives_default));
|
|
28759
|
+
}
|
|
28760
|
+
});
|
|
28761
|
+
|
|
28633
28762
|
// src/swift-packages.ts
|
|
28634
28763
|
function remoteSwiftCheckouts(root) {
|
|
28635
28764
|
const prepared = preparedSwiftCheckouts(root);
|
|
@@ -28638,16 +28767,22 @@ function remoteSwiftCheckouts(root) {
|
|
|
28638
28767
|
import_node_fs68.default.mkdirSync(cacheDir(), { recursive: true });
|
|
28639
28768
|
return import_node_path66.default.join(import_node_fs68.default.realpathSync(cacheDir()), "swift-packages", key2, "checkouts");
|
|
28640
28769
|
}
|
|
28641
|
-
function
|
|
28770
|
+
function unlowerableSources(files2, target) {
|
|
28771
|
+
if (target.declaresWasiNativeSettings) return [];
|
|
28772
|
+
return [
|
|
28773
|
+
...files2.filter((file) => UNSUPPORTED_NATIVE.test(file)),
|
|
28774
|
+
...files2.filter(isSwiftNativeTranslationUnit).filter((file) => swiftCTakesReturnAddress(import_node_fs68.default.readFileSync(file, "utf8")))
|
|
28775
|
+
];
|
|
28776
|
+
}
|
|
28777
|
+
function unloweredSources(files2, target) {
|
|
28642
28778
|
if (target.type !== "regular") return null;
|
|
28643
|
-
if (target.declaresWasiNativeSettings) return null;
|
|
28644
|
-
const assembly = files2.filter((file) => UNSUPPORTED_NATIVE.test(file));
|
|
28645
|
-
if (assembly.length === 0) return null;
|
|
28646
28779
|
if (!files2.some(isSwiftNativeTranslationUnit)) return null;
|
|
28780
|
+
const unlowered = unlowerableSources(files2, target);
|
|
28781
|
+
if (unlowered.length === 0) return null;
|
|
28647
28782
|
const headers = import_node_path66.default.resolve(target.dir, target.publicHeadersPath);
|
|
28648
28783
|
if (!files2.some((file) => file.startsWith(`${headers}${import_node_path66.default.sep}`) && file.endsWith(".h")))
|
|
28649
28784
|
return null;
|
|
28650
|
-
return
|
|
28785
|
+
return unlowered;
|
|
28651
28786
|
}
|
|
28652
28787
|
function resolvedPins(data) {
|
|
28653
28788
|
if (!data || typeof data !== "object") return null;
|
|
@@ -28943,9 +29078,9 @@ function resolveSwiftPackages(options) {
|
|
|
28943
29078
|
if (target.type === "macro") return preservePackage(pkg, [name3], "host");
|
|
28944
29079
|
const files2 = target.type === "regular" || target.type === "system" ? swiftTargetFiles(pkg.manifest, target) : [];
|
|
28945
29080
|
const gap = options.binaryGaps?.get(name3);
|
|
28946
|
-
const
|
|
29081
|
+
const unlowerable = unlowerableSources(files2, target);
|
|
28947
29082
|
const placeholder = placeholderPackage(pkg);
|
|
28948
|
-
const ownReason = target.type === "binary" ? `${name3} ${BINARY}${gap ? `; ${gap}` : ""}` : placeholder && gap ? `${name3} stands in as a placeholder (${placeholder}), and ${gap}` : target.type !== "regular" && target.type !== "system" ? `${name3} is a ${target.type} target` :
|
|
29083
|
+
const ownReason = target.type === "binary" ? `${name3} ${BINARY}${gap ? `; ${gap}` : ""}` : placeholder && gap ? `${name3} stands in as a placeholder (${placeholder}), and ${gap}` : target.type !== "regular" && target.type !== "system" ? `${name3} is a ${target.type} target` : unlowerable.length > 0 ? `${name3} has native sources with no wasm32 lowering: ${unlowerable.map((file) => import_node_path66.default.relative(pkg.manifest.dir, file)).join(", ")}${gap ? `; ${gap}` : ""}` : null;
|
|
28949
29084
|
const reasons = target.dependencies.map((dependency) => {
|
|
28950
29085
|
if (dependency.kind === "target") return resolveTarget(pkg, dependency.name);
|
|
28951
29086
|
const nested = resolveDependencyProduct(pkg, dependency);
|
|
@@ -29024,7 +29159,7 @@ function resolveSwiftPackages(options) {
|
|
|
29024
29159
|
(file) => file.endsWith(".swift") && import_node_fs68.default.readFileSync(file, "utf8").trim() === ""
|
|
29025
29160
|
))
|
|
29026
29161
|
return false;
|
|
29027
|
-
if (
|
|
29162
|
+
if (unloweredSources(files2, target)) return false;
|
|
29028
29163
|
claimed.add(key2);
|
|
29029
29164
|
providedTargets.delete(name3);
|
|
29030
29165
|
for (const dependency of target.dependencies) {
|
|
@@ -29038,6 +29173,13 @@ function resolveSwiftPackages(options) {
|
|
|
29038
29173
|
};
|
|
29039
29174
|
const claimProduct = (pkg, product) => {
|
|
29040
29175
|
const roots = pkg.manifest.products.get(product)?.targets ?? [];
|
|
29176
|
+
for (const root of roots) {
|
|
29177
|
+
const target = pkg.manifest.targets.get(root);
|
|
29178
|
+
if (target?.type === "binary" && !options.standinTargets?.has(root) && shippedBinaryDiffers(root, target.checksum)) {
|
|
29179
|
+
providedTargets.delete(root);
|
|
29180
|
+
providedProducts.delete(product);
|
|
29181
|
+
}
|
|
29182
|
+
}
|
|
29041
29183
|
if (roots.map((name3) => claimTarget(pkg, name3)).some(Boolean))
|
|
29042
29184
|
providedProducts.delete(product);
|
|
29043
29185
|
};
|
|
@@ -29065,7 +29207,7 @@ function resolveSwiftPackages(options) {
|
|
|
29065
29207
|
if (target.type === "executable") continue;
|
|
29066
29208
|
const files2 = target.type === "regular" || target.type === "system" ? swiftTargetFiles(pkg.manifest, target) : [];
|
|
29067
29209
|
const objc = target.type === "regular" && files2.some((file) => /\.(m|mm)$/.test(file));
|
|
29068
|
-
const
|
|
29210
|
+
const unlowered = unloweredSources(files2, target);
|
|
29069
29211
|
const gap = placeholderPackage(pkg);
|
|
29070
29212
|
const sources = files2.filter((file) => file.endsWith(".swift"));
|
|
29071
29213
|
const release = (setting) => setting.configuration !== "debug";
|
|
@@ -29092,7 +29234,7 @@ function resolveSwiftPackages(options) {
|
|
|
29092
29234
|
]
|
|
29093
29235
|
}
|
|
29094
29236
|
});
|
|
29095
|
-
else if (target.type === "binary" || objc ||
|
|
29237
|
+
else if (target.type === "binary" || objc || unlowered)
|
|
29096
29238
|
result.binaries.push({
|
|
29097
29239
|
target: name3,
|
|
29098
29240
|
source: pkg.source,
|
|
@@ -29106,8 +29248,8 @@ function resolveSwiftPackages(options) {
|
|
|
29106
29248
|
import_node_path66.default.join(target.dir, target.publicHeadersPath)
|
|
29107
29249
|
)
|
|
29108
29250
|
},
|
|
29109
|
-
...
|
|
29110
|
-
|
|
29251
|
+
...unlowered ? {
|
|
29252
|
+
unloweredSources: unlowered.map(
|
|
29111
29253
|
(file) => import_node_path66.default.relative(pkg.manifest.dir, file)
|
|
29112
29254
|
)
|
|
29113
29255
|
} : {}
|
|
@@ -29328,8 +29470,10 @@ var init_swift_packages = __esm({
|
|
|
29328
29470
|
init_native_git();
|
|
29329
29471
|
init_numbered_lock();
|
|
29330
29472
|
init_prepared_xcode_phases();
|
|
29473
|
+
init_swift_compile();
|
|
29331
29474
|
init_swift_package();
|
|
29332
29475
|
init_swift_package_manifest();
|
|
29476
|
+
init_swift_shipped_binaries();
|
|
29333
29477
|
swiftBinaryOnDisk = (binary2) => binary2.url !== null || import_node_fs68.default.existsSync(binary2.dir);
|
|
29334
29478
|
SWIFT_PLACEHOLDER_PACKAGES = /* @__PURE__ */ new Map();
|
|
29335
29479
|
placeholderPackage = (pkg) => SWIFT_PLACEHOLDER_PACKAGES.get(swiftPackageIdentity(pkg.manifest.dir));
|
|
@@ -30928,7 +31072,7 @@ function interfaceEnumValues(graphs, interfaceText) {
|
|
|
30928
31072
|
const declarations = [
|
|
30929
31073
|
...interfaceText.matchAll(
|
|
30930
31074
|
new RegExp(
|
|
30931
|
-
`^([ \\t]*)(?:@[\\w.]+(?:\\([^)]*\\))?\\s+)*(?:nonisolated\\s+)?(?:public|open)\\s+enum\\s+${name3}\\s*:\\s*(?:Swift\\.)?U?Int(?:8|16|32|64)
|
|
31075
|
+
`^([ \\t]*)(?:@[\\w.]+(?:\\([^)]*\\))?\\s+)*(?:nonisolated\\s+)?(?:public|open)\\s+enum\\s+${name3}\\s*:\\s*(?:Swift\\.)?(?:U?Int(?:8|16|32|64)?|IntegerLiteralType)\\b[^{]*\\{[ \\t]*$`,
|
|
30932
31076
|
"gm"
|
|
30933
31077
|
)
|
|
30934
31078
|
)
|
|
@@ -31027,9 +31171,26 @@ function mixedStandin(surface, binary2, toolchain, work, behavior, frameworkDirs
|
|
|
31027
31171
|
view.protocolProperties ?? /* @__PURE__ */ new Map(),
|
|
31028
31172
|
null,
|
|
31029
31173
|
view.inheritedConformances,
|
|
31030
|
-
interfaceProjections(view.graphs, interfaceText)
|
|
31174
|
+
interfaceProjections(view.graphs, interfaceText),
|
|
31175
|
+
[],
|
|
31176
|
+
externalConformances(surface.module, interfaceText)
|
|
31031
31177
|
);
|
|
31032
31178
|
}
|
|
31179
|
+
function externalConformances(module2, interfaceText) {
|
|
31180
|
+
const lines = /* @__PURE__ */ new Set();
|
|
31181
|
+
for (const match of interfaceText.matchAll(
|
|
31182
|
+
/^(?:@\w+\s+)*extension\s+([\w.]+)\s*:\s*([^{\n]+?)\s*\{/gm
|
|
31183
|
+
)) {
|
|
31184
|
+
const [, extended, conformances] = match;
|
|
31185
|
+
if (extended.startsWith(`${module2}.`) || /\bwhere\b/.test(conformances)) continue;
|
|
31186
|
+
const own = conformances.split(",").map((name3) => name3.trim()).filter((name3) => name3.startsWith(`${module2}.`));
|
|
31187
|
+
const type = extended.startsWith("Swift.") ? extended : extended.split(".").slice(1).join(".");
|
|
31188
|
+
if (own.length > 0 && type) lines.add(`extension ${type} : ${own.join(", ")} {}
|
|
31189
|
+
`);
|
|
31190
|
+
}
|
|
31191
|
+
return lines.size > 0 ? `
|
|
31192
|
+
${[...lines].join("")}` : "";
|
|
31193
|
+
}
|
|
31033
31194
|
function wasmFlags(toolchain, imports2) {
|
|
31034
31195
|
const { sysroot, darwin, resources, cFlags } = swiftSdkPaths(
|
|
31035
31196
|
toolchain.moduleRoot,
|
|
@@ -31122,7 +31283,7 @@ function objcStandin(surface, binary2, toolchain, work, behavior, frameworks, si
|
|
|
31122
31283
|
dependencyGraphs
|
|
31123
31284
|
);
|
|
31124
31285
|
}
|
|
31125
|
-
function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, requiredInits2, declared, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = []) {
|
|
31286
|
+
function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, requiredInits2, declared, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = [], trailer = "") {
|
|
31126
31287
|
const paths = new Set(
|
|
31127
31288
|
graphs.flatMap(
|
|
31128
31289
|
(graph) => graph.symbols.map((symbol2) => symbol2.pathComponents.join("."))
|
|
@@ -31163,6 +31324,8 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31163
31324
|
const plain = /* @__PURE__ */ new Set();
|
|
31164
31325
|
const unobjc = /* @__PURE__ */ new Set();
|
|
31165
31326
|
const trapped = /* @__PURE__ */ new Set();
|
|
31327
|
+
const forced = /* @__PURE__ */ new Set();
|
|
31328
|
+
const nonfailable = /* @__PURE__ */ new Set();
|
|
31166
31329
|
const unconformed = /* @__PURE__ */ new Map();
|
|
31167
31330
|
const objcProtocols = new Set(
|
|
31168
31331
|
graphs.flatMap(
|
|
@@ -31172,7 +31335,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31172
31335
|
)
|
|
31173
31336
|
);
|
|
31174
31337
|
const file = import_node_path70.default.join(work, `${module2}.swift`);
|
|
31175
|
-
const inert = binary2.placeholder !== void 0 || binary2.publicHeaders !== void 0 && binary2.
|
|
31338
|
+
const inert = binary2.placeholder !== void 0 || binary2.publicHeaders !== void 0 && binary2.unloweredSources === void 0;
|
|
31176
31339
|
for (; ; ) {
|
|
31177
31340
|
const { source, owners, skipped } = emitSwiftStandin(graphs, {
|
|
31178
31341
|
module: module2,
|
|
@@ -31185,6 +31348,8 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31185
31348
|
unobjc,
|
|
31186
31349
|
unconformed,
|
|
31187
31350
|
trapped,
|
|
31351
|
+
forcedOverride: forced,
|
|
31352
|
+
coderNonfailable: nonfailable,
|
|
31188
31353
|
inert,
|
|
31189
31354
|
imports: [...placeholder?.peachImports ?? [], ...imports2],
|
|
31190
31355
|
family: [...imports2, ...placeholder?.peachImports ?? []],
|
|
@@ -31204,7 +31369,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31204
31369
|
`Configured Swift behavior ${module2}.${entry.path} was not emitted: ${entry.reason}`
|
|
31205
31370
|
);
|
|
31206
31371
|
}
|
|
31207
|
-
import_node_fs73.default.writeFileSync(file, source);
|
|
31372
|
+
import_node_fs73.default.writeFileSync(file, source + trailer);
|
|
31208
31373
|
const check2 = (0, import_node_child_process37.spawnSync)(
|
|
31209
31374
|
import_node_path70.default.join(toolchain.toolchainBin, "swiftc"),
|
|
31210
31375
|
// emitting the module runs the diagnostics a typecheck skips, such as
|
|
@@ -31228,10 +31393,10 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31228
31393
|
return {
|
|
31229
31394
|
module: module2,
|
|
31230
31395
|
target: binary2.target,
|
|
31231
|
-
files: { [`${module2}.swift`]: source },
|
|
31396
|
+
files: { [`${module2}.swift`]: source + trailer },
|
|
31232
31397
|
...imports2.length ? { dependencies: imports2 } : {}
|
|
31233
31398
|
};
|
|
31234
|
-
const before = omit.size + plain.size + unobjc.size + trapped.size + unconformed.size;
|
|
31399
|
+
const before = omit.size + plain.size + unobjc.size + trapped.size + unconformed.size + forced.size + nonfailable.size;
|
|
31235
31400
|
const elsewhere = [];
|
|
31236
31401
|
for (const match of check2.stderr.matchAll(/^(\S+?):(\d+):\d+: error: (.*)$/gm)) {
|
|
31237
31402
|
const owner = match[1] === file ? owners[Number(match[2]) - 1] : void 0;
|
|
@@ -31254,14 +31419,22 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31254
31419
|
throw new Error(
|
|
31255
31420
|
`Configured Swift behavior ${module2}.${owner} does not typecheck: ${match[3]}`
|
|
31256
31421
|
);
|
|
31257
|
-
if (owner && /does not override any|overrides nothing/.test(
|
|
31422
|
+
if (owner && /does not override any|overrides nothing|does not override a designated initializer/.test(
|
|
31423
|
+
match[3]
|
|
31424
|
+
))
|
|
31258
31425
|
plain.add(owner);
|
|
31426
|
+
else if (owner && /failable initializer 'init\(coder:\)' cannot override a non-failable/.test(
|
|
31427
|
+
match[3]
|
|
31428
|
+
) && !nonfailable.has(owner))
|
|
31429
|
+
nonfailable.add(owner);
|
|
31430
|
+
else if (owner && /requires an 'override' keyword/.test(match[3]) && !forced.has(owner))
|
|
31431
|
+
forced.add(owner);
|
|
31259
31432
|
else if (owner && inert && INERT_VALUE.test(match[3]) && !trapped.has(owner))
|
|
31260
31433
|
trapped.add(owner);
|
|
31261
31434
|
else if (owner) omit.set(owner, `rejected by swiftc: ${match[3]}`);
|
|
31262
31435
|
else elsewhere.push(match[3]);
|
|
31263
31436
|
}
|
|
31264
|
-
if (omit.size + plain.size + unobjc.size + trapped.size + unconformed.size === before)
|
|
31437
|
+
if (omit.size + plain.size + unobjc.size + trapped.size + unconformed.size + forced.size + nonfailable.size === before)
|
|
31265
31438
|
throw new Error(
|
|
31266
31439
|
`its generated source does not typecheck: ${elsewhere.slice(0, 3).join("; ") || check2.stderr.trim().slice(0, 400)}`
|
|
31267
31440
|
);
|
|
@@ -32063,7 +32236,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
32063
32236
|
...(binary2.headerDependencies ?? []).map(
|
|
32064
32237
|
(dependency) => `${swiftTargetModuleName(dependency.module)}\0${treeDigest2(import_node_path70.default.join(binary2.dir, dependency.path))}`
|
|
32065
32238
|
),
|
|
32066
|
-
...binary2.
|
|
32239
|
+
...binary2.unloweredSources ?? []
|
|
32067
32240
|
].join("\0") : swiftBinaryFramework(binary2).digest
|
|
32068
32241
|
);
|
|
32069
32242
|
} catch {
|
|
@@ -32746,7 +32919,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
32746
32919
|
const binaryHeaders = binarySearch.flatMap((search) => search.headers);
|
|
32747
32920
|
const configuration = app.configuration === "Debug" ? "debug" : "release";
|
|
32748
32921
|
for (const binary2 of binaries) {
|
|
32749
|
-
if (!binary2.reached || binary2.publicHeaders === void 0 || binary2.
|
|
32922
|
+
if (!binary2.reached || binary2.publicHeaders === void 0 || binary2.unloweredSources !== void 0)
|
|
32750
32923
|
continue;
|
|
32751
32924
|
const manifest = swiftPackageManifest(binary2.dir);
|
|
32752
32925
|
const target = manifest.targets.get(binary2.target);
|
|
@@ -36170,9 +36343,9 @@ var init_self_invocation = __esm({
|
|
|
36170
36343
|
});
|
|
36171
36344
|
|
|
36172
36345
|
// src/swift-pdf-raster.ts
|
|
36173
|
-
function rasterBinary() {
|
|
36174
|
-
const tag = (0, import_node_crypto39.createHash)("sha256").update(
|
|
36175
|
-
const binary2 = import_node_path76.default.join(cacheDir(),
|
|
36346
|
+
function rasterBinary(swift = RASTER_SWIFT, name3 = "swift-pdf-raster") {
|
|
36347
|
+
const tag = (0, import_node_crypto39.createHash)("sha256").update(swift).digest("hex").slice(0, 16);
|
|
36348
|
+
const binary2 = import_node_path76.default.join(cacheDir(), `${name3}-${tag}`);
|
|
36176
36349
|
try {
|
|
36177
36350
|
import_node_fs79.default.accessSync(binary2, import_node_fs79.default.constants.X_OK);
|
|
36178
36351
|
return binary2;
|
|
@@ -36184,7 +36357,7 @@ function rasterBinary() {
|
|
|
36184
36357
|
import_node_fs79.default.mkdtempSync(import_node_path76.default.join(import_node_os16.default.tmpdir(), "swift-pdf-raster-")),
|
|
36185
36358
|
"raster.swift"
|
|
36186
36359
|
);
|
|
36187
|
-
import_node_fs79.default.writeFileSync(source,
|
|
36360
|
+
import_node_fs79.default.writeFileSync(source, swift);
|
|
36188
36361
|
try {
|
|
36189
36362
|
(0, import_node_child_process40.execFileSync)("xcrun", ["swiftc", "-o", binary2, source], { stdio: "pipe" });
|
|
36190
36363
|
} finally {
|
|
@@ -36242,7 +36415,31 @@ function rasterizePdfFile(diskPath, pdfSha256) {
|
|
|
36242
36415
|
import_node_fs79.default.rmSync(import_node_path76.default.dirname(out), { recursive: true, force: true });
|
|
36243
36416
|
}
|
|
36244
36417
|
}
|
|
36245
|
-
|
|
36418
|
+
function rasterizeSvgFile(diskPath, svgSha256) {
|
|
36419
|
+
if (process.platform !== "darwin") return null;
|
|
36420
|
+
const binary2 = rasterBinary(RASTER_SVG_SWIFT, "swift-svg-raster");
|
|
36421
|
+
const tag = (0, import_node_crypto39.createHash)("sha256").update(RASTER_SVG_SWIFT).digest("hex").slice(0, 16);
|
|
36422
|
+
const cached2 = import_node_path76.default.join(cacheDir(), `swift-svg-png-${tag}-${svgSha256}.png`);
|
|
36423
|
+
if (import_node_fs79.default.existsSync(cached2)) return { bytes: import_node_fs79.default.readFileSync(cached2) };
|
|
36424
|
+
const out = import_node_path76.default.join(
|
|
36425
|
+
import_node_fs79.default.mkdtempSync(import_node_path76.default.join(import_node_os16.default.tmpdir(), "swift-svg-png-")),
|
|
36426
|
+
"out.png"
|
|
36427
|
+
);
|
|
36428
|
+
try {
|
|
36429
|
+
(0, import_node_child_process40.execFileSync)(binary2, [diskPath, "3", out], { stdio: "pipe" });
|
|
36430
|
+
const bytes = import_node_fs79.default.readFileSync(out);
|
|
36431
|
+
import_node_fs79.default.mkdirSync(cacheDir(), { recursive: true });
|
|
36432
|
+
import_node_fs79.default.copyFileSync(out, cached2);
|
|
36433
|
+
return { bytes: Buffer.from(bytes) };
|
|
36434
|
+
} catch (error) {
|
|
36435
|
+
throw new Error(
|
|
36436
|
+
`swift svg asset ${diskPath} did not rasterize: ${error instanceof Error ? error.message : String(error)}`
|
|
36437
|
+
);
|
|
36438
|
+
} finally {
|
|
36439
|
+
import_node_fs79.default.rmSync(import_node_path76.default.dirname(out), { recursive: true, force: true });
|
|
36440
|
+
}
|
|
36441
|
+
}
|
|
36442
|
+
var import_node_child_process40, import_node_crypto39, import_node_fs79, import_node_os16, import_node_path76, RASTER_SWIFT, RASTER_SVG_SWIFT;
|
|
36246
36443
|
var init_swift_pdf_raster = __esm({
|
|
36247
36444
|
"src/swift-pdf-raster.ts"() {
|
|
36248
36445
|
"use strict";
|
|
@@ -36278,6 +36475,25 @@ guard let image = ctx.makeImage() else { exit(5) }
|
|
|
36278
36475
|
guard let dest = CGImageDestinationCreateWithURL(output as CFURL, UTType.png.identifier as CFString, 1, nil) else { exit(6) }
|
|
36279
36476
|
CGImageDestinationAddImage(dest, image, nil)
|
|
36280
36477
|
guard CGImageDestinationFinalize(dest) else { exit(7) }
|
|
36478
|
+
`;
|
|
36479
|
+
RASTER_SVG_SWIFT = `import AppKit
|
|
36480
|
+
guard CommandLine.arguments.count == 4 else { exit(1) }
|
|
36481
|
+
let input = URL(fileURLWithPath: CommandLine.arguments[1])
|
|
36482
|
+
let scale = CGFloat(Double(CommandLine.arguments[2]) ?? 3.0)
|
|
36483
|
+
let output = URL(fileURLWithPath: CommandLine.arguments[3])
|
|
36484
|
+
guard let image = NSImage(contentsOf: input), image.size.width > 0, image.size.height > 0 else { exit(2) }
|
|
36485
|
+
let width = Int(ceil(image.size.width * scale))
|
|
36486
|
+
let height = Int(ceil(image.size.height * scale))
|
|
36487
|
+
if width > 12000 || height > 12000 { exit(3) }
|
|
36488
|
+
guard let rep = NSBitmapImageRep(bitmapDataPlanes: nil, pixelsWide: width, pixelsHigh: height, bitsPerSample: 8, samplesPerPixel: 4, hasAlpha: true, isPlanar: false, colorSpaceName: .deviceRGB, bytesPerRow: 0, bitsPerPixel: 0) else { exit(4) }
|
|
36489
|
+
guard let context = NSGraphicsContext(bitmapImageRep: rep) else { exit(5) }
|
|
36490
|
+
NSGraphicsContext.saveGraphicsState()
|
|
36491
|
+
NSGraphicsContext.current = context
|
|
36492
|
+
context.imageInterpolation = .high
|
|
36493
|
+
image.draw(in: NSRect(x: 0, y: 0, width: width, height: height), from: .zero, operation: .copy, fraction: 1)
|
|
36494
|
+
NSGraphicsContext.restoreGraphicsState()
|
|
36495
|
+
guard let data = rep.representation(using: .png, properties: [:]) else { exit(6) }
|
|
36496
|
+
do { try data.write(to: output) } catch { exit(7) }
|
|
36281
36497
|
`;
|
|
36282
36498
|
}
|
|
36283
36499
|
});
|
|
@@ -36475,7 +36691,7 @@ async function swiftPackages(entry, app) {
|
|
|
36475
36691
|
] : []
|
|
36476
36692
|
);
|
|
36477
36693
|
let reached = [...cached2.binaries.filter((binary2) => binary2.reached), ...vendored];
|
|
36478
|
-
const standinArtifact = (binary2) => binary2.publicHeaders === void 0 || binary2.
|
|
36694
|
+
const standinArtifact = (binary2) => binary2.publicHeaders === void 0 || binary2.unloweredSources !== void 0;
|
|
36479
36695
|
const artifacts = reached.filter(standinArtifact);
|
|
36480
36696
|
if (entry.moduleRoot && entry.provided && artifacts.length > 0) {
|
|
36481
36697
|
const resolved = swiftModuleToolchain(entry.moduleRoot);
|
|
@@ -36494,10 +36710,13 @@ async function swiftPackages(entry, app) {
|
|
|
36494
36710
|
const cxxArtifacts = reached.filter(standinArtifact);
|
|
36495
36711
|
const generation = standinGenerationInputs(cxxArtifacts, toolchain, entry.behavior);
|
|
36496
36712
|
if (cached2.standinKey !== generation) {
|
|
36713
|
+
const replaced = new Set(
|
|
36714
|
+
cxxArtifacts.filter((binary2) => shippedBinaryDiffers(binary2.target, binary2.checksum)).map((binary2) => binary2.target)
|
|
36715
|
+
);
|
|
36497
36716
|
const built2 = await swiftStandins(
|
|
36498
36717
|
cxxArtifacts,
|
|
36499
36718
|
toolchain,
|
|
36500
|
-
entry.provided,
|
|
36719
|
+
new Set([...entry.provided].filter((name3) => !replaced.has(name3))),
|
|
36501
36720
|
entry.behavior
|
|
36502
36721
|
);
|
|
36503
36722
|
cached2.packages = await resolveSwiftPackagesAsync({
|
|
@@ -36511,6 +36730,9 @@ async function swiftPackages(entry, app) {
|
|
|
36511
36730
|
...entry.provided,
|
|
36512
36731
|
...cxxArtifacts.map((binary2) => binary2.target).filter((target) => !built2.gaps.has(target))
|
|
36513
36732
|
]),
|
|
36733
|
+
standinTargets: new Set(
|
|
36734
|
+
[...replaced].filter((target) => !built2.gaps.has(target))
|
|
36735
|
+
),
|
|
36514
36736
|
binaryGaps: built2.gaps,
|
|
36515
36737
|
owners
|
|
36516
36738
|
});
|
|
@@ -37420,6 +37642,12 @@ function buildSwiftResourceTable(project, baseUrl, inputs) {
|
|
|
37420
37642
|
throw new Error("swift image pack exceeds the compile service caps");
|
|
37421
37643
|
}
|
|
37422
37644
|
bytes = readPackageFile2(project.packagePath, disk, limits.imageBytes);
|
|
37645
|
+
const svg = ext === ".svg" ? rasterizeSvgFile(disk, (0, import_node_crypto40.createHash)("sha256").update(bytes).digest("hex")) : null;
|
|
37646
|
+
if (svg) {
|
|
37647
|
+
bytes = svg.bytes;
|
|
37648
|
+
ext = ".png";
|
|
37649
|
+
uploadName = `${import_node_path77.default.posix.basename(file, import_node_path77.default.posix.extname(file))}.png`;
|
|
37650
|
+
}
|
|
37423
37651
|
}
|
|
37424
37652
|
if (imageBytes + bytes.length > limits.imageTotalBytes) {
|
|
37425
37653
|
throw new Error("swift image pack exceeds the compile service caps");
|
|
@@ -38311,6 +38539,7 @@ var init_swift_host = __esm({
|
|
|
38311
38539
|
init_swift_package_manifest();
|
|
38312
38540
|
init_swift_packages();
|
|
38313
38541
|
init_swift_pdf_raster();
|
|
38542
|
+
init_swift_shipped_binaries();
|
|
38314
38543
|
init_swift_source_file();
|
|
38315
38544
|
init_swift_standin_config();
|
|
38316
38545
|
init_swift_standins();
|
|
@@ -48548,7 +48777,7 @@ init_swift_native_pin();
|
|
|
48548
48777
|
init_xcode_project();
|
|
48549
48778
|
var EXPO_NATIVE_ENTRY_NAME = "ios";
|
|
48550
48779
|
function expoNativeCompilerDigestValue() {
|
|
48551
|
-
return true ? "
|
|
48780
|
+
return true ? "84a9fe588bafb71e772f78ffc8de2ac50d4ff654547f5aab6cb44528fc7c7d15" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
48552
48781
|
}
|
|
48553
48782
|
var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
|
|
48554
48783
|
function readSources(value) {
|