peachsim 0.1.2252 → 0.1.2255
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/compat.ts +1 -1
- package/cli/commands/control.ts +1 -1
- package/cli/commands/package.ts +1 -1
- package/cli/commands/runtime.ts +1 -1
- package/cli/commands/upgrade.ts +2 -5
- package/cli/commands/version.ts +1 -1
- package/cli/native-input.ts +1 -1
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +2927 -2218
- 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 +16 -1
- package/dist-lib/config.mjs +14 -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 +3110 -2402
- 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 +2995 -2275
- 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 +2785 -2643
- 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 +3 -2
- 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 +126 -42
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -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 +24 -24
- package/dist-lib/public-origins-lib.json +126 -114
- 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 +3454 -2736
- package/dist-lib/swift-compile.cjs +97 -31
- package/dist-lib/swift-compile.mjs +100 -31
- 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 +2203 -1517
- package/dist-lib/vite.cjs +4804 -3498
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/config.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +33 -1
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +11 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/wasm/include/__typedef_time_t.h +5 -0
- package/sdk/ios/wasm/include/ifaddrs.h +75 -0
- package/sdk/ios/wasm/include/machine/_types.h +1 -1
- package/sdk/ios/wasm/include/pthread.h +4 -0
- package/sdk/ios/wasm/include/unistd.h +2 -0
- package/{cli → src}/app-config.ts +5 -5
- package/src/bundle-channel.mjs +1 -1
- package/src/config.ts +29 -0
- package/src/core-data-entity-classes.ts +2 -2
- package/src/core-data-model.ts +681 -0
- package/src/expo-swift-host.ts +1 -1
- package/src/kotlin-host.ts +2 -1
- package/src/metro-plugin.ts +1 -3
- package/src/nitro-adapter.lock.json +236 -236
- package/src/nitro-bundle.ts +1 -1
- package/src/nitro-superset.lock.json +4 -4
- package/src/plist-bytes.ts +113 -0
- package/src/runtime-delivery.ts +3 -2
- package/src/swift-compile.ts +8 -1
- package/src/swift-distribution.lock.json +11 -11
- package/src/swift-guest-image-ledger.ts +2 -1
- package/src/swift-host.ts +18 -3
- package/src/turbo-bundle.ts +1 -1
- package/src/turbo-runtime.lock.json +20 -20
- package/src/vite-plugin-one.ts +68 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2255 | (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;
|
|
@@ -7195,7 +7195,7 @@ function createGuestImageLedger(input) {
|
|
|
7195
7195
|
const objects = units.map(({ image, object: object3, aliases, functionImports }) => {
|
|
7196
7196
|
const shared = bindingsByImage.get(image);
|
|
7197
7197
|
const own = startup.get(object3.path);
|
|
7198
|
-
|
|
7198
|
+
let bindings = own ? new Map([...shared, ...own]) : shared;
|
|
7199
7199
|
for (const [name2, type] of functionImports) {
|
|
7200
7200
|
const alias = bindings.get(name2);
|
|
7201
7201
|
const provider = alias === void 0 ? void 0 : definitionsByAlias.get(alias);
|
|
@@ -7211,6 +7211,7 @@ function createGuestImageLedger(input) {
|
|
|
7211
7211
|
};
|
|
7212
7212
|
resultWrappers.set(key, wrapper);
|
|
7213
7213
|
}
|
|
7214
|
+
if (bindings === shared) bindings = new Map(shared);
|
|
7214
7215
|
bindings.set(name2, wrapper.symbol);
|
|
7215
7216
|
}
|
|
7216
7217
|
return {
|
|
@@ -10161,7 +10162,6 @@ var import_node_crypto10 = __toESM(require("node:crypto"), 1);
|
|
|
10161
10162
|
var import_node_fs14 = __toESM(require("node:fs"), 1);
|
|
10162
10163
|
var import_node_os5 = __toESM(require("node:os"), 1);
|
|
10163
10164
|
var import_node_path14 = __toESM(require("node:path"), 1);
|
|
10164
|
-
var import_node_stream2 = require("node:stream");
|
|
10165
10165
|
var import_promises3 = require("node:stream/promises");
|
|
10166
10166
|
var import_node_zlib = __toESM(require("node:zlib"), 1);
|
|
10167
10167
|
async function installVerifiedTarball(tarball) {
|
|
@@ -10207,17 +10207,20 @@ async function installVerifiedTarballLocked(tarball, presentAtStart) {
|
|
|
10207
10207
|
import_node_path14.default.join(import_node_path14.default.dirname(destDir), `.installing-${import_node_path14.default.basename(destDir)}-`)
|
|
10208
10208
|
);
|
|
10209
10209
|
try {
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
if (actual !== digest.value) {
|
|
10218
|
-
throw new Error(
|
|
10219
|
-
`${digest.algorithm} mismatch for ${label}: expected ${digest.value}, actual ${actual}`
|
|
10210
|
+
for (let attempt = 1; ; attempt++) {
|
|
10211
|
+
await downloadToFile(url, archivePath, signal);
|
|
10212
|
+
const actual = await digestFile(
|
|
10213
|
+
archivePath,
|
|
10214
|
+
digest.algorithm,
|
|
10215
|
+
digest.encoding,
|
|
10216
|
+
signal
|
|
10220
10217
|
);
|
|
10218
|
+
if (actual === digest.value) break;
|
|
10219
|
+
if (attempt >= 2) {
|
|
10220
|
+
throw new Error(
|
|
10221
|
+
`${digest.algorithm} mismatch for ${label}: expected ${digest.value}, actual ${actual}`
|
|
10222
|
+
);
|
|
10223
|
+
}
|
|
10221
10224
|
}
|
|
10222
10225
|
const { pathname } = new URL(url);
|
|
10223
10226
|
if (pathname.endsWith(".zip")) await extractZip(archivePath, tmpDir, signal);
|
|
@@ -10268,27 +10271,87 @@ async function installVerifiedTarballLocked(tarball, presentAtStart) {
|
|
|
10268
10271
|
function isErrnoCode(err, ...codes) {
|
|
10269
10272
|
return err instanceof Error && "code" in err && codes.includes(String(err.code));
|
|
10270
10273
|
}
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10274
|
+
var DownloadHttpError = class extends Error {
|
|
10275
|
+
retryable;
|
|
10276
|
+
constructor(status, statusText, url) {
|
|
10277
|
+
super(`download failed: ${status} ${statusText} (${url})`);
|
|
10278
|
+
this.retryable = status < 400 || status >= 500 || status === 408 || status === 429;
|
|
10275
10279
|
}
|
|
10280
|
+
};
|
|
10281
|
+
async function waitRetryDelay(ms, signal) {
|
|
10282
|
+
signal?.throwIfAborted();
|
|
10283
|
+
await new Promise((resolve, reject) => {
|
|
10284
|
+
const onAbort = () => {
|
|
10285
|
+
clearTimeout(timer);
|
|
10286
|
+
const reason = signal?.reason;
|
|
10287
|
+
reject(
|
|
10288
|
+
reason instanceof Error ? reason : new Error("Download canceled", { cause: reason })
|
|
10289
|
+
);
|
|
10290
|
+
};
|
|
10291
|
+
const timer = setTimeout(() => {
|
|
10292
|
+
signal?.removeEventListener("abort", onAbort);
|
|
10293
|
+
resolve();
|
|
10294
|
+
}, ms);
|
|
10295
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
10296
|
+
});
|
|
10297
|
+
}
|
|
10298
|
+
async function downloadToFile(url, destPath, signal) {
|
|
10276
10299
|
import_node_fs14.default.mkdirSync(import_node_path14.default.dirname(destPath), { recursive: true });
|
|
10277
10300
|
const tmp = `${destPath}.partial`;
|
|
10278
|
-
|
|
10279
|
-
await (0, import_promises3.pipeline)(
|
|
10280
|
-
import_node_stream2.Readable.fromWeb(res.body),
|
|
10281
|
-
import_node_fs14.default.createWriteStream(tmp),
|
|
10282
|
-
{ signal }
|
|
10283
|
-
);
|
|
10301
|
+
for (let attempt = 1; attempt <= 4; attempt++) {
|
|
10284
10302
|
signal?.throwIfAborted();
|
|
10285
|
-
|
|
10286
|
-
|
|
10303
|
+
let reader2;
|
|
10304
|
+
let handle;
|
|
10305
|
+
let completed = false;
|
|
10287
10306
|
try {
|
|
10288
|
-
|
|
10289
|
-
|
|
10307
|
+
const res = await fetch(url, { signal });
|
|
10308
|
+
if (!res.ok || !res.body) {
|
|
10309
|
+
throw new DownloadHttpError(res.status, res.statusText, url);
|
|
10310
|
+
}
|
|
10311
|
+
reader2 = res.body.getReader();
|
|
10312
|
+
handle = await import_node_fs14.default.promises.open(tmp, "w");
|
|
10313
|
+
let written = 0;
|
|
10314
|
+
for (; ; ) {
|
|
10315
|
+
signal?.throwIfAborted();
|
|
10316
|
+
const { done, value } = await reader2.read();
|
|
10317
|
+
if (done) break;
|
|
10318
|
+
let offset = 0;
|
|
10319
|
+
while (offset < value.byteLength) {
|
|
10320
|
+
const { bytesWritten } = await handle.write(
|
|
10321
|
+
value,
|
|
10322
|
+
offset,
|
|
10323
|
+
value.byteLength - offset
|
|
10324
|
+
);
|
|
10325
|
+
offset += bytesWritten;
|
|
10326
|
+
}
|
|
10327
|
+
written += value.byteLength;
|
|
10328
|
+
}
|
|
10329
|
+
await handle.close();
|
|
10330
|
+
handle = void 0;
|
|
10331
|
+
if (!res.headers.get("content-encoding")) {
|
|
10332
|
+
const header = res.headers.get("content-length");
|
|
10333
|
+
const expected = header ? Number(header) : Number.NaN;
|
|
10334
|
+
if (Number.isFinite(expected) && expected > 0 && written !== expected) {
|
|
10335
|
+
throw new Error(`incomplete download (${written}/${expected} bytes): ${url}`);
|
|
10336
|
+
}
|
|
10337
|
+
}
|
|
10338
|
+
signal?.throwIfAborted();
|
|
10339
|
+
import_node_fs14.default.renameSync(tmp, destPath);
|
|
10340
|
+
completed = true;
|
|
10341
|
+
return;
|
|
10342
|
+
} catch (err) {
|
|
10343
|
+
if (handle) await handle.close().catch(() => {
|
|
10344
|
+
});
|
|
10345
|
+
if (reader2 && !completed) await reader2.cancel().catch(() => {
|
|
10346
|
+
});
|
|
10347
|
+
try {
|
|
10348
|
+
import_node_fs14.default.unlinkSync(tmp);
|
|
10349
|
+
} catch {
|
|
10350
|
+
}
|
|
10351
|
+
const nonRetryable = err instanceof DownloadHttpError && !err.retryable;
|
|
10352
|
+
if (signal?.aborted || nonRetryable || attempt === 4) throw err;
|
|
10353
|
+
await waitRetryDelay(250 * attempt, signal);
|
|
10290
10354
|
}
|
|
10291
|
-
throw err;
|
|
10292
10355
|
}
|
|
10293
10356
|
}
|
|
10294
10357
|
async function digestFile(filePath, algorithm, encoding, signal) {
|
|
@@ -12648,7 +12711,7 @@ function swiftCondition(text2, available) {
|
|
|
12648
12711
|
if (name2 === "canImport")
|
|
12649
12712
|
return argument !== "FoundationNetworking" && available?.has(argument);
|
|
12650
12713
|
if (name2 === "targetEnvironment") return argument === "simulator";
|
|
12651
|
-
if (name2 === "arch") return argument === "wasm64";
|
|
12714
|
+
if (name2 === "arch") return argument === "wasm64" || argument === "arm64";
|
|
12652
12715
|
return void 0;
|
|
12653
12716
|
};
|
|
12654
12717
|
const both = () => {
|
|
@@ -13117,6 +13180,8 @@ var executableLinkFlags = (root) => ` "-Xclang-linker", "-O0",
|
|
|
13117
13180
|
"-Xlinker", "--global-base=8372224",
|
|
13118
13181
|
"-Xlinker", "-lsetjmp",
|
|
13119
13182
|
"-Xlinker", "--export-table",
|
|
13183
|
+
"-Xlinker", "--export-if-defined=__cpp_exception",
|
|
13184
|
+
"-Xlinker", "--export-if-defined=__objc_wasm_terminate",
|
|
13120
13185
|
"-Xlinker", "--growable-table",
|
|
13121
13186
|
"-Xlinker", "--wrap=swift_udata_open",
|
|
13122
13187
|
"-Xlinker", "--wrap=swift_udata_openChoice",
|
|
@@ -13125,7 +13190,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
|
|
|
13125
13190
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
13126
13191
|
var MULTI_MANIFEST_VERSION = 68;
|
|
13127
13192
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
13128
|
-
var compilerSourceDigest = true ? "
|
|
13193
|
+
var compilerSourceDigest = true ? "7a3d4cb0dd1707b250c7820af78306aad350bdeea3ce3d4722e9e54ffbbf3817" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
13129
13194
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
13130
13195
|
const hash = (0, import_node_crypto13.createHash)("sha256");
|
|
13131
13196
|
hash.update(`swift-compile
|
|
@@ -13635,6 +13700,7 @@ function syncSwiftTree(base, files) {
|
|
|
13635
13700
|
}
|
|
13636
13701
|
var DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
|
|
13637
13702
|
var OS_IOS = /\b(?:os\(\s*iOS\s*\)|targetEnvironment\(\s*simulator\s*\))/g;
|
|
13703
|
+
var ARCH_ARM64 = /\barch\(\s*arm64\s*\)/g;
|
|
13638
13704
|
var NOT_ON_IOS = /\b(?:os\(\s*WASI\s*\)|canImport\(\s*FoundationNetworking\s*\))/g;
|
|
13639
13705
|
var DELEGATE_CLASS = /^class\s+[A-Za-z_]\w*\s*(?:<[^>{]*>)?\s*:[^{]*\b(?:UIApplicationDelegate|UISceneDelegate|UIWindowSceneDelegate)\b[^{]*\{/;
|
|
13640
13706
|
function compiledSwiftSources(files, targets, overlayFrameworks) {
|
|
@@ -14317,7 +14383,7 @@ function swiftConditionsAsIOS(source, lineStarts, swiftPackage) {
|
|
|
14317
14383
|
const start = offset;
|
|
14318
14384
|
offset += line.length + 1;
|
|
14319
14385
|
if (!lineStarts.has(start) || !DIRECTIVE.test(line)) return line;
|
|
14320
|
-
const platform = line.replace(OS_IOS, (match) => "true".padEnd(match.length)).replace(NOT_ON_IOS, (match) => "false".padEnd(match.length));
|
|
14386
|
+
const platform = line.replace(OS_IOS, (match) => "true".padEnd(match.length)).replace(ARCH_ARM64, (match) => "true".padEnd(match.length)).replace(NOT_ON_IOS, (match) => "false".padEnd(match.length));
|
|
14321
14387
|
return swiftPackage === false ? platform.replace(/\bSWIFT_PACKAGE\b/g, (match) => "false".padEnd(match.length)) : platform;
|
|
14322
14388
|
}).join("\n");
|
|
14323
14389
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2255 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2
5
|
|
|
3
6
|
// src/swift-compile.ts
|
|
4
7
|
import {
|
|
@@ -7145,7 +7148,7 @@ function createGuestImageLedger(input) {
|
|
|
7145
7148
|
const objects = units.map(({ image, object: object3, aliases, functionImports }) => {
|
|
7146
7149
|
const shared = bindingsByImage.get(image);
|
|
7147
7150
|
const own = startup.get(object3.path);
|
|
7148
|
-
|
|
7151
|
+
let bindings = own ? new Map([...shared, ...own]) : shared;
|
|
7149
7152
|
for (const [name2, type] of functionImports) {
|
|
7150
7153
|
const alias = bindings.get(name2);
|
|
7151
7154
|
const provider = alias === void 0 ? void 0 : definitionsByAlias.get(alias);
|
|
@@ -7161,6 +7164,7 @@ function createGuestImageLedger(input) {
|
|
|
7161
7164
|
};
|
|
7162
7165
|
resultWrappers.set(key, wrapper);
|
|
7163
7166
|
}
|
|
7167
|
+
if (bindings === shared) bindings = new Map(shared);
|
|
7164
7168
|
bindings.set(name2, wrapper.symbol);
|
|
7165
7169
|
}
|
|
7166
7170
|
return {
|
|
@@ -10112,7 +10116,6 @@ import crypto from "node:crypto";
|
|
|
10112
10116
|
import fs7 from "node:fs";
|
|
10113
10117
|
import os2 from "node:os";
|
|
10114
10118
|
import path17 from "node:path";
|
|
10115
|
-
import { Readable } from "node:stream";
|
|
10116
10119
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
10117
10120
|
import zlib2 from "node:zlib";
|
|
10118
10121
|
|
|
@@ -10164,17 +10167,20 @@ async function installVerifiedTarballLocked(tarball, presentAtStart) {
|
|
|
10164
10167
|
path17.join(path17.dirname(destDir), `.installing-${path17.basename(destDir)}-`)
|
|
10165
10168
|
);
|
|
10166
10169
|
try {
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
if (actual !== digest.value) {
|
|
10175
|
-
throw new Error(
|
|
10176
|
-
`${digest.algorithm} mismatch for ${label}: expected ${digest.value}, actual ${actual}`
|
|
10170
|
+
for (let attempt = 1; ; attempt++) {
|
|
10171
|
+
await downloadToFile(url, archivePath, signal);
|
|
10172
|
+
const actual = await digestFile(
|
|
10173
|
+
archivePath,
|
|
10174
|
+
digest.algorithm,
|
|
10175
|
+
digest.encoding,
|
|
10176
|
+
signal
|
|
10177
10177
|
);
|
|
10178
|
+
if (actual === digest.value) break;
|
|
10179
|
+
if (attempt >= 2) {
|
|
10180
|
+
throw new Error(
|
|
10181
|
+
`${digest.algorithm} mismatch for ${label}: expected ${digest.value}, actual ${actual}`
|
|
10182
|
+
);
|
|
10183
|
+
}
|
|
10178
10184
|
}
|
|
10179
10185
|
const { pathname } = new URL(url);
|
|
10180
10186
|
if (pathname.endsWith(".zip")) await extractZip(archivePath, tmpDir, signal);
|
|
@@ -10225,27 +10231,87 @@ async function installVerifiedTarballLocked(tarball, presentAtStart) {
|
|
|
10225
10231
|
function isErrnoCode(err, ...codes) {
|
|
10226
10232
|
return err instanceof Error && "code" in err && codes.includes(String(err.code));
|
|
10227
10233
|
}
|
|
10228
|
-
|
|
10229
|
-
|
|
10230
|
-
|
|
10231
|
-
|
|
10234
|
+
var DownloadHttpError = class extends Error {
|
|
10235
|
+
constructor(status, statusText, url) {
|
|
10236
|
+
super(`download failed: ${status} ${statusText} (${url})`);
|
|
10237
|
+
__publicField(this, "retryable");
|
|
10238
|
+
this.retryable = status < 400 || status >= 500 || status === 408 || status === 429;
|
|
10232
10239
|
}
|
|
10240
|
+
};
|
|
10241
|
+
async function waitRetryDelay(ms, signal) {
|
|
10242
|
+
signal?.throwIfAborted();
|
|
10243
|
+
await new Promise((resolve, reject) => {
|
|
10244
|
+
const onAbort = () => {
|
|
10245
|
+
clearTimeout(timer);
|
|
10246
|
+
const reason = signal?.reason;
|
|
10247
|
+
reject(
|
|
10248
|
+
reason instanceof Error ? reason : new Error("Download canceled", { cause: reason })
|
|
10249
|
+
);
|
|
10250
|
+
};
|
|
10251
|
+
const timer = setTimeout(() => {
|
|
10252
|
+
signal?.removeEventListener("abort", onAbort);
|
|
10253
|
+
resolve();
|
|
10254
|
+
}, ms);
|
|
10255
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
10256
|
+
});
|
|
10257
|
+
}
|
|
10258
|
+
async function downloadToFile(url, destPath, signal) {
|
|
10233
10259
|
fs7.mkdirSync(path17.dirname(destPath), { recursive: true });
|
|
10234
10260
|
const tmp = `${destPath}.partial`;
|
|
10235
|
-
|
|
10236
|
-
await pipeline2(
|
|
10237
|
-
Readable.fromWeb(res.body),
|
|
10238
|
-
fs7.createWriteStream(tmp),
|
|
10239
|
-
{ signal }
|
|
10240
|
-
);
|
|
10261
|
+
for (let attempt = 1; attempt <= 4; attempt++) {
|
|
10241
10262
|
signal?.throwIfAborted();
|
|
10242
|
-
|
|
10243
|
-
|
|
10263
|
+
let reader2;
|
|
10264
|
+
let handle;
|
|
10265
|
+
let completed = false;
|
|
10244
10266
|
try {
|
|
10245
|
-
|
|
10246
|
-
|
|
10267
|
+
const res = await fetch(url, { signal });
|
|
10268
|
+
if (!res.ok || !res.body) {
|
|
10269
|
+
throw new DownloadHttpError(res.status, res.statusText, url);
|
|
10270
|
+
}
|
|
10271
|
+
reader2 = res.body.getReader();
|
|
10272
|
+
handle = await fs7.promises.open(tmp, "w");
|
|
10273
|
+
let written = 0;
|
|
10274
|
+
for (; ; ) {
|
|
10275
|
+
signal?.throwIfAborted();
|
|
10276
|
+
const { done, value } = await reader2.read();
|
|
10277
|
+
if (done) break;
|
|
10278
|
+
let offset = 0;
|
|
10279
|
+
while (offset < value.byteLength) {
|
|
10280
|
+
const { bytesWritten } = await handle.write(
|
|
10281
|
+
value,
|
|
10282
|
+
offset,
|
|
10283
|
+
value.byteLength - offset
|
|
10284
|
+
);
|
|
10285
|
+
offset += bytesWritten;
|
|
10286
|
+
}
|
|
10287
|
+
written += value.byteLength;
|
|
10288
|
+
}
|
|
10289
|
+
await handle.close();
|
|
10290
|
+
handle = void 0;
|
|
10291
|
+
if (!res.headers.get("content-encoding")) {
|
|
10292
|
+
const header = res.headers.get("content-length");
|
|
10293
|
+
const expected = header ? Number(header) : Number.NaN;
|
|
10294
|
+
if (Number.isFinite(expected) && expected > 0 && written !== expected) {
|
|
10295
|
+
throw new Error(`incomplete download (${written}/${expected} bytes): ${url}`);
|
|
10296
|
+
}
|
|
10297
|
+
}
|
|
10298
|
+
signal?.throwIfAborted();
|
|
10299
|
+
fs7.renameSync(tmp, destPath);
|
|
10300
|
+
completed = true;
|
|
10301
|
+
return;
|
|
10302
|
+
} catch (err) {
|
|
10303
|
+
if (handle) await handle.close().catch(() => {
|
|
10304
|
+
});
|
|
10305
|
+
if (reader2 && !completed) await reader2.cancel().catch(() => {
|
|
10306
|
+
});
|
|
10307
|
+
try {
|
|
10308
|
+
fs7.unlinkSync(tmp);
|
|
10309
|
+
} catch {
|
|
10310
|
+
}
|
|
10311
|
+
const nonRetryable = err instanceof DownloadHttpError && !err.retryable;
|
|
10312
|
+
if (signal?.aborted || nonRetryable || attempt === 4) throw err;
|
|
10313
|
+
await waitRetryDelay(250 * attempt, signal);
|
|
10247
10314
|
}
|
|
10248
|
-
throw err;
|
|
10249
10315
|
}
|
|
10250
10316
|
}
|
|
10251
10317
|
async function digestFile(filePath, algorithm, encoding, signal) {
|
|
@@ -12631,7 +12697,7 @@ function swiftCondition(text2, available) {
|
|
|
12631
12697
|
if (name2 === "canImport")
|
|
12632
12698
|
return argument !== "FoundationNetworking" && available?.has(argument);
|
|
12633
12699
|
if (name2 === "targetEnvironment") return argument === "simulator";
|
|
12634
|
-
if (name2 === "arch") return argument === "wasm64";
|
|
12700
|
+
if (name2 === "arch") return argument === "wasm64" || argument === "arm64";
|
|
12635
12701
|
return void 0;
|
|
12636
12702
|
};
|
|
12637
12703
|
const both = () => {
|
|
@@ -13100,6 +13166,8 @@ var executableLinkFlags = (root) => ` "-Xclang-linker", "-O0",
|
|
|
13100
13166
|
"-Xlinker", "--global-base=8372224",
|
|
13101
13167
|
"-Xlinker", "-lsetjmp",
|
|
13102
13168
|
"-Xlinker", "--export-table",
|
|
13169
|
+
"-Xlinker", "--export-if-defined=__cpp_exception",
|
|
13170
|
+
"-Xlinker", "--export-if-defined=__objc_wasm_terminate",
|
|
13103
13171
|
"-Xlinker", "--growable-table",
|
|
13104
13172
|
"-Xlinker", "--wrap=swift_udata_open",
|
|
13105
13173
|
"-Xlinker", "--wrap=swift_udata_openChoice",
|
|
@@ -13108,7 +13176,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
|
|
|
13108
13176
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
13109
13177
|
var MULTI_MANIFEST_VERSION = 68;
|
|
13110
13178
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
13111
|
-
var compilerSourceDigest = true ? "
|
|
13179
|
+
var compilerSourceDigest = true ? "7a3d4cb0dd1707b250c7820af78306aad350bdeea3ce3d4722e9e54ffbbf3817" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
13112
13180
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
13113
13181
|
const hash = createHash13("sha256");
|
|
13114
13182
|
hash.update(`swift-compile
|
|
@@ -13618,6 +13686,7 @@ function syncSwiftTree(base, files) {
|
|
|
13618
13686
|
}
|
|
13619
13687
|
var DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
|
|
13620
13688
|
var OS_IOS = /\b(?:os\(\s*iOS\s*\)|targetEnvironment\(\s*simulator\s*\))/g;
|
|
13689
|
+
var ARCH_ARM64 = /\barch\(\s*arm64\s*\)/g;
|
|
13621
13690
|
var NOT_ON_IOS = /\b(?:os\(\s*WASI\s*\)|canImport\(\s*FoundationNetworking\s*\))/g;
|
|
13622
13691
|
var DELEGATE_CLASS = /^class\s+[A-Za-z_]\w*\s*(?:<[^>{]*>)?\s*:[^{]*\b(?:UIApplicationDelegate|UISceneDelegate|UIWindowSceneDelegate)\b[^{]*\{/;
|
|
13623
13692
|
function compiledSwiftSources(files, targets, overlayFrameworks) {
|
|
@@ -14300,7 +14369,7 @@ function swiftConditionsAsIOS(source, lineStarts, swiftPackage) {
|
|
|
14300
14369
|
const start = offset;
|
|
14301
14370
|
offset += line.length + 1;
|
|
14302
14371
|
if (!lineStarts.has(start) || !DIRECTIVE.test(line)) return line;
|
|
14303
|
-
const platform = line.replace(OS_IOS, (match) => "true".padEnd(match.length)).replace(NOT_ON_IOS, (match) => "false".padEnd(match.length));
|
|
14372
|
+
const platform = line.replace(OS_IOS, (match) => "true".padEnd(match.length)).replace(ARCH_ARM64, (match) => "true".padEnd(match.length)).replace(NOT_ON_IOS, (match) => "false".padEnd(match.length));
|
|
14304
14373
|
return swiftPackage === false ? platform.replace(/\bSWIFT_PACKAGE\b/g, (match) => "false".padEnd(match.length)) : platform;
|
|
14305
14374
|
}).join("\n");
|
|
14306
14375
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2255 | (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.2255 | (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.2255 | (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.2255 | (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;
|