peachsim 0.1.1653 → 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/cli/app-stubs.ts +97 -14
- package/cli/bridge-diagnostics.ts +10 -7
- package/cli/cloud-client.ts +11 -2
- package/cli/commands/doctor.ts +20 -10
- package/cli/commands/inspect/core.ts +2 -1
- package/cli/commands/inspect/shared.ts +2 -0
- package/cli/commands/inspect.ts +11 -2
- package/cli/output-redaction.ts +22 -6
- package/cli/pause-aware-timeout.ts +24 -10
- package/cli/ws-bridge.ts +17 -1
- 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 +277 -244
- 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 +47 -12
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +276 -243
- 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 +320 -246
- package/dist-lib/host/fetch-proxy-handler.cjs +191 -31
- 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 +633 -373
- 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 +62 -14
- 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 +62 -54
- 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 +2 -2
- package/dist-lib/sdk.mjs +2 -2
- package/dist-lib/skills.cjs +535 -380
- package/dist-lib/swift-compile.cjs +258 -197
- package/dist-lib/swift-compile.mjs +257 -197
- 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 +276 -243
- package/dist-lib/vite.cjs +385 -200
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-gesture-handler.d.ts +1 -0
- package/dist-types/packages/peach-compat/src/stubs/screen-transition-math.d.ts +10 -7
- package/dist-types/packages/peach-engine/src/capture/browser-composite.d.ts +10 -0
- package/dist-types/packages/peach-engine/src/cli-companion.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +23 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/visible-frame.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/observability/types.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +38 -0
- package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +9 -0
- package/package.json +5 -1
- package/runtime-companion.json +1 -1
- package/src/bridge-contract.ts +2 -0
- package/src/bundleGlobalFooter.ts +9 -0
- package/src/host/fetch-proxy-handler.ts +54 -0
- package/src/sfSymbolMetricsContract.ts +268 -0
- package/src/swift-compile.ts +302 -238
- package/src/swift-distribution.lock.json +20 -46
- package/src/swift-objc-metadata.ts +21 -7
- package/src/swift-objc-sdk.ts +13 -0
- package/src/swiftContract.ts +2 -0
- package/src/vite-plugin-one.ts +161 -16
- package/src/host/lease-owner.test.ts +0 -49
|
@@ -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;
|
|
@@ -49,6 +49,7 @@ __export(swift_compile_exports, {
|
|
|
49
49
|
swiftApplicationEntry: () => swiftApplicationEntry,
|
|
50
50
|
swiftArtifactHash: () => swiftArtifactHash,
|
|
51
51
|
swiftAvailableModules: () => swiftAvailableModules,
|
|
52
|
+
swiftBuilderHopTimeoutMs: () => swiftBuilderHopTimeoutMs,
|
|
52
53
|
swiftCodeMask: () => swiftCodeMask,
|
|
53
54
|
swiftDistributionAt: () => swiftDistributionAt,
|
|
54
55
|
swiftIcuAsset: () => swiftIcuAsset,
|
|
@@ -22767,6 +22768,19 @@ __attribute__((swift_bridge("Swift.String")))
|
|
|
22767
22768
|
- (void)appendFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);
|
|
22768
22769
|
+ (NSMutableString *)stringWithCapacity:(NSUInteger)capacity;
|
|
22769
22770
|
@end
|
|
22771
|
+
NS_SWIFT_UNAVAILABLE("Use String or NSString instead.")
|
|
22772
|
+
@interface NSSimpleCString : NSString {
|
|
22773
|
+
@package
|
|
22774
|
+
char *bytes;
|
|
22775
|
+
int numBytes;
|
|
22776
|
+
#if __LP64__
|
|
22777
|
+
int _unused;
|
|
22778
|
+
#endif
|
|
22779
|
+
}
|
|
22780
|
+
@end
|
|
22781
|
+
NS_SWIFT_UNAVAILABLE("Use String or NSString instead.")
|
|
22782
|
+
@interface NSConstantString : NSSimpleCString
|
|
22783
|
+
@end
|
|
22770
22784
|
@interface NSAttributedString : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>
|
|
22771
22785
|
@property (readonly, copy) NSString *string;
|
|
22772
22786
|
@end
|
|
@@ -25599,6 +25613,11 @@ var SWIFTPM_NOISE = /^(?:\[\d+\/\d+\] |Building for production\.\.\.$|warning: '
|
|
|
25599
25613
|
var BUILD_JOBS = String(
|
|
25600
25614
|
Math.min(4, Math.max(1, Math.floor(import_node_os4.default.availableParallelism() / 2)))
|
|
25601
25615
|
);
|
|
25616
|
+
var SWIFT_BUILDER_TRANSPORT_MARGIN_MS = 3e5;
|
|
25617
|
+
var SWIFT_BUILDER_DEFAULT_COMPILE_MS = 18e5;
|
|
25618
|
+
function swiftBuilderHopTimeoutMs(compileTimeoutMs) {
|
|
25619
|
+
return (compileTimeoutMs ?? SWIFT_BUILDER_DEFAULT_COMPILE_MS) + SWIFT_BUILDER_TRANSPORT_MARGIN_MS;
|
|
25620
|
+
}
|
|
25602
25621
|
function swiftDistributionAt(root) {
|
|
25603
25622
|
const file = import_node_path7.default.join(root, SWIFT_DISTRIBUTION_MANIFEST);
|
|
25604
25623
|
if (!(0, import_node_fs6.existsSync)(file)) return null;
|
|
@@ -25991,7 +26010,7 @@ var EXECUTABLE_LINK_FLAGS = ` "-Xclang-linker", "-O0",
|
|
|
25991
26010
|
`;
|
|
25992
26011
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
25993
26012
|
var MULTI_MANIFEST_VERSION = 39;
|
|
25994
|
-
var compilerSourceDigest = true ? "
|
|
26013
|
+
var compilerSourceDigest = true ? "042e57f70d169ec5fd94262a87fc4d50da0c31cc6a6c329e56f12d4b7c5484a1" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
25995
26014
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
25996
26015
|
const hash2 = (0, import_node_crypto7.createHash)("sha256");
|
|
25997
26016
|
hash2.update(`swift-compile
|
|
@@ -30233,6 +30252,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
30233
30252
|
] : compileTargets(input);
|
|
30234
30253
|
const files = /* @__PURE__ */ new Map();
|
|
30235
30254
|
const native = /* @__PURE__ */ new Map();
|
|
30255
|
+
const targetFailures = [];
|
|
30236
30256
|
const bySourcePath = [...targets].sort(
|
|
30237
30257
|
(left, right) => right.path.length - left.path.length
|
|
30238
30258
|
);
|
|
@@ -30283,188 +30303,212 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
30283
30303
|
if (units.length === 0) continue;
|
|
30284
30304
|
const settings = input.nativeTargets?.find((value) => value.name === target.name);
|
|
30285
30305
|
if (entries.some(([file]) => file.endsWith(".swift")) || settings && units.some(([file]) => /\.mm?$/.test(file))) {
|
|
30286
|
-
|
|
30287
|
-
|
|
30288
|
-
|
|
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")
|
|
30289
30330
|
);
|
|
30290
|
-
|
|
30291
|
-
|
|
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
|
-
const accessorUnit = `${prefix}${OBJC_RESOURCE_ACCESSOR_BODY}`;
|
|
30345
|
-
if (accessor && (input.files[accessorUnit] !== void 0 || input.files[`${prefix}${OBJC_RESOURCE_ACCESSOR_HEADER}`] !== void 0))
|
|
30346
|
-
throw new Error(`target ${target.name} already contains its resource accessor`);
|
|
30347
|
-
const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
|
|
30348
|
-
const accessorFlags = accessor ? ["-include", accessorHeader] : [];
|
|
30349
|
-
if (accessor) {
|
|
30350
|
-
files.set(accessorHeader, accessor.header);
|
|
30351
|
-
files.set(import_node_path7.default.join(layout.root, accessorUnit), accessor.body);
|
|
30352
|
-
}
|
|
30353
|
-
const sourceHeaders = import_node_path7.default.join(
|
|
30354
|
-
layout.root,
|
|
30355
|
-
".build",
|
|
30356
|
-
"peach-objc-originals",
|
|
30357
|
-
target.name
|
|
30358
|
-
);
|
|
30359
|
-
(0, import_node_fs6.mkdirSync)(sourceHeaders, { recursive: true });
|
|
30360
|
-
const modulemap = import_node_path7.default.join(sourceHeaders, "module.modulemap");
|
|
30361
|
-
(0, import_node_fs6.writeFileSync)(
|
|
30362
|
-
modulemap,
|
|
30363
|
-
`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)} {
|
|
30364
30385
|
${roots2.map((file) => `header ${JSON.stringify(import_node_path7.default.join(layout.root, file))}`).join("\n")}
|
|
30365
30386
|
export *
|
|
30366
30387
|
}
|
|
30367
30388
|
`
|
|
30368
|
-
|
|
30369
|
-
|
|
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
|
-
|
|
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
|
+
});
|
|
30396
30430
|
}
|
|
30397
|
-
|
|
30398
|
-
|
|
30399
|
-
|
|
30400
|
-
|
|
30401
|
-
|
|
30402
|
-
|
|
30403
|
-
|
|
30404
|
-
const groups = /* @__PURE__ */ new Map();
|
|
30405
|
-
for (const [file] of nativeUnits) {
|
|
30406
|
-
const origin = settings?.sourceDirectories[file];
|
|
30407
|
-
if (origin) (0, import_node_fs6.mkdirSync)(import_node_path7.default.join(layout.root, origin), { recursive: true });
|
|
30408
|
-
const perFile = [
|
|
30409
|
-
...origin ? ["-iquote", import_node_path7.default.join(layout.root, origin)] : [],
|
|
30410
|
-
...stageFlags(
|
|
30411
|
-
settings?.fileFlags[file] ?? [],
|
|
30412
|
-
import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
30413
|
-
)
|
|
30414
|
-
];
|
|
30415
|
-
const cxx = /\.(?:cc|cpp|cxx|mm)$/.test(file);
|
|
30416
|
-
const identity = (0, import_node_crypto7.createHash)("sha256").update(JSON.stringify([cxx, perFile])).digest("hex").slice(0, 12);
|
|
30417
|
-
const group = groups.get(identity) ?? {
|
|
30418
|
-
name: `${target.name}SwiftImplementation_${identity}`,
|
|
30419
|
-
sources: [],
|
|
30420
|
-
flags: [...flags, ...prefixHeader, ...accessorFlags, ...perFile],
|
|
30421
|
-
cxxFlags: [
|
|
30422
|
-
...flags,
|
|
30423
|
-
...prefixHeader,
|
|
30424
|
-
...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)] : [],
|
|
30425
30438
|
...stageFlags(
|
|
30426
|
-
|
|
30439
|
+
settings?.fileFlags[file] ?? [],
|
|
30427
30440
|
import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
30428
|
-
)
|
|
30429
|
-
|
|
30430
|
-
|
|
30431
|
-
|
|
30432
|
-
|
|
30433
|
-
|
|
30434
|
-
|
|
30435
|
-
|
|
30436
|
-
|
|
30437
|
-
|
|
30438
|
-
|
|
30439
|
-
|
|
30440
|
-
|
|
30441
|
-
|
|
30442
|
-
|
|
30443
|
-
|
|
30444
|
-
|
|
30445
|
-
|
|
30446
|
-
|
|
30447
|
-
|
|
30448
|
-
|
|
30449
|
-
path: target.path,
|
|
30450
|
-
includeDirectory: include2,
|
|
30451
|
-
sources: nativeUnits.map(([file]) => file.slice(prefix.length)),
|
|
30452
|
-
lateSources: [...nativeUnits.map(([file]) => file.slice(prefix.length)), thunk],
|
|
30453
|
-
exclude: [
|
|
30454
|
-
...entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length)),
|
|
30455
|
-
...accessor ? [OBJC_RESOURCE_ACCESSOR_HEADER, OBJC_RESOURCE_ACCESSOR_BODY] : [],
|
|
30456
|
-
thunk,
|
|
30457
|
-
"include"
|
|
30458
|
-
],
|
|
30459
|
-
groups: [...groups.values()],
|
|
30460
|
-
late: {
|
|
30461
|
-
name: `${target.name}SwiftImplementation`,
|
|
30462
|
-
producers: [
|
|
30463
|
-
target.name,
|
|
30464
|
-
...(target.dependencies ?? []).filter((dependency) => swiftTargets.has(dependency.name)).map((dependency) => dependency.name)
|
|
30465
|
-
]
|
|
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);
|
|
30466
30462
|
}
|
|
30467
|
-
|
|
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
|
+
}
|
|
30468
30512
|
continue;
|
|
30469
30513
|
}
|
|
30470
30514
|
const includes = `${prefix}include/`;
|
|
@@ -30627,20 +30671,27 @@ export *
|
|
|
30627
30671
|
for (const name2 of objcProducers) {
|
|
30628
30672
|
const target = targets.find((value) => value.name === name2);
|
|
30629
30673
|
const prefix = target.path === "." ? "" : `${target.path}/`;
|
|
30630
|
-
|
|
30631
|
-
|
|
30632
|
-
|
|
30633
|
-
|
|
30634
|
-
|
|
30635
|
-
|
|
30636
|
-
|
|
30637
|
-
|
|
30638
|
-
|
|
30639
|
-
|
|
30640
|
-
|
|
30641
|
-
|
|
30642
|
-
|
|
30643
|
-
|
|
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
|
+
}
|
|
30644
30695
|
const original = imports.get(name2);
|
|
30645
30696
|
if (!exported && !original) continue;
|
|
30646
30697
|
objcModules.add(name2);
|
|
@@ -30912,6 +30963,7 @@ public func __peachObjcExportRoot() { _objcRegisterPeerClass(NSObject.self, nati
|
|
|
30912
30963
|
for (const dependency of dependencies.get(producer) ?? []) include(dependency);
|
|
30913
30964
|
return {
|
|
30914
30965
|
headerProducers: producers.filter((name2) => !included.has(name2)),
|
|
30966
|
+
targetFailures,
|
|
30915
30967
|
...rootOwner && objcExports ? {
|
|
30916
30968
|
objcImplementations: {
|
|
30917
30969
|
owner: import_node_path7.default.join(layout.root, rootOwner),
|
|
@@ -31102,7 +31154,7 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
31102
31154
|
],
|
|
31103
31155
|
{
|
|
31104
31156
|
cwd: repo,
|
|
31105
|
-
timeout: options.timeoutMs,
|
|
31157
|
+
timeout: options.timeoutMs === void 0 ? void 0 : swiftBuilderHopTimeoutMs(options.timeoutMs),
|
|
31106
31158
|
maxBuffer: 64 * 1024 * 1024,
|
|
31107
31159
|
signal: options.signal
|
|
31108
31160
|
},
|
|
@@ -31134,6 +31186,9 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
31134
31186
|
return retain(root, built);
|
|
31135
31187
|
}
|
|
31136
31188
|
const preparation = writeSwiftProject(layout, input, moduleRoot);
|
|
31189
|
+
const unprepared = preparation.targetFailures.map(
|
|
31190
|
+
(failure) => `error: target ${failure}`
|
|
31191
|
+
);
|
|
31137
31192
|
const swift = import_node_path7.default.join(options.toolchainBin, "swift");
|
|
31138
31193
|
if (!(0, import_node_fs6.existsSync)(swift)) {
|
|
31139
31194
|
throw new Error(
|
|
@@ -31283,18 +31338,23 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
31283
31338
|
);
|
|
31284
31339
|
} catch (retryError) {
|
|
31285
31340
|
throw new Error(
|
|
31286
|
-
|
|
31287
|
-
|
|
31288
|
-
|
|
31289
|
-
|
|
31341
|
+
[
|
|
31342
|
+
...unprepared,
|
|
31343
|
+
projectDiagnostic(outputOf(retryError), layout, input.files)
|
|
31344
|
+
].join("\n"),
|
|
31345
|
+
{ cause: retryError }
|
|
31290
31346
|
);
|
|
31291
31347
|
}
|
|
31292
31348
|
} else {
|
|
31293
|
-
throw new Error(
|
|
31294
|
-
|
|
31295
|
-
|
|
31349
|
+
throw new Error(
|
|
31350
|
+
[...unprepared, projectDiagnostic(output, layout, input.files)].join(
|
|
31351
|
+
"\n"
|
|
31352
|
+
),
|
|
31353
|
+
{ cause: error }
|
|
31354
|
+
);
|
|
31296
31355
|
}
|
|
31297
31356
|
}
|
|
31357
|
+
if (unprepared.length) throw new Error(unprepared.join("\n"));
|
|
31298
31358
|
const artifact = {
|
|
31299
31359
|
hash: hash2,
|
|
31300
31360
|
bytes: (0, import_node_fs6.readFileSync)(builtArtifact(layout)),
|
|
@@ -31330,6 +31390,7 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
31330
31390
|
swiftApplicationEntry,
|
|
31331
31391
|
swiftArtifactHash,
|
|
31332
31392
|
swiftAvailableModules,
|
|
31393
|
+
swiftBuilderHopTimeoutMs,
|
|
31333
31394
|
swiftCodeMask,
|
|
31334
31395
|
swiftDistributionAt,
|
|
31335
31396
|
swiftIcuAsset,
|