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
|
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;
|
|
@@ -26010,7 +26010,7 @@ var EXECUTABLE_LINK_FLAGS = ` "-Xclang-linker", "-O0",
|
|
|
26010
26010
|
`;
|
|
26011
26011
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
26012
26012
|
var MULTI_MANIFEST_VERSION = 39;
|
|
26013
|
-
var compilerSourceDigest = true ? "
|
|
26013
|
+
var compilerSourceDigest = true ? "042e57f70d169ec5fd94262a87fc4d50da0c31cc6a6c329e56f12d4b7c5484a1" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
26014
26014
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
26015
26015
|
const hash2 = (0, import_node_crypto7.createHash)("sha256");
|
|
26016
26016
|
hash2.update(`swift-compile
|
|
@@ -30252,6 +30252,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
30252
30252
|
] : compileTargets(input);
|
|
30253
30253
|
const files = /* @__PURE__ */ new Map();
|
|
30254
30254
|
const native = /* @__PURE__ */ new Map();
|
|
30255
|
+
const targetFailures = [];
|
|
30255
30256
|
const bySourcePath = [...targets].sort(
|
|
30256
30257
|
(left, right) => right.path.length - left.path.length
|
|
30257
30258
|
);
|
|
@@ -30302,188 +30303,212 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
30302
30303
|
if (units.length === 0) continue;
|
|
30303
30304
|
const settings = input.nativeTargets?.find((value) => value.name === target.name);
|
|
30304
30305
|
if (entries.some(([file]) => file.endsWith(".swift")) || settings && units.some(([file]) => /\.mm?$/.test(file))) {
|
|
30305
|
-
|
|
30306
|
-
|
|
30307
|
-
|
|
30306
|
+
const swift = entries.some(([file]) => file.endsWith(".swift"));
|
|
30307
|
+
try {
|
|
30308
|
+
if (!settings)
|
|
30309
|
+
throw new Error(
|
|
30310
|
+
`mixed target ${target.name} requires its original native target settings; SwiftPM does not compile mixed source targets`
|
|
30311
|
+
);
|
|
30312
|
+
const headers = settings.headers;
|
|
30313
|
+
const roots2 = settings.bridgingHeader ? [settings.bridgingHeader] : settings.publicHeaders;
|
|
30314
|
+
for (const file of headers) {
|
|
30315
|
+
const destination = import_node_path7.default.join(layout.root, file);
|
|
30316
|
+
(0, import_node_fs6.mkdirSync)(import_node_path7.default.dirname(destination), { recursive: true });
|
|
30317
|
+
(0, import_node_fs6.writeFileSync)(destination, input.files[file]);
|
|
30318
|
+
}
|
|
30319
|
+
const search = [
|
|
30320
|
+
.../* @__PURE__ */ new Set([
|
|
30321
|
+
...settings?.headerSearchPaths ?? [],
|
|
30322
|
+
...headers.map((file) => import_node_path7.default.posix.dirname(file))
|
|
30323
|
+
])
|
|
30324
|
+
].flatMap((dir) => ["-I", import_node_path7.default.join(layout.root, dir)]);
|
|
30325
|
+
const pin = distribution ?? JSON.parse((0, import_node_fs6.readFileSync)(import_node_path7.default.join(moduleRoot, "toolchain.json"), "utf8"));
|
|
30326
|
+
const release = pin.release;
|
|
30327
|
+
const toolchainBin = swiftToolchain(release, swiftModuleSdk(moduleRoot));
|
|
30328
|
+
const sdkHeaders = materializeObjcSdk(
|
|
30329
|
+
import_node_path7.default.join(layout.root, ".build", "peach-objc-sdk")
|
|
30308
30330
|
);
|
|
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
|
-
|
|
30347
|
-
|
|
30348
|
-
|
|
30349
|
-
|
|
30350
|
-
|
|
30351
|
-
|
|
30352
|
-
|
|
30353
|
-
|
|
30354
|
-
|
|
30355
|
-
|
|
30356
|
-
|
|
30357
|
-
|
|
30358
|
-
|
|
30359
|
-
|
|
30360
|
-
|
|
30361
|
-
|
|
30362
|
-
|
|
30363
|
-
const accessorUnit = `${prefix}${OBJC_RESOURCE_ACCESSOR_BODY}`;
|
|
30364
|
-
if (accessor && (input.files[accessorUnit] !== void 0 || input.files[`${prefix}${OBJC_RESOURCE_ACCESSOR_HEADER}`] !== void 0))
|
|
30365
|
-
throw new Error(`target ${target.name} already contains its resource accessor`);
|
|
30366
|
-
const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
|
|
30367
|
-
const accessorFlags = accessor ? ["-include", accessorHeader] : [];
|
|
30368
|
-
if (accessor) {
|
|
30369
|
-
files.set(accessorHeader, accessor.header);
|
|
30370
|
-
files.set(import_node_path7.default.join(layout.root, accessorUnit), accessor.body);
|
|
30371
|
-
}
|
|
30372
|
-
const sourceHeaders = import_node_path7.default.join(
|
|
30373
|
-
layout.root,
|
|
30374
|
-
".build",
|
|
30375
|
-
"peach-objc-originals",
|
|
30376
|
-
target.name
|
|
30377
|
-
);
|
|
30378
|
-
(0, import_node_fs6.mkdirSync)(sourceHeaders, { recursive: true });
|
|
30379
|
-
const modulemap = import_node_path7.default.join(sourceHeaders, "module.modulemap");
|
|
30380
|
-
(0, import_node_fs6.writeFileSync)(
|
|
30381
|
-
modulemap,
|
|
30382
|
-
`module ${swiftTargetModuleName(target.name)} {
|
|
30331
|
+
const stageFlags = (flags2, sdkInclude) => flags2.map(
|
|
30332
|
+
(flag) => flag.replaceAll(SWIFT_NATIVE_INPUT_ROOT, layout.root).replaceAll(SWIFT_NATIVE_SDK_INCLUDE, sdkInclude)
|
|
30333
|
+
);
|
|
30334
|
+
const originalFlags = [
|
|
30335
|
+
...settings?.flags ?? [],
|
|
30336
|
+
...search,
|
|
30337
|
+
...(settings?.frameworkSearchPaths ?? []).flatMap((dir) => [
|
|
30338
|
+
"-F",
|
|
30339
|
+
import_node_path7.default.join(layout.root, dir)
|
|
30340
|
+
]),
|
|
30341
|
+
"-I",
|
|
30342
|
+
headerDirectory
|
|
30343
|
+
];
|
|
30344
|
+
const flags = stageFlags(
|
|
30345
|
+
originalFlags,
|
|
30346
|
+
import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
30347
|
+
);
|
|
30348
|
+
const prefixHeader = settings?.prefixHeader ? ["-include", import_node_path7.default.join(layout.root, settings.prefixHeader)] : [];
|
|
30349
|
+
const bundleName = entries.some(([file]) => file.endsWith(".swift")) ? void 0 : swiftObjCResourceBundleName({
|
|
30350
|
+
target: target.name,
|
|
30351
|
+
path: target.path,
|
|
30352
|
+
resources: resourceTargets.find((candidate) => candidate.name === target.name)?.resources ?? false,
|
|
30353
|
+
usesBundleMacro: entries.some(
|
|
30354
|
+
([file, contents]) => /\.(?:c|cc|cpp|cxx|m|mm|h|hpp|hh|hxx)$/.test(file) && /\bSWIFTPM_MODULE_BUNDLE\b/.test(contents)
|
|
30355
|
+
),
|
|
30356
|
+
bundles: input.resourceBundles
|
|
30357
|
+
});
|
|
30358
|
+
const accessor = bundleName === void 0 ? void 0 : swiftObjCResourceAccessor(bundleName);
|
|
30359
|
+
const accessorHeader = import_node_path7.default.join(
|
|
30360
|
+
layout.root,
|
|
30361
|
+
target.path,
|
|
30362
|
+
OBJC_RESOURCE_ACCESSOR_HEADER
|
|
30363
|
+
);
|
|
30364
|
+
const accessorUnit = `${prefix}${OBJC_RESOURCE_ACCESSOR_BODY}`;
|
|
30365
|
+
if (accessor && (input.files[accessorUnit] !== void 0 || input.files[`${prefix}${OBJC_RESOURCE_ACCESSOR_HEADER}`] !== void 0))
|
|
30366
|
+
throw new Error(`target ${target.name} already contains its resource accessor`);
|
|
30367
|
+
const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
|
|
30368
|
+
const accessorFlags = accessor ? ["-include", accessorHeader] : [];
|
|
30369
|
+
if (accessor) {
|
|
30370
|
+
files.set(accessorHeader, accessor.header);
|
|
30371
|
+
files.set(import_node_path7.default.join(layout.root, accessorUnit), accessor.body);
|
|
30372
|
+
}
|
|
30373
|
+
if (roots2.length) {
|
|
30374
|
+
const sourceHeaders = import_node_path7.default.join(
|
|
30375
|
+
layout.root,
|
|
30376
|
+
".build",
|
|
30377
|
+
"peach-objc-originals",
|
|
30378
|
+
target.name
|
|
30379
|
+
);
|
|
30380
|
+
(0, import_node_fs6.mkdirSync)(sourceHeaders, { recursive: true });
|
|
30381
|
+
const modulemap = import_node_path7.default.join(sourceHeaders, "module.modulemap");
|
|
30382
|
+
(0, import_node_fs6.writeFileSync)(
|
|
30383
|
+
modulemap,
|
|
30384
|
+
`module ${swiftTargetModuleName(target.name)} {
|
|
30383
30385
|
${roots2.map((file) => `header ${JSON.stringify(import_node_path7.default.join(layout.root, file))}`).join("\n")}
|
|
30384
30386
|
export *
|
|
30385
30387
|
}
|
|
30386
30388
|
`
|
|
30387
|
-
|
|
30388
|
-
|
|
30389
|
-
|
|
30390
|
-
|
|
30391
|
-
|
|
30392
|
-
|
|
30393
|
-
|
|
30394
|
-
|
|
30395
|
-
|
|
30396
|
-
|
|
30397
|
-
|
|
30398
|
-
|
|
30399
|
-
|
|
30400
|
-
|
|
30401
|
-
|
|
30402
|
-
|
|
30403
|
-
|
|
30404
|
-
|
|
30405
|
-
|
|
30406
|
-
|
|
30407
|
-
|
|
30408
|
-
|
|
30409
|
-
|
|
30410
|
-
|
|
30411
|
-
|
|
30412
|
-
|
|
30413
|
-
|
|
30414
|
-
|
|
30389
|
+
);
|
|
30390
|
+
const view = objcView(
|
|
30391
|
+
{
|
|
30392
|
+
module: swiftTargetModuleName(target.name),
|
|
30393
|
+
headers: sourceHeaders,
|
|
30394
|
+
modulemap
|
|
30395
|
+
},
|
|
30396
|
+
toolchainBin,
|
|
30397
|
+
import_node_path7.default.join(moduleRoot, "ios-simulator-stdlib"),
|
|
30398
|
+
import_node_path7.default.join(layout.root, ".build", "peach-objc-sdk"),
|
|
30399
|
+
import_node_path7.default.join(layout.root, ".build", "peach-objc-imports", target.name),
|
|
30400
|
+
{
|
|
30401
|
+
flags: stageFlags(originalFlags, import_node_path7.default.join(sdkHeaders, "usr/include")),
|
|
30402
|
+
target: `arm64-apple-ios${settings?.deploymentTarget ?? "16.0"}-simulator`
|
|
30403
|
+
}
|
|
30404
|
+
);
|
|
30405
|
+
const defined = /* @__PURE__ */ new Set();
|
|
30406
|
+
const declarations = (node) => {
|
|
30407
|
+
if (!node || typeof node !== "object") return;
|
|
30408
|
+
const name2 = Reflect.get(node, "name");
|
|
30409
|
+
if (Reflect.get(node, "kind") === "ObjCInterfaceDecl" && Reflect.get(node, "super") && typeof name2 === "string")
|
|
30410
|
+
defined.add(name2);
|
|
30411
|
+
const children = Reflect.get(node, "inner");
|
|
30412
|
+
if (Array.isArray(children)) for (const child of children) declarations(child);
|
|
30413
|
+
};
|
|
30414
|
+
declarations(view.clangAST);
|
|
30415
|
+
const foreignTypes = /* @__PURE__ */ new Map();
|
|
30416
|
+
for (const graph of view.graphs)
|
|
30417
|
+
for (const symbol of graph.symbols) {
|
|
30418
|
+
const nativeName = /^c:objc\(cs\)(\w+)$/.exec(
|
|
30419
|
+
symbol.identifier.precise
|
|
30420
|
+
)?.[1];
|
|
30421
|
+
if (nativeName && defined.has(nativeName))
|
|
30422
|
+
foreignTypes.set(symbol.pathComponents[0], nativeName);
|
|
30423
|
+
}
|
|
30424
|
+
imports.set(target.name, {
|
|
30425
|
+
view,
|
|
30426
|
+
classes: [...foreignTypes.values()],
|
|
30427
|
+
headers: roots2.map((file) => import_node_path7.default.join(layout.root, file)),
|
|
30428
|
+
foreignTypes
|
|
30429
|
+
});
|
|
30415
30430
|
}
|
|
30416
|
-
|
|
30417
|
-
|
|
30418
|
-
|
|
30419
|
-
|
|
30420
|
-
|
|
30421
|
-
|
|
30422
|
-
|
|
30423
|
-
const groups = /* @__PURE__ */ new Map();
|
|
30424
|
-
for (const [file] of nativeUnits) {
|
|
30425
|
-
const origin = settings?.sourceDirectories[file];
|
|
30426
|
-
if (origin) (0, import_node_fs6.mkdirSync)(import_node_path7.default.join(layout.root, origin), { recursive: true });
|
|
30427
|
-
const perFile = [
|
|
30428
|
-
...origin ? ["-iquote", import_node_path7.default.join(layout.root, origin)] : [],
|
|
30429
|
-
...stageFlags(
|
|
30430
|
-
settings?.fileFlags[file] ?? [],
|
|
30431
|
-
import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
30432
|
-
)
|
|
30433
|
-
];
|
|
30434
|
-
const cxx = /\.(?:cc|cpp|cxx|mm)$/.test(file);
|
|
30435
|
-
const identity = (0, import_node_crypto7.createHash)("sha256").update(JSON.stringify([cxx, perFile])).digest("hex").slice(0, 12);
|
|
30436
|
-
const group = groups.get(identity) ?? {
|
|
30437
|
-
name: `${target.name}SwiftImplementation_${identity}`,
|
|
30438
|
-
sources: [],
|
|
30439
|
-
flags: [...flags, ...prefixHeader, ...accessorFlags, ...perFile],
|
|
30440
|
-
cxxFlags: [
|
|
30441
|
-
...flags,
|
|
30442
|
-
...prefixHeader,
|
|
30443
|
-
...accessorFlags,
|
|
30431
|
+
const thunks = roots2.length ? ["PeachObjCImports.generated.m"] : [];
|
|
30432
|
+
const groups = /* @__PURE__ */ new Map();
|
|
30433
|
+
for (const [file] of nativeUnits) {
|
|
30434
|
+
const origin = settings?.sourceDirectories[file];
|
|
30435
|
+
if (origin) (0, import_node_fs6.mkdirSync)(import_node_path7.default.join(layout.root, origin), { recursive: true });
|
|
30436
|
+
const perFile = [
|
|
30437
|
+
...origin ? ["-iquote", import_node_path7.default.join(layout.root, origin)] : [],
|
|
30444
30438
|
...stageFlags(
|
|
30445
|
-
|
|
30439
|
+
settings?.fileFlags[file] ?? [],
|
|
30446
30440
|
import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
30447
|
-
)
|
|
30448
|
-
|
|
30449
|
-
|
|
30450
|
-
|
|
30451
|
-
|
|
30452
|
-
|
|
30453
|
-
|
|
30454
|
-
|
|
30455
|
-
|
|
30456
|
-
|
|
30457
|
-
|
|
30458
|
-
|
|
30459
|
-
|
|
30460
|
-
|
|
30461
|
-
|
|
30462
|
-
|
|
30463
|
-
|
|
30464
|
-
|
|
30465
|
-
|
|
30466
|
-
|
|
30467
|
-
|
|
30468
|
-
path: target.path,
|
|
30469
|
-
includeDirectory: include2,
|
|
30470
|
-
sources: nativeUnits.map(([file]) => file.slice(prefix.length)),
|
|
30471
|
-
lateSources: [...nativeUnits.map(([file]) => file.slice(prefix.length)), thunk],
|
|
30472
|
-
exclude: [
|
|
30473
|
-
...entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length)),
|
|
30474
|
-
...accessor ? [OBJC_RESOURCE_ACCESSOR_HEADER, OBJC_RESOURCE_ACCESSOR_BODY] : [],
|
|
30475
|
-
thunk,
|
|
30476
|
-
"include"
|
|
30477
|
-
],
|
|
30478
|
-
groups: [...groups.values()],
|
|
30479
|
-
late: {
|
|
30480
|
-
name: `${target.name}SwiftImplementation`,
|
|
30481
|
-
producers: [
|
|
30482
|
-
target.name,
|
|
30483
|
-
...(target.dependencies ?? []).filter((dependency) => swiftTargets.has(dependency.name)).map((dependency) => dependency.name)
|
|
30484
|
-
]
|
|
30441
|
+
)
|
|
30442
|
+
];
|
|
30443
|
+
const cxx = /\.(?:cc|cpp|cxx|mm)$/.test(file);
|
|
30444
|
+
const identity = (0, import_node_crypto7.createHash)("sha256").update(JSON.stringify([cxx, perFile])).digest("hex").slice(0, 12);
|
|
30445
|
+
const group = groups.get(identity) ?? {
|
|
30446
|
+
name: `${target.name}SwiftImplementation_${identity}`,
|
|
30447
|
+
sources: [],
|
|
30448
|
+
flags: [...flags, ...prefixHeader, ...accessorFlags, ...perFile],
|
|
30449
|
+
cxxFlags: [
|
|
30450
|
+
...flags,
|
|
30451
|
+
...prefixHeader,
|
|
30452
|
+
...accessorFlags,
|
|
30453
|
+
...stageFlags(
|
|
30454
|
+
cxx ? settings.cxxFlags : [],
|
|
30455
|
+
import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
30456
|
+
),
|
|
30457
|
+
...perFile
|
|
30458
|
+
]
|
|
30459
|
+
};
|
|
30460
|
+
group.sources.push(file.slice(prefix.length));
|
|
30461
|
+
groups.set(identity, group);
|
|
30485
30462
|
}
|
|
30486
|
-
|
|
30463
|
+
if (thunks.length)
|
|
30464
|
+
groups.set("imports", {
|
|
30465
|
+
name: `${target.name}ObjCImports`,
|
|
30466
|
+
sources: thunks,
|
|
30467
|
+
flags: [...flags, "-fobjc-arc"],
|
|
30468
|
+
cxxFlags: [...flags, "-fobjc-arc"]
|
|
30469
|
+
});
|
|
30470
|
+
const include2 = import_node_path7.default.join(layout.root, target.path, "include");
|
|
30471
|
+
files.set(
|
|
30472
|
+
import_node_path7.default.join(include2, "module.modulemap"),
|
|
30473
|
+
`module ${target.name}ImplementationDeclarations { export * }
|
|
30474
|
+
`
|
|
30475
|
+
);
|
|
30476
|
+
native.set(target.name, {
|
|
30477
|
+
mixed: true,
|
|
30478
|
+
path: target.path,
|
|
30479
|
+
includeDirectory: include2,
|
|
30480
|
+
sources: nativeUnits.map(([file]) => file.slice(prefix.length)),
|
|
30481
|
+
lateSources: [
|
|
30482
|
+
...nativeUnits.map(([file]) => file.slice(prefix.length)),
|
|
30483
|
+
...thunks
|
|
30484
|
+
],
|
|
30485
|
+
exclude: [
|
|
30486
|
+
...entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length)),
|
|
30487
|
+
...accessor ? [OBJC_RESOURCE_ACCESSOR_HEADER, OBJC_RESOURCE_ACCESSOR_BODY] : [],
|
|
30488
|
+
...thunks,
|
|
30489
|
+
"include"
|
|
30490
|
+
],
|
|
30491
|
+
groups: [...groups.values()],
|
|
30492
|
+
late: {
|
|
30493
|
+
name: `${target.name}SwiftImplementation`,
|
|
30494
|
+
producers: [
|
|
30495
|
+
target.name,
|
|
30496
|
+
...(target.dependencies ?? []).filter((dependency) => swiftTargets.has(dependency.name)).map((dependency) => dependency.name)
|
|
30497
|
+
]
|
|
30498
|
+
}
|
|
30499
|
+
});
|
|
30500
|
+
} catch (error) {
|
|
30501
|
+
if (!swift || !(error instanceof Error)) throw error;
|
|
30502
|
+
targetFailures.push(`${target.name}: ${error.message}`);
|
|
30503
|
+
native.set(target.name, {
|
|
30504
|
+
mixed: true,
|
|
30505
|
+
path: target.path,
|
|
30506
|
+
includeDirectory: import_node_path7.default.join(layout.root, target.path, "include"),
|
|
30507
|
+
sources: [],
|
|
30508
|
+
lateSources: [],
|
|
30509
|
+
exclude: entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length))
|
|
30510
|
+
});
|
|
30511
|
+
}
|
|
30487
30512
|
continue;
|
|
30488
30513
|
}
|
|
30489
30514
|
const includes = `${prefix}include/`;
|
|
@@ -30646,20 +30671,27 @@ export *
|
|
|
30646
30671
|
for (const name2 of objcProducers) {
|
|
30647
30672
|
const target = targets.find((value) => value.name === name2);
|
|
30648
30673
|
const prefix = target.path === "." ? "" : `${target.path}/`;
|
|
30649
|
-
|
|
30650
|
-
|
|
30651
|
-
|
|
30652
|
-
|
|
30653
|
-
|
|
30654
|
-
|
|
30655
|
-
|
|
30656
|
-
|
|
30657
|
-
|
|
30658
|
-
|
|
30659
|
-
|
|
30660
|
-
|
|
30661
|
-
|
|
30662
|
-
|
|
30674
|
+
let exported;
|
|
30675
|
+
try {
|
|
30676
|
+
exported = swiftObjCExports({
|
|
30677
|
+
module: swiftTargetModuleName(name2),
|
|
30678
|
+
sources: Object.entries(input.files).filter(
|
|
30679
|
+
([file]) => file.startsWith(prefix) && file.endsWith(".swift") && !targets.some(
|
|
30680
|
+
(candidate) => candidate.name !== name2 && candidate.path !== "." && candidate.path.startsWith(prefix) && file.startsWith(`${candidate.path}/`)
|
|
30681
|
+
) && !target.exclude?.some(
|
|
30682
|
+
(excluded) => file.slice(prefix.length) === excluded || file.slice(prefix.length).startsWith(`${excluded}/`)
|
|
30683
|
+
)
|
|
30684
|
+
),
|
|
30685
|
+
mask: swiftCodeMask,
|
|
30686
|
+
declarationStart,
|
|
30687
|
+
selector: objcSelectorName,
|
|
30688
|
+
foreignTypes: imports.get(name2)?.foreignTypes
|
|
30689
|
+
});
|
|
30690
|
+
} catch (error) {
|
|
30691
|
+
if (!(error instanceof Error)) throw error;
|
|
30692
|
+
targetFailures.push(`${name2}: ${error.message}`);
|
|
30693
|
+
continue;
|
|
30694
|
+
}
|
|
30663
30695
|
const original = imports.get(name2);
|
|
30664
30696
|
if (!exported && !original) continue;
|
|
30665
30697
|
objcModules.add(name2);
|
|
@@ -30931,6 +30963,7 @@ public func __peachObjcExportRoot() { _objcRegisterPeerClass(NSObject.self, nati
|
|
|
30931
30963
|
for (const dependency of dependencies.get(producer) ?? []) include(dependency);
|
|
30932
30964
|
return {
|
|
30933
30965
|
headerProducers: producers.filter((name2) => !included.has(name2)),
|
|
30966
|
+
targetFailures,
|
|
30934
30967
|
...rootOwner && objcExports ? {
|
|
30935
30968
|
objcImplementations: {
|
|
30936
30969
|
owner: import_node_path7.default.join(layout.root, rootOwner),
|
|
@@ -31153,6 +31186,9 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
31153
31186
|
return retain(root, built);
|
|
31154
31187
|
}
|
|
31155
31188
|
const preparation = writeSwiftProject(layout, input, moduleRoot);
|
|
31189
|
+
const unprepared = preparation.targetFailures.map(
|
|
31190
|
+
(failure) => `error: target ${failure}`
|
|
31191
|
+
);
|
|
31156
31192
|
const swift = import_node_path7.default.join(options.toolchainBin, "swift");
|
|
31157
31193
|
if (!(0, import_node_fs6.existsSync)(swift)) {
|
|
31158
31194
|
throw new Error(
|
|
@@ -31302,18 +31338,23 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
31302
31338
|
);
|
|
31303
31339
|
} catch (retryError) {
|
|
31304
31340
|
throw new Error(
|
|
31305
|
-
|
|
31306
|
-
|
|
31307
|
-
|
|
31308
|
-
|
|
31341
|
+
[
|
|
31342
|
+
...unprepared,
|
|
31343
|
+
projectDiagnostic(outputOf(retryError), layout, input.files)
|
|
31344
|
+
].join("\n"),
|
|
31345
|
+
{ cause: retryError }
|
|
31309
31346
|
);
|
|
31310
31347
|
}
|
|
31311
31348
|
} else {
|
|
31312
|
-
throw new Error(
|
|
31313
|
-
|
|
31314
|
-
|
|
31349
|
+
throw new Error(
|
|
31350
|
+
[...unprepared, projectDiagnostic(output, layout, input.files)].join(
|
|
31351
|
+
"\n"
|
|
31352
|
+
),
|
|
31353
|
+
{ cause: error }
|
|
31354
|
+
);
|
|
31315
31355
|
}
|
|
31316
31356
|
}
|
|
31357
|
+
if (unprepared.length) throw new Error(unprepared.join("\n"));
|
|
31317
31358
|
const artifact = {
|
|
31318
31359
|
hash: hash2,
|
|
31319
31360
|
bytes: (0, import_node_fs6.readFileSync)(builtArtifact(layout)),
|