peachsim 0.1.2746 → 0.1.2748
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/outbound-endpoints.ts +19 -9
- 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 +3902 -3889
- 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 +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-QOTAOF5Z.mjs → acorn-VEWLHGUF.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-QST2EJ23.mjs → chunk-4QUOVEXG.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-JBA5MZXI.mjs → chunk-62Z4HAA5.mjs} +16 -15
- package/dist-lib/esm-chunks/{chunk-L7AI2APK.mjs → chunk-6ZVR2CVC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4NBVXIZE.mjs → chunk-A2EC74CI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-TMC5X24U.mjs → chunk-BYYBOHZI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2WXEOIBB.mjs → chunk-C6IVVMZN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-3NVVAQSW.mjs → chunk-GWZFPIGW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-TEIXMLXF.mjs → chunk-HMPLB7MA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ZIB7E2UZ.mjs → chunk-HPANCGMI.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-LJCRY4MG.mjs → chunk-HRS3DSAZ.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-VU3BUF6L.mjs → chunk-I3KV46CL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GT4KPY7G.mjs → chunk-IE2LTKEG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ZJOVVIFO.mjs → chunk-KD3TI7UV.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-5HNCEXGF.mjs → chunk-KNNMOD5T.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-XLZ2P347.mjs → chunk-NNVYKFSY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JWQYDDFF.mjs → chunk-RU7J2QST.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ZQQKJLZG.mjs → chunk-TQACQLZ6.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BBTAOM4S.mjs → chunk-TW5FZFU7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4IWPN4FR.mjs → chunk-U5SZIAIF.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-LCAHUXRX.mjs → chunk-UFQHPARI.mjs} +199 -197
- package/dist-lib/esm-chunks/{chunk-RHXTAMFH.mjs → chunk-UNOAFCHH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-PGBXZIRW.mjs → chunk-VKYISXKK.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-HCGHGGZY.mjs → chunk-WN22FGGA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SGCTCFCQ.mjs → chunk-XM3QYC5V.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-4PCWGBJT.mjs → metro-layout-parser-B74NVOKQ.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-FVIN2AH2.mjs → swift-package-prebuilt-B4QBXBQL.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-YTTAJZSA.mjs → swift-sdk-app-module-5OCMAJPP.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-GHK7ZE4W.mjs → swift-sdk-image-LQKEASAW.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-C7JWU22H.mjs → swift-sdk-image-producer-ZMYZXL7Z.mjs} +8 -7
- package/dist-lib/expo-swift-bundle.cjs +143 -130
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +434 -421
- package/dist-lib/host/fetch-proxy-handler.cjs +15 -8
- 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 +86 -85
- package/dist-lib/public-origins-lib.json +73 -67
- 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 +434 -421
- package/dist-lib/swift-compile.cjs +124 -115
- 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/canvaskit/graphite.d.ts +13 -0
- package/dist-types/packages/peach-engine/src/engine/native-paint-facts.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/engine/paint-value-input.d.ts +7 -0
- package/dist-types/packages/peach-engine/src/engine/scene-native-binding.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/canvaskit-webgpu.d.ts +2 -19
- package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/render-worker/native-hot-ops.d.ts +2 -2
- package/package.json +1 -1
- package/src/expo-swift-host.ts +4 -0
- package/src/one-native-controls-package.ts +5 -5
- package/src/one-sdk-bundle.ts +1 -1
- package/src/swift-compiler-digest.ts +1 -0
- package/src/swift-objc-compile.ts +4 -5
- package/src/swift-objc-prebuilt.ts +2 -2
- package/src/swift-pdf-raster.ts +2 -2
- package/src/swift-sdk-image-producer.ts +2 -1
- package/src/swift-sdk-surface.ts +4 -120
- package/src/swift-source-pods.ts +3 -3
- package/src/one-sdk/shard.ts +0 -382
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2748 | (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;
|
|
@@ -6177,7 +6177,7 @@ var init_swift_objc_sdk_tree = __esm({
|
|
|
6177
6177
|
|
|
6178
6178
|
// src/swift-compiler-digest.ts
|
|
6179
6179
|
function swiftArchiveCompilerDigestValue() {
|
|
6180
|
-
return true ? "
|
|
6180
|
+
return true ? "99ae71a024c1f7e48133d193acd1d2f2b0738fcbc5e5291800fd396afb31897b" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
|
|
6181
6181
|
}
|
|
6182
6182
|
var import_node_crypto10, import_node_fs25, import_node_path25, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
|
|
6183
6183
|
var init_swift_compiler_digest = __esm({
|
|
@@ -6190,6 +6190,7 @@ var init_swift_compiler_digest = __esm({
|
|
|
6190
6190
|
SWIFT_DIGEST_SOURCES = [
|
|
6191
6191
|
"swift-compile.ts",
|
|
6192
6192
|
"swift-sdk-surface.ts",
|
|
6193
|
+
"../../peach-globals/build/swift-source-mask.ts",
|
|
6193
6194
|
"swift-wasm-archive.ts",
|
|
6194
6195
|
"swift-lexical.ts",
|
|
6195
6196
|
"swift-header-compiler.ts",
|
|
@@ -6322,13 +6323,13 @@ var init_swift_standin_digest = __esm({
|
|
|
6322
6323
|
];
|
|
6323
6324
|
RUNTIME_IMPORT = /(?:^|[;\n])[ \t]*(?:import|export)\s+(?!type(?:\s|\{))([\s\S]*?)\s+from\s*['"]([^'"]+)['"]|(?:^|[;\n])[ \t]*import\s+['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
6324
6325
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES);
|
|
6325
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
6326
|
+
STANDIN_SOURCE_DIGEST = true ? "a17a387bf80ef3648c26193901ee6a7cb9abc691b99809c6a8bf9ad4617836af" : standinSourceDigest();
|
|
6326
6327
|
}
|
|
6327
6328
|
});
|
|
6328
6329
|
|
|
6329
6330
|
// src/expo-native-compiler-digest.ts
|
|
6330
6331
|
function expoNativeCompilerDigestValue() {
|
|
6331
|
-
return true ? "
|
|
6332
|
+
return true ? "3c2822a0dd3afa16e099b22ab6970a7d2276823c6d9aa2d72292a87fd8077fad" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
6332
6333
|
}
|
|
6333
6334
|
var import_node_crypto12;
|
|
6334
6335
|
var init_expo_native_compiler_digest = __esm({
|
|
@@ -41690,6 +41691,122 @@ var init_swift_lexical = __esm({
|
|
|
41690
41691
|
}
|
|
41691
41692
|
});
|
|
41692
41693
|
|
|
41694
|
+
// ../peach-globals/build/swift-source-mask.ts
|
|
41695
|
+
function maskSwiftCode(source) {
|
|
41696
|
+
const chars2 = source.split("");
|
|
41697
|
+
const blank = (from, to) => {
|
|
41698
|
+
for (let i = Math.max(0, from); i < Math.min(to, chars2.length); i++)
|
|
41699
|
+
if (chars2[i] !== "\n") chars2[i] = " ";
|
|
41700
|
+
};
|
|
41701
|
+
const hashesAt = (at) => {
|
|
41702
|
+
let end = at;
|
|
41703
|
+
while (source[end] === "#") end++;
|
|
41704
|
+
return end - at;
|
|
41705
|
+
};
|
|
41706
|
+
const scanString = (quote3, hashes) => {
|
|
41707
|
+
const multiline = source.startsWith('"""', quote3);
|
|
41708
|
+
let i = quote3 + (multiline ? 3 : 1);
|
|
41709
|
+
const keep = [];
|
|
41710
|
+
const quoteEnd = (at) => {
|
|
41711
|
+
const mark = multiline ? '"""' : '"';
|
|
41712
|
+
return source.startsWith(mark, at) && source.startsWith("#".repeat(hashes), at + mark.length);
|
|
41713
|
+
};
|
|
41714
|
+
while (i < chars2.length) {
|
|
41715
|
+
if (source[i] === "\\" && source.startsWith("#".repeat(hashes), i + 1)) {
|
|
41716
|
+
const escaped = i + 1 + hashes;
|
|
41717
|
+
if (source[escaped] === "(") {
|
|
41718
|
+
const codeStart = escaped + 1;
|
|
41719
|
+
const codeEnd = scanCode(codeStart, true);
|
|
41720
|
+
keep.push([codeStart, codeEnd]);
|
|
41721
|
+
i = codeEnd + 1;
|
|
41722
|
+
} else {
|
|
41723
|
+
i = escaped + 1;
|
|
41724
|
+
}
|
|
41725
|
+
continue;
|
|
41726
|
+
}
|
|
41727
|
+
if (quoteEnd(i)) {
|
|
41728
|
+
const close2 = i + (multiline ? 3 : 1) + hashes;
|
|
41729
|
+
let cursor = quote3 - hashes;
|
|
41730
|
+
const ranges = [...keep, [close2, close2]];
|
|
41731
|
+
for (const [from, to] of ranges)
|
|
41732
|
+
if (from > cursor) {
|
|
41733
|
+
blank(cursor, from);
|
|
41734
|
+
cursor = to;
|
|
41735
|
+
} else cursor = Math.max(cursor, to);
|
|
41736
|
+
return close2;
|
|
41737
|
+
}
|
|
41738
|
+
i++;
|
|
41739
|
+
}
|
|
41740
|
+
blank(quote3 - hashes, chars2.length);
|
|
41741
|
+
return chars2.length;
|
|
41742
|
+
};
|
|
41743
|
+
const scanCode = (i, nested) => {
|
|
41744
|
+
let parens = 0;
|
|
41745
|
+
while (i < chars2.length) {
|
|
41746
|
+
const char = source[i];
|
|
41747
|
+
if (char === "/" && source[i + 1] === "/") {
|
|
41748
|
+
const end = source.indexOf("\n", i);
|
|
41749
|
+
blank(i, end === -1 ? chars2.length : end);
|
|
41750
|
+
i = end === -1 ? chars2.length : end;
|
|
41751
|
+
continue;
|
|
41752
|
+
}
|
|
41753
|
+
if (char === "/" && source[i + 1] === "*") {
|
|
41754
|
+
let j = i + 2;
|
|
41755
|
+
let depth = 1;
|
|
41756
|
+
while (j < chars2.length && depth > 0) {
|
|
41757
|
+
if (source.startsWith("/*", j)) {
|
|
41758
|
+
depth++;
|
|
41759
|
+
j += 2;
|
|
41760
|
+
} else if (source.startsWith("*/", j)) {
|
|
41761
|
+
depth--;
|
|
41762
|
+
j += 2;
|
|
41763
|
+
} else j++;
|
|
41764
|
+
}
|
|
41765
|
+
blank(i, j);
|
|
41766
|
+
i = j;
|
|
41767
|
+
continue;
|
|
41768
|
+
}
|
|
41769
|
+
if (char === "#") {
|
|
41770
|
+
const hashes = hashesAt(i);
|
|
41771
|
+
const at = i + hashes;
|
|
41772
|
+
if (source[at] === '"') {
|
|
41773
|
+
i = scanString(at, hashes);
|
|
41774
|
+
continue;
|
|
41775
|
+
}
|
|
41776
|
+
if (hashes > 0 && source[at] === "/") {
|
|
41777
|
+
const mark = "#".repeat(hashes);
|
|
41778
|
+
let j = at + 1;
|
|
41779
|
+
while (j < chars2.length && !(source[j] === "/" && source.startsWith(mark, j + 1)))
|
|
41780
|
+
j++;
|
|
41781
|
+
blank(i, Math.min(chars2.length, j + 1 + hashes));
|
|
41782
|
+
i = Math.min(chars2.length, j + 1 + hashes);
|
|
41783
|
+
continue;
|
|
41784
|
+
}
|
|
41785
|
+
i++;
|
|
41786
|
+
continue;
|
|
41787
|
+
}
|
|
41788
|
+
if (char === '"') {
|
|
41789
|
+
i = scanString(i, 0);
|
|
41790
|
+
continue;
|
|
41791
|
+
}
|
|
41792
|
+
if (char === "(") parens++;
|
|
41793
|
+
else if (char === ")") {
|
|
41794
|
+
if (nested && parens === 0) return i;
|
|
41795
|
+
parens--;
|
|
41796
|
+
}
|
|
41797
|
+
i++;
|
|
41798
|
+
}
|
|
41799
|
+
return i;
|
|
41800
|
+
};
|
|
41801
|
+
scanCode(0, false);
|
|
41802
|
+
return chars2.join("");
|
|
41803
|
+
}
|
|
41804
|
+
var init_swift_source_mask = __esm({
|
|
41805
|
+
"../peach-globals/build/swift-source-mask.ts"() {
|
|
41806
|
+
"use strict";
|
|
41807
|
+
}
|
|
41808
|
+
});
|
|
41809
|
+
|
|
41693
41810
|
// src/swift-sdk-surface.ts
|
|
41694
41811
|
function swiftBuildJobs() {
|
|
41695
41812
|
const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
|
|
@@ -42377,115 +42494,6 @@ function swiftCodeMask(source) {
|
|
|
42377
42494
|
codeMaskChars += source.length;
|
|
42378
42495
|
return masked;
|
|
42379
42496
|
}
|
|
42380
|
-
function maskSwiftCode(source) {
|
|
42381
|
-
const chars2 = source.split("");
|
|
42382
|
-
const blank = (from, to) => {
|
|
42383
|
-
for (let i = Math.max(0, from); i < Math.min(to, chars2.length); i++)
|
|
42384
|
-
if (chars2[i] !== "\n") chars2[i] = " ";
|
|
42385
|
-
};
|
|
42386
|
-
const hashesAt = (at) => {
|
|
42387
|
-
let end = at;
|
|
42388
|
-
while (source[end] === "#") end++;
|
|
42389
|
-
return end - at;
|
|
42390
|
-
};
|
|
42391
|
-
const scanString = (quote3, hashes) => {
|
|
42392
|
-
const multiline = source.startsWith('"""', quote3);
|
|
42393
|
-
let i = quote3 + (multiline ? 3 : 1);
|
|
42394
|
-
const keep = [];
|
|
42395
|
-
const quoteEnd = (at) => {
|
|
42396
|
-
const mark = multiline ? '"""' : '"';
|
|
42397
|
-
return source.startsWith(mark, at) && source.startsWith("#".repeat(hashes), at + mark.length);
|
|
42398
|
-
};
|
|
42399
|
-
while (i < chars2.length) {
|
|
42400
|
-
if (source[i] === "\\" && source.startsWith("#".repeat(hashes), i + 1)) {
|
|
42401
|
-
const escaped = i + 1 + hashes;
|
|
42402
|
-
if (source[escaped] === "(") {
|
|
42403
|
-
const codeStart = escaped + 1;
|
|
42404
|
-
const codeEnd = scanCode(codeStart, true);
|
|
42405
|
-
keep.push([codeStart, codeEnd]);
|
|
42406
|
-
i = codeEnd + 1;
|
|
42407
|
-
} else {
|
|
42408
|
-
i = escaped + 1;
|
|
42409
|
-
}
|
|
42410
|
-
continue;
|
|
42411
|
-
}
|
|
42412
|
-
if (quoteEnd(i)) {
|
|
42413
|
-
const close2 = i + (multiline ? 3 : 1) + hashes;
|
|
42414
|
-
let cursor = quote3 - hashes;
|
|
42415
|
-
const ranges = [...keep, [close2, close2]];
|
|
42416
|
-
for (const [from, to] of ranges)
|
|
42417
|
-
if (from > cursor) {
|
|
42418
|
-
blank(cursor, from);
|
|
42419
|
-
cursor = to;
|
|
42420
|
-
} else cursor = Math.max(cursor, to);
|
|
42421
|
-
return close2;
|
|
42422
|
-
}
|
|
42423
|
-
i++;
|
|
42424
|
-
}
|
|
42425
|
-
blank(quote3 - hashes, chars2.length);
|
|
42426
|
-
return chars2.length;
|
|
42427
|
-
};
|
|
42428
|
-
const scanCode = (i, nested) => {
|
|
42429
|
-
let parens = 0;
|
|
42430
|
-
while (i < chars2.length) {
|
|
42431
|
-
const char = source[i];
|
|
42432
|
-
if (char === "/" && source[i + 1] === "/") {
|
|
42433
|
-
const end = source.indexOf("\n", i);
|
|
42434
|
-
blank(i, end === -1 ? chars2.length : end);
|
|
42435
|
-
i = end === -1 ? chars2.length : end;
|
|
42436
|
-
continue;
|
|
42437
|
-
}
|
|
42438
|
-
if (char === "/" && source[i + 1] === "*") {
|
|
42439
|
-
let j = i + 2;
|
|
42440
|
-
let depth = 1;
|
|
42441
|
-
while (j < chars2.length && depth > 0) {
|
|
42442
|
-
if (source.startsWith("/*", j)) {
|
|
42443
|
-
depth++;
|
|
42444
|
-
j += 2;
|
|
42445
|
-
} else if (source.startsWith("*/", j)) {
|
|
42446
|
-
depth--;
|
|
42447
|
-
j += 2;
|
|
42448
|
-
} else j++;
|
|
42449
|
-
}
|
|
42450
|
-
blank(i, j);
|
|
42451
|
-
i = j;
|
|
42452
|
-
continue;
|
|
42453
|
-
}
|
|
42454
|
-
if (char === "#") {
|
|
42455
|
-
const hashes = hashesAt(i);
|
|
42456
|
-
const at = i + hashes;
|
|
42457
|
-
if (source[at] === '"') {
|
|
42458
|
-
i = scanString(at, hashes);
|
|
42459
|
-
continue;
|
|
42460
|
-
}
|
|
42461
|
-
if (hashes > 0 && source[at] === "/") {
|
|
42462
|
-
const mark = "#".repeat(hashes);
|
|
42463
|
-
let j = at + 1;
|
|
42464
|
-
while (j < chars2.length && !(source[j] === "/" && source.startsWith(mark, j + 1)))
|
|
42465
|
-
j++;
|
|
42466
|
-
blank(i, Math.min(chars2.length, j + 1 + hashes));
|
|
42467
|
-
i = Math.min(chars2.length, j + 1 + hashes);
|
|
42468
|
-
continue;
|
|
42469
|
-
}
|
|
42470
|
-
i++;
|
|
42471
|
-
continue;
|
|
42472
|
-
}
|
|
42473
|
-
if (char === '"') {
|
|
42474
|
-
i = scanString(i, 0);
|
|
42475
|
-
continue;
|
|
42476
|
-
}
|
|
42477
|
-
if (char === "(") parens++;
|
|
42478
|
-
else if (char === ")") {
|
|
42479
|
-
if (nested && parens === 0) return i;
|
|
42480
|
-
parens--;
|
|
42481
|
-
}
|
|
42482
|
-
i++;
|
|
42483
|
-
}
|
|
42484
|
-
return i;
|
|
42485
|
-
};
|
|
42486
|
-
scanCode(0, false);
|
|
42487
|
-
return chars2.join("");
|
|
42488
|
-
}
|
|
42489
42497
|
function foundationOwnerOf(name3) {
|
|
42490
42498
|
if (name3 === "NSKeyValueObservedChange" || name3 === "NSKeyValueObservation")
|
|
42491
42499
|
return "PeachObjC";
|
|
@@ -42670,8 +42678,9 @@ function swiftModuleToolchain(root) {
|
|
|
42670
42678
|
}
|
|
42671
42679
|
function remoteSwiftCheckouts(root) {
|
|
42672
42680
|
const key2 = (0, import_node_crypto39.createHash)("sha256").update((0, import_node_fs68.realpathSync)(root)).digest("hex").slice(0, 32);
|
|
42673
|
-
|
|
42674
|
-
|
|
42681
|
+
const cache = swiftCacheDir();
|
|
42682
|
+
(0, import_node_fs68.mkdirSync)(cache, { recursive: true });
|
|
42683
|
+
return import_node_path68.default.join((0, import_node_fs68.realpathSync)(cache), "swift-packages", key2, "checkouts");
|
|
42675
42684
|
}
|
|
42676
42685
|
var import_node_child_process32, import_node_crypto39, import_node_fs68, import_node_os12, import_node_path68, distributionManifests, distributionCompileViews, REACH_STAGED_FRAMEWORKS, objcEnumerations, clangDeclarationEnumCache, objcEnumForward, sdkDeclarationOwners, swiftInterfaceDeclarations, linkedModuleDigests, compileSurfaces, SWIFT_IMPORT, kleeneNot, kleeneAnd, kleeneOr, NON_IOS_MODULES, importNamesCache, sdkPaths, FOUNDATION_IMPLICIT_MODULES, FRAMEWORK_COMPANION_IMPORT, codeMasks, codeMaskChars, CODE_MASK_CACHE_CHARS, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, emptyMacroEnvironment, wasmMacroEnvironment, swiftBinaryOnDisk;
|
|
42677
42686
|
var init_swift_sdk_surface = __esm({
|
|
@@ -42682,8 +42691,8 @@ var init_swift_sdk_surface = __esm({
|
|
|
42682
42691
|
import_node_fs68 = require("node:fs");
|
|
42683
42692
|
import_node_os12 = __toESM(require("node:os"), 1);
|
|
42684
42693
|
import_node_path68 = __toESM(require("node:path"), 1);
|
|
42694
|
+
init_swift_source_mask();
|
|
42685
42695
|
init_admitted_mac_build();
|
|
42686
|
-
init_home_paths();
|
|
42687
42696
|
init_swift_distribution_contract();
|
|
42688
42697
|
init_swift_package();
|
|
42689
42698
|
init_swift_shared_sdk();
|
|
@@ -44574,7 +44583,8 @@ async function produceSwiftSdkImage(input) {
|
|
|
44574
44583
|
import_node_path72.default.join(directory3, "snapshot"),
|
|
44575
44584
|
requestFile,
|
|
44576
44585
|
import_node_path72.default.join(directory3, "delivery"),
|
|
44577
|
-
input.frameworkKey
|
|
44586
|
+
input.frameworkKey,
|
|
44587
|
+
process.env.CONTRAST_LAND_CHECK === "1" ? "1" : ""
|
|
44578
44588
|
],
|
|
44579
44589
|
{ cwd: repo }
|
|
44580
44590
|
);
|
|
@@ -44662,7 +44672,7 @@ mv "$1.tmp" "$1"
|
|
|
44662
44672
|
shift
|
|
44663
44673
|
export GIT_ALTERNATE_OBJECT_DIRECTORIES="$2/objects"
|
|
44664
44674
|
set +e
|
|
44665
|
-
env -u TM_WINDOW -u TM_WAIT_DEADLINE_MS -u TM_EXEC_OUTER_DEADLINE_MS -u REMOTE_BUILD_DEADLINE -u TM_EXEC_ADMITTED -u LINUX_BUILD_SCOPE -u TM_EXEC_CPU_CORES -u TM_EXEC_LINUX_MEMORY_MAX -u CONTRAST_HEAVY_ADMITTED -u CONTRAST_HEAVY_CPU_CORES tm exec --local --kind build-linux --cores "$1" --timeout 90m --param wait=true --param job-kind=swift-sdk-image --param "source-snapshot=$2" --param "delivery-dir=$4" --param "serial-key=swift-sdk-$5" -- bun scripts/ops/produce-swift-sdk-image.ts "$3" </dev/null
|
|
44675
|
+
env -u TM_WINDOW -u TM_WAIT_DEADLINE_MS -u TM_EXEC_OUTER_DEADLINE_MS -u REMOTE_BUILD_DEADLINE -u TM_EXEC_ADMITTED -u LINUX_BUILD_SCOPE -u TM_EXEC_CPU_CORES -u TM_EXEC_LINUX_MEMORY_MAX -u CONTRAST_HEAVY_ADMITTED -u CONTRAST_HEAVY_CPU_CORES CONTRAST_LAND_CHECK="$6" tm exec --local --kind build-linux --cores "$1" --timeout 90m --param wait=true --param job-kind=swift-sdk-image --param "source-snapshot=$2" --param "delivery-dir=$4" --param "serial-key=swift-sdk-$5" -- bun scripts/ops/produce-swift-sdk-image.ts "$3" </dev/null
|
|
44666
44676
|
status=$?
|
|
44667
44677
|
if bun -e 'try { if (JSON.parse(require("node:fs").readFileSync(process.argv[1], "utf8")).released !== true) process.exit(1) } catch { process.exit(1) }' "$4/cleanup.json"; then rm -rf "$2"; fi
|
|
44668
44678
|
exit "$status"
|
|
@@ -48658,9 +48668,9 @@ var init_swift_objc_prebuilt = __esm({
|
|
|
48658
48668
|
import_node_path79 = __toESM(require("node:path"), 1);
|
|
48659
48669
|
init_internal_child_contract();
|
|
48660
48670
|
init_self_invocation();
|
|
48661
|
-
init_home_paths();
|
|
48662
48671
|
init_native_prebuilt();
|
|
48663
48672
|
init_swift_objc_prebuilt_catalog();
|
|
48673
|
+
init_swift_toolchain();
|
|
48664
48674
|
quote2 = (value) => "'" + value.replaceAll("'", "'\\''") + "'";
|
|
48665
48675
|
}
|
|
48666
48676
|
});
|
|
@@ -54980,7 +54990,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
|
|
|
54980
54990
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
54981
54991
|
MULTI_MANIFEST_VERSION = 76;
|
|
54982
54992
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
54983
|
-
compilerSourceDigest = true ? "
|
|
54993
|
+
compilerSourceDigest = true ? "9e800b4e5695e0ea16860a945e2ba4dd9efa69f299d64b77b74c6197d9d31df6" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
|
|
54984
54994
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
54985
54995
|
MODULE_MAP_RESPONSE_FILE_RUN = 16;
|
|
54986
54996
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
@@ -88667,7 +88677,7 @@ function cachedBinaryFileDigest(file) {
|
|
|
88667
88677
|
const stamp = `${stat2.dev}:${stat2.ino}:${stat2.size}:${stat2.mtimeNs}:${stat2.ctimeNs}`;
|
|
88668
88678
|
const memory = binaryFileDigests.get(real);
|
|
88669
88679
|
if (memory?.stamp === stamp) return memory.digest;
|
|
88670
|
-
const dir = import_node_path124.default.join(
|
|
88680
|
+
const dir = import_node_path124.default.join(swiftCacheDir(), "swift-binary-digests");
|
|
88671
88681
|
const record6 = import_node_path124.default.join(dir, `${sha256Hex6(real)}.json`);
|
|
88672
88682
|
if (import_node_fs120.default.existsSync(record6)) {
|
|
88673
88683
|
const saved = JSON.parse(import_node_fs120.default.readFileSync(record6, "utf8"));
|
|
@@ -89261,7 +89271,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
|
|
|
89261
89271
|
[...providers].map(([name3, file]) => [name3, digest3(import_node_fs120.default.readFileSync(file))])
|
|
89262
89272
|
)
|
|
89263
89273
|
};
|
|
89264
|
-
const parent = import_node_path124.default.join(
|
|
89274
|
+
const parent = import_node_path124.default.join(swiftCacheDir(), "swift-xcode-products");
|
|
89265
89275
|
import_node_fs120.default.mkdirSync(parent, { recursive: true });
|
|
89266
89276
|
const key2 = digest3(JSON.stringify(identity2));
|
|
89267
89277
|
const work = import_node_path124.default.join(parent, key2);
|
|
@@ -89599,7 +89609,7 @@ async function prepareXcodeNativeInputs(app, binaries, moduleRoot, purpose) {
|
|
|
89599
89609
|
derivations,
|
|
89600
89610
|
swiftProducts: products?.receipt
|
|
89601
89611
|
};
|
|
89602
|
-
const parent = import_node_path124.default.join(
|
|
89612
|
+
const parent = import_node_path124.default.join(swiftCacheDir(), "swift-objc-implementations");
|
|
89603
89613
|
import_node_fs120.default.mkdirSync(parent, { recursive: true });
|
|
89604
89614
|
const key2 = digest3(JSON.stringify(identity2));
|
|
89605
89615
|
const work = import_node_path124.default.join(parent, key2);
|
|
@@ -89964,7 +89974,6 @@ var init_swift_objc_compile = __esm({
|
|
|
89964
89974
|
import_node_fs120 = __toESM(require("node:fs"), 1);
|
|
89965
89975
|
import_node_path124 = __toESM(require("node:path"), 1);
|
|
89966
89976
|
init_mapLimit();
|
|
89967
|
-
init_home_paths();
|
|
89968
89977
|
init_is_record();
|
|
89969
89978
|
init_swift_objc_import();
|
|
89970
89979
|
init_swift_objc_runtime();
|
|
@@ -97751,7 +97760,7 @@ function rasterizePdfFiles(inputs2, { imageBytes, imageTotalBytes } = { imageByt
|
|
|
97751
97760
|
const rendered = /* @__PURE__ */ new Map();
|
|
97752
97761
|
const pending2 = /* @__PURE__ */ new Map();
|
|
97753
97762
|
const renderer = process.platform === "darwin" ? "30774891a9db216d" : "pdfium-1";
|
|
97754
|
-
const cache =
|
|
97763
|
+
const cache = swiftCacheDir();
|
|
97755
97764
|
const cached4 = (sha2565) => import_node_path132.default.join(cache, `swift-pdf-png-${renderer}-${sha2565}.png`);
|
|
97756
97765
|
let remainingBytes = imageTotalBytes;
|
|
97757
97766
|
const record6 = ({ file, sha256: sha2565 }, bytes) => {
|
|
@@ -97837,7 +97846,7 @@ var init_swift_pdf_raster = __esm({
|
|
|
97837
97846
|
import_node_path132 = __toESM(require("node:path"), 1);
|
|
97838
97847
|
init_internal_child_contract();
|
|
97839
97848
|
init_self_invocation();
|
|
97840
|
-
|
|
97849
|
+
init_swift_toolchain();
|
|
97841
97850
|
RASTER_PDF = `
|
|
97842
97851
|
ObjC.import('Foundation')
|
|
97843
97852
|
ObjC.import('CoreGraphics')
|
|
@@ -111576,6 +111585,10 @@ function installSwiftInputTrace() {
|
|
|
111576
111585
|
import_node_path146.default.join(cacheDir(), "swift-builds"),
|
|
111577
111586
|
import_node_path146.default.join(swiftCacheDir(), "swift-builds"),
|
|
111578
111587
|
import_node_path146.default.join(swiftCacheDir(), "swift-sdk-views"),
|
|
111588
|
+
import_node_path146.default.join(swiftCacheDir(), "swift-binary-digests"),
|
|
111589
|
+
import_node_path146.default.join(swiftCacheDir(), "swift-xcode-products"),
|
|
111590
|
+
import_node_path146.default.join(swiftCacheDir(), "swift-objc-implementations"),
|
|
111591
|
+
import_node_path146.default.join(swiftCacheDir(), "swift-header-case"),
|
|
111579
111592
|
swiftRootLocksDir(),
|
|
111580
111593
|
import_node_path146.default.join(cacheDir(), "swift-tmp"),
|
|
111581
111594
|
// content-addressed records whose reads renew their timestamps for expiry.
|
|
@@ -119818,9 +119831,285 @@ var init_nativeSourceContract = __esm({
|
|
|
119818
119831
|
}
|
|
119819
119832
|
});
|
|
119820
119833
|
|
|
119834
|
+
// ../peach-globals/build/one-sdk-shard.ts
|
|
119835
|
+
function unsharded(name3, source) {
|
|
119836
|
+
const lineCount = source.split("\n").length;
|
|
119837
|
+
return [
|
|
119838
|
+
{
|
|
119839
|
+
name: name3,
|
|
119840
|
+
source,
|
|
119841
|
+
originalName: name3,
|
|
119842
|
+
lineMap: Array.from({ length: lineCount }, (_, index) => index + 1)
|
|
119843
|
+
}
|
|
119844
|
+
];
|
|
119845
|
+
}
|
|
119846
|
+
function chunkKey2(lines) {
|
|
119847
|
+
for (const { text: text7 } of lines) {
|
|
119848
|
+
const trimmed = text7.trim();
|
|
119849
|
+
if (trimmed !== "" && !trimmed.startsWith("//")) return trimmed;
|
|
119850
|
+
}
|
|
119851
|
+
return lines.map((item) => item.text).join("\n");
|
|
119852
|
+
}
|
|
119853
|
+
function stableShardIndex(key2, shardCount) {
|
|
119854
|
+
return (0, import_node_crypto93.createHash)("sha256").update(key2).digest().readUInt32BE(0) % shardCount;
|
|
119855
|
+
}
|
|
119856
|
+
function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SHARDS) {
|
|
119857
|
+
if (shardCount <= 1 || !name3.endsWith(".swift") || name3.endsWith(".types.swift") || source.length < ONE_SDK_BINDING_SHARD_MIN_BYTES) {
|
|
119858
|
+
return unsharded(name3, source);
|
|
119859
|
+
}
|
|
119860
|
+
const masked = maskSwiftCode(source);
|
|
119861
|
+
if (/\bfileprivate\b/.test(masked)) return unsharded(name3, source);
|
|
119862
|
+
const lines = source.split("\n");
|
|
119863
|
+
const maskedLines = masked.split("\n");
|
|
119864
|
+
if (lines.length !== maskedLines.length) return unsharded(name3, source);
|
|
119865
|
+
const headerLines = [];
|
|
119866
|
+
let index = 0;
|
|
119867
|
+
let headerIfDepth = 0;
|
|
119868
|
+
while (index < lines.length) {
|
|
119869
|
+
const text7 = lines[index];
|
|
119870
|
+
const trimmed = text7.trim();
|
|
119871
|
+
if (trimmed === "" || trimmed.startsWith("// generated ") || trimmed.startsWith("import ")) {
|
|
119872
|
+
headerLines.push({ text: text7, line: index + 1 });
|
|
119873
|
+
index++;
|
|
119874
|
+
continue;
|
|
119875
|
+
}
|
|
119876
|
+
if (trimmed.startsWith("#if ")) {
|
|
119877
|
+
headerIfDepth++;
|
|
119878
|
+
headerLines.push({ text: text7, line: index + 1 });
|
|
119879
|
+
index++;
|
|
119880
|
+
continue;
|
|
119881
|
+
}
|
|
119882
|
+
if (headerIfDepth > 0 && (trimmed.startsWith("#elseif ") || trimmed === "#else" || trimmed === "#endif")) {
|
|
119883
|
+
if (trimmed === "#endif") headerIfDepth--;
|
|
119884
|
+
headerLines.push({ text: text7, line: index + 1 });
|
|
119885
|
+
index++;
|
|
119886
|
+
continue;
|
|
119887
|
+
}
|
|
119888
|
+
break;
|
|
119889
|
+
}
|
|
119890
|
+
if (headerIfDepth !== 0) return unsharded(name3, source);
|
|
119891
|
+
while (headerLines.length > 0 && headerLines.at(-1).text.trim() === "") {
|
|
119892
|
+
headerLines.pop();
|
|
119893
|
+
}
|
|
119894
|
+
const chunks = [];
|
|
119895
|
+
let depth = 0;
|
|
119896
|
+
let pending2 = [];
|
|
119897
|
+
let hadBrace = false;
|
|
119898
|
+
let inImplementation = false;
|
|
119899
|
+
let inOpen = false;
|
|
119900
|
+
let openDeclarations = 0;
|
|
119901
|
+
let activeEnum = null;
|
|
119902
|
+
let enumDeclLine = 0;
|
|
119903
|
+
let memberLines = [];
|
|
119904
|
+
let memberHadBrace = false;
|
|
119905
|
+
for (; index < lines.length; index++) {
|
|
119906
|
+
const text7 = lines[index];
|
|
119907
|
+
const lineNo = index + 1;
|
|
119908
|
+
const maskedLine = maskedLines[index];
|
|
119909
|
+
if (depth <= 1 && /^\s*#/.test(maskedLine)) return unsharded(name3, source);
|
|
119910
|
+
let delta = 0;
|
|
119911
|
+
for (let i = 0; i < maskedLine.length; i++) {
|
|
119912
|
+
const ch = maskedLine[i];
|
|
119913
|
+
if (ch === "{") delta++;
|
|
119914
|
+
else if (ch === "}") delta--;
|
|
119915
|
+
}
|
|
119916
|
+
if (activeEnum === null) {
|
|
119917
|
+
if (depth === 0 && !hadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
|
|
119918
|
+
return unsharded(name3, source);
|
|
119919
|
+
}
|
|
119920
|
+
if (depth === 0 && !hadBrace && !inImplementation && text7.startsWith("// implementation ")) {
|
|
119921
|
+
inImplementation = true;
|
|
119922
|
+
pending2.push({ text: text7, line: lineNo });
|
|
119923
|
+
continue;
|
|
119924
|
+
}
|
|
119925
|
+
if (inImplementation) {
|
|
119926
|
+
pending2.push({ text: text7, line: lineNo });
|
|
119927
|
+
depth += delta;
|
|
119928
|
+
if (depth < 0) return unsharded(name3, source);
|
|
119929
|
+
if (depth === 0 && text7 === "// end implementation") {
|
|
119930
|
+
chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
|
|
119931
|
+
pending2 = [];
|
|
119932
|
+
hadBrace = false;
|
|
119933
|
+
inImplementation = false;
|
|
119934
|
+
}
|
|
119935
|
+
continue;
|
|
119936
|
+
}
|
|
119937
|
+
if (depth === 0 && !hadBrace && !inOpen && text7.startsWith("// open ")) {
|
|
119938
|
+
inOpen = true;
|
|
119939
|
+
openDeclarations = 0;
|
|
119940
|
+
pending2.push({ text: text7, line: lineNo });
|
|
119941
|
+
continue;
|
|
119942
|
+
}
|
|
119943
|
+
if (inOpen) {
|
|
119944
|
+
pending2.push({ text: text7, line: lineNo });
|
|
119945
|
+
if (delta !== 0 || depth > 0) hadBrace = true;
|
|
119946
|
+
depth += delta;
|
|
119947
|
+
if (depth < 0) return unsharded(name3, source);
|
|
119948
|
+
if (hadBrace && depth === 0) {
|
|
119949
|
+
openDeclarations++;
|
|
119950
|
+
hadBrace = false;
|
|
119951
|
+
if (openDeclarations === 2) {
|
|
119952
|
+
chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
|
|
119953
|
+
pending2 = [];
|
|
119954
|
+
inOpen = false;
|
|
119955
|
+
openDeclarations = 0;
|
|
119956
|
+
}
|
|
119957
|
+
}
|
|
119958
|
+
continue;
|
|
119959
|
+
}
|
|
119960
|
+
const enumMatch = depth === 0 && !hadBrace && pending2.every(
|
|
119961
|
+
(item) => item.text.trim() === "" || item.text.trim().startsWith("//")
|
|
119962
|
+
) ? /^enum (OneSDK_\w+)\s*\{\s*$/.exec(maskedLine) : null;
|
|
119963
|
+
if (enumMatch && delta === 1) {
|
|
119964
|
+
const enumName = enumMatch[1];
|
|
119965
|
+
const prefix = pending2.filter((item) => item.text.trim() !== "");
|
|
119966
|
+
enumDeclLine = lineNo;
|
|
119967
|
+
chunks.push({
|
|
119968
|
+
kind: "enumDecl",
|
|
119969
|
+
enumName,
|
|
119970
|
+
lines: [...prefix, { text: `enum ${enumName} {}`, line: lineNo }]
|
|
119971
|
+
});
|
|
119972
|
+
pending2 = [];
|
|
119973
|
+
activeEnum = enumName;
|
|
119974
|
+
depth = 1;
|
|
119975
|
+
continue;
|
|
119976
|
+
}
|
|
119977
|
+
if (depth === 0 && !hadBrace && text7.trim() === "" && pending2.length === 0) {
|
|
119978
|
+
continue;
|
|
119979
|
+
}
|
|
119980
|
+
pending2.push({ text: text7, line: lineNo });
|
|
119981
|
+
if (delta !== 0 || depth > 0) hadBrace = true;
|
|
119982
|
+
depth += delta;
|
|
119983
|
+
if (depth < 0) return unsharded(name3, source);
|
|
119984
|
+
if (hadBrace && depth === 0) {
|
|
119985
|
+
chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
|
|
119986
|
+
pending2 = [];
|
|
119987
|
+
hadBrace = false;
|
|
119988
|
+
}
|
|
119989
|
+
} else {
|
|
119990
|
+
const nextDepth = depth + delta;
|
|
119991
|
+
if (nextDepth < 0) return unsharded(name3, source);
|
|
119992
|
+
if (depth === 1 && nextDepth === 0) {
|
|
119993
|
+
if (memberHadBrace || maskedLine.trim() !== "}") return unsharded(name3, source);
|
|
119994
|
+
if (memberLines.some(
|
|
119995
|
+
(item) => item.text.trim() !== "" && !item.text.trim().startsWith("//")
|
|
119996
|
+
)) {
|
|
119997
|
+
chunks.push({
|
|
119998
|
+
kind: "enumMember",
|
|
119999
|
+
enumName: activeEnum,
|
|
120000
|
+
key: chunkKey2(memberLines),
|
|
120001
|
+
lines: memberLines
|
|
120002
|
+
});
|
|
120003
|
+
}
|
|
120004
|
+
activeEnum = null;
|
|
120005
|
+
depth = 0;
|
|
120006
|
+
memberLines = [];
|
|
120007
|
+
continue;
|
|
120008
|
+
}
|
|
120009
|
+
if (depth === 1 && !memberHadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
|
|
120010
|
+
return unsharded(name3, source);
|
|
120011
|
+
}
|
|
120012
|
+
if (depth === 1 && !memberHadBrace && text7.trim() === "") {
|
|
120013
|
+
depth = nextDepth;
|
|
120014
|
+
continue;
|
|
120015
|
+
}
|
|
120016
|
+
memberLines.push({ text: text7, line: lineNo });
|
|
120017
|
+
if (nextDepth > 1 || delta !== 0) memberHadBrace = true;
|
|
120018
|
+
depth = nextDepth;
|
|
120019
|
+
if (memberHadBrace && depth === 1 || !memberHadBrace && depth === 1 && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*static\s+let\b/.test(maskedLine)) {
|
|
120020
|
+
chunks.push({
|
|
120021
|
+
kind: "enumMember",
|
|
120022
|
+
enumName: activeEnum,
|
|
120023
|
+
key: chunkKey2(memberLines),
|
|
120024
|
+
lines: memberLines
|
|
120025
|
+
});
|
|
120026
|
+
memberLines = [];
|
|
120027
|
+
memberHadBrace = false;
|
|
120028
|
+
}
|
|
120029
|
+
}
|
|
120030
|
+
}
|
|
120031
|
+
if (depth !== 0 || activeEnum !== null || inImplementation || inOpen || pending2.some(
|
|
120032
|
+
(item) => item.text.trim() !== "" && !item.text.trim().startsWith("//")
|
|
120033
|
+
) || chunks.length < shardCount) {
|
|
120034
|
+
return unsharded(name3, source);
|
|
120035
|
+
}
|
|
120036
|
+
const buckets = Array.from({ length: shardCount }, () => []);
|
|
120037
|
+
for (const chunk of chunks) {
|
|
120038
|
+
if (chunk.kind === "enumDecl") {
|
|
120039
|
+
buckets[0].push(chunk);
|
|
120040
|
+
} else {
|
|
120041
|
+
buckets[stableShardIndex(chunk.key, shardCount)].push(chunk);
|
|
120042
|
+
}
|
|
120043
|
+
}
|
|
120044
|
+
const nonEmpty2 = buckets.map((bucket, index2) => ({ bucket, index: index2 })).filter(({ bucket }) => bucket.length > 0);
|
|
120045
|
+
if (nonEmpty2.length < 2) return unsharded(name3, source);
|
|
120046
|
+
const stem2 = name3.slice(0, -".swift".length);
|
|
120047
|
+
return nonEmpty2.map(({ bucket, index: shardIndex }) => {
|
|
120048
|
+
const outLines = [];
|
|
120049
|
+
const lineMap = [];
|
|
120050
|
+
const pushLine = (text7, origLine) => {
|
|
120051
|
+
outLines.push(text7);
|
|
120052
|
+
lineMap.push(origLine);
|
|
120053
|
+
};
|
|
120054
|
+
for (const item of headerLines) pushLine(item.text, item.line);
|
|
120055
|
+
pushLine("", 0);
|
|
120056
|
+
let openEnum = null;
|
|
120057
|
+
let enumBody = [];
|
|
120058
|
+
let hasPart = false;
|
|
120059
|
+
const startPart = () => {
|
|
120060
|
+
if (hasPart) pushLine("", 0);
|
|
120061
|
+
hasPart = true;
|
|
120062
|
+
};
|
|
120063
|
+
const flushEnum = () => {
|
|
120064
|
+
if (!openEnum) return;
|
|
120065
|
+
startPart();
|
|
120066
|
+
pushLine(`extension ${openEnum} {`, enumDeclLine);
|
|
120067
|
+
for (let i = 0; i < enumBody.length; i++) {
|
|
120068
|
+
if (i > 0) pushLine("", 0);
|
|
120069
|
+
for (const item of enumBody[i]) pushLine(item.text, item.line);
|
|
120070
|
+
}
|
|
120071
|
+
pushLine("}", enumDeclLine);
|
|
120072
|
+
openEnum = null;
|
|
120073
|
+
enumBody = [];
|
|
120074
|
+
};
|
|
120075
|
+
for (const chunk of bucket) {
|
|
120076
|
+
if (chunk.kind === "enumMember") {
|
|
120077
|
+
if (openEnum !== chunk.enumName) {
|
|
120078
|
+
flushEnum();
|
|
120079
|
+
openEnum = chunk.enumName;
|
|
120080
|
+
}
|
|
120081
|
+
enumBody.push(chunk.lines);
|
|
120082
|
+
} else {
|
|
120083
|
+
flushEnum();
|
|
120084
|
+
startPart();
|
|
120085
|
+
for (const item of chunk.lines) pushLine(item.text, item.line);
|
|
120086
|
+
}
|
|
120087
|
+
}
|
|
120088
|
+
flushEnum();
|
|
120089
|
+
pushLine("", 0);
|
|
120090
|
+
return {
|
|
120091
|
+
name: `${stem2}_${shardIndex}.swift`,
|
|
120092
|
+
source: outLines.join("\n"),
|
|
120093
|
+
originalName: name3,
|
|
120094
|
+
lineMap
|
|
120095
|
+
};
|
|
120096
|
+
});
|
|
120097
|
+
}
|
|
120098
|
+
var import_node_crypto93, import_node_path157, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES;
|
|
120099
|
+
var init_one_sdk_shard = __esm({
|
|
120100
|
+
"../peach-globals/build/one-sdk-shard.ts"() {
|
|
120101
|
+
"use strict";
|
|
120102
|
+
import_node_crypto93 = require("node:crypto");
|
|
120103
|
+
import_node_path157 = __toESM(require("node:path"), 1);
|
|
120104
|
+
init_swift_source_mask();
|
|
120105
|
+
ONE_SDK_BINDING_SHARDS = 8;
|
|
120106
|
+
ONE_SDK_BINDING_SHARD_MIN_BYTES = 256 * 1024;
|
|
120107
|
+
}
|
|
120108
|
+
});
|
|
120109
|
+
|
|
119821
120110
|
// ../peach-globals/build/one-swift-control-source.ts
|
|
119822
120111
|
function readSchema(one) {
|
|
119823
|
-
return JSON.parse((0, import_node_fs155.readFileSync)((0,
|
|
120112
|
+
return JSON.parse((0, import_node_fs155.readFileSync)((0, import_node_path158.join)(one, "schema.json"), "utf8"));
|
|
119824
120113
|
}
|
|
119825
120114
|
function payloadRows(schema4, props, prop) {
|
|
119826
120115
|
const item = /^ReadonlyArray<(\w+)>$/.exec(props[prop]?.type ?? "")?.[1];
|
|
@@ -119975,22 +120264,22 @@ function arrayBindings(name3, body) {
|
|
|
119975
120264
|
}
|
|
119976
120265
|
function componentViews(one, selected) {
|
|
119977
120266
|
const schema4 = readSchema(one);
|
|
119978
|
-
const folders = [(0,
|
|
120267
|
+
const folders = [(0, import_node_path158.join)(one, "ios/Generated"), (0, import_node_path158.join)(one, "ios")];
|
|
119979
120268
|
const files2 = folders.map((folder) => new Set((0, import_node_fs155.readdirSync)(folder)));
|
|
119980
120269
|
return schema4.components.flatMap(({ name: name3, props, commands: commands2 = {} }) => {
|
|
119981
120270
|
if (selected && !selected.includes(name3)) return [];
|
|
119982
120271
|
const file = `${name3}ComponentView.mm`;
|
|
119983
120272
|
const folder = folders.find((_, index) => files2[index].has(file));
|
|
119984
120273
|
if (!folder) return [];
|
|
119985
|
-
const raw2 = (0, import_node_fs155.readFileSync)((0,
|
|
120274
|
+
const raw2 = (0, import_node_fs155.readFileSync)((0, import_node_path158.join)(folder, file), "utf8");
|
|
119986
120275
|
const view = /\b(_\w+) = \[OneNative\w+View new\]/.exec(raw2)?.[1];
|
|
119987
120276
|
if (!view) return [];
|
|
119988
120277
|
const source = raw2.replace(new RegExp(`\\b${view}\\b`, "g"), "_nativeView");
|
|
119989
|
-
return [{ name: name3, props, commands: commands2, source, file: (0,
|
|
120278
|
+
return [{ name: name3, props, commands: commands2, source, file: (0, import_node_path158.join)(folder, file) }];
|
|
119990
120279
|
});
|
|
119991
120280
|
}
|
|
119992
120281
|
function swiftGuestControls(one, names, linkedGroups) {
|
|
119993
|
-
const watched = [(0,
|
|
120282
|
+
const watched = [(0, import_node_path158.join)(one, "schema.json")];
|
|
119994
120283
|
const defines = /* @__PURE__ */ new Set();
|
|
119995
120284
|
const schema4 = readSchema(one);
|
|
119996
120285
|
const views = componentViews(one, names);
|
|
@@ -120005,7 +120294,7 @@ function swiftGuestControls(one, names, linkedGroups) {
|
|
|
120005
120294
|
const arrays = arrayBindings(name3, update);
|
|
120006
120295
|
const conformance = childMounting(viewClass, source);
|
|
120007
120296
|
if (conformance) conformances.push(conformance);
|
|
120008
|
-
const swift = (0,
|
|
120297
|
+
const swift = (0, import_node_path158.join)((0, import_node_path158.dirname)(file), viewClass + ".swift");
|
|
120009
120298
|
const declaration = (0, import_node_fs155.readFileSync)(swift, "utf8");
|
|
120010
120299
|
watched.push(file, swift);
|
|
120011
120300
|
const initializer = /public (?:override )?init\(\)/.test(declaration) ? "()" : "(frame: .zero)";
|
|
@@ -120100,12 +120389,12 @@ function swiftGuestControls(one, names, linkedGroups) {
|
|
|
120100
120389
|
watched
|
|
120101
120390
|
};
|
|
120102
120391
|
}
|
|
120103
|
-
var import_node_fs155,
|
|
120392
|
+
var import_node_fs155, import_node_path158, payloadTypes, payloadProp;
|
|
120104
120393
|
var init_one_swift_control_source = __esm({
|
|
120105
120394
|
"../peach-globals/build/one-swift-control-source.ts"() {
|
|
120106
120395
|
"use strict";
|
|
120107
120396
|
import_node_fs155 = require("node:fs");
|
|
120108
|
-
|
|
120397
|
+
import_node_path158 = require("node:path");
|
|
120109
120398
|
payloadTypes = {
|
|
120110
120399
|
boolean: ["Bool", false],
|
|
120111
120400
|
"boolean[]": ["[Bool]", []],
|
|
@@ -120230,7 +120519,7 @@ function swiftUIControls(one, options2) {
|
|
|
120230
120519
|
if (glue.guard && (!groupDefines || groupDefines.has(glue.guard))) {
|
|
120231
120520
|
activeDefines.add(glue.guard);
|
|
120232
120521
|
}
|
|
120233
|
-
const header2 = (0,
|
|
120522
|
+
const header2 = (0, import_node_path159.join)(one, "ios", glue.viewClass + ".h");
|
|
120234
120523
|
return { ...glue, header: (0, import_node_fs156.existsSync)(header2) ? header2 : void 0 };
|
|
120235
120524
|
});
|
|
120236
120525
|
const activeControls = controls.filter(
|
|
@@ -120250,7 +120539,7 @@ function swiftUIControls(one, options2) {
|
|
|
120250
120539
|
for (const [, include] of (0, import_node_fs156.readFileSync)(file, "utf8").matchAll(
|
|
120251
120540
|
/^#(?:include|import) "([^"]+)"/gm
|
|
120252
120541
|
)) {
|
|
120253
|
-
const dependency = (0,
|
|
120542
|
+
const dependency = (0, import_node_path159.join)((0, import_node_path159.dirname)(file), include);
|
|
120254
120543
|
if ((0, import_node_fs156.existsSync)(dependency)) headers.add(dependency);
|
|
120255
120544
|
}
|
|
120256
120545
|
}
|
|
@@ -120272,7 +120561,7 @@ function swiftUIControls(one, options2) {
|
|
|
120272
120561
|
'#include "OneNativeSyncBridge.h"',
|
|
120273
120562
|
...controls.flatMap(({ header: header2, guard }) => {
|
|
120274
120563
|
if (!header2) return [];
|
|
120275
|
-
const include = "#import " + JSON.stringify(options2?.basenameImports ? (0,
|
|
120564
|
+
const include = "#import " + JSON.stringify(options2?.basenameImports ? (0, import_node_path159.basename)(header2) : header2);
|
|
120276
120565
|
return guard ? [`#if ${guard}`, include, "#endif"] : [include];
|
|
120277
120566
|
}),
|
|
120278
120567
|
"",
|
|
@@ -120311,12 +120600,12 @@ function swiftUIControls(one, options2) {
|
|
|
120311
120600
|
defines: [...activeDefines]
|
|
120312
120601
|
};
|
|
120313
120602
|
}
|
|
120314
|
-
var import_node_fs156,
|
|
120603
|
+
var import_node_fs156, import_node_path159, handwritten, boxes;
|
|
120315
120604
|
var init_one_swift_ui_controls = __esm({
|
|
120316
120605
|
"../peach-globals/build/one-swift-ui-controls.ts"() {
|
|
120317
120606
|
"use strict";
|
|
120318
120607
|
import_node_fs156 = require("node:fs");
|
|
120319
|
-
|
|
120608
|
+
import_node_path159 = require("node:path");
|
|
120320
120609
|
init_one_swift_control_source();
|
|
120321
120610
|
handwritten = /* @__PURE__ */ new Set([
|
|
120322
120611
|
"OneNativeMenu",
|
|
@@ -122747,282 +123036,6 @@ const char* peach_one_swift_ui_commands(const char* namePtr, uint32_t nameLen) {
|
|
|
122747
123036
|
}
|
|
122748
123037
|
});
|
|
122749
123038
|
|
|
122750
|
-
// src/one-sdk/shard.ts
|
|
122751
|
-
function unsharded(name3, source) {
|
|
122752
|
-
const lineCount = source.split("\n").length;
|
|
122753
|
-
return [
|
|
122754
|
-
{
|
|
122755
|
-
name: name3,
|
|
122756
|
-
source,
|
|
122757
|
-
originalName: name3,
|
|
122758
|
-
lineMap: Array.from({ length: lineCount }, (_, index) => index + 1)
|
|
122759
|
-
}
|
|
122760
|
-
];
|
|
122761
|
-
}
|
|
122762
|
-
function chunkKey2(lines) {
|
|
122763
|
-
for (const { text: text7 } of lines) {
|
|
122764
|
-
const trimmed = text7.trim();
|
|
122765
|
-
if (trimmed !== "" && !trimmed.startsWith("//")) return trimmed;
|
|
122766
|
-
}
|
|
122767
|
-
return lines.map((item) => item.text).join("\n");
|
|
122768
|
-
}
|
|
122769
|
-
function stableShardIndex(key2, shardCount) {
|
|
122770
|
-
return (0, import_node_crypto93.createHash)("sha256").update(key2).digest().readUInt32BE(0) % shardCount;
|
|
122771
|
-
}
|
|
122772
|
-
function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SHARDS) {
|
|
122773
|
-
if (shardCount <= 1 || !name3.endsWith(".swift") || name3.endsWith(".types.swift") || source.length < ONE_SDK_BINDING_SHARD_MIN_BYTES) {
|
|
122774
|
-
return unsharded(name3, source);
|
|
122775
|
-
}
|
|
122776
|
-
const masked = swiftCodeMask(source);
|
|
122777
|
-
if (/\bfileprivate\b/.test(masked)) return unsharded(name3, source);
|
|
122778
|
-
const lines = source.split("\n");
|
|
122779
|
-
const maskedLines = masked.split("\n");
|
|
122780
|
-
if (lines.length !== maskedLines.length) return unsharded(name3, source);
|
|
122781
|
-
const headerLines = [];
|
|
122782
|
-
let index = 0;
|
|
122783
|
-
let headerIfDepth = 0;
|
|
122784
|
-
while (index < lines.length) {
|
|
122785
|
-
const text7 = lines[index];
|
|
122786
|
-
const trimmed = text7.trim();
|
|
122787
|
-
if (trimmed === "" || trimmed.startsWith("// generated ") || trimmed.startsWith("import ")) {
|
|
122788
|
-
headerLines.push({ text: text7, line: index + 1 });
|
|
122789
|
-
index++;
|
|
122790
|
-
continue;
|
|
122791
|
-
}
|
|
122792
|
-
if (trimmed.startsWith("#if ")) {
|
|
122793
|
-
headerIfDepth++;
|
|
122794
|
-
headerLines.push({ text: text7, line: index + 1 });
|
|
122795
|
-
index++;
|
|
122796
|
-
continue;
|
|
122797
|
-
}
|
|
122798
|
-
if (headerIfDepth > 0 && (trimmed.startsWith("#elseif ") || trimmed === "#else" || trimmed === "#endif")) {
|
|
122799
|
-
if (trimmed === "#endif") headerIfDepth--;
|
|
122800
|
-
headerLines.push({ text: text7, line: index + 1 });
|
|
122801
|
-
index++;
|
|
122802
|
-
continue;
|
|
122803
|
-
}
|
|
122804
|
-
break;
|
|
122805
|
-
}
|
|
122806
|
-
if (headerIfDepth !== 0) return unsharded(name3, source);
|
|
122807
|
-
while (headerLines.length > 0 && headerLines.at(-1).text.trim() === "") {
|
|
122808
|
-
headerLines.pop();
|
|
122809
|
-
}
|
|
122810
|
-
const chunks = [];
|
|
122811
|
-
let depth = 0;
|
|
122812
|
-
let pending2 = [];
|
|
122813
|
-
let hadBrace = false;
|
|
122814
|
-
let inImplementation = false;
|
|
122815
|
-
let inOpen = false;
|
|
122816
|
-
let openDeclarations = 0;
|
|
122817
|
-
let activeEnum = null;
|
|
122818
|
-
let enumDeclLine = 0;
|
|
122819
|
-
let memberLines = [];
|
|
122820
|
-
let memberHadBrace = false;
|
|
122821
|
-
for (; index < lines.length; index++) {
|
|
122822
|
-
const text7 = lines[index];
|
|
122823
|
-
const lineNo = index + 1;
|
|
122824
|
-
const maskedLine = maskedLines[index];
|
|
122825
|
-
if (depth <= 1 && /^\s*#/.test(maskedLine)) return unsharded(name3, source);
|
|
122826
|
-
let delta = 0;
|
|
122827
|
-
for (let i = 0; i < maskedLine.length; i++) {
|
|
122828
|
-
const ch = maskedLine[i];
|
|
122829
|
-
if (ch === "{") delta++;
|
|
122830
|
-
else if (ch === "}") delta--;
|
|
122831
|
-
}
|
|
122832
|
-
if (activeEnum === null) {
|
|
122833
|
-
if (depth === 0 && !hadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
|
|
122834
|
-
return unsharded(name3, source);
|
|
122835
|
-
}
|
|
122836
|
-
if (depth === 0 && !hadBrace && !inImplementation && text7.startsWith("// implementation ")) {
|
|
122837
|
-
inImplementation = true;
|
|
122838
|
-
pending2.push({ text: text7, line: lineNo });
|
|
122839
|
-
continue;
|
|
122840
|
-
}
|
|
122841
|
-
if (inImplementation) {
|
|
122842
|
-
pending2.push({ text: text7, line: lineNo });
|
|
122843
|
-
depth += delta;
|
|
122844
|
-
if (depth < 0) return unsharded(name3, source);
|
|
122845
|
-
if (depth === 0 && text7 === "// end implementation") {
|
|
122846
|
-
chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
|
|
122847
|
-
pending2 = [];
|
|
122848
|
-
hadBrace = false;
|
|
122849
|
-
inImplementation = false;
|
|
122850
|
-
}
|
|
122851
|
-
continue;
|
|
122852
|
-
}
|
|
122853
|
-
if (depth === 0 && !hadBrace && !inOpen && text7.startsWith("// open ")) {
|
|
122854
|
-
inOpen = true;
|
|
122855
|
-
openDeclarations = 0;
|
|
122856
|
-
pending2.push({ text: text7, line: lineNo });
|
|
122857
|
-
continue;
|
|
122858
|
-
}
|
|
122859
|
-
if (inOpen) {
|
|
122860
|
-
pending2.push({ text: text7, line: lineNo });
|
|
122861
|
-
if (delta !== 0 || depth > 0) hadBrace = true;
|
|
122862
|
-
depth += delta;
|
|
122863
|
-
if (depth < 0) return unsharded(name3, source);
|
|
122864
|
-
if (hadBrace && depth === 0) {
|
|
122865
|
-
openDeclarations++;
|
|
122866
|
-
hadBrace = false;
|
|
122867
|
-
if (openDeclarations === 2) {
|
|
122868
|
-
chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
|
|
122869
|
-
pending2 = [];
|
|
122870
|
-
inOpen = false;
|
|
122871
|
-
openDeclarations = 0;
|
|
122872
|
-
}
|
|
122873
|
-
}
|
|
122874
|
-
continue;
|
|
122875
|
-
}
|
|
122876
|
-
const enumMatch = depth === 0 && !hadBrace && pending2.every(
|
|
122877
|
-
(item) => item.text.trim() === "" || item.text.trim().startsWith("//")
|
|
122878
|
-
) ? /^enum (OneSDK_\w+)\s*\{\s*$/.exec(maskedLine) : null;
|
|
122879
|
-
if (enumMatch && delta === 1) {
|
|
122880
|
-
const enumName = enumMatch[1];
|
|
122881
|
-
const prefix = pending2.filter((item) => item.text.trim() !== "");
|
|
122882
|
-
enumDeclLine = lineNo;
|
|
122883
|
-
chunks.push({
|
|
122884
|
-
kind: "enumDecl",
|
|
122885
|
-
enumName,
|
|
122886
|
-
lines: [...prefix, { text: `enum ${enumName} {}`, line: lineNo }]
|
|
122887
|
-
});
|
|
122888
|
-
pending2 = [];
|
|
122889
|
-
activeEnum = enumName;
|
|
122890
|
-
depth = 1;
|
|
122891
|
-
continue;
|
|
122892
|
-
}
|
|
122893
|
-
if (depth === 0 && !hadBrace && text7.trim() === "" && pending2.length === 0) {
|
|
122894
|
-
continue;
|
|
122895
|
-
}
|
|
122896
|
-
pending2.push({ text: text7, line: lineNo });
|
|
122897
|
-
if (delta !== 0 || depth > 0) hadBrace = true;
|
|
122898
|
-
depth += delta;
|
|
122899
|
-
if (depth < 0) return unsharded(name3, source);
|
|
122900
|
-
if (hadBrace && depth === 0) {
|
|
122901
|
-
chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
|
|
122902
|
-
pending2 = [];
|
|
122903
|
-
hadBrace = false;
|
|
122904
|
-
}
|
|
122905
|
-
} else {
|
|
122906
|
-
const nextDepth = depth + delta;
|
|
122907
|
-
if (nextDepth < 0) return unsharded(name3, source);
|
|
122908
|
-
if (depth === 1 && nextDepth === 0) {
|
|
122909
|
-
if (memberHadBrace || maskedLine.trim() !== "}") return unsharded(name3, source);
|
|
122910
|
-
if (memberLines.some(
|
|
122911
|
-
(item) => item.text.trim() !== "" && !item.text.trim().startsWith("//")
|
|
122912
|
-
)) {
|
|
122913
|
-
chunks.push({
|
|
122914
|
-
kind: "enumMember",
|
|
122915
|
-
enumName: activeEnum,
|
|
122916
|
-
key: chunkKey2(memberLines),
|
|
122917
|
-
lines: memberLines
|
|
122918
|
-
});
|
|
122919
|
-
}
|
|
122920
|
-
activeEnum = null;
|
|
122921
|
-
depth = 0;
|
|
122922
|
-
memberLines = [];
|
|
122923
|
-
continue;
|
|
122924
|
-
}
|
|
122925
|
-
if (depth === 1 && !memberHadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
|
|
122926
|
-
return unsharded(name3, source);
|
|
122927
|
-
}
|
|
122928
|
-
if (depth === 1 && !memberHadBrace && text7.trim() === "") {
|
|
122929
|
-
depth = nextDepth;
|
|
122930
|
-
continue;
|
|
122931
|
-
}
|
|
122932
|
-
memberLines.push({ text: text7, line: lineNo });
|
|
122933
|
-
if (nextDepth > 1 || delta !== 0) memberHadBrace = true;
|
|
122934
|
-
depth = nextDepth;
|
|
122935
|
-
if (memberHadBrace && depth === 1 || !memberHadBrace && depth === 1 && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*static\s+let\b/.test(maskedLine)) {
|
|
122936
|
-
chunks.push({
|
|
122937
|
-
kind: "enumMember",
|
|
122938
|
-
enumName: activeEnum,
|
|
122939
|
-
key: chunkKey2(memberLines),
|
|
122940
|
-
lines: memberLines
|
|
122941
|
-
});
|
|
122942
|
-
memberLines = [];
|
|
122943
|
-
memberHadBrace = false;
|
|
122944
|
-
}
|
|
122945
|
-
}
|
|
122946
|
-
}
|
|
122947
|
-
if (depth !== 0 || activeEnum !== null || inImplementation || inOpen || pending2.some(
|
|
122948
|
-
(item) => item.text.trim() !== "" && !item.text.trim().startsWith("//")
|
|
122949
|
-
) || chunks.length < shardCount) {
|
|
122950
|
-
return unsharded(name3, source);
|
|
122951
|
-
}
|
|
122952
|
-
const buckets = Array.from({ length: shardCount }, () => []);
|
|
122953
|
-
for (const chunk of chunks) {
|
|
122954
|
-
if (chunk.kind === "enumDecl") {
|
|
122955
|
-
buckets[0].push(chunk);
|
|
122956
|
-
} else {
|
|
122957
|
-
buckets[stableShardIndex(chunk.key, shardCount)].push(chunk);
|
|
122958
|
-
}
|
|
122959
|
-
}
|
|
122960
|
-
const nonEmpty2 = buckets.map((bucket, index2) => ({ bucket, index: index2 })).filter(({ bucket }) => bucket.length > 0);
|
|
122961
|
-
if (nonEmpty2.length < 2) return unsharded(name3, source);
|
|
122962
|
-
const stem2 = name3.slice(0, -".swift".length);
|
|
122963
|
-
return nonEmpty2.map(({ bucket, index: shardIndex }) => {
|
|
122964
|
-
const outLines = [];
|
|
122965
|
-
const lineMap = [];
|
|
122966
|
-
const pushLine = (text7, origLine) => {
|
|
122967
|
-
outLines.push(text7);
|
|
122968
|
-
lineMap.push(origLine);
|
|
122969
|
-
};
|
|
122970
|
-
for (const item of headerLines) pushLine(item.text, item.line);
|
|
122971
|
-
pushLine("", 0);
|
|
122972
|
-
let openEnum = null;
|
|
122973
|
-
let enumBody = [];
|
|
122974
|
-
let hasPart = false;
|
|
122975
|
-
const startPart = () => {
|
|
122976
|
-
if (hasPart) pushLine("", 0);
|
|
122977
|
-
hasPart = true;
|
|
122978
|
-
};
|
|
122979
|
-
const flushEnum = () => {
|
|
122980
|
-
if (!openEnum) return;
|
|
122981
|
-
startPart();
|
|
122982
|
-
pushLine(`extension ${openEnum} {`, enumDeclLine);
|
|
122983
|
-
for (let i = 0; i < enumBody.length; i++) {
|
|
122984
|
-
if (i > 0) pushLine("", 0);
|
|
122985
|
-
for (const item of enumBody[i]) pushLine(item.text, item.line);
|
|
122986
|
-
}
|
|
122987
|
-
pushLine("}", enumDeclLine);
|
|
122988
|
-
openEnum = null;
|
|
122989
|
-
enumBody = [];
|
|
122990
|
-
};
|
|
122991
|
-
for (const chunk of bucket) {
|
|
122992
|
-
if (chunk.kind === "enumMember") {
|
|
122993
|
-
if (openEnum !== chunk.enumName) {
|
|
122994
|
-
flushEnum();
|
|
122995
|
-
openEnum = chunk.enumName;
|
|
122996
|
-
}
|
|
122997
|
-
enumBody.push(chunk.lines);
|
|
122998
|
-
} else {
|
|
122999
|
-
flushEnum();
|
|
123000
|
-
startPart();
|
|
123001
|
-
for (const item of chunk.lines) pushLine(item.text, item.line);
|
|
123002
|
-
}
|
|
123003
|
-
}
|
|
123004
|
-
flushEnum();
|
|
123005
|
-
pushLine("", 0);
|
|
123006
|
-
return {
|
|
123007
|
-
name: `${stem2}_${shardIndex}.swift`,
|
|
123008
|
-
source: outLines.join("\n"),
|
|
123009
|
-
originalName: name3,
|
|
123010
|
-
lineMap
|
|
123011
|
-
};
|
|
123012
|
-
});
|
|
123013
|
-
}
|
|
123014
|
-
var import_node_crypto93, import_node_path159, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES;
|
|
123015
|
-
var init_shard = __esm({
|
|
123016
|
-
"src/one-sdk/shard.ts"() {
|
|
123017
|
-
"use strict";
|
|
123018
|
-
import_node_crypto93 = require("node:crypto");
|
|
123019
|
-
import_node_path159 = __toESM(require("node:path"), 1);
|
|
123020
|
-
init_swift_compile();
|
|
123021
|
-
ONE_SDK_BINDING_SHARDS = 8;
|
|
123022
|
-
ONE_SDK_BINDING_SHARD_MIN_BYTES = 256 * 1024;
|
|
123023
|
-
}
|
|
123024
|
-
});
|
|
123025
|
-
|
|
123026
123039
|
// src/one-sdk/source.ts
|
|
123027
123040
|
var oneSDKModule, oneSDKHost, oneSDKApp, oneSDKTransport;
|
|
123028
123041
|
var init_source2 = __esm({
|
|
@@ -124191,10 +124204,10 @@ var init_one_native_controls_package = __esm({
|
|
|
124191
124204
|
import_node_path160 = __toESM(require("node:path"), 1);
|
|
124192
124205
|
import_node_url8 = require("node:url");
|
|
124193
124206
|
init_nativeSourceContract();
|
|
124207
|
+
init_one_sdk_shard();
|
|
124194
124208
|
init_one_swift_control_source();
|
|
124195
124209
|
init_one_swift_ui_controls();
|
|
124196
124210
|
init_one_direct_host_source();
|
|
124197
|
-
init_shard();
|
|
124198
124211
|
init_source2();
|
|
124199
124212
|
init_oneNativeControlsContract2();
|
|
124200
124213
|
init_swift_compile();
|
|
@@ -129022,7 +129035,7 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
|
|
|
129022
129035
|
if (typeof checksum !== "string" || !/^[a-f0-9]{40}$/.test(checksum))
|
|
129023
129036
|
throw new Error(`${lockFile}: missing checksum for ${root}`);
|
|
129024
129037
|
const file = import_node_path178.default.join(
|
|
129025
|
-
|
|
129038
|
+
swiftCacheDir(),
|
|
129026
129039
|
"swift-source-pods",
|
|
129027
129040
|
"specifications",
|
|
129028
129041
|
`${checksum}.json`
|
|
@@ -129165,7 +129178,7 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
129165
129178
|
Object.entries(specificationChecksums).sort(([a], [b]) => a.localeCompare(b))
|
|
129166
129179
|
)
|
|
129167
129180
|
).digest("hex");
|
|
129168
|
-
const work = import_node_path178.default.join(
|
|
129181
|
+
const work = import_node_path178.default.join(swiftCacheDir(), "swift-source-pods", key2);
|
|
129169
129182
|
return withSwiftRootLock(work, async () => {
|
|
129170
129183
|
const ios = import_node_path178.default.join(work, "ios");
|
|
129171
129184
|
const complete = import_node_path178.default.join(work, "pods-installed");
|
|
@@ -129237,12 +129250,12 @@ var init_swift_source_pods = __esm({
|
|
|
129237
129250
|
import_node_fs174 = __toESM(require("node:fs"), 1);
|
|
129238
129251
|
import_node_path178 = __toESM(require("node:path"), 1);
|
|
129239
129252
|
init_browser();
|
|
129240
|
-
init_home_paths();
|
|
129241
129253
|
init_pod_lockfile();
|
|
129242
129254
|
init_pods_install();
|
|
129243
129255
|
init_swift_host();
|
|
129244
129256
|
init_swift_package();
|
|
129245
129257
|
init_swift_root_lock();
|
|
129258
|
+
init_swift_toolchain();
|
|
129246
129259
|
init_xcode_project();
|
|
129247
129260
|
APP = "PeachPodDependencies";
|
|
129248
129261
|
record5 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -130193,7 +130206,7 @@ var init_nitro_superset = __esm({
|
|
|
130193
130206
|
init_nitroContract();
|
|
130194
130207
|
init_swift_standin_digest();
|
|
130195
130208
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
130196
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
130209
|
+
NITRO_COMPILER_DIGEST = true ? "2bd4530ba3bae000e41dcb8e8c3d99b7cef19a11f4e14afedde939ee1f14828f" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
130197
130210
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
130198
130211
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
130199
130212
|
published3 = /* @__PURE__ */ new Map();
|
|
@@ -130613,10 +130626,10 @@ var init_one_sdk_bundle = __esm({
|
|
|
130613
130626
|
import_node_crypto109 = require("node:crypto");
|
|
130614
130627
|
import_node_fs179 = __toESM(require("node:fs"), 1);
|
|
130615
130628
|
import_node_path184 = __toESM(require("node:path"), 1);
|
|
130629
|
+
init_one_sdk_shard();
|
|
130616
130630
|
init_expo_native_workspace();
|
|
130617
130631
|
init_nitro_bundle();
|
|
130618
130632
|
init_one_sdk_preparation();
|
|
130619
|
-
init_shard();
|
|
130620
130633
|
init_source2();
|
|
130621
130634
|
init_oneSdkContract();
|
|
130622
130635
|
init_swift_compile();
|