peachsim 0.1.2248 → 0.1.2250
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/bridge-flow-runner.ts +30 -3
- package/cli/commands/flow.ts +4 -1
- package/cli/commands/inspect/settling.ts +35 -4
- package/cli/drivers/playwright.ts +2 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +203 -53
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +33 -9
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +177 -49
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +210 -54
- package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +45 -14
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +15 -8
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +53 -53
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +2 -2
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +31 -7
- package/dist-lib/sdk.mjs +31 -7
- package/dist-lib/skills.cjs +289 -64
- package/dist-lib/swift-compile.cjs +165 -38
- package/dist-lib/swift-compile.mjs +165 -38
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +174 -46
- package/dist-lib/vite.cjs +15 -8
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/render-worker/image-pixel-contract.d.ts +0 -4
- package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/shell-tree-wire.d.ts +8 -0
- package/dist-types/packages/peach-engine/src/render-worker/webview-capture-protocol.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/globalsContract.d.ts +5 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/wasm/include/math.h +1 -1
- package/sdk/ios/wasm/include/pthread.h +1 -1
- package/src/assetCatalogContract.ts +6 -0
- package/src/nitro-compile.ts +23 -1
- package/src/process-group.ts +5 -2
- package/src/runtime-packs.ts +8 -0
- package/src/sfSymbolMetricsContract.ts +73 -37
- package/src/swift-compile.ts +119 -13
- package/src/swift-guest-image-ledger.ts +10 -5
- package/src/swift-guest-link.ts +20 -14
- package/src/swift-guest-source-inputs.ts +5 -1
- package/src/swift-installed-targets.ts +4 -1
- package/src/swift-standins.ts +11 -8
- package/src/swift-wasm-prune.ts +33 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2250 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/swift-compile.ts
|
|
4
4
|
import {
|
|
@@ -2213,8 +2213,9 @@ function readProcessTable(timeoutMs = 1e4, pid) {
|
|
|
2213
2213
|
// src/process-group.ts
|
|
2214
2214
|
var GRACEFUL_TIMEOUT_MS = 3e3;
|
|
2215
2215
|
var FORCED_EXIT_TIMEOUT_MS = 1e3;
|
|
2216
|
+
var INSPECTION_TIMEOUT_MS = 1e4;
|
|
2216
2217
|
var FREEZE_GUARD_NAME = "process-freeze-guard";
|
|
2217
|
-
function listProcessChildren(parents, timeoutMs =
|
|
2218
|
+
function listProcessChildren(parents, timeoutMs = 1e4) {
|
|
2218
2219
|
if (parents.some((pid) => !Number.isInteger(pid) || pid <= 1))
|
|
2219
2220
|
throw new Error("process inspection requires valid parent pids");
|
|
2220
2221
|
if (parents.length === 0) return [];
|
|
@@ -2424,7 +2425,7 @@ async function terminateProcessGroup(child, signal = "SIGTERM", gracefulTimeoutM
|
|
|
2424
2425
|
try {
|
|
2425
2426
|
signalProcessGroup(child, "SIGSTOP");
|
|
2426
2427
|
let parents = [child.pid];
|
|
2427
|
-
const inspectionDeadline = Date.now() +
|
|
2428
|
+
const inspectionDeadline = Date.now() + INSPECTION_TIMEOUT_MS;
|
|
2428
2429
|
while (parents.length > 0) {
|
|
2429
2430
|
const remaining = inspectionDeadline - Date.now();
|
|
2430
2431
|
if (remaining <= 0) {
|
|
@@ -5522,7 +5523,11 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
5522
5523
|
objcClassSymToTypePrefix,
|
|
5523
5524
|
typePrefixesInObj,
|
|
5524
5525
|
rootFuncs,
|
|
5525
|
-
rootSegs
|
|
5526
|
+
rootSegs,
|
|
5527
|
+
segPayloadRanges: sEnds.map((end, i) => [
|
|
5528
|
+
dataStart + sPayloadStarts[i],
|
|
5529
|
+
dataStart + end
|
|
5530
|
+
])
|
|
5526
5531
|
};
|
|
5527
5532
|
}
|
|
5528
5533
|
function parseWasmObjectCached(file, isDist, useCache) {
|
|
@@ -5765,6 +5770,7 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
5765
5770
|
const eagerFiles = [];
|
|
5766
5771
|
const lazyBuildObjects = /* @__PURE__ */ new Map();
|
|
5767
5772
|
const extraArchiveObjs = [];
|
|
5773
|
+
const objectBytes = /* @__PURE__ */ new Map();
|
|
5768
5774
|
let inStartLib = false;
|
|
5769
5775
|
let swiftrtOrigPath = "";
|
|
5770
5776
|
for (const t of tokens) {
|
|
@@ -5811,7 +5817,9 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
5811
5817
|
} else if (!inStartLib && t.endsWith(".a") && !t.endsWith("libclang_rt.builtins-wasm64.a") && fs4.existsSync(t)) {
|
|
5812
5818
|
const members = readArMembers(new Uint8Array(fs4.readFileSync(t)));
|
|
5813
5819
|
for (const m of members) {
|
|
5814
|
-
|
|
5820
|
+
const object3 = parseWasmObjectBytes(`${t}(${m.name})`, m.bytes, false);
|
|
5821
|
+
extraArchiveObjs.push(object3);
|
|
5822
|
+
objectBytes.set(object3, Buffer.from(m.bytes));
|
|
5815
5823
|
}
|
|
5816
5824
|
}
|
|
5817
5825
|
}
|
|
@@ -6182,9 +6190,28 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
6182
6190
|
"$s10Foundation16NSSortDescriptorC7keyPath9ascendingACs03KeyE0Cyxq_G_SbtcSLR_r0_lufC",
|
|
6183
6191
|
"$s10Foundation16NSSortDescriptorC7keyPath9ascendingACs03KeyE0Cyxq_G_SbtcSLR_r0_lufc"
|
|
6184
6192
|
]);
|
|
6193
|
+
const keepObjCClassesNamedInSegment = (obj, segIdx) => {
|
|
6194
|
+
const range = obj.segPayloadRanges[segIdx];
|
|
6195
|
+
if (!range) return;
|
|
6196
|
+
let bytes = objectBytes.get(obj);
|
|
6197
|
+
if (!bytes) objectBytes.set(obj, bytes = fs4.readFileSync(obj.file));
|
|
6198
|
+
const text2 = bytes.toString("latin1", range[0], range[1]);
|
|
6199
|
+
for (const match of text2.matchAll(/So(\d+)/g)) {
|
|
6200
|
+
const start = match.index + 2 + match[1].length;
|
|
6201
|
+
const length = Number(match[1]);
|
|
6202
|
+
if (text2[start + length] !== "C") continue;
|
|
6203
|
+
const symbol = `._OBJC_CLASS_${text2.slice(start, start + length)}`;
|
|
6204
|
+
for (const provider of lazyProviders.get(symbol) ?? []) {
|
|
6205
|
+
eagerDynamicObjects.add(provider);
|
|
6206
|
+
extractObject(provider);
|
|
6207
|
+
activateSymbolInObj(provider, provider.symNames.indexOf(symbol));
|
|
6208
|
+
}
|
|
6209
|
+
}
|
|
6210
|
+
};
|
|
6185
6211
|
while (workQueue.length > 0) {
|
|
6186
6212
|
const item = workQueue.pop();
|
|
6187
6213
|
const obj = item.obj;
|
|
6214
|
+
if (item.kind === "seg") keepObjCClassesNamedInSegment(obj, item.idx);
|
|
6188
6215
|
let relocs;
|
|
6189
6216
|
if (item.kind === "func") {
|
|
6190
6217
|
relocs = obj.funcRelocs[item.idx];
|
|
@@ -7034,8 +7061,12 @@ function createGuestImageLedger(input) {
|
|
|
7034
7061
|
}
|
|
7035
7062
|
}
|
|
7036
7063
|
}
|
|
7064
|
+
const nameBytes = /* @__PURE__ */ new Map();
|
|
7065
|
+
for (const definition of definitions)
|
|
7066
|
+
if (!nameBytes.has(definition.name))
|
|
7067
|
+
nameBytes.set(definition.name, Buffer.from(definition.name));
|
|
7037
7068
|
definitions.sort(
|
|
7038
|
-
(a, b) => Buffer.compare(
|
|
7069
|
+
(a, b) => Buffer.compare(nameBytes.get(a.name), nameBytes.get(b.name)) || a.image - b.image
|
|
7039
7070
|
);
|
|
7040
7071
|
const preserveCanonical = /* @__PURE__ */ new Set();
|
|
7041
7072
|
const definitionsByName = Map.groupBy(definitions, (definition) => definition.name);
|
|
@@ -7065,12 +7096,12 @@ function createGuestImageLedger(input) {
|
|
|
7065
7096
|
preserveCanonical.add(name2);
|
|
7066
7097
|
for (const name2 of input.commandLineSymbols ?? []) preserveCanonical.add(name2);
|
|
7067
7098
|
const bindingsByImage = /* @__PURE__ */ new Map();
|
|
7099
|
+
const definitionsByImage = Map.groupBy(definitions, (definition) => definition.image);
|
|
7068
7100
|
for (const caller of input.callers) {
|
|
7069
7101
|
const bindings = /* @__PURE__ */ new Map();
|
|
7070
7102
|
const seen = /* @__PURE__ */ new Map();
|
|
7071
7103
|
for (const image of [caller.image, ...caller.next])
|
|
7072
|
-
for (const definition of
|
|
7073
|
-
if (definition.image !== image) continue;
|
|
7104
|
+
for (const definition of definitionsByImage.get(image) ?? []) {
|
|
7074
7105
|
const previous = seen.get(definition.name);
|
|
7075
7106
|
if (previous?.image === definition.image) {
|
|
7076
7107
|
if (previous.weak && !definition.weak) {
|
|
@@ -7110,8 +7141,9 @@ function createGuestImageLedger(input) {
|
|
|
7110
7141
|
definitionsByAlias.set(definition.alias, definition);
|
|
7111
7142
|
}
|
|
7112
7143
|
const objects = units.map(({ image, object: object3, aliases, functionImports }) => {
|
|
7113
|
-
const
|
|
7114
|
-
|
|
7144
|
+
const shared = bindingsByImage.get(image);
|
|
7145
|
+
const own = startup.get(object3.path);
|
|
7146
|
+
const bindings = own ? new Map([...shared, ...own]) : shared;
|
|
7115
7147
|
for (const [name2, type] of functionImports) {
|
|
7116
7148
|
const alias = bindings.get(name2);
|
|
7117
7149
|
const provider = alias === void 0 ? void 0 : definitionsByAlias.get(alias);
|
|
@@ -8960,6 +8992,7 @@ function linkGuestImages(options) {
|
|
|
8960
8992
|
);
|
|
8961
8993
|
}
|
|
8962
8994
|
const archives = /* @__PURE__ */ new Map();
|
|
8995
|
+
const memberBytes = /* @__PURE__ */ new Map();
|
|
8963
8996
|
const prepare = (provider2) => {
|
|
8964
8997
|
const trace = runLink("discovery", [
|
|
8965
8998
|
...withOutput(args, discovery, true),
|
|
@@ -9003,20 +9036,23 @@ function linkGuestImages(options) {
|
|
|
9003
9036
|
}
|
|
9004
9037
|
const objectsByImage = /* @__PURE__ */ new Map();
|
|
9005
9038
|
for (const image of plan.images) objectsByImage.set(image.id, []);
|
|
9039
|
+
const artifacts = new Map(plan.artifacts.map((artifact) => [artifact.path, artifact]));
|
|
9006
9040
|
for (const item of selected2) {
|
|
9007
|
-
const artifact =
|
|
9008
|
-
(candidate) => candidate.path === item.artifact
|
|
9009
|
-
);
|
|
9041
|
+
const artifact = artifacts.get(item.artifact);
|
|
9010
9042
|
const image = selectedGuestInputImage(artifact, item.member);
|
|
9011
9043
|
let bytes;
|
|
9012
9044
|
if (item.member === null) bytes = fs5.readFileSync(item.artifact);
|
|
9013
9045
|
else {
|
|
9014
|
-
let
|
|
9015
|
-
if (!
|
|
9016
|
-
members = readArMembers(fs5.readFileSync(item.artifact));
|
|
9046
|
+
let byName = memberBytes.get(item.artifact);
|
|
9047
|
+
if (!byName) {
|
|
9048
|
+
const members = readArMembers(fs5.readFileSync(item.artifact));
|
|
9017
9049
|
archives.set(item.artifact, members);
|
|
9050
|
+
byName = /* @__PURE__ */ new Map();
|
|
9051
|
+
for (const member of members)
|
|
9052
|
+
if (!byName.has(member.name)) byName.set(member.name, member.bytes);
|
|
9053
|
+
memberBytes.set(item.artifact, byName);
|
|
9018
9054
|
}
|
|
9019
|
-
bytes =
|
|
9055
|
+
bytes = byName.get(item.member);
|
|
9020
9056
|
}
|
|
9021
9057
|
const objects = objectsByImage.get(image);
|
|
9022
9058
|
if (!objects) throw new Error(`unknown image ${image}`);
|
|
@@ -9049,10 +9085,11 @@ function linkGuestImages(options) {
|
|
|
9049
9085
|
const { selected, ledger } = prepared;
|
|
9050
9086
|
const replacements = /* @__PURE__ */ new Map();
|
|
9051
9087
|
const linkedOwners = /* @__PURE__ */ new Map();
|
|
9088
|
+
const ledgerObjects = new Map(ledger.objects.map((item) => [item.path, item]));
|
|
9052
9089
|
for (const [index, artifact] of plan.artifacts.entries()) {
|
|
9053
9090
|
const prefix = `${artifact.path}(`;
|
|
9054
9091
|
if (artifact.kind === "object") {
|
|
9055
|
-
const object3 =
|
|
9092
|
+
const object3 = ledgerObjects.get(artifact.path);
|
|
9056
9093
|
if (!object3) continue;
|
|
9057
9094
|
const output2 = path14.join(directory, `object-${index}.o`);
|
|
9058
9095
|
fs5.writeFileSync(output2, object3.bytes);
|
|
@@ -9072,9 +9109,7 @@ function linkGuestImages(options) {
|
|
|
9072
9109
|
const output = path14.join(directory, `archive-${index}.a`);
|
|
9073
9110
|
const inputs = members.map((member) => {
|
|
9074
9111
|
const memberOutput = path14.join(memberDir, member.name);
|
|
9075
|
-
const rewritten =
|
|
9076
|
-
(item) => item.path === `${prefix}${member.name})`
|
|
9077
|
-
);
|
|
9112
|
+
const rewritten = ledgerObjects.get(`${prefix}${member.name})`);
|
|
9078
9113
|
fs5.writeFileSync(memberOutput, rewritten?.bytes ?? member.bytes);
|
|
9079
9114
|
if (rewritten) {
|
|
9080
9115
|
linkedOwners.set(
|
|
@@ -9413,10 +9448,13 @@ function selectedGuestSymbolInputs(plan, selected) {
|
|
|
9413
9448
|
else {
|
|
9414
9449
|
let members = archives.get(item.artifact);
|
|
9415
9450
|
if (!members) {
|
|
9416
|
-
members =
|
|
9451
|
+
members = Map.groupBy(
|
|
9452
|
+
readArMembers(fs5.readFileSync(item.artifact)),
|
|
9453
|
+
(member) => member.name
|
|
9454
|
+
);
|
|
9417
9455
|
archives.set(item.artifact, members);
|
|
9418
9456
|
}
|
|
9419
|
-
const matching = members.
|
|
9457
|
+
const matching = members.get(item.member) ?? [];
|
|
9420
9458
|
if (matching.length !== 1)
|
|
9421
9459
|
throw new Error(
|
|
9422
9460
|
`ambiguous selected symbol input ${item.artifact}(${item.member})`
|
|
@@ -9815,9 +9853,10 @@ function sourceGuestClangLinkOptions(options) {
|
|
|
9815
9853
|
if (command.tool !== "clang" || compiler !== realpathSync2(path15.join(options.toolchainBin, "clang")) && compiler !== realpathSync2(path15.join(options.buildDirectory, CLANG_TARGET_MODULE_WRAPPER)))
|
|
9816
9854
|
throw new Error(`unsupported source object producer ${file}`);
|
|
9817
9855
|
const args = command.args.slice(1).filter((arg) => arg !== "-c");
|
|
9856
|
+
const targetBuild = path15.relative(options.buildDirectory, file).split(path15.sep).findLast((part) => part !== ".build" && part.endsWith(".build"));
|
|
9818
9857
|
const outputDirectory = path15.join(
|
|
9819
9858
|
options.directory,
|
|
9820
|
-
path15.basename(path15.dirname(file))
|
|
9859
|
+
targetBuild ?? path15.basename(path15.dirname(file))
|
|
9821
9860
|
);
|
|
9822
9861
|
mkdirSync2(outputDirectory, { recursive: true });
|
|
9823
9862
|
const output = path15.join(outputDirectory, `clang-link-${index}.ll`);
|
|
@@ -12143,6 +12182,52 @@ var clangInterfaceHeader = (header) => header.replace(/^@import (?:UIKitCore|UIK
|
|
|
12143
12182
|
/^@import (?:CoreFoundation|FoundationNetworking);$/gm,
|
|
12144
12183
|
"@import Foundation;"
|
|
12145
12184
|
).replace(/\b_TtC10Foundation\d+(NS\w+)\b/g, "$1").replace(/\b__attribute__\(\(objc_subclassing_restricted\)\)\s*/g, "");
|
|
12185
|
+
var objcEnumerations = (header) => [
|
|
12186
|
+
...header.matchAll(
|
|
12187
|
+
/^\s*typedef\s+(?:NS|CF|SWIFT)_\w*(?:ENUM|OPTIONS)\w*\s*\(\s*\w+\s*,\s*(\w+)\b/gm
|
|
12188
|
+
)
|
|
12189
|
+
].map((match) => match[1]);
|
|
12190
|
+
function nativelyDeclaredFunctions(generated, headers) {
|
|
12191
|
+
const candidates = [
|
|
12192
|
+
...new Set(
|
|
12193
|
+
[...generated.matchAll(/^\s*SWIFT_EXTERN\b[^(\n]*?\b(\w+)\s*\(/gm)].map(
|
|
12194
|
+
(match) => match[1]
|
|
12195
|
+
)
|
|
12196
|
+
)
|
|
12197
|
+
];
|
|
12198
|
+
if (candidates.length === 0) return [];
|
|
12199
|
+
const declaration = new RegExp(`^[^\\n#/*]*?\\b(${candidates.join("|")})\\s*\\(`, "gm");
|
|
12200
|
+
const found = /* @__PURE__ */ new Set();
|
|
12201
|
+
for (const header of headers)
|
|
12202
|
+
for (const match of header.matchAll(declaration)) found.add(match[1]);
|
|
12203
|
+
return [...found];
|
|
12204
|
+
}
|
|
12205
|
+
var sdkDeclarationOwners = /* @__PURE__ */ new Map();
|
|
12206
|
+
function sdkObjCDeclarationOwners(frameworks) {
|
|
12207
|
+
const known = sdkDeclarationOwners.get(frameworks);
|
|
12208
|
+
if (known) return known;
|
|
12209
|
+
const owners = /* @__PURE__ */ new Map();
|
|
12210
|
+
for (const framework of readdirSync8(frameworks))
|
|
12211
|
+
if (framework.endsWith(".framework")) {
|
|
12212
|
+
const headers = path27.join(frameworks, framework, "Headers");
|
|
12213
|
+
if (existsSync5(headers)) {
|
|
12214
|
+
for (const file of readdirSync8(headers, { recursive: true, encoding: "utf8" }))
|
|
12215
|
+
if (file.endsWith(".h")) {
|
|
12216
|
+
const header = readFileSync17(path27.join(headers, file), "utf8");
|
|
12217
|
+
for (const name2 of [
|
|
12218
|
+
...swiftInterfaceDeclarations(header),
|
|
12219
|
+
...objcEnumerations(header),
|
|
12220
|
+
...[
|
|
12221
|
+
...header.matchAll(/^[A-Z_]*_(?:EXTERN|EXPORT)\b[^;(\n]*?\b(\w+)\s*\(/gm)
|
|
12222
|
+
].map((match) => match[1])
|
|
12223
|
+
])
|
|
12224
|
+
owners.set(name2, framework.slice(0, -".framework".length));
|
|
12225
|
+
}
|
|
12226
|
+
}
|
|
12227
|
+
}
|
|
12228
|
+
sdkDeclarationOwners.set(frameworks, owners);
|
|
12229
|
+
return owners;
|
|
12230
|
+
}
|
|
12146
12231
|
function swiftHeaderWithSuperclassImports(header, interfaceFor) {
|
|
12147
12232
|
const superclasses = new Set(
|
|
12148
12233
|
[...header.matchAll(/@interface\s+\w+\s*:\s*(\w+)/g)].map((match) => match[1])
|
|
@@ -12187,6 +12272,10 @@ function withoutSwiftDeclarations(text2, declared, interfaceImport) {
|
|
|
12187
12272
|
const name2 = /^\s*(?:[A-Z_]\w*(?:\([^()\n]*\))?\s+)*@(?:protocol|interface)\s+(\w+)\s*(?=[:<{]|$)/.exec(
|
|
12188
12273
|
line
|
|
12189
12274
|
)?.[1];
|
|
12275
|
+
const external = /^\s*SWIFT_EXTERN\b[^(\n]*?\b(\w+)\s*\(.*\)[^;\n]*;\s*$/.exec(
|
|
12276
|
+
line
|
|
12277
|
+
)?.[1];
|
|
12278
|
+
if (external && declared.has(external)) continue;
|
|
12190
12279
|
const enumeration = /^\s*typedef\s+(?:NS_ENUM|NS_OPTIONS|SWIFT_ENUM(?:_NAMED)?)\s*\(\s*\w+\s*,\s*(\w+)\b/.exec(
|
|
12191
12280
|
line
|
|
12192
12281
|
)?.[1];
|
|
@@ -13017,7 +13106,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
|
|
|
13017
13106
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
13018
13107
|
var MULTI_MANIFEST_VERSION = 68;
|
|
13019
13108
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
13020
|
-
var compilerSourceDigest = true ? "
|
|
13109
|
+
var compilerSourceDigest = true ? "4a1be1d1296381c7090b5b2b704a7d2bebba03ceaa580613acd0f2c39c31ed4c" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
13021
13110
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
13022
13111
|
const hash = createHash13("sha256");
|
|
13023
13112
|
hash.update(`swift-compile
|
|
@@ -16196,15 +16285,29 @@ module ${moduleName}.Swift {
|
|
|
16196
16285
|
[
|
|
16197
16286
|
"#!/bin/sh",
|
|
16198
16287
|
"name=",
|
|
16288
|
+
"explicit=",
|
|
16199
16289
|
"prev=",
|
|
16200
16290
|
'for arg in "$@"; do',
|
|
16201
|
-
|
|
16291
|
+
" case $arg in -fmodule-name=*) explicit=1 ;; esac",
|
|
16292
|
+
' if [ "$prev" = -o ]; then',
|
|
16293
|
+
" case $arg in */*) dir=${arg%/*} ;; *) dir= ;; esac",
|
|
16294
|
+
' while [ -n "$dir" ] && [ "$dir" != / ] && [ "$dir" != . ]; do',
|
|
16295
|
+
" base=${dir##*/}",
|
|
16296
|
+
" case $base in",
|
|
16297
|
+
" .build) break ;;",
|
|
16298
|
+
" *.build) name=${base%.build}; break ;;",
|
|
16299
|
+
" esac",
|
|
16300
|
+
" next=${dir%/*}",
|
|
16301
|
+
' [ "$next" = "$dir" ] && break',
|
|
16302
|
+
" dir=$next",
|
|
16303
|
+
" done",
|
|
16304
|
+
" fi",
|
|
16202
16305
|
" prev=$arg",
|
|
16203
16306
|
"done",
|
|
16204
|
-
"
|
|
16205
|
-
`
|
|
16206
|
-
|
|
16207
|
-
"
|
|
16307
|
+
'if [ -n "$name" ] && [ -z "$explicit" ]; then',
|
|
16308
|
+
` exec '${path27.join(nativeToolchain(), "clang")}' "-fmodule-name=$name" "$@"`,
|
|
16309
|
+
"fi",
|
|
16310
|
+
`exec '${path27.join(nativeToolchain(), "clang")}' "$@"`,
|
|
16208
16311
|
""
|
|
16209
16312
|
].join("\n")
|
|
16210
16313
|
);
|
|
@@ -16671,7 +16774,7 @@ function frameworkLinkClosure(scratch2, roots) {
|
|
|
16671
16774
|
const deps = /* @__PURE__ */ new Set();
|
|
16672
16775
|
for (const file of paths) {
|
|
16673
16776
|
const module = /\/Modules\/([^/]+)\.swiftmodule$/.exec(file);
|
|
16674
|
-
const object3 = /\/([^/]+)\.build
|
|
16777
|
+
const object3 = /\/release\/([^/]+)\.build\/.+\.o$/.exec(file);
|
|
16675
16778
|
if (module) deps.add(module[1]);
|
|
16676
16779
|
else if (object3 && object3[1] !== pending.name) deps.add(object3[1]);
|
|
16677
16780
|
}
|
|
@@ -17351,11 +17454,28 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
17351
17454
|
))
|
|
17352
17455
|
declared.add(name3);
|
|
17353
17456
|
}
|
|
17354
|
-
const
|
|
17457
|
+
const own = withoutSwiftDeclarations(
|
|
17355
17458
|
clangInterfaceHeader(readFileSync17(source, "utf8")),
|
|
17356
17459
|
declared,
|
|
17357
17460
|
`#import <${name2}/${name2}.h>`
|
|
17358
17461
|
);
|
|
17462
|
+
const owners = sdkObjCDeclarationOwners(path27.dirname(path27.dirname(headers)));
|
|
17463
|
+
const foreign = /* @__PURE__ */ new Map();
|
|
17464
|
+
for (const declaration of [
|
|
17465
|
+
...swiftInterfaceDeclarations(own),
|
|
17466
|
+
...objcEnumerations(own),
|
|
17467
|
+
...[...own.matchAll(/^\s*SWIFT_EXTERN\b[^(\n]*?\b(\w+)\s*\(/gm)].map(
|
|
17468
|
+
(match) => match[1]
|
|
17469
|
+
)
|
|
17470
|
+
]) {
|
|
17471
|
+
const owner = owners.get(declaration);
|
|
17472
|
+
if (owner && owner !== name2) foreign.set(declaration, owner);
|
|
17473
|
+
}
|
|
17474
|
+
const header = foreign.size ? withoutSwiftDeclarations(
|
|
17475
|
+
own,
|
|
17476
|
+
new Set(foreign.keys()),
|
|
17477
|
+
[...new Set(foreign.values())].map((owner) => `#import <${owner}/${owner}.h>`).join("\n")
|
|
17478
|
+
) : own;
|
|
17359
17479
|
const value = {
|
|
17360
17480
|
file: path27.join(root, ".build/peach-framework-objc", `${name2}-Swift.h`),
|
|
17361
17481
|
header,
|
|
@@ -17392,18 +17512,25 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
17392
17512
|
`${producer}-Swift.h`
|
|
17393
17513
|
);
|
|
17394
17514
|
const original = preparation.nativeHeaderDeclarations[producer] ? emitted.replace(/-Swift\.h$/, "-Swift.original.h") : emitted;
|
|
17395
|
-
if (existsSync5(original))
|
|
17515
|
+
if (existsSync5(original)) {
|
|
17516
|
+
const generated = clangInterfaceHeader(readFileSync17(original, "utf8"));
|
|
17396
17517
|
writeBuildFile(
|
|
17397
17518
|
emitted,
|
|
17398
17519
|
withoutSwiftDeclarations(
|
|
17399
|
-
swiftHeaderWithSuperclassImports(
|
|
17400
|
-
|
|
17401
|
-
|
|
17402
|
-
|
|
17403
|
-
|
|
17520
|
+
swiftHeaderWithSuperclassImports(generated, frameworkInterface),
|
|
17521
|
+
/* @__PURE__ */ new Set([
|
|
17522
|
+
...preparation.nativeHeaderDeclarations[producer] ?? [],
|
|
17523
|
+
...nativelyDeclaredFunctions(
|
|
17524
|
+
generated,
|
|
17525
|
+
Object.entries(input.files).filter(
|
|
17526
|
+
([name2]) => name2.endsWith(".h") && !name2.endsWith("-Swift.h")
|
|
17527
|
+
).map(([, source]) => source)
|
|
17528
|
+
)
|
|
17529
|
+
]),
|
|
17404
17530
|
`#import <${producer}/${producer}.h>`
|
|
17405
17531
|
)
|
|
17406
17532
|
);
|
|
17533
|
+
}
|
|
17407
17534
|
}
|
|
17408
17535
|
}
|
|
17409
17536
|
const checkpoints = path27.join(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2250 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2250 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2250 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/dist-lib/swift.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2250 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|