peachsim 0.1.2018 → 0.1.2021
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/inspect/settling.ts +11 -6
- package/cli/commands/screenshots-capture.ts +9 -2
- package/cli/outbound-endpoints.ts +1 -1
- package/cli/telemetry.ts +19 -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 +383 -102
- 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 -4
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +377 -96
- 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 +382 -101
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +83 -18
- 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 +78 -15
- package/dist-lib/native-app-identity-project.cjs +76 -13
- package/dist-lib/native-app-identity-project.mjs +76 -12
- package/dist-lib/native-app-identity.cjs +5 -2
- package/dist-lib/native-app-identity.mjs +5 -2
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +53 -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 +6 -4
- package/dist-lib/sdk.mjs +6 -4
- package/dist-lib/skills.cjs +389 -106
- package/dist-lib/swift-compile.cjs +101 -66
- package/dist-lib/swift-compile.mjs +100 -65
- 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 +26 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +376 -95
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/components/native-ui/context-menu-types.d.ts +84 -0
- package/dist-types/packages/peach-engine/src/engine/animated.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/fontDataContract.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/rn-spring.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/render-worker/graph-linked-value.d.ts +4 -1
- package/dist-types/packages/peach-engine/src/render-worker/native-menu-gesture.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -0
- package/package.json +1 -1
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSession.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/CoreData.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h +10 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchRequest.h +28 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObject.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectContext.h +16 -1
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectModel.h +3 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreCoordinator.h +7 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreRequest.h +3 -0
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSPredicate.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSSortDescriptor.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSURLConnection.h +1 -1
- package/sdk/ios/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAContext.h +1 -1
- package/sdk/ios/System/Library/Frameworks/SafariServices.framework/Headers/SFAuthenticationSession.h +17 -0
- package/sdk/ios/System/Library/Frameworks/SafariServices.framework/Headers/SafariServices.h +1 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInputViewController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPageViewController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPointerStyle.h +1 -6
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Modules/module.modulemap +1 -0
- package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +6 -0
- package/sdk/ios/System/Library/Frameworks/WatchConnectivity.framework/Headers/WCSession.h +1 -1
- package/sdk/ios/usr/include/objc/NSObject.h +1 -1
- package/sdk/ios/wasm/include/stdlib.h +1 -0
- package/src/nitro-adapter.lock.json +274 -274
- package/src/nitro-superset.lock.json +4 -4
- package/src/swift-compile.ts +70 -81
- package/src/swift-distribution.lock.json +14 -12
- package/src/swift-guest-image-ledger.ts +15 -10
- package/src/swift-guest-source-inputs.ts +6 -3
- package/src/swift-guest-source-plan.ts +5 -1
- package/src/swift-objc-compile.ts +2 -2
- package/src/swift-objc-standin.ts +197 -5
- package/src/swift-packages.ts +13 -12
- package/src/swift-shared-sdk.ts +2 -1
- package/src/swift-standin-emit.ts +43 -5
- package/src/swift-standins.ts +41 -2
- package/src/swift-toolchain.ts +24 -0
- package/src/turbo-runtime.lock.json +23 -23
- package/src/xcode-project.ts +59 -1
- package/src/xcode-target-members.ts +4 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2021 | (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;
|
|
@@ -34,7 +34,6 @@ var swift_compile_exports = {};
|
|
|
34
34
|
__export(swift_compile_exports, {
|
|
35
35
|
FOUNDATION_IMPLICIT_MODULES: () => FOUNDATION_IMPLICIT_MODULES,
|
|
36
36
|
MULTI_MANIFEST_VERSION: () => MULTI_MANIFEST_VERSION,
|
|
37
|
-
SWIFT_BUILD_JOBS: () => SWIFT_BUILD_JOBS,
|
|
38
37
|
WASM_TRIPLE: () => WASM_TRIPLE,
|
|
39
38
|
brotliCompressQ11: () => brotliCompressQ11,
|
|
40
39
|
brotliCompressQ4: () => brotliCompressQ4,
|
|
@@ -55,6 +54,7 @@ __export(swift_compile_exports, {
|
|
|
55
54
|
swiftApplicationEntry: () => swiftApplicationEntry,
|
|
56
55
|
swiftArtifactHash: () => swiftArtifactHash,
|
|
57
56
|
swiftAvailableModules: () => swiftAvailableModules,
|
|
57
|
+
swiftBuildJobs: () => swiftBuildJobs,
|
|
58
58
|
swiftBuilderHopTimeoutMs: () => swiftBuilderHopTimeoutMs,
|
|
59
59
|
swiftCDefinedNames: () => swiftCDefinedNames,
|
|
60
60
|
swiftCMainEntry: () => swiftCMainEntry,
|
|
@@ -2678,6 +2678,24 @@ function swiftSdkOptions() {
|
|
|
2678
2678
|
var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-81b2c791c27276bf";
|
|
2679
2679
|
var SWIFT_HOST_COMPILER_ID = "81b2c791c27276bf";
|
|
2680
2680
|
var compilerArchives = {
|
|
2681
|
+
"swift-6.4.0-RELEASE-custom-11345d60dca47496": {
|
|
2682
|
+
identity: "11345d60dca47496",
|
|
2683
|
+
archive: "tar.zst",
|
|
2684
|
+
hosts: {
|
|
2685
|
+
"darwin-arm64": {
|
|
2686
|
+
checksum: "3df74a95c6f3ffa45aaa412027b390c99f9af81f6f6a41bf6d58a1a3079b5b02",
|
|
2687
|
+
manifest: "8e5ed4be6adc967e4c7d955eff004c96d5dc050a589d50e1b3e694b70f9afd63"
|
|
2688
|
+
},
|
|
2689
|
+
"linux-x64": {
|
|
2690
|
+
checksum: "a80e46add069932114bacc18640dc2e6a1a8f2a3ea7306a8ea8614d5cdf6e0e7",
|
|
2691
|
+
manifest: "662d8869534f3cce827b1205973db1f9a1e1d92027005a5bdb6893f9c2a0b39d"
|
|
2692
|
+
},
|
|
2693
|
+
"linux-arm64": {
|
|
2694
|
+
checksum: "4ca69bbc284fc7d54be57c80b744b88cce997d470ff23048795db54e7a6fbcba",
|
|
2695
|
+
manifest: "85df84da2f814b6a71c264b37b83a81965ac33b5d2b465443d60c08cc7bc5dc3"
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
},
|
|
2681
2699
|
"swift-6.4.0-RELEASE-custom-45bb46301c86fe73": {
|
|
2682
2700
|
identity: "45bb46301c86fe73",
|
|
2683
2701
|
archive: "tar.gz",
|
|
@@ -2882,7 +2900,12 @@ function privateSwiftDistributionRoot() {
|
|
|
2882
2900
|
const root = process.env[SWIFT_PRIVATE_DISTRIBUTION_ENV]?.trim();
|
|
2883
2901
|
return root ? import_node_path4.default.resolve(root) : null;
|
|
2884
2902
|
}
|
|
2903
|
+
function privateSwiftCompilerRelease() {
|
|
2904
|
+
return process.env.PEACH_SWIFT_PRIVATE_COMPILER_RELEASE?.trim() || null;
|
|
2905
|
+
}
|
|
2885
2906
|
function privateSwiftRelease() {
|
|
2907
|
+
const compiler = privateSwiftCompilerRelease();
|
|
2908
|
+
if (compiler) return compiler;
|
|
2886
2909
|
const root = privateSwiftDistributionRoot();
|
|
2887
2910
|
if (!root) return null;
|
|
2888
2911
|
const manifest = JSON.parse(
|
|
@@ -4116,7 +4139,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
|
|
|
4116
4139
|
const overlay = import_node_path8.default.join(swiftSharedSdkRoot(moduleRoot, distribution), "wasm/include");
|
|
4117
4140
|
const overlayFiles = (0, import_node_fs7.readdirSync)(overlay, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path8.default.join(entry.parentPath, entry.name)).sort();
|
|
4118
4141
|
const key = JSON.stringify([
|
|
4119
|
-
"
|
|
4142
|
+
"v22",
|
|
4120
4143
|
toolchainBin,
|
|
4121
4144
|
sdk,
|
|
4122
4145
|
frameworks,
|
|
@@ -4172,6 +4195,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
|
|
|
4172
4195
|
[import_node_path8.default.join(sysroot, "darwin/System/Library/Frameworks"), frameworks],
|
|
4173
4196
|
...[
|
|
4174
4197
|
"MacTypes.h",
|
|
4198
|
+
"objc/NSObject.h",
|
|
4175
4199
|
"net/if.h",
|
|
4176
4200
|
"notify.h",
|
|
4177
4201
|
"notify.modulemap",
|
|
@@ -7046,13 +7070,18 @@ function createGuestImageLedger(input) {
|
|
|
7046
7070
|
exported.set(definition.alias, definition);
|
|
7047
7071
|
}
|
|
7048
7072
|
const names = [...new Set([...exported.values()].map((definition) => definition.name))];
|
|
7049
|
-
const
|
|
7050
|
-
|
|
7051
|
-
names.
|
|
7073
|
+
const nameOffsets = /* @__PURE__ */ new Map();
|
|
7074
|
+
let nameSize = 0;
|
|
7075
|
+
const nameContents = names.map((name2) => {
|
|
7052
7076
|
const bytes = Buffer.concat([Buffer.from(name2), Buffer.from([0])]);
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7077
|
+
nameOffsets.set(name2, nameSize);
|
|
7078
|
+
nameSize += bytes.length;
|
|
7079
|
+
return [...bytes].map((byte) => `\\${byte.toString(16).padStart(2, "0")}`).join("");
|
|
7080
|
+
}).join("");
|
|
7081
|
+
const ir = [
|
|
7082
|
+
'target triple = "wasm32-unknown-wasip1"',
|
|
7083
|
+
`@.names = private constant [${nameSize} x i8] c"${nameContents}"`
|
|
7084
|
+
];
|
|
7056
7085
|
for (const definition of exported.values()) {
|
|
7057
7086
|
if (definition.kind === "function")
|
|
7058
7087
|
ir.push(
|
|
@@ -7063,7 +7092,7 @@ function createGuestImageLedger(input) {
|
|
|
7063
7092
|
ir.push(`@__peach_dyld_symbols = constant [${exported.size} x { ptr, i32, ptr }] [`);
|
|
7064
7093
|
ir.push(
|
|
7065
7094
|
[...exported.values()].map(
|
|
7066
|
-
(definition) => ` { ptr, i32, ptr } { ptr @.
|
|
7095
|
+
(definition) => ` { ptr, i32, ptr } { ptr getelementptr (i8, ptr @.names, i32 ${nameOffsets.get(definition.name)}), i32 ${definition.image}, ptr @${definition.alias} }`
|
|
7067
7096
|
).join(",\n")
|
|
7068
7097
|
);
|
|
7069
7098
|
ir.push("]", `@__peach_dyld_symbol_count = constant i32 ${exported.size}`);
|
|
@@ -7884,7 +7913,7 @@ function guestSourceImages(graph) {
|
|
|
7884
7913
|
const type = dependency.productType;
|
|
7885
7914
|
let dynamic;
|
|
7886
7915
|
if (type.startsWith("swiftpm.target.")) {
|
|
7887
|
-
if (type !== "swiftpm.target.regular" && type !== "swiftpm.target.binary")
|
|
7916
|
+
if (type !== "swiftpm.target.regular" && type !== "swiftpm.target.binary" && type !== "swiftpm.target.system")
|
|
7888
7917
|
throw new Error(`unsupported SwiftPM target ${edge.target}`);
|
|
7889
7918
|
dynamic = false;
|
|
7890
7919
|
} else if (type.startsWith("swiftpm.library.")) {
|
|
@@ -9805,10 +9834,11 @@ function sourceGuestRuntimeLinks(options) {
|
|
|
9805
9834
|
const links = [];
|
|
9806
9835
|
const requests = [];
|
|
9807
9836
|
const optionGroups = [
|
|
9808
|
-
{ object: null, flags:
|
|
9809
|
-
|
|
9837
|
+
{ object: null, flags: image.linkerFlags, autoLinked: false },
|
|
9838
|
+
{ object: null, flags: autolink, autoLinked: true },
|
|
9839
|
+
...image.clangLinkOptions.map((options2) => ({ ...options2, autoLinked: true }))
|
|
9810
9840
|
];
|
|
9811
|
-
for (const { object: object3, flags } of optionGroups) {
|
|
9841
|
+
for (const { object: object3, flags, autoLinked } of optionGroups) {
|
|
9812
9842
|
for (let index = 0; index < flags.length; index++) {
|
|
9813
9843
|
const flag = flags[index];
|
|
9814
9844
|
const artifact = artifacts.get(flag);
|
|
@@ -9825,6 +9855,7 @@ function sourceGuestRuntimeLinks(options) {
|
|
|
9825
9855
|
if (flag === "-framework") {
|
|
9826
9856
|
const name3 = flags[++index];
|
|
9827
9857
|
const provider = name3 && frameworkAliases.get(name3);
|
|
9858
|
+
if (!provider && name3 && autoLinked) continue;
|
|
9828
9859
|
if (!provider)
|
|
9829
9860
|
throw new Error(
|
|
9830
9861
|
`source image ${image.id} has unresolved framework linkage ${name3}`
|
|
@@ -11579,13 +11610,14 @@ async function runCompiler(command, args, options, stream = false, quiet) {
|
|
|
11579
11610
|
var WASM_TRIPLE = "wasm32-unknown-wasip1";
|
|
11580
11611
|
var SWIFTPM_PROGRESS = /^\[\d+\/\d+\] /;
|
|
11581
11612
|
var SWIFTPM_NOISE = /^(?:\[\d+\/\d+\] |Building for production\.\.\.$|warning: '--build-system native' has been deprecated)/;
|
|
11582
|
-
|
|
11583
|
-
|
|
11584
|
-
|
|
11585
|
-
|
|
11586
|
-
|
|
11587
|
-
)
|
|
11588
|
-
|
|
11613
|
+
function swiftBuildJobs() {
|
|
11614
|
+
const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
|
|
11615
|
+
return Math.min(
|
|
11616
|
+
4,
|
|
11617
|
+
Math.max(1, Math.floor(import_node_os10.default.availableParallelism() / 2)),
|
|
11618
|
+
Number.isInteger(admittedCores) && admittedCores > 0 ? admittedCores : 4
|
|
11619
|
+
);
|
|
11620
|
+
}
|
|
11589
11621
|
var SWIFT_BUILDER_TRANSPORT_MARGIN_MS = 3e5;
|
|
11590
11622
|
var SWIFT_BUILDER_DEFAULT_COMPILE_MS = 18e5;
|
|
11591
11623
|
function swiftBuilderHopTimeoutMs(compileTimeoutMs) {
|
|
@@ -12373,9 +12405,9 @@ var executableLinkFlags = (root) => ` "-Xclang-linker", "-O0",
|
|
|
12373
12405
|
`;
|
|
12374
12406
|
var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quoted, "-Wl,--end-lib"] : [];
|
|
12375
12407
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
12376
|
-
var MULTI_MANIFEST_VERSION =
|
|
12408
|
+
var MULTI_MANIFEST_VERSION = 68;
|
|
12377
12409
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
12378
|
-
var compilerSourceDigest = true ? "
|
|
12410
|
+
var compilerSourceDigest = true ? "0be1de6e499585bfdd605805a7b9dbaa1f1e8d69f2a1a65d693d7952343a2edb" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
12379
12411
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
12380
12412
|
const hash = (0, import_node_crypto13.createHash)("sha256");
|
|
12381
12413
|
hash.update(`swift-compile
|
|
@@ -12517,7 +12549,23 @@ function emitSwiftPackageManifest(args) {
|
|
|
12517
12549
|
const distributionLink = args.distributionLink;
|
|
12518
12550
|
if (distribution && distributionLink) {
|
|
12519
12551
|
const isProvider = (object3) => object3.startsWith(`lib/${DARWIN_RECORDS_PREFIX}`);
|
|
12520
|
-
const
|
|
12552
|
+
const sourceModules = new Set(
|
|
12553
|
+
targets.filter(
|
|
12554
|
+
(target) => args.sourceSwiftTargets?.has(target.name) && !args.native?.get(target.name)?.clang
|
|
12555
|
+
).map((target) => swiftTargetModuleName(target.name))
|
|
12556
|
+
);
|
|
12557
|
+
const product = v5.parse(
|
|
12558
|
+
swiftFrameworkProductSchema,
|
|
12559
|
+
JSON.parse(
|
|
12560
|
+
(0, import_node_fs25.readFileSync)(import_node_path27.default.join(moduleRoot, SWIFT_FRAMEWORK_PRODUCT_FILE), "utf8")
|
|
12561
|
+
)
|
|
12562
|
+
);
|
|
12563
|
+
const replacedObjects = new Set(
|
|
12564
|
+
product.objects.filter((object3) => sourceModules.has(swiftTargetModuleName(object3.target))).map((object3) => object3.path)
|
|
12565
|
+
);
|
|
12566
|
+
const available = distribution.objects.filter(
|
|
12567
|
+
(object3) => !isProvider(object3) && !replacedObjects.has(object3)
|
|
12568
|
+
);
|
|
12521
12569
|
const objects = available.filter(
|
|
12522
12570
|
(object3) => !targets.some((target) => object3.startsWith(`lib/${target.name}-`)) && [...OPTIONAL_FRAMEWORKS, "SpriteKit", "PeachBox2D"].every(
|
|
12523
12571
|
(name2) => !object3.startsWith(`lib/${name2}-`) || reachedFrameworks.has(name2)
|
|
@@ -12832,14 +12880,6 @@ function syncSwiftTree(base, files) {
|
|
|
12832
12880
|
var DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
|
|
12833
12881
|
var OS_IOS = /\b(?:os\(\s*iOS\s*\)|targetEnvironment\(\s*simulator\s*\))/g;
|
|
12834
12882
|
var DELEGATE_CLASS = /^class\s+[A-Za-z_]\w*\s*(?:<[^>{]*>)?\s*:[^{]*\b(?:UIApplicationDelegate|UISceneDelegate|UIWindowSceneDelegate)\b[^{]*\{/;
|
|
12835
|
-
var REUSABLE_INIT = /^override(?=\s+(?:(?:public|open|internal)\s+)?init\s*\(\s*(?:style\s*:[^,)]*,\s*reuseIdentifier|reuseIdentifier)\s*:)/;
|
|
12836
|
-
var REUSABLE_VIEW_BASES = [
|
|
12837
|
-
"UICollectionReusableView",
|
|
12838
|
-
"UICollectionViewCell",
|
|
12839
|
-
"UICollectionViewListCell"
|
|
12840
|
-
];
|
|
12841
|
-
var CLASS_BASE = /^class\s+([A-Za-z_]\w*)\s*(?:<[^>{]*>)?\s*:\s*([A-Za-z_][\w.]*)[^{]*\{/;
|
|
12842
|
-
var FRAME_INIT = /^override(?=\s+(?:(?:public|open|internal)\s+)?init\s*\(\s*frame\s*:)/;
|
|
12843
12883
|
function compiledSwiftSources(files, targets, overlayFrameworks) {
|
|
12844
12884
|
const ordered = [...targets].sort((a, b) => b.path.length - a.path.length);
|
|
12845
12885
|
return new Map(
|
|
@@ -13619,7 +13659,7 @@ var CORE_FOUNDATION_HANDLE_IMPORTS = [
|
|
|
13619
13659
|
"import CoreGraphics"
|
|
13620
13660
|
]).join("; ");
|
|
13621
13661
|
function foundationOwnerOf(name2) {
|
|
13622
|
-
if (name2 === "
|
|
13662
|
+
if (name2 === "NSKeyValueObservedChange" || name2 === "NSKeyValueObservation")
|
|
13623
13663
|
return "PeachObjC";
|
|
13624
13664
|
if (name2 === "DispatchData") return "Dispatch";
|
|
13625
13665
|
if (FOUNDATION_NETWORKING_TYPES.has(name2)) return "FoundationNetworking";
|
|
@@ -13639,10 +13679,6 @@ function swiftSourceAsIOS(source, overlayFrameworks, swiftPackage) {
|
|
|
13639
13679
|
}).join("\n");
|
|
13640
13680
|
let out = "";
|
|
13641
13681
|
let copied = 0;
|
|
13642
|
-
const reusableViews = new Set(REUSABLE_VIEW_BASES);
|
|
13643
|
-
const reusableBodies = [];
|
|
13644
|
-
let depth = 0;
|
|
13645
|
-
let opensReusableBody = false;
|
|
13646
13682
|
const sceneLifecycleBodies = /* @__PURE__ */ new Set();
|
|
13647
13683
|
for (const at of tokens) {
|
|
13648
13684
|
const rest = conditioned.slice(at, at + 400);
|
|
@@ -13651,21 +13687,6 @@ function swiftSourceAsIOS(source, overlayFrameworks, swiftPackage) {
|
|
|
13651
13687
|
out += conditioned.slice(copied, at + 1) + " public var _peachUsesSceneLifecycle: Bool { true };";
|
|
13652
13688
|
copied = at + 1;
|
|
13653
13689
|
}
|
|
13654
|
-
depth++;
|
|
13655
|
-
if (opensReusableBody) reusableBodies.push(depth);
|
|
13656
|
-
opensReusableBody = false;
|
|
13657
|
-
continue;
|
|
13658
|
-
}
|
|
13659
|
-
if (rest.startsWith("}")) {
|
|
13660
|
-
if (reusableBodies.at(-1) === depth) reusableBodies.pop();
|
|
13661
|
-
depth--;
|
|
13662
|
-
continue;
|
|
13663
|
-
}
|
|
13664
|
-
if (rest.startsWith("override")) {
|
|
13665
|
-
if (REUSABLE_INIT.test(rest) || reusableBodies.at(-1) === depth && FRAME_INIT.test(rest)) {
|
|
13666
|
-
out += `${conditioned.slice(copied, at)}required`;
|
|
13667
|
-
copied = at + "override".length;
|
|
13668
|
-
}
|
|
13669
13690
|
continue;
|
|
13670
13691
|
}
|
|
13671
13692
|
const imported = conditioned[at - 1] === "." ? null : /^import[ \t]+([A-Za-z_]\w*)(?:[ \t]*\.[ \t]*[A-Za-z_]\w*)+/.exec(rest);
|
|
@@ -13710,11 +13731,6 @@ function swiftSourceAsIOS(source, overlayFrameworks, swiftPackage) {
|
|
|
13710
13731
|
continue;
|
|
13711
13732
|
}
|
|
13712
13733
|
if (rest.startsWith("class")) {
|
|
13713
|
-
const declared = CLASS_BASE.exec(rest);
|
|
13714
|
-
if (declared && reusableViews.has(declared[2].split(".").pop())) {
|
|
13715
|
-
reusableViews.add(declared[1]);
|
|
13716
|
-
opensReusableBody = true;
|
|
13717
|
-
}
|
|
13718
13734
|
const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
|
|
13719
13735
|
const delegateClass = DELEGATE_CLASS.exec(rest);
|
|
13720
13736
|
if (delegateClass && /\bUIApplicationDelegate\b/.test(delegateClass[0])) {
|
|
@@ -14254,7 +14270,7 @@ function swiftCodeScan(source) {
|
|
|
14254
14270
|
else top.parens--;
|
|
14255
14271
|
i++;
|
|
14256
14272
|
} else {
|
|
14257
|
-
const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("func", i) ? "func" : source.startsWith("UIApplicationMain", i) ? "UIApplicationMain" : source.startsWith("
|
|
14273
|
+
const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("func", i) ? "func" : source.startsWith("UIApplicationMain", i) ? "UIApplicationMain" : source.startsWith("Foundation", i) ? "Foundation" : source.startsWith("CoreFoundation", i) ? "CoreFoundation" : source.startsWith("ObjectiveC", i) ? "ObjectiveC" : source.startsWith("_LocationEssentials", i) ? "_LocationEssentials" : null;
|
|
14258
14274
|
if (keyword && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + keyword.length] ?? "")) {
|
|
14259
14275
|
tokens.push(i);
|
|
14260
14276
|
i += keyword.length;
|
|
@@ -15211,6 +15227,7 @@ module ${moduleName}.Swift {
|
|
|
15211
15227
|
return projectOverlayFrameworks;
|
|
15212
15228
|
}
|
|
15213
15229
|
);
|
|
15230
|
+
const libraryEntryFiles = /* @__PURE__ */ new Map();
|
|
15214
15231
|
for (const target of [...targets]) {
|
|
15215
15232
|
if (!target.executable || ![...native.values()].some((value) => value.late?.producers.includes(target.name)))
|
|
15216
15233
|
continue;
|
|
@@ -15266,7 +15283,18 @@ module ${moduleName}.Swift {
|
|
|
15266
15283
|
`mixed executable ${target.name} requires one typed Swift application entry`
|
|
15267
15284
|
);
|
|
15268
15285
|
}
|
|
15269
|
-
if (!nativeEntry)
|
|
15286
|
+
if (!nativeEntry) {
|
|
15287
|
+
compiled.set(entryFile, entrySource);
|
|
15288
|
+
if (import_node_path27.default.basename(entryFile) === "main.swift") {
|
|
15289
|
+
const libraryEntry = import_node_path27.default.posix.join(
|
|
15290
|
+
import_node_path27.default.posix.dirname(entryFile),
|
|
15291
|
+
"PeachApplicationEntry.generated.swift"
|
|
15292
|
+
);
|
|
15293
|
+
if (Object.hasOwn(input.files, libraryEntry))
|
|
15294
|
+
throw new Error(`mixed application entry conflicts with ${libraryEntry}`);
|
|
15295
|
+
libraryEntryFiles.set(entryFile, libraryEntry);
|
|
15296
|
+
}
|
|
15297
|
+
}
|
|
15270
15298
|
const name2 = `${target.name}Executable`;
|
|
15271
15299
|
if (targets.some((candidate) => candidate.name === name2))
|
|
15272
15300
|
throw new Error(`mixed application executable target conflicts with ${name2}`);
|
|
@@ -15414,7 +15442,7 @@ module ${moduleName}.Swift {
|
|
|
15414
15442
|
}
|
|
15415
15443
|
for (const [file, contents] of Object.entries(input.files)) {
|
|
15416
15444
|
if (file === "Package.swift") continue;
|
|
15417
|
-
const destination = import_node_path27.default.join(base, file);
|
|
15445
|
+
const destination = import_node_path27.default.join(base, libraryEntryFiles.get(file) ?? file);
|
|
15418
15446
|
const interfaceModule = /(?:^|\/)(\w+)-Swift\.h$/.exec(file)?.[1];
|
|
15419
15447
|
const localInterface = interfaceModule && swiftTargets.has(interfaceModule) ? `#include ${JSON.stringify(
|
|
15420
15448
|
import_node_path27.default.relative(
|
|
@@ -15473,9 +15501,16 @@ module ${moduleName}.Swift {
|
|
|
15473
15501
|
emitSwiftPackageManifest({
|
|
15474
15502
|
root: layout2.root,
|
|
15475
15503
|
files,
|
|
15476
|
-
targets: manifestTargets
|
|
15504
|
+
targets: manifestTargets.map((target) => ({
|
|
15505
|
+
...target,
|
|
15506
|
+
sources: target.sources?.map((source) => {
|
|
15507
|
+
const entry = libraryEntryFiles.get(import_node_path27.default.posix.join(target.path, source));
|
|
15508
|
+
return entry ? import_node_path27.default.posix.relative(target.path, entry) : source;
|
|
15509
|
+
})
|
|
15510
|
+
})),
|
|
15477
15511
|
packages,
|
|
15478
15512
|
native,
|
|
15513
|
+
sourceSwiftTargets: swiftTargets,
|
|
15479
15514
|
nativeFlags,
|
|
15480
15515
|
nativeImportFlags,
|
|
15481
15516
|
nativeHeaderFlags,
|
|
@@ -16051,7 +16086,7 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
16051
16086
|
"--build-system",
|
|
16052
16087
|
"native",
|
|
16053
16088
|
"-j",
|
|
16054
|
-
|
|
16089
|
+
String(swiftBuildJobs()),
|
|
16055
16090
|
"--package-path",
|
|
16056
16091
|
linkRoot,
|
|
16057
16092
|
"--scratch-path",
|
|
@@ -16069,7 +16104,7 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
16069
16104
|
"-Xswiftc",
|
|
16070
16105
|
"-num-threads",
|
|
16071
16106
|
"-Xswiftc",
|
|
16072
|
-
|
|
16107
|
+
String(swiftBuildJobs()),
|
|
16073
16108
|
...swiftReproducibleBuildFlags([
|
|
16074
16109
|
[import_node_path27.default.dirname(args.toolchainBin), "toolchain"],
|
|
16075
16110
|
[args.moduleRoot, "framework"],
|
|
@@ -16548,7 +16583,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
16548
16583
|
"--build-system",
|
|
16549
16584
|
"native",
|
|
16550
16585
|
"-j",
|
|
16551
|
-
|
|
16586
|
+
String(swiftBuildJobs()),
|
|
16552
16587
|
"--package-path",
|
|
16553
16588
|
root,
|
|
16554
16589
|
...swiftCompileSdkOptions(frameworkRoot, options.toolchainBin),
|
|
@@ -16561,7 +16596,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
16561
16596
|
"-Xswiftc",
|
|
16562
16597
|
"-num-threads",
|
|
16563
16598
|
"-Xswiftc",
|
|
16564
|
-
|
|
16599
|
+
String(swiftBuildJobs()),
|
|
16565
16600
|
...swiftReproducibleBuildFlags([
|
|
16566
16601
|
[import_node_path27.default.dirname(options.toolchainBin), "toolchain"],
|
|
16567
16602
|
[frameworkRoot, "framework"],
|
|
@@ -16753,7 +16788,6 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
16753
16788
|
0 && (module.exports = {
|
|
16754
16789
|
FOUNDATION_IMPLICIT_MODULES,
|
|
16755
16790
|
MULTI_MANIFEST_VERSION,
|
|
16756
|
-
SWIFT_BUILD_JOBS,
|
|
16757
16791
|
WASM_TRIPLE,
|
|
16758
16792
|
brotliCompressQ11,
|
|
16759
16793
|
brotliCompressQ4,
|
|
@@ -16774,6 +16808,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
16774
16808
|
swiftApplicationEntry,
|
|
16775
16809
|
swiftArtifactHash,
|
|
16776
16810
|
swiftAvailableModules,
|
|
16811
|
+
swiftBuildJobs,
|
|
16777
16812
|
swiftBuilderHopTimeoutMs,
|
|
16778
16813
|
swiftCDefinedNames,
|
|
16779
16814
|
swiftCMainEntry,
|