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.
Files changed (111) hide show
  1. package/cli/app-stubs.ts +97 -14
  2. package/cli/bridge-diagnostics.ts +10 -7
  3. package/cli/cloud-client.ts +11 -2
  4. package/cli/commands/doctor.ts +20 -10
  5. package/cli/commands/inspect/core.ts +2 -1
  6. package/cli/commands/inspect/shared.ts +2 -0
  7. package/cli/commands/inspect.ts +11 -2
  8. package/cli/output-redaction.ts +22 -6
  9. package/cli/pause-aware-timeout.ts +24 -10
  10. package/cli/ws-bridge.ts +17 -1
  11. package/dist-lib/agent-daemon-client.cjs +1 -1
  12. package/dist-lib/agent-events.cjs +1 -1
  13. package/dist-lib/attached-projects.cjs +1 -1
  14. package/dist-lib/auth/shared-session.cjs +1 -1
  15. package/dist-lib/backend-origin.cjs +1 -1
  16. package/dist-lib/beta.cjs +1 -1
  17. package/dist-lib/beta.mjs +1 -1
  18. package/dist-lib/bridge-constants.cjs +1 -1
  19. package/dist-lib/bridge-contract-input.cjs +1 -1
  20. package/dist-lib/bridge-contract-input.mjs +1 -1
  21. package/dist-lib/bridge-contract.cjs +1 -1
  22. package/dist-lib/bridge-contract.mjs +1 -1
  23. package/dist-lib/bundle-channel.cjs +277 -244
  24. package/dist-lib/capture-contract.cjs +1 -1
  25. package/dist-lib/capture-contract.mjs +1 -1
  26. package/dist-lib/cloud-contract.cjs +1 -1
  27. package/dist-lib/cloud-contract.mjs +1 -1
  28. package/dist-lib/cloud-test-args.cjs +1 -1
  29. package/dist-lib/cloud-test-args.mjs +1 -1
  30. package/dist-lib/cloud.cjs +1 -1
  31. package/dist-lib/cloud.mjs +1 -1
  32. package/dist-lib/config.cjs +1 -1
  33. package/dist-lib/config.mjs +1 -1
  34. package/dist-lib/detox/index.cjs +47 -12
  35. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  36. package/dist-lib/expo-swift-bundle.cjs +276 -243
  37. package/dist-lib/expo-swift-metadata.cjs +1 -1
  38. package/dist-lib/expo-swift-metadata.mjs +1 -1
  39. package/dist-lib/home-paths.cjs +1 -1
  40. package/dist-lib/host/bridge-host.cjs +320 -246
  41. package/dist-lib/host/fetch-proxy-handler.cjs +191 -31
  42. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  43. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  44. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  45. package/dist-lib/host/websocket-proxy.cjs +1 -1
  46. package/dist-lib/index.cjs +633 -373
  47. package/dist-lib/jump-to-source-babel.cjs +1 -1
  48. package/dist-lib/jump-to-source-native.cjs +1 -1
  49. package/dist-lib/kotlin-host.cjs +1 -1
  50. package/dist-lib/menu.cjs +1 -1
  51. package/dist-lib/menu.mjs +1 -1
  52. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  53. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  54. package/dist-lib/metro-production-bundle.cjs +1 -1
  55. package/dist-lib/metro-production-bundle.mjs +1 -1
  56. package/dist-lib/metro.cjs +62 -14
  57. package/dist-lib/native-app-identity-project.cjs +1 -1
  58. package/dist-lib/native-app-identity-project.mjs +1 -1
  59. package/dist-lib/native-app-identity.cjs +1 -1
  60. package/dist-lib/native-app-identity.mjs +1 -1
  61. package/dist-lib/native-firebase-metadata.cjs +1 -1
  62. package/dist-lib/native-firebase-metadata.mjs +1 -1
  63. package/dist-lib/plist.cjs +1 -1
  64. package/dist-lib/plist.mjs +1 -1
  65. package/dist-lib/profiles.cjs +1 -1
  66. package/dist-lib/public-brand.cjs +1 -1
  67. package/dist-lib/public-origins-lib-esm.json +23 -23
  68. package/dist-lib/public-origins-lib.json +62 -54
  69. package/dist-lib/react-native-host-modules.cjs +1 -1
  70. package/dist-lib/react-native-host-modules.mjs +1 -1
  71. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  72. package/dist-lib/sdk.cjs +2 -2
  73. package/dist-lib/sdk.mjs +2 -2
  74. package/dist-lib/skills.cjs +535 -380
  75. package/dist-lib/swift-compile.cjs +258 -197
  76. package/dist-lib/swift-compile.mjs +257 -197
  77. package/dist-lib/swift-package.cjs +1 -1
  78. package/dist-lib/swift-package.mjs +1 -1
  79. package/dist-lib/swift-submit.cjs +1 -1
  80. package/dist-lib/swift-submit.mjs +1 -1
  81. package/dist-lib/swift-toolchain.cjs +1 -1
  82. package/dist-lib/swift.cjs +1 -1
  83. package/dist-lib/vite-swift.cjs +276 -243
  84. package/dist-lib/vite.cjs +385 -200
  85. package/dist-lib/worklet-executable.cjs +1 -1
  86. package/dist-lib/worklet-executable.mjs +1 -1
  87. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-gesture-handler.d.ts +1 -0
  88. package/dist-types/packages/peach-compat/src/stubs/screen-transition-math.d.ts +10 -7
  89. package/dist-types/packages/peach-engine/src/capture/browser-composite.d.ts +10 -0
  90. package/dist-types/packages/peach-engine/src/cli-companion.d.ts +1 -0
  91. package/dist-types/packages/peach-engine/src/engine/node.d.ts +3 -1
  92. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -1
  93. package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +23 -0
  94. package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -1
  95. package/dist-types/packages/peach-engine/src/engine/visible-frame.d.ts +1 -0
  96. package/dist-types/packages/peach-engine/src/observability/types.d.ts +1 -0
  97. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +38 -0
  98. package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +9 -0
  99. package/package.json +5 -1
  100. package/runtime-companion.json +1 -1
  101. package/src/bridge-contract.ts +2 -0
  102. package/src/bundleGlobalFooter.ts +9 -0
  103. package/src/host/fetch-proxy-handler.ts +54 -0
  104. package/src/sfSymbolMetricsContract.ts +268 -0
  105. package/src/swift-compile.ts +302 -238
  106. package/src/swift-distribution.lock.json +20 -46
  107. package/src/swift-objc-metadata.ts +21 -7
  108. package/src/swift-objc-sdk.ts +13 -0
  109. package/src/swiftContract.ts +2 -0
  110. package/src/vite-plugin-one.ts +161 -16
  111. package/src/host/lease-owner.test.ts +0 -49
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
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)
@@ -22741,6 +22741,19 @@ __attribute__((swift_bridge("Swift.String")))
22741
22741
  - (void)appendFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);
22742
22742
  + (NSMutableString *)stringWithCapacity:(NSUInteger)capacity;
22743
22743
  @end
22744
+ NS_SWIFT_UNAVAILABLE("Use String or NSString instead.")
22745
+ @interface NSSimpleCString : NSString {
22746
+ @package
22747
+ char *bytes;
22748
+ int numBytes;
22749
+ #if __LP64__
22750
+ int _unused;
22751
+ #endif
22752
+ }
22753
+ @end
22754
+ NS_SWIFT_UNAVAILABLE("Use String or NSString instead.")
22755
+ @interface NSConstantString : NSSimpleCString
22756
+ @end
22744
22757
  @interface NSAttributedString : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>
22745
22758
  @property (readonly, copy) NSString *string;
22746
22759
  @end
@@ -25583,6 +25596,11 @@ var SWIFTPM_NOISE = /^(?:\[\d+\/\d+\] |Building for production\.\.\.$|warning: '
25583
25596
  var BUILD_JOBS = String(
25584
25597
  Math.min(4, Math.max(1, Math.floor(os2.availableParallelism() / 2)))
25585
25598
  );
25599
+ var SWIFT_BUILDER_TRANSPORT_MARGIN_MS = 3e5;
25600
+ var SWIFT_BUILDER_DEFAULT_COMPILE_MS = 18e5;
25601
+ function swiftBuilderHopTimeoutMs(compileTimeoutMs) {
25602
+ return (compileTimeoutMs ?? SWIFT_BUILDER_DEFAULT_COMPILE_MS) + SWIFT_BUILDER_TRANSPORT_MARGIN_MS;
25603
+ }
25586
25604
  function swiftDistributionAt(root) {
25587
25605
  const file = path8.join(root, SWIFT_DISTRIBUTION_MANIFEST);
25588
25606
  if (!existsSync2(file)) return null;
@@ -25975,7 +25993,7 @@ var EXECUTABLE_LINK_FLAGS = ` "-Xclang-linker", "-O0",
25975
25993
  `;
25976
25994
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
25977
25995
  var MULTI_MANIFEST_VERSION = 39;
25978
- var compilerSourceDigest = true ? "f4eb526a3d0d01972f3bb179b60c2b10df37c90e90ad1717a3b4946374cdb248" : swiftCompilerSourceDigest(import.meta.dirname);
25996
+ var compilerSourceDigest = true ? "042e57f70d169ec5fd94262a87fc4d50da0c31cc6a6c329e56f12d4b7c5484a1" : swiftCompilerSourceDigest(import.meta.dirname);
25979
25997
  function swiftArtifactHash(input, release, moduleRoot) {
25980
25998
  const hash2 = createHash9("sha256");
25981
25999
  hash2.update(`swift-compile
@@ -30217,6 +30235,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
30217
30235
  ] : compileTargets(input);
30218
30236
  const files = /* @__PURE__ */ new Map();
30219
30237
  const native = /* @__PURE__ */ new Map();
30238
+ const targetFailures = [];
30220
30239
  const bySourcePath = [...targets].sort(
30221
30240
  (left, right) => right.path.length - left.path.length
30222
30241
  );
@@ -30267,188 +30286,212 @@ function writeSwiftProject(layout, input, moduleRoot) {
30267
30286
  if (units.length === 0) continue;
30268
30287
  const settings = input.nativeTargets?.find((value) => value.name === target.name);
30269
30288
  if (entries.some(([file]) => file.endsWith(".swift")) || settings && units.some(([file]) => /\.mm?$/.test(file))) {
30270
- if (!settings)
30271
- throw new Error(
30272
- `mixed target ${target.name} requires its original native target settings; SwiftPM does not compile mixed source targets`
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")
30273
30313
  );
30274
- const headers = settings.headers;
30275
- const roots2 = settings.bridgingHeader ? [settings.bridgingHeader] : settings.publicHeaders;
30276
- if (!roots2.length)
30277
- throw new Error(`mixed target ${target.name} has no original declaration headers`);
30278
- for (const file of headers) {
30279
- const destination = path8.join(layout.root, file);
30280
- mkdirSync2(path8.dirname(destination), { recursive: true });
30281
- writeFileSync3(destination, input.files[file]);
30282
- }
30283
- const search = [
30284
- .../* @__PURE__ */ new Set([
30285
- ...settings?.headerSearchPaths ?? [],
30286
- ...headers.map((file) => path8.posix.dirname(file))
30287
- ])
30288
- ].flatMap((dir) => ["-I", path8.join(layout.root, dir)]);
30289
- const pin = distribution ?? JSON.parse(readFileSync5(path8.join(moduleRoot, "toolchain.json"), "utf8"));
30290
- const release = pin.release;
30291
- const toolchainBin = swiftToolchain(release, swiftModuleSdk(moduleRoot));
30292
- const sdkHeaders = materializeObjcSdk(
30293
- path8.join(layout.root, ".build", "peach-objc-sdk")
30294
- );
30295
- const stageFlags = (flags2, sdkInclude) => flags2.map(
30296
- (flag) => flag.replaceAll(SWIFT_NATIVE_INPUT_ROOT, layout.root).replaceAll(SWIFT_NATIVE_SDK_INCLUDE, sdkInclude)
30297
- );
30298
- const originalFlags = [
30299
- ...settings?.flags ?? [],
30300
- ...search,
30301
- ...(settings?.frameworkSearchPaths ?? []).flatMap((dir) => [
30302
- "-F",
30303
- path8.join(layout.root, dir)
30304
- ]),
30305
- "-I",
30306
- headerDirectory
30307
- ];
30308
- const flags = stageFlags(
30309
- originalFlags,
30310
- path8.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
30311
- );
30312
- const prefixHeader = settings?.prefixHeader ? ["-include", path8.join(layout.root, settings.prefixHeader)] : [];
30313
- const bundleName = entries.some(([file]) => file.endsWith(".swift")) ? void 0 : swiftObjCResourceBundleName({
30314
- target: target.name,
30315
- path: target.path,
30316
- resources: resourceTargets.find((candidate) => candidate.name === target.name)?.resources ?? false,
30317
- usesBundleMacro: entries.some(
30318
- ([file, contents]) => /\.(?:c|cc|cpp|cxx|m|mm|h|hpp|hh|hxx)$/.test(file) && /\bSWIFTPM_MODULE_BUNDLE\b/.test(contents)
30319
- ),
30320
- bundles: input.resourceBundles
30321
- });
30322
- const accessor = bundleName === void 0 ? void 0 : swiftObjCResourceAccessor(bundleName);
30323
- const accessorHeader = path8.join(
30324
- layout.root,
30325
- target.path,
30326
- OBJC_RESOURCE_ACCESSOR_HEADER
30327
- );
30328
- const accessorUnit = `${prefix}${OBJC_RESOURCE_ACCESSOR_BODY}`;
30329
- if (accessor && (input.files[accessorUnit] !== void 0 || input.files[`${prefix}${OBJC_RESOURCE_ACCESSOR_HEADER}`] !== void 0))
30330
- throw new Error(`target ${target.name} already contains its resource accessor`);
30331
- const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
30332
- const accessorFlags = accessor ? ["-include", accessorHeader] : [];
30333
- if (accessor) {
30334
- files.set(accessorHeader, accessor.header);
30335
- files.set(path8.join(layout.root, accessorUnit), accessor.body);
30336
- }
30337
- const sourceHeaders = path8.join(
30338
- layout.root,
30339
- ".build",
30340
- "peach-objc-originals",
30341
- target.name
30342
- );
30343
- mkdirSync2(sourceHeaders, { recursive: true });
30344
- const modulemap = path8.join(sourceHeaders, "module.modulemap");
30345
- writeFileSync3(
30346
- modulemap,
30347
- `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)} {
30348
30368
  ${roots2.map((file) => `header ${JSON.stringify(path8.join(layout.root, file))}`).join("\n")}
30349
30369
  export *
30350
30370
  }
30351
30371
  `
30352
- );
30353
- const view = objcView(
30354
- { module: swiftTargetModuleName(target.name), headers: sourceHeaders, modulemap },
30355
- toolchainBin,
30356
- path8.join(moduleRoot, "ios-simulator-stdlib"),
30357
- path8.join(layout.root, ".build", "peach-objc-sdk"),
30358
- path8.join(layout.root, ".build", "peach-objc-imports", target.name),
30359
- {
30360
- flags: stageFlags(originalFlags, path8.join(sdkHeaders, "usr/include")),
30361
- target: `arm64-apple-ios${settings?.deploymentTarget ?? "16.0"}-simulator`
30362
- }
30363
- );
30364
- const defined = /* @__PURE__ */ new Set();
30365
- const declarations = (node) => {
30366
- if (!node || typeof node !== "object") return;
30367
- const name2 = Reflect.get(node, "name");
30368
- if (Reflect.get(node, "kind") === "ObjCInterfaceDecl" && Reflect.get(node, "super") && typeof name2 === "string")
30369
- defined.add(name2);
30370
- const children = Reflect.get(node, "inner");
30371
- if (Array.isArray(children)) for (const child of children) declarations(child);
30372
- };
30373
- declarations(view.clangAST);
30374
- const foreignTypes = /* @__PURE__ */ new Map();
30375
- for (const graph of view.graphs)
30376
- for (const symbol of graph.symbols) {
30377
- const nativeName = /^c:objc\(cs\)(\w+)$/.exec(symbol.identifier.precise)?.[1];
30378
- if (nativeName && defined.has(nativeName))
30379
- foreignTypes.set(symbol.pathComponents[0], nativeName);
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
+ });
30380
30413
  }
30381
- imports.set(target.name, {
30382
- view,
30383
- classes: [...foreignTypes.values()],
30384
- headers: roots2.map((file) => path8.join(layout.root, file)),
30385
- foreignTypes
30386
- });
30387
- const thunk = "PeachObjCImports.generated.m";
30388
- const groups = /* @__PURE__ */ new Map();
30389
- for (const [file] of nativeUnits) {
30390
- const origin = settings?.sourceDirectories[file];
30391
- if (origin) mkdirSync2(path8.join(layout.root, origin), { recursive: true });
30392
- const perFile = [
30393
- ...origin ? ["-iquote", path8.join(layout.root, origin)] : [],
30394
- ...stageFlags(
30395
- settings?.fileFlags[file] ?? [],
30396
- path8.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
30397
- )
30398
- ];
30399
- const cxx = /\.(?:cc|cpp|cxx|mm)$/.test(file);
30400
- const identity = createHash9("sha256").update(JSON.stringify([cxx, perFile])).digest("hex").slice(0, 12);
30401
- const group = groups.get(identity) ?? {
30402
- name: `${target.name}SwiftImplementation_${identity}`,
30403
- sources: [],
30404
- flags: [...flags, ...prefixHeader, ...accessorFlags, ...perFile],
30405
- cxxFlags: [
30406
- ...flags,
30407
- ...prefixHeader,
30408
- ...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)] : [],
30409
30421
  ...stageFlags(
30410
- cxx ? settings.cxxFlags : [],
30422
+ settings?.fileFlags[file] ?? [],
30411
30423
  path8.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
30412
- ),
30413
- ...perFile
30414
- ]
30415
- };
30416
- group.sources.push(file.slice(prefix.length));
30417
- groups.set(identity, group);
30418
- }
30419
- groups.set("imports", {
30420
- name: `${target.name}ObjCImports`,
30421
- sources: [thunk],
30422
- flags: [...flags, "-fobjc-arc"],
30423
- cxxFlags: [...flags, "-fobjc-arc"]
30424
- });
30425
- const include2 = path8.join(layout.root, target.path, "include");
30426
- files.set(
30427
- path8.join(include2, "module.modulemap"),
30428
- `module ${target.name}ImplementationDeclarations { export * }
30429
- `
30430
- );
30431
- native.set(target.name, {
30432
- mixed: true,
30433
- path: target.path,
30434
- includeDirectory: include2,
30435
- sources: nativeUnits.map(([file]) => file.slice(prefix.length)),
30436
- lateSources: [...nativeUnits.map(([file]) => file.slice(prefix.length)), thunk],
30437
- exclude: [
30438
- ...entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length)),
30439
- ...accessor ? [OBJC_RESOURCE_ACCESSOR_HEADER, OBJC_RESOURCE_ACCESSOR_BODY] : [],
30440
- thunk,
30441
- "include"
30442
- ],
30443
- groups: [...groups.values()],
30444
- late: {
30445
- name: `${target.name}SwiftImplementation`,
30446
- producers: [
30447
- target.name,
30448
- ...(target.dependencies ?? []).filter((dependency) => swiftTargets.has(dependency.name)).map((dependency) => dependency.name)
30449
- ]
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);
30450
30445
  }
30451
- });
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
+ }
30452
30495
  continue;
30453
30496
  }
30454
30497
  const includes = `${prefix}include/`;
@@ -30611,20 +30654,27 @@ export *
30611
30654
  for (const name2 of objcProducers) {
30612
30655
  const target = targets.find((value) => value.name === name2);
30613
30656
  const prefix = target.path === "." ? "" : `${target.path}/`;
30614
- const exported = swiftObjCExports({
30615
- module: swiftTargetModuleName(name2),
30616
- sources: Object.entries(input.files).filter(
30617
- ([file]) => file.startsWith(prefix) && file.endsWith(".swift") && !targets.some(
30618
- (candidate) => candidate.name !== name2 && candidate.path !== "." && candidate.path.startsWith(prefix) && file.startsWith(`${candidate.path}/`)
30619
- ) && !target.exclude?.some(
30620
- (excluded) => file.slice(prefix.length) === excluded || file.slice(prefix.length).startsWith(`${excluded}/`)
30621
- )
30622
- ),
30623
- mask: swiftCodeMask,
30624
- declarationStart,
30625
- selector: objcSelectorName,
30626
- foreignTypes: imports.get(name2)?.foreignTypes
30627
- });
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
+ }
30628
30678
  const original = imports.get(name2);
30629
30679
  if (!exported && !original) continue;
30630
30680
  objcModules.add(name2);
@@ -30896,6 +30946,7 @@ public func __peachObjcExportRoot() { _objcRegisterPeerClass(NSObject.self, nati
30896
30946
  for (const dependency of dependencies.get(producer) ?? []) include(dependency);
30897
30947
  return {
30898
30948
  headerProducers: producers.filter((name2) => !included.has(name2)),
30949
+ targetFailures,
30899
30950
  ...rootOwner && objcExports ? {
30900
30951
  objcImplementations: {
30901
30952
  owner: path8.join(layout.root, rootOwner),
@@ -31086,7 +31137,7 @@ function compileSwiftProjectUnit(input, options) {
31086
31137
  ],
31087
31138
  {
31088
31139
  cwd: repo,
31089
- timeout: options.timeoutMs,
31140
+ timeout: options.timeoutMs === void 0 ? void 0 : swiftBuilderHopTimeoutMs(options.timeoutMs),
31090
31141
  maxBuffer: 64 * 1024 * 1024,
31091
31142
  signal: options.signal
31092
31143
  },
@@ -31118,6 +31169,9 @@ function compileSwiftProjectUnit(input, options) {
31118
31169
  return retain(root, built);
31119
31170
  }
31120
31171
  const preparation = writeSwiftProject(layout, input, moduleRoot);
31172
+ const unprepared = preparation.targetFailures.map(
31173
+ (failure) => `error: target ${failure}`
31174
+ );
31121
31175
  const swift = path8.join(options.toolchainBin, "swift");
31122
31176
  if (!existsSync2(swift)) {
31123
31177
  throw new Error(
@@ -31267,18 +31321,23 @@ function compileSwiftProjectUnit(input, options) {
31267
31321
  );
31268
31322
  } catch (retryError) {
31269
31323
  throw new Error(
31270
- projectDiagnostic(outputOf(retryError), layout, input.files),
31271
- {
31272
- cause: retryError
31273
- }
31324
+ [
31325
+ ...unprepared,
31326
+ projectDiagnostic(outputOf(retryError), layout, input.files)
31327
+ ].join("\n"),
31328
+ { cause: retryError }
31274
31329
  );
31275
31330
  }
31276
31331
  } else {
31277
- throw new Error(projectDiagnostic(output, layout, input.files), {
31278
- cause: error
31279
- });
31332
+ throw new Error(
31333
+ [...unprepared, projectDiagnostic(output, layout, input.files)].join(
31334
+ "\n"
31335
+ ),
31336
+ { cause: error }
31337
+ );
31280
31338
  }
31281
31339
  }
31340
+ if (unprepared.length) throw new Error(unprepared.join("\n"));
31282
31341
  const artifact = {
31283
31342
  hash: hash2,
31284
31343
  bytes: readFileSync5(builtArtifact(layout)),
@@ -31313,6 +31372,7 @@ export {
31313
31372
  swiftApplicationEntry,
31314
31373
  swiftArtifactHash,
31315
31374
  swiftAvailableModules,
31375
+ swiftBuilderHopTimeoutMs,
31316
31376
  swiftCodeMask,
31317
31377
  swiftDistributionAt,
31318
31378
  swiftIcuAsset,
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
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.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1655 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/swift-package.ts
4
4
  function isSwiftManifestFile(file) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
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.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1655 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/is-record.ts
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
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;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
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;