peachsim 0.1.1964 → 0.1.1965
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +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 +156 -28
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +154 -27
- 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 +155 -28
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- 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 +1 -1
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +1 -1
- 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 +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +156 -28
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +1 -1
- 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 +153 -26
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/package.json +1 -1
- package/src/swift-packages.ts +13 -1
- package/src/swift-standin-emit.ts +16 -3
- package/src/swift-standins.ts +144 -17
package/dist-lib/vite-swift.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1965 | (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;
|
|
@@ -6221,7 +6221,12 @@ function splitTopLevel(text5, separator) {
|
|
|
6221
6221
|
function emitSwiftStandin(sourceGraphs, options) {
|
|
6222
6222
|
const imported = new Set(options.imports);
|
|
6223
6223
|
const importedTypeModules = options.importedTypeModules ?? /* @__PURE__ */ new Map();
|
|
6224
|
-
const
|
|
6224
|
+
const ownIds = new Set(
|
|
6225
|
+
sourceGraphs.flatMap(
|
|
6226
|
+
(graph) => graph.symbols.map((symbol2) => symbol2.identifier.precise)
|
|
6227
|
+
)
|
|
6228
|
+
);
|
|
6229
|
+
const graphs = [...sourceGraphs, ...options.dependencyGraphs ?? []].map(
|
|
6225
6230
|
(graph) => qualifyImportedTypes(graph, imported, importedTypeModules)
|
|
6226
6231
|
);
|
|
6227
6232
|
const nativeObjcProtocols = objcProtocolsInSwiftSignatures(graphs);
|
|
@@ -6805,7 +6810,8 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
6805
6810
|
)
|
|
6806
6811
|
].filter((name3, at, all2) => all2.indexOf(name3) === at);
|
|
6807
6812
|
const parentSymbol = superId.has(id) ? byId.get(superId.get(id)) : void 0;
|
|
6808
|
-
if (!parentSymbol
|
|
6813
|
+
if (!parentSymbol || !ownIds.has(parentSymbol.identifier.precise))
|
|
6814
|
+
list2.push(standinMarker);
|
|
6809
6815
|
const open = symbol2.accessLevel === "open" && (!parentSymbol || parentSymbol.accessLevel === "open");
|
|
6810
6816
|
const objcName = /^c:objc\(cs\)(\w+)$/.exec(id)?.[1];
|
|
6811
6817
|
emit(
|
|
@@ -7155,7 +7161,9 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
7155
7161
|
return match ? [`${match[1]}|${LEADING_ATTRS.exec(text(symbol2))[2]}`] : [];
|
|
7156
7162
|
})
|
|
7157
7163
|
);
|
|
7158
|
-
const roots = [...byId.values()].filter(
|
|
7164
|
+
const roots = [...byId.values()].filter(
|
|
7165
|
+
(symbol2) => ownIds.has(symbol2.identifier.precise) && !owner.has(symbol2.identifier.precise) && !unavailable(symbol2)
|
|
7166
|
+
).filter((symbol2) => {
|
|
7159
7167
|
const name3 = /^c:@M@[^@]+@F@([^@]+)$/.exec(symbol2.identifier.precise)?.[1];
|
|
7160
7168
|
return !name3 || !cExports.has(`${name3}|${text(symbol2)}`);
|
|
7161
7169
|
}).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
|
|
@@ -7167,6 +7175,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
7167
7175
|
for (const [name3, members2] of [...external].sort(([a], [b]) => a.localeCompare(b))) {
|
|
7168
7176
|
const seen = /* @__PURE__ */ new Set();
|
|
7169
7177
|
const kept = members2.filter((member) => {
|
|
7178
|
+
if (!ownIds.has(member.identifier.precise)) return false;
|
|
7170
7179
|
const key2 = `${member.kind.identifier}|${text(member)}`;
|
|
7171
7180
|
if (unavailable(member) || seen.has(key2)) return false;
|
|
7172
7181
|
seen.add(key2);
|
|
@@ -29311,6 +29320,11 @@ function resolveSwiftPackages(options) {
|
|
|
29311
29320
|
if (claimed.has(key2)) return true;
|
|
29312
29321
|
const target = pkg.manifest.targets.get(name3);
|
|
29313
29322
|
if (!target || target.type !== "regular" || placeholderPackage(pkg)) return false;
|
|
29323
|
+
const files2 = swiftTargetFiles(pkg.manifest, target);
|
|
29324
|
+
if (files2.every(
|
|
29325
|
+
(file) => file.endsWith(".swift") && import_node_fs38.default.readFileSync(file, "utf8").trim() === ""
|
|
29326
|
+
))
|
|
29327
|
+
return false;
|
|
29314
29328
|
claimed.add(key2);
|
|
29315
29329
|
provided.delete(name3);
|
|
29316
29330
|
for (const dependency of target.dependencies) {
|
|
@@ -29418,7 +29432,7 @@ function resolveSwiftPackages(options) {
|
|
|
29418
29432
|
if (provided.has(name3) && placeholderPackage(pkg)) return;
|
|
29419
29433
|
for (const dependency of pkg.manifest.targets.get(name3)?.dependencies ?? []) {
|
|
29420
29434
|
if (dependency.kind === "target") visit(pkg, dependency.name);
|
|
29421
|
-
else {
|
|
29435
|
+
else if (!provided.has(dependency.name)) {
|
|
29422
29436
|
const nested = dependencyPackage(pkg, dependency);
|
|
29423
29437
|
if (nested && typeof nested !== "string")
|
|
29424
29438
|
for (const root of nested.manifest.products.get(dependency.name)?.targets ?? [])
|
|
@@ -29427,6 +29441,7 @@ function resolveSwiftPackages(options) {
|
|
|
29427
29441
|
}
|
|
29428
29442
|
};
|
|
29429
29443
|
for (const { product, source } of listed) {
|
|
29444
|
+
if (provided.has(product)) continue;
|
|
29430
29445
|
const pkg = source.kind === "unnamed" ? unnamed(source, product) : packages.get(sourceKey(source));
|
|
29431
29446
|
if (!pkg || typeof pkg === "string") continue;
|
|
29432
29447
|
for (const root of pkg.manifest.products.get(product)?.targets ?? [])
|
|
@@ -29649,7 +29664,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
|
|
|
29649
29664
|
return hash.digest("hex");
|
|
29650
29665
|
}
|
|
29651
29666
|
var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
29652
|
-
var STANDIN_SOURCE_DIGEST = true ? "
|
|
29667
|
+
var STANDIN_SOURCE_DIGEST = true ? "a7e1ecaaff6c8861c337b5c6049d14450807f5be059d246ba06f5abd6384bfe7" : standinSourceDigest();
|
|
29653
29668
|
|
|
29654
29669
|
// src/swift-standins.ts
|
|
29655
29670
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -30533,11 +30548,11 @@ ${uikit}${body}`
|
|
|
30533
30548
|
function binaryHeaderSearchPaths(binary, root, declaredFrameworks) {
|
|
30534
30549
|
const artifact = xcframework(binary);
|
|
30535
30550
|
const slice = simulatorSlice(artifact.dir);
|
|
30536
|
-
const found = surfaces(artifact.dir, slice);
|
|
30551
|
+
const found = surfaces(artifact.dir, binary.target, slice);
|
|
30537
30552
|
const frameworks = [
|
|
30538
30553
|
...new Set(
|
|
30539
30554
|
found.flatMap(
|
|
30540
|
-
(surface) => "modulemap" in surface && import_node_path47.default.basename(import_node_path47.default.dirname(surface.modulemap)) === "Modules" ? [import_node_path47.default.dirname(
|
|
30555
|
+
(surface) => "modulemap" in surface && import_node_path47.default.basename(import_node_path47.default.dirname(surface.modulemap)) === "Modules" ? [import_node_path47.default.dirname(surface.headers)] : []
|
|
30541
30556
|
)
|
|
30542
30557
|
)
|
|
30543
30558
|
];
|
|
@@ -30602,8 +30617,21 @@ function binaryHeaderSearchPaths(binary, root, declaredFrameworks) {
|
|
|
30602
30617
|
import_node_path47.default.join(pending, "frameworks", import_node_path47.default.basename(framework), part),
|
|
30603
30618
|
{ recursive: true, dereference: true }
|
|
30604
30619
|
);
|
|
30620
|
+
const surface = found.find(
|
|
30621
|
+
(item) => "headers" in item && import_node_path47.default.dirname(item.headers) === framework
|
|
30622
|
+
);
|
|
30623
|
+
if (surface && "modulemap" in surface) {
|
|
30624
|
+
const modules = import_node_path47.default.join(
|
|
30625
|
+
pending,
|
|
30626
|
+
"frameworks",
|
|
30627
|
+
import_node_path47.default.basename(framework),
|
|
30628
|
+
"Modules"
|
|
30629
|
+
);
|
|
30630
|
+
import_node_fs45.default.mkdirSync(modules, { recursive: true });
|
|
30631
|
+
import_node_fs45.default.copyFileSync(surface.modulemap, import_node_path47.default.join(modules, "module.modulemap"));
|
|
30632
|
+
}
|
|
30605
30633
|
}
|
|
30606
|
-
for (const [index, directory] of headers.entries())
|
|
30634
|
+
for (const [index, directory] of headers.entries()) {
|
|
30607
30635
|
import_node_fs45.default.cpSync(directory, import_node_path47.default.join(pending, "headers", String(index)), {
|
|
30608
30636
|
recursive: true,
|
|
30609
30637
|
dereference: true,
|
|
@@ -30611,6 +30639,15 @@ function binaryHeaderSearchPaths(binary, root, declaredFrameworks) {
|
|
|
30611
30639
|
filter: (source) => import_node_fs45.default.statSync(source).isDirectory() ? import_node_path47.default.dirname(source) !== directory || !import_node_path47.default.basename(source).startsWith("ios-") : !isBinaryLibraryFile(source)
|
|
30612
30640
|
} : {}
|
|
30613
30641
|
});
|
|
30642
|
+
const surface = found.find(
|
|
30643
|
+
(item) => "headers" in item && item.headers === directory
|
|
30644
|
+
);
|
|
30645
|
+
if (surface && "modulemap" in surface)
|
|
30646
|
+
import_node_fs45.default.copyFileSync(
|
|
30647
|
+
surface.modulemap,
|
|
30648
|
+
import_node_path47.default.join(pending, "headers", String(index), "module.modulemap")
|
|
30649
|
+
);
|
|
30650
|
+
}
|
|
30614
30651
|
const contents = (0, import_node_crypto24.createHash)("sha256");
|
|
30615
30652
|
for (const relative2 of import_node_fs45.default.readdirSync(pending, { recursive: true, encoding: "utf8" }).sort()) {
|
|
30616
30653
|
const file = import_node_path47.default.join(pending, relative2);
|
|
@@ -30666,7 +30703,7 @@ function simulatorSlice(xcframeworkDir) {
|
|
|
30666
30703
|
const slice = import_node_fs45.default.readdirSync(xcframeworkDir).filter((name3) => /^ios-.+-simulator$/.test(name3)).sort()[0];
|
|
30667
30704
|
return slice ? import_node_path47.default.join(xcframeworkDir, slice) : null;
|
|
30668
30705
|
}
|
|
30669
|
-
function surfaces(xcframeworkDir, slice = simulatorSlice(xcframeworkDir)) {
|
|
30706
|
+
function surfaces(xcframeworkDir, target, slice = simulatorSlice(xcframeworkDir)) {
|
|
30670
30707
|
const standaloneMap = import_node_path47.default.join(xcframeworkDir, "module.modulemap");
|
|
30671
30708
|
if (import_node_fs45.default.existsSync(standaloneMap)) {
|
|
30672
30709
|
const module2 = moduleMapName(import_node_fs45.default.readFileSync(standaloneMap, "utf8"));
|
|
@@ -30687,7 +30724,16 @@ function surfaces(xcframeworkDir, slice = simulatorSlice(xcframeworkDir)) {
|
|
|
30687
30724
|
(name3) => name3.endsWith(".swiftinterface") && !name3.endsWith(".private.swiftinterface") && !name3.endsWith(".package.swiftinterface")
|
|
30688
30725
|
);
|
|
30689
30726
|
const chosen = interfaces.find((name3) => name3.startsWith("arm64-")) ?? interfaces[0] ?? null;
|
|
30690
|
-
|
|
30727
|
+
let modulemap = import_node_path47.default.join(framework, "Modules", "module.modulemap");
|
|
30728
|
+
const headers2 = import_node_path47.default.join(framework, "Headers");
|
|
30729
|
+
if (!import_node_fs45.default.existsSync(modulemap) && files(headers2, (name3) => name3.endsWith(".h")).length) {
|
|
30730
|
+
const umbrella = import_node_fs45.default.existsSync(import_node_path47.default.join(headers2, `${module2}.h`)) ? `umbrella header "${module2}.h"` : 'umbrella "Headers"';
|
|
30731
|
+
modulemap = generatedModuleMap(
|
|
30732
|
+
`framework module ${module2} { ${umbrella} export * module * { export * } }
|
|
30733
|
+
`,
|
|
30734
|
+
true
|
|
30735
|
+
);
|
|
30736
|
+
}
|
|
30691
30737
|
if (chosen) {
|
|
30692
30738
|
const privateInterface = import_node_path47.default.join(
|
|
30693
30739
|
swiftmodule,
|
|
@@ -30719,8 +30765,33 @@ function surfaces(xcframeworkDir, slice = simulatorSlice(xcframeworkDir)) {
|
|
|
30719
30765
|
const module2 = moduleMapName(import_node_fs45.default.readFileSync(modulemap, "utf8"));
|
|
30720
30766
|
if (module2) found.push(headerSurface(module2, modulemap, import_node_path47.default.dirname(modulemap)));
|
|
30721
30767
|
}
|
|
30768
|
+
if (found.length === 0 && files(headers, (name3) => name3.endsWith(".h")).length) {
|
|
30769
|
+
const module2 = swiftTargetModuleName(target);
|
|
30770
|
+
const modulemap = generatedModuleMap(
|
|
30771
|
+
`module ${module2} { umbrella "." export * }
|
|
30772
|
+
`,
|
|
30773
|
+
false
|
|
30774
|
+
);
|
|
30775
|
+
found.push(headerSurface(module2, modulemap, headers));
|
|
30776
|
+
}
|
|
30722
30777
|
return found;
|
|
30723
30778
|
}
|
|
30779
|
+
function generatedModuleMap(text5, framework) {
|
|
30780
|
+
const dir = import_node_path47.default.join(
|
|
30781
|
+
cacheDir4,
|
|
30782
|
+
"modulemaps",
|
|
30783
|
+
key(text5),
|
|
30784
|
+
framework ? "Modules" : "Headers"
|
|
30785
|
+
);
|
|
30786
|
+
import_node_fs45.default.mkdirSync(dir, { recursive: true });
|
|
30787
|
+
const file = import_node_path47.default.join(dir, "module.modulemap");
|
|
30788
|
+
if (!import_node_fs45.default.existsSync(file)) {
|
|
30789
|
+
const pending = `${file}.${process.pid}.tmp`;
|
|
30790
|
+
import_node_fs45.default.writeFileSync(pending, text5);
|
|
30791
|
+
import_node_fs45.default.renameSync(pending, file);
|
|
30792
|
+
}
|
|
30793
|
+
return file;
|
|
30794
|
+
}
|
|
30724
30795
|
function peachModuleDirs(toolchain, imports2, sdkIncludes) {
|
|
30725
30796
|
const { moduleRoot, toolchainBin } = toolchain;
|
|
30726
30797
|
if (swiftDistributionAt(moduleRoot)) return [import_node_path47.default.join(moduleRoot, "modules")];
|
|
@@ -31144,18 +31215,39 @@ function wasmFlags(toolchain, imports2) {
|
|
|
31144
31215
|
...toolchain.standinModules ? ["-I", toolchain.standinModules] : []
|
|
31145
31216
|
];
|
|
31146
31217
|
}
|
|
31147
|
-
function objcStandin(surface, binary, toolchain, work, behavior) {
|
|
31218
|
+
function objcStandin(surface, binary, toolchain, work, behavior, frameworks, siblings) {
|
|
31148
31219
|
const view = objcView(
|
|
31149
31220
|
surface,
|
|
31150
31221
|
toolchain.toolchainBin,
|
|
31151
31222
|
import_node_path47.default.join(toolchain.moduleRoot, "ios-simulator-stdlib"),
|
|
31152
31223
|
cacheDir4,
|
|
31153
|
-
import_node_path47.default.join(work, "objc")
|
|
31224
|
+
import_node_path47.default.join(work, "objc"),
|
|
31225
|
+
void 0,
|
|
31226
|
+
frameworks.dirs
|
|
31154
31227
|
);
|
|
31155
31228
|
const provided = new Set(swiftPeachModules(toolchain.moduleRoot));
|
|
31156
31229
|
const headerModules = view.imports.filter(
|
|
31157
|
-
(name3) => !STANDIN_IMPORTS.includes(name3) && provided.has(name3)
|
|
31230
|
+
(name3) => !STANDIN_IMPORTS.includes(name3) && (provided.has(name3) || siblings.has(name3))
|
|
31158
31231
|
);
|
|
31232
|
+
const dependencyGraphs = headerModules.flatMap((module2) => {
|
|
31233
|
+
const dependency = frameworks.surfaces.get(module2);
|
|
31234
|
+
if (!dependency || module2 === surface.module) return [];
|
|
31235
|
+
return objcView(
|
|
31236
|
+
{
|
|
31237
|
+
module: dependency.module,
|
|
31238
|
+
modulemap: dependency.modulemap,
|
|
31239
|
+
headers: dependency.headers
|
|
31240
|
+
},
|
|
31241
|
+
toolchain.toolchainBin,
|
|
31242
|
+
import_node_path47.default.join(toolchain.moduleRoot, "ios-simulator-stdlib"),
|
|
31243
|
+
cacheDir4,
|
|
31244
|
+
import_node_path47.default.join(work, "dependencies", module2),
|
|
31245
|
+
void 0,
|
|
31246
|
+
frameworks.dirs.filter(
|
|
31247
|
+
(dir) => !import_node_fs45.default.existsSync(import_node_path47.default.join(dir, `${module2}.framework`))
|
|
31248
|
+
)
|
|
31249
|
+
).graphs;
|
|
31250
|
+
});
|
|
31159
31251
|
return graphStandin(
|
|
31160
31252
|
surface.module,
|
|
31161
31253
|
view.graphs,
|
|
@@ -31172,12 +31264,18 @@ function objcStandin(surface, binary, toolchain, work, behavior) {
|
|
|
31172
31264
|
(dependency) => swiftTargetModuleName(dependency.module)
|
|
31173
31265
|
) ?? []
|
|
31174
31266
|
])
|
|
31175
|
-
]
|
|
31267
|
+
],
|
|
31268
|
+
false,
|
|
31269
|
+
/* @__PURE__ */ new Map(),
|
|
31270
|
+
null,
|
|
31271
|
+
/* @__PURE__ */ new Map(),
|
|
31272
|
+
/* @__PURE__ */ new Map(),
|
|
31273
|
+
dependencyGraphs
|
|
31176
31274
|
);
|
|
31177
31275
|
}
|
|
31178
31276
|
var OBJC_UNREPRESENTABLE = "cannot be marked '@objc' because its type cannot be represented in Objective-C";
|
|
31179
31277
|
var INERT_VALUE = /missing argument|cannot be constructed|has no member 'init'|no exact matches in call to initializer|cannot convert return expression|does not conform to '|extra argument|takes no arguments|could not be inferred|cannot infer/;
|
|
31180
|
-
function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, behavior, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map()) {
|
|
31278
|
+
function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, behavior, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = []) {
|
|
31181
31279
|
const paths = new Set(
|
|
31182
31280
|
graphs.flatMap(
|
|
31183
31281
|
(graph) => graph.symbols.map((symbol2) => symbol2.pathComponents.join("."))
|
|
@@ -31233,6 +31331,7 @@ function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, be
|
|
|
31233
31331
|
objcProperties,
|
|
31234
31332
|
inheritedConformances,
|
|
31235
31333
|
projections,
|
|
31334
|
+
dependencyGraphs,
|
|
31236
31335
|
...placeholder ? { exported: placeholder.exported, placeholder: binary.placeholder.gap } : {}
|
|
31237
31336
|
});
|
|
31238
31337
|
for (const entry of skipped) {
|
|
@@ -31909,6 +32008,11 @@ async function sourceStandins(binaries, toolchain, provided, behavior) {
|
|
|
31909
32008
|
}))
|
|
31910
32009
|
});
|
|
31911
32010
|
} else {
|
|
32011
|
+
const absent = missingArtifactGap(binary);
|
|
32012
|
+
if (absent !== null) {
|
|
32013
|
+
gaps.set(binary.target, absent);
|
|
32014
|
+
continue;
|
|
32015
|
+
}
|
|
31912
32016
|
const resolved = xcframework(binary);
|
|
31913
32017
|
const dir = import_node_path47.default.join(artifact, String(index), import_node_path47.default.basename(resolved.dir));
|
|
31914
32018
|
import_node_fs45.default.cpSync(resolved.dir, dir, { recursive: true, dereference: true });
|
|
@@ -32045,7 +32149,9 @@ function standinGenerationInputs(binaries, toolchain, behavior = {}, sourceDir)
|
|
|
32045
32149
|
const modules = new Set(
|
|
32046
32150
|
binaries.flatMap((binary) => {
|
|
32047
32151
|
try {
|
|
32048
|
-
return binary.publicHeaders !== void 0 || binary.placeholder !== void 0 ? [swiftTargetModuleName(binary.target)] : surfaces(xcframework(binary).dir).map(
|
|
32152
|
+
return binary.publicHeaders !== void 0 || binary.placeholder !== void 0 ? [swiftTargetModuleName(binary.target)] : surfaces(xcframework(binary).dir, binary.target).map(
|
|
32153
|
+
(surface) => surface.module
|
|
32154
|
+
);
|
|
32049
32155
|
} catch {
|
|
32050
32156
|
return [];
|
|
32051
32157
|
}
|
|
@@ -32078,7 +32184,9 @@ function standinGenerationInputs(binaries, toolchain, behavior = {}, sourceDir)
|
|
|
32078
32184
|
if (binary.publicHeaders !== void 0 && swiftTargetModuleName(binary.target) !== binary.target)
|
|
32079
32185
|
parts.push(`module/${swiftTargetModuleName(binary.target)}`);
|
|
32080
32186
|
try {
|
|
32081
|
-
if (binary.publicHeaders === void 0 && surfaces(xcframework(binary).dir).some(
|
|
32187
|
+
if (binary.publicHeaders === void 0 && surfaces(xcframework(binary).dir, binary.target).some(
|
|
32188
|
+
(surface) => surface.kind === "swift"
|
|
32189
|
+
))
|
|
32082
32190
|
parts.push(`interface-emulation/${WASI_EMULATION.join(",")}`);
|
|
32083
32191
|
parts.push(
|
|
32084
32192
|
binary.target,
|
|
@@ -32106,10 +32214,14 @@ function standinGenerationInputs(binaries, toolchain, behavior = {}, sourceDir)
|
|
|
32106
32214
|
}
|
|
32107
32215
|
return (0, import_node_crypto24.createHash)("sha256").update(parts.join("\0")).digest("hex");
|
|
32108
32216
|
}
|
|
32217
|
+
function missingArtifactGap(binary) {
|
|
32218
|
+
if (swiftBinaryOnDisk(binary)) return null;
|
|
32219
|
+
return `${import_node_path47.default.relative(process.cwd(), binary.dir) || binary.dir} is not on disk, and Xcode fails without it too; run the script that downloads or builds it, then run again`;
|
|
32220
|
+
}
|
|
32109
32221
|
async function binaryStandins(binary, toolchain, provided, behavior, frameworks, siblings) {
|
|
32110
32222
|
if (provided.has(binary.target)) return [];
|
|
32111
|
-
|
|
32112
|
-
|
|
32223
|
+
const absent = missingArtifactGap(binary);
|
|
32224
|
+
if (absent !== null) return absent;
|
|
32113
32225
|
import_node_fs45.default.mkdirSync(cacheDir4, { recursive: true });
|
|
32114
32226
|
const work = import_node_fs45.default.mkdtempSync(import_node_path47.default.join(cacheDir4, "work-"));
|
|
32115
32227
|
let all;
|
|
@@ -32161,7 +32273,7 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
|
|
|
32161
32273
|
].join("\0");
|
|
32162
32274
|
} else {
|
|
32163
32275
|
const artifact = xcframework(binary);
|
|
32164
|
-
all = surfaces(artifact.dir);
|
|
32276
|
+
all = surfaces(artifact.dir, binary.target);
|
|
32165
32277
|
digest = artifact.digest;
|
|
32166
32278
|
}
|
|
32167
32279
|
} catch (error) {
|
|
@@ -32180,7 +32292,8 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
|
|
|
32180
32292
|
);
|
|
32181
32293
|
hash.update(digest);
|
|
32182
32294
|
hash.update([...siblings].sort().join("\0"));
|
|
32183
|
-
if (found.some((surface) => surface.kind === "mixed"
|
|
32295
|
+
if (found.some((surface) => surface.kind === "mixed" || surface.kind === "objc"))
|
|
32296
|
+
hash.update(frameworks.digest);
|
|
32184
32297
|
for (const surface of found) {
|
|
32185
32298
|
hash.update(`${surface.kind}\0${surface.module}\0`);
|
|
32186
32299
|
for (const file of surface.kind === "swift" ? [surface.interface] : surface.kind === "source" ? surface.sources : [
|
|
@@ -32257,7 +32370,9 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
|
|
|
32257
32370
|
binary,
|
|
32258
32371
|
toolchain,
|
|
32259
32372
|
dir,
|
|
32260
|
-
new Map(Object.entries(configured.get(surface.module) ?? {}))
|
|
32373
|
+
new Map(Object.entries(configured.get(surface.module) ?? {})),
|
|
32374
|
+
frameworks,
|
|
32375
|
+
siblings
|
|
32261
32376
|
) : binary.cxxHeaders ? await cxxStandin(surface, binary, toolchain, dir) : cStandin(surface, binary, toolchain, dir)
|
|
32262
32377
|
);
|
|
32263
32378
|
} catch (error) {
|
|
@@ -32302,6 +32417,7 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
32302
32417
|
import_node_fs45.default.mkdirSync(cacheDir4, { recursive: true });
|
|
32303
32418
|
const modules = import_node_fs45.default.mkdtempSync(import_node_path47.default.join(cacheDir4, "modules-"));
|
|
32304
32419
|
const frameworkDirs = /* @__PURE__ */ new Set();
|
|
32420
|
+
const frameworkSurfaces = /* @__PURE__ */ new Map();
|
|
32305
32421
|
const frameworkInputs = [];
|
|
32306
32422
|
const byModule = new Map(
|
|
32307
32423
|
binaries.map((binary) => [swiftTargetModuleName(binary.target), binary])
|
|
@@ -32325,16 +32441,26 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
32325
32441
|
frameworkInputs.push(`${binary.target}\0${artifact.digest}`);
|
|
32326
32442
|
const imports2 = /* @__PURE__ */ new Set();
|
|
32327
32443
|
interfaceImports.set(binary, imports2);
|
|
32328
|
-
for (const surface of surfaces(artifact.dir)) {
|
|
32444
|
+
for (const surface of surfaces(artifact.dir, binary.target)) {
|
|
32329
32445
|
byModule.set(surface.module, binary);
|
|
32330
32446
|
if (surface.kind === "swift" || surface.kind === "mixed")
|
|
32331
32447
|
for (const module2 of swiftImportNames(
|
|
32332
32448
|
import_node_fs45.default.readFileSync(surface.interface, "utf8")
|
|
32333
32449
|
))
|
|
32334
32450
|
imports2.add(module2);
|
|
32451
|
+
if (surface.kind === "objc" || surface.kind === "mixed")
|
|
32452
|
+
for (const file of files(surface.headers, (name3) => name3.endsWith(".h")))
|
|
32453
|
+
for (const module2 of clangImportNames(
|
|
32454
|
+
import_node_fs45.default.readFileSync(import_node_path47.default.join(surface.headers, file), "utf8")
|
|
32455
|
+
))
|
|
32456
|
+
imports2.add(module2);
|
|
32335
32457
|
if (surface.kind === "c") continue;
|
|
32458
|
+
if (surface.kind === "objc" || surface.kind === "mixed")
|
|
32459
|
+
frameworkSurfaces.set(surface.module, surface);
|
|
32460
|
+
if (surface.kind !== "swift" && import_node_path47.default.basename(import_node_path47.default.dirname(surface.modulemap)) !== "Modules")
|
|
32461
|
+
continue;
|
|
32336
32462
|
frameworkDirs.add(
|
|
32337
|
-
surface.kind === "swift" ? import_node_path47.default.resolve(surface.interface, "../../../..") : import_node_path47.default.resolve(surface.
|
|
32463
|
+
surface.kind === "swift" ? import_node_path47.default.resolve(surface.interface, "../../../..") : import_node_path47.default.resolve(surface.headers, "../..")
|
|
32338
32464
|
);
|
|
32339
32465
|
}
|
|
32340
32466
|
} catch {
|
|
@@ -32343,7 +32469,8 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
32343
32469
|
const generatedToolchain = { ...toolchain, standinModules: modules };
|
|
32344
32470
|
const frameworks = {
|
|
32345
32471
|
dirs: [...frameworkDirs].sort(),
|
|
32346
|
-
digest: (0, import_node_crypto24.createHash)("sha256").update(frameworkInputs.sort().join("\0")).digest("hex")
|
|
32472
|
+
digest: (0, import_node_crypto24.createHash)("sha256").update(frameworkInputs.sort().join("\0")).digest("hex"),
|
|
32473
|
+
surfaces: frameworkSurfaces
|
|
32347
32474
|
};
|
|
32348
32475
|
const siblings = new Map(
|
|
32349
32476
|
binaries.map((binary) => [
|
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1965 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1965 | (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;
|
package/package.json
CHANGED
package/src/swift-packages.ts
CHANGED
|
@@ -765,6 +765,15 @@ export function resolveSwiftPackages(options: {
|
|
|
765
765
|
if (claimed.has(key)) return true
|
|
766
766
|
const target = pkg.manifest.targets.get(name)
|
|
767
767
|
if (!target || target.type !== 'regular' || placeholderPackage(pkg)) return false
|
|
768
|
+
// a wrapper target with empty sources only groups binary dependencies,
|
|
769
|
+
// which the module peach ships already covers
|
|
770
|
+
const files = swiftTargetFiles(pkg.manifest, target)
|
|
771
|
+
if (
|
|
772
|
+
files.every(
|
|
773
|
+
(file) => file.endsWith('.swift') && fs.readFileSync(file, 'utf8').trim() === '',
|
|
774
|
+
)
|
|
775
|
+
)
|
|
776
|
+
return false
|
|
768
777
|
claimed.add(key)
|
|
769
778
|
provided.delete(name)
|
|
770
779
|
for (const dependency of target.dependencies) {
|
|
@@ -907,7 +916,7 @@ export function resolveSwiftPackages(options: {
|
|
|
907
916
|
if (provided.has(name) && placeholderPackage(pkg)) return
|
|
908
917
|
for (const dependency of pkg.manifest.targets.get(name)?.dependencies ?? []) {
|
|
909
918
|
if (dependency.kind === 'target') visit(pkg, dependency.name)
|
|
910
|
-
else {
|
|
919
|
+
else if (!provided.has(dependency.name)) {
|
|
911
920
|
const nested = dependencyPackage(pkg, dependency)
|
|
912
921
|
if (nested && typeof nested !== 'string')
|
|
913
922
|
for (const root of nested.manifest.products.get(dependency.name)?.targets ??
|
|
@@ -916,7 +925,10 @@ export function resolveSwiftPackages(options: {
|
|
|
916
925
|
}
|
|
917
926
|
}
|
|
918
927
|
}
|
|
928
|
+
// a product peach ships links as its module, so its wrapper targets and
|
|
929
|
+
// their binary dependencies are not part of what compiles
|
|
919
930
|
for (const { product, source } of listed) {
|
|
931
|
+
if (provided.has(product)) continue
|
|
920
932
|
const pkg =
|
|
921
933
|
source.kind === 'unnamed'
|
|
922
934
|
? unnamed(source, product)
|
|
@@ -168,6 +168,7 @@ export type StandinOptions = {
|
|
|
168
168
|
behavior?: ReadonlyMap<string, StandinBehavior>
|
|
169
169
|
/** modules whose protocols a declaration may conform to, beside its own. */
|
|
170
170
|
family?: string[]
|
|
171
|
+
dependencyGraphs?: SymbolGraph[]
|
|
171
172
|
/** paths left out, with why: the compiler rejected their declaration. */
|
|
172
173
|
omit?: ReadonlyMap<string, string>
|
|
173
174
|
/** inert paths whose return value the compiler rejected: their bodies trap. */
|
|
@@ -638,7 +639,12 @@ export function emitSwiftStandin(
|
|
|
638
639
|
): StandinResult {
|
|
639
640
|
const imported = new Set(options.imports)
|
|
640
641
|
const importedTypeModules = options.importedTypeModules ?? new Map<string, string>()
|
|
641
|
-
const
|
|
642
|
+
const ownIds = new Set(
|
|
643
|
+
sourceGraphs.flatMap((graph) =>
|
|
644
|
+
graph.symbols.map((symbol) => symbol.identifier.precise),
|
|
645
|
+
),
|
|
646
|
+
)
|
|
647
|
+
const graphs = [...sourceGraphs, ...(options.dependencyGraphs ?? [])].map((graph) =>
|
|
642
648
|
qualifyImportedTypes(graph, imported, importedTypeModules),
|
|
643
649
|
)
|
|
644
650
|
const nativeObjcProtocols = objcProtocolsInSwiftSignatures(graphs)
|
|
@@ -1453,7 +1459,8 @@ export function emitSwiftStandin(
|
|
|
1453
1459
|
),
|
|
1454
1460
|
].filter((name, at, all) => all.indexOf(name) === at)
|
|
1455
1461
|
const parentSymbol = superId.has(id) ? byId.get(superId.get(id)!) : undefined
|
|
1456
|
-
if (!parentSymbol
|
|
1462
|
+
if (!parentSymbol || !ownIds.has(parentSymbol.identifier.precise))
|
|
1463
|
+
list.push(standinMarker)
|
|
1457
1464
|
const open =
|
|
1458
1465
|
symbol.accessLevel === 'open' &&
|
|
1459
1466
|
(!parentSymbol || parentSymbol.accessLevel === 'open')
|
|
@@ -1936,7 +1943,12 @@ export function emitSwiftStandin(
|
|
|
1936
1943
|
}),
|
|
1937
1944
|
)
|
|
1938
1945
|
const roots = [...byId.values()]
|
|
1939
|
-
.filter(
|
|
1946
|
+
.filter(
|
|
1947
|
+
(symbol) =>
|
|
1948
|
+
ownIds.has(symbol.identifier.precise) &&
|
|
1949
|
+
!owner.has(symbol.identifier.precise) &&
|
|
1950
|
+
!unavailable(symbol),
|
|
1951
|
+
)
|
|
1940
1952
|
.filter((symbol) => {
|
|
1941
1953
|
const name = /^c:@M@[^@]+@F@([^@]+)$/.exec(symbol.identifier.precise)?.[1]
|
|
1942
1954
|
return !name || !cExports.has(`${name}|${text(symbol)}`)
|
|
@@ -1950,6 +1962,7 @@ export function emitSwiftStandin(
|
|
|
1950
1962
|
for (const [name, members] of [...external].sort(([a], [b]) => a.localeCompare(b))) {
|
|
1951
1963
|
const seen = new Set<string>()
|
|
1952
1964
|
const kept = members.filter((member) => {
|
|
1965
|
+
if (!ownIds.has(member.identifier.precise)) return false
|
|
1953
1966
|
const key = `${member.kind.identifier}|${text(member)}`
|
|
1954
1967
|
if (unavailable(member) || seen.has(key)) return false
|
|
1955
1968
|
seen.add(key)
|