peachsim 0.1.1654 → 0.1.1655
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 +237 -196
- 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 +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +237 -196
- 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 +264 -208
- package/dist-lib/host/fetch-proxy-handler.cjs +28 -13
- 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 +2 -2
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +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/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 +23 -23
- package/dist-lib/public-origins-lib.json +51 -51
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +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 +265 -209
- package/dist-lib/swift-compile.cjs +237 -196
- package/dist-lib/swift-compile.mjs +237 -196
- 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 +237 -196
- package/dist-lib/vite.cjs +2 -2
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +4 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/host/fetch-proxy-handler.ts +27 -10
- package/src/swift-compile.ts +286 -237
- package/src/swiftContract.ts +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1655 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __export = (target, all) => {
|
|
4
4
|
for (var name2 in all)
|
|
@@ -25993,7 +25993,7 @@ var EXECUTABLE_LINK_FLAGS = ` "-Xclang-linker", "-O0",
|
|
|
25993
25993
|
`;
|
|
25994
25994
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
25995
25995
|
var MULTI_MANIFEST_VERSION = 39;
|
|
25996
|
-
var compilerSourceDigest = true ? "
|
|
25996
|
+
var compilerSourceDigest = true ? "042e57f70d169ec5fd94262a87fc4d50da0c31cc6a6c329e56f12d4b7c5484a1" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
25997
25997
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
25998
25998
|
const hash2 = createHash9("sha256");
|
|
25999
25999
|
hash2.update(`swift-compile
|
|
@@ -30235,6 +30235,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
30235
30235
|
] : compileTargets(input);
|
|
30236
30236
|
const files = /* @__PURE__ */ new Map();
|
|
30237
30237
|
const native = /* @__PURE__ */ new Map();
|
|
30238
|
+
const targetFailures = [];
|
|
30238
30239
|
const bySourcePath = [...targets].sort(
|
|
30239
30240
|
(left, right) => right.path.length - left.path.length
|
|
30240
30241
|
);
|
|
@@ -30285,188 +30286,212 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
30285
30286
|
if (units.length === 0) continue;
|
|
30286
30287
|
const settings = input.nativeTargets?.find((value) => value.name === target.name);
|
|
30287
30288
|
if (entries.some(([file]) => file.endsWith(".swift")) || settings && units.some(([file]) => /\.mm?$/.test(file))) {
|
|
30288
|
-
|
|
30289
|
-
|
|
30290
|
-
|
|
30289
|
+
const swift = entries.some(([file]) => file.endsWith(".swift"));
|
|
30290
|
+
try {
|
|
30291
|
+
if (!settings)
|
|
30292
|
+
throw new Error(
|
|
30293
|
+
`mixed target ${target.name} requires its original native target settings; SwiftPM does not compile mixed source targets`
|
|
30294
|
+
);
|
|
30295
|
+
const headers = settings.headers;
|
|
30296
|
+
const roots2 = settings.bridgingHeader ? [settings.bridgingHeader] : settings.publicHeaders;
|
|
30297
|
+
for (const file of headers) {
|
|
30298
|
+
const destination = path8.join(layout.root, file);
|
|
30299
|
+
mkdirSync2(path8.dirname(destination), { recursive: true });
|
|
30300
|
+
writeFileSync3(destination, input.files[file]);
|
|
30301
|
+
}
|
|
30302
|
+
const search = [
|
|
30303
|
+
.../* @__PURE__ */ new Set([
|
|
30304
|
+
...settings?.headerSearchPaths ?? [],
|
|
30305
|
+
...headers.map((file) => path8.posix.dirname(file))
|
|
30306
|
+
])
|
|
30307
|
+
].flatMap((dir) => ["-I", path8.join(layout.root, dir)]);
|
|
30308
|
+
const pin = distribution ?? JSON.parse(readFileSync5(path8.join(moduleRoot, "toolchain.json"), "utf8"));
|
|
30309
|
+
const release = pin.release;
|
|
30310
|
+
const toolchainBin = swiftToolchain(release, swiftModuleSdk(moduleRoot));
|
|
30311
|
+
const sdkHeaders = materializeObjcSdk(
|
|
30312
|
+
path8.join(layout.root, ".build", "peach-objc-sdk")
|
|
30291
30313
|
);
|
|
30292
|
-
|
|
30293
|
-
|
|
30294
|
-
|
|
30295
|
-
|
|
30296
|
-
|
|
30297
|
-
|
|
30298
|
-
|
|
30299
|
-
|
|
30300
|
-
|
|
30301
|
-
|
|
30302
|
-
|
|
30303
|
-
|
|
30304
|
-
|
|
30305
|
-
|
|
30306
|
-
|
|
30307
|
-
|
|
30308
|
-
|
|
30309
|
-
|
|
30310
|
-
|
|
30311
|
-
|
|
30312
|
-
|
|
30313
|
-
|
|
30314
|
-
|
|
30315
|
-
|
|
30316
|
-
|
|
30317
|
-
|
|
30318
|
-
|
|
30319
|
-
|
|
30320
|
-
|
|
30321
|
-
|
|
30322
|
-
|
|
30323
|
-
|
|
30324
|
-
|
|
30325
|
-
|
|
30326
|
-
|
|
30327
|
-
|
|
30328
|
-
|
|
30329
|
-
|
|
30330
|
-
|
|
30331
|
-
|
|
30332
|
-
|
|
30333
|
-
|
|
30334
|
-
|
|
30335
|
-
|
|
30336
|
-
|
|
30337
|
-
|
|
30338
|
-
|
|
30339
|
-
|
|
30340
|
-
|
|
30341
|
-
|
|
30342
|
-
|
|
30343
|
-
|
|
30344
|
-
|
|
30345
|
-
|
|
30346
|
-
const accessorUnit = `${prefix}${OBJC_RESOURCE_ACCESSOR_BODY}`;
|
|
30347
|
-
if (accessor && (input.files[accessorUnit] !== void 0 || input.files[`${prefix}${OBJC_RESOURCE_ACCESSOR_HEADER}`] !== void 0))
|
|
30348
|
-
throw new Error(`target ${target.name} already contains its resource accessor`);
|
|
30349
|
-
const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
|
|
30350
|
-
const accessorFlags = accessor ? ["-include", accessorHeader] : [];
|
|
30351
|
-
if (accessor) {
|
|
30352
|
-
files.set(accessorHeader, accessor.header);
|
|
30353
|
-
files.set(path8.join(layout.root, accessorUnit), accessor.body);
|
|
30354
|
-
}
|
|
30355
|
-
const sourceHeaders = path8.join(
|
|
30356
|
-
layout.root,
|
|
30357
|
-
".build",
|
|
30358
|
-
"peach-objc-originals",
|
|
30359
|
-
target.name
|
|
30360
|
-
);
|
|
30361
|
-
mkdirSync2(sourceHeaders, { recursive: true });
|
|
30362
|
-
const modulemap = path8.join(sourceHeaders, "module.modulemap");
|
|
30363
|
-
writeFileSync3(
|
|
30364
|
-
modulemap,
|
|
30365
|
-
`module ${swiftTargetModuleName(target.name)} {
|
|
30314
|
+
const stageFlags = (flags2, sdkInclude) => flags2.map(
|
|
30315
|
+
(flag) => flag.replaceAll(SWIFT_NATIVE_INPUT_ROOT, layout.root).replaceAll(SWIFT_NATIVE_SDK_INCLUDE, sdkInclude)
|
|
30316
|
+
);
|
|
30317
|
+
const originalFlags = [
|
|
30318
|
+
...settings?.flags ?? [],
|
|
30319
|
+
...search,
|
|
30320
|
+
...(settings?.frameworkSearchPaths ?? []).flatMap((dir) => [
|
|
30321
|
+
"-F",
|
|
30322
|
+
path8.join(layout.root, dir)
|
|
30323
|
+
]),
|
|
30324
|
+
"-I",
|
|
30325
|
+
headerDirectory
|
|
30326
|
+
];
|
|
30327
|
+
const flags = stageFlags(
|
|
30328
|
+
originalFlags,
|
|
30329
|
+
path8.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
30330
|
+
);
|
|
30331
|
+
const prefixHeader = settings?.prefixHeader ? ["-include", path8.join(layout.root, settings.prefixHeader)] : [];
|
|
30332
|
+
const bundleName = entries.some(([file]) => file.endsWith(".swift")) ? void 0 : swiftObjCResourceBundleName({
|
|
30333
|
+
target: target.name,
|
|
30334
|
+
path: target.path,
|
|
30335
|
+
resources: resourceTargets.find((candidate) => candidate.name === target.name)?.resources ?? false,
|
|
30336
|
+
usesBundleMacro: entries.some(
|
|
30337
|
+
([file, contents]) => /\.(?:c|cc|cpp|cxx|m|mm|h|hpp|hh|hxx)$/.test(file) && /\bSWIFTPM_MODULE_BUNDLE\b/.test(contents)
|
|
30338
|
+
),
|
|
30339
|
+
bundles: input.resourceBundles
|
|
30340
|
+
});
|
|
30341
|
+
const accessor = bundleName === void 0 ? void 0 : swiftObjCResourceAccessor(bundleName);
|
|
30342
|
+
const accessorHeader = path8.join(
|
|
30343
|
+
layout.root,
|
|
30344
|
+
target.path,
|
|
30345
|
+
OBJC_RESOURCE_ACCESSOR_HEADER
|
|
30346
|
+
);
|
|
30347
|
+
const accessorUnit = `${prefix}${OBJC_RESOURCE_ACCESSOR_BODY}`;
|
|
30348
|
+
if (accessor && (input.files[accessorUnit] !== void 0 || input.files[`${prefix}${OBJC_RESOURCE_ACCESSOR_HEADER}`] !== void 0))
|
|
30349
|
+
throw new Error(`target ${target.name} already contains its resource accessor`);
|
|
30350
|
+
const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
|
|
30351
|
+
const accessorFlags = accessor ? ["-include", accessorHeader] : [];
|
|
30352
|
+
if (accessor) {
|
|
30353
|
+
files.set(accessorHeader, accessor.header);
|
|
30354
|
+
files.set(path8.join(layout.root, accessorUnit), accessor.body);
|
|
30355
|
+
}
|
|
30356
|
+
if (roots2.length) {
|
|
30357
|
+
const sourceHeaders = path8.join(
|
|
30358
|
+
layout.root,
|
|
30359
|
+
".build",
|
|
30360
|
+
"peach-objc-originals",
|
|
30361
|
+
target.name
|
|
30362
|
+
);
|
|
30363
|
+
mkdirSync2(sourceHeaders, { recursive: true });
|
|
30364
|
+
const modulemap = path8.join(sourceHeaders, "module.modulemap");
|
|
30365
|
+
writeFileSync3(
|
|
30366
|
+
modulemap,
|
|
30367
|
+
`module ${swiftTargetModuleName(target.name)} {
|
|
30366
30368
|
${roots2.map((file) => `header ${JSON.stringify(path8.join(layout.root, file))}`).join("\n")}
|
|
30367
30369
|
export *
|
|
30368
30370
|
}
|
|
30369
30371
|
`
|
|
30370
|
-
|
|
30371
|
-
|
|
30372
|
-
|
|
30373
|
-
|
|
30374
|
-
|
|
30375
|
-
|
|
30376
|
-
|
|
30377
|
-
|
|
30378
|
-
|
|
30379
|
-
|
|
30380
|
-
|
|
30381
|
-
|
|
30382
|
-
|
|
30383
|
-
|
|
30384
|
-
|
|
30385
|
-
|
|
30386
|
-
|
|
30387
|
-
|
|
30388
|
-
|
|
30389
|
-
|
|
30390
|
-
|
|
30391
|
-
|
|
30392
|
-
|
|
30393
|
-
|
|
30394
|
-
|
|
30395
|
-
|
|
30396
|
-
|
|
30397
|
-
|
|
30372
|
+
);
|
|
30373
|
+
const view = objcView(
|
|
30374
|
+
{
|
|
30375
|
+
module: swiftTargetModuleName(target.name),
|
|
30376
|
+
headers: sourceHeaders,
|
|
30377
|
+
modulemap
|
|
30378
|
+
},
|
|
30379
|
+
toolchainBin,
|
|
30380
|
+
path8.join(moduleRoot, "ios-simulator-stdlib"),
|
|
30381
|
+
path8.join(layout.root, ".build", "peach-objc-sdk"),
|
|
30382
|
+
path8.join(layout.root, ".build", "peach-objc-imports", target.name),
|
|
30383
|
+
{
|
|
30384
|
+
flags: stageFlags(originalFlags, path8.join(sdkHeaders, "usr/include")),
|
|
30385
|
+
target: `arm64-apple-ios${settings?.deploymentTarget ?? "16.0"}-simulator`
|
|
30386
|
+
}
|
|
30387
|
+
);
|
|
30388
|
+
const defined = /* @__PURE__ */ new Set();
|
|
30389
|
+
const declarations = (node) => {
|
|
30390
|
+
if (!node || typeof node !== "object") return;
|
|
30391
|
+
const name2 = Reflect.get(node, "name");
|
|
30392
|
+
if (Reflect.get(node, "kind") === "ObjCInterfaceDecl" && Reflect.get(node, "super") && typeof name2 === "string")
|
|
30393
|
+
defined.add(name2);
|
|
30394
|
+
const children = Reflect.get(node, "inner");
|
|
30395
|
+
if (Array.isArray(children)) for (const child of children) declarations(child);
|
|
30396
|
+
};
|
|
30397
|
+
declarations(view.clangAST);
|
|
30398
|
+
const foreignTypes = /* @__PURE__ */ new Map();
|
|
30399
|
+
for (const graph of view.graphs)
|
|
30400
|
+
for (const symbol of graph.symbols) {
|
|
30401
|
+
const nativeName = /^c:objc\(cs\)(\w+)$/.exec(
|
|
30402
|
+
symbol.identifier.precise
|
|
30403
|
+
)?.[1];
|
|
30404
|
+
if (nativeName && defined.has(nativeName))
|
|
30405
|
+
foreignTypes.set(symbol.pathComponents[0], nativeName);
|
|
30406
|
+
}
|
|
30407
|
+
imports.set(target.name, {
|
|
30408
|
+
view,
|
|
30409
|
+
classes: [...foreignTypes.values()],
|
|
30410
|
+
headers: roots2.map((file) => path8.join(layout.root, file)),
|
|
30411
|
+
foreignTypes
|
|
30412
|
+
});
|
|
30398
30413
|
}
|
|
30399
|
-
|
|
30400
|
-
|
|
30401
|
-
|
|
30402
|
-
|
|
30403
|
-
|
|
30404
|
-
|
|
30405
|
-
|
|
30406
|
-
const groups = /* @__PURE__ */ new Map();
|
|
30407
|
-
for (const [file] of nativeUnits) {
|
|
30408
|
-
const origin = settings?.sourceDirectories[file];
|
|
30409
|
-
if (origin) mkdirSync2(path8.join(layout.root, origin), { recursive: true });
|
|
30410
|
-
const perFile = [
|
|
30411
|
-
...origin ? ["-iquote", path8.join(layout.root, origin)] : [],
|
|
30412
|
-
...stageFlags(
|
|
30413
|
-
settings?.fileFlags[file] ?? [],
|
|
30414
|
-
path8.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
30415
|
-
)
|
|
30416
|
-
];
|
|
30417
|
-
const cxx = /\.(?:cc|cpp|cxx|mm)$/.test(file);
|
|
30418
|
-
const identity = createHash9("sha256").update(JSON.stringify([cxx, perFile])).digest("hex").slice(0, 12);
|
|
30419
|
-
const group = groups.get(identity) ?? {
|
|
30420
|
-
name: `${target.name}SwiftImplementation_${identity}`,
|
|
30421
|
-
sources: [],
|
|
30422
|
-
flags: [...flags, ...prefixHeader, ...accessorFlags, ...perFile],
|
|
30423
|
-
cxxFlags: [
|
|
30424
|
-
...flags,
|
|
30425
|
-
...prefixHeader,
|
|
30426
|
-
...accessorFlags,
|
|
30414
|
+
const thunks = roots2.length ? ["PeachObjCImports.generated.m"] : [];
|
|
30415
|
+
const groups = /* @__PURE__ */ new Map();
|
|
30416
|
+
for (const [file] of nativeUnits) {
|
|
30417
|
+
const origin = settings?.sourceDirectories[file];
|
|
30418
|
+
if (origin) mkdirSync2(path8.join(layout.root, origin), { recursive: true });
|
|
30419
|
+
const perFile = [
|
|
30420
|
+
...origin ? ["-iquote", path8.join(layout.root, origin)] : [],
|
|
30427
30421
|
...stageFlags(
|
|
30428
|
-
|
|
30422
|
+
settings?.fileFlags[file] ?? [],
|
|
30429
30423
|
path8.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
30430
|
-
)
|
|
30431
|
-
|
|
30432
|
-
|
|
30433
|
-
|
|
30434
|
-
|
|
30435
|
-
|
|
30436
|
-
|
|
30437
|
-
|
|
30438
|
-
|
|
30439
|
-
|
|
30440
|
-
|
|
30441
|
-
|
|
30442
|
-
|
|
30443
|
-
|
|
30444
|
-
|
|
30445
|
-
|
|
30446
|
-
|
|
30447
|
-
|
|
30448
|
-
|
|
30449
|
-
|
|
30450
|
-
|
|
30451
|
-
path: target.path,
|
|
30452
|
-
includeDirectory: include2,
|
|
30453
|
-
sources: nativeUnits.map(([file]) => file.slice(prefix.length)),
|
|
30454
|
-
lateSources: [...nativeUnits.map(([file]) => file.slice(prefix.length)), thunk],
|
|
30455
|
-
exclude: [
|
|
30456
|
-
...entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length)),
|
|
30457
|
-
...accessor ? [OBJC_RESOURCE_ACCESSOR_HEADER, OBJC_RESOURCE_ACCESSOR_BODY] : [],
|
|
30458
|
-
thunk,
|
|
30459
|
-
"include"
|
|
30460
|
-
],
|
|
30461
|
-
groups: [...groups.values()],
|
|
30462
|
-
late: {
|
|
30463
|
-
name: `${target.name}SwiftImplementation`,
|
|
30464
|
-
producers: [
|
|
30465
|
-
target.name,
|
|
30466
|
-
...(target.dependencies ?? []).filter((dependency) => swiftTargets.has(dependency.name)).map((dependency) => dependency.name)
|
|
30467
|
-
]
|
|
30424
|
+
)
|
|
30425
|
+
];
|
|
30426
|
+
const cxx = /\.(?:cc|cpp|cxx|mm)$/.test(file);
|
|
30427
|
+
const identity = createHash9("sha256").update(JSON.stringify([cxx, perFile])).digest("hex").slice(0, 12);
|
|
30428
|
+
const group = groups.get(identity) ?? {
|
|
30429
|
+
name: `${target.name}SwiftImplementation_${identity}`,
|
|
30430
|
+
sources: [],
|
|
30431
|
+
flags: [...flags, ...prefixHeader, ...accessorFlags, ...perFile],
|
|
30432
|
+
cxxFlags: [
|
|
30433
|
+
...flags,
|
|
30434
|
+
...prefixHeader,
|
|
30435
|
+
...accessorFlags,
|
|
30436
|
+
...stageFlags(
|
|
30437
|
+
cxx ? settings.cxxFlags : [],
|
|
30438
|
+
path8.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
30439
|
+
),
|
|
30440
|
+
...perFile
|
|
30441
|
+
]
|
|
30442
|
+
};
|
|
30443
|
+
group.sources.push(file.slice(prefix.length));
|
|
30444
|
+
groups.set(identity, group);
|
|
30468
30445
|
}
|
|
30469
|
-
|
|
30446
|
+
if (thunks.length)
|
|
30447
|
+
groups.set("imports", {
|
|
30448
|
+
name: `${target.name}ObjCImports`,
|
|
30449
|
+
sources: thunks,
|
|
30450
|
+
flags: [...flags, "-fobjc-arc"],
|
|
30451
|
+
cxxFlags: [...flags, "-fobjc-arc"]
|
|
30452
|
+
});
|
|
30453
|
+
const include2 = path8.join(layout.root, target.path, "include");
|
|
30454
|
+
files.set(
|
|
30455
|
+
path8.join(include2, "module.modulemap"),
|
|
30456
|
+
`module ${target.name}ImplementationDeclarations { export * }
|
|
30457
|
+
`
|
|
30458
|
+
);
|
|
30459
|
+
native.set(target.name, {
|
|
30460
|
+
mixed: true,
|
|
30461
|
+
path: target.path,
|
|
30462
|
+
includeDirectory: include2,
|
|
30463
|
+
sources: nativeUnits.map(([file]) => file.slice(prefix.length)),
|
|
30464
|
+
lateSources: [
|
|
30465
|
+
...nativeUnits.map(([file]) => file.slice(prefix.length)),
|
|
30466
|
+
...thunks
|
|
30467
|
+
],
|
|
30468
|
+
exclude: [
|
|
30469
|
+
...entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length)),
|
|
30470
|
+
...accessor ? [OBJC_RESOURCE_ACCESSOR_HEADER, OBJC_RESOURCE_ACCESSOR_BODY] : [],
|
|
30471
|
+
...thunks,
|
|
30472
|
+
"include"
|
|
30473
|
+
],
|
|
30474
|
+
groups: [...groups.values()],
|
|
30475
|
+
late: {
|
|
30476
|
+
name: `${target.name}SwiftImplementation`,
|
|
30477
|
+
producers: [
|
|
30478
|
+
target.name,
|
|
30479
|
+
...(target.dependencies ?? []).filter((dependency) => swiftTargets.has(dependency.name)).map((dependency) => dependency.name)
|
|
30480
|
+
]
|
|
30481
|
+
}
|
|
30482
|
+
});
|
|
30483
|
+
} catch (error) {
|
|
30484
|
+
if (!swift || !(error instanceof Error)) throw error;
|
|
30485
|
+
targetFailures.push(`${target.name}: ${error.message}`);
|
|
30486
|
+
native.set(target.name, {
|
|
30487
|
+
mixed: true,
|
|
30488
|
+
path: target.path,
|
|
30489
|
+
includeDirectory: path8.join(layout.root, target.path, "include"),
|
|
30490
|
+
sources: [],
|
|
30491
|
+
lateSources: [],
|
|
30492
|
+
exclude: entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length))
|
|
30493
|
+
});
|
|
30494
|
+
}
|
|
30470
30495
|
continue;
|
|
30471
30496
|
}
|
|
30472
30497
|
const includes = `${prefix}include/`;
|
|
@@ -30629,20 +30654,27 @@ export *
|
|
|
30629
30654
|
for (const name2 of objcProducers) {
|
|
30630
30655
|
const target = targets.find((value) => value.name === name2);
|
|
30631
30656
|
const prefix = target.path === "." ? "" : `${target.path}/`;
|
|
30632
|
-
|
|
30633
|
-
|
|
30634
|
-
|
|
30635
|
-
|
|
30636
|
-
|
|
30637
|
-
|
|
30638
|
-
|
|
30639
|
-
|
|
30640
|
-
|
|
30641
|
-
|
|
30642
|
-
|
|
30643
|
-
|
|
30644
|
-
|
|
30645
|
-
|
|
30657
|
+
let exported;
|
|
30658
|
+
try {
|
|
30659
|
+
exported = swiftObjCExports({
|
|
30660
|
+
module: swiftTargetModuleName(name2),
|
|
30661
|
+
sources: Object.entries(input.files).filter(
|
|
30662
|
+
([file]) => file.startsWith(prefix) && file.endsWith(".swift") && !targets.some(
|
|
30663
|
+
(candidate) => candidate.name !== name2 && candidate.path !== "." && candidate.path.startsWith(prefix) && file.startsWith(`${candidate.path}/`)
|
|
30664
|
+
) && !target.exclude?.some(
|
|
30665
|
+
(excluded) => file.slice(prefix.length) === excluded || file.slice(prefix.length).startsWith(`${excluded}/`)
|
|
30666
|
+
)
|
|
30667
|
+
),
|
|
30668
|
+
mask: swiftCodeMask,
|
|
30669
|
+
declarationStart,
|
|
30670
|
+
selector: objcSelectorName,
|
|
30671
|
+
foreignTypes: imports.get(name2)?.foreignTypes
|
|
30672
|
+
});
|
|
30673
|
+
} catch (error) {
|
|
30674
|
+
if (!(error instanceof Error)) throw error;
|
|
30675
|
+
targetFailures.push(`${name2}: ${error.message}`);
|
|
30676
|
+
continue;
|
|
30677
|
+
}
|
|
30646
30678
|
const original = imports.get(name2);
|
|
30647
30679
|
if (!exported && !original) continue;
|
|
30648
30680
|
objcModules.add(name2);
|
|
@@ -30914,6 +30946,7 @@ public func __peachObjcExportRoot() { _objcRegisterPeerClass(NSObject.self, nati
|
|
|
30914
30946
|
for (const dependency of dependencies.get(producer) ?? []) include(dependency);
|
|
30915
30947
|
return {
|
|
30916
30948
|
headerProducers: producers.filter((name2) => !included.has(name2)),
|
|
30949
|
+
targetFailures,
|
|
30917
30950
|
...rootOwner && objcExports ? {
|
|
30918
30951
|
objcImplementations: {
|
|
30919
30952
|
owner: path8.join(layout.root, rootOwner),
|
|
@@ -31136,6 +31169,9 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
31136
31169
|
return retain(root, built);
|
|
31137
31170
|
}
|
|
31138
31171
|
const preparation = writeSwiftProject(layout, input, moduleRoot);
|
|
31172
|
+
const unprepared = preparation.targetFailures.map(
|
|
31173
|
+
(failure) => `error: target ${failure}`
|
|
31174
|
+
);
|
|
31139
31175
|
const swift = path8.join(options.toolchainBin, "swift");
|
|
31140
31176
|
if (!existsSync2(swift)) {
|
|
31141
31177
|
throw new Error(
|
|
@@ -31285,18 +31321,23 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
31285
31321
|
);
|
|
31286
31322
|
} catch (retryError) {
|
|
31287
31323
|
throw new Error(
|
|
31288
|
-
|
|
31289
|
-
|
|
31290
|
-
|
|
31291
|
-
|
|
31324
|
+
[
|
|
31325
|
+
...unprepared,
|
|
31326
|
+
projectDiagnostic(outputOf(retryError), layout, input.files)
|
|
31327
|
+
].join("\n"),
|
|
31328
|
+
{ cause: retryError }
|
|
31292
31329
|
);
|
|
31293
31330
|
}
|
|
31294
31331
|
} else {
|
|
31295
|
-
throw new Error(
|
|
31296
|
-
|
|
31297
|
-
|
|
31332
|
+
throw new Error(
|
|
31333
|
+
[...unprepared, projectDiagnostic(output, layout, input.files)].join(
|
|
31334
|
+
"\n"
|
|
31335
|
+
),
|
|
31336
|
+
{ cause: error }
|
|
31337
|
+
);
|
|
31298
31338
|
}
|
|
31299
31339
|
}
|
|
31340
|
+
if (unprepared.length) throw new Error(unprepared.join("\n"));
|
|
31300
31341
|
const artifact = {
|
|
31301
31342
|
hash: hash2,
|
|
31302
31343
|
bytes: readFileSync5(builtArtifact(layout)),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1655 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1655 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1655 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } 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.1655 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|