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
  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;
@@ -23728,6 +23728,19 @@ __attribute__((swift_bridge("Swift.String")))
23728
23728
  - (void)appendFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);
23729
23729
  + (NSMutableString *)stringWithCapacity:(NSUInteger)capacity;
23730
23730
  @end
23731
+ NS_SWIFT_UNAVAILABLE("Use String or NSString instead.")
23732
+ @interface NSSimpleCString : NSString {
23733
+ @package
23734
+ char *bytes;
23735
+ int numBytes;
23736
+ #if __LP64__
23737
+ int _unused;
23738
+ #endif
23739
+ }
23740
+ @end
23741
+ NS_SWIFT_UNAVAILABLE("Use String or NSString instead.")
23742
+ @interface NSConstantString : NSSimpleCString
23743
+ @end
23731
23744
  @interface NSAttributedString : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>
23732
23745
  @property (readonly, copy) NSString *string;
23733
23746
  @end
@@ -26738,6 +26751,9 @@ async function runCompiler(command, args, options, stream = false, quiet) {
26738
26751
  await stopping;
26739
26752
  }
26740
26753
  }
26754
+ function swiftBuilderHopTimeoutMs(compileTimeoutMs) {
26755
+ return (compileTimeoutMs ?? SWIFT_BUILDER_DEFAULT_COMPILE_MS) + SWIFT_BUILDER_TRANSPORT_MARGIN_MS;
26756
+ }
26741
26757
  function swiftDistributionAt(root) {
26742
26758
  const file = import_node_path7.default.join(root, SWIFT_DISTRIBUTION_MANIFEST);
26743
26759
  if (!(0, import_node_fs6.existsSync)(file)) return null;
@@ -29034,6 +29050,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
29034
29050
  ] : compileTargets(input);
29035
29051
  const files2 = /* @__PURE__ */ new Map();
29036
29052
  const native = /* @__PURE__ */ new Map();
29053
+ const targetFailures = [];
29037
29054
  const bySourcePath = [...targets].sort(
29038
29055
  (left, right) => right.path.length - left.path.length
29039
29056
  );
@@ -29084,188 +29101,212 @@ function writeSwiftProject(layout, input, moduleRoot) {
29084
29101
  if (units.length === 0) continue;
29085
29102
  const settings = input.nativeTargets?.find((value) => value.name === target.name);
29086
29103
  if (entries.some(([file]) => file.endsWith(".swift")) || settings && units.some(([file]) => /\.mm?$/.test(file))) {
29087
- if (!settings)
29088
- throw new Error(
29089
- `mixed target ${target.name} requires its original native target settings; SwiftPM does not compile mixed source targets`
29104
+ const swift = entries.some(([file]) => file.endsWith(".swift"));
29105
+ try {
29106
+ if (!settings)
29107
+ throw new Error(
29108
+ `mixed target ${target.name} requires its original native target settings; SwiftPM does not compile mixed source targets`
29109
+ );
29110
+ const headers = settings.headers;
29111
+ const roots2 = settings.bridgingHeader ? [settings.bridgingHeader] : settings.publicHeaders;
29112
+ for (const file of headers) {
29113
+ const destination = import_node_path7.default.join(layout.root, file);
29114
+ (0, import_node_fs6.mkdirSync)(import_node_path7.default.dirname(destination), { recursive: true });
29115
+ (0, import_node_fs6.writeFileSync)(destination, input.files[file]);
29116
+ }
29117
+ const search = [
29118
+ .../* @__PURE__ */ new Set([
29119
+ ...settings?.headerSearchPaths ?? [],
29120
+ ...headers.map((file) => import_node_path7.default.posix.dirname(file))
29121
+ ])
29122
+ ].flatMap((dir) => ["-I", import_node_path7.default.join(layout.root, dir)]);
29123
+ const pin = distribution ?? JSON.parse((0, import_node_fs6.readFileSync)(import_node_path7.default.join(moduleRoot, "toolchain.json"), "utf8"));
29124
+ const release = pin.release;
29125
+ const toolchainBin = swiftToolchain(release, swiftModuleSdk(moduleRoot));
29126
+ const sdkHeaders = materializeObjcSdk(
29127
+ import_node_path7.default.join(layout.root, ".build", "peach-objc-sdk")
29090
29128
  );
29091
- const headers = settings.headers;
29092
- const roots2 = settings.bridgingHeader ? [settings.bridgingHeader] : settings.publicHeaders;
29093
- if (!roots2.length)
29094
- throw new Error(`mixed target ${target.name} has no original declaration headers`);
29095
- for (const file of headers) {
29096
- const destination = import_node_path7.default.join(layout.root, file);
29097
- (0, import_node_fs6.mkdirSync)(import_node_path7.default.dirname(destination), { recursive: true });
29098
- (0, import_node_fs6.writeFileSync)(destination, input.files[file]);
29099
- }
29100
- const search = [
29101
- .../* @__PURE__ */ new Set([
29102
- ...settings?.headerSearchPaths ?? [],
29103
- ...headers.map((file) => import_node_path7.default.posix.dirname(file))
29104
- ])
29105
- ].flatMap((dir) => ["-I", import_node_path7.default.join(layout.root, dir)]);
29106
- const pin = distribution ?? JSON.parse((0, import_node_fs6.readFileSync)(import_node_path7.default.join(moduleRoot, "toolchain.json"), "utf8"));
29107
- const release = pin.release;
29108
- const toolchainBin = swiftToolchain(release, swiftModuleSdk(moduleRoot));
29109
- const sdkHeaders = materializeObjcSdk(
29110
- import_node_path7.default.join(layout.root, ".build", "peach-objc-sdk")
29111
- );
29112
- const stageFlags = (flags2, sdkInclude) => flags2.map(
29113
- (flag) => flag.replaceAll(SWIFT_NATIVE_INPUT_ROOT, layout.root).replaceAll(SWIFT_NATIVE_SDK_INCLUDE, sdkInclude)
29114
- );
29115
- const originalFlags = [
29116
- ...settings?.flags ?? [],
29117
- ...search,
29118
- ...(settings?.frameworkSearchPaths ?? []).flatMap((dir) => [
29119
- "-F",
29120
- import_node_path7.default.join(layout.root, dir)
29121
- ]),
29122
- "-I",
29123
- headerDirectory
29124
- ];
29125
- const flags = stageFlags(
29126
- originalFlags,
29127
- import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
29128
- );
29129
- const prefixHeader = settings?.prefixHeader ? ["-include", import_node_path7.default.join(layout.root, settings.prefixHeader)] : [];
29130
- const bundleName = entries.some(([file]) => file.endsWith(".swift")) ? void 0 : swiftObjCResourceBundleName({
29131
- target: target.name,
29132
- path: target.path,
29133
- resources: resourceTargets.find((candidate) => candidate.name === target.name)?.resources ?? false,
29134
- usesBundleMacro: entries.some(
29135
- ([file, contents]) => /\.(?:c|cc|cpp|cxx|m|mm|h|hpp|hh|hxx)$/.test(file) && /\bSWIFTPM_MODULE_BUNDLE\b/.test(contents)
29136
- ),
29137
- bundles: input.resourceBundles
29138
- });
29139
- const accessor = bundleName === void 0 ? void 0 : swiftObjCResourceAccessor(bundleName);
29140
- const accessorHeader = import_node_path7.default.join(
29141
- layout.root,
29142
- target.path,
29143
- OBJC_RESOURCE_ACCESSOR_HEADER
29144
- );
29145
- const accessorUnit = `${prefix}${OBJC_RESOURCE_ACCESSOR_BODY}`;
29146
- if (accessor && (input.files[accessorUnit] !== void 0 || input.files[`${prefix}${OBJC_RESOURCE_ACCESSOR_HEADER}`] !== void 0))
29147
- throw new Error(`target ${target.name} already contains its resource accessor`);
29148
- const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
29149
- const accessorFlags = accessor ? ["-include", accessorHeader] : [];
29150
- if (accessor) {
29151
- files2.set(accessorHeader, accessor.header);
29152
- files2.set(import_node_path7.default.join(layout.root, accessorUnit), accessor.body);
29153
- }
29154
- const sourceHeaders = import_node_path7.default.join(
29155
- layout.root,
29156
- ".build",
29157
- "peach-objc-originals",
29158
- target.name
29159
- );
29160
- (0, import_node_fs6.mkdirSync)(sourceHeaders, { recursive: true });
29161
- const modulemap = import_node_path7.default.join(sourceHeaders, "module.modulemap");
29162
- (0, import_node_fs6.writeFileSync)(
29163
- modulemap,
29164
- `module ${swiftTargetModuleName(target.name)} {
29129
+ const stageFlags = (flags2, sdkInclude) => flags2.map(
29130
+ (flag) => flag.replaceAll(SWIFT_NATIVE_INPUT_ROOT, layout.root).replaceAll(SWIFT_NATIVE_SDK_INCLUDE, sdkInclude)
29131
+ );
29132
+ const originalFlags = [
29133
+ ...settings?.flags ?? [],
29134
+ ...search,
29135
+ ...(settings?.frameworkSearchPaths ?? []).flatMap((dir) => [
29136
+ "-F",
29137
+ import_node_path7.default.join(layout.root, dir)
29138
+ ]),
29139
+ "-I",
29140
+ headerDirectory
29141
+ ];
29142
+ const flags = stageFlags(
29143
+ originalFlags,
29144
+ import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
29145
+ );
29146
+ const prefixHeader = settings?.prefixHeader ? ["-include", import_node_path7.default.join(layout.root, settings.prefixHeader)] : [];
29147
+ const bundleName = entries.some(([file]) => file.endsWith(".swift")) ? void 0 : swiftObjCResourceBundleName({
29148
+ target: target.name,
29149
+ path: target.path,
29150
+ resources: resourceTargets.find((candidate) => candidate.name === target.name)?.resources ?? false,
29151
+ usesBundleMacro: entries.some(
29152
+ ([file, contents]) => /\.(?:c|cc|cpp|cxx|m|mm|h|hpp|hh|hxx)$/.test(file) && /\bSWIFTPM_MODULE_BUNDLE\b/.test(contents)
29153
+ ),
29154
+ bundles: input.resourceBundles
29155
+ });
29156
+ const accessor = bundleName === void 0 ? void 0 : swiftObjCResourceAccessor(bundleName);
29157
+ const accessorHeader = import_node_path7.default.join(
29158
+ layout.root,
29159
+ target.path,
29160
+ OBJC_RESOURCE_ACCESSOR_HEADER
29161
+ );
29162
+ const accessorUnit = `${prefix}${OBJC_RESOURCE_ACCESSOR_BODY}`;
29163
+ if (accessor && (input.files[accessorUnit] !== void 0 || input.files[`${prefix}${OBJC_RESOURCE_ACCESSOR_HEADER}`] !== void 0))
29164
+ throw new Error(`target ${target.name} already contains its resource accessor`);
29165
+ const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
29166
+ const accessorFlags = accessor ? ["-include", accessorHeader] : [];
29167
+ if (accessor) {
29168
+ files2.set(accessorHeader, accessor.header);
29169
+ files2.set(import_node_path7.default.join(layout.root, accessorUnit), accessor.body);
29170
+ }
29171
+ if (roots2.length) {
29172
+ const sourceHeaders = import_node_path7.default.join(
29173
+ layout.root,
29174
+ ".build",
29175
+ "peach-objc-originals",
29176
+ target.name
29177
+ );
29178
+ (0, import_node_fs6.mkdirSync)(sourceHeaders, { recursive: true });
29179
+ const modulemap = import_node_path7.default.join(sourceHeaders, "module.modulemap");
29180
+ (0, import_node_fs6.writeFileSync)(
29181
+ modulemap,
29182
+ `module ${swiftTargetModuleName(target.name)} {
29165
29183
  ${roots2.map((file) => `header ${JSON.stringify(import_node_path7.default.join(layout.root, file))}`).join("\n")}
29166
29184
  export *
29167
29185
  }
29168
29186
  `
29169
- );
29170
- const view = objcView(
29171
- { module: swiftTargetModuleName(target.name), headers: sourceHeaders, modulemap },
29172
- toolchainBin,
29173
- import_node_path7.default.join(moduleRoot, "ios-simulator-stdlib"),
29174
- import_node_path7.default.join(layout.root, ".build", "peach-objc-sdk"),
29175
- import_node_path7.default.join(layout.root, ".build", "peach-objc-imports", target.name),
29176
- {
29177
- flags: stageFlags(originalFlags, import_node_path7.default.join(sdkHeaders, "usr/include")),
29178
- target: `arm64-apple-ios${settings?.deploymentTarget ?? "16.0"}-simulator`
29187
+ );
29188
+ const view = objcView(
29189
+ {
29190
+ module: swiftTargetModuleName(target.name),
29191
+ headers: sourceHeaders,
29192
+ modulemap
29193
+ },
29194
+ toolchainBin,
29195
+ import_node_path7.default.join(moduleRoot, "ios-simulator-stdlib"),
29196
+ import_node_path7.default.join(layout.root, ".build", "peach-objc-sdk"),
29197
+ import_node_path7.default.join(layout.root, ".build", "peach-objc-imports", target.name),
29198
+ {
29199
+ flags: stageFlags(originalFlags, import_node_path7.default.join(sdkHeaders, "usr/include")),
29200
+ target: `arm64-apple-ios${settings?.deploymentTarget ?? "16.0"}-simulator`
29201
+ }
29202
+ );
29203
+ const defined = /* @__PURE__ */ new Set();
29204
+ const declarations = (node) => {
29205
+ if (!node || typeof node !== "object") return;
29206
+ const name3 = Reflect.get(node, "name");
29207
+ if (Reflect.get(node, "kind") === "ObjCInterfaceDecl" && Reflect.get(node, "super") && typeof name3 === "string")
29208
+ defined.add(name3);
29209
+ const children = Reflect.get(node, "inner");
29210
+ if (Array.isArray(children)) for (const child of children) declarations(child);
29211
+ };
29212
+ declarations(view.clangAST);
29213
+ const foreignTypes = /* @__PURE__ */ new Map();
29214
+ for (const graph of view.graphs)
29215
+ for (const symbol of graph.symbols) {
29216
+ const nativeName = /^c:objc\(cs\)(\w+)$/.exec(
29217
+ symbol.identifier.precise
29218
+ )?.[1];
29219
+ if (nativeName && defined.has(nativeName))
29220
+ foreignTypes.set(symbol.pathComponents[0], nativeName);
29221
+ }
29222
+ imports.set(target.name, {
29223
+ view,
29224
+ classes: [...foreignTypes.values()],
29225
+ headers: roots2.map((file) => import_node_path7.default.join(layout.root, file)),
29226
+ foreignTypes
29227
+ });
29179
29228
  }
29180
- );
29181
- const defined = /* @__PURE__ */ new Set();
29182
- const declarations = (node) => {
29183
- if (!node || typeof node !== "object") return;
29184
- const name3 = Reflect.get(node, "name");
29185
- if (Reflect.get(node, "kind") === "ObjCInterfaceDecl" && Reflect.get(node, "super") && typeof name3 === "string")
29186
- defined.add(name3);
29187
- const children = Reflect.get(node, "inner");
29188
- if (Array.isArray(children)) for (const child of children) declarations(child);
29189
- };
29190
- declarations(view.clangAST);
29191
- const foreignTypes = /* @__PURE__ */ new Map();
29192
- for (const graph of view.graphs)
29193
- for (const symbol of graph.symbols) {
29194
- const nativeName = /^c:objc\(cs\)(\w+)$/.exec(symbol.identifier.precise)?.[1];
29195
- if (nativeName && defined.has(nativeName))
29196
- foreignTypes.set(symbol.pathComponents[0], nativeName);
29197
- }
29198
- imports.set(target.name, {
29199
- view,
29200
- classes: [...foreignTypes.values()],
29201
- headers: roots2.map((file) => import_node_path7.default.join(layout.root, file)),
29202
- foreignTypes
29203
- });
29204
- const thunk = "PeachObjCImports.generated.m";
29205
- const groups = /* @__PURE__ */ new Map();
29206
- for (const [file] of nativeUnits) {
29207
- const origin = settings?.sourceDirectories[file];
29208
- if (origin) (0, import_node_fs6.mkdirSync)(import_node_path7.default.join(layout.root, origin), { recursive: true });
29209
- const perFile = [
29210
- ...origin ? ["-iquote", import_node_path7.default.join(layout.root, origin)] : [],
29211
- ...stageFlags(
29212
- settings?.fileFlags[file] ?? [],
29213
- import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
29214
- )
29215
- ];
29216
- const cxx = /\.(?:cc|cpp|cxx|mm)$/.test(file);
29217
- const identity2 = (0, import_node_crypto7.createHash)("sha256").update(JSON.stringify([cxx, perFile])).digest("hex").slice(0, 12);
29218
- const group = groups.get(identity2) ?? {
29219
- name: `${target.name}SwiftImplementation_${identity2}`,
29220
- sources: [],
29221
- flags: [...flags, ...prefixHeader, ...accessorFlags, ...perFile],
29222
- cxxFlags: [
29223
- ...flags,
29224
- ...prefixHeader,
29225
- ...accessorFlags,
29229
+ const thunks = roots2.length ? ["PeachObjCImports.generated.m"] : [];
29230
+ const groups = /* @__PURE__ */ new Map();
29231
+ for (const [file] of nativeUnits) {
29232
+ const origin = settings?.sourceDirectories[file];
29233
+ if (origin) (0, import_node_fs6.mkdirSync)(import_node_path7.default.join(layout.root, origin), { recursive: true });
29234
+ const perFile = [
29235
+ ...origin ? ["-iquote", import_node_path7.default.join(layout.root, origin)] : [],
29226
29236
  ...stageFlags(
29227
- cxx ? settings.cxxFlags : [],
29237
+ settings?.fileFlags[file] ?? [],
29228
29238
  import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
29229
- ),
29230
- ...perFile
29231
- ]
29232
- };
29233
- group.sources.push(file.slice(prefix.length));
29234
- groups.set(identity2, group);
29235
- }
29236
- groups.set("imports", {
29237
- name: `${target.name}ObjCImports`,
29238
- sources: [thunk],
29239
- flags: [...flags, "-fobjc-arc"],
29240
- cxxFlags: [...flags, "-fobjc-arc"]
29241
- });
29242
- const include2 = import_node_path7.default.join(layout.root, target.path, "include");
29243
- files2.set(
29244
- import_node_path7.default.join(include2, "module.modulemap"),
29245
- `module ${target.name}ImplementationDeclarations { export * }
29239
+ )
29240
+ ];
29241
+ const cxx = /\.(?:cc|cpp|cxx|mm)$/.test(file);
29242
+ const identity2 = (0, import_node_crypto7.createHash)("sha256").update(JSON.stringify([cxx, perFile])).digest("hex").slice(0, 12);
29243
+ const group = groups.get(identity2) ?? {
29244
+ name: `${target.name}SwiftImplementation_${identity2}`,
29245
+ sources: [],
29246
+ flags: [...flags, ...prefixHeader, ...accessorFlags, ...perFile],
29247
+ cxxFlags: [
29248
+ ...flags,
29249
+ ...prefixHeader,
29250
+ ...accessorFlags,
29251
+ ...stageFlags(
29252
+ cxx ? settings.cxxFlags : [],
29253
+ import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
29254
+ ),
29255
+ ...perFile
29256
+ ]
29257
+ };
29258
+ group.sources.push(file.slice(prefix.length));
29259
+ groups.set(identity2, group);
29260
+ }
29261
+ if (thunks.length)
29262
+ groups.set("imports", {
29263
+ name: `${target.name}ObjCImports`,
29264
+ sources: thunks,
29265
+ flags: [...flags, "-fobjc-arc"],
29266
+ cxxFlags: [...flags, "-fobjc-arc"]
29267
+ });
29268
+ const include2 = import_node_path7.default.join(layout.root, target.path, "include");
29269
+ files2.set(
29270
+ import_node_path7.default.join(include2, "module.modulemap"),
29271
+ `module ${target.name}ImplementationDeclarations { export * }
29246
29272
  `
29247
- );
29248
- native.set(target.name, {
29249
- mixed: true,
29250
- path: target.path,
29251
- includeDirectory: include2,
29252
- sources: nativeUnits.map(([file]) => file.slice(prefix.length)),
29253
- lateSources: [...nativeUnits.map(([file]) => file.slice(prefix.length)), thunk],
29254
- exclude: [
29255
- ...entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length)),
29256
- ...accessor ? [OBJC_RESOURCE_ACCESSOR_HEADER, OBJC_RESOURCE_ACCESSOR_BODY] : [],
29257
- thunk,
29258
- "include"
29259
- ],
29260
- groups: [...groups.values()],
29261
- late: {
29262
- name: `${target.name}SwiftImplementation`,
29263
- producers: [
29264
- target.name,
29265
- ...(target.dependencies ?? []).filter((dependency) => swiftTargets.has(dependency.name)).map((dependency) => dependency.name)
29266
- ]
29267
- }
29268
- });
29273
+ );
29274
+ native.set(target.name, {
29275
+ mixed: true,
29276
+ path: target.path,
29277
+ includeDirectory: include2,
29278
+ sources: nativeUnits.map(([file]) => file.slice(prefix.length)),
29279
+ lateSources: [
29280
+ ...nativeUnits.map(([file]) => file.slice(prefix.length)),
29281
+ ...thunks
29282
+ ],
29283
+ exclude: [
29284
+ ...entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length)),
29285
+ ...accessor ? [OBJC_RESOURCE_ACCESSOR_HEADER, OBJC_RESOURCE_ACCESSOR_BODY] : [],
29286
+ ...thunks,
29287
+ "include"
29288
+ ],
29289
+ groups: [...groups.values()],
29290
+ late: {
29291
+ name: `${target.name}SwiftImplementation`,
29292
+ producers: [
29293
+ target.name,
29294
+ ...(target.dependencies ?? []).filter((dependency) => swiftTargets.has(dependency.name)).map((dependency) => dependency.name)
29295
+ ]
29296
+ }
29297
+ });
29298
+ } catch (error) {
29299
+ if (!swift || !(error instanceof Error)) throw error;
29300
+ targetFailures.push(`${target.name}: ${error.message}`);
29301
+ native.set(target.name, {
29302
+ mixed: true,
29303
+ path: target.path,
29304
+ includeDirectory: import_node_path7.default.join(layout.root, target.path, "include"),
29305
+ sources: [],
29306
+ lateSources: [],
29307
+ exclude: entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length))
29308
+ });
29309
+ }
29269
29310
  continue;
29270
29311
  }
29271
29312
  const includes = `${prefix}include/`;
@@ -29428,20 +29469,27 @@ export *
29428
29469
  for (const name3 of objcProducers) {
29429
29470
  const target = targets.find((value) => value.name === name3);
29430
29471
  const prefix = target.path === "." ? "" : `${target.path}/`;
29431
- const exported = swiftObjCExports({
29432
- module: swiftTargetModuleName(name3),
29433
- sources: Object.entries(input.files).filter(
29434
- ([file]) => file.startsWith(prefix) && file.endsWith(".swift") && !targets.some(
29435
- (candidate) => candidate.name !== name3 && candidate.path !== "." && candidate.path.startsWith(prefix) && file.startsWith(`${candidate.path}/`)
29436
- ) && !target.exclude?.some(
29437
- (excluded) => file.slice(prefix.length) === excluded || file.slice(prefix.length).startsWith(`${excluded}/`)
29438
- )
29439
- ),
29440
- mask: swiftCodeMask,
29441
- declarationStart,
29442
- selector: objcSelectorName,
29443
- foreignTypes: imports.get(name3)?.foreignTypes
29444
- });
29472
+ let exported;
29473
+ try {
29474
+ exported = swiftObjCExports({
29475
+ module: swiftTargetModuleName(name3),
29476
+ sources: Object.entries(input.files).filter(
29477
+ ([file]) => file.startsWith(prefix) && file.endsWith(".swift") && !targets.some(
29478
+ (candidate) => candidate.name !== name3 && candidate.path !== "." && candidate.path.startsWith(prefix) && file.startsWith(`${candidate.path}/`)
29479
+ ) && !target.exclude?.some(
29480
+ (excluded) => file.slice(prefix.length) === excluded || file.slice(prefix.length).startsWith(`${excluded}/`)
29481
+ )
29482
+ ),
29483
+ mask: swiftCodeMask,
29484
+ declarationStart,
29485
+ selector: objcSelectorName,
29486
+ foreignTypes: imports.get(name3)?.foreignTypes
29487
+ });
29488
+ } catch (error) {
29489
+ if (!(error instanceof Error)) throw error;
29490
+ targetFailures.push(`${name3}: ${error.message}`);
29491
+ continue;
29492
+ }
29445
29493
  const original = imports.get(name3);
29446
29494
  if (!exported && !original) continue;
29447
29495
  objcModules.add(name3);
@@ -29713,6 +29761,7 @@ public func __peachObjcExportRoot() { _objcRegisterPeerClass(NSObject.self, nati
29713
29761
  for (const dependency of dependencies.get(producer) ?? []) include(dependency);
29714
29762
  return {
29715
29763
  headerProducers: producers.filter((name3) => !included.has(name3)),
29764
+ targetFailures,
29716
29765
  ...rootOwner && objcExports ? {
29717
29766
  objcImplementations: {
29718
29767
  owner: import_node_path7.default.join(layout.root, rootOwner),
@@ -29899,7 +29948,7 @@ function compileSwiftProjectUnit(input, options) {
29899
29948
  ],
29900
29949
  {
29901
29950
  cwd: repo,
29902
- timeout: options.timeoutMs,
29951
+ timeout: options.timeoutMs === void 0 ? void 0 : swiftBuilderHopTimeoutMs(options.timeoutMs),
29903
29952
  maxBuffer: 64 * 1024 * 1024,
29904
29953
  signal: options.signal
29905
29954
  },
@@ -29931,6 +29980,9 @@ function compileSwiftProjectUnit(input, options) {
29931
29980
  return retain(root, built2);
29932
29981
  }
29933
29982
  const preparation = writeSwiftProject(layout, input, moduleRoot);
29983
+ const unprepared = preparation.targetFailures.map(
29984
+ (failure2) => `error: target ${failure2}`
29985
+ );
29934
29986
  const swift = import_node_path7.default.join(options.toolchainBin, "swift");
29935
29987
  if (!(0, import_node_fs6.existsSync)(swift)) {
29936
29988
  throw new Error(
@@ -30080,18 +30132,23 @@ function compileSwiftProjectUnit(input, options) {
30080
30132
  );
30081
30133
  } catch (retryError) {
30082
30134
  throw new Error(
30083
- projectDiagnostic(outputOf(retryError), layout, input.files),
30084
- {
30085
- cause: retryError
30086
- }
30135
+ [
30136
+ ...unprepared,
30137
+ projectDiagnostic(outputOf(retryError), layout, input.files)
30138
+ ].join("\n"),
30139
+ { cause: retryError }
30087
30140
  );
30088
30141
  }
30089
30142
  } else {
30090
- throw new Error(projectDiagnostic(output, layout, input.files), {
30091
- cause: error
30092
- });
30143
+ throw new Error(
30144
+ [...unprepared, projectDiagnostic(output, layout, input.files)].join(
30145
+ "\n"
30146
+ ),
30147
+ { cause: error }
30148
+ );
30093
30149
  }
30094
30150
  }
30151
+ if (unprepared.length) throw new Error(unprepared.join("\n"));
30095
30152
  const artifact = {
30096
30153
  hash: hash2,
30097
30154
  bytes: (0, import_node_fs6.readFileSync)(builtArtifact(layout)),
@@ -30108,7 +30165,7 @@ function compileSwiftProjectUnit(input, options) {
30108
30165
  options.signal
30109
30166
  );
30110
30167
  }
30111
- var import_node_child_process7, import_node_crypto7, import_node_fs6, import_node_os4, import_node_path7, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, BUILD_JOBS, linkedModuleDigests, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, sdkPaths, availableModules, ONE_PRODUCT, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_MODULES, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, EXECUTABLE_LINK_FLAGS, REACTOR_FLAG, MULTI_MANIFEST_VERSION, compilerSourceDigest, DIRECTIVE, OS_IOS, OBJC_ATTRIBUTE, SELECTOR, PROTOCOL_NAME, KEY_PATH, TYPE_AFTER_ATTRIBUTE, DELEGATE_CLASS, REUSABLE_INIT, REUSABLE_VIEW_BASES, CLASS_BASE, FRAME_INIT, APPLE_CLASS, EXTENSION_DECL, CLASS_DECL, MODIFIERS, OVERRIDE_FUNC, OVERRIDE_VAR, APPLE_PROTOCOL, OBJC_PROTOCOL, OBJC_PREPOSITIONS, DECLARATION_MODIFIERS, optionalResult, SDK_OBJC_OPTIONAL, IMP_CONVENTION, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, ROOT_LOCKS, host, rootLocks, retainedArtifacts;
30168
+ var import_node_child_process7, import_node_crypto7, import_node_fs6, import_node_os4, import_node_path7, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, BUILD_JOBS, SWIFT_BUILDER_TRANSPORT_MARGIN_MS, SWIFT_BUILDER_DEFAULT_COMPILE_MS, linkedModuleDigests, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, sdkPaths, availableModules, ONE_PRODUCT, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_MODULES, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, EXECUTABLE_LINK_FLAGS, REACTOR_FLAG, MULTI_MANIFEST_VERSION, compilerSourceDigest, DIRECTIVE, OS_IOS, OBJC_ATTRIBUTE, SELECTOR, PROTOCOL_NAME, KEY_PATH, TYPE_AFTER_ATTRIBUTE, DELEGATE_CLASS, REUSABLE_INIT, REUSABLE_VIEW_BASES, CLASS_BASE, FRAME_INIT, APPLE_CLASS, EXTENSION_DECL, CLASS_DECL, MODIFIERS, OVERRIDE_FUNC, OVERRIDE_VAR, APPLE_PROTOCOL, OBJC_PROTOCOL, OBJC_PREPOSITIONS, DECLARATION_MODIFIERS, optionalResult, SDK_OBJC_OPTIONAL, IMP_CONVENTION, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, ROOT_LOCKS, host, rootLocks, retainedArtifacts;
30112
30169
  var init_swift_compile = __esm({
30113
30170
  "src/swift-compile.ts"() {
30114
30171
  "use strict";
@@ -30140,6 +30197,8 @@ var init_swift_compile = __esm({
30140
30197
  BUILD_JOBS = String(
30141
30198
  Math.min(4, Math.max(1, Math.floor(import_node_os4.default.availableParallelism() / 2)))
30142
30199
  );
30200
+ SWIFT_BUILDER_TRANSPORT_MARGIN_MS = 3e5;
30201
+ SWIFT_BUILDER_DEFAULT_COMPILE_MS = 18e5;
30143
30202
  linkedModuleDigests = /* @__PURE__ */ new Map();
30144
30203
  OPTIONAL_FRAMEWORK_DEPENDENCIES = {
30145
30204
  GameplayKit: [],
@@ -30212,7 +30271,7 @@ var init_swift_compile = __esm({
30212
30271
  `;
30213
30272
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
30214
30273
  MULTI_MANIFEST_VERSION = 39;
30215
- compilerSourceDigest = true ? "f4eb526a3d0d01972f3bb179b60c2b10df37c90e90ad1717a3b4946374cdb248" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
30274
+ compilerSourceDigest = true ? "042e57f70d169ec5fd94262a87fc4d50da0c31cc6a6c329e56f12d4b7c5484a1" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
30216
30275
  DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
30217
30276
  OS_IOS = /\b(?:os\(\s*iOS\s*\)|targetEnvironment\(\s*simulator\s*\))/g;
30218
30277
  OBJC_ATTRIBUTE = /^@(?:objcMembers\b|objc\b(?:(\s*)\(([^()]*)\))?|IBAction\b)/;
@@ -35638,12 +35697,12 @@ var swift_distribution_lock_default;
35638
35697
  var init_swift_distribution_lock = __esm({
35639
35698
  "src/swift-distribution.lock.json"() {
35640
35699
  swift_distribution_lock_default = {
35641
- id: "e3bdd3d8fa4f9993",
35700
+ id: "ca4dfda0ca14bc49",
35642
35701
  release: "swift-6.4.0-RELEASE-custom-0d775d32d7c74eae",
35643
35702
  wasmSdkId: "swift-6.4.0-RELEASE_wasm-peach-f02bd198",
35644
35703
  wasmSdkUrl: "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-f02bd198.artifactbundle.tar.gz",
35645
35704
  wasmSdkChecksum: "1e19ea768fd4e821aae34b8966c4ddcee45615c4b3cf018979b061aee2fb5504",
35646
- source: "5791eeff9ca9c054514aeb4a6599e1de8e1e4711",
35705
+ source: "33e8641403dd73a7ce0ca902007e3a36407e1f0b",
35647
35706
  targets: [
35648
35707
  "ImagePlayground",
35649
35708
  "QuickLookThumbnailing",
@@ -35688,6 +35747,7 @@ var init_swift_distribution_lock = __esm({
35688
35747
  "PeachObjCRuntime",
35689
35748
  "PeachObjC",
35690
35749
  "UIUtilities",
35750
+ "UIKitEnums",
35691
35751
  "UIKitCore",
35692
35752
  "PeachICU",
35693
35753
  "PeachCMark",
@@ -35803,33 +35863,14 @@ var init_swift_distribution_lock = __esm({
35803
35863
  "PeachBox2D"
35804
35864
  ],
35805
35865
  systemEnvironment: {
35806
- scenePhase: [
35807
- "string:active",
35808
- "string:inactive",
35809
- "string:background"
35810
- ],
35811
- deviceModel: [
35812
- "string"
35813
- ],
35814
- systemName: [
35815
- "string"
35816
- ],
35817
- systemVersion: [
35818
- "string"
35819
- ],
35820
- colorScheme: [
35821
- "string:light",
35822
- "string:dark"
35823
- ],
35824
- semanticColors: [
35825
- "object"
35826
- ],
35827
- imageAssets: [
35828
- "object"
35829
- ],
35830
- locale: [
35831
- "string"
35832
- ],
35866
+ scenePhase: ["string:active", "string:inactive", "string:background"],
35867
+ deviceModel: ["string"],
35868
+ systemName: ["string"],
35869
+ systemVersion: ["string"],
35870
+ colorScheme: ["string:light", "string:dark"],
35871
+ semanticColors: ["object"],
35872
+ imageAssets: ["object"],
35873
+ locale: ["string"],
35833
35874
  dynamicTypeSize: [
35834
35875
  "string:xSmall",
35835
35876
  "string:small",
@@ -35844,30 +35885,22 @@ var init_swift_distribution_lock = __esm({
35844
35885
  "string:accessibility4",
35845
35886
  "string:accessibility5"
35846
35887
  ],
35847
- horizontalSizeClass: [
35848
- "string:compact",
35849
- "string:regular"
35850
- ],
35851
- verticalSizeClass: [
35852
- "string:compact",
35853
- "string:regular"
35854
- ],
35855
- accessibilityReduceMotion: [
35856
- "bool"
35857
- ]
35888
+ horizontalSizeClass: ["string:compact", "string:regular"],
35889
+ verticalSizeClass: ["string:compact", "string:regular"],
35890
+ accessibilityReduceMotion: ["bool"]
35858
35891
  },
35859
35892
  hosts: {
35860
35893
  "darwin-arm64": {
35861
- sha256: "278cf5301795dd1e9f0f044bdb4e079b45ab4eb72a6e72331b06916115e34902",
35862
- size: 71532233
35894
+ sha256: "8679052c4c2b21ad748a8db40cdbc0c91ab14a29fc06bbed777efb57030c01fa",
35895
+ size: 70963039
35863
35896
  },
35864
35897
  "linux-x64": {
35865
- sha256: "920c6fe08ba45930880fee133a3cb85b310d713a4d60404f29d03555d3df879c",
35866
- size: 71538725
35898
+ sha256: "a1719d844e2f45e8c9a2ccb9dbe7857978918639a3933c225a328d84cae235cf",
35899
+ size: 70968746
35867
35900
  },
35868
35901
  "linux-arm64": {
35869
- sha256: "d3a3421e0c80cc698869bc39dd538d42b0e053db02526d3f5f22acf8e7c6dca9",
35870
- size: 71536749
35902
+ sha256: "3da8f2c920e65c633b5310c778b4a5c54b0f5f8278d58fd109f3db4310794c04",
35903
+ size: 70967077
35871
35904
  }
35872
35905
  }
35873
35906
  };