peachsim 0.1.1886 → 0.1.1887
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/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 +206 -82
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +136 -42
- 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 +146 -23
- 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 +15 -2
- 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 +15 -2
- package/dist-lib/native-app-identity-project.cjs +15 -2
- package/dist-lib/native-app-identity-project.mjs +22 -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 +27 -24
- package/dist-lib/public-origins-lib.json +70 -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 +170 -31
- package/dist-lib/swift-compile.cjs +100 -12
- package/dist-lib/swift-compile.mjs +104 -11
- 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 +116 -18
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/package.json +1 -1
- package/src/expo-swift-bundle.ts +2 -7
- package/src/nitro-bundle.ts +7 -10
- package/src/podspec-sources.ts +20 -0
- package/src/swift-compile.ts +10 -5
- package/src/swift-host.ts +32 -19
- package/src/swift-icu.ts +60 -18
- package/src/swift-submit.ts +3 -1
- package/src/turbo-bundle.ts +1 -1
- package/src/turbo-codegen-intake.ts +10 -3
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1887 | (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;
|
|
@@ -30781,7 +30781,7 @@ var init_swift_submit = __esm({
|
|
|
30781
30781
|
MAX_SWIFT_COMPILE_IMAGES = 256;
|
|
30782
30782
|
MAX_SWIFT_COMPILE_IMAGE_BYTES = 4 * 1024 * 1024;
|
|
30783
30783
|
MAX_SWIFT_COMPILE_IMAGE_TOTAL_BYTES = 16 * 1024 * 1024;
|
|
30784
|
-
SWIFT_HOST_ABI =
|
|
30784
|
+
SWIFT_HOST_ABI = 69;
|
|
30785
30785
|
POLL_INTERVAL_MS = 1500;
|
|
30786
30786
|
}
|
|
30787
30787
|
});
|
|
@@ -51568,6 +51568,76 @@ var init_swift_guest_compile = __esm({
|
|
|
51568
51568
|
}
|
|
51569
51569
|
});
|
|
51570
51570
|
|
|
51571
|
+
// ../peach-compat/src/stubs/wasm-memory.ts
|
|
51572
|
+
var init_wasm_memory = __esm({
|
|
51573
|
+
"../peach-compat/src/stubs/wasm-memory.ts"() {
|
|
51574
|
+
"use strict";
|
|
51575
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
51576
|
+
}
|
|
51577
|
+
});
|
|
51578
|
+
|
|
51579
|
+
// ../sootsim-swift/src/icuData.ts
|
|
51580
|
+
function swiftIcuLayout(head, blobBytes) {
|
|
51581
|
+
const view = new DataView(head.buffer, head.byteOffset, head.byteLength);
|
|
51582
|
+
const toc = view.getUint16(0, true);
|
|
51583
|
+
if (head[2] !== 218 || head[3] !== 39)
|
|
51584
|
+
throw new Error("swift icu data has no icu header");
|
|
51585
|
+
const count = view.getUint32(toc, true);
|
|
51586
|
+
const names = [];
|
|
51587
|
+
const offsets = new Uint32Array(count + 1);
|
|
51588
|
+
const decoder2 = new TextDecoder("latin1");
|
|
51589
|
+
for (let index = 0; index < count; index++) {
|
|
51590
|
+
const name3 = toc + view.getUint32(toc + 4 + index * 8, true);
|
|
51591
|
+
offsets[index] = toc + view.getUint32(toc + 8 + index * 8, true);
|
|
51592
|
+
names.push(decoder2.decode(head.subarray(name3, head.indexOf(0, name3))));
|
|
51593
|
+
}
|
|
51594
|
+
offsets[count] = blobBytes;
|
|
51595
|
+
const packOf = new Uint32Array(count);
|
|
51596
|
+
const packs = [];
|
|
51597
|
+
for (let index = 0; index < count; index++) {
|
|
51598
|
+
const last = packs[packs.length - 1];
|
|
51599
|
+
if (last && offsets[index + 1] - last[0] <= PACK_BYTES) last[1] = offsets[index + 1];
|
|
51600
|
+
else packs.push([offsets[index], offsets[index + 1]]);
|
|
51601
|
+
packOf[index] = packs.length - 1;
|
|
51602
|
+
}
|
|
51603
|
+
return { headBytes: offsets[0], names, packOf, packs };
|
|
51604
|
+
}
|
|
51605
|
+
function swiftIcuPack(blob, deflate2) {
|
|
51606
|
+
const layout2 = swiftIcuLayout(blob, blob.byteLength);
|
|
51607
|
+
const parts = [
|
|
51608
|
+
deflate2(blob.subarray(0, layout2.headBytes)),
|
|
51609
|
+
...layout2.packs.map(([start, end]) => deflate2(blob.subarray(start, end)))
|
|
51610
|
+
];
|
|
51611
|
+
const index = new DataView(new ArrayBuffer(16 + parts.length * 4));
|
|
51612
|
+
index.setUint32(0, MAGIC, true);
|
|
51613
|
+
index.setUint32(4, VERSION, true);
|
|
51614
|
+
index.setUint32(8, blob.byteLength, true);
|
|
51615
|
+
index.setUint32(12, layout2.packs.length, true);
|
|
51616
|
+
parts.forEach((part, at2) => index.setUint32(16 + at2 * 4, part.byteLength, true));
|
|
51617
|
+
const packed = new Uint8Array(
|
|
51618
|
+
index.byteLength + parts.reduce((total, part) => total + part.byteLength, 0)
|
|
51619
|
+
);
|
|
51620
|
+
packed.set(new Uint8Array(index.buffer));
|
|
51621
|
+
let at = index.byteLength;
|
|
51622
|
+
for (const part of parts) {
|
|
51623
|
+
packed.set(part, at);
|
|
51624
|
+
at += part.byteLength;
|
|
51625
|
+
}
|
|
51626
|
+
return packed;
|
|
51627
|
+
}
|
|
51628
|
+
var PACK_BYTES, MAGIC, VERSION, SWIFT_ICU_PACKED;
|
|
51629
|
+
var init_icuData = __esm({
|
|
51630
|
+
"../sootsim-swift/src/icuData.ts"() {
|
|
51631
|
+
"use strict";
|
|
51632
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
51633
|
+
init_wasm_memory();
|
|
51634
|
+
PACK_BYTES = 64 * 1024;
|
|
51635
|
+
MAGIC = 1430473040;
|
|
51636
|
+
VERSION = 1;
|
|
51637
|
+
SWIFT_ICU_PACKED = `picu${VERSION}`;
|
|
51638
|
+
}
|
|
51639
|
+
});
|
|
51640
|
+
|
|
51571
51641
|
// src/swift-icu.ts
|
|
51572
51642
|
async function cachedBrotli(bytes, quality, cacheKey) {
|
|
51573
51643
|
const key2 = cacheKey && /^[a-f0-9]{64}$/.test(cacheKey) ? cacheKey : (0, import_node_crypto21.createHash)("sha256").update(bytes).digest("hex");
|
|
@@ -51600,9 +51670,6 @@ async function cachedBrotli(bytes, quality, cacheKey) {
|
|
|
51600
51670
|
function brotliCompressQ4(bytes, cacheKey) {
|
|
51601
51671
|
return cachedBrotli(bytes, 4, cacheKey);
|
|
51602
51672
|
}
|
|
51603
|
-
async function swiftIcuBrotliQ4(icu) {
|
|
51604
|
-
return brotliMemoryCache.get(`4:${icu.sha256}`) ?? brotliCompressQ4(await inflateGzip(icu.gzip), icu.sha256);
|
|
51605
|
-
}
|
|
51606
51673
|
async function memo(cache, key2, load2) {
|
|
51607
51674
|
const cached4 = cache.get(key2);
|
|
51608
51675
|
if (cached4 !== void 0) return cached4;
|
|
@@ -51705,7 +51772,40 @@ function icuSegment(object6) {
|
|
|
51705
51772
|
throw new Error(`swift-icu: expected one icu data segment, found ${found.length}`);
|
|
51706
51773
|
return found[0];
|
|
51707
51774
|
}
|
|
51708
|
-
|
|
51775
|
+
function swiftIcuAddress(icu) {
|
|
51776
|
+
return `${icu.sha256}.${SWIFT_ICU_PACKED}`;
|
|
51777
|
+
}
|
|
51778
|
+
function swiftIcuPacked(icu) {
|
|
51779
|
+
return memo(packedFiles, icu.sha256, async () => {
|
|
51780
|
+
const file = import_node_path39.default.join(
|
|
51781
|
+
import_node_os9.default.homedir(),
|
|
51782
|
+
".peach",
|
|
51783
|
+
"cache",
|
|
51784
|
+
"swift-brotli",
|
|
51785
|
+
swiftIcuAddress(icu)
|
|
51786
|
+
);
|
|
51787
|
+
if ((0, import_node_fs42.existsSync)(file)) return (0, import_promises4.readFile)(file);
|
|
51788
|
+
const packed = Buffer.from(
|
|
51789
|
+
swiftIcuPack(
|
|
51790
|
+
await inflateGzip(icu.gzip),
|
|
51791
|
+
(bytes) => (0, import_node_zlib2.deflateRawSync)(bytes, { level: 9 })
|
|
51792
|
+
)
|
|
51793
|
+
);
|
|
51794
|
+
await (0, import_promises4.mkdir)(import_node_path39.default.dirname(file), { recursive: true });
|
|
51795
|
+
const tmp = `${file}.${(0, import_node_crypto21.randomUUID)()}.tmp`;
|
|
51796
|
+
await (0, import_promises4.writeFile)(tmp, packed);
|
|
51797
|
+
await (0, import_promises4.rename)(tmp, file);
|
|
51798
|
+
return packed;
|
|
51799
|
+
});
|
|
51800
|
+
}
|
|
51801
|
+
async function swiftIcuBundleAsset(icu) {
|
|
51802
|
+
return {
|
|
51803
|
+
path: `__peach/swift-icu/${swiftIcuAddress(icu)}`,
|
|
51804
|
+
bytes: await swiftIcuPacked(icu),
|
|
51805
|
+
contentType: "application/octet-stream"
|
|
51806
|
+
};
|
|
51807
|
+
}
|
|
51808
|
+
var import_node_child_process26, import_node_crypto21, import_node_fs42, import_promises4, import_node_os9, import_node_path39, import_node_util7, import_node_zlib2, run6, deflate, compressBrotli, inflateGzip, ARCHIVE, MEMBER, raw, assets, brotliMemoryCache, packedFiles;
|
|
51709
51809
|
var init_swift_icu = __esm({
|
|
51710
51810
|
"src/swift-icu.ts"() {
|
|
51711
51811
|
"use strict";
|
|
@@ -51718,6 +51818,7 @@ var init_swift_icu = __esm({
|
|
|
51718
51818
|
import_node_path39 = __toESM(require("node:path"), 1);
|
|
51719
51819
|
import_node_util7 = require("node:util");
|
|
51720
51820
|
import_node_zlib2 = require("node:zlib");
|
|
51821
|
+
init_icuData();
|
|
51721
51822
|
init_swift_toolchain();
|
|
51722
51823
|
run6 = (0, import_node_util7.promisify)(import_node_child_process26.execFile);
|
|
51723
51824
|
deflate = (0, import_node_util7.promisify)(import_node_zlib2.gzip);
|
|
@@ -51728,6 +51829,7 @@ var init_swift_icu = __esm({
|
|
|
51728
51829
|
raw = /* @__PURE__ */ new Map();
|
|
51729
51830
|
assets = /* @__PURE__ */ new Map();
|
|
51730
51831
|
brotliMemoryCache = /* @__PURE__ */ new Map();
|
|
51832
|
+
packedFiles = /* @__PURE__ */ new Map();
|
|
51731
51833
|
}
|
|
51732
51834
|
});
|
|
51733
51835
|
|
|
@@ -56846,12 +56948,14 @@ var init_swift_compile = __esm({
|
|
|
56846
56948
|
"-Xlinker", "-lsetjmp",
|
|
56847
56949
|
"-Xlinker", "--export-table",
|
|
56848
56950
|
"-Xlinker", "--growable-table",
|
|
56951
|
+
"-Xlinker", "--wrap=swift_udata_open",
|
|
56952
|
+
"-Xlinker", "--wrap=swift_udata_openChoice",
|
|
56849
56953
|
`;
|
|
56850
56954
|
darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quoted, "-Wl,--end-lib"] : [];
|
|
56851
56955
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
56852
56956
|
MULTI_MANIFEST_VERSION = 66;
|
|
56853
56957
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
56854
|
-
compilerSourceDigest = true ? "
|
|
56958
|
+
compilerSourceDigest = true ? "d46232537a993bc7418818ab7d2dc159518328882280b8b4bfd459cffd910921" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
56855
56959
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
56856
56960
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
56857
56961
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
@@ -63126,7 +63230,7 @@ var init_swift_standin_digest = __esm({
|
|
|
63126
63230
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
63127
63231
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
63128
63232
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
63129
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
63233
|
+
STANDIN_SOURCE_DIGEST = true ? "2340b1684e4aa046dace7fdc861bb6a39fde0a6ee06003187e6af39416313d98" : standinSourceDigest();
|
|
63130
63234
|
}
|
|
63131
63235
|
});
|
|
63132
63236
|
|
|
@@ -63856,7 +63960,7 @@ var init_expo_native_prebuilt = __esm({
|
|
|
63856
63960
|
init_swift_native_pin();
|
|
63857
63961
|
init_xcode_project();
|
|
63858
63962
|
EXPO_NATIVE_ENTRY_NAME = "ios";
|
|
63859
|
-
EXPO_NATIVE_COMPILER_DIGEST = true ? "
|
|
63963
|
+
EXPO_NATIVE_COMPILER_DIGEST = true ? "4585315f71394b53ace3ffe5eaedd20a11f727ce4eaa50a1cbc934b5c7f189d1" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
63860
63964
|
IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
|
|
63861
63965
|
expoNativeEntryUrl = (key2, file) => `${NATIVE_PREBUILT_ORIGIN}/${nativeEntryPrefix("expo", EXPO_NATIVE_ENTRY_NAME, key2)}/${file}`;
|
|
63862
63966
|
isStringRecord = (value) => isRecord(value) && Object.values(value).every((item) => typeof item === "string");
|
|
@@ -73132,7 +73236,7 @@ function entryRootId(packagePath, file) {
|
|
|
73132
73236
|
return `${import_node_path76.default.basename(packagePath)}${import_node_path76.default.posix.sep}${relative5}`;
|
|
73133
73237
|
}
|
|
73134
73238
|
function icuUrl(origin, artifact) {
|
|
73135
|
-
return "url" in artifact.icu ? artifact.icu.url : `${origin}${ICU_PATH}${artifact.icu
|
|
73239
|
+
return "url" in artifact.icu ? artifact.icu.url : `${origin}${ICU_PATH}${swiftIcuAddress(artifact.icu)}`;
|
|
73136
73240
|
}
|
|
73137
73241
|
function standinLibraries(binaries, standins, rootDir, toolchain) {
|
|
73138
73242
|
const linked = /* @__PURE__ */ new Map();
|
|
@@ -73801,20 +73905,30 @@ async function serveSwiftPackageAsset(pathname, res) {
|
|
|
73801
73905
|
if (pathname.startsWith(ICU_PATH)) {
|
|
73802
73906
|
for (const project2 of projects().values()) {
|
|
73803
73907
|
const icu = project2.artifacts.find(
|
|
73804
|
-
(artifact) => "sha256" in artifact.icu && pathname === `${ICU_PATH}${artifact.icu
|
|
73908
|
+
(artifact) => "sha256" in artifact.icu && pathname === `${ICU_PATH}${swiftIcuAddress(artifact.icu)}`
|
|
73805
73909
|
)?.icu;
|
|
73806
|
-
if (!icu || "url" in icu
|
|
73910
|
+
if (!icu || "url" in icu) continue;
|
|
73911
|
+
const packed = await swiftIcuPacked(icu);
|
|
73807
73912
|
res.setHeader("access-control-allow-origin", "*");
|
|
73808
73913
|
res.setHeader("cache-control", "public, max-age=31536000, immutable");
|
|
73809
|
-
res.setHeader("
|
|
73810
|
-
|
|
73811
|
-
|
|
73812
|
-
|
|
73813
|
-
res.end(
|
|
73814
|
-
|
|
73815
|
-
res.setHeader("content-type", "application/gzip");
|
|
73816
|
-
res.end(icu.gzip);
|
|
73914
|
+
res.setHeader("content-type", "application/octet-stream");
|
|
73915
|
+
res.setHeader("accept-ranges", "bytes");
|
|
73916
|
+
const range2 = /^bytes=(\d+)-(\d+)$/.exec(res.req?.headers.range ?? "");
|
|
73917
|
+
if (!range2) {
|
|
73918
|
+
res.end(packed);
|
|
73919
|
+
return true;
|
|
73817
73920
|
}
|
|
73921
|
+
const start = Number(range2[1]);
|
|
73922
|
+
const end = Math.min(Number(range2[2]), packed.length - 1);
|
|
73923
|
+
if (start > end) {
|
|
73924
|
+
res.statusCode = 416;
|
|
73925
|
+
res.setHeader("content-range", `bytes */${packed.length}`);
|
|
73926
|
+
res.end();
|
|
73927
|
+
return true;
|
|
73928
|
+
}
|
|
73929
|
+
res.statusCode = 206;
|
|
73930
|
+
res.setHeader("content-range", `bytes ${start}-${end}/${packed.length}`);
|
|
73931
|
+
res.end(packed.subarray(start, end + 1));
|
|
73818
73932
|
return true;
|
|
73819
73933
|
}
|
|
73820
73934
|
res.statusCode = 404;
|
|
@@ -73842,7 +73956,7 @@ async function serveSwiftPackageAsset(pathname, res) {
|
|
|
73842
73956
|
res.end("swift artifact is stale");
|
|
73843
73957
|
return true;
|
|
73844
73958
|
}
|
|
73845
|
-
function swiftPackageAssets(packagePath, hash) {
|
|
73959
|
+
async function swiftPackageAssets(packagePath, hash) {
|
|
73846
73960
|
const project2 = projects().get(import_node_fs79.default.realpathSync(packagePath));
|
|
73847
73961
|
const artifact = project2?.artifacts.find((candidate) => candidate.hash === hash);
|
|
73848
73962
|
if (!project2 || !artifact) throw new Error(`Swift artifact ${hash} was not built`);
|
|
@@ -73854,11 +73968,10 @@ function swiftPackageAssets(packagePath, hash) {
|
|
|
73854
73968
|
]);
|
|
73855
73969
|
for (const [key2, resource] of project2.resourceFiles)
|
|
73856
73970
|
assets2.set(`${RESOURCE_PATH}${key2}`, resource);
|
|
73857
|
-
if ("sha256" in artifact.icu)
|
|
73858
|
-
|
|
73859
|
-
|
|
73860
|
-
|
|
73861
|
-
});
|
|
73971
|
+
if ("sha256" in artifact.icu) {
|
|
73972
|
+
const asset = await swiftIcuBundleAsset(artifact.icu);
|
|
73973
|
+
assets2.set(`/${asset.path}`, asset);
|
|
73974
|
+
}
|
|
73862
73975
|
return assets2;
|
|
73863
73976
|
}
|
|
73864
73977
|
function disposeSwiftProject(packagePath, signal) {
|
|
@@ -75257,6 +75370,24 @@ var init_podspec_sources = __esm({
|
|
|
75257
75370
|
helper,
|
|
75258
75371
|
node.args.map((arg) => this.ev(scope2, arg))
|
|
75259
75372
|
);
|
|
75373
|
+
if (node.name === "get_folly_config") {
|
|
75374
|
+
let root = import_node_path78.default.dirname(this.current);
|
|
75375
|
+
while (!import_node_fs81.default.existsSync(import_node_path78.default.join(root, "scripts/cocoapods/helpers.rb"))) {
|
|
75376
|
+
if (root === import_node_path78.default.dirname(root)) return this.fail("call to get_folly_config");
|
|
75377
|
+
root = import_node_path78.default.dirname(root);
|
|
75378
|
+
}
|
|
75379
|
+
const helpers = import_node_fs81.default.readFileSync(
|
|
75380
|
+
import_node_path78.default.join(root, "scripts/cocoapods/helpers.rb"),
|
|
75381
|
+
"utf8"
|
|
75382
|
+
);
|
|
75383
|
+
const version2 = /:version\s*=>\s*'([^']*)'/.exec(helpers)?.[1];
|
|
75384
|
+
const flags = /:compiler_flags\s*=>\s*'([^']*)'/.exec(helpers)?.[1];
|
|
75385
|
+
if (!version2 || !flags) return this.fail("get_folly_config");
|
|
75386
|
+
return /* @__PURE__ */ new Map([
|
|
75387
|
+
["version", version2],
|
|
75388
|
+
["compiler_flags", flags]
|
|
75389
|
+
]);
|
|
75390
|
+
}
|
|
75260
75391
|
return this.fail(`call to ${node.name}`);
|
|
75261
75392
|
}
|
|
75262
75393
|
case "bin": {
|
|
@@ -75886,7 +76017,13 @@ function installedFabricSources(reactNativeRoot, { legacyBridge = false, bridgeO
|
|
|
75886
76017
|
import_node_path79.default.basename(file, ".podspec")
|
|
75887
76018
|
)
|
|
75888
76019
|
);
|
|
75889
|
-
|
|
76020
|
+
const expected = [...bridgeOnly ? LEGACY_BRIDGE_PODS : RENDERER_PODS].filter(
|
|
76021
|
+
(name3) => !RENDERER_PODS_VERSIONED.has(name3)
|
|
76022
|
+
);
|
|
76023
|
+
const present = required.filter(
|
|
76024
|
+
(file) => !RENDERER_PODS_VERSIONED.has(import_node_path79.default.basename(file, ".podspec"))
|
|
76025
|
+
);
|
|
76026
|
+
if (present.length !== expected.length)
|
|
75890
76027
|
throw new Error(`${reactNativeRoot}: installed renderer podspecs are incomplete`);
|
|
75891
76028
|
return specs.map((file) => {
|
|
75892
76029
|
const directory2 = import_node_path79.default.dirname(file);
|
|
@@ -75987,7 +76124,6 @@ var init_turbo_codegen_intake = __esm({
|
|
|
75987
76124
|
"React-FabricComponents",
|
|
75988
76125
|
"React-FabricImage",
|
|
75989
76126
|
"React-RCTFabric",
|
|
75990
|
-
"React-RCTFBReactNativeSpec",
|
|
75991
76127
|
"React-graphics",
|
|
75992
76128
|
"React-rendererdebug",
|
|
75993
76129
|
"React-utils",
|
|
@@ -76000,13 +76136,15 @@ var init_turbo_codegen_intake = __esm({
|
|
|
76000
76136
|
"React-runtimescheduler",
|
|
76001
76137
|
"React-ImageManager",
|
|
76002
76138
|
"React-performancetimeline",
|
|
76003
|
-
"React-jsinspectortracing",
|
|
76004
76139
|
"React-jsinspector",
|
|
76005
76140
|
"React-cxxreact",
|
|
76006
76141
|
"React-jserrorhandler",
|
|
76007
76142
|
"Yoga"
|
|
76008
76143
|
]);
|
|
76009
76144
|
RENDERER_PODS_VERSIONED = /* @__PURE__ */ new Set([
|
|
76145
|
+
// added after react-native 0.75
|
|
76146
|
+
"React-RCTFBReactNativeSpec",
|
|
76147
|
+
"React-jsinspectortracing",
|
|
76010
76148
|
// missing in 0.78, present in 0.81
|
|
76011
76149
|
"React-renderercss",
|
|
76012
76150
|
"React-oscompat",
|
|
@@ -81812,7 +81950,7 @@ var init_nitro_superset = __esm({
|
|
|
81812
81950
|
init_swift_standin_digest();
|
|
81813
81951
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
81814
81952
|
packageVersion = (root) => JSON.parse((0, import_node_fs92.readFileSync)((0, import_node_path89.join)(root, "package.json"), "utf8")).version;
|
|
81815
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
81953
|
+
NITRO_COMPILER_DIGEST = true ? "c178e3c4c8465d4d358306448e5ae7cac0a7c25cfb0e1462fe3da02524653782" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
81816
81954
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
81817
81955
|
nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
|
|
81818
81956
|
published2 = /* @__PURE__ */ new Map();
|
|
@@ -81987,6 +82125,7 @@ var init_nitro_bundle = __esm({
|
|
|
81987
82125
|
init_nitro_superset();
|
|
81988
82126
|
init_swift_distribution();
|
|
81989
82127
|
init_swift_host();
|
|
82128
|
+
init_swift_icu();
|
|
81990
82129
|
NITRO_ROUTE = "/__peach/nitro";
|
|
81991
82130
|
handleNitroRequest = compiledModuleRequestHandler(
|
|
81992
82131
|
"Nitro",
|
|
@@ -118375,7 +118514,7 @@ async function prepareNativeInput(input, opts) {
|
|
|
118375
118514
|
const prepared = await prepareSwiftInput(input, opts);
|
|
118376
118515
|
try {
|
|
118377
118516
|
const built2 = await prepared.build(opts.origin);
|
|
118378
|
-
const assets2 = prepared.host.swiftPackageAssets(
|
|
118517
|
+
const assets2 = await prepared.host.swiftPackageAssets(
|
|
118379
118518
|
prepared.packagePath,
|
|
118380
118519
|
built2.metadata.hash
|
|
118381
118520
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1887 | (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;
|
|
@@ -62,9 +62,10 @@ __export(swift_compile_exports, {
|
|
|
62
62
|
swiftCompileSdkOptions: () => swiftCompileSdkOptions,
|
|
63
63
|
swiftCrossImportFlags: () => swiftCrossImportFlags,
|
|
64
64
|
swiftDistributionAt: () => swiftDistributionAt,
|
|
65
|
+
swiftIcuAddress: () => swiftIcuAddress,
|
|
65
66
|
swiftIcuAsset: () => swiftIcuAsset,
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
swiftIcuBundleAsset: () => swiftIcuBundleAsset,
|
|
68
|
+
swiftIcuPacked: () => swiftIcuPacked,
|
|
68
69
|
swiftImportNames: () => swiftImportNames,
|
|
69
70
|
swiftMacroPlugins: () => swiftMacroPlugins,
|
|
70
71
|
swiftModuleDigest: () => swiftModuleDigest,
|
|
@@ -10245,6 +10246,62 @@ var import_node_os6 = __toESM(require("node:os"), 1);
|
|
|
10245
10246
|
var import_node_path17 = __toESM(require("node:path"), 1);
|
|
10246
10247
|
var import_node_util = require("node:util");
|
|
10247
10248
|
var import_node_zlib = require("node:zlib");
|
|
10249
|
+
|
|
10250
|
+
// ../sootsim-swift/src/icuData.ts
|
|
10251
|
+
var PACK_BYTES = 64 * 1024;
|
|
10252
|
+
var MAGIC = 1430473040;
|
|
10253
|
+
var VERSION = 1;
|
|
10254
|
+
var SWIFT_ICU_PACKED = `picu${VERSION}`;
|
|
10255
|
+
function swiftIcuLayout(head, blobBytes) {
|
|
10256
|
+
const view = new DataView(head.buffer, head.byteOffset, head.byteLength);
|
|
10257
|
+
const toc = view.getUint16(0, true);
|
|
10258
|
+
if (head[2] !== 218 || head[3] !== 39)
|
|
10259
|
+
throw new Error("swift icu data has no icu header");
|
|
10260
|
+
const count = view.getUint32(toc, true);
|
|
10261
|
+
const names = [];
|
|
10262
|
+
const offsets = new Uint32Array(count + 1);
|
|
10263
|
+
const decoder = new TextDecoder("latin1");
|
|
10264
|
+
for (let index = 0; index < count; index++) {
|
|
10265
|
+
const name2 = toc + view.getUint32(toc + 4 + index * 8, true);
|
|
10266
|
+
offsets[index] = toc + view.getUint32(toc + 8 + index * 8, true);
|
|
10267
|
+
names.push(decoder.decode(head.subarray(name2, head.indexOf(0, name2))));
|
|
10268
|
+
}
|
|
10269
|
+
offsets[count] = blobBytes;
|
|
10270
|
+
const packOf = new Uint32Array(count);
|
|
10271
|
+
const packs = [];
|
|
10272
|
+
for (let index = 0; index < count; index++) {
|
|
10273
|
+
const last = packs[packs.length - 1];
|
|
10274
|
+
if (last && offsets[index + 1] - last[0] <= PACK_BYTES) last[1] = offsets[index + 1];
|
|
10275
|
+
else packs.push([offsets[index], offsets[index + 1]]);
|
|
10276
|
+
packOf[index] = packs.length - 1;
|
|
10277
|
+
}
|
|
10278
|
+
return { headBytes: offsets[0], names, packOf, packs };
|
|
10279
|
+
}
|
|
10280
|
+
function swiftIcuPack(blob, deflate2) {
|
|
10281
|
+
const layout2 = swiftIcuLayout(blob, blob.byteLength);
|
|
10282
|
+
const parts = [
|
|
10283
|
+
deflate2(blob.subarray(0, layout2.headBytes)),
|
|
10284
|
+
...layout2.packs.map(([start, end]) => deflate2(blob.subarray(start, end)))
|
|
10285
|
+
];
|
|
10286
|
+
const index = new DataView(new ArrayBuffer(16 + parts.length * 4));
|
|
10287
|
+
index.setUint32(0, MAGIC, true);
|
|
10288
|
+
index.setUint32(4, VERSION, true);
|
|
10289
|
+
index.setUint32(8, blob.byteLength, true);
|
|
10290
|
+
index.setUint32(12, layout2.packs.length, true);
|
|
10291
|
+
parts.forEach((part, at2) => index.setUint32(16 + at2 * 4, part.byteLength, true));
|
|
10292
|
+
const packed = new Uint8Array(
|
|
10293
|
+
index.byteLength + parts.reduce((total, part) => total + part.byteLength, 0)
|
|
10294
|
+
);
|
|
10295
|
+
packed.set(new Uint8Array(index.buffer));
|
|
10296
|
+
let at = index.byteLength;
|
|
10297
|
+
for (const part of parts) {
|
|
10298
|
+
packed.set(part, at);
|
|
10299
|
+
at += part.byteLength;
|
|
10300
|
+
}
|
|
10301
|
+
return packed;
|
|
10302
|
+
}
|
|
10303
|
+
|
|
10304
|
+
// src/swift-icu.ts
|
|
10248
10305
|
var run = (0, import_node_util.promisify)(import_node_child_process14.execFile);
|
|
10249
10306
|
var deflate = (0, import_node_util.promisify)(import_node_zlib.gzip);
|
|
10250
10307
|
var compressBrotli = (0, import_node_util.promisify)(import_node_zlib.brotliCompress);
|
|
@@ -10288,12 +10345,6 @@ function brotliCompressQ11(bytes, cacheKey) {
|
|
|
10288
10345
|
function brotliCompressQ4(bytes, cacheKey) {
|
|
10289
10346
|
return cachedBrotli(bytes, 4, cacheKey);
|
|
10290
10347
|
}
|
|
10291
|
-
async function swiftIcuBrotli(icu) {
|
|
10292
|
-
return brotliMemoryCache.get(`11:${icu.sha256}`) ?? brotliCompressQ11(await inflateGzip(icu.gzip), icu.sha256);
|
|
10293
|
-
}
|
|
10294
|
-
async function swiftIcuBrotliQ4(icu) {
|
|
10295
|
-
return brotliMemoryCache.get(`4:${icu.sha256}`) ?? brotliCompressQ4(await inflateGzip(icu.gzip), icu.sha256);
|
|
10296
|
-
}
|
|
10297
10348
|
async function memo(cache, key, load2) {
|
|
10298
10349
|
const cached = cache.get(key);
|
|
10299
10350
|
if (cached !== void 0) return cached;
|
|
@@ -10396,6 +10447,40 @@ function icuSegment(object3) {
|
|
|
10396
10447
|
throw new Error(`swift-icu: expected one icu data segment, found ${found.length}`);
|
|
10397
10448
|
return found[0];
|
|
10398
10449
|
}
|
|
10450
|
+
function swiftIcuAddress(icu) {
|
|
10451
|
+
return `${icu.sha256}.${SWIFT_ICU_PACKED}`;
|
|
10452
|
+
}
|
|
10453
|
+
var packedFiles = /* @__PURE__ */ new Map();
|
|
10454
|
+
function swiftIcuPacked(icu) {
|
|
10455
|
+
return memo(packedFiles, icu.sha256, async () => {
|
|
10456
|
+
const file = import_node_path17.default.join(
|
|
10457
|
+
import_node_os6.default.homedir(),
|
|
10458
|
+
".peach",
|
|
10459
|
+
"cache",
|
|
10460
|
+
"swift-brotli",
|
|
10461
|
+
swiftIcuAddress(icu)
|
|
10462
|
+
);
|
|
10463
|
+
if ((0, import_node_fs16.existsSync)(file)) return (0, import_promises3.readFile)(file);
|
|
10464
|
+
const packed = Buffer.from(
|
|
10465
|
+
swiftIcuPack(
|
|
10466
|
+
await inflateGzip(icu.gzip),
|
|
10467
|
+
(bytes) => (0, import_node_zlib.deflateRawSync)(bytes, { level: 9 })
|
|
10468
|
+
)
|
|
10469
|
+
);
|
|
10470
|
+
await (0, import_promises3.mkdir)(import_node_path17.default.dirname(file), { recursive: true });
|
|
10471
|
+
const tmp = `${file}.${(0, import_node_crypto10.randomUUID)()}.tmp`;
|
|
10472
|
+
await (0, import_promises3.writeFile)(tmp, packed);
|
|
10473
|
+
await (0, import_promises3.rename)(tmp, file);
|
|
10474
|
+
return packed;
|
|
10475
|
+
});
|
|
10476
|
+
}
|
|
10477
|
+
async function swiftIcuBundleAsset(icu) {
|
|
10478
|
+
return {
|
|
10479
|
+
path: `__peach/swift-icu/${swiftIcuAddress(icu)}`,
|
|
10480
|
+
bytes: await swiftIcuPacked(icu),
|
|
10481
|
+
contentType: "application/octet-stream"
|
|
10482
|
+
};
|
|
10483
|
+
}
|
|
10399
10484
|
|
|
10400
10485
|
// src/swift-link-roots.ts
|
|
10401
10486
|
var import_node_fs17 = __toESM(require("node:fs"), 1);
|
|
@@ -11977,12 +12062,14 @@ var executableLinkFlags = (root) => ` "-Xclang-linker", "-O0",
|
|
|
11977
12062
|
"-Xlinker", "-lsetjmp",
|
|
11978
12063
|
"-Xlinker", "--export-table",
|
|
11979
12064
|
"-Xlinker", "--growable-table",
|
|
12065
|
+
"-Xlinker", "--wrap=swift_udata_open",
|
|
12066
|
+
"-Xlinker", "--wrap=swift_udata_openChoice",
|
|
11980
12067
|
`;
|
|
11981
12068
|
var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quoted, "-Wl,--end-lib"] : [];
|
|
11982
12069
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
11983
12070
|
var MULTI_MANIFEST_VERSION = 66;
|
|
11984
12071
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
11985
|
-
var compilerSourceDigest = true ? "
|
|
12072
|
+
var compilerSourceDigest = true ? "d46232537a993bc7418818ab7d2dc159518328882280b8b4bfd459cffd910921" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
11986
12073
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
11987
12074
|
const hash = (0, import_node_crypto12.createHash)("sha256");
|
|
11988
12075
|
hash.update(`swift-compile
|
|
@@ -16358,9 +16445,10 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
16358
16445
|
swiftCompileSdkOptions,
|
|
16359
16446
|
swiftCrossImportFlags,
|
|
16360
16447
|
swiftDistributionAt,
|
|
16448
|
+
swiftIcuAddress,
|
|
16361
16449
|
swiftIcuAsset,
|
|
16362
|
-
|
|
16363
|
-
|
|
16450
|
+
swiftIcuBundleAsset,
|
|
16451
|
+
swiftIcuPacked,
|
|
16364
16452
|
swiftImportNames,
|
|
16365
16453
|
swiftMacroPlugins,
|
|
16366
16454
|
swiftModuleDigest,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1887 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/swift-compile.ts
|
|
4
4
|
import {
|
|
@@ -10195,7 +10195,69 @@ import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
|
10195
10195
|
import os3 from "node:os";
|
|
10196
10196
|
import path17 from "node:path";
|
|
10197
10197
|
import { promisify as promisify2 } from "node:util";
|
|
10198
|
-
import {
|
|
10198
|
+
import {
|
|
10199
|
+
brotliCompress,
|
|
10200
|
+
constants as zlibConstants,
|
|
10201
|
+
deflateRawSync,
|
|
10202
|
+
gunzip,
|
|
10203
|
+
gzip
|
|
10204
|
+
} from "node:zlib";
|
|
10205
|
+
|
|
10206
|
+
// ../sootsim-swift/src/icuData.ts
|
|
10207
|
+
var PACK_BYTES = 64 * 1024;
|
|
10208
|
+
var MAGIC = 1430473040;
|
|
10209
|
+
var VERSION = 1;
|
|
10210
|
+
var SWIFT_ICU_PACKED = `picu${VERSION}`;
|
|
10211
|
+
function swiftIcuLayout(head, blobBytes) {
|
|
10212
|
+
const view = new DataView(head.buffer, head.byteOffset, head.byteLength);
|
|
10213
|
+
const toc = view.getUint16(0, true);
|
|
10214
|
+
if (head[2] !== 218 || head[3] !== 39)
|
|
10215
|
+
throw new Error("swift icu data has no icu header");
|
|
10216
|
+
const count = view.getUint32(toc, true);
|
|
10217
|
+
const names = [];
|
|
10218
|
+
const offsets = new Uint32Array(count + 1);
|
|
10219
|
+
const decoder = new TextDecoder("latin1");
|
|
10220
|
+
for (let index = 0; index < count; index++) {
|
|
10221
|
+
const name2 = toc + view.getUint32(toc + 4 + index * 8, true);
|
|
10222
|
+
offsets[index] = toc + view.getUint32(toc + 8 + index * 8, true);
|
|
10223
|
+
names.push(decoder.decode(head.subarray(name2, head.indexOf(0, name2))));
|
|
10224
|
+
}
|
|
10225
|
+
offsets[count] = blobBytes;
|
|
10226
|
+
const packOf = new Uint32Array(count);
|
|
10227
|
+
const packs = [];
|
|
10228
|
+
for (let index = 0; index < count; index++) {
|
|
10229
|
+
const last = packs[packs.length - 1];
|
|
10230
|
+
if (last && offsets[index + 1] - last[0] <= PACK_BYTES) last[1] = offsets[index + 1];
|
|
10231
|
+
else packs.push([offsets[index], offsets[index + 1]]);
|
|
10232
|
+
packOf[index] = packs.length - 1;
|
|
10233
|
+
}
|
|
10234
|
+
return { headBytes: offsets[0], names, packOf, packs };
|
|
10235
|
+
}
|
|
10236
|
+
function swiftIcuPack(blob, deflate2) {
|
|
10237
|
+
const layout2 = swiftIcuLayout(blob, blob.byteLength);
|
|
10238
|
+
const parts = [
|
|
10239
|
+
deflate2(blob.subarray(0, layout2.headBytes)),
|
|
10240
|
+
...layout2.packs.map(([start, end]) => deflate2(blob.subarray(start, end)))
|
|
10241
|
+
];
|
|
10242
|
+
const index = new DataView(new ArrayBuffer(16 + parts.length * 4));
|
|
10243
|
+
index.setUint32(0, MAGIC, true);
|
|
10244
|
+
index.setUint32(4, VERSION, true);
|
|
10245
|
+
index.setUint32(8, blob.byteLength, true);
|
|
10246
|
+
index.setUint32(12, layout2.packs.length, true);
|
|
10247
|
+
parts.forEach((part, at2) => index.setUint32(16 + at2 * 4, part.byteLength, true));
|
|
10248
|
+
const packed = new Uint8Array(
|
|
10249
|
+
index.byteLength + parts.reduce((total, part) => total + part.byteLength, 0)
|
|
10250
|
+
);
|
|
10251
|
+
packed.set(new Uint8Array(index.buffer));
|
|
10252
|
+
let at = index.byteLength;
|
|
10253
|
+
for (const part of parts) {
|
|
10254
|
+
packed.set(part, at);
|
|
10255
|
+
at += part.byteLength;
|
|
10256
|
+
}
|
|
10257
|
+
return packed;
|
|
10258
|
+
}
|
|
10259
|
+
|
|
10260
|
+
// src/swift-icu.ts
|
|
10199
10261
|
var run = promisify2(execFile2);
|
|
10200
10262
|
var deflate = promisify2(gzip);
|
|
10201
10263
|
var compressBrotli = promisify2(brotliCompress);
|
|
@@ -10239,12 +10301,6 @@ function brotliCompressQ11(bytes, cacheKey) {
|
|
|
10239
10301
|
function brotliCompressQ4(bytes, cacheKey) {
|
|
10240
10302
|
return cachedBrotli(bytes, 4, cacheKey);
|
|
10241
10303
|
}
|
|
10242
|
-
async function swiftIcuBrotli(icu) {
|
|
10243
|
-
return brotliMemoryCache.get(`11:${icu.sha256}`) ?? brotliCompressQ11(await inflateGzip(icu.gzip), icu.sha256);
|
|
10244
|
-
}
|
|
10245
|
-
async function swiftIcuBrotliQ4(icu) {
|
|
10246
|
-
return brotliMemoryCache.get(`4:${icu.sha256}`) ?? brotliCompressQ4(await inflateGzip(icu.gzip), icu.sha256);
|
|
10247
|
-
}
|
|
10248
10304
|
async function memo(cache, key, load2) {
|
|
10249
10305
|
const cached = cache.get(key);
|
|
10250
10306
|
if (cached !== void 0) return cached;
|
|
@@ -10347,6 +10403,40 @@ function icuSegment(object3) {
|
|
|
10347
10403
|
throw new Error(`swift-icu: expected one icu data segment, found ${found.length}`);
|
|
10348
10404
|
return found[0];
|
|
10349
10405
|
}
|
|
10406
|
+
function swiftIcuAddress(icu) {
|
|
10407
|
+
return `${icu.sha256}.${SWIFT_ICU_PACKED}`;
|
|
10408
|
+
}
|
|
10409
|
+
var packedFiles = /* @__PURE__ */ new Map();
|
|
10410
|
+
function swiftIcuPacked(icu) {
|
|
10411
|
+
return memo(packedFiles, icu.sha256, async () => {
|
|
10412
|
+
const file = path17.join(
|
|
10413
|
+
os3.homedir(),
|
|
10414
|
+
".peach",
|
|
10415
|
+
"cache",
|
|
10416
|
+
"swift-brotli",
|
|
10417
|
+
swiftIcuAddress(icu)
|
|
10418
|
+
);
|
|
10419
|
+
if (existsSync(file)) return readFile(file);
|
|
10420
|
+
const packed = Buffer.from(
|
|
10421
|
+
swiftIcuPack(
|
|
10422
|
+
await inflateGzip(icu.gzip),
|
|
10423
|
+
(bytes) => deflateRawSync(bytes, { level: 9 })
|
|
10424
|
+
)
|
|
10425
|
+
);
|
|
10426
|
+
await mkdir(path17.dirname(file), { recursive: true });
|
|
10427
|
+
const tmp = `${file}.${randomUUID2()}.tmp`;
|
|
10428
|
+
await writeFile(tmp, packed);
|
|
10429
|
+
await rename(tmp, file);
|
|
10430
|
+
return packed;
|
|
10431
|
+
});
|
|
10432
|
+
}
|
|
10433
|
+
async function swiftIcuBundleAsset(icu) {
|
|
10434
|
+
return {
|
|
10435
|
+
path: `__peach/swift-icu/${swiftIcuAddress(icu)}`,
|
|
10436
|
+
bytes: await swiftIcuPacked(icu),
|
|
10437
|
+
contentType: "application/octet-stream"
|
|
10438
|
+
};
|
|
10439
|
+
}
|
|
10350
10440
|
|
|
10351
10441
|
// src/swift-link-roots.ts
|
|
10352
10442
|
import fs6 from "node:fs";
|
|
@@ -11949,12 +12039,14 @@ var executableLinkFlags = (root) => ` "-Xclang-linker", "-O0",
|
|
|
11949
12039
|
"-Xlinker", "-lsetjmp",
|
|
11950
12040
|
"-Xlinker", "--export-table",
|
|
11951
12041
|
"-Xlinker", "--growable-table",
|
|
12042
|
+
"-Xlinker", "--wrap=swift_udata_open",
|
|
12043
|
+
"-Xlinker", "--wrap=swift_udata_openChoice",
|
|
11952
12044
|
`;
|
|
11953
12045
|
var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quoted, "-Wl,--end-lib"] : [];
|
|
11954
12046
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
11955
12047
|
var MULTI_MANIFEST_VERSION = 66;
|
|
11956
12048
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
11957
|
-
var compilerSourceDigest = true ? "
|
|
12049
|
+
var compilerSourceDigest = true ? "d46232537a993bc7418818ab7d2dc159518328882280b8b4bfd459cffd910921" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
11958
12050
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
11959
12051
|
const hash = createHash13("sha256");
|
|
11960
12052
|
hash.update(`swift-compile
|
|
@@ -16329,9 +16421,10 @@ export {
|
|
|
16329
16421
|
swiftCompileSdkOptions,
|
|
16330
16422
|
swiftCrossImportFlags,
|
|
16331
16423
|
swiftDistributionAt,
|
|
16424
|
+
swiftIcuAddress,
|
|
16332
16425
|
swiftIcuAsset,
|
|
16333
|
-
|
|
16334
|
-
|
|
16426
|
+
swiftIcuBundleAsset,
|
|
16427
|
+
swiftIcuPacked,
|
|
16335
16428
|
swiftImportNames,
|
|
16336
16429
|
swiftMacroPlugins,
|
|
16337
16430
|
swiftModuleDigest,
|