peachsim 0.1.2299 → 0.1.2301

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 (109) hide show
  1. package/cli/commands/control.ts +1 -0
  2. package/cli/commands/serve.ts +12 -3
  3. package/cli/commands/shell-url.ts +5 -0
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.cjs +1 -1
  6. package/dist-lib/attached-projects.cjs +1 -1
  7. package/dist-lib/auth/shared-session.cjs +1 -1
  8. package/dist-lib/backend-origin.cjs +1 -1
  9. package/dist-lib/beta.cjs +1 -1
  10. package/dist-lib/beta.mjs +1 -1
  11. package/dist-lib/bridge-constants.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.mjs +1 -1
  14. package/dist-lib/bridge-contract.cjs +1 -1
  15. package/dist-lib/bridge-contract.mjs +1 -1
  16. package/dist-lib/bundle-channel.cjs +413 -100
  17. package/dist-lib/capture-contract.cjs +1 -1
  18. package/dist-lib/capture-contract.mjs +1 -1
  19. package/dist-lib/cloud-contract.cjs +1 -1
  20. package/dist-lib/cloud-contract.mjs +1 -1
  21. package/dist-lib/cloud-test-args.cjs +1 -1
  22. package/dist-lib/cloud-test-args.mjs +1 -1
  23. package/dist-lib/cloud.cjs +1 -1
  24. package/dist-lib/cloud.mjs +1 -1
  25. package/dist-lib/config.cjs +1 -1
  26. package/dist-lib/config.mjs +1 -1
  27. package/dist-lib/detox/index.cjs +3 -2
  28. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  29. package/dist-lib/expo-swift-bundle.cjs +385 -93
  30. package/dist-lib/expo-swift-metadata.cjs +1 -1
  31. package/dist-lib/expo-swift-metadata.mjs +1 -1
  32. package/dist-lib/home-paths.cjs +1 -1
  33. package/dist-lib/host/bridge-host.cjs +2608 -102
  34. package/dist-lib/host/fetch-proxy-handler.cjs +6 -10
  35. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  36. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  37. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  38. package/dist-lib/host/websocket-proxy.cjs +1 -1
  39. package/dist-lib/index.cjs +68 -33
  40. package/dist-lib/jump-to-source-babel.cjs +1 -1
  41. package/dist-lib/jump-to-source-native.cjs +1 -1
  42. package/dist-lib/kotlin-host.cjs +1 -1
  43. package/dist-lib/menu.cjs +1 -1
  44. package/dist-lib/menu.mjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  46. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  47. package/dist-lib/metro-production-bundle.cjs +1 -1
  48. package/dist-lib/metro-production-bundle.mjs +1 -1
  49. package/dist-lib/metro.cjs +66 -32
  50. package/dist-lib/native-app-identity-project.cjs +49 -24
  51. package/dist-lib/native-app-identity-project.mjs +49 -24
  52. package/dist-lib/native-app-identity.cjs +1 -1
  53. package/dist-lib/native-app-identity.mjs +1 -1
  54. package/dist-lib/native-firebase-metadata.cjs +1 -1
  55. package/dist-lib/native-firebase-metadata.mjs +1 -1
  56. package/dist-lib/pdfium-raster.cjs +1 -1
  57. package/dist-lib/pdfium-raster.mjs +1 -1
  58. package/dist-lib/plist.cjs +1 -1
  59. package/dist-lib/plist.mjs +1 -1
  60. package/dist-lib/profiles.cjs +1 -1
  61. package/dist-lib/public-brand.cjs +1 -1
  62. package/dist-lib/public-origins-lib-esm.json +24 -24
  63. package/dist-lib/public-origins-lib.json +56 -53
  64. package/dist-lib/react-native-host-modules.cjs +1 -1
  65. package/dist-lib/react-native-host-modules.mjs +1 -1
  66. package/dist-lib/reap-browser.cjs +1 -1
  67. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  68. package/dist-lib/sdk.cjs +2 -1
  69. package/dist-lib/sdk.mjs +2 -1
  70. package/dist-lib/skills.cjs +481 -125
  71. package/dist-lib/swift-compile.cjs +40 -8
  72. package/dist-lib/swift-compile.mjs +40 -8
  73. package/dist-lib/swift-package.cjs +1 -1
  74. package/dist-lib/swift-package.mjs +1 -1
  75. package/dist-lib/swift-submit.cjs +1 -1
  76. package/dist-lib/swift-submit.mjs +1 -1
  77. package/dist-lib/swift-toolchain.cjs +1 -1
  78. package/dist-lib/swift.cjs +1 -1
  79. package/dist-lib/vite-swift.cjs +94 -37
  80. package/dist-lib/vite.cjs +12 -11
  81. package/dist-lib/worklet-executable.cjs +1 -1
  82. package/dist-lib/worklet-executable.mjs +1 -1
  83. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-gesture-handler.d.ts +3 -0
  84. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -0
  85. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +2 -0
  86. package/dist-types/packages/peach-engine/src/render-worker/activitykit-activityContract.d.ts +17 -0
  87. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +1 -0
  88. package/dist-types/packages/peach-engine/src/render-worker/gesture-arbitration-native.d.ts +124 -0
  89. package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +4 -0
  90. package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +3 -1
  91. package/dist-types/packages/peach-kit/src/transitions/screen-transition-math.d.ts +2 -2
  92. package/package.json +1 -1
  93. package/runtime-companion.json +1 -1
  94. package/src/bundle-channel.mjs +4 -3
  95. package/src/cli-runtime.ts +6 -0
  96. package/src/expo-discovery-cache.ts +6 -6
  97. package/src/expo-swift-host.ts +19 -4
  98. package/src/host/bridge-host.ts +9 -0
  99. package/src/launchMetadataContract.ts +1 -0
  100. package/src/native-firebase-config.ts +14 -0
  101. package/src/swift-compile.ts +28 -1
  102. package/src/swift-guest-compile.ts +19 -3
  103. package/src/swift-guest-source-plan.ts +7 -2
  104. package/src/swiftContract.ts +3 -0
  105. package/src/turbo-compile.ts +60 -4
  106. package/src/turbo-source.ts +239 -35
  107. package/src/vite-plugin-one.ts +3 -3
  108. package/src/widget-extension-bundle.ts +48 -0
  109. package/src/xcode-project.ts +67 -25
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2299 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2301 | (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;
@@ -5129,7 +5129,7 @@ var swiftCoverageProvenance;
5129
5129
  var init_provenance = __esm({
5130
5130
  "src/swift-coverage/provenance.ts"() {
5131
5131
  "use strict";
5132
- swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"bfde06f157f52d3dd76577b3c6059c95c0393180b054ced773624ea89558992b","swift-package.ts":"338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb","swift-source-file.ts":"93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94","swift-toolchain.ts":"b60efa4eb7516378344cb7c48216aea5fa36590ace91a698655b48cfd0db96fe","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1","xcode-project.ts":"b37f72dc848b4e2bc1ef1c875bd39c6085dc3e7038f03164102d3718c3dad217","xcode-target-members.ts":"2f25aaf5a3aa34395983c75935491c06bd68554c47ff1cb06b49c79499c03db0","xcode-json-project.ts":"41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6","openstep-plist.ts":"74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3"}') : swiftCoverageSourceDigests((0, import_node_path.join)(__sootsim_import_meta_dirname, ".."));
5132
+ swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"bfde06f157f52d3dd76577b3c6059c95c0393180b054ced773624ea89558992b","swift-package.ts":"338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb","swift-source-file.ts":"93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94","swift-toolchain.ts":"b60efa4eb7516378344cb7c48216aea5fa36590ace91a698655b48cfd0db96fe","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1","xcode-project.ts":"f0e86caccf203fa58395cbac9fed64577bb98a061efdf24f85a289c4e5996db9","xcode-target-members.ts":"2f25aaf5a3aa34395983c75935491c06bd68554c47ff1cb06b49c79499c03db0","xcode-json-project.ts":"41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6","openstep-plist.ts":"74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3"}') : swiftCoverageSourceDigests((0, import_node_path.join)(__sootsim_import_meta_dirname, ".."));
5133
5133
  }
5134
5134
  });
5135
5135
 
@@ -10663,8 +10663,8 @@ function developerDirs() {
10663
10663
  }
10664
10664
  return found;
10665
10665
  }
10666
- function readNativeSdk(developerDir) {
10667
- const env = { ...process.env, DEVELOPER_DIR: developerDir };
10666
+ function readNativeSdk(developerDir2) {
10667
+ const env = { ...process.env, DEVELOPER_DIR: developerDir2 };
10668
10668
  const xcrun = (args) => (
10669
10669
  // runner-toolchain-platform: darwin
10670
10670
  (0, import_node_child_process15.execFileSync)("xcrun", args, {
@@ -10703,19 +10703,19 @@ function nativeGraphMismatches(read) {
10703
10703
  function pinnedNativeSdk() {
10704
10704
  if (resolvedPinnedSdk) return resolvedPinnedSdk;
10705
10705
  let mismatches;
10706
- for (const developerDir of developerDirs()) {
10706
+ for (const developerDir2 of developerDirs()) {
10707
10707
  let read;
10708
10708
  try {
10709
- read = readNativeSdk(developerDir);
10709
+ read = readNativeSdk(developerDir2);
10710
10710
  } catch {
10711
10711
  continue;
10712
10712
  }
10713
10713
  if (read.sdk !== NATIVE_GRAPH_SDK_VERSION) continue;
10714
10714
  const differ = nativeGraphMismatches(read);
10715
10715
  if (differ.length === 0) {
10716
- process.env.DEVELOPER_DIR = developerDir;
10716
+ process.env.DEVELOPER_DIR = developerDir2;
10717
10717
  resolvedPinnedSdk = {
10718
- developerDir,
10718
+ developerDir: developerDir2,
10719
10719
  sdkPath: read.sdkPath,
10720
10720
  compiler: read.compiler
10721
10721
  };
@@ -16477,8 +16477,8 @@ function swiftPackageLinkage(target) {
16477
16477
  function guestSourceImages(graph) {
16478
16478
  const targets = new Map(graph.targets.map((target) => [target.id, target]));
16479
16479
  const entry = targets.get(graph.entry);
16480
- if (!entry || entry.productType !== "com.apple.product-type.application")
16481
- throw new Error("source graph has no application entry");
16480
+ if (!entry || entry.productType !== "com.apple.product-type.application" && entry.productType !== "com.apple.product-type.app-extension")
16481
+ throw new Error("source graph has no application or app extension entry");
16482
16482
  const images = [
16483
16483
  { id: 0, owner: entry.id, members: [] }
16484
16484
  ];
@@ -18991,6 +18991,12 @@ async function compileGuestLink(options) {
18991
18991
  (target) => target.productName.endsWith(".framework") ? [target.productName.slice(0, -10)] : []
18992
18992
  )
18993
18993
  );
18994
+ const sourceLibraries = new Set(
18995
+ options.graph.targets.flatMap((target) => {
18996
+ const library = /^lib(.+)\.(?:a|dylib)$/.exec(target.productName);
18997
+ return library ? [library[1]] : [];
18998
+ })
18999
+ );
18994
19000
  const entry = targets.get(options.graph.entry);
18995
19001
  if (!entry) throw new Error("guest source graph has no entry");
18996
19002
  const imageBuildVersion = (value) => {
@@ -19160,10 +19166,12 @@ async function compileGuestLink(options) {
19160
19166
  images: sourceImages.map((image) => ({
19161
19167
  id: image.id,
19162
19168
  objects: selectedSource.filter((artifact) => artifact.image === image.id).map((artifact) => artifact.path),
19163
- // a `-framework Name` for a framework the source graph builds links
19164
- // that framework's own image, which the plan already depends on
19169
+ // a `-framework Name` or `-lname` for a product the source graph
19170
+ // builds links that product's own target, which the plan already holds
19165
19171
  linkerFlags: image.members.flatMap((id) => targets.get(id).linkerFlags).filter(
19166
- (flag, index, flags) => !sourceFrameworks.has(flags[index - 1] === "-framework" ? flag : "") && !(flag === "-framework" && sourceFrameworks.has(flags[index + 1] ?? ""))
19172
+ (flag, index, flags) => !sourceFrameworks.has(flags[index - 1] === "-framework" ? flag : "") && !(flag === "-framework" && sourceFrameworks.has(flags[index + 1] ?? "")) && !sourceLibraries.has(
19173
+ flag.startsWith("-l") && flag.length > 2 ? flag.slice(2) : flags[index - 1] === "-l" ? flag : ""
19174
+ ) && !(flag === "-l" && sourceLibraries.has(flags[index + 1] ?? ""))
19167
19175
  ),
19168
19176
  clangLinkOptions: selectedSource.filter((artifact) => artifact.image === image.id).map((artifact) => ({
19169
19177
  object: import_node_path38.default.resolve(rewritten.get(artifact.path) ?? artifact.path),
@@ -24760,6 +24768,28 @@ function compileSwiftProjectOnce(input, options) {
24760
24768
  (0, import_node_fs49.rmSync)(linked, { force: true });
24761
24769
  report("compiling and linking Swift modules");
24762
24770
  const frameworkInterfaces = /* @__PURE__ */ new Map();
24771
+ const nativeDeclarations = /* @__PURE__ */ new Map();
24772
+ for (const [file, contents] of Object.entries(input.files)) {
24773
+ if (!file.endsWith(".modulemap")) continue;
24774
+ const name3 = moduleMapName(contents);
24775
+ const umbrella = /\bumbrella\s+header\s+"([^"]+)"/.exec(contents)?.[1];
24776
+ if (!name3 || !umbrella) continue;
24777
+ const header = input.files[import_node_path46.default.posix.join(import_node_path46.default.posix.dirname(file), umbrella)];
24778
+ if (header === void 0) continue;
24779
+ const included = new Set(
24780
+ [
24781
+ ...header.matchAll(/^\s*#\s*(?:import|include)\s*[<"]([^">]+)[">]/gm)
24782
+ ].map((match) => import_node_path46.default.posix.basename(match[1]))
24783
+ );
24784
+ const declarations = nativeDeclarations.get(name3) ?? /* @__PURE__ */ new Set();
24785
+ for (const declaration of swiftInterfaceDeclarations(header))
24786
+ declarations.add(declaration);
24787
+ for (const [candidate, source] of Object.entries(input.files))
24788
+ if (included.has(import_node_path46.default.posix.basename(candidate)))
24789
+ for (const declaration of swiftInterfaceDeclarations(source))
24790
+ declarations.add(declaration);
24791
+ nativeDeclarations.set(name3, declarations);
24792
+ }
24763
24793
  const frameworkInterface = (name3) => {
24764
24794
  if (frameworkInterfaces.has(name3)) return frameworkInterfaces.get(name3);
24765
24795
  const source = distribution ? import_node_path46.default.join(frameworkRoot, "modules", `${name3}-Swift.h`) : import_node_path46.default.join(
@@ -24787,10 +24817,12 @@ function compileSwiftProjectOnce(input, options) {
24787
24817
  ))
24788
24818
  declared.add(name4);
24789
24819
  }
24820
+ for (const declaration of nativeDeclarations.get(name3) ?? [])
24821
+ declared.add(declaration);
24790
24822
  const own = withoutSwiftDeclarations(
24791
24823
  clangInterfaceHeader((0, import_node_fs49.readFileSync)(source, "utf8")),
24792
24824
  declared,
24793
- `#import <${name3}/${name3}.h>`
24825
+ nativeDeclarations.has(name3) ? `@import ${name3};` : `#import <${name3}/${name3}.h>`
24794
24826
  );
24795
24827
  const owners = sdkObjCDeclarationOwners(import_node_path46.default.dirname(import_node_path46.default.dirname(headers)));
24796
24828
  const foreign = /* @__PURE__ */ new Map();
@@ -25238,7 +25270,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
25238
25270
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
25239
25271
  MULTI_MANIFEST_VERSION = 68;
25240
25272
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
25241
- compilerSourceDigest = true ? "0dc8ec5771fbb3c2f4e287a53570e9f15b27a2c933eb41530f414a37408c01d5" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
25273
+ compilerSourceDigest = true ? "ad311d7f868d4920f32f2ed00502f49f84fb83ae19817180a70ef5f799334169" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
25242
25274
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
25243
25275
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
25244
25276
  cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
@@ -27462,6 +27494,16 @@ function loadProject(xcodeproj) {
27462
27494
  loaded.set(projectFile, { digest: digest3, project: result });
27463
27495
  return result;
27464
27496
  }
27497
+ function selectedDeveloperDir() {
27498
+ developerDir ??= process.platform === "darwin" ? (
27499
+ // runner-toolchain-platform: darwin
27500
+ (0, import_node_child_process30.execFileSync)("xcode-select", ["-p"], {
27501
+ encoding: "utf8",
27502
+ stdio: ["ignore", "pipe", "pipe"]
27503
+ }).trim()
27504
+ ) : "";
27505
+ return developerDir;
27506
+ }
27465
27507
  function defaultConfiguration(project) {
27466
27508
  const configList = project.object(str(project.project.buildConfigurationList));
27467
27509
  const names = list(configList?.buildConfigurations).flatMap(
@@ -27528,15 +27570,8 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
27528
27570
  resolving.delete(marker);
27529
27571
  return value;
27530
27572
  };
27531
- let developerDir;
27532
27573
  const derivedSettings = {
27533
- DEVELOPER_DIR: () => options.environment?.DEVELOPER_DIR ?? process.env.DEVELOPER_DIR ?? (developerDir ??= process.platform === "darwin" ? (
27534
- // runner-toolchain-platform: darwin
27535
- (0, import_node_child_process30.execFileSync)("xcode-select", ["-p"], {
27536
- encoding: "utf8",
27537
- stdio: ["ignore", "pipe", "pipe"]
27538
- }).trim()
27539
- ) : ""),
27574
+ DEVELOPER_DIR: () => options.environment?.DEVELOPER_DIR ?? process.env.DEVELOPER_DIR ?? selectedDeveloperDir(),
27540
27575
  PRODUCT_NAME: () => get("TARGET_NAME"),
27541
27576
  PRODUCT_MODULE_NAME: () => applyOperator(get("PRODUCT_NAME"), "c99extidentifier"),
27542
27577
  EXECUTABLE_NAME: () => get("PRODUCT_NAME"),
@@ -28175,7 +28210,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
28175
28210
  options.installedPods
28176
28211
  );
28177
28212
  const allTargets = projects2.flatMap(projectTargets);
28178
- const appTargets = allTargets.filter((ref) => isIosAppTarget(ref, options));
28213
+ const appTargets = allTargets.filter(
28214
+ (ref) => isIosAppTarget(ref, options) || targetName !== void 0 && ref.target.name === targetName && ref.target.productType === APP_EXTENSION
28215
+ );
28179
28216
  const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
28180
28217
  const container = import_node_path50.default.basename(xcodeprojOrWorkspace);
28181
28218
  const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
@@ -28239,7 +28276,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
28239
28276
  const words2 = settingList(flags);
28240
28277
  const linked = new Set(linkedTargets(ref).map((link) => link.target));
28241
28278
  return words2.flatMap((word, index) => {
28242
- const target = words2[index - 1] === "-framework" ? byProduct.get(`${word}.framework`) : void 0;
28279
+ const library = word.startsWith("-l") && word.length > 2 ? word.slice(2) : words2[index - 1] === "-l" ? word : void 0;
28280
+ const target = words2[index - 1] === "-framework" ? byProduct.get(`${word}.framework`) : library ? byProduct.get(`lib${library}.a`) ?? byProduct.get(`lib${library}.dylib`) : void 0;
28243
28281
  if (!target || target === ref || linked.has(target)) return [];
28244
28282
  linked.add(target);
28245
28283
  return [{ target, attributes: [] }];
@@ -28267,7 +28305,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
28267
28305
  order.push(ref);
28268
28306
  };
28269
28307
  visit3(app);
28270
- const headerPhase = (ref) => list(ref.target.buildPhases).flatMap((phaseId) => {
28308
+ const headerPhases = /* @__PURE__ */ new Map();
28309
+ const headerPhase = (ref) => {
28310
+ const key2 = `${ref.project.xcodeproj}\0${ref.id}`;
28311
+ const cached2 = headerPhases.get(key2);
28312
+ if (cached2) return cached2;
28313
+ const files2 = readHeaderPhase(ref);
28314
+ headerPhases.set(key2, files2);
28315
+ return files2;
28316
+ };
28317
+ const readHeaderPhase = (ref) => list(ref.target.buildPhases).flatMap((phaseId) => {
28271
28318
  const phase = ref.project.object(phaseId);
28272
28319
  if (phase?.isa !== "PBXHeadersBuildPhase") return [];
28273
28320
  return list(phase.files).flatMap((id) => {
@@ -28284,6 +28331,23 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
28284
28331
  ];
28285
28332
  });
28286
28333
  });
28334
+ const projectNonFrameworkHeaders = /* @__PURE__ */ new Map();
28335
+ const nonFrameworkHeadersOf = (project) => {
28336
+ const cached2 = projectNonFrameworkHeaders.get(project);
28337
+ if (cached2) return cached2;
28338
+ const headers = /* @__PURE__ */ new Map();
28339
+ for (const other of projectTargets(project)) {
28340
+ if (FRAMEWORK_PRODUCTS.has(str(other.target.productType) ?? "")) continue;
28341
+ const otherProduct = productName(other);
28342
+ for (const { file, visibility } of headerPhase(other)) {
28343
+ if (visibility === "Project") continue;
28344
+ const key2 = `${otherProduct}/${import_node_path50.default.basename(file)}`;
28345
+ if (!headers.has(key2)) headers.set(key2, file);
28346
+ }
28347
+ }
28348
+ projectNonFrameworkHeaders.set(project, headers);
28349
+ return headers;
28350
+ };
28287
28351
  const productNames = /* @__PURE__ */ new Map();
28288
28352
  const productName = (ref) => {
28289
28353
  const key2 = `${ref.project.xcodeproj}\0${ref.id}`;
@@ -28516,16 +28580,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
28516
28580
  const qualified2 = `${product}/${name4}`;
28517
28581
  if (!ownHeaders.has(qualified2)) ownHeaders.set(qualified2, file);
28518
28582
  }
28519
- const nonFrameworkHeaders = /* @__PURE__ */ new Map();
28520
- for (const other of projectTargets(ref.project)) {
28521
- if (FRAMEWORK_PRODUCTS.has(str(other.target.productType) ?? "")) continue;
28522
- const otherProduct = productName(other);
28523
- for (const { file, visibility } of headerPhase(other)) {
28524
- if (visibility === "Project") continue;
28525
- const key2 = `${otherProduct}/${import_node_path50.default.basename(file)}`;
28526
- if (!nonFrameworkHeaders.has(key2)) nonFrameworkHeaders.set(key2, file);
28527
- }
28528
- }
28583
+ const nonFrameworkHeaders = nonFrameworkHeadersOf(ref.project);
28529
28584
  const wrapper = import_node_path50.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
28530
28585
  const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
28531
28586
  const frameworkUmbrella = !compatibility && framework && members2.sources.length > 0 && moduleMap ? import_node_path50.default.join(import_node_path50.default.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
@@ -29224,7 +29279,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
29224
29279
  cocoapods
29225
29280
  };
29226
29281
  }
29227
- var import_node_child_process30, import_node_crypto22, import_node_fs52, import_node_path50, import_plist2, XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET, runScriptTimeoutMs, CXX_STANDARD_ALIASES, PRE_CXX20_STANDARDS, APPLICATION, RESOURCE_BUNDLE, PRODUCT_MACH_O_TYPES, FRAMEWORK_PRODUCTS, HEADER_FILE, MODULE_PRODUCTS, CONDITIONS, isDirectory, loaded, preparedSourcePhases, isPodsProject, targetRefs, workspaceResolvedFile, SwiftPackageResolutionRequired;
29282
+ var import_node_child_process30, import_node_crypto22, import_node_fs52, import_node_path50, import_plist2, XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET, runScriptTimeoutMs, CXX_STANDARD_ALIASES, PRE_CXX20_STANDARDS, APPLICATION, APP_EXTENSION, RESOURCE_BUNDLE, PRODUCT_MACH_O_TYPES, FRAMEWORK_PRODUCTS, HEADER_FILE, MODULE_PRODUCTS, CONDITIONS, isDirectory, loaded, developerDir, preparedSourcePhases, isPodsProject, targetRefs, workspaceResolvedFile, SwiftPackageResolutionRequired;
29228
29283
  var init_xcode_project = __esm({
29229
29284
  "src/xcode-project.ts"() {
29230
29285
  "use strict";
@@ -29263,6 +29318,7 @@ var init_xcode_project = __esm({
29263
29318
  "compiler-default"
29264
29319
  ]);
29265
29320
  APPLICATION = "com.apple.product-type.application";
29321
+ APP_EXTENSION = "com.apple.product-type.app-extension";
29266
29322
  RESOURCE_BUNDLE = "com.apple.product-type.bundle";
29267
29323
  PRODUCT_MACH_O_TYPES = {
29268
29324
  "com.apple.product-type.application": "mh_execute",
@@ -29415,7 +29471,7 @@ var init_swift_standin_digest = __esm({
29415
29471
  STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
29416
29472
  SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
29417
29473
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
29418
- STANDIN_SOURCE_DIGEST = true ? "318c5e93a7c7c8e4ce1dbf748ec63c84273728043e6bafd140c6563890d717d0" : standinSourceDigest();
29474
+ STANDIN_SOURCE_DIGEST = true ? "7dd2fef3ceef6be07d22cfa2f397bda7721d34bc2ef8764f78e05b9637849f09" : standinSourceDigest();
29419
29475
  }
29420
29476
  });
29421
29477
 
@@ -42937,7 +42993,8 @@ async function collectTurboSources(options) {
42937
42993
  reactNative,
42938
42994
  sources: [],
42939
42995
  externalPodSources: [],
42940
- rendererSwiftTargets: []
42996
+ rendererSwiftTargets: [],
42997
+ fabricComponents: []
42941
42998
  };
42942
42999
  const sharedLibrary = [...options.installedPods?.values() ?? []].find(
42943
43000
  (pod) => pod.sharedLibrary
@@ -43384,6 +43441,9 @@ async function collectTurboSources(options) {
43384
43441
  };
43385
43442
  let objc = Boolean(options.reactNativeProvider);
43386
43443
  let fabric = Boolean(options.reactNativeProvider);
43444
+ const fabricPackages = /* @__PURE__ */ new Set();
43445
+ const fabricViews = [];
43446
+ let fabricTarget = null;
43387
43447
  let legacyBridge = false;
43388
43448
  let hermesHeaders = null;
43389
43449
  const objcClasses = /* @__PURE__ */ new Set();
@@ -43407,7 +43467,11 @@ async function collectTurboSources(options) {
43407
43467
  { tool: "cxx", flags: pod.installed.preprocessorFlags.cxx }
43408
43468
  ];
43409
43469
  const root = pod.root;
43410
- fabric ||= fabricComponents(provider.root);
43470
+ if (fabricComponents(provider.root)) {
43471
+ fabric = true;
43472
+ fabricPackages.add(provider.name);
43473
+ fabricTarget ??= { targetName, label, root: provider.root };
43474
+ }
43411
43475
  if (pod.installed?.library) {
43412
43476
  result.libraries ??= {};
43413
43477
  result.libraries[targetName] = import_node_fs84.default.readFileSync(pod.installed.library).toString("base64");
@@ -43680,6 +43744,17 @@ async function collectTurboSources(options) {
43680
43744
  const owned = /* @__PURE__ */ new Set();
43681
43745
  walkFiles2(generated, "", owned);
43682
43746
  const spec = codegenConfig.name;
43747
+ let definedComponentNames;
43748
+ const getDefinedComponentNames = () => {
43749
+ if (definedComponentNames) return definedComponentNames;
43750
+ definedComponentNames = /* @__PURE__ */ new Set();
43751
+ const pattern = /\b(?:const\s+char|char\s+const)\s+(\w+ComponentName)\s*\[\s*\]\s*=/g;
43752
+ for (const sourceFile of sources) {
43753
+ const text6 = readPackageFile(root, import_node_path81.default.join(root, sourceFile), Infinity).toString("utf8").replace(/\/\/[^\n]*/g, "");
43754
+ for (const match of text6.matchAll(pattern)) definedComponentNames.add(match[1]);
43755
+ }
43756
+ return definedComponentNames;
43757
+ };
43683
43758
  for (const file of [...owned].sort()) {
43684
43759
  const base = import_node_path81.default.posix.basename(file);
43685
43760
  const objcSpec = providerObjC && file.startsWith(`${spec}/`);
@@ -43701,7 +43776,32 @@ async function collectTurboSources(options) {
43701
43776
  relative: file
43702
43777
  }
43703
43778
  );
43704
- else original(targetName, "ReactCodegen", generated, file);
43779
+ else {
43780
+ if (component && base === "ShadowNodes.cpp") {
43781
+ const defined = getDefinedComponentNames();
43782
+ if (defined.size) {
43783
+ const source = readPackageFile(
43784
+ generated,
43785
+ import_node_path81.default.join(generated, file),
43786
+ Infinity
43787
+ ).toString("utf8");
43788
+ const filtered = source.replace(
43789
+ /^[ \t]*(?:extern[ \t]+)?(?:const[ \t]+char|char[ \t]+const)[ \t]+(\w+ComponentName)[ \t]*\[[ \t]*\][ \t]*=[^;]*;[ \t]*\r?\n?/gm,
43790
+ (line, name3) => defined.has(name3) ? "" : line
43791
+ );
43792
+ if (filtered !== source) {
43793
+ if (!/\b(?:const\s+char|char\s+const)\s+\w+ComponentName\s*\[\s*\]\s*=/.test(
43794
+ filtered
43795
+ ))
43796
+ continue;
43797
+ const key2 = original(targetName, "ReactCodegen", generated, file);
43798
+ result.files[key2] = filtered;
43799
+ continue;
43800
+ }
43801
+ }
43802
+ }
43803
+ original(targetName, "ReactCodegen", generated, file);
43804
+ }
43705
43805
  }
43706
43806
  }
43707
43807
  for (const file of sources) original(targetName, label, root, file);
@@ -43762,7 +43862,7 @@ ${declared.map((symbol2) => `extern "C" void ${symbol2}();
43762
43862
  add(`${core}/include/PeachJsiRuntime.hpp`, TURBO_RUNTIME_HEADER);
43763
43863
  add(
43764
43864
  `${core}/${TURBO_CORE_PUBLIC_HEADERS}/${TURBO_ENTRY_HEADER}`,
43765
- '#pragma once\nextern "C" void peachTurboInitialize();\n'
43865
+ '#pragma once\nextern "C" void peachTurboInitialize();\n// the +1 Fabric component view a root of the process shows, in an app with one\nextern "C" void *peach_fabric_view_content(int tag);\n'
43766
43866
  );
43767
43867
  add(
43768
43868
  `${core}/${TURBO_CORE_PUBLIC_HEADERS}/module.modulemap`,
@@ -43888,6 +43988,21 @@ ${declared.map((symbol2) => `extern "C" void ${symbol2}();
43888
43988
  original(TURBO_CORE_TARGET, "ReactCodegen", generated, "RCTModuleProviders.h")
43889
43989
  );
43890
43990
  }
43991
+ const thirdParty = import_node_path81.default.join(generated, "RCTThirdPartyComponentsProvider.mm");
43992
+ if (fabricPackages.size > 0 && import_node_fs84.default.existsSync(thirdParty)) {
43993
+ for (const [, name3, className2, owner] of import_node_fs84.default.readFileSync(thirdParty, "utf8").matchAll(/@"([^"]+)": NSClassFromString\(@"([^"]+)"\), \/\/ (\S+)/g))
43994
+ if (fabricPackages.has(owner))
43995
+ fabricViews.push({ name: name3, className: className2 });
43996
+ }
43997
+ if (fabricViews.length > 0 && fabricTarget) {
43998
+ result.fabricComponents = fabricViews.map(({ name: name3 }) => name3);
43999
+ const unit2 = `${targetPath(fabricTarget.targetName)}/PeachFabricHost.mm`;
44000
+ add(unit2, fabricHostSource(fabricViews));
44001
+ scanText(
44002
+ { key: unit2, ...fabricTarget, relative: "PeachFabricHost.mm" },
44003
+ result.files[unit2]
44004
+ );
44005
+ }
43891
44006
  }
43892
44007
  if (fabric || legacyBridge) {
43893
44008
  if (legacyBridge) {
@@ -44231,38 +44346,6 @@ void dispatchToJSThread(dispatch_block_t block) {
44231
44346
  }
44232
44347
  } // namespace
44233
44348
 
44234
- static CGFloat peachScreenBrightness = 0.5;
44235
-
44236
- @implementation UIScreen (PeachTurboRuntime)
44237
- + (UIScreen *)mainScreen {
44238
- static UIScreen *screen = nil;
44239
- if (!screen) screen = [[UIScreen alloc] init];
44240
- return screen;
44241
- }
44242
- - (CGFloat)brightness {
44243
- return peachScreenBrightness;
44244
- }
44245
- - (void)setBrightness:(CGFloat)value {
44246
- peachScreenBrightness = value;
44247
- }
44248
- @end
44249
-
44250
- static BOOL peachIdleTimerDisabled = NO;
44251
-
44252
- @implementation UIApplication (PeachTurboRuntime)
44253
- + (UIApplication *)sharedApplication {
44254
- static UIApplication *app = nil;
44255
- if (!app) app = [[UIApplication alloc] init];
44256
- return app;
44257
- }
44258
- - (BOOL)isIdleTimerDisabled {
44259
- return peachIdleTimerDisabled;
44260
- }
44261
- - (void)setIdleTimerDisabled:(BOOL)disabled {
44262
- peachIdleTimerDisabled = disabled;
44263
- }
44264
- @end
44265
-
44266
44349
  // React Native's own modules register before any provider's, and RCTBridge.mm
44267
44350
  // creates the registry's queue in the first RCTRegisterModule. the engine
44268
44351
  // supplies those modules, so a process whose providers register none (codegen
@@ -44379,6 +44462,12 @@ ${moduleProviders ? `- (id<RCTModuleProvider>)getModuleProvider:(const char *)na
44379
44462
 
44380
44463
  @end
44381
44464
 
44465
+ // an app's Fabric component views, which its own Fabric host defines
44466
+ extern "C" void peachInstallFabricViews(facebook::jsi::Runtime &runtime) __attribute__((weak));
44467
+
44468
+ // UIKitCore: the key window and root view controller an app delegate makes at launch
44469
+ extern "C" void PeachLaunchReactNativeWindow(void);
44470
+
44382
44471
  extern "C" void peachTurboInitialize() {
44383
44472
  objc_create_block_classes_as_subclasses_of([NSObject class]);
44384
44473
  if (Class blockClass = NSClassFromString(@"_NSBlock")) {
@@ -44392,6 +44481,7 @@ extern "C" void peachTurboInitialize() {
44392
44481
  static_cast<uint32_t *>((__bridge void *)mainQueueClass)[4] &= ~2048u;
44393
44482
  *reinterpret_cast<void **>(&_dispatch_main_q) = (__bridge void *)mainQueueClass;
44394
44483
  }
44484
+ PeachLaunchReactNativeWindow();
44395
44485
  auto& runtime = peach::jsi_runtime::create(
44396
44486
  [] { invoker->drain(); },
44397
44487
  [] {
@@ -44452,6 +44542,7 @@ ${bridgeProxy ? ` // as RCTInstance does: the proxy modules reach as their brid
44452
44542
  }];
44453
44543
  [decorator.moduleRegistry setTurboModuleRegistry:manager];
44454
44544
  [manager installJSBindings:runtime];
44545
+ if (peachInstallFabricViews) peachInstallFabricViews(runtime);
44455
44546
  }
44456
44547
 
44457
44548
  // the screenshot the device took, as UIKit posts it to every observer in the
@@ -44497,7 +44588,129 @@ ${moduleProviders ? " [found addObjectsFromArray:RCTModuleProviders.moduleProvi
44497
44588
  }
44498
44589
  `;
44499
44590
  }
44500
- var import_node_child_process45, import_node_crypto43, import_node_fs84, import_node_path81, import_node_util15, execFileAsync3, TURBO_CORE_TARGET, TURBO_FMT_TARGET, TURBO_ENTRY_HEADER, TURBO_CORE_PUBLIC_HEADERS, REGISTRATION, CODEGEN_OBJC, UNIT, HEADER3, OBJC2, OBJC_TURBO, OBJC_BRIDGE, OBJC_REGISTERED, REACT_NATIVE_UNITS, REACT_NATIVE_INCLUDE_ROOTS, REACT_NATIVE_OBJC_UNITS, REACT_NATIVE_OBJC_VERSIONED_UNITS, REACT_NATIVE_HEADER_DIRS, REACT_NATIVE_BARE_HEADER_DIRS, sha2564, versionParts, iosOf, JS_CALL_INVOKER;
44591
+ function fabricHostSource(views) {
44592
+ const entries = views.map(
44593
+ ({ name: name3, className: className2 }) => `@${JSON.stringify(name3)}: NSClassFromString(@${JSON.stringify(className2)})`
44594
+ ).join(", ");
44595
+ return `${FABRIC_HOST_INCLUDES}
44596
+ @interface PeachFabricComponents : NSObject <RCTComponentViewFactoryComponentProvider>
44597
+ @end
44598
+
44599
+ @implementation PeachFabricComponents
44600
+ - (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
44601
+ {
44602
+ return @{${entries}};
44603
+ }
44604
+ @end
44605
+
44606
+ namespace {
44607
+ struct PeachFabricView {
44608
+ react::ComponentHandle handle;
44609
+ const react::ComponentDescriptor *descriptor;
44610
+ react::Props::Shared props;
44611
+ react::LayoutMetrics layoutMetrics;
44612
+ };
44613
+ PeachFabricComponents *fabricComponents;
44614
+ RCTComponentViewRegistry *fabricRegistry;
44615
+ std::shared_ptr<const react::ContextContainer> fabricContext;
44616
+ react::ComponentDescriptorRegistry::Shared fabricDescriptors;
44617
+ std::unordered_map<int, PeachFabricView> fabricViews;
44618
+ int nextFabricView = 1;
44619
+ std::string fabricNames = ${JSON.stringify(views.map(({ name: name3 }) => name3).join("\n"))};
44620
+
44621
+ PeachFabricView &fabricView(int tag) {
44622
+ auto found = fabricViews.find(tag);
44623
+ if (found == fabricViews.end()) {
44624
+ std::fprintf(stderr, "no mounted Fabric view %d\\n", tag);
44625
+ std::abort();
44626
+ }
44627
+ return found->second;
44628
+ }
44629
+
44630
+ react::Props::Shared fabricCloneProps(jsi::Runtime &rt, const PeachFabricView &view, const jsi::Value &props) {
44631
+ react::PropsParserContext context{-1, *fabricContext};
44632
+ return view.descriptor->cloneProps(context, view.props, react::RawProps(rt, props));
44633
+ }
44634
+
44635
+ } // namespace
44636
+
44637
+ extern "C" void peachInstallFabricViews(jsi::Runtime &rt) {
44638
+ fabricComponents = [PeachFabricComponents new];
44639
+ RCTComponentViewFactory *factory = [RCTComponentViewFactory currentComponentViewFactory];
44640
+ factory.thirdPartyFabricComponentsProvider = fabricComponents;
44641
+ fabricRegistry = [RCTComponentViewRegistry new];
44642
+ fabricContext = std::make_shared<const react::ContextContainer>();
44643
+ react::ComponentDescriptorParameters parameters{{}, fabricContext, nullptr};
44644
+ fabricDescriptors = [factory createComponentDescriptorRegistryWithParameters:parameters];
44645
+ auto views = jsi::Object(rt);
44646
+ auto method = [&](const char *name, unsigned count, jsi::HostFunctionType body) {
44647
+ views.setProperty(rt, name, jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, name), count, std::move(body)));
44648
+ };
44649
+ // Create then Insert: the first props, no event emitter or state, and the
44650
+ // layout the view has before the engine measures it
44651
+ method("create", 2, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
44652
+ const auto &descriptor = fabricDescriptors->at(args[0].asString(rt).utf8(rt));
44653
+ int tag = nextFabricView++;
44654
+ auto &view = fabricViews.emplace(tag, PeachFabricView{descriptor.getComponentHandle(), &descriptor, nullptr, {}}).first->second;
44655
+ view.props = fabricCloneProps(rt, view, args[1]);
44656
+ UIView<RCTComponentViewProtocol> *componentView =
44657
+ [fabricRegistry dequeueComponentViewWithComponentHandle:view.handle tag:tag].view;
44658
+ [componentView updateProps:view.props oldProps:nullptr];
44659
+ [componentView updateEventEmitter:nullptr];
44660
+ [componentView updateState:nullptr oldState:nullptr];
44661
+ [componentView updateLayoutMetrics:view.layoutMetrics oldLayoutMetrics:react::EmptyLayoutMetrics];
44662
+ [componentView finalizeUpdates:RNComponentViewUpdateMaskAll];
44663
+ return jsi::Value(tag);
44664
+ });
44665
+ // Update with the props React changed since the last commit
44666
+ method("update", 2, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
44667
+ int tag = static_cast<int>(args[0].asNumber());
44668
+ auto &view = fabricView(tag);
44669
+ auto oldProps = view.props;
44670
+ view.props = fabricCloneProps(rt, view, args[1]);
44671
+ UIView<RCTComponentViewProtocol> *componentView = [fabricRegistry componentViewDescriptorWithTag:tag].view;
44672
+ [componentView updateProps:view.props oldProps:oldProps];
44673
+ [componentView finalizeUpdates:RNComponentViewUpdateMaskProps];
44674
+ return jsi::Value::undefined();
44675
+ });
44676
+ // Update with the size and scale the engine laid the view out at
44677
+ method("layout", 4, [](jsi::Runtime &, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
44678
+ int tag = static_cast<int>(args[0].asNumber());
44679
+ auto &view = fabricView(tag);
44680
+ auto metrics = view.layoutMetrics;
44681
+ metrics.frame = react::Rect{{0, 0}, {static_cast<react::Float>(args[1].asNumber()), static_cast<react::Float>(args[2].asNumber())}};
44682
+ metrics.pointScaleFactor = static_cast<react::Float>(args[3].asNumber());
44683
+ if (metrics == view.layoutMetrics) return jsi::Value::undefined();
44684
+ UIView<RCTComponentViewProtocol> *componentView = [fabricRegistry componentViewDescriptorWithTag:tag].view;
44685
+ [componentView updateLayoutMetrics:metrics oldLayoutMetrics:view.layoutMetrics];
44686
+ view.layoutMetrics = metrics;
44687
+ [componentView finalizeUpdates:RNComponentViewUpdateMaskLayoutMetrics];
44688
+ return jsi::Value::undefined();
44689
+ });
44690
+ // Remove then Delete: the registry recycles the view
44691
+ method("drop", 1, [](jsi::Runtime &, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
44692
+ int tag = static_cast<int>(args[0].asNumber());
44693
+ auto &view = fabricView(tag);
44694
+ RCTComponentViewDescriptor descriptor = [fabricRegistry componentViewDescriptorWithTag:tag];
44695
+ [descriptor.view removeFromSuperview];
44696
+ [fabricRegistry enqueueComponentViewWithComponentHandle:view.handle tag:tag componentViewDescriptor:descriptor];
44697
+ fabricViews.erase(tag);
44698
+ return jsi::Value::undefined();
44699
+ });
44700
+ rt.global().setProperty(rt, "peachFabricViews", std::move(views));
44701
+ }
44702
+
44703
+ extern "C" void *peach_fabric_view_content(int tag) {
44704
+ return (__bridge_retained void *)[fabricRegistry componentViewDescriptorWithTag:tag].view;
44705
+ }
44706
+
44707
+ // the component names the host registers as views, newline separated
44708
+ extern "C" __attribute__((export_name("peach_fabric_component_names"))) const char *peachFabricComponentNames() {
44709
+ return fabricNames.c_str();
44710
+ }
44711
+ `;
44712
+ }
44713
+ var import_node_child_process45, import_node_crypto43, import_node_fs84, import_node_path81, import_node_util15, execFileAsync3, TURBO_CORE_TARGET, TURBO_FMT_TARGET, TURBO_ENTRY_HEADER, TURBO_CORE_PUBLIC_HEADERS, REGISTRATION, CODEGEN_OBJC, UNIT, HEADER3, OBJC2, OBJC_TURBO, OBJC_BRIDGE, OBJC_REGISTERED, REACT_NATIVE_UNITS, REACT_NATIVE_INCLUDE_ROOTS, REACT_NATIVE_OBJC_UNITS, REACT_NATIVE_OBJC_VERSIONED_UNITS, REACT_NATIVE_HEADER_DIRS, REACT_NATIVE_BARE_HEADER_DIRS, sha2564, versionParts, iosOf, JS_CALL_INVOKER, FABRIC_HOST_INCLUDES;
44501
44714
  var init_turbo_source = __esm({
44502
44715
  "src/turbo-source.ts"() {
44503
44716
  "use strict";
@@ -44658,6 +44871,22 @@ class JsCallInvoker final : public react::CallInvoker {
44658
44871
  std::deque<react::CallFunc> pending;
44659
44872
  };
44660
44873
 
44874
+ `;
44875
+ FABRIC_HOST_INCLUDES = `#import <Foundation/Foundation.h>
44876
+ #import <React/RCTComponentViewFactory.h>
44877
+ #import <React/RCTComponentViewProtocol.h>
44878
+ #import <React/RCTComponentViewRegistry.h>
44879
+ #include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
44880
+ #include <react/renderer/core/LayoutMetrics.h>
44881
+ #include <react/renderer/core/PropsParserContext.h>
44882
+ #include <react/renderer/core/RawProps.h>
44883
+ #include <react/utils/ContextContainer.h>
44884
+ #include <cstdio>
44885
+ #include <cstdlib>
44886
+ #include <unordered_map>
44887
+ #include <jsi/jsi.h>
44888
+
44889
+ using namespace facebook;
44661
44890
  `;
44662
44891
  }
44663
44892
  });
@@ -44713,7 +44942,7 @@ function collectTurboCompileInput(collection, runtime, iosDeploymentTarget, depe
44713
44942
  dependencyTargets = dependencyTargets.filter(
44714
44943
  (_, index) => !providerNames.has(parsedTargets[index].name)
44715
44944
  );
44716
- const swift = Object.keys(files2).some((file) => file.endsWith(".swift"));
44945
+ const swift = collection.coreMode === "turbo" || Object.keys(files2).some((file) => file.endsWith(".swift"));
44717
44946
  const entry = `Sources/PeachTurboApp/main.${swift ? "swift" : "cpp"}`;
44718
44947
  const targetNames = targets.map(({ name: name3 }) => name3);
44719
44948
  const loadTargetNames = new Set(collection.loads.map(({ target }) => target));
@@ -44722,10 +44951,56 @@ function collectTurboCompileInput(collection, runtime, iosDeploymentTarget, depe
44722
44951
  (file) => file.startsWith(`${target.path}/`) && file.endsWith(".swift")
44723
44952
  )
44724
44953
  ).map(({ name: name3 }) => name3);
44725
- files2[entry] = swift ? "@_spi(Peach) import PeachFoundation\n" + swiftImportedTargetNames.map((target) => `import ${target}
44726
- `).join("") + `PeachHostDriver.installExecutor()
44727
- ${collection.loads.map(({ symbol: symbol2 }) => `${symbol2}()
44728
- `).join("")}${runtime ? "peachTurboInitialize()\n" : ""}` : [
44954
+ const initialize = [
44955
+ "_PeachReactNativeWindow.launch()",
44956
+ ...collection.loads.map(({ symbol: symbol2 }) => `${symbol2}()`),
44957
+ ...runtime ? ["peachTurboInitialize()"] : []
44958
+ ];
44959
+ const fabric = collection.fabricComponents.length > 0;
44960
+ files2[entry] = swift ? [
44961
+ "import SwiftUI",
44962
+ "import UIKit",
44963
+ "import PeachJSON",
44964
+ ...swiftImportedTargetNames.map((target) => `import ${target}`),
44965
+ "",
44966
+ "@main struct PeachTurboApp: PeachPackage {",
44967
+ ` init() { ${initialize.join("; ")} }`,
44968
+ ...fabric ? [
44969
+ " func view(props: JSON) -> PeachTurboRoot { PeachTurboRoot(props: props) }",
44970
+ "}",
44971
+ "",
44972
+ "struct PeachTurboRoot: View {",
44973
+ " let fabric: Int32?",
44974
+ "",
44975
+ " init(props: JSON) {",
44976
+ ' guard case .object(let fields) = props, let field = fields.first(where: { $0.0 == "fabric" }), case .number(let tag) = field.1 else {',
44977
+ " fabric = nil",
44978
+ " return",
44979
+ " }",
44980
+ " fabric = Int32(tag)",
44981
+ " }",
44982
+ "",
44983
+ " var body: some View {",
44984
+ " if let fabric { PeachFabricComponent(tag: fabric) } else { _PeachReactNativeWindow() }",
44985
+ " }",
44986
+ "}",
44987
+ "",
44988
+ "struct PeachFabricComponent: UIViewRepresentable {",
44989
+ " let tag: Int32",
44990
+ "",
44991
+ " func makeUIView(context: Context) -> UIView {",
44992
+ ' guard let view = peach_fabric_view_content(tag) else { fatalError("Fabric view \\(tag) is not mounted") }',
44993
+ " return Unmanaged<UIView>.fromOpaque(view).takeRetainedValue()",
44994
+ " }",
44995
+ "",
44996
+ " func updateUIView(_ view: UIView, context: Context) {}",
44997
+ "}"
44998
+ ] : [
44999
+ " func view(props: JSON) -> _PeachReactNativeWindow { _PeachReactNativeWindow() }",
45000
+ "}"
45001
+ ],
45002
+ ""
45003
+ ].join("\n") : [
44729
45004
  'extern "C" void peachTurboInitialize();',
44730
45005
  ...collection.loads.map(({ symbol: symbol2 }) => `extern "C" void ${symbol2}();`),
44731
45006
  "int main(int argc, char **argv) {",
@@ -45091,7 +45366,7 @@ var init_react_native_core = __esm({
45091
45366
  init_swift_distribution();
45092
45367
  init_swift_package();
45093
45368
  init_swiftContract();
45094
- recipe = true ? "f30840269a1f4be9434de5fb0adcd21490990ef2b55e4f3e6c159fcb6752a29d" : reactNativeCoreDigest2(__sootsim_import_meta_dirname);
45369
+ recipe = true ? "96416de7238919b274266f095ef4213211a2a26c133d0df7ab5e0459ded52ef1" : reactNativeCoreDigest2(__sootsim_import_meta_dirname);
45095
45370
  strings4 = (value) => isRecord(value) && Object.values(value).every((item) => typeof item === "string");
45096
45371
  building = /* @__PURE__ */ new Map();
45097
45372
  }
@@ -48994,6 +49269,15 @@ const result = JSON.stringify(getConfig(root, { skipSDKVersionRequirement: true
48994
49269
  if (Buffer.byteLength(result) > 1024 * 1024) throw new Error('Expo native configuration exceeds 1 MiB.');
48995
49270
  writeFileSync(process.argv[2], result, { mode: 0o600 });`;
48996
49271
  function hasExpoConfig(projectRoot) {
49272
+ const packagePath = import_node_path51.default.join(projectRoot, "package.json");
49273
+ const manifest = import_node_fs53.default.existsSync(packagePath) ? JSON.parse(import_node_fs53.default.readFileSync(packagePath, "utf8")) : null;
49274
+ if (isRecord(manifest)) {
49275
+ const dependencies = [manifest.dependencies, manifest.devDependencies].filter(
49276
+ isRecord
49277
+ );
49278
+ if (dependencies.some((deps) => "one" in deps) && !dependencies.some((deps) => "expo" in deps))
49279
+ return false;
49280
+ }
48997
49281
  const appJsonPath = import_node_path51.default.join(projectRoot, "app.json");
48998
49282
  const appJson = import_node_fs53.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs53.default.readFileSync(appJsonPath, "utf8")) : null;
48999
49283
  const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
@@ -50058,7 +50342,7 @@ async function expoDiscoveryKey(options) {
50058
50342
  const key2 = (0, import_node_crypto28.createHash)("sha256").update(`${peachPin()}\0${hash}\0`).update(`${stable2(JSON.parse(options.searchText))}\0`).update(`${stable2(options.configuration)}\0`).update(stable2(JSON.parse(options.resolveText))).digest("hex");
50059
50343
  return { key: key2, root };
50060
50344
  }
50061
- function sharedDir() {
50345
+ function expoDiscoveryCacheDir() {
50062
50346
  return import_node_path58.default.join(sharedCacheDir(import_node_path58.default.join(ambientHomeDir(), "cache")), "expo-discovery");
50063
50347
  }
50064
50348
  var EXPIRY_MS = 7 * 24 * 36e5;
@@ -50101,7 +50385,7 @@ function isStoredUnit(value) {
50101
50385
  }
50102
50386
  function readExpoDiscovery(key2) {
50103
50387
  let parsed;
50104
- const record2 = import_node_path58.default.join(sharedDir(), `${key2}.json`);
50388
+ const record2 = import_node_path58.default.join(expoDiscoveryCacheDir(), `${key2}.json`);
50105
50389
  try {
50106
50390
  parsed = JSON.parse(import_node_fs60.default.readFileSync(record2, "utf8"));
50107
50391
  } catch {
@@ -50130,7 +50414,7 @@ function readExpoDiscovery(key2) {
50130
50414
  const read = (digest3) => {
50131
50415
  const known = blobs.get(digest3);
50132
50416
  if (known !== void 0) return known;
50133
- const blob = import_node_path58.default.join(sharedDir(), "blobs", digest3);
50417
+ const blob = import_node_path58.default.join(expoDiscoveryCacheDir(), "blobs", digest3);
50134
50418
  const body = import_node_fs60.default.readFileSync(blob, "utf8");
50135
50419
  if ((0, import_node_crypto28.createHash)("sha256").update(body).digest("hex") !== digest3)
50136
50420
  throw new Error("discovery blob differs from its digest");
@@ -50178,7 +50462,7 @@ var fileHashes = /* @__PURE__ */ new Map();
50178
50462
  var fileHashesLoaded = false;
50179
50463
  var fileHashesChanged = false;
50180
50464
  function fileHashesPath() {
50181
- return import_node_path58.default.join(sharedDir(), "framework-file-hashes.json");
50465
+ return import_node_path58.default.join(expoDiscoveryCacheDir(), "framework-file-hashes.json");
50182
50466
  }
50183
50467
  function stampedFileHash(file) {
50184
50468
  if (!fileHashesLoaded) {
@@ -50357,7 +50641,7 @@ function rewritePreparedPaths(options) {
50357
50641
  frameworkDependencies[sourceDir] = sourceDigest;
50358
50642
  let portableDir = sourceDir;
50359
50643
  if (preparedDigest !== sourceDigest) {
50360
- const parent = import_node_path58.default.join(sharedDir(), "frameworks", preparedDigest);
50644
+ const parent = import_node_path58.default.join(expoDiscoveryCacheDir(), "frameworks", preparedDigest);
50361
50645
  portableDir = import_node_path58.default.join(parent, import_node_path58.default.basename(dir));
50362
50646
  if (!import_node_fs60.default.existsSync(portableDir)) {
50363
50647
  import_node_fs60.default.mkdirSync(parent, { recursive: true });
@@ -50388,7 +50672,7 @@ function rewritePreparedPaths(options) {
50388
50672
  }
50389
50673
  function writeExpoDiscovery(options) {
50390
50674
  try {
50391
- const dir = sharedDir();
50675
+ const dir = expoDiscoveryCacheDir();
50392
50676
  import_node_fs60.default.mkdirSync(dir, { recursive: true });
50393
50677
  const tmp = import_node_path58.default.join(dir, `.${options.key}.${process.pid}.${(0, import_node_crypto28.randomUUID)()}.tmp`);
50394
50678
  if (options.units === null) {
@@ -50562,7 +50846,7 @@ init_swift_native_pin();
50562
50846
  init_xcode_project();
50563
50847
  var EXPO_NATIVE_ENTRY_NAME = "ios";
50564
50848
  function expoNativeCompilerDigestValue() {
50565
- return true ? "3c8bd65a3c749594ba3fad51bc9caeee0a5bf0ac9e8c6e569e513ec366ee6554" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
50849
+ return true ? "064dc6aa590b7937e7499edee9ff07b0ef387a59a35ed48a2d820ab27209917a" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
50566
50850
  }
50567
50851
  var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
50568
50852
  function readSources(value) {
@@ -51510,7 +51794,9 @@ function installSwiftInputTrace() {
51510
51794
  import_node_path85.default.join(swiftCacheDir(), "swift-builds"),
51511
51795
  import_node_path85.default.join(swiftCacheDir(), "swift-sdk-views"),
51512
51796
  swiftRootLocksDir(),
51513
- import_node_path85.default.join(cacheDir(), "swift-tmp")
51797
+ import_node_path85.default.join(cacheDir(), "swift-tmp"),
51798
+ // content-addressed records whose reads renew their timestamps for expiry.
51799
+ expoDiscoveryCacheDir()
51514
51800
  ].filter((prefix, index, all) => all.indexOf(prefix) === index);
51515
51801
  ignoredRoots = prefixes.flatMap((root) => {
51516
51802
  try {
@@ -51616,11 +51902,13 @@ async function witnessMatches(witness) {
51616
51902
  return true;
51617
51903
  }
51618
51904
  async function discoveryKey(root, installedWorkspace, prepareNative, iosTarget, moduleRoot) {
51619
- const [config, expoConfig] = await Promise.all([
51905
+ const preparesWorkspace = prepareNative && !installedWorkspace && nativeWorkspaceAvailable();
51906
+ const [config, expoConfig, workspace] = await Promise.all([
51620
51907
  loadRNXAppConfig(resolveAppProject(root)),
51621
- readExpoConfigAsync(root)
51908
+ readExpoConfigAsync(root),
51909
+ preparesWorkspace ? traceStore.exit(() => hashExpoWorkspace(root)) : null
51622
51910
  ]);
51623
- return `${import_node_fs87.default.realpathSync(root)}\0${installedWorkspace ?? ""}\0${iosTarget ?? ""}\0${moduleRoot ?? ""}\0${prepareNative ? "1" : "0"}\0${JSON.stringify(config)}\0${JSON.stringify(expoConfig)}`;
51911
+ return `${import_node_fs87.default.realpathSync(root)}\0${installedWorkspace ?? ""}\0${iosTarget ?? ""}\0${moduleRoot ?? ""}\0${prepareNative ? "1" : "0"}\0${JSON.stringify(config)}\0${JSON.stringify(expoConfig)}\0${workspace?.hash ?? ""}`;
51624
51912
  }
51625
51913
  function cloneNativeTarget(target) {
51626
51914
  return {
@@ -52903,7 +53191,11 @@ function expoEntry(units, oneSDK = false) {
52903
53191
  (unit2) => Object.keys(unit2.files).some((file) => file.startsWith(`Sources/${namespace}/`))
52904
53192
  )
52905
53193
  );
52906
- const bridgeModules = units.flatMap((unit2) => unit2.bridgeModules);
53194
+ const bridgeModules = units.flatMap(
53195
+ (unit2) => unit2.bridgeModules.map(
53196
+ (registration) => registration === `${unit2.namespace}.__peachReactModule_${unit2.namespace}()` ? registration.slice(unit2.namespace.length + 1) : registration
53197
+ )
53198
+ );
52907
53199
  const subscribers = units.flatMap((unit2) => unit2.appDelegateSubscribers);
52908
53200
  const handlers = units.flatMap((unit2) => unit2.reactDelegateHandlers);
52909
53201
  const delegates = subscribers.length + handlers.length > 0 ? `; PeachExpoRuntime.registerDelegates(subscribers: [${subscribers.join(", ")}], handlers: [${handlers.join(", ")}])` : "";