peachsim 0.1.2679 → 0.1.2680
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/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 +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +740 -162
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-KT4EYLSJ.mjs → acorn-KFRNGPIS.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-BHQ3JLKY.mjs → chunk-2DSJ4Y2B.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-FLEDVCBF.mjs → chunk-54DXR7XC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4MQNNSXS.mjs → chunk-5ZUDE2OE.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-22IVJ37E.mjs → chunk-63IRSGUP.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WSX6WDGU.mjs → chunk-6FMJ3RGV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HSSAEZKK.mjs → chunk-AKMQQCL4.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-I77TXXX6.mjs → chunk-BRJ7ARFB.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BMPYVWFP.mjs → chunk-BZZUMB6S.mjs} +8 -7
- package/dist-lib/esm-chunks/{chunk-TJ5Y26RK.mjs → chunk-D7K24QPS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YGGXAYBE.mjs → chunk-HTM32XYI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4QDKSAM6.mjs → chunk-I567ROA6.mjs} +16 -16
- package/dist-lib/esm-chunks/{chunk-7VK6K2OI.mjs → chunk-ISLJJHL6.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JK6VGS54.mjs → chunk-MA526IJY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-DPFS4TZQ.mjs → chunk-NDNSEMKC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WLJU7OX2.mjs → chunk-RXNQMOOQ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-M4IBIRSF.mjs → chunk-S2R5CB3W.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4X7TCSFW.mjs → chunk-SAKCEYPB.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-XA22MMUJ.mjs → chunk-SZLZ7MYO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4ZQP7VPQ.mjs → chunk-TTFIUXYS.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-AIMGU6I4.mjs → chunk-UASVIFF4.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-UOT25QCP.mjs → chunk-UTPHWDOY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FA5V3ZBF.mjs → chunk-X6TNJRLY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-DGARJVZC.mjs → chunk-YIBGV5BP.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4T5622XC.mjs → chunk-YOSTYBQ5.mjs} +3 -3
- package/dist-lib/esm-chunks/{metro-layout-parser-NZ5LDDDY.mjs → metro-layout-parser-6ETCKA7E.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-YUCWJYTO.mjs → swift-package-prebuilt-GTSH3CYC.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-AJD2DGDE.mjs → swift-sdk-app-module-PUPJSKNY.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-7SWUP4QR.mjs → swift-sdk-image-YPS6TJTZ.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-RISXYQ6A.mjs → swift-sdk-image-producer-5NMRH53W.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +5235 -923
- package/dist-lib/expo-swift-metadata.cjs +2 -2
- package/dist-lib/expo-swift-metadata.mjs +8 -8
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +97 -38
- package/dist-lib/host/fetch-proxy-handler.cjs +7 -7
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +15 -15
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +85 -85
- package/dist-lib/public-origins-lib.json +75 -65
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- 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 +8 -8
- package/dist-lib/skills.cjs +98 -38
- package/dist-lib/swift-compile.cjs +5 -4
- package/dist-lib/swift-compile.mjs +12 -12
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/dist-types/packages/peach-engine/src/engine/native-image-pipeline.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/webgpu-frame-transaction.d.ts +2 -1
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/expo-swift-bundle.ts +2 -7
- package/src/expo-swift-host.ts +20 -3
- package/src/expoSwiftContract.ts +9 -0
- package/src/native-bundles.ts +6 -0
- package/src/nitro-bundle.ts +5 -2
- package/src/swift-compile.ts +1 -1
- package/src/swift-host.ts +16 -0
- package/src/swift-sdk-surface.ts +3 -4
- package/src/turbo-source.ts +61 -43
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2680 | (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;
|
|
@@ -1297,7 +1297,7 @@ var init_src = __esm({
|
|
|
1297
1297
|
var runtime_companion_default;
|
|
1298
1298
|
var init_runtime_companion = __esm({
|
|
1299
1299
|
"runtime-companion.json"() {
|
|
1300
|
-
runtime_companion_default = { abi: 1, sha256: "
|
|
1300
|
+
runtime_companion_default = { abi: 1, sha256: "daf162d4a4e16da33424ba3f1895db477c3561a9d74f1f77b381d8f6af391475", file: "node/cli-daf162d4a4e16da33424ba3f1895db477c3561a9d74f1f77b381d8f6af391475.cjs" };
|
|
1301
1301
|
}
|
|
1302
1302
|
});
|
|
1303
1303
|
|
|
@@ -5534,7 +5534,7 @@ function isExpoSwiftCompilationResult(value) {
|
|
|
5534
5534
|
if (value.bridgeModules !== void 0 && (!strings(value.bridgeModules) || !value.bridgeModules.every((name3) => remaining.has(name3))))
|
|
5535
5535
|
return false;
|
|
5536
5536
|
for (const artifact of value.modules) {
|
|
5537
|
-
if (!isRecord(artifact) || !strings(artifact.namespaces) || artifact.namespaces.length === 0 || !artifact.namespaces.every((namespace) => remaining.delete(namespace)) || typeof artifact.url !== "string" || typeof artifact.hash !== "string" || typeof artifact.icuUrl !== "string" || typeof artifact.rootId !== "string" || artifact.bundleFiles !== void 0 && (!isRecord(artifact.bundleFiles) || !Object.entries(artifact.bundleFiles).every(
|
|
5537
|
+
if (!isRecord(artifact) || !strings(artifact.namespaces) || artifact.namespaces.length === 0 || !artifact.namespaces.every((namespace) => remaining.delete(namespace)) || typeof artifact.url !== "string" || !(artifact.sdkUrl === void 0 && artifact.sdkBindingUrl === void 0 || typeof artifact.sdkUrl === "string" && artifact.sdkUrl.length > 0 && typeof artifact.sdkBindingUrl === "string" && artifact.sdkBindingUrl.length > 0) || typeof artifact.hash !== "string" || typeof artifact.icuUrl !== "string" || typeof artifact.rootId !== "string" || artifact.bundleFiles !== void 0 && (!isRecord(artifact.bundleFiles) || !Object.entries(artifact.bundleFiles).every(
|
|
5538
5538
|
([key2, bytes]) => isSwiftResourcePath(key2) && typeof bytes === "string"
|
|
5539
5539
|
)))
|
|
5540
5540
|
return false;
|
|
@@ -10091,7 +10091,7 @@ var init_swift_objc_sdk_tree = __esm({
|
|
|
10091
10091
|
|
|
10092
10092
|
// src/swift-compiler-digest.ts
|
|
10093
10093
|
function swiftArchiveCompilerDigestValue() {
|
|
10094
|
-
return true ? "
|
|
10094
|
+
return true ? "7ec504e1047ea0f31b14e25b8958c42fd1e55cb9c121db3f05e4dead6ef226eb" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname, "archive");
|
|
10095
10095
|
}
|
|
10096
10096
|
var import_node_crypto9, import_node_fs20, import_node_path16, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
|
|
10097
10097
|
var init_swift_compiler_digest = __esm({
|
|
@@ -20320,7 +20320,7 @@ var init_swift_guest_archive = __esm({
|
|
|
20320
20320
|
});
|
|
20321
20321
|
|
|
20322
20322
|
// ../peach-kit/src/nativeWasmContract.ts
|
|
20323
|
-
var NATIVE_IMAGE_SECTION, NATIVE_TABLE_ABI, NATIVE_TABLE_IMPORT_MODULE, NATIVE_DYLD_FUNCTION_IMPORT, NATIVE_DYLD_PLACE_EXPORT, NATIVE_LAZY_IMPORT_MODULE, NATIVE_SDK_IMPORT_MODULE, NATIVE_SDK_THUNK_SECTION, NATIVE_LAZY_SLOT_IMPORT, NATIVE_LAZY_DIGEST_BYTES, NATIVE_LAZY_PART_BYTES, NATIVE_TABLE_RESERVE_SLOTS;
|
|
20323
|
+
var NATIVE_IMAGE_SECTION, NATIVE_TABLE_ABI, NATIVE_TABLE_IMPORT_MODULE, NATIVE_DYLD_FUNCTION_IMPORT, NATIVE_DYLD_PLACE_EXPORT, NATIVE_LAZY_IMPORT_MODULE, NATIVE_SDK_IMPORT_MODULE, NATIVE_SDK_THUNK_SECTION, NATIVE_LAZY_SLOT_IMPORT, NATIVE_LAZY_SECTION, NATIVE_LAZY_DIGEST_BYTES, NATIVE_LAZY_PART_BYTES, NATIVE_TABLE_RESERVE_SLOTS;
|
|
20324
20324
|
var init_nativeWasmContract = __esm({
|
|
20325
20325
|
"../peach-kit/src/nativeWasmContract.ts"() {
|
|
20326
20326
|
"use strict";
|
|
@@ -20333,6 +20333,7 @@ var init_nativeWasmContract = __esm({
|
|
|
20333
20333
|
NATIVE_SDK_IMPORT_MODULE = "peach_sdk";
|
|
20334
20334
|
NATIVE_SDK_THUNK_SECTION = "peach.sdk-thunks";
|
|
20335
20335
|
NATIVE_LAZY_SLOT_IMPORT = "load_slot";
|
|
20336
|
+
NATIVE_LAZY_SECTION = "peach.lazy-code-v2";
|
|
20336
20337
|
NATIVE_LAZY_DIGEST_BYTES = 32;
|
|
20337
20338
|
NATIVE_LAZY_PART_BYTES = NATIVE_LAZY_DIGEST_BYTES + 4;
|
|
20338
20339
|
NATIVE_TABLE_RESERVE_SLOTS = 4096;
|
|
@@ -28329,7 +28330,8 @@ function swiftBuildJobs() {
|
|
|
28329
28330
|
const cores = Math.min(admittedCores, parallelism);
|
|
28330
28331
|
if (process.platform === "darwin") return cores;
|
|
28331
28332
|
const memory = process.env.TM_EXEC_ADMITTED === "1" && process.env.LINUX_BUILD_SCOPE ? Number(process.env.TM_EXEC_LINUX_MEMORY_MAX) : NaN;
|
|
28332
|
-
const
|
|
28333
|
+
const effectiveMemory = Number.isSafeInteger(memory) && memory > 0 ? memory : import_node_os8.default.totalmem();
|
|
28334
|
+
const memoryJobs = Math.max(1, Math.floor(effectiveMemory / (2 * 1024 ** 3)));
|
|
28333
28335
|
return Math.min(cores, memoryJobs);
|
|
28334
28336
|
}
|
|
28335
28337
|
function swiftDistributionAt(root) {
|
|
@@ -32080,6 +32082,37 @@ function nativeSdkDataLength(bytes, start = 0) {
|
|
|
32080
32082
|
if (at > bytes.byteLength) throw new Error("Swift SDK data range exceeds its section");
|
|
32081
32083
|
return at - start;
|
|
32082
32084
|
}
|
|
32085
|
+
function encodeNativeSdkLater(later) {
|
|
32086
|
+
const { files: files2, needs = [] } = later;
|
|
32087
|
+
if (!files2.length || files2.length > 255)
|
|
32088
|
+
throw new Error("Swift SDK later data needs one to 255 files");
|
|
32089
|
+
const bytes = new Uint8Array(
|
|
32090
|
+
8 + files2.length * (LATER_DIGEST_BYTES + 4) + needs.reduce((sum, part) => sum + 1 + part.length, 0)
|
|
32091
|
+
);
|
|
32092
|
+
const view = new DataView(bytes.buffer);
|
|
32093
|
+
view.setUint32(0, files2.length, true);
|
|
32094
|
+
let at = 4;
|
|
32095
|
+
for (const { sha256: sha2565, byteLength } of files2) {
|
|
32096
|
+
if (!/^[a-f0-9]{64}$/.test(sha2565))
|
|
32097
|
+
throw new Error("Swift SDK later data needs a sha256 digest");
|
|
32098
|
+
if (!byteLength) throw new Error("Swift SDK later data file is empty");
|
|
32099
|
+
for (let i = 0; i < LATER_DIGEST_BYTES; i++)
|
|
32100
|
+
bytes[at + i] = Number.parseInt(sha2565.slice(i * 2, i * 2 + 2), 16);
|
|
32101
|
+
view.setUint32(at + LATER_DIGEST_BYTES, byteLength, true);
|
|
32102
|
+
at += LATER_DIGEST_BYTES + 4;
|
|
32103
|
+
}
|
|
32104
|
+
view.setUint32(at, needs.length, true);
|
|
32105
|
+
at += 4;
|
|
32106
|
+
for (const part of needs) {
|
|
32107
|
+
bytes[at++] = part.length;
|
|
32108
|
+
for (const file of part) {
|
|
32109
|
+
if (file >= files2.length)
|
|
32110
|
+
throw new Error("Swift SDK later need names a missing file");
|
|
32111
|
+
bytes[at++] = file;
|
|
32112
|
+
}
|
|
32113
|
+
}
|
|
32114
|
+
return bytes;
|
|
32115
|
+
}
|
|
32083
32116
|
function decodeNativeSdkLater(trailer) {
|
|
32084
32117
|
const view = new DataView(trailer.buffer, trailer.byteOffset, trailer.byteLength);
|
|
32085
32118
|
const truncated = () => new Error("Swift SDK binding later data is truncated");
|
|
@@ -33377,7 +33410,7 @@ function selectSwiftSdkData(sdk2, usage, linkage, projection) {
|
|
|
33377
33410
|
}
|
|
33378
33411
|
for (const piece of pieces) if (piece.object.startsWith("<")) live.add(piece);
|
|
33379
33412
|
const sorted2 = [...pieces].sort((a, b) => a.address - b.address);
|
|
33380
|
-
const
|
|
33413
|
+
const pieceAt2 = (address2) => {
|
|
33381
33414
|
let lo = 0;
|
|
33382
33415
|
let hi = sorted2.length - 1;
|
|
33383
33416
|
while (lo <= hi) {
|
|
@@ -33391,7 +33424,7 @@ function selectSwiftSdkData(sdk2, usage, linkage, projection) {
|
|
|
33391
33424
|
};
|
|
33392
33425
|
const dataQueue = [...live];
|
|
33393
33426
|
const visit3 = (address2) => {
|
|
33394
|
-
const piece =
|
|
33427
|
+
const piece = pieceAt2(address2);
|
|
33395
33428
|
if (piece && !live.has(piece)) {
|
|
33396
33429
|
live.add(piece);
|
|
33397
33430
|
dataQueue.push(piece);
|
|
@@ -33484,7 +33517,7 @@ function selectSwiftSdkData(sdk2, usage, linkage, projection) {
|
|
|
33484
33517
|
if (!sdkConstructorIds.has(id) || name3 !== ".L.swift.objc.register" && !name3.startsWith(".L.swift.objc.register."))
|
|
33485
33518
|
return;
|
|
33486
33519
|
for (let i = edgeStarts[index]; i < edgeStarts[index + 1]; i++) {
|
|
33487
|
-
const piece =
|
|
33520
|
+
const piece = pieceAt2(functionEdges[i]);
|
|
33488
33521
|
if (!piece?.symbols.some((name4) => {
|
|
33489
33522
|
const symbol2 = metadataName(name4);
|
|
33490
33523
|
return symbol2.startsWith("._OBJC_CLASS_") || symbol2.startsWith("$s") && (symbol2.endsWith("CN") || symbol2.endsWith("CMn"));
|
|
@@ -33554,9 +33587,9 @@ function selectSwiftSdkData(sdk2, usage, linkage, projection) {
|
|
|
33554
33587
|
classes.data.byteLength
|
|
33555
33588
|
);
|
|
33556
33589
|
for (let at2 = 0; at2 + 8 <= view2.byteLength; at2 += 8) {
|
|
33557
|
-
const target =
|
|
33590
|
+
const target = pieceAt2(Number(view2.getBigUint64(at2, true)));
|
|
33558
33591
|
if (!target || !live.has(target)) continue;
|
|
33559
|
-
const registration =
|
|
33592
|
+
const registration = pieceAt2(classes.address + at2);
|
|
33560
33593
|
if (registration) live.add(registration);
|
|
33561
33594
|
}
|
|
33562
33595
|
}
|
|
@@ -35784,7 +35817,7 @@ async function runCompiler(command, args, options2, stream = false, quiet) {
|
|
|
35784
35817
|
}
|
|
35785
35818
|
}
|
|
35786
35819
|
function swiftCompilerJobs() {
|
|
35787
|
-
return Math.min(
|
|
35820
|
+
return Math.min(64, swiftBuildJobs(), Math.max(1, Math.floor(import_node_os14.default.totalmem() / 2 ** 31)));
|
|
35788
35821
|
}
|
|
35789
35822
|
function swiftCompilerBaseEnv(toolchainBin, sourceEnv, includePeachHome = false) {
|
|
35790
35823
|
const env = {};
|
|
@@ -41418,7 +41451,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
|
|
|
41418
41451
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
41419
41452
|
MULTI_MANIFEST_VERSION = 76;
|
|
41420
41453
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
41421
|
-
compilerSourceDigest = true ? "
|
|
41454
|
+
compilerSourceDigest = true ? "229f789297c5cb8e33a042e23ad3c1df20450a712a02dd0b50d2e78bc8ed3de6" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
41422
41455
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
41423
41456
|
MODULE_MAP_RESPONSE_FILE_RUN = 16;
|
|
41424
41457
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
@@ -87461,7 +87494,7 @@ var init_swift_standin_digest = __esm({
|
|
|
87461
87494
|
];
|
|
87462
87495
|
RUNTIME_IMPORT = /(?:^|[;\n])[ \t]*(?:import|export)\s+(?!type(?:\s|\{))([\s\S]*?)\s+from\s*['"]([^'"]+)['"]|(?:^|[;\n])[ \t]*import\s+['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
87463
87496
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES);
|
|
87464
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
87497
|
+
STANDIN_SOURCE_DIGEST = true ? "4289873bce1ce2ab2636a7dfd38503815524abc6fd13e3bb62739b7395f65b20" : standinSourceDigest();
|
|
87465
87498
|
}
|
|
87466
87499
|
});
|
|
87467
87500
|
|
|
@@ -95411,6 +95444,476 @@ var init_swift_standin_config = __esm({
|
|
|
95411
95444
|
}
|
|
95412
95445
|
});
|
|
95413
95446
|
|
|
95447
|
+
// src/swift-sdk-later-data.ts
|
|
95448
|
+
var swift_sdk_later_data_exports = {};
|
|
95449
|
+
__export(swift_sdk_later_data_exports, {
|
|
95450
|
+
fetchSwiftSdkDataPlan: () => fetchSwiftSdkDataPlan,
|
|
95451
|
+
splitSwiftSdkLaterData: () => splitSwiftSdkLaterData,
|
|
95452
|
+
swiftSdkDeferredDataPlan: () => swiftSdkDeferredDataPlan
|
|
95453
|
+
});
|
|
95454
|
+
function addressImmediates(bytes) {
|
|
95455
|
+
const out = [];
|
|
95456
|
+
let at = 0;
|
|
95457
|
+
const u = () => {
|
|
95458
|
+
let value = 0;
|
|
95459
|
+
for (let shift = 0; ; shift += 7) {
|
|
95460
|
+
const byte = bytes[at++];
|
|
95461
|
+
if (shift < 53) value += (byte & 127) * 2 ** shift;
|
|
95462
|
+
if (!(byte & 128)) return value;
|
|
95463
|
+
}
|
|
95464
|
+
};
|
|
95465
|
+
const skip = () => {
|
|
95466
|
+
while (bytes[at++] & 128) ;
|
|
95467
|
+
};
|
|
95468
|
+
const address = (bits) => {
|
|
95469
|
+
let lo = 0;
|
|
95470
|
+
let hi = 0;
|
|
95471
|
+
let shift = 0;
|
|
95472
|
+
let byte = 0;
|
|
95473
|
+
do {
|
|
95474
|
+
byte = bytes[at++];
|
|
95475
|
+
const chunk = byte & 127;
|
|
95476
|
+
if (shift < 28) lo |= chunk << shift;
|
|
95477
|
+
else if (shift === 28) {
|
|
95478
|
+
lo |= (chunk & 15) << 28;
|
|
95479
|
+
hi |= chunk >>> 4;
|
|
95480
|
+
} else if (shift < 63) hi |= chunk << shift - 32;
|
|
95481
|
+
else hi |= (chunk & 1) << 31;
|
|
95482
|
+
shift += 7;
|
|
95483
|
+
} while (byte & 128);
|
|
95484
|
+
const negative = (byte & 64) !== 0;
|
|
95485
|
+
if (negative && shift < 64) {
|
|
95486
|
+
if (shift < 32) {
|
|
95487
|
+
lo |= ~0 << shift;
|
|
95488
|
+
hi = ~0;
|
|
95489
|
+
} else hi |= ~0 << shift - 32;
|
|
95490
|
+
}
|
|
95491
|
+
const uLo = lo >>> 0;
|
|
95492
|
+
const uHi = hi >>> 0;
|
|
95493
|
+
if (bits === 32 || uHi === 0 || uHi === 2147483648) out.push(uLo);
|
|
95494
|
+
};
|
|
95495
|
+
const memarg = () => {
|
|
95496
|
+
if (u() & 64) skip();
|
|
95497
|
+
const offset = u();
|
|
95498
|
+
if (offset && offset < 2 ** 32) out.push(offset);
|
|
95499
|
+
};
|
|
95500
|
+
const expression = (end) => {
|
|
95501
|
+
while (at < end) {
|
|
95502
|
+
const op = bytes[at++];
|
|
95503
|
+
if (op === 65) address(32);
|
|
95504
|
+
else if (op === 66) address(64);
|
|
95505
|
+
else if (op >= 40 && op <= 62) memarg();
|
|
95506
|
+
else if (op <= 1 || op === 5 || op === 10 || op === 11 || op === 15 || op === 25 || op === 26 || op === 27 || op >= 69 && op <= 196 || op === 209 || op === 211 || op === 212)
|
|
95507
|
+
continue;
|
|
95508
|
+
else if (op >= 2 && op <= 4 || op >= 6 && op <= 9 || op === 12 || op === 13 || op === 16 || op === 18 || op === 20 || op === 21 || op === 24 || op >= 32 && op <= 38 || op === 63 || op === 64 || op === 208 || op === 210 || op === 213 || op === 214)
|
|
95509
|
+
skip();
|
|
95510
|
+
else if (op === 14) for (let n = u() + 1; n > 0; n--) skip();
|
|
95511
|
+
else if (op === 17 || op === 19) {
|
|
95512
|
+
skip();
|
|
95513
|
+
skip();
|
|
95514
|
+
} else if (op === 28) for (let n = u(); n > 0; n--) skip();
|
|
95515
|
+
else if (op === 31) {
|
|
95516
|
+
skip();
|
|
95517
|
+
for (let n = u(); n > 0; n--) {
|
|
95518
|
+
if (bytes[at++] < 2) skip();
|
|
95519
|
+
skip();
|
|
95520
|
+
}
|
|
95521
|
+
} else if (op === 67) at += 4;
|
|
95522
|
+
else if (op === 68) at += 8;
|
|
95523
|
+
else if (op === 252) {
|
|
95524
|
+
const sub = u();
|
|
95525
|
+
if (sub === 8 || sub === 10 || sub === 12 || sub === 14) {
|
|
95526
|
+
skip();
|
|
95527
|
+
skip();
|
|
95528
|
+
} else if (sub > 7 && sub <= 17) skip();
|
|
95529
|
+
else if (sub > 17) throw new Error(`sdk code has unknown instruction 0xfc ${sub}`);
|
|
95530
|
+
} else if (op === 253) {
|
|
95531
|
+
const sub = u();
|
|
95532
|
+
if (sub <= 11 || sub === 92 || sub === 93) memarg();
|
|
95533
|
+
else if (sub === 12 || sub === 13) at += 16;
|
|
95534
|
+
else if (sub >= 21 && sub <= 34) at++;
|
|
95535
|
+
else if (sub >= 84 && sub <= 91) {
|
|
95536
|
+
memarg();
|
|
95537
|
+
at++;
|
|
95538
|
+
}
|
|
95539
|
+
} else if (op === 254) {
|
|
95540
|
+
if (u() === 3) at++;
|
|
95541
|
+
else memarg();
|
|
95542
|
+
} else throw new Error(`sdk code has unknown instruction ${op.toString(16)}`);
|
|
95543
|
+
}
|
|
95544
|
+
};
|
|
95545
|
+
for (const section2 of wasmSections2(bytes)) {
|
|
95546
|
+
at = section2.start;
|
|
95547
|
+
if (section2.id === 6)
|
|
95548
|
+
for (let n = u(); n > 0; n--) {
|
|
95549
|
+
at += 2;
|
|
95550
|
+
const start = at;
|
|
95551
|
+
while (bytes[at] !== 11) {
|
|
95552
|
+
const op = bytes[at++];
|
|
95553
|
+
if (op === 65) address(32);
|
|
95554
|
+
else if (op === 66) address(64);
|
|
95555
|
+
else if (op === 35 || op === 208 || op === 210) skip();
|
|
95556
|
+
else if (op === 67) at += 4;
|
|
95557
|
+
else if (op === 68) at += 8;
|
|
95558
|
+
else if (!(op >= 106 && op <= 108) && !(op >= 124 && op <= 126))
|
|
95559
|
+
throw new Error(`sdk global initializer at ${start} has opcode ${op}`);
|
|
95560
|
+
}
|
|
95561
|
+
at++;
|
|
95562
|
+
}
|
|
95563
|
+
else if (section2.id === 10)
|
|
95564
|
+
for (let n = u(); n > 0; n--) {
|
|
95565
|
+
const end = u() + at;
|
|
95566
|
+
for (let locals = u(); locals > 0; locals--) {
|
|
95567
|
+
skip();
|
|
95568
|
+
if (bytes[at++] >= 99 && bytes[at - 1] <= 100) skip();
|
|
95569
|
+
}
|
|
95570
|
+
expression(end);
|
|
95571
|
+
at = end;
|
|
95572
|
+
}
|
|
95573
|
+
}
|
|
95574
|
+
return out;
|
|
95575
|
+
}
|
|
95576
|
+
function readSdkPieces(directory2) {
|
|
95577
|
+
const cached2 = sdkPieces.get(directory2);
|
|
95578
|
+
if (cached2) return cached2;
|
|
95579
|
+
const { manifest, block: block2 } = readSwiftSdkManifest({ directory: directory2 });
|
|
95580
|
+
const fields = block2("pieces");
|
|
95581
|
+
const order = [];
|
|
95582
|
+
for (let i = 0; i < fields.length; i += SWIFT_SDK_PIECE_FIELDS)
|
|
95583
|
+
if (fields[i + 1] > 0) order.push(i);
|
|
95584
|
+
order.sort((a, b) => fields[a] - fields[b]);
|
|
95585
|
+
const starts = new Uint32Array(order.length);
|
|
95586
|
+
const ends = new Uint32Array(order.length);
|
|
95587
|
+
const walked = new Uint8Array(order.length);
|
|
95588
|
+
const identifier3 = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
95589
|
+
order.forEach((field, index) => {
|
|
95590
|
+
starts[index] = fields[field];
|
|
95591
|
+
ends[index] = fields[field] + fields[field + 1];
|
|
95592
|
+
const segment3 = manifest.segments[fields[field + 2]]?.name;
|
|
95593
|
+
if (segment3 && identifier3.test(segment3)) walked[index] = 1;
|
|
95594
|
+
});
|
|
95595
|
+
const edges = block2("dataEdges");
|
|
95596
|
+
const edgeSources = new Uint32Array(edges.length / 2);
|
|
95597
|
+
const edgeTargets = new Uint32Array(edges.length / 2);
|
|
95598
|
+
for (let i = 0; i < edgeSources.length; i++) {
|
|
95599
|
+
edgeSources[i] = edges[i * 2];
|
|
95600
|
+
edgeTargets[i] = edges[i * 2 + 1];
|
|
95601
|
+
}
|
|
95602
|
+
const recordSymbol = manifest.strings.indexOf("__peach_sdk_records");
|
|
95603
|
+
const recordIndex = recordSymbol < 0 ? -1 : block2("pieceSymbols").indexOf(recordSymbol);
|
|
95604
|
+
const records = order.find(
|
|
95605
|
+
(field) => fields[field + 5] <= recordIndex && recordIndex < fields[field + 5] + fields[field + 6]
|
|
95606
|
+
);
|
|
95607
|
+
const result = {
|
|
95608
|
+
starts,
|
|
95609
|
+
ends,
|
|
95610
|
+
walked,
|
|
95611
|
+
swiftRecordsAddress: records === void 0 ? void 0 : fields[records],
|
|
95612
|
+
edgeSources,
|
|
95613
|
+
edgeTargets,
|
|
95614
|
+
functionSlots: block2("functionSlots").slice(),
|
|
95615
|
+
functionEdgeStarts: block2("functionEdgeStarts").slice(),
|
|
95616
|
+
functionEdges: block2("functionEdges").slice(),
|
|
95617
|
+
functionCallStarts: block2("functionCallStarts").slice(),
|
|
95618
|
+
functionCalls: block2("functionCalls").slice()
|
|
95619
|
+
};
|
|
95620
|
+
sdkPieces.set(directory2, result);
|
|
95621
|
+
return result;
|
|
95622
|
+
}
|
|
95623
|
+
function closeOverData(pieces, reached, seeds) {
|
|
95624
|
+
const pending2 = [];
|
|
95625
|
+
for (const piece of seeds) {
|
|
95626
|
+
if (!reached[piece]) {
|
|
95627
|
+
reached[piece] = 1;
|
|
95628
|
+
pending2.push(piece);
|
|
95629
|
+
}
|
|
95630
|
+
}
|
|
95631
|
+
while (pending2.length) {
|
|
95632
|
+
const piece = pending2.pop();
|
|
95633
|
+
const end = pieces.ends[piece];
|
|
95634
|
+
for (let edge = firstAtOrAfter(pieces.edgeSources, pieces.starts[piece]); edge < pieces.edgeSources.length && pieces.edgeSources[edge] < end; edge++) {
|
|
95635
|
+
const target = pieceAt(pieces, pieces.edgeTargets[edge]);
|
|
95636
|
+
if (target >= 0 && !reached[target]) {
|
|
95637
|
+
reached[target] = 1;
|
|
95638
|
+
pending2.push(target);
|
|
95639
|
+
}
|
|
95640
|
+
}
|
|
95641
|
+
}
|
|
95642
|
+
}
|
|
95643
|
+
function reachedFrom(pieces, modules) {
|
|
95644
|
+
const seeds = [];
|
|
95645
|
+
for (const module2 of modules)
|
|
95646
|
+
for (const value of addressImmediates(module2)) {
|
|
95647
|
+
for (let piece = Math.max(0, firstAtOrAfter(pieces.ends, value - ADDRESS_REACH + 1)); piece < pieces.starts.length && pieces.starts[piece] <= value + ADDRESS_REACH; piece++)
|
|
95648
|
+
seeds.push(piece);
|
|
95649
|
+
}
|
|
95650
|
+
const reached = new Uint8Array(pieces.starts.length);
|
|
95651
|
+
closeOverData(pieces, reached, seeds);
|
|
95652
|
+
return reached;
|
|
95653
|
+
}
|
|
95654
|
+
function eagerLinkReferences(pieces, inventory) {
|
|
95655
|
+
const slots = new DataView(inventory.buffer, inventory.byteOffset, inventory.length);
|
|
95656
|
+
const slotOffset = 4 + slots.getUint32(0, true) * NATIVE_LAZY_PART_BYTES;
|
|
95657
|
+
const {
|
|
95658
|
+
functionSlots,
|
|
95659
|
+
functionEdgeStarts,
|
|
95660
|
+
functionEdges,
|
|
95661
|
+
functionCallStarts,
|
|
95662
|
+
functionCalls
|
|
95663
|
+
} = pieces;
|
|
95664
|
+
const deferred = (index) => {
|
|
95665
|
+
const slot = functionSlots[index];
|
|
95666
|
+
if (!slot) return false;
|
|
95667
|
+
const at = slotOffset + slot * 2;
|
|
95668
|
+
return at + 2 <= slots.byteLength && slots.getUint16(at, true) !== 0;
|
|
95669
|
+
};
|
|
95670
|
+
const seen = new Uint8Array(functionSlots.length);
|
|
95671
|
+
const pending2 = [];
|
|
95672
|
+
const visit3 = (index) => {
|
|
95673
|
+
if (seen[index] || deferred(index)) return;
|
|
95674
|
+
seen[index] = 1;
|
|
95675
|
+
pending2.push(index);
|
|
95676
|
+
};
|
|
95677
|
+
for (let index = 0; index < functionSlots.length; index++) visit3(index);
|
|
95678
|
+
const references = [];
|
|
95679
|
+
while (pending2.length) {
|
|
95680
|
+
const index = pending2.pop();
|
|
95681
|
+
for (let i = functionCallStarts[index]; i < functionCallStarts[index + 1]; i++)
|
|
95682
|
+
visit3(functionCalls[i]);
|
|
95683
|
+
for (let i = functionEdgeStarts[index]; i < functionEdgeStarts[index + 1]; i++) {
|
|
95684
|
+
const piece = pieceAt(pieces, functionEdges[i]);
|
|
95685
|
+
if (piece >= 0) references.push(piece);
|
|
95686
|
+
}
|
|
95687
|
+
}
|
|
95688
|
+
return references;
|
|
95689
|
+
}
|
|
95690
|
+
function swiftSdkDeferredDataPlan(directory2, primary, parts) {
|
|
95691
|
+
const pieces = readSdkPieces(directory2);
|
|
95692
|
+
const inventory = readWasmCustomSection(primary, NATIVE_LAZY_SECTION);
|
|
95693
|
+
if (!inventory) return Buffer.alloc(pieces.starts.length);
|
|
95694
|
+
const eager = reachedFrom(pieces, [primary]);
|
|
95695
|
+
closeOverData(pieces, eager, eagerLinkReferences(pieces, inventory));
|
|
95696
|
+
const reaches = Array.from(parts, (part) => reachedFrom(pieces, [part]));
|
|
95697
|
+
const owner = new Int32Array(pieces.starts.length).fill(-1);
|
|
95698
|
+
const owned = new Float64Array(reaches.length);
|
|
95699
|
+
for (const [part, reached] of reaches.entries())
|
|
95700
|
+
for (let piece = 0; piece < reached.length; piece++)
|
|
95701
|
+
if (reached[piece] && !eager[piece] && owner[piece] < 0) {
|
|
95702
|
+
owner[piece] = part;
|
|
95703
|
+
owned[part] += pieces.ends[piece] - pieces.starts[piece];
|
|
95704
|
+
}
|
|
95705
|
+
const total = owned.reduce((sum, bytes) => sum + bytes, 0);
|
|
95706
|
+
const target = Math.max(LATER_GROUP_BYTES, total / (MAX_LATER_GROUPS - 1));
|
|
95707
|
+
const groupOf = new Uint8Array(reaches.length);
|
|
95708
|
+
let group = 0;
|
|
95709
|
+
let filled = 0;
|
|
95710
|
+
for (let part = 0; part < reaches.length; part++) {
|
|
95711
|
+
groupOf[part] = group;
|
|
95712
|
+
filled += owned[part];
|
|
95713
|
+
if (filled >= target) {
|
|
95714
|
+
group++;
|
|
95715
|
+
filled = 0;
|
|
95716
|
+
}
|
|
95717
|
+
}
|
|
95718
|
+
const groups = Buffer.alloc(pieces.starts.length);
|
|
95719
|
+
for (let piece = 0; piece < owner.length; piece++)
|
|
95720
|
+
if (owner[piece] >= 0) groups[piece] = groupOf[owner[piece]] + 1;
|
|
95721
|
+
const needs = reaches.map((reached) => {
|
|
95722
|
+
const set2 = /* @__PURE__ */ new Set();
|
|
95723
|
+
for (let piece = 0; piece < reached.length; piece++)
|
|
95724
|
+
if (reached[piece] && owner[piece] >= 0) set2.add(groupOf[owner[piece]]);
|
|
95725
|
+
return [...set2].sort((a, b) => a - b);
|
|
95726
|
+
});
|
|
95727
|
+
const appendix = Buffer.alloc(4 + needs.reduce((sum, list2) => sum + 1 + list2.length, 0));
|
|
95728
|
+
appendix.writeUInt32LE(needs.length, 0);
|
|
95729
|
+
let at = 4;
|
|
95730
|
+
for (const list2 of needs) {
|
|
95731
|
+
appendix[at++] = list2.length;
|
|
95732
|
+
for (const need of list2) appendix[at++] = need;
|
|
95733
|
+
}
|
|
95734
|
+
return Buffer.concat([groups, appendix]);
|
|
95735
|
+
}
|
|
95736
|
+
function readSwiftSdkDataPlan(plan, pieceCount) {
|
|
95737
|
+
if (plan.length < pieceCount)
|
|
95738
|
+
throw new Error("Swift SDK data plan does not match its layout");
|
|
95739
|
+
const groups = plan.subarray(0, pieceCount);
|
|
95740
|
+
if (plan.length === pieceCount) return { groups };
|
|
95741
|
+
const view = new DataView(plan.buffer, plan.byteOffset, plan.byteLength);
|
|
95742
|
+
if (plan.length < pieceCount + 4) throw new Error("Swift SDK data plan is truncated");
|
|
95743
|
+
let at = pieceCount + 4;
|
|
95744
|
+
const needs = [];
|
|
95745
|
+
for (let part = view.getUint32(pieceCount, true); part > 0; part--) {
|
|
95746
|
+
const n = plan[at++];
|
|
95747
|
+
if (n === void 0 || at + n > plan.length)
|
|
95748
|
+
throw new Error("Swift SDK data plan is truncated");
|
|
95749
|
+
needs.push(Array.from(plan.subarray(at, at + n)));
|
|
95750
|
+
at += n;
|
|
95751
|
+
}
|
|
95752
|
+
if (at !== plan.length) throw new Error("Swift SDK data plan has trailing bytes");
|
|
95753
|
+
return { groups, needs };
|
|
95754
|
+
}
|
|
95755
|
+
function fetchSwiftSdkDataPlan({ url, dataPlan }) {
|
|
95756
|
+
if (!dataPlan) return void 0;
|
|
95757
|
+
let pending2 = publishedPlans.get(dataPlan);
|
|
95758
|
+
if (!pending2) {
|
|
95759
|
+
const address = new URL(dataPlan, url);
|
|
95760
|
+
pending2 = fetch(address).then(async (response) => {
|
|
95761
|
+
if (!response.ok)
|
|
95762
|
+
throw new Error(`Swift SDK data plan ${address} answered ${response.status}`);
|
|
95763
|
+
const bytes = Buffer.from(await response.arrayBuffer());
|
|
95764
|
+
if ((0, import_node_crypto69.createHash)("sha256").update(bytes).digest("hex") !== dataPlan)
|
|
95765
|
+
throw new Error(`Swift SDK data plan ${address} failed its digest check`);
|
|
95766
|
+
return bytes;
|
|
95767
|
+
});
|
|
95768
|
+
pending2.catch(() => publishedPlans.delete(dataPlan));
|
|
95769
|
+
publishedPlans.set(dataPlan, pending2);
|
|
95770
|
+
}
|
|
95771
|
+
return pending2;
|
|
95772
|
+
}
|
|
95773
|
+
function splitSwiftSdkLaterData(directory2, binding, plan) {
|
|
95774
|
+
const decoded = decodeNativeSdkBinding(
|
|
95775
|
+
binding.buffer.slice(binding.byteOffset, binding.byteOffset + binding.byteLength)
|
|
95776
|
+
);
|
|
95777
|
+
if (decoded.later) throw new Error("Swift SDK binding already names later data");
|
|
95778
|
+
const pieces = readSdkPieces(directory2);
|
|
95779
|
+
const { groups, needs } = readSwiftSdkDataPlan(plan, pieces.starts.length);
|
|
95780
|
+
if (!groups.some((group) => group > 0)) return { binding, later: [] };
|
|
95781
|
+
const eager = new Uint8Array(groups.length);
|
|
95782
|
+
const data = decoded.sdkData;
|
|
95783
|
+
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
95784
|
+
const runs = [];
|
|
95785
|
+
for (let at = 4, count = view.getUint32(0, true); count > 0; count--) {
|
|
95786
|
+
const length = view.getUint32(at + 8, true);
|
|
95787
|
+
runs.push({
|
|
95788
|
+
address: Number(view.getBigUint64(at, true)),
|
|
95789
|
+
bytes: data.subarray(at + 12, at + 12 + length)
|
|
95790
|
+
});
|
|
95791
|
+
at += 12 + length;
|
|
95792
|
+
}
|
|
95793
|
+
const seeds = [];
|
|
95794
|
+
const seed = (address) => {
|
|
95795
|
+
const piece = pieceAt(pieces, address);
|
|
95796
|
+
if (piece >= 0) seeds.push(piece);
|
|
95797
|
+
};
|
|
95798
|
+
for (const value of decoded.values)
|
|
95799
|
+
if (value >= 0n && value < 2n ** 32n) seed(Number(value));
|
|
95800
|
+
for (let i = 0; i < decoded.memory.length; i += 3) seed(decoded.memory[i]);
|
|
95801
|
+
for (const { address, bytes } of runs) {
|
|
95802
|
+
if (address === pieces.swiftRecordsAddress) {
|
|
95803
|
+
seed(address);
|
|
95804
|
+
const records = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
95805
|
+
for (let offset = 9 * 4; offset < records.byteLength; offset += 4)
|
|
95806
|
+
seed((records.getUint32(offset, true) & ~3) >>> 0);
|
|
95807
|
+
}
|
|
95808
|
+
for (let piece = firstAtOrAfter(pieces.ends, address + 1); piece < pieces.starts.length && pieces.starts[piece] < address + bytes.length; piece++)
|
|
95809
|
+
if (pieces.walked[piece] || !groups[piece]) seeds.push(piece);
|
|
95810
|
+
}
|
|
95811
|
+
closeOverData(pieces, eager, seeds);
|
|
95812
|
+
const now = [];
|
|
95813
|
+
const deferred = /* @__PURE__ */ new Map();
|
|
95814
|
+
for (const { address, bytes } of runs) {
|
|
95815
|
+
let start = 0;
|
|
95816
|
+
let deferring = 0;
|
|
95817
|
+
const flush = (end) => {
|
|
95818
|
+
if (end > start) {
|
|
95819
|
+
const run16 = { address: address + start, bytes: bytes.subarray(start, end) };
|
|
95820
|
+
if (!deferring) now.push(run16);
|
|
95821
|
+
else {
|
|
95822
|
+
const list2 = deferred.get(deferring);
|
|
95823
|
+
if (list2) list2.push(run16);
|
|
95824
|
+
else deferred.set(deferring, [run16]);
|
|
95825
|
+
}
|
|
95826
|
+
}
|
|
95827
|
+
start = end;
|
|
95828
|
+
};
|
|
95829
|
+
let offset = 0;
|
|
95830
|
+
while (offset < bytes.length) {
|
|
95831
|
+
const piece = pieceAt(pieces, address + offset);
|
|
95832
|
+
const end = piece < 0 ? Math.min(
|
|
95833
|
+
bytes.length,
|
|
95834
|
+
(pieces.starts[firstAtOrAfter(pieces.starts, address + offset)] ?? address + bytes.length) - address
|
|
95835
|
+
) : Math.min(bytes.length, pieces.ends[piece] - address);
|
|
95836
|
+
const deferrable = piece >= 0 && !eager[piece] ? groups[piece] : 0;
|
|
95837
|
+
if (deferrable !== deferring) {
|
|
95838
|
+
flush(offset);
|
|
95839
|
+
deferring = deferrable;
|
|
95840
|
+
}
|
|
95841
|
+
offset = end;
|
|
95842
|
+
}
|
|
95843
|
+
flush(bytes.length);
|
|
95844
|
+
}
|
|
95845
|
+
if (!deferred.size) return { binding, later: [] };
|
|
95846
|
+
const encode = (list2) => {
|
|
95847
|
+
const out = Buffer.alloc(
|
|
95848
|
+
4 + list2.reduce((sum, run16) => sum + 12 + run16.bytes.length, 0)
|
|
95849
|
+
);
|
|
95850
|
+
out.writeUInt32LE(list2.length, 0);
|
|
95851
|
+
let at = 4;
|
|
95852
|
+
for (const run16 of list2) {
|
|
95853
|
+
out.writeBigUInt64LE(BigInt(run16.address), at);
|
|
95854
|
+
out.writeUInt32LE(run16.bytes.length, at + 8);
|
|
95855
|
+
out.set(run16.bytes, at + 12);
|
|
95856
|
+
at += 12 + run16.bytes.length;
|
|
95857
|
+
}
|
|
95858
|
+
return out;
|
|
95859
|
+
};
|
|
95860
|
+
const order = [...deferred.keys()].sort((a, b) => a - b);
|
|
95861
|
+
const later = order.map((group) => encode(deferred.get(group)));
|
|
95862
|
+
const fileOf = new Map(order.map((group, file) => [group - 1, file]));
|
|
95863
|
+
return {
|
|
95864
|
+
binding: Buffer.concat([
|
|
95865
|
+
binding.subarray(0, data.byteOffset),
|
|
95866
|
+
encode(now),
|
|
95867
|
+
encodeNativeSdkLater({
|
|
95868
|
+
files: later.map((bytes) => ({
|
|
95869
|
+
sha256: (0, import_node_crypto69.createHash)("sha256").update(bytes).digest("hex"),
|
|
95870
|
+
byteLength: bytes.length
|
|
95871
|
+
})),
|
|
95872
|
+
...needs && {
|
|
95873
|
+
needs: needs.map(
|
|
95874
|
+
(list2) => list2.flatMap((group) => {
|
|
95875
|
+
const file = fileOf.get(group);
|
|
95876
|
+
return file === void 0 ? [] : [file];
|
|
95877
|
+
})
|
|
95878
|
+
)
|
|
95879
|
+
}
|
|
95880
|
+
})
|
|
95881
|
+
]),
|
|
95882
|
+
later
|
|
95883
|
+
};
|
|
95884
|
+
}
|
|
95885
|
+
var import_node_crypto69, ADDRESS_REACH, sdkPieces, firstAtOrAfter, pieceAt, LATER_GROUP_BYTES, MAX_LATER_GROUPS, publishedPlans;
|
|
95886
|
+
var init_swift_sdk_later_data = __esm({
|
|
95887
|
+
"src/swift-sdk-later-data.ts"() {
|
|
95888
|
+
"use strict";
|
|
95889
|
+
import_node_crypto69 = require("node:crypto");
|
|
95890
|
+
init_nativeSdkBindingContract();
|
|
95891
|
+
init_nativeWasmContract();
|
|
95892
|
+
init_swift_sdk_image();
|
|
95893
|
+
init_wasm_binary_sections();
|
|
95894
|
+
init_wasm_narrow_boundary();
|
|
95895
|
+
ADDRESS_REACH = 64;
|
|
95896
|
+
sdkPieces = /* @__PURE__ */ new Map();
|
|
95897
|
+
firstAtOrAfter = (sorted2, value) => {
|
|
95898
|
+
let low = 0;
|
|
95899
|
+
let high = sorted2.length;
|
|
95900
|
+
while (low < high) {
|
|
95901
|
+
const middle = low + high >>> 1;
|
|
95902
|
+
if (sorted2[middle] < value) low = middle + 1;
|
|
95903
|
+
else high = middle;
|
|
95904
|
+
}
|
|
95905
|
+
return low;
|
|
95906
|
+
};
|
|
95907
|
+
pieceAt = ({ starts, ends }, address) => {
|
|
95908
|
+
const index = firstAtOrAfter(starts, address + 1) - 1;
|
|
95909
|
+
return index >= 0 && address < ends[index] ? index : -1;
|
|
95910
|
+
};
|
|
95911
|
+
LATER_GROUP_BYTES = 16 * 1024;
|
|
95912
|
+
MAX_LATER_GROUPS = 255;
|
|
95913
|
+
publishedPlans = /* @__PURE__ */ new Map();
|
|
95914
|
+
}
|
|
95915
|
+
});
|
|
95916
|
+
|
|
95414
95917
|
// src/swift-host.ts
|
|
95415
95918
|
function swiftPackageId(packagePath) {
|
|
95416
95919
|
return import_node_path116.default.basename(packagePath).replace(/[^A-Za-z0-9_]/g, "_").replace(/^(\d)/, "_$1");
|
|
@@ -95435,7 +95938,7 @@ function nativeSourceDescriptor(packagePath) {
|
|
|
95435
95938
|
function swiftArtifactContentDigest(bytes) {
|
|
95436
95939
|
let digest3 = swiftArtifactDigests.get(bytes);
|
|
95437
95940
|
if (!digest3) {
|
|
95438
|
-
digest3 = (0,
|
|
95941
|
+
digest3 = (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex");
|
|
95439
95942
|
swiftArtifactDigests.set(bytes, digest3);
|
|
95440
95943
|
}
|
|
95441
95944
|
return digest3;
|
|
@@ -95563,7 +96066,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
|
|
|
95563
96066
|
const clang = import_node_path116.default.join(toolchainBin, "clang");
|
|
95564
96067
|
const empty = (binary2, file) => {
|
|
95565
96068
|
const source = import_node_path116.default.join(binary2.dir, file);
|
|
95566
|
-
const key2 = (0,
|
|
96069
|
+
const key2 = (0, import_node_crypto70.createHash)("sha256").update(
|
|
95567
96070
|
JSON.stringify([
|
|
95568
96071
|
clang,
|
|
95569
96072
|
sdk2.sysroot,
|
|
@@ -95608,7 +96111,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
|
|
|
95608
96111
|
return new Set(portable.flat());
|
|
95609
96112
|
}
|
|
95610
96113
|
async function swiftPackages(entry, app) {
|
|
95611
|
-
const stamp = (file) => import_node_fs114.default.existsSync(file) ? (0,
|
|
96114
|
+
const stamp = (file) => import_node_fs114.default.existsSync(file) ? (0, import_node_crypto70.createHash)("sha256").update(import_node_fs114.default.readFileSync(file)).digest("hex") : null;
|
|
95612
96115
|
const owners = [...app.frameworks, app].map((target) => ({
|
|
95613
96116
|
module: target.moduleName,
|
|
95614
96117
|
products: target.packageProducts ?? []
|
|
@@ -96777,7 +97280,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
|
|
|
96777
97280
|
const source = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(
|
|
96778
97281
|
bytes
|
|
96779
97282
|
);
|
|
96780
|
-
const sha2565 = (0,
|
|
97283
|
+
const sha2565 = (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex");
|
|
96781
97284
|
const bundle = swiftResourceBundleForFile(bundles, key2);
|
|
96782
97285
|
if (!bundle && inputs2["Package.swift"])
|
|
96783
97286
|
throw new Error(`metal source ${key2} has no resource target bundle`);
|
|
@@ -96800,7 +97303,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
|
|
|
96800
97303
|
const bytes = readPackageFile2(project2.packagePath, disk, limits.imageBytes);
|
|
96801
97304
|
pdfs.set(file, {
|
|
96802
97305
|
file: disk,
|
|
96803
|
-
sha256: (0,
|
|
97306
|
+
sha256: (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex")
|
|
96804
97307
|
});
|
|
96805
97308
|
}
|
|
96806
97309
|
const pdfRasters = rasterizePdfFiles([...pdfs.values()], limits);
|
|
@@ -96846,7 +97349,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
|
|
|
96846
97349
|
throw new Error("swift image pack exceeds the compile service caps");
|
|
96847
97350
|
}
|
|
96848
97351
|
imageBytes += bytes.length;
|
|
96849
|
-
const hash = (0,
|
|
97352
|
+
const hash = (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex").slice(0, 16);
|
|
96850
97353
|
const bundle = table[bundlePath] ?? /* @__PURE__ */ Object.create(null);
|
|
96851
97354
|
const pixelSize = ext === ".png" ? readPngDimensions(bytes) : null;
|
|
96852
97355
|
const variant2 = {
|
|
@@ -97153,7 +97656,7 @@ function updateSwiftConfigStamp(hash, packagePath) {
|
|
|
97153
97656
|
hash.update(JSON.stringify(gates.map((name3) => swiftWasm64PlatformGates[name3])));
|
|
97154
97657
|
}
|
|
97155
97658
|
function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
|
|
97156
|
-
const hash = (0,
|
|
97659
|
+
const hash = (0, import_node_crypto70.createHash)("sha256");
|
|
97157
97660
|
hash.update(packagePath);
|
|
97158
97661
|
updateSwiftConfigStamp(hash, packagePath);
|
|
97159
97662
|
const libraries = projects().get(packagePath)?.libraries;
|
|
@@ -97182,7 +97685,7 @@ function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
|
|
|
97182
97685
|
return hash.digest("hex").slice(0, 16);
|
|
97183
97686
|
}
|
|
97184
97687
|
function sourceContentStamp(packagePath, moduleRootOverride) {
|
|
97185
|
-
const hash = (0,
|
|
97688
|
+
const hash = (0, import_node_crypto70.createHash)("sha256");
|
|
97186
97689
|
hash.update(compilerSourceDigest);
|
|
97187
97690
|
updateSwiftConfigStamp(hash, packagePath);
|
|
97188
97691
|
const libraries = projects().get(packagePath)?.libraries;
|
|
@@ -97214,7 +97717,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
|
|
|
97214
97717
|
(root) => import_node_fs114.default.existsSync(import_node_path116.default.join(root, "toolchain.json"))
|
|
97215
97718
|
);
|
|
97216
97719
|
if (!moduleRoot) return "";
|
|
97217
|
-
const hash = (0,
|
|
97720
|
+
const hash = (0, import_node_crypto70.createHash)("sha256");
|
|
97218
97721
|
hash.update(moduleRoot);
|
|
97219
97722
|
for (const relative4 of swiftModuleInputFiles(moduleRoot)) {
|
|
97220
97723
|
hash.update(relative4);
|
|
@@ -97224,7 +97727,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
|
|
|
97224
97727
|
}
|
|
97225
97728
|
function otherInputs(input, standalone) {
|
|
97226
97729
|
const { files: _files, ...rest } = input;
|
|
97227
|
-
return (0,
|
|
97730
|
+
return (0, import_node_crypto70.createHash)("sha256").update(JSON.stringify({ ...rest, standalone })).digest("hex");
|
|
97228
97731
|
}
|
|
97229
97732
|
function icuUrl(origin, artifact) {
|
|
97230
97733
|
return "url" in artifact.icu ? artifact.icu.url : `${origin}${ICU_PATH}${swiftIcuAddress(artifact.icu)}`;
|
|
@@ -97239,7 +97742,7 @@ function standinLibraries(binaries, standins, rootDir, toolchain, rustWasm64) {
|
|
|
97239
97742
|
for (const standin of standins) {
|
|
97240
97743
|
if (!standin.prebuilt) continue;
|
|
97241
97744
|
const bytes = Buffer.from(standin.prebuilt.library, "base64");
|
|
97242
|
-
const digest3 = (0,
|
|
97745
|
+
const digest3 = (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex");
|
|
97243
97746
|
const dir = import_node_path116.default.join(swiftCacheDir(), "native-archives", digest3);
|
|
97244
97747
|
import_node_fs114.default.mkdirSync(dir, { recursive: true });
|
|
97245
97748
|
const library = import_node_path116.default.join(dir, `lib${standin.module}.a`);
|
|
@@ -97588,7 +98091,7 @@ function swiftBuildRoot(packagePath, moduleRoot) {
|
|
|
97588
98091
|
return import_node_path116.default.join(
|
|
97589
98092
|
swiftCacheDir(),
|
|
97590
98093
|
"swift-builds",
|
|
97591
|
-
(0,
|
|
98094
|
+
(0, import_node_crypto70.createHash)("sha256").update(`${compilerKey}\0${buildKeyPath}`).digest("hex").slice(0, 16)
|
|
97592
98095
|
);
|
|
97593
98096
|
}
|
|
97594
98097
|
function installedWorkspaceInput(packagePath, entry, moduleRoot) {
|
|
@@ -97890,7 +98393,7 @@ async function fetchSwiftDyldTable(moduleUrl, module2, signal) {
|
|
|
97890
98393
|
const response = await fetch(url, { signal });
|
|
97891
98394
|
if (!response.ok) throw new Error(`swift compile: ${url} answered ${response.status}`);
|
|
97892
98395
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
97893
|
-
if (bytes.length !== byteLength || (0,
|
|
98396
|
+
if (bytes.length !== byteLength || (0, import_node_crypto70.createHash)("sha256").update(bytes).digest("hex") !== sha2565)
|
|
97894
98397
|
throw new Error(`swift compile: ${url} does not match its module's index`);
|
|
97895
98398
|
return { dyldTable: { sha256: sha2565, bytes } };
|
|
97896
98399
|
}
|
|
@@ -97964,6 +98467,24 @@ function scopedArtifact(project2, entry, moduleRoot, signal) {
|
|
|
97964
98467
|
project2.building = { stamp, promise: fresh, signal };
|
|
97965
98468
|
return fresh;
|
|
97966
98469
|
}
|
|
98470
|
+
async function splitSdkBinding(sdk2, splitKey, plan) {
|
|
98471
|
+
const key2 = `${sdk2.binding.sha256}:${splitKey}`;
|
|
98472
|
+
if (sdkSplitBindings.has(key2)) return;
|
|
98473
|
+
const [{ splitSwiftSdkLaterData: splitSwiftSdkLaterData2 }, { swiftSdkImageFile: swiftSdkImageFile2 }] = await Promise.all([
|
|
98474
|
+
Promise.resolve().then(() => (init_swift_sdk_later_data(), swift_sdk_later_data_exports)),
|
|
98475
|
+
Promise.resolve().then(() => (init_swift_sdk_image(), swift_sdk_image_exports))
|
|
98476
|
+
]);
|
|
98477
|
+
const split = splitSwiftSdkLaterData2(
|
|
98478
|
+
import_node_path116.default.dirname(swiftSdkImageFile2(sdk2.key)),
|
|
98479
|
+
sdk2.binding.bytes,
|
|
98480
|
+
plan
|
|
98481
|
+
);
|
|
98482
|
+
const digest3 = (0, import_node_crypto70.createHash)("sha256").update(split.binding).digest("hex");
|
|
98483
|
+
sdkBindingFiles.set(digest3, split.binding);
|
|
98484
|
+
for (const later of split.later)
|
|
98485
|
+
sdkBindingFiles.set((0, import_node_crypto70.createHash)("sha256").update(later).digest("hex"), later);
|
|
98486
|
+
sdkSplitBindings.set(key2, digest3);
|
|
98487
|
+
}
|
|
97967
98488
|
function swiftSdkEntryAssets(origin, image, sdkDigest = image.sdk?.sha256) {
|
|
97968
98489
|
if (image.hostedSdk) return image.hostedSdk;
|
|
97969
98490
|
if (!image.sdk) return {};
|
|
@@ -97973,6 +98494,17 @@ function swiftSdkEntryAssets(origin, image, sdkDigest = image.sdk?.sha256) {
|
|
|
97973
98494
|
sdkBindingUrl: `${origin}${SDK_BINDING_PATH}${servedSdkBinding(image.sdk, published3?.dataPlan ?? sdkDigest)}.bin`
|
|
97974
98495
|
};
|
|
97975
98496
|
}
|
|
98497
|
+
async function prepareSwiftSdkEntryAssets(origin, image, sdkDigest = image.sdk?.sha256) {
|
|
98498
|
+
if (image.sdk && !image.hostedSdk) {
|
|
98499
|
+
const published3 = publishedSwiftSdk(image.sdk.sha256);
|
|
98500
|
+
if (published3?.dataPlan) {
|
|
98501
|
+
const { fetchSwiftSdkDataPlan: fetchSwiftSdkDataPlan2 } = await Promise.resolve().then(() => (init_swift_sdk_later_data(), swift_sdk_later_data_exports));
|
|
98502
|
+
const plan = await fetchSwiftSdkDataPlan2(published3);
|
|
98503
|
+
if (plan) await splitSdkBinding(image.sdk, published3.dataPlan, plan);
|
|
98504
|
+
}
|
|
98505
|
+
}
|
|
98506
|
+
return swiftSdkEntryAssets(origin, image, sdkDigest);
|
|
98507
|
+
}
|
|
97976
98508
|
function swiftArtifactIsAvailable(origin, url, hash) {
|
|
97977
98509
|
return !url.startsWith(`${origin}${ARTIFACT_PATH}`) || [...projects().values()].some(
|
|
97978
98510
|
(project2) => project2.artifacts.some((artifact) => artifact.hash === hash)
|
|
@@ -97999,7 +98531,7 @@ async function swiftArtifactAssets(artifact, { sdkUrl, sdkBindingUrl }) {
|
|
|
97999
98531
|
const sdkPath = new URL(sdkUrl, "http://localhost").pathname;
|
|
98000
98532
|
if (sdkPath.startsWith(SDK_PATH)) {
|
|
98001
98533
|
const digest3 = sdkPath.slice(SDK_PATH.length, -".wasm".length);
|
|
98002
|
-
const primary =
|
|
98534
|
+
const primary = sdkPieces2.get(digest3);
|
|
98003
98535
|
let bytes2;
|
|
98004
98536
|
if (primary) {
|
|
98005
98537
|
bytes2 = primary;
|
|
@@ -98040,13 +98572,13 @@ async function swiftArtifactAssets(artifact, { sdkUrl, sdkBindingUrl }) {
|
|
|
98040
98572
|
}
|
|
98041
98573
|
return assets2;
|
|
98042
98574
|
}
|
|
98043
|
-
var import_node_async_hooks3, import_node_child_process60,
|
|
98575
|
+
var import_node_async_hooks3, import_node_child_process60, import_node_crypto70, import_node_fs114, import_node_os24, import_node_path116, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SDK_PATH, SDK_BINDING_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, swiftArtifactDigests, sharedProjects, projectScope, projects, sharedSourceEntries, sourceEntries, sharedXcodeProjects, xcodeProjects, preparedScriptInputs, emptyWasmAssembly, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, layoutScope, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, IOS_SDK_FRAMEWORKS, sdkStartupParts, sdkPieces2, sdkSplitBindings, sdkBindingFiles, servedSdkBinding;
|
|
98044
98576
|
var init_swift_host = __esm({
|
|
98045
98577
|
"src/swift-host.ts"() {
|
|
98046
98578
|
"use strict";
|
|
98047
98579
|
import_node_async_hooks3 = require("node:async_hooks");
|
|
98048
98580
|
import_node_child_process60 = require("node:child_process");
|
|
98049
|
-
|
|
98581
|
+
import_node_crypto70 = require("node:crypto");
|
|
98050
98582
|
import_node_fs114 = __toESM(require("node:fs"), 1);
|
|
98051
98583
|
import_node_os24 = __toESM(require("node:os"), 1);
|
|
98052
98584
|
import_node_path116 = __toESM(require("node:path"), 1);
|
|
@@ -98177,7 +98709,7 @@ var init_swift_host = __esm({
|
|
|
98177
98709
|
];
|
|
98178
98710
|
IOS_SDK_FRAMEWORKS = new Set(ios_sdk_frameworks_default.frameworks);
|
|
98179
98711
|
sdkStartupParts = /* @__PURE__ */ new Map();
|
|
98180
|
-
|
|
98712
|
+
sdkPieces2 = /* @__PURE__ */ new Map();
|
|
98181
98713
|
sdkSplitBindings = /* @__PURE__ */ new Map();
|
|
98182
98714
|
sdkBindingFiles = /* @__PURE__ */ new Map();
|
|
98183
98715
|
servedSdkBinding = (sdk2, sdkDigest) => sdkDigest && sdkSplitBindings.get(`${sdk2.binding.sha256}:${sdkDigest}`) || sdk2.binding.sha256;
|
|
@@ -98607,7 +99139,7 @@ function hashTree(root) {
|
|
|
98607
99139
|
for (const entry of import_node_fs117.default.readdirSync(root, { recursive: true, withFileTypes: true })) {
|
|
98608
99140
|
if (!entry.isFile()) continue;
|
|
98609
99141
|
const file = import_node_path119.default.join(entry.parentPath, entry.name);
|
|
98610
|
-
hashes[import_node_path119.default.relative(root, file).split(import_node_path119.default.sep).join("/")] = (0,
|
|
99142
|
+
hashes[import_node_path119.default.relative(root, file).split(import_node_path119.default.sep).join("/")] = (0, import_node_crypto71.createHash)("sha256").update(import_node_fs117.default.readFileSync(file)).digest("hex");
|
|
98611
99143
|
}
|
|
98612
99144
|
return Object.fromEntries(Object.entries(hashes).sort(([a], [b]) => a < b ? -1 : 1));
|
|
98613
99145
|
}
|
|
@@ -98657,12 +99189,12 @@ async function runInstalledTurboCodegen(appRoot, outDir, signal) {
|
|
|
98657
99189
|
files: hashTree(generatedRoot)
|
|
98658
99190
|
};
|
|
98659
99191
|
}
|
|
98660
|
-
var import_node_child_process61,
|
|
99192
|
+
var import_node_child_process61, import_node_crypto71, import_node_fs117, import_node_module13, import_node_path119, import_node_util15, run10, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
|
|
98661
99193
|
var init_turbo_codegen_intake = __esm({
|
|
98662
99194
|
"src/turbo-codegen-intake.ts"() {
|
|
98663
99195
|
"use strict";
|
|
98664
99196
|
import_node_child_process61 = require("node:child_process");
|
|
98665
|
-
|
|
99197
|
+
import_node_crypto71 = require("node:crypto");
|
|
98666
99198
|
import_node_fs117 = __toESM(require("node:fs"), 1);
|
|
98667
99199
|
import_node_module13 = require("node:module");
|
|
98668
99200
|
import_node_path119 = __toESM(require("node:path"), 1);
|
|
@@ -99154,8 +99686,7 @@ function podspecDependencies(pod) {
|
|
|
99154
99686
|
if (!Array.isArray(requirements) || !requirements.every((item) => typeof item === "string"))
|
|
99155
99687
|
throw new Error(`${pod.file}: invalid requirements for ${name3}`);
|
|
99156
99688
|
const [root, ...subspec] = name3.split("/");
|
|
99157
|
-
if (root === pod.name ||
|
|
99158
|
-
continue;
|
|
99689
|
+
if (root === pod.name || reactNativePod(root)) continue;
|
|
99159
99690
|
const dep = deps.get(root) ?? { name: root, requirements: [], subspecs: [] };
|
|
99160
99691
|
dep.requirements.push(...requirements);
|
|
99161
99692
|
dep.subspecs.push(subspec.join("/"));
|
|
@@ -99743,7 +100274,7 @@ async function collectTurboSources(options2) {
|
|
|
99743
100274
|
...folly.defines
|
|
99744
100275
|
];
|
|
99745
100276
|
const defines = [...baseDefines, "RCT_NEW_ARCH_ENABLED=1", "RCT_REMOVE_LEGACY_ARCH=1"];
|
|
99746
|
-
const target = (name3, dependencies) => ({
|
|
100277
|
+
const target = (name3, dependencies, cxxDefines = defines) => ({
|
|
99747
100278
|
name: name3,
|
|
99748
100279
|
path: targetPath(name3),
|
|
99749
100280
|
executable: false,
|
|
@@ -99754,7 +100285,7 @@ async function collectTurboSources(options2) {
|
|
|
99754
100285
|
kind: "target",
|
|
99755
100286
|
name: dependency
|
|
99756
100287
|
})),
|
|
99757
|
-
cxxDefines
|
|
100288
|
+
cxxDefines
|
|
99758
100289
|
});
|
|
99759
100290
|
const result = {
|
|
99760
100291
|
coreMode: "turbo-cxx",
|
|
@@ -99808,6 +100339,9 @@ async function collectTurboSources(options2) {
|
|
|
99808
100339
|
const installedTargets = workspace && !options2.reactNativeCore && !options2.reactNativeProvider ? readXcodeAppTarget(workspace, void 0, "Release", {
|
|
99809
100340
|
installedPods: true
|
|
99810
100341
|
}).frameworks : [];
|
|
100342
|
+
const installedByIdentity = new Map(
|
|
100343
|
+
installedTargets.map((target2) => [target2.targetIdentity, target2])
|
|
100344
|
+
);
|
|
99811
100345
|
const fileFlags = new Map(
|
|
99812
100346
|
installedTargets.flatMap(
|
|
99813
100347
|
(target2) => Object.entries(target2.objc?.fileFlags ?? {}).map(
|
|
@@ -99959,6 +100493,18 @@ async function collectTurboSources(options2) {
|
|
|
99959
100493
|
const podHeaders = /* @__PURE__ */ new Map();
|
|
99960
100494
|
const podFileLists = /* @__PURE__ */ new Map();
|
|
99961
100495
|
const isHeaderFile = (file) => import_node_fs118.default.statSync(file, { throwIfNoEntry: false })?.isFile() ?? false;
|
|
100496
|
+
const installedDependencyHeader = (from, root, relative4) => {
|
|
100497
|
+
const provider = podHeaders.get(from.targetName);
|
|
100498
|
+
const providerFile = provider ? relativeInside(provider.root, import_node_path120.default.join(root, relative4)) : null;
|
|
100499
|
+
if (provider && providerFile !== null)
|
|
100500
|
+
return original(from.targetName, provider.label, provider.root, providerFile, false);
|
|
100501
|
+
for (const pod of installedHeaderPods) {
|
|
100502
|
+
const directory2 = relativeInside(options2.appRoot, pod.root);
|
|
100503
|
+
const file = directory2 === null ? null : relativeInside(directory2, relative4);
|
|
100504
|
+
if (file !== null) return original(from.targetName, pod.name, pod.root, file, false);
|
|
100505
|
+
}
|
|
100506
|
+
return original(from.targetName, "installed-dependency", root, relative4, false);
|
|
100507
|
+
};
|
|
99962
100508
|
const resolve4 = (from, include, quoted2) => {
|
|
99963
100509
|
if (quoted2) {
|
|
99964
100510
|
const relative4 = import_node_path120.default.posix.normalize(
|
|
@@ -100106,15 +100652,7 @@ async function collectTurboSources(options2) {
|
|
|
100106
100652
|
] : pod?.dependencyHeaderMaps.filter(({ flag }) => flag === "-I") ?? []) {
|
|
100107
100653
|
const relative4 = map2.headers.get(include);
|
|
100108
100654
|
if (relative4 === void 0) continue;
|
|
100109
|
-
|
|
100110
|
-
const root = relativeInside(options2.appRoot, candidate.root);
|
|
100111
|
-
const file = root === null ? null : relativeInside(root, relative4);
|
|
100112
|
-
return file === null ? [] : [{ pod: candidate, file }];
|
|
100113
|
-
})[0];
|
|
100114
|
-
alias(
|
|
100115
|
-
own2,
|
|
100116
|
-
owner ? original(from.targetName, owner.pod.name, owner.pod.root, owner.file, false) : original(from.targetName, "installed-dependency", map2.root, relative4, false)
|
|
100117
|
-
);
|
|
100655
|
+
alias(own2, installedDependencyHeader(from, map2.root, relative4));
|
|
100118
100656
|
return;
|
|
100119
100657
|
}
|
|
100120
100658
|
for (const search of pod?.dependencySearchPaths ?? []) {
|
|
@@ -100124,10 +100662,7 @@ async function collectTurboSources(options2) {
|
|
|
100124
100662
|
const relative4 = relativeInside(search.root, file);
|
|
100125
100663
|
if (relative4 === null)
|
|
100126
100664
|
throw new Error("installed dependency header escapes its workspace: " + candidate);
|
|
100127
|
-
alias(
|
|
100128
|
-
own2,
|
|
100129
|
-
original(from.targetName, "installed-dependency", search.root, relative4, false)
|
|
100130
|
-
);
|
|
100665
|
+
alias(own2, installedDependencyHeader(from, search.root, relative4));
|
|
100131
100666
|
return;
|
|
100132
100667
|
}
|
|
100133
100668
|
resolveDependency(include);
|
|
@@ -100244,16 +100779,18 @@ async function collectTurboSources(options2) {
|
|
|
100244
100779
|
for (const provider of providers) {
|
|
100245
100780
|
const targetName = providerTarget(provider.info.name);
|
|
100246
100781
|
const label = provider.info.name;
|
|
100247
|
-
const
|
|
100248
|
-
|
|
100249
|
-
|
|
100782
|
+
const providerDefines = provider.paper ? baseDefines : defines;
|
|
100783
|
+
const providerTargetInput = target(
|
|
100784
|
+
targetName,
|
|
100785
|
+
[TURBO_CORE_TARGET],
|
|
100786
|
+
providerDefines
|
|
100787
|
+
);
|
|
100250
100788
|
result.targets.push(providerTargetInput);
|
|
100251
100789
|
const pod = readPod(
|
|
100252
100790
|
provider,
|
|
100253
100791
|
options2.appRoot,
|
|
100254
100792
|
options2.installedPods?.get(provider.name)
|
|
100255
100793
|
);
|
|
100256
|
-
if (provider.paper) providerTargetInput.cxxDefines = baseDefines;
|
|
100257
100794
|
if (pod.installed)
|
|
100258
100795
|
providerTargetInput.clangSettings = [
|
|
100259
100796
|
{ tool: "c", flags: pod.installed.preprocessorFlags.c },
|
|
@@ -100394,7 +100931,9 @@ async function collectTurboSources(options2) {
|
|
|
100394
100931
|
const depUnits = [];
|
|
100395
100932
|
const depSwiftPods = [];
|
|
100396
100933
|
const externalDefines = [];
|
|
100397
|
-
|
|
100934
|
+
const dependencies = podspecDependencies(pod);
|
|
100935
|
+
const seenDependencies = /* @__PURE__ */ new Set([pod.name, ...dependencies.map(({ name: name3 }) => name3)]);
|
|
100936
|
+
for (const dep of dependencies) {
|
|
100398
100937
|
const installed = installedHeaderPods.find(
|
|
100399
100938
|
(candidate) => candidate.name === dep.name
|
|
100400
100939
|
);
|
|
@@ -100428,6 +100967,13 @@ async function collectTurboSources(options2) {
|
|
|
100428
100967
|
if (!resolved) continue;
|
|
100429
100968
|
if (provider.reactModulesOnly && resolved.files.some((f) => f.endsWith(".swift")))
|
|
100430
100969
|
continue;
|
|
100970
|
+
for (const identity2 of installedTarget?.targetDependencies ?? []) {
|
|
100971
|
+
const dependency = installedByIdentity.get(identity2);
|
|
100972
|
+
if (!dependency?.podRoot || seenDependencies.has(dependency.name) || reactNativePod(dependency.name))
|
|
100973
|
+
continue;
|
|
100974
|
+
seenDependencies.add(dependency.name);
|
|
100975
|
+
dependencies.push({ name: dependency.name, requirements: [], subspecs: [""] });
|
|
100976
|
+
}
|
|
100431
100977
|
externalDefines.push(...resolved.defines);
|
|
100432
100978
|
const mappings2 = installed ? podHeaderMappings(installed) : [];
|
|
100433
100979
|
const swiftFilesForDep = [];
|
|
@@ -100505,7 +101051,8 @@ async function collectTurboSources(options2) {
|
|
|
100505
101051
|
result.targets.push({
|
|
100506
101052
|
...target(
|
|
100507
101053
|
swiftModule,
|
|
100508
|
-
depSwiftPods.map((dep) => dep.moduleName)
|
|
101054
|
+
depSwiftPods.map((dep) => dep.moduleName),
|
|
101055
|
+
providerDefines
|
|
100509
101056
|
),
|
|
100510
101057
|
cxxInterop: true
|
|
100511
101058
|
});
|
|
@@ -102965,11 +103512,11 @@ extern "C" __attribute__((export_name("peach_fabric_component_names"))) const ch
|
|
|
102965
103512
|
}
|
|
102966
103513
|
`;
|
|
102967
103514
|
}
|
|
102968
|
-
var
|
|
103515
|
+
var import_node_crypto72, import_node_fs118, import_node_module14, import_node_path120, TURBO_CORE_TARGET, TURBO_FMT_TARGET, TURBO_ENTRY_HEADER, TURBO_CORE_PUBLIC_HEADERS, REGISTRATION, CODEGEN_OBJC, UNIT, HEADER5, OBJC2, OBJC_TURBO, OBJC_BRIDGE, OBJC_REGISTERED, REACT_NATIVE_UNITS, REACT_NATIVE_INCLUDE_ROOTS, REACT_NATIVE_OBJC_UNITS, REACT_NATIVE_OBJC_VERSIONED_UNITS, REACT_NATIVE_HEADER_DIRS, REACT_NATIVE_BARE_HEADER_DIRS, DECLARED_MODULE_NAME, EXPORTED_MODULE, sha2564, podspecList, reactNativePods, reactNativePod, versionParts, iosOf, JS_CALL_INVOKER, FABRIC_SHADOW_HANDLE_HOST, FABRIC_HOST_INCLUDES, FABRIC_HOST_PAPER_INCLUDES, PAPER_UIKIT_BRIDGE_SWIFT;
|
|
102969
103516
|
var init_turbo_source = __esm({
|
|
102970
103517
|
"src/turbo-source.ts"() {
|
|
102971
103518
|
"use strict";
|
|
102972
|
-
|
|
103519
|
+
import_node_crypto72 = require("node:crypto");
|
|
102973
103520
|
import_node_fs118 = __toESM(require("node:fs"), 1);
|
|
102974
103521
|
import_node_module14 = require("node:module");
|
|
102975
103522
|
import_node_path120 = __toESM(require("node:path"), 1);
|
|
@@ -103099,8 +103646,23 @@ var init_turbo_source = __esm({
|
|
|
103099
103646
|
];
|
|
103100
103647
|
DECLARED_MODULE_NAME = /\bName\(\s*"(\w+)"\s*\)/g;
|
|
103101
103648
|
EXPORTED_MODULE = /\bRCT_(?:EXPORT_MODULE(?:_NO_LOAD)?|EXTERN_MODULE)\s*\(\s*(\w*)/g;
|
|
103102
|
-
sha2564 = (data) => (0,
|
|
103649
|
+
sha2564 = (data) => (0, import_node_crypto72.createHash)("sha256").update(data).digest("hex");
|
|
103103
103650
|
podspecList = podspecAttribute;
|
|
103651
|
+
reactNativePods = /* @__PURE__ */ new Set([
|
|
103652
|
+
"React",
|
|
103653
|
+
"ReactCommon",
|
|
103654
|
+
"ReactCodegen",
|
|
103655
|
+
"ReactNativeDependencies",
|
|
103656
|
+
"hermes-engine",
|
|
103657
|
+
"FBLazyVector",
|
|
103658
|
+
"DoubleConversion",
|
|
103659
|
+
"glog",
|
|
103660
|
+
"boost",
|
|
103661
|
+
"fmt",
|
|
103662
|
+
"fast_float",
|
|
103663
|
+
"Yoga"
|
|
103664
|
+
]);
|
|
103665
|
+
reactNativePod = (name3) => reactNativePods.has(name3) || name3.startsWith("React-") || name3.startsWith("RCT");
|
|
103104
103666
|
versionParts = (version2) => version2.split(/[.-]/).map((p) => Number(p) || 0);
|
|
103105
103667
|
iosOf = (member) => object7(member.ios) ? member.ios : null;
|
|
103106
103668
|
JS_CALL_INVOKER = `namespace {
|
|
@@ -103971,7 +104533,7 @@ function retainInstalledReactNativeDeclarations(snapshot, options2, skipped, cor
|
|
|
103971
104533
|
}
|
|
103972
104534
|
async function prepareTurboCompileInput(options2) {
|
|
103973
104535
|
await prepareTurboSourceDependencies(options2.reactNativeRoot);
|
|
103974
|
-
const key2 = (0,
|
|
104536
|
+
const key2 = (0, import_node_crypto73.createHash)("sha256").update(options2.providers.map(({ root }) => import_node_fs119.default.realpathSync(root)).join("\0")).update("\0").update(import_node_fs119.default.realpathSync(options2.moduleRoot)).digest("hex");
|
|
103975
104537
|
const scratch2 = import_node_path121.default.join(import_node_os25.default.tmpdir(), "peach-turbo-swift", key2);
|
|
103976
104538
|
import_node_fs119.default.mkdirSync(scratch2, { recursive: true });
|
|
103977
104539
|
const codegenDir = import_node_fs119.default.mkdtempSync(import_node_path121.default.join(scratch2, "codegen-"));
|
|
@@ -104214,11 +104776,11 @@ async function compileTurboModule(options2) {
|
|
|
104214
104776
|
collection
|
|
104215
104777
|
};
|
|
104216
104778
|
}
|
|
104217
|
-
var
|
|
104779
|
+
var import_node_crypto73, import_node_fs119, import_node_module15, import_node_os25, import_node_path121;
|
|
104218
104780
|
var init_turbo_compile = __esm({
|
|
104219
104781
|
"src/turbo-compile.ts"() {
|
|
104220
104782
|
"use strict";
|
|
104221
|
-
|
|
104783
|
+
import_node_crypto73 = require("node:crypto");
|
|
104222
104784
|
import_node_fs119 = __toESM(require("node:fs"), 1);
|
|
104223
104785
|
import_node_module15 = require("node:module");
|
|
104224
104786
|
import_node_os25 = __toESM(require("node:os"), 1);
|
|
@@ -104418,8 +104980,8 @@ function reactNativeCoreEntry(reactNativeRoot, moduleRoot, mode) {
|
|
|
104418
104980
|
);
|
|
104419
104981
|
if (!isRecord(manifest) || typeof manifest.version !== "string")
|
|
104420
104982
|
throw new Error(`${reactNativeRoot}: react-native has no version`);
|
|
104421
|
-
const headers = (0,
|
|
104422
|
-
const sources = (0,
|
|
104983
|
+
const headers = (0, import_node_crypto74.createHash)("sha256");
|
|
104984
|
+
const sources = (0, import_node_crypto74.createHash)("sha256");
|
|
104423
104985
|
const walk4 = (relative4) => {
|
|
104424
104986
|
for (const file of import_node_fs121.default.readdirSync(import_node_path123.default.join(reactNativeRoot, relative4), { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
104425
104987
|
if (file.name === "node_modules" || file.name.startsWith(".")) continue;
|
|
@@ -104526,7 +105088,7 @@ function linkReactNativeCore(collection, core, moduleRoot) {
|
|
|
104526
105088
|
const file = import_node_path123.default.join(
|
|
104527
105089
|
cacheDir(),
|
|
104528
105090
|
"native-archives",
|
|
104529
|
-
`${(0,
|
|
105091
|
+
`${(0, import_node_crypto74.createHash)("sha256").update(data).digest("hex")}.a`
|
|
104530
105092
|
);
|
|
104531
105093
|
import_node_fs121.default.mkdirSync(import_node_path123.default.dirname(file), { recursive: true });
|
|
104532
105094
|
if (!import_node_fs121.default.existsSync(file)) import_node_fs121.default.writeFileSync(file, Buffer.from(data, "base64"));
|
|
@@ -104536,11 +105098,11 @@ function linkReactNativeCore(collection, core, moduleRoot) {
|
|
|
104536
105098
|
}
|
|
104537
105099
|
}
|
|
104538
105100
|
}
|
|
104539
|
-
var
|
|
105101
|
+
var import_node_crypto74, import_node_fs121, import_node_module16, import_node_path123, import_node_util16, recipe, strings3, building;
|
|
104540
105102
|
var init_react_native_core = __esm({
|
|
104541
105103
|
"src/react-native-core.ts"() {
|
|
104542
105104
|
"use strict";
|
|
104543
|
-
|
|
105105
|
+
import_node_crypto74 = require("node:crypto");
|
|
104544
105106
|
import_node_fs121 = __toESM(require("node:fs"), 1);
|
|
104545
105107
|
import_node_module16 = require("node:module");
|
|
104546
105108
|
import_node_path123 = __toESM(require("node:path"), 1);
|
|
@@ -104555,7 +105117,7 @@ var init_react_native_core = __esm({
|
|
|
104555
105117
|
init_swift_distribution();
|
|
104556
105118
|
init_swift_package();
|
|
104557
105119
|
init_swiftContract();
|
|
104558
|
-
recipe = true ? "
|
|
105120
|
+
recipe = true ? "d54320ef52f1a201f825b780998684f9460a3c75c115b7dadf4789e14ec7f639" : reactNativeCoreDigest(__sootsim_import_meta_dirname);
|
|
104559
105121
|
strings3 = (value) => isRecord(value) && Object.values(value).every((item) => typeof item === "string");
|
|
104560
105122
|
building = /* @__PURE__ */ new Map();
|
|
104561
105123
|
}
|
|
@@ -104571,11 +105133,11 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
|
|
|
104571
105133
|
"specifications",
|
|
104572
105134
|
`${checksum}.json`
|
|
104573
105135
|
);
|
|
104574
|
-
const sha1 = (value) => (0,
|
|
105136
|
+
const sha1 = (value) => (0, import_node_crypto75.createHash)("sha1").update(value).digest("hex");
|
|
104575
105137
|
let text7;
|
|
104576
105138
|
if (import_node_fs122.default.existsSync(file)) text7 = import_node_fs122.default.readFileSync(file, "utf8");
|
|
104577
105139
|
else {
|
|
104578
|
-
const shard2 = (0,
|
|
105140
|
+
const shard2 = (0, import_node_crypto75.createHash)("md5").update(root).digest("hex").slice(0, 3).split("").join("/");
|
|
104579
105141
|
const specPath = `Specs/${shard2}/${root}/${version2}/${root}.podspec.json`;
|
|
104580
105142
|
const response = await fetch(`https://cdn.cocoapods.org/${specPath}`);
|
|
104581
105143
|
if (!response.ok)
|
|
@@ -104704,7 +105266,7 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
104704
105266
|
"end",
|
|
104705
105267
|
""
|
|
104706
105268
|
].join("\n");
|
|
104707
|
-
const key2 = (0,
|
|
105269
|
+
const key2 = (0, import_node_crypto75.createHash)("sha256").update(project).update(podfile).update(JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b)))).update(
|
|
104708
105270
|
JSON.stringify(
|
|
104709
105271
|
Object.entries(specificationChecksums).sort(([a], [b]) => a.localeCompare(b))
|
|
104710
105272
|
)
|
|
@@ -104773,11 +105335,11 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
104773
105335
|
);
|
|
104774
105336
|
});
|
|
104775
105337
|
}
|
|
104776
|
-
var
|
|
105338
|
+
var import_node_crypto75, import_node_fs122, import_node_path124, APP, record4, project, podModuleName;
|
|
104777
105339
|
var init_swift_source_pods = __esm({
|
|
104778
105340
|
"src/swift-source-pods.ts"() {
|
|
104779
105341
|
"use strict";
|
|
104780
|
-
|
|
105342
|
+
import_node_crypto75 = require("node:crypto");
|
|
104781
105343
|
import_node_fs122 = __toESM(require("node:fs"), 1);
|
|
104782
105344
|
import_node_path124 = __toESM(require("node:path"), 1);
|
|
104783
105345
|
init_browser();
|
|
@@ -105453,7 +106015,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
105453
106015
|
input.libraries ??= {};
|
|
105454
106016
|
input.libraries[nitroProviderTarget({ name: name3 })] = library;
|
|
105455
106017
|
}
|
|
105456
|
-
const key2 = (0,
|
|
106018
|
+
const key2 = (0, import_node_crypto76.createHash)("sha256").update(
|
|
105457
106019
|
collection.providers.map(({ root, hybridObjects }) => `${root}\0${hybridObjects.join(",")}`).join("\0")
|
|
105458
106020
|
).update("\0").update(import_node_fs123.default.realpathSync(options2.moduleRoot)).update("\0").update(options2.configuration).digest("hex");
|
|
105459
106021
|
const packagePath = import_node_path125.default.join(import_node_os26.default.tmpdir(), "peach-nitro-swift", key2, `p${process.pid}`);
|
|
@@ -105510,11 +106072,11 @@ function nitrogenGeneratedSources(podDirectory) {
|
|
|
105510
106072
|
...sources(import_node_path125.default.join(generated, "ios"), /\.(h|hpp|c|cpp|mm|swift)$/)
|
|
105511
106073
|
];
|
|
105512
106074
|
}
|
|
105513
|
-
var
|
|
106075
|
+
var import_node_crypto76, import_node_fs123, import_node_os26, import_node_path125, BUNDLED_CXX_NAMESPACES, REACT_INCLUDE_PATTERN, REACT_LINKING_PATTERN, REACT_VERSION_PATTERN, RN_HEADER_DIR_MAP, RN_COMMON_ROOTS;
|
|
105514
106076
|
var init_nitro_compile = __esm({
|
|
105515
106077
|
"src/nitro-compile.ts"() {
|
|
105516
106078
|
"use strict";
|
|
105517
|
-
|
|
106079
|
+
import_node_crypto76 = require("node:crypto");
|
|
105518
106080
|
import_node_fs123 = __toESM(require("node:fs"), 1);
|
|
105519
106081
|
import_node_os26 = __toESM(require("node:os"), 1);
|
|
105520
106082
|
import_node_path125 = __toESM(require("node:path"), 1);
|
|
@@ -105591,11 +106153,11 @@ var init_nitro_compile = __esm({
|
|
|
105591
106153
|
});
|
|
105592
106154
|
|
|
105593
106155
|
// src/nitro-compiler-digest.ts
|
|
105594
|
-
var
|
|
106156
|
+
var import_node_crypto77, import_node_fs124, import_node_path126;
|
|
105595
106157
|
var init_nitro_compiler_digest = __esm({
|
|
105596
106158
|
"src/nitro-compiler-digest.ts"() {
|
|
105597
106159
|
"use strict";
|
|
105598
|
-
|
|
106160
|
+
import_node_crypto77 = require("node:crypto");
|
|
105599
106161
|
import_node_fs124 = require("node:fs");
|
|
105600
106162
|
import_node_path126 = __toESM(require("node:path"), 1);
|
|
105601
106163
|
init_swift_compiler_digest();
|
|
@@ -105616,7 +106178,7 @@ function hashPackageTree(root, options2) {
|
|
|
105616
106178
|
}
|
|
105617
106179
|
};
|
|
105618
106180
|
walk4(root, "");
|
|
105619
|
-
const hash = (0,
|
|
106181
|
+
const hash = (0, import_node_crypto78.createHash)("sha256");
|
|
105620
106182
|
return (async () => {
|
|
105621
106183
|
for (let start = 0; start < files2.length; start += READ_AHEAD) {
|
|
105622
106184
|
const batch = files2.slice(start, start + READ_AHEAD);
|
|
@@ -105631,11 +106193,11 @@ function packageTreeDigest(root) {
|
|
|
105631
106193
|
compareNames: (left, right) => left.localeCompare(right)
|
|
105632
106194
|
});
|
|
105633
106195
|
}
|
|
105634
|
-
var
|
|
106196
|
+
var import_node_crypto78, import_node_fs125, import_promises11, import_node_path127, READ_AHEAD;
|
|
105635
106197
|
var init_package_tree_digest = __esm({
|
|
105636
106198
|
"src/package-tree-digest.ts"() {
|
|
105637
106199
|
"use strict";
|
|
105638
|
-
|
|
106200
|
+
import_node_crypto78 = require("node:crypto");
|
|
105639
106201
|
import_node_fs125 = require("node:fs");
|
|
105640
106202
|
import_promises11 = require("node:fs/promises");
|
|
105641
106203
|
import_node_path127 = require("node:path");
|
|
@@ -105774,7 +106336,7 @@ var init_nitro_superset = __esm({
|
|
|
105774
106336
|
init_nitroContract();
|
|
105775
106337
|
init_swift_standin_digest();
|
|
105776
106338
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
105777
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
106339
|
+
NITRO_COMPILER_DIGEST = true ? "36fce173b160477b6b449e37c6203973648c41456da0875f9b607c4f4ca2dc64" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
105778
106340
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
105779
106341
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
105780
106342
|
published = /* @__PURE__ */ new Map();
|
|
@@ -105852,7 +106414,10 @@ async function compileNitroApp(appRoot, origin, configure, moduleRoot, shared =
|
|
|
105852
106414
|
};
|
|
105853
106415
|
}
|
|
105854
106416
|
async function compiledModuleAssets(artifact) {
|
|
105855
|
-
const assets2 = await swiftArtifactAssets(
|
|
106417
|
+
const assets2 = await swiftArtifactAssets(
|
|
106418
|
+
artifact,
|
|
106419
|
+
await prepareSwiftSdkEntryAssets("", artifact)
|
|
106420
|
+
);
|
|
105856
106421
|
return [...assets2].map(([address, asset]) => ({ path: address.slice(1), ...asset }));
|
|
105857
106422
|
}
|
|
105858
106423
|
async function buildNitroBundle(appRoot, configuration, moduleRoot, shared = true) {
|
|
@@ -105965,7 +106530,7 @@ function chunkKey2(lines) {
|
|
|
105965
106530
|
return lines.map((item) => item.text).join("\n");
|
|
105966
106531
|
}
|
|
105967
106532
|
function stableShardIndex(key2, shardCount) {
|
|
105968
|
-
return (0,
|
|
106533
|
+
return (0, import_node_crypto79.createHash)("sha256").update(key2).digest().readUInt32BE(0) % shardCount;
|
|
105969
106534
|
}
|
|
105970
106535
|
function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SHARDS) {
|
|
105971
106536
|
if (shardCount <= 1 || !name3.endsWith(".swift") || name3.endsWith(".types.swift") || source.length < ONE_SDK_BINDING_SHARD_MIN_BYTES) {
|
|
@@ -106209,11 +106774,11 @@ function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SH
|
|
|
106209
106774
|
};
|
|
106210
106775
|
});
|
|
106211
106776
|
}
|
|
106212
|
-
var
|
|
106777
|
+
var import_node_crypto79, import_node_path130, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES;
|
|
106213
106778
|
var init_shard = __esm({
|
|
106214
106779
|
"src/one-sdk/shard.ts"() {
|
|
106215
106780
|
"use strict";
|
|
106216
|
-
|
|
106781
|
+
import_node_crypto79 = require("node:crypto");
|
|
106217
106782
|
import_node_path130 = __toESM(require("node:path"), 1);
|
|
106218
106783
|
init_swift_compile();
|
|
106219
106784
|
ONE_SDK_BINDING_SHARDS = 8;
|
|
@@ -106656,7 +107221,7 @@ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRoo
|
|
|
106656
107221
|
const packagePath = import_node_path131.default.join(
|
|
106657
107222
|
swiftCacheDir(),
|
|
106658
107223
|
"peach-one-sdk-swift",
|
|
106659
|
-
(0,
|
|
107224
|
+
(0, import_node_crypto80.createHash)("sha256").update(import_node_fs128.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
|
|
106660
107225
|
"sdk"
|
|
106661
107226
|
);
|
|
106662
107227
|
const bindingFlags = optimize ? '["-suppress-warnings"]' : '["-suppress-warnings", "-Onone", "-no-whole-module-optimization"]';
|
|
@@ -106703,11 +107268,11 @@ async function buildOneSDKBundle(appRoot) {
|
|
|
106703
107268
|
assets: await compiledModuleAssets(compiled.artifact)
|
|
106704
107269
|
};
|
|
106705
107270
|
}
|
|
106706
|
-
var
|
|
107271
|
+
var import_node_crypto80, import_node_fs128, import_node_path131, ONE_SDK_ROUTE, handleOneSDKRequest;
|
|
106707
107272
|
var init_one_sdk_bundle = __esm({
|
|
106708
107273
|
"src/one-sdk-bundle.ts"() {
|
|
106709
107274
|
"use strict";
|
|
106710
|
-
|
|
107275
|
+
import_node_crypto80 = require("node:crypto");
|
|
106711
107276
|
import_node_fs128 = __toESM(require("node:fs"), 1);
|
|
106712
107277
|
import_node_path131 = __toESM(require("node:path"), 1);
|
|
106713
107278
|
init_expo_native_workspace();
|
|
@@ -106750,13 +107315,13 @@ var init_expo_eager_seam_contract = __esm({
|
|
|
106750
107315
|
|
|
106751
107316
|
// src/expo-native-compiler-digest.ts
|
|
106752
107317
|
function expoNativeCompilerDigestValue() {
|
|
106753
|
-
return true ? "
|
|
107318
|
+
return true ? "32e5f0f006289879151f5e79955eb059b1701f32206abe1b3134a47271cca666" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
106754
107319
|
}
|
|
106755
|
-
var
|
|
107320
|
+
var import_node_crypto81;
|
|
106756
107321
|
var init_expo_native_compiler_digest = __esm({
|
|
106757
107322
|
"src/expo-native-compiler-digest.ts"() {
|
|
106758
107323
|
"use strict";
|
|
106759
|
-
|
|
107324
|
+
import_node_crypto81 = require("node:crypto");
|
|
106760
107325
|
init_react_native_core_digest();
|
|
106761
107326
|
init_swift_compiler_digest();
|
|
106762
107327
|
init_swift_standin_digest();
|
|
@@ -106765,7 +107330,7 @@ var init_expo_native_compiler_digest = __esm({
|
|
|
106765
107330
|
|
|
106766
107331
|
// src/expo-discovery-cache.ts
|
|
106767
107332
|
function peachPin() {
|
|
106768
|
-
return (0,
|
|
107333
|
+
return (0, import_node_crypto82.createHash)("sha256").update(
|
|
106769
107334
|
`${FORMAT}\0${expoNativeCompilerDigestValue()}\0${swiftNativePin().distribution.id}\0`
|
|
106770
107335
|
).update(JSON.stringify([...EXPO_EAGER_NATIVE_VIEWS])).update(JSON.stringify([...peachAnsweredNativePackages()].sort())).digest("hex");
|
|
106771
107336
|
}
|
|
@@ -106779,7 +107344,7 @@ function stable(value) {
|
|
|
106779
107344
|
}
|
|
106780
107345
|
async function expoDiscoveryKey(options2) {
|
|
106781
107346
|
const { root, hash } = await hashExpoWorkspace(options2.appRoot, options2.signal);
|
|
106782
|
-
const key2 = (0,
|
|
107347
|
+
const key2 = (0, import_node_crypto82.createHash)("sha256").update(`${peachPin()}\0${hash}\0`).update(`${stable(JSON.parse(options2.searchText))}\0`).update(`${stable(options2.configuration)}\0`).update(stable(JSON.parse(options2.resolveText))).digest("hex");
|
|
106783
107348
|
return { key: key2, root };
|
|
106784
107349
|
}
|
|
106785
107350
|
function expoDiscoveryCacheDir() {
|
|
@@ -106850,7 +107415,7 @@ function readExpoDiscovery(key2) {
|
|
|
106850
107415
|
if (typeof parsed2.archive !== "string" || !isDigest(parsed2.archive)) return void 0;
|
|
106851
107416
|
const archive = import_node_path132.default.join(expoDiscoveryCacheDir(), "blobs", `${parsed2.archive}.zst`);
|
|
106852
107417
|
const bytes = import_node_fs129.default.readFileSync(archive);
|
|
106853
|
-
if ((0,
|
|
107418
|
+
if ((0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex") !== parsed2.archive)
|
|
106854
107419
|
return void 0;
|
|
106855
107420
|
const bodies = (0, import_node_zlib8.zstdDecompressSync)(bytes);
|
|
106856
107421
|
const decoded = /* @__PURE__ */ new Map();
|
|
@@ -106924,7 +107489,7 @@ function stampedFileHash(file) {
|
|
|
106924
107489
|
const stamp = [stat.dev, stat.ino, stat.size, stat.mtimeNs, stat.ctimeNs].join(":");
|
|
106925
107490
|
const cached2 = fileHashes.get(file);
|
|
106926
107491
|
if (cached2?.stamp === stamp) return cached2.checksum;
|
|
106927
|
-
const checksum = (0,
|
|
107492
|
+
const checksum = (0, import_node_crypto82.createHash)("sha256").update(import_node_fs129.default.readFileSync(file)).digest("hex");
|
|
106928
107493
|
fileHashes.set(file, { stamp, checksum });
|
|
106929
107494
|
fileHashesChanged = true;
|
|
106930
107495
|
return checksum;
|
|
@@ -106933,7 +107498,7 @@ function saveFileHashes() {
|
|
|
106933
107498
|
if (!fileHashesChanged) return;
|
|
106934
107499
|
fileHashesChanged = false;
|
|
106935
107500
|
const target = fileHashesPath();
|
|
106936
|
-
const temporary = `${target}.${process.pid}.${(0,
|
|
107501
|
+
const temporary = `${target}.${process.pid}.${(0, import_node_crypto82.randomUUID)()}.tmp`;
|
|
106937
107502
|
try {
|
|
106938
107503
|
import_node_fs129.default.mkdirSync(import_node_path132.default.dirname(target), { recursive: true });
|
|
106939
107504
|
import_node_fs129.default.writeFileSync(
|
|
@@ -106988,7 +107553,7 @@ function frameworkDigest(directory2, signal) {
|
|
|
106988
107553
|
if (target !== root && !target.startsWith(`${root}${import_node_path132.default.sep}`))
|
|
106989
107554
|
throw new Error(`framework link escapes its tree: ${relative4}`);
|
|
106990
107555
|
}
|
|
106991
|
-
return (0,
|
|
107556
|
+
return (0, import_node_crypto82.createHash)("sha256").update(JSON.stringify([...entries2])).digest("hex");
|
|
106992
107557
|
}
|
|
106993
107558
|
function rewritePreparedPaths(options2) {
|
|
106994
107559
|
const { units, sourceRoot, preparedRoot, signal } = options2;
|
|
@@ -107009,7 +107574,7 @@ function rewritePreparedPaths(options2) {
|
|
|
107009
107574
|
return null;
|
|
107010
107575
|
}
|
|
107011
107576
|
if (!preparedBytes.equals(sourceBytes)) return null;
|
|
107012
|
-
dependencies[sourceFile] = (0,
|
|
107577
|
+
dependencies[sourceFile] = (0, import_node_crypto82.createHash)("sha256").update(sourceBytes).digest("hex");
|
|
107013
107578
|
verifiedFiles.set(preparedFile, sourceFile);
|
|
107014
107579
|
return sourceFile;
|
|
107015
107580
|
};
|
|
@@ -107086,7 +107651,7 @@ function rewritePreparedPaths(options2) {
|
|
|
107086
107651
|
portableDir = import_node_path132.default.join(parent, import_node_path132.default.basename(dir));
|
|
107087
107652
|
if (!import_node_fs129.default.existsSync(portableDir)) {
|
|
107088
107653
|
import_node_fs129.default.mkdirSync(parent, { recursive: true });
|
|
107089
|
-
const tmp = import_node_path132.default.join(parent, `.${process.pid}.${(0,
|
|
107654
|
+
const tmp = import_node_path132.default.join(parent, `.${process.pid}.${(0, import_node_crypto82.randomUUID)()}.tmp`);
|
|
107090
107655
|
try {
|
|
107091
107656
|
import_node_fs129.default.cpSync(dir, tmp, { recursive: true, verbatimSymlinks: true });
|
|
107092
107657
|
if (frameworkDigest(tmp, signal) !== preparedDigest)
|
|
@@ -107115,7 +107680,7 @@ function writeExpoDiscovery(options2) {
|
|
|
107115
107680
|
try {
|
|
107116
107681
|
const dir = expoDiscoveryCacheDir();
|
|
107117
107682
|
import_node_fs129.default.mkdirSync(dir, { recursive: true });
|
|
107118
|
-
const tmp = import_node_path132.default.join(dir, `.${options2.key}.${process.pid}.${(0,
|
|
107683
|
+
const tmp = import_node_path132.default.join(dir, `.${options2.key}.${process.pid}.${(0, import_node_crypto82.randomUUID)()}.tmp`);
|
|
107119
107684
|
if (options2.units === null) {
|
|
107120
107685
|
import_node_fs129.default.writeFileSync(
|
|
107121
107686
|
tmp,
|
|
@@ -107178,8 +107743,8 @@ function writeExpoDiscovery(options2) {
|
|
|
107178
107743
|
}
|
|
107179
107744
|
);
|
|
107180
107745
|
const contents2 = (0, import_node_zlib8.zstdCompressSync)(Buffer.concat(chunks, size2));
|
|
107181
|
-
const archive = (0,
|
|
107182
|
-
const temporary = import_node_path132.default.join(blobDir, "." + (0,
|
|
107746
|
+
const archive = (0, import_node_crypto82.createHash)("sha256").update(contents2).digest("hex");
|
|
107747
|
+
const temporary = import_node_path132.default.join(blobDir, "." + (0, import_node_crypto82.randomUUID)() + ".tmp");
|
|
107183
107748
|
try {
|
|
107184
107749
|
import_node_fs129.default.writeFileSync(temporary, contents2);
|
|
107185
107750
|
import_node_fs129.default.renameSync(temporary, import_node_path132.default.join(blobDir, `${archive}.zst`));
|
|
@@ -107206,11 +107771,11 @@ function writeExpoDiscovery(options2) {
|
|
|
107206
107771
|
return error instanceof Error ? error.message : String(error);
|
|
107207
107772
|
}
|
|
107208
107773
|
}
|
|
107209
|
-
var
|
|
107774
|
+
var import_node_crypto82, import_node_fs129, import_node_path132, import_node_zlib8, FORMAT, EXPIRY_MS, ORPHAN_TEMPORARY_MS, strings4, stringRecord, isDigest, digestRecord, isBodyOffset, isBodyOffsets, sourceLocationLine, fileHashes, fileHashesLoaded, fileHashesChanged, MISSING_TREE;
|
|
107210
107775
|
var init_expo_discovery_cache = __esm({
|
|
107211
107776
|
"src/expo-discovery-cache.ts"() {
|
|
107212
107777
|
"use strict";
|
|
107213
|
-
|
|
107778
|
+
import_node_crypto82 = require("node:crypto");
|
|
107214
107779
|
import_node_fs129 = __toESM(require("node:fs"), 1);
|
|
107215
107780
|
import_node_path132 = __toESM(require("node:path"), 1);
|
|
107216
107781
|
import_node_zlib8 = require("node:zlib");
|
|
@@ -107414,7 +107979,7 @@ async function expoNativeInputs(appRoot) {
|
|
|
107414
107979
|
"swift-pin": JSON.stringify(swiftNativePin()),
|
|
107415
107980
|
answered: JSON.stringify([...peachAnsweredNativePackages()].sort()),
|
|
107416
107981
|
"pods-environment": JSON.stringify(reactNativePodsEnvironment()),
|
|
107417
|
-
fingerprint: (0,
|
|
107982
|
+
fingerprint: (0, import_node_crypto83.createHash)("sha256").update(lines.sort().join("\n")).digest("hex")
|
|
107418
107983
|
},
|
|
107419
107984
|
packages
|
|
107420
107985
|
};
|
|
@@ -107520,7 +108085,7 @@ async function prebuiltAppTarget(appRoot, signal, dependencies = "lockfile") {
|
|
|
107520
108085
|
}
|
|
107521
108086
|
function servedExpoSwift(appRoot, entry, app) {
|
|
107522
108087
|
if (!entry.expoSwift) return null;
|
|
107523
|
-
const rootId = `${(0,
|
|
108088
|
+
const rootId = `${(0, import_node_crypto83.createHash)("sha256").update(import_node_fs131.default.realpathSync(appRoot)).digest("hex")}/Expo`;
|
|
107524
108089
|
if (app.infoPlist === null) throw new Error("the prebuilt app target has no Info.plist");
|
|
107525
108090
|
const installed = installedInfoPlist(app.infoPlist, entry.infoPlist);
|
|
107526
108091
|
const infoPlist2 = Buffer.from(installed).toString("base64");
|
|
@@ -107548,11 +108113,11 @@ async function prebuiltExpoSwiftResult(appRoot, entry, signal) {
|
|
|
107548
108113
|
await prebuiltAppTarget(appRoot, signal, "installed")
|
|
107549
108114
|
);
|
|
107550
108115
|
}
|
|
107551
|
-
var
|
|
108116
|
+
var import_node_crypto83, import_node_fs131, import_node_module19, import_node_path134, import_node_util17, EXPO_NATIVE_ENTRY_NAME, IDENTITY_SOURCE_SKIPS, expoNativeEntryUrl, isStringRecord, isPlistArray, published2, lookups, answers;
|
|
107552
108117
|
var init_expo_native_prebuilt = __esm({
|
|
107553
108118
|
"src/expo-native-prebuilt.ts"() {
|
|
107554
108119
|
"use strict";
|
|
107555
|
-
|
|
108120
|
+
import_node_crypto83 = require("node:crypto");
|
|
107556
108121
|
import_node_fs131 = __toESM(require("node:fs"), 1);
|
|
107557
108122
|
import_node_module19 = require("node:module");
|
|
107558
108123
|
import_node_path134 = __toESM(require("node:path"), 1);
|
|
@@ -108169,7 +108734,7 @@ function exportedNames(moduleRoot, name3) {
|
|
|
108169
108734
|
const modules = import_node_path136.default.join(moduleRoot, "modules");
|
|
108170
108735
|
const module2 = import_node_path136.default.join(modules, `${name3}.swiftmodule`);
|
|
108171
108736
|
if (!import_node_fs133.default.existsSync(module2)) return /* @__PURE__ */ new Set();
|
|
108172
|
-
const key2 = (0,
|
|
108737
|
+
const key2 = (0, import_node_crypto84.createHash)("sha256").update(import_node_fs133.default.readFileSync(module2)).digest("hex");
|
|
108173
108738
|
const directory2 = import_node_path136.default.join(swiftCacheDir(), "swift-public-names");
|
|
108174
108739
|
const receipt = import_node_path136.default.join(directory2, `${key2}.json`);
|
|
108175
108740
|
if (import_node_fs133.default.existsSync(receipt)) {
|
|
@@ -108252,12 +108817,12 @@ function clangTypeOwnership(moduleRoot, module2) {
|
|
|
108252
108817
|
}
|
|
108253
108818
|
);
|
|
108254
108819
|
}
|
|
108255
|
-
var import_node_child_process64,
|
|
108820
|
+
var import_node_child_process64, import_node_crypto84, import_node_fs133, import_node_path136, blockTypedef, enumTypedef, enumConstant, swiftPrivate;
|
|
108256
108821
|
var init_swift_clang_type_ownership = __esm({
|
|
108257
108822
|
"src/swift-clang-type-ownership.ts"() {
|
|
108258
108823
|
"use strict";
|
|
108259
108824
|
import_node_child_process64 = require("node:child_process");
|
|
108260
|
-
|
|
108825
|
+
import_node_crypto84 = require("node:crypto");
|
|
108261
108826
|
import_node_fs133 = __toESM(require("node:fs"), 1);
|
|
108262
108827
|
import_node_path136 = __toESM(require("node:path"), 1);
|
|
108263
108828
|
init_is_record();
|
|
@@ -108668,6 +109233,9 @@ function retarget(cached2, base2) {
|
|
|
108668
109233
|
for (const module2 of result.modules) {
|
|
108669
109234
|
module2.url = replaceBase(module2.url, cached2.base, base2);
|
|
108670
109235
|
module2.icuUrl = replaceBase(module2.icuUrl, cached2.base, base2);
|
|
109236
|
+
if (module2.sdkUrl) module2.sdkUrl = replaceBase(module2.sdkUrl, cached2.base, base2);
|
|
109237
|
+
if (module2.sdkBindingUrl)
|
|
109238
|
+
module2.sdkBindingUrl = replaceBase(module2.sdkBindingUrl, cached2.base, base2);
|
|
108671
109239
|
}
|
|
108672
109240
|
return result;
|
|
108673
109241
|
}
|
|
@@ -108765,9 +109333,19 @@ function enrichInstalledUnits(units, installed, namespaceGroups, provided, modul
|
|
|
108765
109333
|
map2(file)
|
|
108766
109334
|
])
|
|
108767
109335
|
);
|
|
109336
|
+
const publishedFrameworkTargets = /* @__PURE__ */ new Set([...provided, ...reactTargets]);
|
|
109337
|
+
const frameworkQueue = [...publishedFrameworkTargets];
|
|
109338
|
+
while (frameworkQueue.length > 0) {
|
|
109339
|
+
const name3 = frameworkQueue.pop();
|
|
109340
|
+
for (const dependency of importedTargets.get(name3) ?? []) {
|
|
109341
|
+
if (publishedFrameworkTargets.has(dependency)) continue;
|
|
109342
|
+
publishedFrameworkTargets.add(dependency);
|
|
109343
|
+
frameworkQueue.push(dependency);
|
|
109344
|
+
}
|
|
109345
|
+
}
|
|
108768
109346
|
for (const target of input.nativeTargets ?? []) {
|
|
108769
109347
|
const runtimeModule = provided.has(target.name);
|
|
108770
|
-
if (!
|
|
109348
|
+
if (!publishedFrameworkTargets.has(target.name)) continue;
|
|
108771
109349
|
const swift = runtimeModule ? swiftModuleInterface(moduleRoot, target.name) : null;
|
|
108772
109350
|
const refineClangTypes = clangTypeOwnership(moduleRoot, target.name);
|
|
108773
109351
|
const interfaceName = `${target.name}-Swift.h`;
|
|
@@ -109906,7 +110484,7 @@ function targetSettings2(units) {
|
|
|
109906
110484
|
}
|
|
109907
110485
|
function oneSDKStamp(oneSDK) {
|
|
109908
110486
|
if (!oneSDK) return "";
|
|
109909
|
-
const hash = (0,
|
|
110487
|
+
const hash = (0, import_node_crypto85.createHash)("sha256");
|
|
109910
110488
|
for (const files2 of [oneSDK.targets, oneSDK.entry])
|
|
109911
110489
|
for (const [name3, source] of [...files2].sort(([a], [b]) => a.localeCompare(b)))
|
|
109912
110490
|
hash.update(`${name3}\0${source}\0`);
|
|
@@ -109957,7 +110535,7 @@ ${bridgeModules.length ? "import React\n" : ""}${oneSDK ? "import One\nimport On
|
|
|
109957
110535
|
`;
|
|
109958
110536
|
}
|
|
109959
110537
|
function expoSwiftPreparedKey(base2, units, reactProviderStamp) {
|
|
109960
|
-
const hash = (0,
|
|
110538
|
+
const hash = (0, import_node_crypto85.createHash)("sha256");
|
|
109961
110539
|
hash.update(base2);
|
|
109962
110540
|
hash.update(reactProviderStamp);
|
|
109963
110541
|
for (const unit2 of units) {
|
|
@@ -110145,7 +110723,6 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
110145
110723
|
linkedLibraries.set(name3, library);
|
|
110146
110724
|
}
|
|
110147
110725
|
projectFor(packagePath).oneModule = false;
|
|
110148
|
-
projectFor(packagePath).standalone = true;
|
|
110149
110726
|
projectFor(packagePath).optimize = true;
|
|
110150
110727
|
projectFor(packagePath).staticClangTargets = provider?.staticClangTargets;
|
|
110151
110728
|
projectFor(packagePath).binaryModules = Object.fromEntries([
|
|
@@ -110331,8 +110908,8 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
110331
110908
|
}
|
|
110332
110909
|
return provider;
|
|
110333
110910
|
})() : void 0;
|
|
110334
|
-
const reactProviderStamp = reactProvider ? (0,
|
|
110335
|
-
const key2 = (0,
|
|
110911
|
+
const reactProviderStamp = reactProvider ? (0, import_node_crypto85.createHash)("sha256").update(JSON.stringify(reactProvider)).digest("hex") : "";
|
|
110912
|
+
const key2 = (0, import_node_crypto85.createHash)("sha256").update(import_node_fs134.default.realpathSync(root)).digest("hex");
|
|
110336
110913
|
const unitContentStamp = (unit2) => sourceContentStamp(expoSwiftPackage(key2, unit2.moduleId), module2.root) + (unit2.reactNativeProvider ? `:${reactProviderStamp}` : "");
|
|
110337
110914
|
const failures = /* @__PURE__ */ new Map();
|
|
110338
110915
|
const failureRecords = /* @__PURE__ */ new Map();
|
|
@@ -110650,10 +111227,12 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
110650
111227
|
}
|
|
110651
111228
|
if (artifact) {
|
|
110652
111229
|
signal.throwIfAborted();
|
|
111230
|
+
const sdkAssets = await prepareSwiftSdkEntryAssets(base2, artifact);
|
|
110653
111231
|
await publishArtifact?.(artifact, signal);
|
|
110654
111232
|
result.modules.push({
|
|
110655
111233
|
namespaces: linked.map((unit2) => unit2.moduleId),
|
|
110656
111234
|
url: `${base2}/__peach/swift/${artifact.hash}.wasm`,
|
|
111235
|
+
...sdkAssets,
|
|
110657
111236
|
hash: artifact.hash,
|
|
110658
111237
|
icuUrl: icuUrl(base2, artifact),
|
|
110659
111238
|
rootId: `${key2}/Expo`,
|
|
@@ -110674,13 +111253,13 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
110674
111253
|
throw failure2;
|
|
110675
111254
|
}
|
|
110676
111255
|
}
|
|
110677
|
-
var import_node_async_hooks4, import_node_child_process65,
|
|
111256
|
+
var import_node_async_hooks4, import_node_child_process65, import_node_crypto85, import_node_fs134, import_node_module21, import_node_os28, import_node_path137, import_node_url4, import_node_util18, run11, scriptEnv, EXPO_SWIFT_ENTRY, WITNESS_BATCH, traceStore, discoveryCache, preparedCache, savedFs, ignoredRoots, ownTemporaryRoots, EXPO_MODULE_SCAN_TIMEOUT_MS, preparedExpoSwift, openPreparations, ExpoSwiftLinkRefusal;
|
|
110678
111257
|
var init_expo_swift_host = __esm({
|
|
110679
111258
|
"src/expo-swift-host.ts"() {
|
|
110680
111259
|
"use strict";
|
|
110681
111260
|
import_node_async_hooks4 = require("node:async_hooks");
|
|
110682
111261
|
import_node_child_process65 = require("node:child_process");
|
|
110683
|
-
|
|
111262
|
+
import_node_crypto85 = require("node:crypto");
|
|
110684
111263
|
import_node_fs134 = __toESM(require("node:fs"), 1);
|
|
110685
111264
|
import_node_module21 = require("node:module");
|
|
110686
111265
|
import_node_os28 = __toESM(require("node:os"), 1);
|
|
@@ -110746,12 +111325,7 @@ async function buildExpoSwiftBundle(appRoot, oneSDK) {
|
|
|
110746
111325
|
"",
|
|
110747
111326
|
async (artifact, signal) => {
|
|
110748
111327
|
signal.throwIfAborted();
|
|
110749
|
-
assets2.push(
|
|
110750
|
-
path: `__peach/swift/${artifact.hash}.wasm`,
|
|
110751
|
-
bytes: artifact.bytes,
|
|
110752
|
-
contentType: "application/wasm"
|
|
110753
|
-
});
|
|
110754
|
-
if ("gzip" in artifact.icu) assets2.push(await swiftIcuBundleAsset(artifact.icu));
|
|
111328
|
+
for (const asset of await compiledModuleAssets(artifact)) assets2.push(asset);
|
|
110755
111329
|
},
|
|
110756
111330
|
{ oneSDK }
|
|
110757
111331
|
);
|
|
@@ -110762,7 +111336,7 @@ var init_expo_swift_bundle = __esm({
|
|
|
110762
111336
|
"src/expo-swift-bundle.ts"() {
|
|
110763
111337
|
"use strict";
|
|
110764
111338
|
init_expo_swift_host();
|
|
110765
|
-
|
|
111339
|
+
init_nitro_bundle();
|
|
110766
111340
|
}
|
|
110767
111341
|
});
|
|
110768
111342
|
|
|
@@ -111009,7 +111583,7 @@ async function resolveAndroidGradleSources(request) {
|
|
|
111009
111583
|
const parent = import_node_path140.default.join(kotlinHome(), "gradle-sources");
|
|
111010
111584
|
import_node_fs136.default.mkdirSync(parent, { recursive: true });
|
|
111011
111585
|
const work = import_node_fs136.default.mkdtempSync(import_node_path140.default.join(parent, ".query-"));
|
|
111012
|
-
const task = `peachAndroidSources${(0,
|
|
111586
|
+
const task = `peachAndroidSources${(0, import_node_crypto86.randomBytes)(8).toString("hex")}`;
|
|
111013
111587
|
const script = import_node_path140.default.join(work, "sources.gradle");
|
|
111014
111588
|
const encoded = Buffer.from(
|
|
111015
111589
|
JSON.stringify({
|
|
@@ -111161,12 +111735,12 @@ function readDependencySources(value) {
|
|
|
111161
111735
|
};
|
|
111162
111736
|
});
|
|
111163
111737
|
}
|
|
111164
|
-
var import_node_child_process66,
|
|
111738
|
+
var import_node_child_process66, import_node_crypto86, import_node_fs136, import_node_path140, import_node_util19, run12, modelQuery;
|
|
111165
111739
|
var init_android_gradle_sources = __esm({
|
|
111166
111740
|
"src/android-gradle-sources.ts"() {
|
|
111167
111741
|
"use strict";
|
|
111168
111742
|
import_node_child_process66 = require("node:child_process");
|
|
111169
|
-
|
|
111743
|
+
import_node_crypto86 = require("node:crypto");
|
|
111170
111744
|
import_node_fs136 = __toESM(require("node:fs"), 1);
|
|
111171
111745
|
import_node_path140 = __toESM(require("node:path"), 1);
|
|
111172
111746
|
import_node_util19 = require("node:util");
|
|
@@ -111554,7 +112128,7 @@ var init_android_bridge_packages = __esm({
|
|
|
111554
112128
|
|
|
111555
112129
|
// src/java-module-abi.ts
|
|
111556
112130
|
async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
|
|
111557
|
-
const digest3 = (0,
|
|
112131
|
+
const digest3 = (0, import_node_crypto87.createHash)("sha256");
|
|
111558
112132
|
const parent = import_node_path142.default.join(kotlinHome(), "java-specs");
|
|
111559
112133
|
import_node_fs138.default.mkdirSync(parent, { recursive: true });
|
|
111560
112134
|
const work = import_node_fs138.default.mkdtempSync(import_node_path142.default.join(parent, ".read-"));
|
|
@@ -111651,12 +112225,12 @@ async function compileJavaModuleAbi(input) {
|
|
|
111651
112225
|
);
|
|
111652
112226
|
return library;
|
|
111653
112227
|
}
|
|
111654
|
-
var import_node_child_process67,
|
|
112228
|
+
var import_node_child_process67, import_node_crypto87, import_node_fs138, import_node_path142, import_node_util20, run13, JAVA_BINDINGS_INITIALIZER;
|
|
111655
112229
|
var init_java_module_abi = __esm({
|
|
111656
112230
|
"src/java-module-abi.ts"() {
|
|
111657
112231
|
"use strict";
|
|
111658
112232
|
import_node_child_process67 = require("node:child_process");
|
|
111659
|
-
|
|
112233
|
+
import_node_crypto87 = require("node:crypto");
|
|
111660
112234
|
import_node_fs138 = __toESM(require("node:fs"), 1);
|
|
111661
112235
|
import_node_path142 = __toESM(require("node:path"), 1);
|
|
111662
112236
|
import_node_util20 = require("node:util");
|
|
@@ -111764,13 +112338,13 @@ function verifyKotlinSdkDirectory(root, compiler) {
|
|
|
111764
112338
|
if (!stat.isFile() || stat.nlink !== 1)
|
|
111765
112339
|
throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
|
|
111766
112340
|
const bytes = import_node_fs139.default.readFileSync(target);
|
|
111767
|
-
if (bytes.length !== expected.bytes || (0,
|
|
112341
|
+
if (bytes.length !== expected.bytes || (0, import_node_crypto88.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
|
|
111768
112342
|
throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
|
|
111769
112343
|
}
|
|
111770
112344
|
return manifest;
|
|
111771
112345
|
}
|
|
111772
112346
|
async function installKotlinSdkArchive(archive, compiler) {
|
|
111773
|
-
const sha2565 = (0,
|
|
112347
|
+
const sha2565 = (0, import_node_crypto88.createHash)("sha256").update(archive).digest("hex");
|
|
111774
112348
|
const parent = import_node_path143.default.join(kotlinHome(), "sdk");
|
|
111775
112349
|
const root = import_node_path143.default.join(parent, sha2565);
|
|
111776
112350
|
if (import_node_fs139.default.existsSync(root))
|
|
@@ -111799,12 +112373,12 @@ async function installKotlinSdkArchive(archive, compiler) {
|
|
|
111799
112373
|
import_node_fs139.default.rmSync(work, { recursive: true, force: true });
|
|
111800
112374
|
}
|
|
111801
112375
|
}
|
|
111802
|
-
var import_node_child_process68,
|
|
112376
|
+
var import_node_child_process68, import_node_crypto88, import_node_fs139, import_node_path143, import_node_util21, run14;
|
|
111803
112377
|
var init_kotlin_sdk = __esm({
|
|
111804
112378
|
"src/kotlin-sdk.ts"() {
|
|
111805
112379
|
"use strict";
|
|
111806
112380
|
import_node_child_process68 = require("node:child_process");
|
|
111807
|
-
|
|
112381
|
+
import_node_crypto88 = require("node:crypto");
|
|
111808
112382
|
import_node_fs139 = __toESM(require("node:fs"), 1);
|
|
111809
112383
|
import_node_path143 = __toESM(require("node:path"), 1);
|
|
111810
112384
|
import_node_util21 = require("node:util");
|
|
@@ -111910,7 +112484,7 @@ function peachKotlinModuleRoot() {
|
|
|
111910
112484
|
if (!IS_STANDALONE) return import_node_path145.default.join(peachsimPackageRoot(), "kotlin");
|
|
111911
112485
|
if (installedRoot) return installedRoot;
|
|
111912
112486
|
const files2 = JSON.parse(__PEACH_BUNDLED_KOTLIN__);
|
|
111913
|
-
const digest3 = (0,
|
|
112487
|
+
const digest3 = (0, import_node_crypto89.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
|
|
111914
112488
|
const parent = import_node_path145.default.join(rnxHomeDir(), "kotlin", "modules");
|
|
111915
112489
|
const root = import_node_path145.default.join(parent, digest3);
|
|
111916
112490
|
import_node_fs141.default.mkdirSync(parent, { recursive: true });
|
|
@@ -111939,11 +112513,11 @@ function peachKotlinModuleRoot() {
|
|
|
111939
112513
|
installedRoot = root;
|
|
111940
112514
|
return root;
|
|
111941
112515
|
}
|
|
111942
|
-
var
|
|
112516
|
+
var import_node_crypto89, import_node_fs141, import_node_path145, installedRoot;
|
|
111943
112517
|
var init_kotlin_module = __esm({
|
|
111944
112518
|
"src/kotlin-module.ts"() {
|
|
111945
112519
|
"use strict";
|
|
111946
|
-
|
|
112520
|
+
import_node_crypto89 = require("node:crypto");
|
|
111947
112521
|
import_node_fs141 = __toESM(require("node:fs"), 1);
|
|
111948
112522
|
import_node_path145 = __toESM(require("node:path"), 1);
|
|
111949
112523
|
init_standalone();
|
|
@@ -112306,7 +112880,7 @@ function zipSources(bytes, where) {
|
|
|
112306
112880
|
return entries2;
|
|
112307
112881
|
}
|
|
112308
112882
|
function extract(bytes, where) {
|
|
112309
|
-
const key2 = (0,
|
|
112883
|
+
const key2 = (0, import_node_crypto90.createHash)("sha256").update(bytes).digest("hex");
|
|
112310
112884
|
const cached2 = pending.get(key2);
|
|
112311
112885
|
if (cached2) return cached2;
|
|
112312
112886
|
const request = (async () => {
|
|
@@ -112355,11 +112929,11 @@ function readSourcesJar(archive, where) {
|
|
|
112355
112929
|
function readMavenSourcesArchive(archive) {
|
|
112356
112930
|
return extract(readSourcesJar(archive, archive), archive);
|
|
112357
112931
|
}
|
|
112358
|
-
var
|
|
112932
|
+
var import_node_crypto90, import_node_fs143, import_node_os29, import_node_path147, import_node_zlib9, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
|
|
112359
112933
|
var init_kotlin_maven_sources = __esm({
|
|
112360
112934
|
"src/kotlin-maven-sources.ts"() {
|
|
112361
112935
|
"use strict";
|
|
112362
|
-
|
|
112936
|
+
import_node_crypto90 = require("node:crypto");
|
|
112363
112937
|
import_node_fs143 = __toESM(require("node:fs"), 1);
|
|
112364
112938
|
import_node_os29 = __toESM(require("node:os"), 1);
|
|
112365
112939
|
import_node_path147 = __toESM(require("node:path"), 1);
|
|
@@ -112400,7 +112974,7 @@ async function compileKotlinGradleLibraries(input) {
|
|
|
112400
112974
|
])
|
|
112401
112975
|
];
|
|
112402
112976
|
const name3 = library.coordinate.replace(/[^a-zA-Z0-9._-]/g, "-");
|
|
112403
|
-
const suffix = (0,
|
|
112977
|
+
const suffix = (0, import_node_crypto91.createHash)("sha256").update(library.coordinate).digest("hex").slice(0, 12);
|
|
112404
112978
|
const klib = import_node_path148.default.join(input.output, `${name3}-${suffix}.klib`);
|
|
112405
112979
|
const kotlinJvmAbi = java.length && kotlin.length && library.jars.length === 1 ? library.jars[0] : void 0;
|
|
112406
112980
|
const abiPairs = java.length ? dependencies.flatMap(
|
|
@@ -112442,11 +113016,11 @@ async function compileKotlinGradleLibraries(input) {
|
|
|
112442
113016
|
}
|
|
112443
113017
|
return [...compiled.values()].map(({ klib }) => klib);
|
|
112444
113018
|
}
|
|
112445
|
-
var
|
|
113019
|
+
var import_node_crypto91, import_node_fs144, import_node_path148;
|
|
112446
113020
|
var init_kotlin_gradle_library_plan = __esm({
|
|
112447
113021
|
"src/kotlin-gradle-library-plan.ts"() {
|
|
112448
113022
|
"use strict";
|
|
112449
|
-
|
|
113023
|
+
import_node_crypto91 = require("node:crypto");
|
|
112450
113024
|
import_node_fs144 = __toESM(require("node:fs"), 1);
|
|
112451
113025
|
import_node_path148 = __toESM(require("node:path"), 1);
|
|
112452
113026
|
init_kotlin_library_sources();
|
|
@@ -112903,7 +113477,7 @@ function readExpoTypes(output) {
|
|
|
112903
113477
|
});
|
|
112904
113478
|
}
|
|
112905
113479
|
async function scanSources(tool, parse16, toolchain, moduleRoot, files2) {
|
|
112906
|
-
const digest3 = (0,
|
|
113480
|
+
const digest3 = (0, import_node_crypto92.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
|
|
112907
113481
|
const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
|
|
112908
113482
|
digest3.update(import_node_fs145.default.readFileSync(import_node_path149.default.join(moduleRoot, "sdk.tar.gz")));
|
|
112909
113483
|
digest3.update(tool);
|
|
@@ -113565,7 +114139,7 @@ async function compileKotlin(input, origin) {
|
|
|
113565
114139
|
bytes: import_node_fs145.default.readFileSync(file)
|
|
113566
114140
|
}));
|
|
113567
114141
|
const { composeArchive, ...compilerInputs } = toolchain;
|
|
113568
|
-
const digest3 = (0,
|
|
114142
|
+
const digest3 = (0, import_node_crypto92.createHash)("sha256");
|
|
113569
114143
|
digest3.update(
|
|
113570
114144
|
JSON.stringify({
|
|
113571
114145
|
format: BUILD_FORMAT,
|
|
@@ -113587,7 +114161,7 @@ async function compileKotlin(input, origin) {
|
|
|
113587
114161
|
...gradleLibraries.libraries.flatMap(({ archive, jars }) => [archive, ...jars])
|
|
113588
114162
|
]);
|
|
113589
114163
|
for (const file of files2) {
|
|
113590
|
-
digest3.update((0,
|
|
114164
|
+
digest3.update((0, import_node_crypto92.createHash)("sha256").update(import_node_fs145.default.readFileSync(file)).digest());
|
|
113591
114165
|
}
|
|
113592
114166
|
}
|
|
113593
114167
|
if (viewModels) digest3.update(viewModels.toolClass);
|
|
@@ -113879,12 +114453,12 @@ async function serveKotlinRequest(pathname, res, app) {
|
|
|
113879
114453
|
}
|
|
113880
114454
|
return true;
|
|
113881
114455
|
}
|
|
113882
|
-
var import_node_child_process70,
|
|
114456
|
+
var import_node_child_process70, import_node_crypto92, import_node_fs145, import_node_module24, import_node_path149, import_node_util22, run15, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal2, CONTENT_TYPES;
|
|
113883
114457
|
var init_kotlin_host = __esm({
|
|
113884
114458
|
"src/kotlin-host.ts"() {
|
|
113885
114459
|
"use strict";
|
|
113886
114460
|
import_node_child_process70 = require("node:child_process");
|
|
113887
|
-
|
|
114461
|
+
import_node_crypto92 = require("node:crypto");
|
|
113888
114462
|
import_node_fs145 = __toESM(require("node:fs"), 1);
|
|
113889
114463
|
import_node_module24 = require("node:module");
|
|
113890
114464
|
import_node_path149 = __toESM(require("node:path"), 1);
|
|
@@ -114727,7 +115301,7 @@ __export(bundle_channel_exports, {
|
|
|
114727
115301
|
snapshotOneProductionBundle: () => snapshotOneProductionBundle
|
|
114728
115302
|
});
|
|
114729
115303
|
module.exports = __toCommonJS(bundle_channel_exports);
|
|
114730
|
-
var
|
|
115304
|
+
var import_node_crypto94 = require("node:crypto");
|
|
114731
115305
|
var import_node_fs153 = require("node:fs");
|
|
114732
115306
|
var import_node_path158 = require("node:path");
|
|
114733
115307
|
var import_node_vm = require("node:vm");
|
|
@@ -114814,6 +115388,8 @@ async function buildIosSwiftBundles(projectRoot) {
|
|
|
114814
115388
|
url: linked.url,
|
|
114815
115389
|
hash: linked.hash,
|
|
114816
115390
|
icuUrl: linked.icuUrl,
|
|
115391
|
+
...linked.sdkUrl ? { sdkUrl: linked.sdkUrl } : {},
|
|
115392
|
+
...linked.sdkBindingUrl ? { sdkBindingUrl: linked.sdkBindingUrl } : {},
|
|
114817
115393
|
rootId: `${linked.rootId.split("/")[0]}/OneSDK`,
|
|
114818
115394
|
bundleFiles: linked.bundleFiles ?? {},
|
|
114819
115395
|
modules: oneSDK.modules
|
|
@@ -114878,7 +115454,9 @@ function insertNativeBundleFooters(source, natives, locate) {
|
|
|
114878
115454
|
modules: natives.expoSwift.metadata.modules.map((artifact) => ({
|
|
114879
115455
|
...artifact,
|
|
114880
115456
|
url: served(artifact.url),
|
|
114881
|
-
icuUrl: served(artifact.icuUrl)
|
|
115457
|
+
icuUrl: served(artifact.icuUrl),
|
|
115458
|
+
...artifact.sdkUrl ? { sdkUrl: served(artifact.sdkUrl) } : {},
|
|
115459
|
+
...artifact.sdkBindingUrl ? { sdkBindingUrl: served(artifact.sdkBindingUrl) } : {}
|
|
114882
115460
|
}))
|
|
114883
115461
|
};
|
|
114884
115462
|
source = insertExpoSwiftFooter(source, metadata.expoSwift);
|
|
@@ -114923,7 +115501,7 @@ init_expo_native_workspace();
|
|
|
114923
115501
|
|
|
114924
115502
|
// src/host/staged-host-files.ts
|
|
114925
115503
|
var import_node_async_hooks5 = require("node:async_hooks");
|
|
114926
|
-
var
|
|
115504
|
+
var import_node_crypto93 = require("node:crypto");
|
|
114927
115505
|
var import_node_fs148 = __toESM(require("node:fs"), 1);
|
|
114928
115506
|
var import_node_path152 = __toESM(require("node:path"), 1);
|
|
114929
115507
|
|
|
@@ -115055,10 +115633,10 @@ function stageHostBytes(bytes, origin, extension = "") {
|
|
|
115055
115633
|
}
|
|
115056
115634
|
async function stageHostDerivedBytes(input, producer, origin, extension, derive) {
|
|
115057
115635
|
const directory2 = prepareStagedDirectory();
|
|
115058
|
-
const inputDigest = (0,
|
|
115636
|
+
const inputDigest = (0, import_node_crypto93.createHash)("sha256").update(input).digest("hex");
|
|
115059
115637
|
const index = import_node_path152.default.join(
|
|
115060
115638
|
directory2,
|
|
115061
|
-
`derived-${(0,
|
|
115639
|
+
`derived-${(0, import_node_crypto93.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
|
|
115062
115640
|
);
|
|
115063
115641
|
const recorded = import_node_fs148.default.existsSync(index) ? import_node_fs148.default.readFileSync(index, "utf8") : "";
|
|
115064
115642
|
if (STAGED_NAME.test(recorded) && import_node_fs148.default.existsSync(import_node_path152.default.join(directory2, recorded))) {
|
|
@@ -115069,7 +115647,7 @@ async function stageHostDerivedBytes(input, producer, origin, extension, derive)
|
|
|
115069
115647
|
return new URL(STAGED_PREFIX + recorded, origin).toString();
|
|
115070
115648
|
}
|
|
115071
115649
|
const staged = writeStagedBytes(await derive(), origin, extension, directory2);
|
|
115072
|
-
const temporary = import_node_path152.default.join(directory2, (0,
|
|
115650
|
+
const temporary = import_node_path152.default.join(directory2, (0, import_node_crypto93.randomUUID)());
|
|
115073
115651
|
try {
|
|
115074
115652
|
import_node_fs148.default.writeFileSync(temporary, new URL(staged).pathname.slice(STAGED_PREFIX.length), {
|
|
115075
115653
|
flag: "wx"
|
|
@@ -115094,7 +115672,7 @@ function prepareStagedDirectory() {
|
|
|
115094
115672
|
return directory2;
|
|
115095
115673
|
}
|
|
115096
115674
|
function writeStagedBytes(bytes, origin, extension, directory2) {
|
|
115097
|
-
const digest3 = (0,
|
|
115675
|
+
const digest3 = (0, import_node_crypto93.createHash)("sha256").update(bytes).digest("hex");
|
|
115098
115676
|
extension = extension.toLowerCase();
|
|
115099
115677
|
const name3 = STAGED_NAME.test(digest3 + extension) ? digest3 + extension : digest3;
|
|
115100
115678
|
stagedCapture.getStore()?.add(name3);
|
|
@@ -115103,7 +115681,7 @@ function writeStagedBytes(bytes, origin, extension, directory2) {
|
|
|
115103
115681
|
if (import_node_fs148.default.existsSync(destination)) {
|
|
115104
115682
|
import_node_fs148.default.utimesSync(destination, new Date(now), new Date(now));
|
|
115105
115683
|
} else {
|
|
115106
|
-
const temporary = import_node_path152.default.join(directory2, (0,
|
|
115684
|
+
const temporary = import_node_path152.default.join(directory2, (0, import_node_crypto93.randomUUID)());
|
|
115107
115685
|
try {
|
|
115108
115686
|
import_node_fs148.default.writeFileSync(temporary, bytes, { flag: "wx" });
|
|
115109
115687
|
import_node_fs148.default.renameSync(temporary, destination);
|
|
@@ -115400,7 +115978,7 @@ async function discoverProjectOneNativeAppCatalog(projectRoot, assetOrigin) {
|
|
|
115400
115978
|
}
|
|
115401
115979
|
|
|
115402
115980
|
// src/bundle-channel.mjs
|
|
115403
|
-
var digest2 = (bytes) => (0,
|
|
115981
|
+
var digest2 = (bytes) => (0, import_node_crypto94.createHash)("sha256").update(bytes).digest("hex");
|
|
115404
115982
|
var segment2 = /^[a-zA-Z0-9._-]+$/;
|
|
115405
115983
|
function packagedAssetDirectory(location) {
|
|
115406
115984
|
const parsed2 = new URL(location, "https://packaged.invalid");
|
|
@@ -115506,7 +116084,7 @@ async function prepareChannel({
|
|
|
115506
116084
|
files2.set(asset.path, asset.bytes);
|
|
115507
116085
|
}
|
|
115508
116086
|
}
|
|
115509
|
-
const identity2 = (0,
|
|
116087
|
+
const identity2 = (0, import_node_crypto94.createHash)("sha256").update(bundle).update(icon);
|
|
115510
116088
|
for (const [path145, bytes] of [...files2].sort(
|
|
115511
116089
|
([a], [b]) => a < b ? -1 : a > b ? 1 : 0
|
|
115512
116090
|
)) {
|