peachsim 0.1.2742 → 0.1.2744

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 (126) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +2 -2
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +5 -5
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +3 -3
  13. package/dist-lib/bundle-channel.cjs +137 -119
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +3 -3
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +3 -3
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +2 -2
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +7 -7
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +5 -5
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-I6YLE7RH.mjs → acorn-3G2P6SLD.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-YQSNOLNM.mjs → chunk-2XVKKP7C.mjs} +1 -1
  28. package/dist-lib/esm-chunks/{chunk-RC3JQV7D.mjs → chunk-3N3NWKOV.mjs} +1 -1
  29. package/dist-lib/esm-chunks/{chunk-GMFZTGVJ.mjs → chunk-3R76QB7G.mjs} +6 -6
  30. package/dist-lib/esm-chunks/{chunk-OXFGIZC4.mjs → chunk-4BSH2PJJ.mjs} +2 -2
  31. package/dist-lib/esm-chunks/{chunk-VWRLBFID.mjs → chunk-4J7M5ABU.mjs} +1 -1
  32. package/dist-lib/esm-chunks/{chunk-QDTQYGJB.mjs → chunk-4SL6WT5R.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-CFPPESX7.mjs → chunk-5EMHE44C.mjs} +1 -1
  34. package/dist-lib/esm-chunks/{chunk-4CNYVYQW.mjs → chunk-6HF6522F.mjs} +4 -4
  35. package/dist-lib/esm-chunks/{chunk-MHRTZ6I7.mjs → chunk-7PZCYBRZ.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-FKC5RBXR.mjs → chunk-CWTZZ5PW.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-Y4Q3W36I.mjs → chunk-EP64ATYX.mjs} +6 -6
  38. package/dist-lib/esm-chunks/{chunk-PLXC42XF.mjs → chunk-ESGH55PU.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-NWGCI4JC.mjs → chunk-FZCF4XKV.mjs} +3 -3
  40. package/dist-lib/esm-chunks/{chunk-VH5KY2GM.mjs → chunk-MHWKZ233.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-IVVVYJKG.mjs → chunk-MK5GDI4J.mjs} +1 -1
  42. package/dist-lib/esm-chunks/{chunk-6LMI5DE3.mjs → chunk-NA3WRJON.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-MXADGMSE.mjs → chunk-OYGAP4IB.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-U262IRGM.mjs → chunk-Q3AUIPF2.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-2SC45KUK.mjs → chunk-QNMAUXAH.mjs} +145 -127
  46. package/dist-lib/esm-chunks/{chunk-G44GUBAL.mjs → chunk-SI55AJTD.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-HJBL2ND3.mjs → chunk-U6INDDV4.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-GPVGYC45.mjs → chunk-V6QXWGYS.mjs} +1 -1
  49. package/dist-lib/esm-chunks/{chunk-ZRA35GYC.mjs → chunk-XRGF7PWG.mjs} +5 -5
  50. package/dist-lib/esm-chunks/{chunk-6QTRZNLH.mjs → chunk-YPT6XQJX.mjs} +1 -1
  51. package/dist-lib/esm-chunks/{metro-layout-parser-QGTUKU6T.mjs → metro-layout-parser-IISMSHQ6.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-M2IXDM7B.mjs → swift-package-prebuilt-VA4DWCFB.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-4KYBNEBW.mjs → swift-sdk-app-module-3UUKIQI6.mjs} +16 -16
  54. package/dist-lib/esm-chunks/{swift-sdk-image-Z37PPINV.mjs → swift-sdk-image-XJURAHAQ.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-7KFCU6Y6.mjs → swift-sdk-image-producer-HF3NTKWX.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +137 -119
  57. package/dist-lib/expo-swift-metadata.cjs +1 -1
  58. package/dist-lib/expo-swift-metadata.mjs +7 -7
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +160 -143
  61. package/dist-lib/host/fetch-proxy-handler.cjs +5 -5
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +1 -1
  67. package/dist-lib/kotlin-host.cjs +1 -1
  68. package/dist-lib/menu.cjs +1 -1
  69. package/dist-lib/menu.mjs +3 -3
  70. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  71. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  72. package/dist-lib/metro-production-bundle.cjs +1 -1
  73. package/dist-lib/metro-production-bundle.mjs +4 -4
  74. package/dist-lib/native-app-identity-project.cjs +1 -1
  75. package/dist-lib/native-app-identity-project.mjs +15 -15
  76. package/dist-lib/native-app-identity.cjs +1 -1
  77. package/dist-lib/native-app-identity.mjs +6 -6
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +3 -3
  80. package/dist-lib/pdfium-raster.cjs +1 -1
  81. package/dist-lib/pdfium-raster.mjs +2 -2
  82. package/dist-lib/plist.cjs +1 -1
  83. package/dist-lib/plist.mjs +3 -3
  84. package/dist-lib/profiles.cjs +1 -1
  85. package/dist-lib/public-brand.cjs +1 -1
  86. package/dist-lib/public-origins-lib-esm.json +85 -85
  87. package/dist-lib/public-origins-lib.json +64 -64
  88. package/dist-lib/react-native-host-modules.cjs +1 -1
  89. package/dist-lib/react-native-host-modules.mjs +2 -2
  90. package/dist-lib/reap-browser.cjs +1 -1
  91. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  92. package/dist-lib/sdk.cjs +1 -1
  93. package/dist-lib/sdk.mjs +8 -8
  94. package/dist-lib/skills.cjs +160 -143
  95. package/dist-lib/swift-compile.cjs +133 -115
  96. package/dist-lib/swift-compile.mjs +12 -12
  97. package/dist-lib/swift-package.cjs +1 -1
  98. package/dist-lib/swift-package.mjs +3 -3
  99. package/dist-lib/swift-submit.cjs +1 -1
  100. package/dist-lib/swift-submit.mjs +6 -6
  101. package/dist-lib/swift-svg-raster.cjs +1 -1
  102. package/dist-lib/swift-svg-raster.mjs +2 -2
  103. package/dist-lib/swift-toolchain.cjs +1 -1
  104. package/dist-lib/swift.cjs +1 -1
  105. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  106. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  108. package/dist-lib/vendor/acorn.cjs +1 -1
  109. package/dist-lib/vendor/magic-string.cjs +1 -1
  110. package/dist-lib/vendor/stream-json.cjs +1 -1
  111. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase.cjs +1 -1
  116. package/dist-lib/vendor/terser.cjs +1 -1
  117. package/dist-lib/vendor/valibot.cjs +1 -1
  118. package/dist-lib/vendor/ws.cjs +1 -1
  119. package/dist-lib/vendor/zod.cjs +1 -1
  120. package/dist-lib/worklet-executable.cjs +1 -1
  121. package/dist-lib/worklet-executable.mjs +3 -3
  122. package/dist-types/packages/peach-engine/src/engine/native-font-dataContract.d.ts +1 -0
  123. package/dist-types/packages/peach-kit/src/ui/hosting-safe-area.d.ts +17 -1
  124. package/package.json +1 -1
  125. package/src/one-direct-host-source.ts +23 -24
  126. package/src/swift-compile.ts +171 -152
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2742 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2744 | (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;
@@ -36019,7 +36019,7 @@ var init_swift_objc_sdk_tree = __esm({
36019
36019
 
36020
36020
  // src/swift-compiler-digest.ts
36021
36021
  function swiftArchiveCompilerDigestValue() {
36022
- return true ? "0793e59f1e3cdb2b823e46162b3112e01b180b07a4650b5e43a642bc3094d5ef" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
36022
+ return true ? "ef102649bb803fa4a669fab0435e2270e6dc7dc45669a03a377d6951f7daa35f" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
36023
36023
  }
36024
36024
  var import_node_crypto11, import_node_fs27, import_node_path25, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
36025
36025
  var init_swift_compiler_digest = __esm({
@@ -36170,7 +36170,7 @@ var init_swift_standin_digest = __esm({
36170
36170
 
36171
36171
  // src/expo-native-compiler-digest.ts
36172
36172
  function expoNativeCompilerDigestValue() {
36173
- return true ? "77bd2fbb160fc0dbe5d30a609cfd0c890697b189ef38b63db3c6003f98ae219e" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
36173
+ return true ? "32128bd460028ed060190bfde6d7773aef3938f8c132b90073f8f8fb3daabe41" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
36174
36174
  }
36175
36175
  var import_node_crypto13;
36176
36176
  var init_expo_native_compiler_digest = __esm({
@@ -80174,7 +80174,7 @@ function findTargetForFile(file, byDir, predicate) {
80174
80174
  }
80175
80175
  return void 0;
80176
80176
  }
80177
- function compiledSwiftSources(files2, targets, overlayFrameworks, headers, nativeSourceGlue = false) {
80177
+ function compiledSwiftSources(files2, targets, overlayFrameworks, headers) {
80178
80178
  const ordered = [...targets].sort((a, b) => b.path.length - a.path.length);
80179
80179
  const byDir = indexTargetsByDirectory(ordered);
80180
80180
  const excludeSets = /* @__PURE__ */ new Map();
@@ -80200,7 +80200,7 @@ function compiledSwiftSources(files2, targets, overlayFrameworks, headers, nativ
80200
80200
  const { onWasm, withoutWasm } = swiftTargetArchitectures(targets, swiftSources, headers);
80201
80201
  return new Map(
80202
80202
  [...owners].map(([file, { source, owner }]) => {
80203
- if (nativeSourceGlue && import_node_path84.default.posix.basename(file) === "OneNativeSource.generated.swift")
80203
+ if (import_node_path84.default.posix.basename(file) === "OneNativeSource.generated.swift")
80204
80204
  return [file, source];
80205
80205
  const manifest = /(?:^|\/)Package(?:@swift-[\d.]+)?\.swift$/.test(file);
80206
80206
  if (manifest && (!owner || /^Package(?:@swift-[\d.]+)?\.swift$/.test(file)))
@@ -81725,8 +81725,7 @@ module ${moduleName2}.Swift {
81725
81725
  ([file]) => /\.(?:h|hh|hpp)$/.test(file)
81726
81726
  );
81727
81727
  return headerFiles3.filter(([file]) => file.startsWith(`${directory2}/`)).map(([, contents2]) => contents2);
81728
- },
81729
- input.oneModule
81728
+ }
81730
81729
  );
81731
81730
  const libraryEntryFiles = /* @__PURE__ */ new Map();
81732
81731
  for (const target of [...targets]) {
@@ -82979,9 +82978,10 @@ function removeCaseCollidingModuleArtifacts(modulesDir, keep) {
82979
82978
  (0, import_node_fs84.rmSync)(import_node_path84.default.join(modulesDir, name3), { recursive: true, force: true });
82980
82979
  }
82981
82980
  }
82982
- function readFrameworkProductsReceipt(scratch2, receiptKey) {
82981
+ function readFrameworkProductsReceipt(scratch2, receiptKey, planChangedAt = 0n) {
82983
82982
  const receiptFile2 = import_node_path84.default.join(scratch2, "products-ready", `${receiptKey}.json`);
82984
- if (!(0, import_node_fs84.existsSync)(receiptFile2)) return null;
82983
+ const receiptStat = (0, import_node_fs84.statSync)(receiptFile2, { bigint: true, throwIfNoEntry: false });
82984
+ if (!receiptStat || receiptStat.mtimeNs < planChangedAt) return null;
82985
82985
  let parsed2;
82986
82986
  try {
82987
82987
  parsed2 = v6.parse(
@@ -83105,117 +83105,136 @@ async function buildFrameworkProducts(scratch2, args, allowWrite) {
83105
83105
  const unoptimized = args.input.unoptimized === true;
83106
83106
  const sdkOptions = swiftCompileSdkOptions(args.moduleRoot, args.toolchainBin);
83107
83107
  const selectorOptions = swiftObjCSelectorOptions(args.moduleRoot);
83108
- const receiptKey = (0, import_node_crypto51.createHash)("sha256").update(
83108
+ const receiptKeyFor = (products) => (0, import_node_crypto51.createHash)("sha256").update(
83109
83109
  JSON.stringify([
83110
83110
  "framework-products/v2",
83111
83111
  args.frameworkKey,
83112
83112
  unoptimized,
83113
83113
  args.sdk,
83114
83114
  args.toolchainBin,
83115
- [...linkedTargets.products].sort(),
83115
+ [...products].sort(),
83116
83116
  darwinRecordsMinimum(),
83117
83117
  args.plugins,
83118
83118
  sdkOptions,
83119
83119
  selectorOptions
83120
83120
  ])
83121
83121
  ).digest("hex").slice(0, 32);
83122
+ const receiptKey = receiptKeyFor(linkedTargets.products);
83122
83123
  const ready = readFrameworkProductsReceipt(scratch2, receiptKey);
83123
83124
  if (ready) return ready;
83124
83125
  if (!allowWrite) return;
83125
83126
  const linkRoot = import_node_path84.default.join(scratch2, "link");
83126
- writeFrameworkLinkPackage(linkRoot, args.moduleRoot, linkedTargets.products);
83127
- const frameworkTmp = import_node_path84.default.join(scratch2, "peach-compiler-tmp");
83128
- (0, import_node_fs84.mkdirSync)(frameworkTmp, { recursive: true });
83129
- const jobs = swiftCompilerJobs();
83130
- const targetJobs = jobs >= 4 ? 2 : 1;
83131
- const driverJobs = Math.max(1, Math.floor(jobs / targetJobs));
83132
- const cache = unoptimized ? null : prepareFrameworkCompileCache(
83127
+ const manifest = import_node_path84.default.join(linkRoot, "Package.swift");
83128
+ const manifestStat = (0, import_node_fs84.statSync)(manifest, { bigint: true, throwIfNoEntry: false });
83129
+ const planStat = (0, import_node_fs84.statSync)(import_node_path84.default.join(scratch2, "release.yaml"), {
83130
+ bigint: true,
83131
+ throwIfNoEntry: false
83132
+ });
83133
+ const builtProducts = manifestStat && planStat ? [
83134
+ ...(0, import_node_fs84.readFileSync)(manifest, "utf8").matchAll(
83135
+ /^\s*\.product\(name: "([^"]+)", package:/gm
83136
+ )
83137
+ ].map((match) => match[1]) : [];
83138
+ const reusePlan = manifestStat && planStat && linkedTargets.products.every((product) => builtProducts.includes(product)) && readFrameworkProductsReceipt(
83133
83139
  scratch2,
83134
- args.moduleRoot,
83135
- args.toolchainBin,
83136
- sdkOptions,
83137
- linkedTargets.products
83138
- );
83139
- await runCompiler(
83140
- args.swift,
83141
- [
83142
- "build",
83143
- ...swiftPackageCacheOptions(),
83144
- "--build-system",
83145
- "native",
83146
- "-j",
83147
- String(targetJobs),
83148
- "--package-path",
83149
- linkRoot,
83150
- "--scratch-path",
83140
+ receiptKeyFor(builtProducts),
83141
+ manifestStat.ctimeNs > planStat.ctimeNs ? manifestStat.ctimeNs : planStat.ctimeNs
83142
+ );
83143
+ if (!reusePlan) {
83144
+ writeFrameworkLinkPackage(linkRoot, args.moduleRoot, linkedTargets.products);
83145
+ const frameworkTmp = import_node_path84.default.join(scratch2, "peach-compiler-tmp");
83146
+ (0, import_node_fs84.mkdirSync)(frameworkTmp, { recursive: true });
83147
+ const jobs = swiftCompilerJobs();
83148
+ const targetJobs = jobs >= 4 ? 2 : 1;
83149
+ const driverJobs = Math.max(1, Math.floor(jobs / targetJobs));
83150
+ const cache = unoptimized ? null : prepareFrameworkCompileCache(
83151
83151
  scratch2,
83152
- "--target",
83153
- FRAMEWORK_LINK_TARGET,
83154
- ...sdkOptions,
83155
- ...selectorOptions,
83156
- "--swift-sdk",
83157
- args.sdk,
83158
- "-c",
83159
- "release",
83160
- ...cache ? ["-Xswiftc", "-driver-use-frontend-path", "-Xswiftc", cache.wrapper] : [],
83161
- "-Xswiftc",
83162
- unoptimized ? "-Onone" : "-Osize",
83163
- "-Xswiftc",
83164
- "-no-whole-module-optimization",
83165
- // optimized batches can move specialized definitions between object files.
83166
- ...unoptimized ? ["-Xswiftc", "-incremental"] : [],
83167
- "-Xswiftc",
83168
- "-enable-batch-mode",
83169
- // each batch repeats the same framework diagnostics.
83170
- ...unoptimized ? [] : ["-Xswiftc", "-suppress-warnings"],
83171
- "-Xswiftc",
83172
- "-j",
83173
- "-Xswiftc",
83174
- String(driverJobs),
83175
- // the release link strips all debug info, so none is generated.
83176
- "-Xswiftc",
83177
- "-gnone",
83178
- "-Xcc",
83179
- "-g0",
83180
- "-Xcxx",
83181
- "-g0",
83182
- "-Xswiftc",
83183
- "-num-threads",
83184
- "-Xswiftc",
83185
- "1",
83186
- ...swiftReproducibleBuildFlags([
83187
- [import_node_path84.default.dirname(args.toolchainBin), "toolchain"],
83188
- [args.moduleRoot, "framework"],
83189
- [scratch2, "framework-scratch"]
83190
- ]),
83191
- ...args.plugins.libraries.flatMap((plugin) => [
83152
+ args.moduleRoot,
83153
+ args.toolchainBin,
83154
+ sdkOptions,
83155
+ linkedTargets.products
83156
+ );
83157
+ await runCompiler(
83158
+ args.swift,
83159
+ [
83160
+ "build",
83161
+ ...swiftPackageCacheOptions(),
83162
+ "--build-system",
83163
+ "native",
83164
+ "-j",
83165
+ String(targetJobs),
83166
+ "--package-path",
83167
+ linkRoot,
83168
+ "--scratch-path",
83169
+ scratch2,
83170
+ "--target",
83171
+ FRAMEWORK_LINK_TARGET,
83172
+ ...sdkOptions,
83173
+ ...selectorOptions,
83174
+ "--swift-sdk",
83175
+ args.sdk,
83176
+ "-c",
83177
+ "release",
83178
+ ...cache ? ["-Xswiftc", "-driver-use-frontend-path", "-Xswiftc", cache.wrapper] : [],
83192
83179
  "-Xswiftc",
83193
- "-load-plugin-library",
83180
+ unoptimized ? "-Onone" : "-Osize",
83194
83181
  "-Xswiftc",
83195
- plugin
83196
- ]),
83197
- ...args.plugins.executables.flatMap((plugin) => [
83182
+ "-no-whole-module-optimization",
83183
+ // optimized batches can move specialized definitions between object files.
83184
+ ...unoptimized ? ["-Xswiftc", "-incremental"] : [],
83198
83185
  "-Xswiftc",
83199
- "-load-plugin-executable",
83186
+ "-enable-batch-mode",
83187
+ // each batch repeats the same framework diagnostics.
83188
+ ...unoptimized ? [] : ["-Xswiftc", "-suppress-warnings"],
83200
83189
  "-Xswiftc",
83201
- `${plugin}#ExpoModulesMacros`
83202
- ])
83203
- ],
83204
- // swiftpm hashes TMPDIR into its plan; keep one stable compiler scratch inside the locked slot.
83205
- // the framework build's warnings alone pass the default 1 MiB cap, which kills
83206
- // the build one step from the end.
83207
- {
83208
- ...args.buildOptions,
83209
- temporaryDirectory: frameworkTmp,
83210
- maxBuffer: 64 * 1024 * 1024
83211
- },
83212
- SWIFTPM_PROGRESS,
83213
- SWIFTPM_NOISE
83214
- ).catch((error) => {
83215
- throw new Error(outputOf(error), { cause: error });
83216
- }).finally(() => {
83217
- if (cache) reportFrameworkCompileCacheStats(scratch2, cache.statsFile);
83218
- });
83190
+ "-j",
83191
+ "-Xswiftc",
83192
+ String(driverJobs),
83193
+ // the release link strips all debug info, so none is generated.
83194
+ "-Xswiftc",
83195
+ "-gnone",
83196
+ "-Xcc",
83197
+ "-g0",
83198
+ "-Xcxx",
83199
+ "-g0",
83200
+ "-Xswiftc",
83201
+ "-num-threads",
83202
+ "-Xswiftc",
83203
+ "1",
83204
+ ...swiftReproducibleBuildFlags([
83205
+ [import_node_path84.default.dirname(args.toolchainBin), "toolchain"],
83206
+ [args.moduleRoot, "framework"],
83207
+ [scratch2, "framework-scratch"]
83208
+ ]),
83209
+ ...args.plugins.libraries.flatMap((plugin) => [
83210
+ "-Xswiftc",
83211
+ "-load-plugin-library",
83212
+ "-Xswiftc",
83213
+ plugin
83214
+ ]),
83215
+ ...args.plugins.executables.flatMap((plugin) => [
83216
+ "-Xswiftc",
83217
+ "-load-plugin-executable",
83218
+ "-Xswiftc",
83219
+ `${plugin}#ExpoModulesMacros`
83220
+ ])
83221
+ ],
83222
+ // swiftpm hashes TMPDIR into its plan; keep one stable compiler scratch inside the locked slot.
83223
+ // the framework build's warnings alone pass the default 1 MiB cap, which kills
83224
+ // the build one step from the end.
83225
+ {
83226
+ ...args.buildOptions,
83227
+ temporaryDirectory: frameworkTmp,
83228
+ maxBuffer: 64 * 1024 * 1024
83229
+ },
83230
+ SWIFTPM_PROGRESS,
83231
+ SWIFTPM_NOISE
83232
+ ).catch((error) => {
83233
+ throw new Error(outputOf(error), { cause: error });
83234
+ }).finally(() => {
83235
+ if (cache) reportFrameworkCompileCacheStats(scratch2, cache.statsFile);
83236
+ });
83237
+ }
83219
83238
  const release = import_node_path84.default.join(scratch2, WASM_TRIPLE, "release");
83220
83239
  const linked = frameworkLinkClosure(scratch2, linkedTargets.targets);
83221
83240
  const objects = linked.objects;
@@ -83372,17 +83391,7 @@ function swiftFrameworkSlotKey(slot) {
83372
83391
  function swiftFrameworkSlotRelease(slot) {
83373
83392
  return swiftFrameworkSlotRecord(slot, SWIFT_FRAMEWORK_SLOT_RELEASE);
83374
83393
  }
83375
- function swiftFrameworkSlotHasReceipt(slot) {
83376
- try {
83377
- return (0, import_node_fs84.readdirSync)(import_node_path84.default.join(slot, "products-ready")).some(
83378
- (entry) => entry.endsWith(".json")
83379
- );
83380
- } catch (error) {
83381
- if (vanished(error)) return false;
83382
- throw error;
83383
- }
83384
- }
83385
- async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal, work, unoptimized = false) {
83394
+ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal, work, unoptimized, linkOnly) {
83386
83395
  const slotCount = swiftFrameworkSlotCount(unoptimized);
83387
83396
  const slotsDir = swiftFrameworksDir(unoptimized);
83388
83397
  const slots = Array.from({ length: slotCount }, (_, index) => {
@@ -83399,8 +83408,12 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
83399
83408
  throw error;
83400
83409
  }
83401
83410
  };
83402
- const isRecentForeignReceipt = (slot, now) => !own2(slot) && swiftFrameworkSlotHasReceipt(slot) && now - slotMtimeMs(slot) < SWIFT_FRAMEWORK_HOT_RECEIPT_MS;
83403
- const trySlot = (slot, mode, logSelection, allowHotForeign = true) => {
83411
+ const handoffFile = (slot) => import_node_path84.default.join(slot, SWIFT_FRAMEWORK_SLOT_HANDOFF);
83412
+ const hasPendingForeignHandoff = (slot, now) => {
83413
+ const stamp = (0, import_node_fs84.statSync)(handoffFile(slot), { throwIfNoEntry: false });
83414
+ return stamp !== void 0 && !own2(slot) && now - stamp.mtimeMs < SWIFT_FRAMEWORK_HANDOFF_MS;
83415
+ };
83416
+ const trySlot = (slot, mode, logSelection, allowPendingHandoff = true) => {
83404
83417
  return withSwiftRootLock(
83405
83418
  slot,
83406
83419
  async (lease) => {
@@ -83408,7 +83421,7 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
83408
83421
  if (mode !== "restage" && !matches) return;
83409
83422
  const allowWrite = mode !== "reuse";
83410
83423
  if (allowWrite && await hasLiveSwiftRootReaders(slot, signal)) return;
83411
- if (mode === "restage" && !matches && !allowHotForeign && isRecentForeignReceipt(slot, Date.now()))
83424
+ if (mode === "restage" && !matches && !allowPendingHandoff && hasPendingForeignHandoff(slot, Date.now()))
83412
83425
  return;
83413
83426
  if (!matches) logSelection?.();
83414
83427
  if (mode === "extend")
@@ -83422,6 +83435,8 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
83422
83435
  `[swift-framework-cache] ${import_node_path84.default.basename(slot)} hit=products release=${release}`
83423
83436
  );
83424
83437
  const now = /* @__PURE__ */ new Date();
83438
+ if (linkOnly) (0, import_node_fs84.writeFileSync)(handoffFile(slot), "");
83439
+ else (0, import_node_fs84.rmSync)(handoffFile(slot), { force: true });
83425
83440
  (0, import_node_fs84.utimesSync)(slot, now, now);
83426
83441
  return { value };
83427
83442
  },
@@ -83475,8 +83490,8 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
83475
83490
  return { slot, index, tier: 3, changes: Infinity, own: false, mtimeMs };
83476
83491
  const changes = changedInputsFor(slot, slotKey);
83477
83492
  const isOwn = own2(slot);
83478
- const hotForeign = !isOwn && swiftFrameworkSlotHasReceipt(slot) && now - mtimeMs < SWIFT_FRAMEWORK_HOT_RECEIPT_MS;
83479
- return { slot, index, tier: hotForeign ? 2 : 0, changes, own: isOwn, mtimeMs };
83493
+ const tier = hasPendingForeignHandoff(slot, now) ? 2 : 0;
83494
+ return { slot, index, tier, changes, own: isOwn, mtimeMs };
83480
83495
  }).sort((left, right) => {
83481
83496
  if (left.tier !== right.tier) return left.tier - right.tier;
83482
83497
  if (left.tier === 0)
@@ -83602,6 +83617,7 @@ function stageFrameworkSource(moduleRoot, slot, frameworkKey, release) {
83602
83617
  if (hadKey !== frameworkKey) {
83603
83618
  (0, import_node_fs84.rmSync)(import_node_path84.default.join(slot, SWIFT_FRAMEWORK_SLOT_KEY), { force: true });
83604
83619
  (0, import_node_fs84.rmSync)(import_node_path84.default.join(slot, SWIFT_FRAMEWORK_SLOT_RELEASE), { force: true });
83620
+ (0, import_node_fs84.rmSync)(import_node_path84.default.join(slot, SWIFT_FRAMEWORK_SLOT_HANDOFF), { force: true });
83605
83621
  (0, import_node_fs84.rmSync)(import_node_path84.default.join(slot, "products-ready"), { recursive: true, force: true });
83606
83622
  (0, import_node_fs84.rmSync)(import_node_path84.default.join(slot, "products-lib"), { recursive: true, force: true });
83607
83623
  (0, import_node_fs84.rmSync)(import_node_path84.default.join(slot, "lib"), { recursive: true, force: true });
@@ -83953,7 +83969,8 @@ ${compatShape}` : "";
83953
83969
  moduleRoot,
83954
83970
  budget.signal,
83955
83971
  prepareFrameworks,
83956
- unoptimized
83972
+ unoptimized,
83973
+ options2.linkOnly === true
83957
83974
  );
83958
83975
  if (!frameworks)
83959
83976
  throw new Error("Swift distribution did not provide its frameworks");
@@ -84520,7 +84537,7 @@ ${compatShape}` : "";
84520
84537
  options2.signal
84521
84538
  );
84522
84539
  }
84523
- var import_node_child_process45, import_node_crypto51, import_node_fs84, import_node_os19, import_node_path84, import_promises12, v6, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, SWIFT_COMPILER_ENV_KEYS, SYSTEM_MODULE_LIBRARIES, SYSTEM_MODULE_IMPORT, lastPartition, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, availableModules, sdkOverlayFrameworks, DISTRIBUTION_CLANG_MODULES, CLANG_DISTRIBUTION_MODULES, ONE_PRODUCT, GAME_FAMILY, gameProducts, gameProduct, GAME_REACH, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, MODULE_MAP_RESPONSE_FILE_RUN, cFlagArray, cxxFlagArray, SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET, OS_IOS, ARCH_ARM64, NOT_ON_IOS, DELEGATE_CLASS, ARM64_MACRO, WASM_MACRO, ARCH_WASM32, C_WORDS, archEnvironments, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, cPredefineTable, cPredefineCache, HIDDEN_UNITS, FIRST_WINS_PAIRS, LAST_WINS_PAIRS, VALUE_FLAGS, LIBXML_REFERENCE, LIBXML_SOURCE, ROOT_LOCKS, host, rootLocks, SHARED_ARTIFACT_BUDGET_BYTES, SHARED_ARTIFACT_GRACE_MS, RETIRED_PREFIX, retainedArtifacts, FRAMEWORK_LINK_TARGET, frameworkProductsReceiptSchema, SWIFT_LINK_STAMP, SWIFT_HOST_COMPILER_WRAPPER, SWIFT_FRAMEWORK_SLOTS, SWIFT_FRAMEWORK_UNOPTIMIZED_SLOTS, SWIFT_FRAMEWORK_SLOT_KEY, SWIFT_FRAMEWORK_SLOT_ORIGIN, SWIFT_FRAMEWORK_SLOT_RELEASE, SWIFT_BUILD_ROOT_SLOTS, SWIFT_BUILD_ROOT_SHAPE, SWIFT_FRAMEWORK_HOT_RECEIPT_MS;
84540
+ var import_node_child_process45, import_node_crypto51, import_node_fs84, import_node_os19, import_node_path84, import_promises12, v6, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, SWIFT_COMPILER_ENV_KEYS, SYSTEM_MODULE_LIBRARIES, SYSTEM_MODULE_IMPORT, lastPartition, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, availableModules, sdkOverlayFrameworks, DISTRIBUTION_CLANG_MODULES, CLANG_DISTRIBUTION_MODULES, ONE_PRODUCT, GAME_FAMILY, gameProducts, gameProduct, GAME_REACH, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, MODULE_MAP_RESPONSE_FILE_RUN, cFlagArray, cxxFlagArray, SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET, OS_IOS, ARCH_ARM64, NOT_ON_IOS, DELEGATE_CLASS, ARM64_MACRO, WASM_MACRO, ARCH_WASM32, C_WORDS, archEnvironments, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, cPredefineTable, cPredefineCache, HIDDEN_UNITS, FIRST_WINS_PAIRS, LAST_WINS_PAIRS, VALUE_FLAGS, LIBXML_REFERENCE, LIBXML_SOURCE, ROOT_LOCKS, host, rootLocks, SHARED_ARTIFACT_BUDGET_BYTES, SHARED_ARTIFACT_GRACE_MS, RETIRED_PREFIX, retainedArtifacts, FRAMEWORK_LINK_TARGET, frameworkProductsReceiptSchema, SWIFT_LINK_STAMP, SWIFT_HOST_COMPILER_WRAPPER, SWIFT_FRAMEWORK_SLOTS, SWIFT_FRAMEWORK_UNOPTIMIZED_SLOTS, SWIFT_FRAMEWORK_SLOT_KEY, SWIFT_FRAMEWORK_SLOT_ORIGIN, SWIFT_FRAMEWORK_SLOT_RELEASE, SWIFT_FRAMEWORK_SLOT_HANDOFF, SWIFT_BUILD_ROOT_SLOTS, SWIFT_BUILD_ROOT_SHAPE, SWIFT_FRAMEWORK_HANDOFF_MS;
84524
84541
  var init_swift_compile = __esm({
84525
84542
  "src/swift-compile.ts"() {
84526
84543
  "use strict";
@@ -84754,7 +84771,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
84754
84771
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
84755
84772
  MULTI_MANIFEST_VERSION = 76;
84756
84773
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
84757
- compilerSourceDigest = true ? "07651c3448f918d1873b3ecc1d3db59948c7cbfdd917cd5b69da610a327f857a" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
84774
+ compilerSourceDigest = true ? "9e43b96f22759d18028120bf151aaa3545b4a68d9cb280a87e81051893e9eb50" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
84758
84775
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
84759
84776
  MODULE_MAP_RESPONSE_FILE_RUN = 16;
84760
84777
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
@@ -84860,9 +84877,10 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
84860
84877
  SWIFT_FRAMEWORK_SLOT_KEY = ".peach-framework-key";
84861
84878
  SWIFT_FRAMEWORK_SLOT_ORIGIN = ".peach-framework-origin";
84862
84879
  SWIFT_FRAMEWORK_SLOT_RELEASE = ".peach-framework-release";
84880
+ SWIFT_FRAMEWORK_SLOT_HANDOFF = ".peach-framework-handoff";
84863
84881
  SWIFT_BUILD_ROOT_SLOTS = 4;
84864
84882
  SWIFT_BUILD_ROOT_SHAPE = ".peach-build-shape";
84865
- SWIFT_FRAMEWORK_HOT_RECEIPT_MS = 15 * 60 * 1e3;
84883
+ SWIFT_FRAMEWORK_HANDOFF_MS = 15 * 60 * 1e3;
84866
84884
  }
84867
84885
  });
84868
84886
 
@@ -144576,19 +144594,10 @@ public final class PeachOneDirectStage: NSObject {
144576
144594
  }
144577
144595
  }
144578
144596
 
144579
- @objc public func attachHostView(_ view: UIView, frame: CGRect) {
144580
- if view.superview !== stageView {
144581
- view.removeFromSuperview()
144582
- stageView.addSubview(view)
144583
- }
144584
- if view.frame != frame {
144585
- view.frame = frame
144586
- }
144587
- }
144588
-
144589
144597
  @objc public func detachHostView(_ view: UIView) {
144598
+ let wasDirectHost = view._peachReactContentHost != nil
144590
144599
  view._peachReactContentHost = nil
144591
- if view.superview === stageView {
144600
+ if wasDirectHost {
144592
144601
  view.removeFromSuperview()
144593
144602
  }
144594
144603
  }
@@ -146433,6 +146442,7 @@ struct DirectContainerRecord {
146433
146442
  BOOL composed = NO;
146434
146443
  peach_node hostContentNode = 0;
146435
146444
  CGRect frame = CGRectZero;
146445
+ __weak UIView* hostParent = nil;
146436
146446
  };
146437
146447
 
146438
146448
  std::unordered_map<peach_node, DirectContainerRecord> gRecords;
@@ -146440,6 +146450,16 @@ std::unordered_map<peach_node, UIView*> gContentViews;
146440
146450
  std::unordered_map<peach_node, UIView*> gTriggerViews;
146441
146451
  peach_node gInPlaceTriggerNode = 0;
146442
146452
 
146453
+ UIView* contentViewForNode(peach_node node) {
146454
+ auto& slot = gContentViews[node];
146455
+ if (!slot) {
146456
+ slot = [[UIView alloc] initWithFrame:CGRectZero];
146457
+ slot.backgroundColor = UIColor.clearColor;
146458
+ [PeachOneDirectStage.shared tagContentView:slot node:node];
146459
+ }
146460
+ return slot;
146461
+ }
146462
+
146443
146463
  NSString* nsStringFromBytes(const char* ptr, uint32_t len) {
146444
146464
  if (!ptr || !len) return @"";
146445
146465
  return [[NSString alloc] initWithBytes:ptr length:len encoding:NSUTF8StringEncoding] ?: @"";
@@ -146541,6 +146561,7 @@ id<PeachContainer> makeContainer(NSString* kind, peach_node node, NSDictionary*
146541
146561
  it->second.hostView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, it->second.frame.size.width, it->second.frame.size.height)];
146542
146562
  }
146543
146563
  UIView* hostView = it->second.hostView;
146564
+ it->second.hostParent = nil;
146544
146565
  [PeachOneDirectStage.shared detachHostView:hostView];
146545
146566
  return hostView;
146546
146567
  }
@@ -146554,13 +146575,7 @@ id<PeachContainer> makeContainer(NSString* kind, peach_node node, NSDictionary*
146554
146575
  }
146555
146576
  return trigger;
146556
146577
  }
146557
- auto& slot = gContentViews[node];
146558
- if (!slot) {
146559
- slot = [[UIView alloc] initWithFrame:CGRectZero];
146560
- slot.backgroundColor = UIColor.clearColor;
146561
- [PeachOneDirectStage.shared tagContentView:slot node:node];
146562
- }
146563
- return slot;
146578
+ return contentViewForNode(node);
146564
146579
  }
146565
146580
 
146566
146581
  - (CGSize)layoutSizeForNode:(peach_node)node {
@@ -146737,13 +146752,16 @@ void peach_one_container_mount(uint32_t targetLo, uint32_t targetHi, uint32_t pa
146737
146752
  record.hostView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, w, h)];
146738
146753
  record.hostView.backgroundColor = UIColor.clearColor;
146739
146754
  }
146740
- UIView* stageView = PeachOneDirectStage.shared.stageView;
146741
- if (record.hostView.superview == nil || record.hostView.superview == stageView) {
146755
+ UIView* currentParent = record.hostView.superview;
146756
+ if (!currentParent || currentParent == record.hostParent) {
146757
+ UIView* parent = hostContentNode ? contentViewForNode(hostContentNode) : PeachOneDirectStage.shared.stageView;
146758
+ record.hostParent = parent;
146742
146759
  [PeachOneDirectStage.shared tagHostView:record.hostView
146743
146760
  node:node
146744
146761
  hostContentNode:hostContentNode];
146745
- [PeachOneDirectStage.shared attachHostView:record.hostView
146746
- frame:CGRectMake(0, 0, w, h)];
146762
+ if (currentParent != parent) [parent addSubview:record.hostView];
146763
+ const CGRect next = CGRectMake(0, 0, w, h);
146764
+ if (!CGRectEqualToRect(record.hostView.frame, next)) record.hostView.frame = next;
146747
146765
  } else {
146748
146766
  CGRect current = record.hostView.frame;
146749
146767
  current.size = CGSizeMake(w, h);
@@ -146777,8 +146795,7 @@ void peach_one_container_mount(uint32_t targetLo, uint32_t targetHi, uint32_t pa
146777
146795
 
146778
146796
  // bounds-only update after layout (never re-runs mountIn on PeachSwiftUI)
146779
146797
  if (!record.composed && record.hostView) {
146780
- UIView* stageView = PeachOneDirectStage.shared.stageView;
146781
- if (record.hostView.superview == stageView) {
146798
+ if (record.hostParent && record.hostView.superview == record.hostParent) {
146782
146799
  const CGRect next = CGRectMake(0, 0, w, h);
146783
146800
  if (!CGRectEqualToRect(record.hostView.frame, next)) {
146784
146801
  record.hostView.frame = next;
@@ -154691,7 +154708,7 @@ var init_nitro_superset = __esm({
154691
154708
  init_nitroContract();
154692
154709
  init_swift_standin_digest();
154693
154710
  NITRO_SUPERSET_ENTRY_NAME = "superset";
154694
- NITRO_COMPILER_DIGEST = true ? "044328c5350ebb809f06385360a8f8ac2ddc79127894cab52bbe62745e02eda8" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
154711
+ NITRO_COMPILER_DIGEST = true ? "bbe658f7e2c352f47d2e139b1ee4adb8b1944071676dd2de1401c6f637eaf9f6" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
154695
154712
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
154696
154713
  nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
154697
154714
  published3 = /* @__PURE__ */ new Map();