peachsim 0.1.2220 → 0.1.2221

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 (88) hide show
  1. package/cli/commands/inspect.ts +4 -4
  2. package/dist-lib/agent-daemon-client.cjs +1 -1
  3. package/dist-lib/agent-events.cjs +1 -1
  4. package/dist-lib/attached-projects.cjs +1 -1
  5. package/dist-lib/auth/shared-session.cjs +1 -1
  6. package/dist-lib/backend-origin.cjs +1 -1
  7. package/dist-lib/beta.cjs +1 -1
  8. package/dist-lib/beta.mjs +1 -1
  9. package/dist-lib/bridge-constants.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.cjs +1 -1
  11. package/dist-lib/bridge-contract-input.mjs +1 -1
  12. package/dist-lib/bridge-contract.cjs +1 -1
  13. package/dist-lib/bridge-contract.mjs +1 -1
  14. package/dist-lib/bundle-channel.cjs +42 -24
  15. package/dist-lib/capture-contract.cjs +1 -1
  16. package/dist-lib/capture-contract.mjs +1 -1
  17. package/dist-lib/cloud-contract.cjs +1 -1
  18. package/dist-lib/cloud-contract.mjs +1 -1
  19. package/dist-lib/cloud-test-args.cjs +1 -1
  20. package/dist-lib/cloud-test-args.mjs +1 -1
  21. package/dist-lib/cloud.cjs +1 -1
  22. package/dist-lib/cloud.mjs +1 -1
  23. package/dist-lib/config.cjs +1 -1
  24. package/dist-lib/config.mjs +1 -1
  25. package/dist-lib/detox/index.cjs +1 -1
  26. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  27. package/dist-lib/expo-swift-bundle.cjs +41 -23
  28. package/dist-lib/expo-swift-metadata.cjs +1 -1
  29. package/dist-lib/expo-swift-metadata.mjs +1 -1
  30. package/dist-lib/home-paths.cjs +1 -1
  31. package/dist-lib/host/bridge-host.cjs +42 -24
  32. package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
  33. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  34. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  35. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  36. package/dist-lib/host/websocket-proxy.cjs +1 -1
  37. package/dist-lib/index.cjs +3 -3
  38. package/dist-lib/jump-to-source-babel.cjs +1 -1
  39. package/dist-lib/jump-to-source-native.cjs +1 -1
  40. package/dist-lib/kotlin-host.cjs +1 -1
  41. package/dist-lib/menu.cjs +1 -1
  42. package/dist-lib/menu.mjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  45. package/dist-lib/metro-production-bundle.cjs +1 -1
  46. package/dist-lib/metro-production-bundle.mjs +1 -1
  47. package/dist-lib/metro.cjs +3 -3
  48. package/dist-lib/native-app-identity-project.cjs +2 -2
  49. package/dist-lib/native-app-identity-project.mjs +2 -2
  50. package/dist-lib/native-app-identity.cjs +1 -1
  51. package/dist-lib/native-app-identity.mjs +1 -1
  52. package/dist-lib/native-firebase-metadata.cjs +1 -1
  53. package/dist-lib/native-firebase-metadata.mjs +1 -1
  54. package/dist-lib/pdfium-raster.cjs +1 -1
  55. package/dist-lib/pdfium-raster.mjs +1 -1
  56. package/dist-lib/plist.cjs +1 -1
  57. package/dist-lib/plist.mjs +1 -1
  58. package/dist-lib/profiles.cjs +1 -1
  59. package/dist-lib/public-brand.cjs +1 -1
  60. package/dist-lib/public-origins-lib-esm.json +24 -24
  61. package/dist-lib/public-origins-lib.json +53 -53
  62. package/dist-lib/react-native-host-modules.cjs +1 -1
  63. package/dist-lib/react-native-host-modules.mjs +1 -1
  64. package/dist-lib/reap-browser.cjs +1 -1
  65. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  66. package/dist-lib/sdk.cjs +1 -1
  67. package/dist-lib/sdk.mjs +1 -1
  68. package/dist-lib/skills.cjs +42 -24
  69. package/dist-lib/swift-compile.cjs +39 -21
  70. package/dist-lib/swift-compile.mjs +39 -21
  71. package/dist-lib/swift-package.cjs +1 -1
  72. package/dist-lib/swift-package.mjs +1 -1
  73. package/dist-lib/swift-submit.cjs +1 -1
  74. package/dist-lib/swift-submit.mjs +1 -1
  75. package/dist-lib/swift-toolchain.cjs +1 -1
  76. package/dist-lib/swift.cjs +1 -1
  77. package/dist-lib/vite-swift.cjs +40 -22
  78. package/dist-lib/vite.cjs +3 -3
  79. package/dist-lib/worklet-executable.cjs +1 -1
  80. package/dist-lib/worklet-executable.mjs +1 -1
  81. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +1 -0
  82. package/package.json +1 -1
  83. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSLayoutConstraint.h +1 -8
  84. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Modules/module.modulemap +1 -0
  85. package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +1 -0
  86. package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UILayoutPriority.h +11 -0
  87. package/src/swift-compile.ts +43 -23
  88. package/src/swift-objc-import.ts +4 -0
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2220 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2221 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -16073,7 +16073,7 @@ function swiftSubmoduleImports(sources) {
16073
16073
  }
16074
16074
  return imports2;
16075
16075
  }
16076
- function swiftObjCModuleMap(module2, headers, submodules = /* @__PURE__ */ new Set()) {
16076
+ function swiftObjCModuleMap(module2, headers, submodules = /* @__PURE__ */ new Set(), swiftHeader) {
16077
16077
  const header = (file) => `header ${JSON.stringify(file)}`;
16078
16078
  const stem = (file) => file.slice(file.lastIndexOf("/") + 1).replace(/\.[^.]*$/, "");
16079
16079
  return [
@@ -16081,6 +16081,7 @@ function swiftObjCModuleMap(module2, headers, submodules = /* @__PURE__ */ new S
16081
16081
  ...headers.map(
16082
16082
  (file) => submodules.has(stem(file)) ? ` module ${stem(file)} { ${header(file)} export * }` : ` ${header(file)}`
16083
16083
  ),
16084
+ ...swiftHeader ? [" module Swift {", ` ${header(swiftHeader)}`, " requires objc", " }"] : [],
16084
16085
  " export *",
16085
16086
  "}",
16086
16087
  ""
@@ -16625,7 +16626,10 @@ function swiftModuleInterface(moduleRoot, name3, interfaceRoot) {
16625
16626
  if (declared.size === 0) return null;
16626
16627
  return { declared, header: clangInterfaceHeader((0, import_node_fs27.readFileSync)(built2, "utf8")) };
16627
16628
  }
16628
- var clangInterfaceHeader = (header) => header.replace(/^@import (?:UIKitCore|UIKitText);$/gm, "@import UIKit;").replace(/^@import CoreFoundation;$/gm, "@import Foundation;").replace(/\b_TtC10Foundation\d+(NS\w+)\b/g, "$1").replace(/\b__attribute__\(\(objc_subclassing_restricted\)\)\s*/g, "");
16629
+ var clangInterfaceHeader = (header) => header.replace(/^@import (?:UIKitCore|UIKitText);$/gm, "@import UIKit;").replace(
16630
+ /^@import (?:CoreFoundation|FoundationNetworking);$/gm,
16631
+ "@import Foundation;"
16632
+ ).replace(/\b_TtC10Foundation\d+(NS\w+)\b/g, "$1").replace(/\b__attribute__\(\(objc_subclassing_restricted\)\)\s*/g, "");
16629
16633
  var swiftInterfaceDeclarations = (header) => /* @__PURE__ */ new Set([
16630
16634
  ...[
16631
16635
  ...header.matchAll(
@@ -17459,7 +17463,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
17459
17463
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
17460
17464
  var MULTI_MANIFEST_VERSION = 68;
17461
17465
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
17462
- var compilerSourceDigest = true ? "0a0bc1c871aee83ea273120655f55a43ddccde646478a452b4c73d2daefd58c3" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
17466
+ var compilerSourceDigest = true ? "2e9f321a97a408a1b3b8b7d85bbcfb108f0761ed9726b832a3c6c2cc52102806" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
17463
17467
  function swiftArtifactHash(input, release, moduleRoot) {
17464
17468
  const hash = (0, import_node_crypto13.createHash)("sha256");
17465
17469
  hash.update(`swift-compile
@@ -17752,6 +17756,10 @@ function emitSwiftPackageManifest(args) {
17752
17756
  includeImportContext(dependency);
17753
17757
  const importedNativeFlags = [
17754
17758
  ...args.nativeImportFlags?.get(target.name) ?? [],
17759
+ ...[...importContext].flatMap((name3) => {
17760
+ const map = name3 === target.name ? void 0 : args.nativeSwiftHeaderMaps?.get(name3);
17761
+ return map ? ["-fmodule-map-file=" + map] : [];
17762
+ }),
17755
17763
  ...[...importContext].flatMap((name3) => args.native?.get(name3)?.importFlags ?? []),
17756
17764
  ...[...importContext].flatMap((name3) => {
17757
17765
  const flags = targets.find((target2) => target2.name === name3)?.swiftFlags ?? [];
@@ -19523,6 +19531,7 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
19523
19531
  )
19524
19532
  );
19525
19533
  const importModuleMaps = /* @__PURE__ */ new Map();
19534
+ const sourceModuleMaps = /* @__PURE__ */ new Map();
19526
19535
  const generatedModuleMaps = [];
19527
19536
  for (const target of targets) {
19528
19537
  const prefix = target.path === "." ? "" : `${target.path}/`;
@@ -19757,6 +19766,10 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
19757
19766
  stageTargetFile(target.name, import_node_path27.default.join(layout2.root, modulemap), moduleContents, {
19758
19767
  allowExisting: true
19759
19768
  });
19769
+ sourceModuleMaps.set(swiftTargetModuleName(target.name), {
19770
+ path: import_node_path27.default.join(layout2.root, modulemap),
19771
+ contents: moduleContents.toString()
19772
+ });
19760
19773
  if (modulemap.endsWith("/Modules/module.modulemap")) {
19761
19774
  const framework = import_node_path27.default.posix.dirname(import_node_path27.default.posix.dirname(modulemap));
19762
19775
  for (const [, header] of moduleContents.toString().matchAll(/\bheader\s+"([^"]+)"/g))
@@ -20031,6 +20044,7 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
20031
20044
  if (native.size > 0) (0, import_node_fs27.mkdirSync)(headerDirectory, { recursive: true });
20032
20045
  const headerAliasFlags = Object.keys(input.headerAliases ?? {}).length > 0 ? ["-ivfsoverlay", headerSearch.files[0]] : [];
20033
20046
  const nativeHeaderFlags = [...headerAliasFlags];
20047
+ const nativeSwiftHeaderMaps = /* @__PURE__ */ new Map();
20034
20048
  const originalMaps = /* @__PURE__ */ new Map();
20035
20049
  for (const target of input.nativeTargets ?? []) {
20036
20050
  for (const flag of [...target.flags, ...target.cxxFlags]) {
@@ -20061,30 +20075,33 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
20061
20075
  );
20062
20076
  const moduleName = swiftTargetModuleName(name3);
20063
20077
  const originalMap = originalMaps.get(moduleName);
20064
- const originalTokens = originalMap ? moduleMapTokens(input.files[originalMap]) : [];
20065
- if (originalMap && originalTokens.some(
20078
+ const stagedMap = sourceModuleMaps.get(moduleName);
20079
+ const originalPath = originalMap ? import_node_path27.default.join(layout2.root, originalMap) : stagedMap?.path;
20080
+ const originalContents = originalMap ? input.files[originalMap] : stagedMap?.contents;
20081
+ const originalTokens = originalContents ? moduleMapTokens(originalContents) : [];
20082
+ if (originalPath && originalTokens.some(
20066
20083
  (token, index) => token === "module" && (originalTokens[index + 1] === "Swift" || originalTokens[index + 1] === `${moduleName}.Swift`)
20067
20084
  )) {
20068
- nativeHeaderFlags.push("-fmodule-map-file=" + import_node_path27.default.join(layout2.root, originalMap));
20085
+ nativeHeaderFlags.push("-fmodule-map-file=" + originalPath);
20086
+ nativeSwiftHeaderMaps.set(name3, originalPath);
20069
20087
  continue;
20070
20088
  }
20071
20089
  files2.set(
20072
20090
  modulemap,
20073
- originalMap ? `extern module ${moduleName} ${JSON.stringify(import_node_path27.default.join(layout2.root, originalMap))}
20091
+ originalPath ? `extern module ${moduleName} ${JSON.stringify(originalPath)}
20074
20092
  module ${moduleName}.Swift {
20075
20093
  header ${JSON.stringify(import_node_path27.default.join(headerDirectory, name3 + "-Swift.h"))}
20076
20094
  requires objc
20077
20095
  }
20078
20096
  ` : swiftObjCModuleMap(
20079
20097
  moduleName,
20080
- [
20081
- ...(input.nativeTargets?.find((target) => target.name === name3)?.publicHeaders ?? []).map((header) => import_node_path27.default.join(layout2.root, header)),
20082
- import_node_path27.default.join(headerDirectory, name3 + "-Swift.h")
20083
- ],
20084
- submoduleImports.get(moduleName)
20098
+ (input.nativeTargets?.find((target) => target.name === name3)?.publicHeaders ?? []).map((header) => import_node_path27.default.join(layout2.root, header)),
20099
+ submoduleImports.get(moduleName),
20100
+ import_node_path27.default.join(headerDirectory, name3 + "-Swift.h")
20085
20101
  )
20086
20102
  );
20087
20103
  nativeHeaderFlags.push("-fmodule-map-file=" + modulemap);
20104
+ nativeSwiftHeaderMaps.set(name3, modulemap);
20088
20105
  }
20089
20106
  const modulePlan = (0, import_node_crypto13.createHash)("sha256").update(
20090
20107
  swiftModuleInputFiles(moduleRoot).join("\n")
@@ -20441,6 +20458,7 @@ module ${moduleName}.Swift {
20441
20458
  nativeFlags,
20442
20459
  nativeImportFlags,
20443
20460
  nativeHeaderFlags,
20461
+ nativeSwiftHeaderMaps,
20444
20462
  nativeHeaderDeclarations,
20445
20463
  objcImplementationModules: new Set(
20446
20464
  targets.filter(
@@ -20598,30 +20616,30 @@ module ${moduleName}.Swift {
20598
20616
  )
20599
20617
  ])
20600
20618
  );
20619
+ const producerSet = /* @__PURE__ */ new Set([...Object.keys(nativeHeaderDeclarations), ...producers]);
20620
+ const orderedProducers = [];
20601
20621
  const included = /* @__PURE__ */ new Set();
20602
20622
  const include = (name3) => {
20603
20623
  if (included.has(name3)) return;
20604
20624
  included.add(name3);
20605
20625
  for (const dependency of dependencies.get(name3) ?? []) include(dependency);
20626
+ if (producerSet.has(name3)) orderedProducers.push(name3);
20606
20627
  };
20607
- for (const producer of producers)
20628
+ for (const producer of producerSet)
20608
20629
  for (const dependency of dependencies.get(producer) ?? []) include(dependency);
20630
+ const needsHeaderStages = [...producerSet].some((name3) => included.has(name3));
20631
+ for (const producer of producerSet) include(producer);
20609
20632
  return {
20610
20633
  nativeBuildTargets: [...native].flatMap(([name3, plan]) => [
20611
20634
  ...!plan.mixed && plan.sources.length > 0 ? [name3] : [],
20612
20635
  ...plan.groups?.map((group) => group.name) ?? (plan.late ? [plan.late.name] : [])
20613
20636
  ]),
20614
- headerProducers: [
20615
- .../* @__PURE__ */ new Set([
20616
- ...Object.keys(nativeHeaderDeclarations),
20617
- ...producers.filter((name3) => !included.has(name3))
20618
- ])
20619
- ],
20637
+ headerProducers: orderedProducers,
20620
20638
  emittedHeaderProducers: [
20621
20639
  .../* @__PURE__ */ new Set([...Object.keys(nativeHeaderDeclarations), ...producers])
20622
20640
  ],
20623
20641
  nativeHeaderDeclarations,
20624
- headerProductTarget,
20642
+ headerProductTarget: needsHeaderStages ? void 0 : headerProductTarget,
20625
20643
  targetFailures,
20626
20644
  generatedOwners,
20627
20645
  targetToolset
@@ -30876,7 +30894,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
30876
30894
  return hash.digest("hex");
30877
30895
  }
30878
30896
  var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
30879
- var STANDIN_SOURCE_DIGEST = true ? "c0f609da62368c513c186d23bc8aa8e450d27efae5b8c2e7cdf50d34fa734ff0" : standinSourceDigest();
30897
+ var STANDIN_SOURCE_DIGEST = true ? "70b9e9f32fde5739daaee933df31b2584f9ef3289c322a0f5b03f1eaac947880" : standinSourceDigest();
30880
30898
 
30881
30899
  // src/swift-standins.ts
30882
30900
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2220 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2221 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -2923,7 +2923,7 @@ function readIosSdkTree(root) {
2923
2923
 
2924
2924
  // src/swift-standin-digest.ts
2925
2925
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2926
- var STANDIN_SOURCE_DIGEST = true ? "c0f609da62368c513c186d23bc8aa8e450d27efae5b8c2e7cdf50d34fa734ff0" : standinSourceDigest();
2926
+ var STANDIN_SOURCE_DIGEST = true ? "70b9e9f32fde5739daaee933df31b2584f9ef3289c322a0f5b03f1eaac947880" : standinSourceDigest();
2927
2927
 
2928
2928
  // src/expo-native-workspace.ts
2929
2929
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -6417,7 +6417,7 @@ var FOUNDATION_IMPLICIT_MODULES = [
6417
6417
  var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
6418
6418
  (module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
6419
6419
  ).join("");
6420
- var compilerSourceDigest = true ? "0a0bc1c871aee83ea273120655f55a43ddccde646478a452b4c73d2daefd58c3" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
6420
+ var compilerSourceDigest = true ? "2e9f321a97a408a1b3b8b7d85bbcfb108f0761ed9726b832a3c6c2cc52102806" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
6421
6421
  var CORE_FOUNDATION_HANDLE_IMPORTS = [
6422
6422
  "CFAllocator",
6423
6423
  "CFArray",
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2220 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2221 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2220 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2221 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/worklet-executable.ts
4
4
  import { parse } from "acorn";
@@ -772,6 +772,7 @@ export interface CompositorStats {
772
772
  immediateDemand: boolean;
773
773
  pendingDemandBackingEpoch: number | null;
774
774
  nativeFrameArmed: boolean;
775
+ holds: Readonly<Record<string, number>>;
775
776
  };
776
777
  demandPaintsSuperseded: number;
777
778
  entryEvals: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.2220",
3
+ "version": "0.1.2221",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -9,19 +9,12 @@
9
9
  #import <Foundation/NSObject.h>
10
10
  #import <UIKit/UIGeometry.h>
11
11
  #import <UIKit/UIKitDefines.h>
12
+ #import <UIKitTypes/UILayoutPriority.h>
12
13
 
13
14
  NS_HEADER_AUDIT_BEGIN(nullability, sendability)
14
15
 
15
16
  @class NSArray, NSDictionary, NSLayoutAnchor;
16
17
 
17
- typedef float UILayoutPriority NS_TYPED_EXTENSIBLE_ENUM API_UNAVAILABLE(watchos);
18
- static const UILayoutPriority UILayoutPriorityRequired API_AVAILABLE(ios(6.0)) API_UNAVAILABLE(watchos) = 1000; // A required constraint. Do not exceed this.
19
- static const UILayoutPriority UILayoutPriorityDefaultHigh API_AVAILABLE(ios(6.0)) API_UNAVAILABLE(watchos) = 750; // This is the priority level with which a button resists compressing its content.
20
- static const UILayoutPriority UILayoutPriorityDragThatCanResizeScene API_AVAILABLE(macCatalyst(13.0)) API_UNAVAILABLE(watchos) = 510; // This is the appropriate priority level for a drag that may end up resizing the window's scene.
21
- static const UILayoutPriority UILayoutPrioritySceneSizeStayPut API_AVAILABLE(macCatalyst(13.0)) API_UNAVAILABLE(watchos) = 500; // This is the priority level at which the window's scene prefers to stay the same size. It's generally not appropriate to make a constraint at exactly this priority. You want to be higher or lower.
22
- static const UILayoutPriority UILayoutPriorityDragThatCannotResizeScene API_AVAILABLE(macCatalyst(13.0)) API_UNAVAILABLE(watchos) = 490; // This is the priority level at which a split view divider, say, is dragged. It won't resize the window's scene.
23
- static const UILayoutPriority UILayoutPriorityDefaultLow API_AVAILABLE(ios(6.0)) API_UNAVAILABLE(watchos) = 250; // This is the priority level at which a button hugs its contents horizontally.
24
- static const UILayoutPriority UILayoutPriorityFittingSizeLevel API_AVAILABLE(ios(6.0)) API_UNAVAILABLE(watchos) = 50; // When you send -[UIView systemLayoutSizeFittingSize:], the size fitting most closely to the target size (the argument) is computed. UILayoutPriorityFittingSizeLevel is the priority level with which the view wants to conform to the target size in that computation. It's quite low. It is generally not appropriate to make a constraint at exactly this priority. You want to be higher or lower.
25
18
 
26
19
  #if !TARGET_OS_IPHONE
27
20
  typedef float NSLayoutPriority NS_TYPED_EXTENSIBLE_ENUM;
@@ -19,6 +19,7 @@ framework module UIKit [system] {
19
19
  header "UIGestureRecognizerSubclass.h"
20
20
  export *
21
21
  }
22
+ module * { export * }
22
23
  export UIKitText
23
24
  export *
24
25
  }
@@ -4,6 +4,7 @@
4
4
  #import <Foundation/Foundation.h>
5
5
  #import <UIKitAnimationOptions/UIViewAnimationOptions.h>
6
6
  #import <UIKitTypes/UIWindowLevel.h>
7
+ #import <UIKitTypes/UILayoutPriority.h>
7
8
 
8
9
  typedef NS_ENUM(NSInteger, UIPointerEffectTintMode) {
9
10
  UIPointerEffectTintModeNone = 0,
@@ -0,0 +1,11 @@
1
+ #pragma once
2
+ #import <Foundation/Foundation.h>
3
+
4
+ typedef float UILayoutPriority NS_TYPED_EXTENSIBLE_ENUM API_UNAVAILABLE(watchos);
5
+ static const UILayoutPriority UILayoutPriorityRequired API_AVAILABLE(ios(6.0)) API_UNAVAILABLE(watchos) = 1000; // A required constraint. Do not exceed this.
6
+ static const UILayoutPriority UILayoutPriorityDefaultHigh API_AVAILABLE(ios(6.0)) API_UNAVAILABLE(watchos) = 750; // This is the priority level with which a button resists compressing its content.
7
+ static const UILayoutPriority UILayoutPriorityDragThatCanResizeScene API_AVAILABLE(macCatalyst(13.0)) API_UNAVAILABLE(watchos) = 510; // This is the appropriate priority level for a drag that may end up resizing the window's scene.
8
+ static const UILayoutPriority UILayoutPrioritySceneSizeStayPut API_AVAILABLE(macCatalyst(13.0)) API_UNAVAILABLE(watchos) = 500; // This is the priority level at which the window's scene prefers to stay the same size. It's generally not appropriate to make a constraint at exactly this priority. You want to be higher or lower.
9
+ static const UILayoutPriority UILayoutPriorityDragThatCannotResizeScene API_AVAILABLE(macCatalyst(13.0)) API_UNAVAILABLE(watchos) = 490; // This is the priority level at which a split view divider, say, is dragged. It won't resize the window's scene.
10
+ static const UILayoutPriority UILayoutPriorityDefaultLow API_AVAILABLE(ios(6.0)) API_UNAVAILABLE(watchos) = 250; // This is the priority level at which a button hugs its contents horizontally.
11
+ static const UILayoutPriority UILayoutPriorityFittingSizeLevel API_AVAILABLE(ios(6.0)) API_UNAVAILABLE(watchos) = 50; // When you send -[UIView systemLayoutSizeFittingSize:], the size fitting most closely to the target size (the argument) is computed. UILayoutPriorityFittingSizeLevel is the priority level with which the view wants to conform to the target size in that computation. It's quite low. It is generally not appropriate to make a constraint at exactly this priority. You want to be higher or lower.
@@ -424,11 +424,14 @@ export function swiftModuleInterface(
424
424
  // the compiler imports the module that defines a type, and UIKit's declarations
425
425
  // live in UIKitCore/UIKitText, which only the umbrella UIKit module represents
426
426
  // to clang. CoreFoundation's CGFloat lives in the Swift CoreFoundation overlay,
427
- // while clang's Foundation umbrella provides CoreFoundation/CoreFoundation.h.
427
+ // while clang's Foundation umbrella also owns networking class declarations.
428
428
  const clangInterfaceHeader = (header: string): string =>
429
429
  header
430
430
  .replace(/^@import (?:UIKitCore|UIKitText);$/gm, '@import UIKit;')
431
- .replace(/^@import CoreFoundation;$/gm, '@import Foundation;')
431
+ .replace(
432
+ /^@import (?:CoreFoundation|FoundationNetworking);$/gm,
433
+ '@import Foundation;',
434
+ )
432
435
  .replace(/\b_TtC10Foundation\d+(NS\w+)\b/g, '$1')
433
436
  .replace(/\b__attribute__\(\(objc_subclassing_restricted\)\)\s*/g, '')
434
437
 
@@ -1853,6 +1856,7 @@ export function emitSwiftPackageManifest(args: {
1853
1856
  nativeFlags?: Map<string, string[]>
1854
1857
  nativeImportFlags?: Map<string, string[]>
1855
1858
  nativeHeaderFlags?: string[]
1859
+ nativeSwiftHeaderMaps?: ReadonlyMap<string, string>
1856
1860
  nativeHeaderDeclarations?: Readonly<Record<string, readonly string[]>>
1857
1861
  objcImplementationModules?: Set<string>
1858
1862
  siblings: Map<string, string[]>
@@ -2163,6 +2167,11 @@ export function emitSwiftPackageManifest(args: {
2163
2167
  includeImportContext(dependency)
2164
2168
  const importedNativeFlags = [
2165
2169
  ...(args.nativeImportFlags?.get(target.name) ?? []),
2170
+ ...[...importContext].flatMap((name) => {
2171
+ const map =
2172
+ name === target.name ? undefined : args.nativeSwiftHeaderMaps?.get(name)
2173
+ return map ? ['-fmodule-map-file=' + map] : []
2174
+ }),
2166
2175
  ...[...importContext].flatMap((name) => args.native?.get(name)?.importFlags ?? []),
2167
2176
  ...[...importContext].flatMap((name) => {
2168
2177
  const flags = targets.find((target) => target.name === name)?.swiftFlags ?? []
@@ -4610,6 +4619,7 @@ export function writeSwiftProject(
4610
4619
  // declarations are imported before swift can emit the header that native
4611
4620
  // implementations consume. give those implementations a downstream target.
4612
4621
  const importModuleMaps = new Map<string, string>()
4622
+ const sourceModuleMaps = new Map<string, { path: string; contents: string }>()
4613
4623
  const generatedModuleMaps: { output: string; module: string; published: string }[] = []
4614
4624
  for (const target of targets) {
4615
4625
  const prefix = target.path === '.' ? '' : `${target.path}/`
@@ -4938,6 +4948,10 @@ export function writeSwiftProject(
4938
4948
  stageTargetFile(target.name, path.join(layout.root, modulemap), moduleContents, {
4939
4949
  allowExisting: true,
4940
4950
  })
4951
+ sourceModuleMaps.set(swiftTargetModuleName(target.name), {
4952
+ path: path.join(layout.root, modulemap),
4953
+ contents: moduleContents.toString(),
4954
+ })
4941
4955
  // clang resolves a framework map loaded through extern module against
4942
4956
  // the map directory, not the framework root, so mirror every header
4943
4957
  // the map names there. clang looks in Headers/ and PrivateHeaders/ for
@@ -5272,6 +5286,7 @@ export function writeSwiftProject(
5272
5286
  ? ['-ivfsoverlay', headerSearch.files[0]!]
5273
5287
  : []
5274
5288
  const nativeHeaderFlags: string[] = [...headerAliasFlags]
5289
+ const nativeSwiftHeaderMaps = new Map<string, string>()
5275
5290
  const originalMaps = new Map<string, string>()
5276
5291
  for (const target of input.nativeTargets ?? []) {
5277
5292
  for (const flag of [...target.flags, ...target.cxxFlags]) {
@@ -5304,9 +5319,14 @@ export function writeSwiftProject(
5304
5319
  )
5305
5320
  const moduleName = swiftTargetModuleName(name)
5306
5321
  const originalMap = originalMaps.get(moduleName)
5307
- const originalTokens = originalMap ? moduleMapTokens(input.files[originalMap]!) : []
5322
+ const stagedMap = sourceModuleMaps.get(moduleName)
5323
+ const originalPath = originalMap
5324
+ ? path.join(layout.root, originalMap)
5325
+ : stagedMap?.path
5326
+ const originalContents = originalMap ? input.files[originalMap]! : stagedMap?.contents
5327
+ const originalTokens = originalContents ? moduleMapTokens(originalContents) : []
5308
5328
  if (
5309
- originalMap &&
5329
+ originalPath &&
5310
5330
  originalTokens.some(
5311
5331
  (token, index) =>
5312
5332
  token === 'module' &&
@@ -5314,26 +5334,26 @@ export function writeSwiftProject(
5314
5334
  originalTokens[index + 1] === `${moduleName}.Swift`),
5315
5335
  )
5316
5336
  ) {
5317
- nativeHeaderFlags.push('-fmodule-map-file=' + path.join(layout.root, originalMap))
5337
+ nativeHeaderFlags.push('-fmodule-map-file=' + originalPath)
5338
+ nativeSwiftHeaderMaps.set(name, originalPath)
5318
5339
  continue
5319
5340
  }
5320
5341
  files.set(
5321
5342
  modulemap,
5322
- originalMap
5323
- ? `extern module ${moduleName} ${JSON.stringify(path.join(layout.root, originalMap))}\nmodule ${moduleName}.Swift {\n header ${JSON.stringify(path.join(headerDirectory, name + '-Swift.h'))}\n requires objc\n}\n`
5343
+ originalPath
5344
+ ? `extern module ${moduleName} ${JSON.stringify(originalPath)}\nmodule ${moduleName}.Swift {\n header ${JSON.stringify(path.join(headerDirectory, name + '-Swift.h'))}\n requires objc\n}\n`
5324
5345
  : swiftObjCModuleMap(
5325
5346
  moduleName,
5326
- [
5327
- ...(
5328
- input.nativeTargets?.find((target) => target.name === name)
5329
- ?.publicHeaders ?? []
5330
- ).map((header) => path.join(layout.root, header)),
5331
- path.join(headerDirectory, name + '-Swift.h'),
5332
- ],
5347
+ (
5348
+ input.nativeTargets?.find((target) => target.name === name)
5349
+ ?.publicHeaders ?? []
5350
+ ).map((header) => path.join(layout.root, header)),
5333
5351
  submoduleImports.get(moduleName),
5352
+ path.join(headerDirectory, name + '-Swift.h'),
5334
5353
  ),
5335
5354
  )
5336
5355
  nativeHeaderFlags.push('-fmodule-map-file=' + modulemap)
5356
+ nativeSwiftHeaderMaps.set(name, modulemap)
5337
5357
  }
5338
5358
  // swiftpm plans a build root's build once and reuses the plan until a
5339
5359
  // manifest changes, so a file added to the module would never compile
@@ -5788,6 +5808,7 @@ export function writeSwiftProject(
5788
5808
  nativeFlags,
5789
5809
  nativeImportFlags,
5790
5810
  nativeHeaderFlags,
5811
+ nativeSwiftHeaderMaps,
5791
5812
  nativeHeaderDeclarations,
5792
5813
  objcImplementationModules: new Set(
5793
5814
  targets
@@ -5974,31 +5995,30 @@ export function writeSwiftProject(
5974
5995
  ),
5975
5996
  ]),
5976
5997
  )
5998
+ const producerSet = new Set([...Object.keys(nativeHeaderDeclarations), ...producers])
5999
+ const orderedProducers: string[] = []
5977
6000
  const included = new Set<string>()
5978
6001
  const include = (name: string): void => {
5979
6002
  if (included.has(name)) return
5980
6003
  included.add(name)
5981
6004
  for (const dependency of dependencies.get(name) ?? []) include(dependency)
6005
+ if (producerSet.has(name)) orderedProducers.push(name)
5982
6006
  }
5983
- for (const producer of producers)
6007
+ for (const producer of producerSet)
5984
6008
  for (const dependency of dependencies.get(producer) ?? []) include(dependency)
5985
- // building a producer also emits its dependency producers' headers.
6009
+ const needsHeaderStages = [...producerSet].some((name) => included.has(name))
6010
+ for (const producer of producerSet) include(producer)
5986
6011
  return {
5987
6012
  nativeBuildTargets: [...native].flatMap(([name, plan]) => [
5988
6013
  ...(!plan.mixed && plan.sources.length > 0 ? [name] : []),
5989
6014
  ...(plan.groups?.map((group) => group.name) ?? (plan.late ? [plan.late.name] : [])),
5990
6015
  ]),
5991
- headerProducers: [
5992
- ...new Set([
5993
- ...Object.keys(nativeHeaderDeclarations),
5994
- ...producers.filter((name) => !included.has(name)),
5995
- ]),
5996
- ],
6016
+ headerProducers: orderedProducers,
5997
6017
  emittedHeaderProducers: [
5998
6018
  ...new Set([...Object.keys(nativeHeaderDeclarations), ...producers]),
5999
6019
  ],
6000
6020
  nativeHeaderDeclarations,
6001
- headerProductTarget,
6021
+ headerProductTarget: needsHeaderStages ? undefined : headerProductTarget,
6002
6022
  targetFailures,
6003
6023
  generatedOwners,
6004
6024
  targetToolset,
@@ -49,6 +49,7 @@ export function swiftObjCModuleMap(
49
49
  module: string,
50
50
  headers: readonly string[],
51
51
  submodules: ReadonlySet<string> = new Set(),
52
+ swiftHeader?: string,
52
53
  ): string {
53
54
  const header = (file: string) => `header ${JSON.stringify(file)}`
54
55
  const stem = (file: string) =>
@@ -60,6 +61,9 @@ export function swiftObjCModuleMap(
60
61
  ? ` module ${stem(file)} { ${header(file)} export * }`
61
62
  : ` ${header(file)}`,
62
63
  ),
64
+ ...(swiftHeader
65
+ ? [' module Swift {', ` ${header(swiftHeader)}`, ' requires objc', ' }']
66
+ : []),
63
67
  ' export *',
64
68
  '}',
65
69
  '',