peachsim 0.1.2179 → 0.1.2182
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/package.ts +7 -2
- package/cli/commands/shell-url.ts +28 -22
- 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 +225 -85
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +140 -48
- 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 +201 -82
- package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +4 -4
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +11 -3
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +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 +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +239 -176
- package/dist-lib/swift-compile.cjs +85 -16
- package/dist-lib/swift-compile.mjs +85 -16
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +87 -18
- package/dist-lib/vite.cjs +4 -4
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/cli-companion.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/ios/frame-art.d.ts +41 -0
- package/dist-types/packages/peach-engine/src/ios/frame-paint.d.ts +43 -0
- package/dist-types/packages/peach-engine/src/ios/frame-svg.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +14 -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/UIKit.framework/Headers/UIScrollView.h +8 -25
- package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +26 -0
- package/src/expo-native-workspace.ts +17 -20
- package/src/expo-swift-bundle.ts +6 -1
- package/src/expo-swift-host.ts +35 -6
- package/src/expo-widgets-bundle.ts +12 -8
- package/src/expoSwiftContract.ts +3 -0
- package/src/kotlin-host.ts +10 -2
- package/src/native-bundles.ts +30 -10
- package/src/one-sdk/source.ts +10 -4
- package/src/one-sdk-bundle.ts +57 -24
- package/src/screenshots/frame-compose.ts +14 -109
- package/src/swift-compile.ts +105 -13
- package/src/swift-submit.ts +2 -1
- package/src/wasm-optimize.ts +13 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2182 | (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;
|
|
@@ -10246,6 +10246,13 @@ var BINARYEN_RELEASES = /* @__PURE__ */ new Map([
|
|
|
10246
10246
|
]
|
|
10247
10247
|
]);
|
|
10248
10248
|
async function runWasmOpt(file, output, skipPasses, binary) {
|
|
10249
|
+
const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
|
|
10250
|
+
const requestedCores = Number(process.env.BINARYEN_CORES);
|
|
10251
|
+
const environment = { ...process.env, WASM_OPT_PATH: binary };
|
|
10252
|
+
if (Number.isInteger(admittedCores) && admittedCores > 0)
|
|
10253
|
+
environment.BINARYEN_CORES = String(
|
|
10254
|
+
Number.isInteger(requestedCores) && requestedCores > 0 ? Math.min(admittedCores, requestedCores) : admittedCores
|
|
10255
|
+
);
|
|
10249
10256
|
const result = await (0, import_wasm_opt.wasmOpt)(
|
|
10250
10257
|
[
|
|
10251
10258
|
"-Oz",
|
|
@@ -10255,7 +10262,7 @@ async function runWasmOpt(file, output, skipPasses, binary) {
|
|
|
10255
10262
|
"-o",
|
|
10256
10263
|
output
|
|
10257
10264
|
],
|
|
10258
|
-
{ env:
|
|
10265
|
+
{ env: environment }
|
|
10259
10266
|
);
|
|
10260
10267
|
if (result.status !== 0)
|
|
10261
10268
|
throw new Error(`wasm-opt exited ${result.status}: ${result.stderr}`);
|
|
@@ -12467,7 +12474,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
|
|
|
12467
12474
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
12468
12475
|
var MULTI_MANIFEST_VERSION = 68;
|
|
12469
12476
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
12470
|
-
var compilerSourceDigest = true ? "
|
|
12477
|
+
var compilerSourceDigest = true ? "73960368f0b83cf042511655d857d5f64204fa539e2c984423a12c08657b068e" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
12471
12478
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
12472
12479
|
const hash = (0, import_node_crypto13.createHash)("sha256");
|
|
12473
12480
|
hash.update(`swift-compile
|
|
@@ -12593,6 +12600,20 @@ function emitSwiftPackageManifest(args) {
|
|
|
12593
12600
|
const prebuilt = args.prebuilt;
|
|
12594
12601
|
const linkedObjects = Boolean(distribution || prebuilt);
|
|
12595
12602
|
const cxxFlagsFor = (flags) => args.deferDarwinOverlay ? withoutWasmOverlayIsystem(flags) : flags;
|
|
12603
|
+
const packageModules = new Set(
|
|
12604
|
+
targets.filter(({ name: name2 }) => !args.sourceSwiftTargets?.has(name2)).map(({ name: name2 }) => swiftTargetModuleName(name2))
|
|
12605
|
+
);
|
|
12606
|
+
const mapsPackageModule = (flag) => {
|
|
12607
|
+
if (!flag.startsWith("-fmodule-map-file=")) return false;
|
|
12608
|
+
const file = flag.slice("-fmodule-map-file=".length).replaceAll(SWIFT_NATIVE_INPUT_ROOT, args.root);
|
|
12609
|
+
if (!file.includes("/Pods/Headers/")) return false;
|
|
12610
|
+
const map = args.files.get(file) ?? ((0, import_node_fs25.existsSync)(file) ? (0, import_node_fs25.readFileSync)(file) : void 0);
|
|
12611
|
+
const name2 = map === void 0 ? void 0 : moduleMapName(map.toString());
|
|
12612
|
+
return name2 !== void 0 && packageModules.has(name2);
|
|
12613
|
+
};
|
|
12614
|
+
const withoutPackageModuleMaps = (flags) => flags.filter((flag) => !mapsPackageModule(flag));
|
|
12615
|
+
const targetCFlags = (flags) => cFlagArray(withoutPackageModuleMaps(flags));
|
|
12616
|
+
const targetCxxFlags = (flags) => cxxFlagArray(withoutPackageModuleMaps(flags));
|
|
12596
12617
|
const reachedFrameworks = /* @__PURE__ */ new Set();
|
|
12597
12618
|
const reach = (name2) => {
|
|
12598
12619
|
if (reachedFrameworks.has(name2) || targets.some((target) => swiftTargetModuleName(target.name) === name2))
|
|
@@ -12672,7 +12693,9 @@ function emitSwiftPackageManifest(args) {
|
|
|
12672
12693
|
const macroSettings = (values) => (values ?? []).map((value) => ` ${clangMacroSetting(value)},`).join("");
|
|
12673
12694
|
const flagArray = (literal2) => `peachCompilerArguments(${JSON.stringify(literal2.replace(/,\s*]$/, "]"))})`;
|
|
12674
12695
|
const swiftFlagArray = (literal2) => {
|
|
12675
|
-
const flags = JSON.parse(literal2.replace(/,\s*]$/, "]"))
|
|
12696
|
+
const flags = JSON.parse(literal2.replace(/,\s*]$/, "]")).filter(
|
|
12697
|
+
(flag, index, all) => !mapsPackageModule(flag) && !(flag === "-Xcc" && mapsPackageModule(all[index + 1] ?? ""))
|
|
12698
|
+
);
|
|
12676
12699
|
const content = flags.map((flag) => JSON.stringify(flag)).join("\n") + "\n";
|
|
12677
12700
|
const digest = (0, import_node_crypto13.createHash)("sha256").update(content).digest("hex");
|
|
12678
12701
|
const file = import_node_path27.default.join(args.root, ".peach-swift-arguments", `${digest}.rsp`);
|
|
@@ -12832,18 +12855,18 @@ function emitSwiftPackageManifest(args) {
|
|
|
12832
12855
|
"c"
|
|
12833
12856
|
).map((entry) => ` ${entry},`).join(
|
|
12834
12857
|
""
|
|
12835
|
-
)} .unsafeFlags(${flagArray(
|
|
12858
|
+
)} .unsafeFlags(${flagArray(targetCFlags([...nativeFlags, ...native.clang.flags]))})]`,
|
|
12836
12859
|
...nativeCxx ? [
|
|
12837
12860
|
`cxxSettings: [${cxxDefines}${clangSettingEntries(
|
|
12838
12861
|
frameworkSearchFlags(target, "cxx"),
|
|
12839
12862
|
"cxx"
|
|
12840
12863
|
).map((entry) => ` ${entry},`).join(
|
|
12841
12864
|
""
|
|
12842
|
-
)} .unsafeFlags(${flagArray(
|
|
12865
|
+
)} .unsafeFlags(${flagArray(targetCxxFlags([...cxxFlagsFor(nativeFlags), ...native.clang.cxxFlags]))})]`
|
|
12843
12866
|
] : []
|
|
12844
12867
|
].join(", ") : [
|
|
12845
|
-
`cSettings: [${cDefines}${declaredClangSettings(target, "c")} .unsafeFlags(${flagArray(
|
|
12846
|
-
`cxxSettings: [${cxxDefines}${declaredClangSettings(target, "cxx")} .unsafeFlags(${flagArray(
|
|
12868
|
+
`cSettings: [${cDefines}${declaredClangSettings(target, "c")} .unsafeFlags(${flagArray(targetCFlags([...nativeFlags, ...native?.flags ?? []]))})]`,
|
|
12869
|
+
`cxxSettings: [${cxxDefines}${declaredClangSettings(target, "cxx")} .unsafeFlags(${flagArray(targetCxxFlags([...cxxFlagsFor(nativeFlags), ...native?.cxxFlags ?? []]))})]`
|
|
12847
12870
|
].join(", ");
|
|
12848
12871
|
const exclusions = native?.clang ? [] : [
|
|
12849
12872
|
...native ? native.exclude ?? native.lateSources : [],
|
|
@@ -12912,9 +12935,9 @@ function emitSwiftPackageManifest(args) {
|
|
|
12912
12935
|
` path: ${JSON.stringify(group.path)},`,
|
|
12913
12936
|
` sources: ${JSON.stringify(group.sources)},`,
|
|
12914
12937
|
` publicHeadersPath: ${JSON.stringify(native.groups ? "include" : "PeachSwiftImplementation")},`,
|
|
12915
|
-
` cSettings: [${macroSettings(owner?.cDefines)}${declaredClangSettings(owner, "c")} .unsafeFlags(${flagArray(
|
|
12938
|
+
` cSettings: [${macroSettings(owner?.cDefines)}${declaredClangSettings(owner, "c")} .unsafeFlags(${flagArray(targetCFlags([...nativeFlags, "-I", native.includeDirectory, ...args.headerDirectory ? ["-I", args.headerDirectory] : [], ...group.flags]))})],`,
|
|
12916
12939
|
...group.sources.some((source) => /\.(?:cc|cpp|cxx|mm)$/.test(source)) ? [
|
|
12917
|
-
` cxxSettings: [${macroSettings(owner?.cxxDefines)}${declaredClangSettings(owner, "cxx")} .unsafeFlags(${flagArray(
|
|
12940
|
+
` cxxSettings: [${macroSettings(owner?.cxxDefines)}${declaredClangSettings(owner, "cxx")} .unsafeFlags(${flagArray(targetCxxFlags([...cxxFlagsFor(nativeFlags), "-I", native.includeDirectory, ...group.cxxFlags]))})]),`
|
|
12918
12941
|
] : [" ),"]
|
|
12919
12942
|
]) : [];
|
|
12920
12943
|
}),
|
|
@@ -14511,7 +14534,10 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
14511
14534
|
const target = bySourcePath.find(
|
|
14512
14535
|
(candidate) => candidate.path === "." || file.startsWith(`${candidate.path}/`)
|
|
14513
14536
|
);
|
|
14514
|
-
|
|
14537
|
+
const excluded = target?.exclude?.some(
|
|
14538
|
+
(name2) => file === import_node_path27.default.posix.join(target.path, name2)
|
|
14539
|
+
);
|
|
14540
|
+
if (target && !excluded) swiftTargets.add(target.name);
|
|
14515
14541
|
}
|
|
14516
14542
|
const importedModules = /* @__PURE__ */ new Set();
|
|
14517
14543
|
const swiftImportedModules = /* @__PURE__ */ new Set();
|
|
@@ -15557,6 +15583,9 @@ module ${moduleName}.Swift {
|
|
|
15557
15583
|
frameworkLink,
|
|
15558
15584
|
[
|
|
15559
15585
|
...prebuilt.objects.map(quote),
|
|
15586
|
+
"-Wl,--start-lib",
|
|
15587
|
+
...prebuilt.lazyObjects.map(quote),
|
|
15588
|
+
"-Wl,--end-lib",
|
|
15560
15589
|
...darwinRecordsRegion(prebuilt.providers.map(quote))
|
|
15561
15590
|
].join("\n") + "\n"
|
|
15562
15591
|
);
|
|
@@ -15842,7 +15871,7 @@ function readCompiledArtifact(directory, hash) {
|
|
|
15842
15871
|
return null;
|
|
15843
15872
|
const bytes = (0, import_node_fs25.readFileSync)(import_node_path27.default.join(directory, "app.wasm"));
|
|
15844
15873
|
const gzip2 = (0, import_node_fs25.readFileSync)(import_node_path27.default.join(directory, "icu.gz"));
|
|
15845
|
-
if ((0, import_node_crypto13.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto13.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length
|
|
15874
|
+
if ((0, import_node_crypto13.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto13.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length <= 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
|
|
15846
15875
|
return null;
|
|
15847
15876
|
return { hash, bytes, icu: { sha256: receipt.icu, gzip: gzip2 } };
|
|
15848
15877
|
} catch (error) {
|
|
@@ -15963,7 +15992,13 @@ function linkedFrameworkTargets(moduleRoot, input) {
|
|
|
15963
15992
|
);
|
|
15964
15993
|
const targets = compileTargets(input);
|
|
15965
15994
|
const planning = targets.length > 0 ? targets : [{ name: "App", path: "." }];
|
|
15966
|
-
const siblings = swiftTargetDependencies(
|
|
15995
|
+
const siblings = swiftTargetDependencies(
|
|
15996
|
+
input.files,
|
|
15997
|
+
planning.map(
|
|
15998
|
+
(target) => input.libraries?.[target.name] ? { ...target, exclude: [] } : target
|
|
15999
|
+
),
|
|
16000
|
+
libraries.keys()
|
|
16001
|
+
);
|
|
15967
16002
|
const reached = /* @__PURE__ */ new Set();
|
|
15968
16003
|
const reach = (name2) => {
|
|
15969
16004
|
if (name2 === "SwiftUI") return;
|
|
@@ -16265,9 +16300,31 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
16265
16300
|
}
|
|
16266
16301
|
const providers = (0, import_node_fs25.readdirSync)(providerDir).filter((file) => file.endsWith(".o")).sort().map((file) => import_node_path27.default.join(providerDir, file));
|
|
16267
16302
|
for (const provider of providers) linked.owners.set(provider, "DarwinRecords");
|
|
16303
|
+
const archive = import_node_path27.default.join(scratch2, "lib");
|
|
16304
|
+
(0, import_node_fs25.rmSync)(archive, { recursive: true, force: true });
|
|
16305
|
+
(0, import_node_fs25.mkdirSync)(archive);
|
|
16306
|
+
const archived = /* @__PURE__ */ new Map();
|
|
16307
|
+
for (const object3 of objects) {
|
|
16308
|
+
const target = linked.owners.get(object3);
|
|
16309
|
+
const dir = import_node_path27.default.join(release, `${target}.build`);
|
|
16310
|
+
if (!target || target === "Darwin" || !object3.startsWith(dir + import_node_path27.default.sep)) continue;
|
|
16311
|
+
const name2 = `${target}-${import_node_path27.default.relative(dir, object3).replaceAll(import_node_path27.default.sep, "-").replace(/\.swift\.o$/, ".o")}`;
|
|
16312
|
+
(0, import_node_fs25.symlinkSync)(object3, import_node_path27.default.join(archive, name2));
|
|
16313
|
+
archived.set(object3, `lib/${name2}`);
|
|
16314
|
+
}
|
|
16315
|
+
const roots = swiftObjcRootObjects(`${scratch2}
|
|
16316
|
+
${args.frameworkKey}`, scratch2, [
|
|
16317
|
+
...archived.values()
|
|
16318
|
+
]);
|
|
16319
|
+
const linkedObjects = objects.map((object3) => {
|
|
16320
|
+
const name2 = archived.get(object3);
|
|
16321
|
+
return name2 ? { path: import_node_path27.default.join(scratch2, name2), lazy: !roots.has(name2) } : { path: object3, lazy: false };
|
|
16322
|
+
});
|
|
16268
16323
|
return {
|
|
16324
|
+
root: scratch2,
|
|
16269
16325
|
modules: import_node_path27.default.join(release, "Modules"),
|
|
16270
|
-
objects,
|
|
16326
|
+
objects: linkedObjects.filter((object3) => !object3.lazy).map((object3) => object3.path),
|
|
16327
|
+
lazyObjects: linkedObjects.filter((object3) => object3.lazy).map((object3) => object3.path),
|
|
16271
16328
|
owners: linked.owners,
|
|
16272
16329
|
providers,
|
|
16273
16330
|
link,
|
|
@@ -16421,6 +16478,10 @@ ${args.frameworkKey}
|
|
|
16421
16478
|
for (const object3 of args.prebuilt.objects)
|
|
16422
16479
|
hash.update(`object
|
|
16423
16480
|
${object3}
|
|
16481
|
+
${statOf(object3)}`);
|
|
16482
|
+
for (const object3 of args.prebuilt.lazyObjects)
|
|
16483
|
+
hash.update(`lazy-object
|
|
16484
|
+
${object3}
|
|
16424
16485
|
${statOf(object3)}`);
|
|
16425
16486
|
for (const object3 of args.prebuilt.providers)
|
|
16426
16487
|
hash.update(`provider
|
|
@@ -16837,7 +16898,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
16837
16898
|
pruneSwiftWasmLink(
|
|
16838
16899
|
root,
|
|
16839
16900
|
options.toolchainBin,
|
|
16840
|
-
frameworkRoot,
|
|
16901
|
+
prebuilt?.root ?? frameworkRoot,
|
|
16841
16902
|
input.staticClangTargets,
|
|
16842
16903
|
options.project,
|
|
16843
16904
|
void 0,
|
|
@@ -16861,11 +16922,19 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
16861
16922
|
optimized
|
|
16862
16923
|
});
|
|
16863
16924
|
else if (input.optimize) await optimizeWasm(output, optimized);
|
|
16925
|
+
const executable = input.optimize ? optimized : output;
|
|
16926
|
+
await runCompiler(
|
|
16927
|
+
import_node_path27.default.join(options.toolchainBin, "llvm-objcopy"),
|
|
16928
|
+
["--remove-section=.swift1_autolink_entries", executable],
|
|
16929
|
+
buildOptions
|
|
16930
|
+
);
|
|
16864
16931
|
const artifact = {
|
|
16865
16932
|
hash,
|
|
16866
|
-
bytes: (0, import_node_fs25.readFileSync)(
|
|
16933
|
+
bytes: (0, import_node_fs25.readFileSync)(executable),
|
|
16867
16934
|
icu: await icu
|
|
16868
16935
|
};
|
|
16936
|
+
if (artifact.bytes.length <= 8)
|
|
16937
|
+
throw new Error("swift-compile: deferred linker produced no executable");
|
|
16869
16938
|
if (!options.project) saveCompiledArtifact(root, artifact);
|
|
16870
16939
|
saveSharedArtifact(sharedRoot, artifact);
|
|
16871
16940
|
report("compiled artifact verified");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2182 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/swift-compile.ts
|
|
4
4
|
import {
|
|
@@ -10202,6 +10202,13 @@ var BINARYEN_RELEASES = /* @__PURE__ */ new Map([
|
|
|
10202
10202
|
]
|
|
10203
10203
|
]);
|
|
10204
10204
|
async function runWasmOpt(file, output, skipPasses, binary) {
|
|
10205
|
+
const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
|
|
10206
|
+
const requestedCores = Number(process.env.BINARYEN_CORES);
|
|
10207
|
+
const environment = { ...process.env, WASM_OPT_PATH: binary };
|
|
10208
|
+
if (Number.isInteger(admittedCores) && admittedCores > 0)
|
|
10209
|
+
environment.BINARYEN_CORES = String(
|
|
10210
|
+
Number.isInteger(requestedCores) && requestedCores > 0 ? Math.min(admittedCores, requestedCores) : admittedCores
|
|
10211
|
+
);
|
|
10205
10212
|
const result = await wasmOpt(
|
|
10206
10213
|
[
|
|
10207
10214
|
"-Oz",
|
|
@@ -10211,7 +10218,7 @@ async function runWasmOpt(file, output, skipPasses, binary) {
|
|
|
10211
10218
|
"-o",
|
|
10212
10219
|
output
|
|
10213
10220
|
],
|
|
10214
|
-
{ env:
|
|
10221
|
+
{ env: environment }
|
|
10215
10222
|
);
|
|
10216
10223
|
if (result.status !== 0)
|
|
10217
10224
|
throw new Error(`wasm-opt exited ${result.status}: ${result.stderr}`);
|
|
@@ -12447,7 +12454,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
|
|
|
12447
12454
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
12448
12455
|
var MULTI_MANIFEST_VERSION = 68;
|
|
12449
12456
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
12450
|
-
var compilerSourceDigest = true ? "
|
|
12457
|
+
var compilerSourceDigest = true ? "73960368f0b83cf042511655d857d5f64204fa539e2c984423a12c08657b068e" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
12451
12458
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
12452
12459
|
const hash = createHash13("sha256");
|
|
12453
12460
|
hash.update(`swift-compile
|
|
@@ -12573,6 +12580,20 @@ function emitSwiftPackageManifest(args) {
|
|
|
12573
12580
|
const prebuilt = args.prebuilt;
|
|
12574
12581
|
const linkedObjects = Boolean(distribution || prebuilt);
|
|
12575
12582
|
const cxxFlagsFor = (flags) => args.deferDarwinOverlay ? withoutWasmOverlayIsystem(flags) : flags;
|
|
12583
|
+
const packageModules = new Set(
|
|
12584
|
+
targets.filter(({ name: name2 }) => !args.sourceSwiftTargets?.has(name2)).map(({ name: name2 }) => swiftTargetModuleName(name2))
|
|
12585
|
+
);
|
|
12586
|
+
const mapsPackageModule = (flag) => {
|
|
12587
|
+
if (!flag.startsWith("-fmodule-map-file=")) return false;
|
|
12588
|
+
const file = flag.slice("-fmodule-map-file=".length).replaceAll(SWIFT_NATIVE_INPUT_ROOT, args.root);
|
|
12589
|
+
if (!file.includes("/Pods/Headers/")) return false;
|
|
12590
|
+
const map = args.files.get(file) ?? (existsSync5(file) ? readFileSync16(file) : void 0);
|
|
12591
|
+
const name2 = map === void 0 ? void 0 : moduleMapName(map.toString());
|
|
12592
|
+
return name2 !== void 0 && packageModules.has(name2);
|
|
12593
|
+
};
|
|
12594
|
+
const withoutPackageModuleMaps = (flags) => flags.filter((flag) => !mapsPackageModule(flag));
|
|
12595
|
+
const targetCFlags = (flags) => cFlagArray(withoutPackageModuleMaps(flags));
|
|
12596
|
+
const targetCxxFlags = (flags) => cxxFlagArray(withoutPackageModuleMaps(flags));
|
|
12576
12597
|
const reachedFrameworks = /* @__PURE__ */ new Set();
|
|
12577
12598
|
const reach = (name2) => {
|
|
12578
12599
|
if (reachedFrameworks.has(name2) || targets.some((target) => swiftTargetModuleName(target.name) === name2))
|
|
@@ -12652,7 +12673,9 @@ function emitSwiftPackageManifest(args) {
|
|
|
12652
12673
|
const macroSettings = (values) => (values ?? []).map((value) => ` ${clangMacroSetting(value)},`).join("");
|
|
12653
12674
|
const flagArray = (literal2) => `peachCompilerArguments(${JSON.stringify(literal2.replace(/,\s*]$/, "]"))})`;
|
|
12654
12675
|
const swiftFlagArray = (literal2) => {
|
|
12655
|
-
const flags = JSON.parse(literal2.replace(/,\s*]$/, "]"))
|
|
12676
|
+
const flags = JSON.parse(literal2.replace(/,\s*]$/, "]")).filter(
|
|
12677
|
+
(flag, index, all) => !mapsPackageModule(flag) && !(flag === "-Xcc" && mapsPackageModule(all[index + 1] ?? ""))
|
|
12678
|
+
);
|
|
12656
12679
|
const content = flags.map((flag) => JSON.stringify(flag)).join("\n") + "\n";
|
|
12657
12680
|
const digest = createHash13("sha256").update(content).digest("hex");
|
|
12658
12681
|
const file = path27.join(args.root, ".peach-swift-arguments", `${digest}.rsp`);
|
|
@@ -12812,18 +12835,18 @@ function emitSwiftPackageManifest(args) {
|
|
|
12812
12835
|
"c"
|
|
12813
12836
|
).map((entry) => ` ${entry},`).join(
|
|
12814
12837
|
""
|
|
12815
|
-
)} .unsafeFlags(${flagArray(
|
|
12838
|
+
)} .unsafeFlags(${flagArray(targetCFlags([...nativeFlags, ...native.clang.flags]))})]`,
|
|
12816
12839
|
...nativeCxx ? [
|
|
12817
12840
|
`cxxSettings: [${cxxDefines}${clangSettingEntries(
|
|
12818
12841
|
frameworkSearchFlags(target, "cxx"),
|
|
12819
12842
|
"cxx"
|
|
12820
12843
|
).map((entry) => ` ${entry},`).join(
|
|
12821
12844
|
""
|
|
12822
|
-
)} .unsafeFlags(${flagArray(
|
|
12845
|
+
)} .unsafeFlags(${flagArray(targetCxxFlags([...cxxFlagsFor(nativeFlags), ...native.clang.cxxFlags]))})]`
|
|
12823
12846
|
] : []
|
|
12824
12847
|
].join(", ") : [
|
|
12825
|
-
`cSettings: [${cDefines}${declaredClangSettings(target, "c")} .unsafeFlags(${flagArray(
|
|
12826
|
-
`cxxSettings: [${cxxDefines}${declaredClangSettings(target, "cxx")} .unsafeFlags(${flagArray(
|
|
12848
|
+
`cSettings: [${cDefines}${declaredClangSettings(target, "c")} .unsafeFlags(${flagArray(targetCFlags([...nativeFlags, ...native?.flags ?? []]))})]`,
|
|
12849
|
+
`cxxSettings: [${cxxDefines}${declaredClangSettings(target, "cxx")} .unsafeFlags(${flagArray(targetCxxFlags([...cxxFlagsFor(nativeFlags), ...native?.cxxFlags ?? []]))})]`
|
|
12827
12850
|
].join(", ");
|
|
12828
12851
|
const exclusions = native?.clang ? [] : [
|
|
12829
12852
|
...native ? native.exclude ?? native.lateSources : [],
|
|
@@ -12892,9 +12915,9 @@ function emitSwiftPackageManifest(args) {
|
|
|
12892
12915
|
` path: ${JSON.stringify(group.path)},`,
|
|
12893
12916
|
` sources: ${JSON.stringify(group.sources)},`,
|
|
12894
12917
|
` publicHeadersPath: ${JSON.stringify(native.groups ? "include" : "PeachSwiftImplementation")},`,
|
|
12895
|
-
` cSettings: [${macroSettings(owner?.cDefines)}${declaredClangSettings(owner, "c")} .unsafeFlags(${flagArray(
|
|
12918
|
+
` cSettings: [${macroSettings(owner?.cDefines)}${declaredClangSettings(owner, "c")} .unsafeFlags(${flagArray(targetCFlags([...nativeFlags, "-I", native.includeDirectory, ...args.headerDirectory ? ["-I", args.headerDirectory] : [], ...group.flags]))})],`,
|
|
12896
12919
|
...group.sources.some((source) => /\.(?:cc|cpp|cxx|mm)$/.test(source)) ? [
|
|
12897
|
-
` cxxSettings: [${macroSettings(owner?.cxxDefines)}${declaredClangSettings(owner, "cxx")} .unsafeFlags(${flagArray(
|
|
12920
|
+
` cxxSettings: [${macroSettings(owner?.cxxDefines)}${declaredClangSettings(owner, "cxx")} .unsafeFlags(${flagArray(targetCxxFlags([...cxxFlagsFor(nativeFlags), "-I", native.includeDirectory, ...group.cxxFlags]))})]),`
|
|
12898
12921
|
] : [" ),"]
|
|
12899
12922
|
]) : [];
|
|
12900
12923
|
}),
|
|
@@ -14491,7 +14514,10 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
14491
14514
|
const target = bySourcePath.find(
|
|
14492
14515
|
(candidate) => candidate.path === "." || file.startsWith(`${candidate.path}/`)
|
|
14493
14516
|
);
|
|
14494
|
-
|
|
14517
|
+
const excluded = target?.exclude?.some(
|
|
14518
|
+
(name2) => file === path27.posix.join(target.path, name2)
|
|
14519
|
+
);
|
|
14520
|
+
if (target && !excluded) swiftTargets.add(target.name);
|
|
14495
14521
|
}
|
|
14496
14522
|
const importedModules = /* @__PURE__ */ new Set();
|
|
14497
14523
|
const swiftImportedModules = /* @__PURE__ */ new Set();
|
|
@@ -15537,6 +15563,9 @@ module ${moduleName}.Swift {
|
|
|
15537
15563
|
frameworkLink,
|
|
15538
15564
|
[
|
|
15539
15565
|
...prebuilt.objects.map(quote),
|
|
15566
|
+
"-Wl,--start-lib",
|
|
15567
|
+
...prebuilt.lazyObjects.map(quote),
|
|
15568
|
+
"-Wl,--end-lib",
|
|
15540
15569
|
...darwinRecordsRegion(prebuilt.providers.map(quote))
|
|
15541
15570
|
].join("\n") + "\n"
|
|
15542
15571
|
);
|
|
@@ -15822,7 +15851,7 @@ function readCompiledArtifact(directory, hash) {
|
|
|
15822
15851
|
return null;
|
|
15823
15852
|
const bytes = readFileSync16(path27.join(directory, "app.wasm"));
|
|
15824
15853
|
const gzip2 = readFileSync16(path27.join(directory, "icu.gz"));
|
|
15825
|
-
if (createHash13("sha256").update(bytes).digest("hex") !== receipt.wasm || createHash13("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length
|
|
15854
|
+
if (createHash13("sha256").update(bytes).digest("hex") !== receipt.wasm || createHash13("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length <= 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
|
|
15826
15855
|
return null;
|
|
15827
15856
|
return { hash, bytes, icu: { sha256: receipt.icu, gzip: gzip2 } };
|
|
15828
15857
|
} catch (error) {
|
|
@@ -15943,7 +15972,13 @@ function linkedFrameworkTargets(moduleRoot, input) {
|
|
|
15943
15972
|
);
|
|
15944
15973
|
const targets = compileTargets(input);
|
|
15945
15974
|
const planning = targets.length > 0 ? targets : [{ name: "App", path: "." }];
|
|
15946
|
-
const siblings = swiftTargetDependencies(
|
|
15975
|
+
const siblings = swiftTargetDependencies(
|
|
15976
|
+
input.files,
|
|
15977
|
+
planning.map(
|
|
15978
|
+
(target) => input.libraries?.[target.name] ? { ...target, exclude: [] } : target
|
|
15979
|
+
),
|
|
15980
|
+
libraries.keys()
|
|
15981
|
+
);
|
|
15947
15982
|
const reached = /* @__PURE__ */ new Set();
|
|
15948
15983
|
const reach = (name2) => {
|
|
15949
15984
|
if (name2 === "SwiftUI") return;
|
|
@@ -16245,9 +16280,31 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
16245
16280
|
}
|
|
16246
16281
|
const providers = readdirSync8(providerDir).filter((file) => file.endsWith(".o")).sort().map((file) => path27.join(providerDir, file));
|
|
16247
16282
|
for (const provider of providers) linked.owners.set(provider, "DarwinRecords");
|
|
16283
|
+
const archive = path27.join(scratch2, "lib");
|
|
16284
|
+
rmSync6(archive, { recursive: true, force: true });
|
|
16285
|
+
mkdirSync6(archive);
|
|
16286
|
+
const archived = /* @__PURE__ */ new Map();
|
|
16287
|
+
for (const object3 of objects) {
|
|
16288
|
+
const target = linked.owners.get(object3);
|
|
16289
|
+
const dir = path27.join(release, `${target}.build`);
|
|
16290
|
+
if (!target || target === "Darwin" || !object3.startsWith(dir + path27.sep)) continue;
|
|
16291
|
+
const name2 = `${target}-${path27.relative(dir, object3).replaceAll(path27.sep, "-").replace(/\.swift\.o$/, ".o")}`;
|
|
16292
|
+
symlinkSync2(object3, path27.join(archive, name2));
|
|
16293
|
+
archived.set(object3, `lib/${name2}`);
|
|
16294
|
+
}
|
|
16295
|
+
const roots = swiftObjcRootObjects(`${scratch2}
|
|
16296
|
+
${args.frameworkKey}`, scratch2, [
|
|
16297
|
+
...archived.values()
|
|
16298
|
+
]);
|
|
16299
|
+
const linkedObjects = objects.map((object3) => {
|
|
16300
|
+
const name2 = archived.get(object3);
|
|
16301
|
+
return name2 ? { path: path27.join(scratch2, name2), lazy: !roots.has(name2) } : { path: object3, lazy: false };
|
|
16302
|
+
});
|
|
16248
16303
|
return {
|
|
16304
|
+
root: scratch2,
|
|
16249
16305
|
modules: path27.join(release, "Modules"),
|
|
16250
|
-
objects,
|
|
16306
|
+
objects: linkedObjects.filter((object3) => !object3.lazy).map((object3) => object3.path),
|
|
16307
|
+
lazyObjects: linkedObjects.filter((object3) => object3.lazy).map((object3) => object3.path),
|
|
16251
16308
|
owners: linked.owners,
|
|
16252
16309
|
providers,
|
|
16253
16310
|
link,
|
|
@@ -16401,6 +16458,10 @@ ${args.frameworkKey}
|
|
|
16401
16458
|
for (const object3 of args.prebuilt.objects)
|
|
16402
16459
|
hash.update(`object
|
|
16403
16460
|
${object3}
|
|
16461
|
+
${statOf(object3)}`);
|
|
16462
|
+
for (const object3 of args.prebuilt.lazyObjects)
|
|
16463
|
+
hash.update(`lazy-object
|
|
16464
|
+
${object3}
|
|
16404
16465
|
${statOf(object3)}`);
|
|
16405
16466
|
for (const object3 of args.prebuilt.providers)
|
|
16406
16467
|
hash.update(`provider
|
|
@@ -16817,7 +16878,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
16817
16878
|
pruneSwiftWasmLink(
|
|
16818
16879
|
root,
|
|
16819
16880
|
options.toolchainBin,
|
|
16820
|
-
frameworkRoot,
|
|
16881
|
+
prebuilt?.root ?? frameworkRoot,
|
|
16821
16882
|
input.staticClangTargets,
|
|
16822
16883
|
options.project,
|
|
16823
16884
|
void 0,
|
|
@@ -16841,11 +16902,19 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
16841
16902
|
optimized
|
|
16842
16903
|
});
|
|
16843
16904
|
else if (input.optimize) await optimizeWasm(output, optimized);
|
|
16905
|
+
const executable = input.optimize ? optimized : output;
|
|
16906
|
+
await runCompiler(
|
|
16907
|
+
path27.join(options.toolchainBin, "llvm-objcopy"),
|
|
16908
|
+
["--remove-section=.swift1_autolink_entries", executable],
|
|
16909
|
+
buildOptions
|
|
16910
|
+
);
|
|
16844
16911
|
const artifact = {
|
|
16845
16912
|
hash,
|
|
16846
|
-
bytes: readFileSync16(
|
|
16913
|
+
bytes: readFileSync16(executable),
|
|
16847
16914
|
icu: await icu
|
|
16848
16915
|
};
|
|
16916
|
+
if (artifact.bytes.length <= 8)
|
|
16917
|
+
throw new Error("swift-compile: deferred linker produced no executable");
|
|
16849
16918
|
if (!options.project) saveCompiledArtifact(root, artifact);
|
|
16850
16919
|
saveSharedArtifact(sharedRoot, artifact);
|
|
16851
16920
|
report("compiled artifact verified");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2182 | (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 __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2182 | (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 __defProp = Object.defineProperty;
|
|
@@ -86,7 +86,7 @@ var MAX_SWIFT_COMPILE_METAL_TOTAL_BYTES = 8 * 1024 * 1024;
|
|
|
86
86
|
var MAX_SWIFT_COMPILE_IMAGES = 256;
|
|
87
87
|
var MAX_SWIFT_COMPILE_IMAGE_BYTES = 4 * 1024 * 1024;
|
|
88
88
|
var MAX_SWIFT_COMPILE_IMAGE_TOTAL_BYTES = 16 * 1024 * 1024;
|
|
89
|
-
var SWIFT_HOST_ABI =
|
|
89
|
+
var SWIFT_HOST_ABI = 70;
|
|
90
90
|
var POLL_INTERVAL_MS = 1500;
|
|
91
91
|
function swiftNativeEntry(native, file) {
|
|
92
92
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2182 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/is-record.ts
|
|
4
4
|
function isRecord(value) {
|
|
@@ -40,7 +40,7 @@ var MAX_SWIFT_COMPILE_METAL_TOTAL_BYTES = 8 * 1024 * 1024;
|
|
|
40
40
|
var MAX_SWIFT_COMPILE_IMAGES = 256;
|
|
41
41
|
var MAX_SWIFT_COMPILE_IMAGE_BYTES = 4 * 1024 * 1024;
|
|
42
42
|
var MAX_SWIFT_COMPILE_IMAGE_TOTAL_BYTES = 16 * 1024 * 1024;
|
|
43
|
-
var SWIFT_HOST_ABI =
|
|
43
|
+
var SWIFT_HOST_ABI = 70;
|
|
44
44
|
var POLL_INTERVAL_MS = 1500;
|
|
45
45
|
function swiftNativeEntry(native, file) {
|
|
46
46
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2182 | (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;
|
package/dist-lib/swift.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2182 | (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 __defProp = Object.defineProperty;
|