peachsim 0.1.1879 → 0.1.1881

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 (83) 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 +1 -1
  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 +1 -1
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +1 -1
  13. package/dist-lib/bundle-channel.cjs +109 -54
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +1 -1
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +1 -1
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +1 -1
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +1 -1
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +1 -1
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +104 -51
  27. package/dist-lib/expo-swift-metadata.cjs +1 -1
  28. package/dist-lib/expo-swift-metadata.mjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +107 -52
  31. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +2 -2
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +1 -1
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +2 -2
  47. package/dist-lib/native-app-identity-project.cjs +2 -2
  48. package/dist-lib/native-app-identity-project.mjs +5 -2
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/pdfium-raster.cjs +1 -1
  54. package/dist-lib/pdfium-raster.mjs +1 -1
  55. package/dist-lib/plist.cjs +1 -1
  56. package/dist-lib/plist.mjs +1 -1
  57. package/dist-lib/profiles.cjs +1 -1
  58. package/dist-lib/public-brand.cjs +1 -1
  59. package/dist-lib/public-origins-lib-esm.json +24 -24
  60. package/dist-lib/public-origins-lib.json +53 -53
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/reap-browser.cjs +1 -1
  64. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  65. package/dist-lib/sdk.cjs +1 -1
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +109 -54
  68. package/dist-lib/swift-compile.cjs +97 -48
  69. package/dist-lib/swift-compile.mjs +100 -48
  70. package/dist-lib/swift-package.cjs +1 -1
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +1 -1
  73. package/dist-lib/swift-submit.mjs +1 -1
  74. package/dist-lib/swift-toolchain.cjs +1 -1
  75. package/dist-lib/swift.cjs +1 -1
  76. package/dist-lib/vite-swift.cjs +98 -49
  77. package/dist-lib/vite.cjs +1 -1
  78. package/dist-lib/worklet-executable.cjs +1 -1
  79. package/dist-lib/worklet-executable.mjs +1 -1
  80. package/package.json +1 -1
  81. package/src/expo-native-workspace.ts +4 -0
  82. package/src/swift-compile.ts +135 -64
  83. package/src/turbo-source.ts +4 -1
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1879 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1881 | (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;
@@ -50478,13 +50478,6 @@ function removeCaseCollidingModuleArtifacts(modulesDir, keep) {
50478
50478
  (0, import_node_fs43.rmSync)(import_node_path40.default.join(modulesDir, name3), { recursive: true, force: true });
50479
50479
  }
50480
50480
  }
50481
- async function compileFrameworkProducts(args) {
50482
- const scratch2 = swiftFrameworkScratch(args.frameworkKey);
50483
- (0, import_node_fs43.mkdirSync)(scratch2, { recursive: true });
50484
- const now = /* @__PURE__ */ new Date();
50485
- (0, import_node_fs43.utimesSync)(scratch2, now, now);
50486
- return buildFrameworkProducts(scratch2, args);
50487
- }
50488
50481
  async function buildFrameworkProducts(scratch2, args) {
50489
50482
  const linkedTargets = linkedFrameworkTargets(args.moduleRoot, args.input);
50490
50483
  const linkRoot = import_node_path40.default.join(scratch2, "link");
@@ -50607,30 +50600,97 @@ function swiftFrameworksDir() {
50607
50600
  function swiftFrameworkScratch(frameworkKey) {
50608
50601
  return import_node_path40.default.join(swiftFrameworksDir(), frameworkKey);
50609
50602
  }
50610
- function stageFrameworkSource(moduleRoot, frameworkKey) {
50611
- if (swiftDistributionAt(moduleRoot)) return moduleRoot;
50612
- const staged = import_node_path40.default.join(swiftFrameworkScratch(frameworkKey), "source");
50613
- const stagedModule = import_node_path40.default.join(staged, "packages", import_node_path40.default.basename(moduleRoot));
50614
- if ((0, import_node_fs43.existsSync)(import_node_path40.default.join(staged, ".complete"))) return stagedModule;
50615
- const partial = `${staged}.${(0, import_node_crypto19.randomUUID)()}`;
50616
- (0, import_node_fs43.mkdirSync)(partial, { recursive: true });
50617
- (0, import_node_fs43.cpSync)(moduleRoot, import_node_path40.default.join(partial, "packages", import_node_path40.default.basename(moduleRoot)), {
50618
- recursive: true,
50619
- preserveTimestamps: true,
50620
- filter: (source) => import_node_path40.default.relative(moduleRoot, source) !== ".build"
50603
+ function swiftFrameworkSlotKey(slot) {
50604
+ try {
50605
+ return (0, import_node_fs43.readFileSync)(import_node_path40.default.join(slot, SWIFT_FRAMEWORK_SLOT_KEY), "utf8").trim();
50606
+ } catch (error) {
50607
+ if (!vanished(error)) throw error;
50608
+ return null;
50609
+ }
50610
+ }
50611
+ async function withSwiftFrameworkSlot(frameworkKey, signal, work) {
50612
+ const slots = Array.from({ length: SWIFT_FRAMEWORK_SLOTS }, (_, index) => {
50613
+ const slot = import_node_path40.default.join(swiftFrameworksDir(), `slot-${index}`);
50614
+ (0, import_node_fs43.mkdirSync)(slot, { recursive: true });
50615
+ return slot;
50621
50616
  });
50622
- (0, import_node_fs43.cpSync)(
50623
- swiftSharedSdkRoot(moduleRoot, false),
50624
- import_node_path40.default.join(partial, "packages/peachsim/sdk/ios"),
50625
- { recursive: true, preserveTimestamps: true }
50626
- );
50627
- (0, import_node_fs43.symlinkSync)(
50628
- (0, import_node_fs43.realpathSync)(import_node_path40.default.join(moduleRoot, "../../node_modules")),
50629
- import_node_path40.default.join(partial, "node_modules")
50630
- );
50631
- (0, import_node_fs43.writeFileSync)(import_node_path40.default.join(partial, ".complete"), "");
50632
- (0, import_node_fs43.rmSync)(staged, { recursive: true, force: true });
50633
- (0, import_node_fs43.renameSync)(partial, staged);
50617
+ const run12 = (slot) => (lease) => {
50618
+ const now = /* @__PURE__ */ new Date();
50619
+ (0, import_node_fs43.utimesSync)(slot, now, now);
50620
+ return work(slot, lease);
50621
+ };
50622
+ const staged = slots.find((slot) => swiftFrameworkSlotKey(slot) === frameworkKey);
50623
+ if (staged) return withSwiftRootLock(staged, run12(staged), signal);
50624
+ const oldest = slots.sort(
50625
+ (left, right) => (0, import_node_fs43.statSync)(left).mtimeMs - (0, import_node_fs43.statSync)(right).mtimeMs
50626
+ );
50627
+ for (const slot of oldest) {
50628
+ const result = await withSwiftRootLock(
50629
+ slot,
50630
+ async (lease) => ({ value: await run12(slot)(lease) }),
50631
+ signal,
50632
+ false
50633
+ );
50634
+ if (result) return result.value;
50635
+ }
50636
+ return withSwiftRootLock(oldest[0], run12(oldest[0]), signal);
50637
+ }
50638
+ function mirrorTree2(source, target, skip) {
50639
+ (0, import_node_fs43.mkdirSync)(target, { recursive: true });
50640
+ const wanted = /* @__PURE__ */ new Set();
50641
+ for (const entry of (0, import_node_fs43.readdirSync)(source, { withFileTypes: true })) {
50642
+ if (entry.name === skip) continue;
50643
+ wanted.add(entry.name);
50644
+ const from = import_node_path40.default.join(source, entry.name);
50645
+ const to = import_node_path40.default.join(target, entry.name);
50646
+ let existing = null;
50647
+ try {
50648
+ existing = (0, import_node_fs43.lstatSync)(to);
50649
+ } catch (error) {
50650
+ if (!vanished(error)) throw error;
50651
+ }
50652
+ if (entry.isDirectory()) {
50653
+ if (existing && !existing.isDirectory()) (0, import_node_fs43.rmSync)(to, { force: true });
50654
+ mirrorTree2(from, to);
50655
+ } else if (entry.isSymbolicLink()) {
50656
+ const link = (0, import_node_fs43.readlinkSync)(from);
50657
+ if (existing?.isSymbolicLink() && (0, import_node_fs43.readlinkSync)(to) === link) continue;
50658
+ if (existing) (0, import_node_fs43.rmSync)(to, { recursive: true, force: true });
50659
+ (0, import_node_fs43.symlinkSync)(link, to);
50660
+ } else {
50661
+ const stat2 = (0, import_node_fs43.statSync)(from);
50662
+ if (existing?.isFile() && existing.size === stat2.size && (existing.mtimeMs === stat2.mtimeMs || (0, import_node_fs43.readFileSync)(from).equals((0, import_node_fs43.readFileSync)(to))))
50663
+ continue;
50664
+ if (existing) (0, import_node_fs43.rmSync)(to, { recursive: true, force: true });
50665
+ const partial = `${to}.${(0, import_node_crypto19.randomUUID)()}`;
50666
+ (0, import_node_fs43.copyFileSync)(from, partial);
50667
+ (0, import_node_fs43.utimesSync)(partial, stat2.atime, stat2.mtime);
50668
+ (0, import_node_fs43.renameSync)(partial, to);
50669
+ }
50670
+ }
50671
+ for (const name3 of (0, import_node_fs43.readdirSync)(target))
50672
+ if (!wanted.has(name3) && name3 !== skip)
50673
+ (0, import_node_fs43.rmSync)(import_node_path40.default.join(target, name3), { recursive: true, force: true });
50674
+ }
50675
+ function stageFrameworkSource(moduleRoot, slot, frameworkKey) {
50676
+ if (!slot) return moduleRoot;
50677
+ const staged = import_node_path40.default.join(slot, "source");
50678
+ const stagedModule = import_node_path40.default.join(staged, "packages", import_node_path40.default.basename(moduleRoot));
50679
+ if (swiftFrameworkSlotKey(slot) !== frameworkKey) {
50680
+ (0, import_node_fs43.rmSync)(import_node_path40.default.join(slot, SWIFT_FRAMEWORK_SLOT_KEY), { force: true });
50681
+ mirrorTree2(moduleRoot, stagedModule, ".build");
50682
+ mirrorTree2(
50683
+ swiftSharedSdkRoot(moduleRoot, false),
50684
+ import_node_path40.default.join(staged, "packages/peachsim/sdk/ios")
50685
+ );
50686
+ const modules = import_node_path40.default.join(staged, "node_modules");
50687
+ const target = (0, import_node_fs43.realpathSync)(import_node_path40.default.join(moduleRoot, "../../node_modules"));
50688
+ if (!(0, import_node_fs43.existsSync)(modules) || (0, import_node_fs43.readlinkSync)(modules) !== target) {
50689
+ (0, import_node_fs43.rmSync)(modules, { recursive: true, force: true });
50690
+ (0, import_node_fs43.symlinkSync)(target, modules);
50691
+ }
50692
+ (0, import_node_fs43.writeFileSync)(import_node_path40.default.join(slot, SWIFT_FRAMEWORK_SLOT_KEY), frameworkKey);
50693
+ }
50634
50694
  return stagedModule;
50635
50695
  }
50636
50696
  function swiftLinkStamp(args) {
@@ -50666,17 +50726,6 @@ ${args.prebuilt.modules}
50666
50726
  ${statOf(import_node_path40.default.join(args.prebuilt.modules, entry))}`);
50667
50727
  return hash.digest("hex");
50668
50728
  }
50669
- async function pruneFrameworkScratches(keep) {
50670
- const dir = swiftFrameworksDir();
50671
- const idle = (0, import_node_fs43.readdirSync)(dir).filter((name3) => name3 !== keep).map((name3) => ({ name: name3, modified: (0, import_node_fs43.statSync)(import_node_path40.default.join(dir, name3)).mtimeMs })).sort((left, right) => right.modified - left.modified).slice(SWIFT_FRAMEWORK_SCRATCHES_KEPT - 1);
50672
- for (const { name: name3 } of idle)
50673
- await withSwiftRootLock(
50674
- import_node_path40.default.join(dir, name3),
50675
- async () => (0, import_node_fs43.rmSync)(import_node_path40.default.join(dir, name3), { recursive: true, force: true }),
50676
- void 0,
50677
- false
50678
- );
50679
- }
50680
50729
  function retireStaleSwiftLink(root, stamp) {
50681
50730
  const receipt = import_node_path40.default.join(root, SWIFT_LINK_STAMP);
50682
50731
  let previous = null;
@@ -50805,9 +50854,9 @@ function compileSwiftProjectOnce(input, options) {
50805
50854
  );
50806
50855
  }
50807
50856
  const frameworkScratch = swiftFrameworkScratch(frameworkKey);
50808
- const withFrameworkLock = (work) => distribution ? work() : withSwiftRootLock(frameworkScratch, work, options.signal);
50809
- return withFrameworkLock(async (frameworkLease) => {
50810
- const frameworkRoot = stageFrameworkSource(moduleRoot, frameworkKey);
50857
+ const withFrameworkLock = (work) => distribution ? work(null) : withSwiftFrameworkSlot(frameworkKey, options.signal, work);
50858
+ return withFrameworkLock(async (slot, frameworkLease) => {
50859
+ const frameworkRoot = stageFrameworkSource(moduleRoot, slot, frameworkKey);
50811
50860
  report("preparing compiler plugins");
50812
50861
  const pluginsFor = (pluginLease) => ensureMacroPlugins(
50813
50862
  frameworkRoot,
@@ -50841,7 +50890,7 @@ function compileSwiftProjectOnce(input, options) {
50841
50890
  let prebuilt;
50842
50891
  if (!distribution) {
50843
50892
  report("compiling framework products");
50844
- prebuilt = await compileFrameworkProducts({
50893
+ prebuilt = await buildFrameworkProducts(slot, {
50845
50894
  moduleRoot: frameworkRoot,
50846
50895
  frameworkKey,
50847
50896
  input,
@@ -50851,7 +50900,6 @@ function compileSwiftProjectOnce(input, options) {
50851
50900
  plugins: macroPlugins,
50852
50901
  buildOptions
50853
50902
  });
50854
- await pruneFrameworkScratches(frameworkKey);
50855
50903
  }
50856
50904
  if (options.project) removeProjectLinks(root);
50857
50905
  if (retireStaleSwiftLink(
@@ -51076,7 +51124,7 @@ function compileSwiftProjectOnce(input, options) {
51076
51124
  options.signal
51077
51125
  );
51078
51126
  }
51079
- var import_node_child_process26, import_node_crypto19, import_node_fs43, import_node_os12, import_node_path40, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, admittedCores, SWIFT_BUILD_JOBS, BUILD_JOBS, SWIFT_BUILDER_TRANSPORT_MARGIN_MS, SWIFT_BUILDER_DEFAULT_COMPILE_MS, clangInterfaceHeader, swiftInterfaceDeclarations, linkedModuleDigests, SYSTEM_MODULE_LIBRARIES, SYSTEM_MODULE_IMPORT, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, kleeneNot, kleeneAnd, kleeneOr, sdkPaths, availableModules, ONE_PRODUCT, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_MODULES, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, DIRECTIVE, OS_IOS, DELEGATE_CLASS, REUSABLE_INIT, REUSABLE_VIEW_BASES, CLASS_BASE, FRAME_INIT, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, emptyMacroEnvironment, cPredefineTable, cPredefineCache, HIDDEN_UNITS, LIBXML_REFERENCE, LIBXML_SOURCE, ROOT_LOCKS, host, rootLocks, SHARED_ARTIFACT_BUDGET_BYTES, SHARED_ARTIFACT_GRACE_MS, RETIRED_PREFIX, retainedArtifacts, FRAMEWORK_LINK_TARGET, SWIFT_LINK_STAMP, SWIFT_FRAMEWORK_SCRATCHES_KEPT;
51127
+ var import_node_child_process26, import_node_crypto19, import_node_fs43, import_node_os12, import_node_path40, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, admittedCores, SWIFT_BUILD_JOBS, BUILD_JOBS, SWIFT_BUILDER_TRANSPORT_MARGIN_MS, SWIFT_BUILDER_DEFAULT_COMPILE_MS, clangInterfaceHeader, swiftInterfaceDeclarations, linkedModuleDigests, SYSTEM_MODULE_LIBRARIES, SYSTEM_MODULE_IMPORT, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, kleeneNot, kleeneAnd, kleeneOr, sdkPaths, availableModules, ONE_PRODUCT, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_MODULES, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, DIRECTIVE, OS_IOS, DELEGATE_CLASS, REUSABLE_INIT, REUSABLE_VIEW_BASES, CLASS_BASE, FRAME_INIT, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, emptyMacroEnvironment, cPredefineTable, cPredefineCache, HIDDEN_UNITS, LIBXML_REFERENCE, LIBXML_SOURCE, ROOT_LOCKS, host, rootLocks, SHARED_ARTIFACT_BUDGET_BYTES, SHARED_ARTIFACT_GRACE_MS, RETIRED_PREFIX, retainedArtifacts, FRAMEWORK_LINK_TARGET, SWIFT_LINK_STAMP, SWIFT_FRAMEWORK_SLOTS, SWIFT_FRAMEWORK_SLOT_KEY;
51080
51128
  var init_swift_compile = __esm({
51081
51129
  "src/swift-compile.ts"() {
51082
51130
  "use strict";
@@ -51242,7 +51290,7 @@ var init_swift_compile = __esm({
51242
51290
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
51243
51291
  MULTI_MANIFEST_VERSION = 65;
51244
51292
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
51245
- compilerSourceDigest = true ? "abe4d1a74b7a23d3207ef860184654de7a5bd61ad8d782291ac1c577c7863c9f" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
51293
+ compilerSourceDigest = true ? "86990d3bb695dc1b9f0c4cd7f4db499ad1f3e86d93eb50b44f1cb72a69322840" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
51246
51294
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
51247
51295
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
51248
51296
  cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
@@ -51928,7 +51976,8 @@ var init_swift_compile = __esm({
51928
51976
  retainedArtifacts = /* @__PURE__ */ new Map();
51929
51977
  FRAMEWORK_LINK_TARGET = "PeachFrameworkLink";
51930
51978
  SWIFT_LINK_STAMP = ".peach-link-stamp";
51931
- SWIFT_FRAMEWORK_SCRATCHES_KEPT = 3;
51979
+ SWIFT_FRAMEWORK_SLOTS = 3;
51980
+ SWIFT_FRAMEWORK_SLOT_KEY = ".peach-framework-key";
51932
51981
  }
51933
51982
  });
51934
51983
 
@@ -57075,6 +57124,10 @@ async function prepareNativeProject(app, manifest, stage, execute, run12, report
57075
57124
  const sourcePodEnv = { EXPO_USE_PRECOMPILED_MODULES: "0", RCT_NEW_ARCH_ENABLED: "1" };
57076
57125
  const declares2 = (name3) => Object.hasOwn(manifest.dependencies ?? {}, name3) || Object.hasOwn(manifest.devDependencies ?? {}, name3);
57077
57126
  if (!import_node_fs53.default.existsSync(import_node_path51.default.join(app, "ios", "Podfile"))) {
57127
+ if (!declares2("expo") && !declares2("one"))
57128
+ throw new Error(
57129
+ `${app} has no ios/Podfile and declares neither expo nor one, so peach cannot generate an iOS project for it`
57130
+ );
57078
57131
  const prebuild = declares2("expo") ? [appRequire.resolve("expo/bin/cli"), "prebuild"] : [
57079
57132
  import_node_path51.default.join(import_node_path51.default.dirname(appRequire.resolve("one/package.json")), "run.mjs"),
57080
57133
  "prebuild"
@@ -58586,7 +58639,7 @@ var init_swift_standin_digest = __esm({
58586
58639
  STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
58587
58640
  SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
58588
58641
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
58589
- STANDIN_SOURCE_DIGEST = true ? "602b9c9a1c5338ca39136a37c2a3feed2d70360714624751d9bc4e1d49bd016f" : standinSourceDigest();
58642
+ STANDIN_SOURCE_DIGEST = true ? "1cd682598c8039d3c836ff5b04a7395ad1178aeedac94ecc42645a0cb76b3ce0" : standinSourceDigest();
58590
58643
  }
58591
58644
  });
58592
58645
 
@@ -59315,7 +59368,7 @@ var init_expo_native_prebuilt = __esm({
59315
59368
  init_swift_native_pin();
59316
59369
  init_xcode_project();
59317
59370
  EXPO_NATIVE_ENTRY_NAME = "ios";
59318
- EXPO_NATIVE_COMPILER_DIGEST = true ? "72f10c157a99c89f1ae74ef275774fc4aa8b8ca8a229635ced41b1bac633dcf5" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
59371
+ EXPO_NATIVE_COMPILER_DIGEST = true ? "05cc4f0fc2f5cef07d79c3495fdaa4d6f39e244b76f4b9dd1584140b9b1f6209" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
59319
59372
  IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
59320
59373
  expoNativeEntryUrl = (key2, file) => `${NATIVE_PREBUILT_ORIGIN}/${nativeEntryPrefix("expo", EXPO_NATIVE_ENTRY_NAME, key2)}/${file}`;
59321
59374
  isStringRecord = (value) => isRecord(value) && Object.values(value).every((item) => typeof item === "string");
@@ -71864,7 +71917,9 @@ function readFollyConfig(reactNativeRoot) {
71864
71917
  import_node_path74.default.join(reactNativeRoot, "scripts/cocoapods/helpers.rb"),
71865
71918
  "utf8"
71866
71919
  );
71867
- const config = /@@folly_config\s*=\s*\{([\s\S]*?)\n\s*\}/.exec(helpers)?.[1];
71920
+ const config = /(?:@@folly_config\s*=|def self\.folly_config\s+return)\s*\{([\s\S]*?)\n\s*\}/.exec(
71921
+ helpers
71922
+ )?.[1];
71868
71923
  const flags = config && /:compiler_flags\s*=>\s*'([^']*)'/.exec(config)?.[1];
71869
71924
  const lines = config && /:config_file\s*=>\s*\[([\s\S]*?)\]/.exec(config)?.[1];
71870
71925
  if (!flags) throw new Error(`${reactNativeRoot}: helpers.rb has no folly config`);
@@ -77092,7 +77147,7 @@ var init_nitro_superset = __esm({
77092
77147
  init_swift_standin_digest();
77093
77148
  NITRO_SUPERSET_ENTRY_NAME = "superset";
77094
77149
  packageVersion = (root) => JSON.parse((0, import_node_fs86.readFileSync)((0, import_node_path83.join)(root, "package.json"), "utf8")).version;
77095
- NITRO_COMPILER_DIGEST = true ? "403e0b5c26728a5b3b083137be9aa6a65d5f07e0c261e25a3b2a7c4def6d7a82" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
77150
+ NITRO_COMPILER_DIGEST = true ? "249d1b10f55c061a04c2d66f15d82f7abd750ff6d3e4846b69c9c6c41ee91634" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
77096
77151
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
77097
77152
  nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
77098
77153
  published2 = /* @__PURE__ */ new Map();
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1879 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1881 | (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;
@@ -7878,7 +7878,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
7878
7878
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
7879
7879
  var MULTI_MANIFEST_VERSION = 65;
7880
7880
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
7881
- var compilerSourceDigest = true ? "abe4d1a74b7a23d3207ef860184654de7a5bd61ad8d782291ac1c577c7863c9f" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
7881
+ var compilerSourceDigest = true ? "86990d3bb695dc1b9f0c4cd7f4db499ad1f3e86d93eb50b44f1cb72a69322840" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
7882
7882
  function swiftArtifactHash(input, release, moduleRoot) {
7883
7883
  const hash = (0, import_node_crypto8.createHash)("sha256");
7884
7884
  hash.update(`swift-compile
@@ -11430,13 +11430,6 @@ function removeCaseCollidingModuleArtifacts(modulesDir, keep) {
11430
11430
  (0, import_node_fs17.rmSync)(import_node_path19.default.join(modulesDir, name2), { recursive: true, force: true });
11431
11431
  }
11432
11432
  }
11433
- async function compileFrameworkProducts(args) {
11434
- const scratch2 = swiftFrameworkScratch(args.frameworkKey);
11435
- (0, import_node_fs17.mkdirSync)(scratch2, { recursive: true });
11436
- const now = /* @__PURE__ */ new Date();
11437
- (0, import_node_fs17.utimesSync)(scratch2, now, now);
11438
- return buildFrameworkProducts(scratch2, args);
11439
- }
11440
11433
  async function buildFrameworkProducts(scratch2, args) {
11441
11434
  const linkedTargets = linkedFrameworkTargets(args.moduleRoot, args.input);
11442
11435
  const linkRoot = import_node_path19.default.join(scratch2, "link");
@@ -11554,37 +11547,105 @@ async function buildFrameworkProducts(scratch2, args) {
11554
11547
  };
11555
11548
  }
11556
11549
  var SWIFT_LINK_STAMP = ".peach-link-stamp";
11557
- var SWIFT_FRAMEWORK_SCRATCHES_KEPT = 3;
11550
+ var SWIFT_FRAMEWORK_SLOTS = 3;
11551
+ var SWIFT_FRAMEWORK_SLOT_KEY = ".peach-framework-key";
11558
11552
  function swiftFrameworksDir() {
11559
11553
  return import_node_path19.default.join(swiftCacheDir(), "swift-frameworks");
11560
11554
  }
11561
11555
  function swiftFrameworkScratch(frameworkKey) {
11562
11556
  return import_node_path19.default.join(swiftFrameworksDir(), frameworkKey);
11563
11557
  }
11564
- function stageFrameworkSource(moduleRoot, frameworkKey) {
11565
- if (swiftDistributionAt(moduleRoot)) return moduleRoot;
11566
- const staged = import_node_path19.default.join(swiftFrameworkScratch(frameworkKey), "source");
11567
- const stagedModule = import_node_path19.default.join(staged, "packages", import_node_path19.default.basename(moduleRoot));
11568
- if ((0, import_node_fs17.existsSync)(import_node_path19.default.join(staged, ".complete"))) return stagedModule;
11569
- const partial = `${staged}.${(0, import_node_crypto8.randomUUID)()}`;
11570
- (0, import_node_fs17.mkdirSync)(partial, { recursive: true });
11571
- (0, import_node_fs17.cpSync)(moduleRoot, import_node_path19.default.join(partial, "packages", import_node_path19.default.basename(moduleRoot)), {
11572
- recursive: true,
11573
- preserveTimestamps: true,
11574
- filter: (source) => import_node_path19.default.relative(moduleRoot, source) !== ".build"
11558
+ function swiftFrameworkSlotKey(slot) {
11559
+ try {
11560
+ return (0, import_node_fs17.readFileSync)(import_node_path19.default.join(slot, SWIFT_FRAMEWORK_SLOT_KEY), "utf8").trim();
11561
+ } catch (error) {
11562
+ if (!vanished(error)) throw error;
11563
+ return null;
11564
+ }
11565
+ }
11566
+ async function withSwiftFrameworkSlot(frameworkKey, signal, work) {
11567
+ const slots = Array.from({ length: SWIFT_FRAMEWORK_SLOTS }, (_, index) => {
11568
+ const slot = import_node_path19.default.join(swiftFrameworksDir(), `slot-${index}`);
11569
+ (0, import_node_fs17.mkdirSync)(slot, { recursive: true });
11570
+ return slot;
11575
11571
  });
11576
- (0, import_node_fs17.cpSync)(
11577
- swiftSharedSdkRoot(moduleRoot, false),
11578
- import_node_path19.default.join(partial, "packages/peachsim/sdk/ios"),
11579
- { recursive: true, preserveTimestamps: true }
11580
- );
11581
- (0, import_node_fs17.symlinkSync)(
11582
- (0, import_node_fs17.realpathSync)(import_node_path19.default.join(moduleRoot, "../../node_modules")),
11583
- import_node_path19.default.join(partial, "node_modules")
11572
+ const run2 = (slot) => (lease) => {
11573
+ const now = /* @__PURE__ */ new Date();
11574
+ (0, import_node_fs17.utimesSync)(slot, now, now);
11575
+ return work(slot, lease);
11576
+ };
11577
+ const staged = slots.find((slot) => swiftFrameworkSlotKey(slot) === frameworkKey);
11578
+ if (staged) return withSwiftRootLock(staged, run2(staged), signal);
11579
+ const oldest = slots.sort(
11580
+ (left, right) => (0, import_node_fs17.statSync)(left).mtimeMs - (0, import_node_fs17.statSync)(right).mtimeMs
11584
11581
  );
11585
- (0, import_node_fs17.writeFileSync)(import_node_path19.default.join(partial, ".complete"), "");
11586
- (0, import_node_fs17.rmSync)(staged, { recursive: true, force: true });
11587
- (0, import_node_fs17.renameSync)(partial, staged);
11582
+ for (const slot of oldest) {
11583
+ const result = await withSwiftRootLock(
11584
+ slot,
11585
+ async (lease) => ({ value: await run2(slot)(lease) }),
11586
+ signal,
11587
+ false
11588
+ );
11589
+ if (result) return result.value;
11590
+ }
11591
+ return withSwiftRootLock(oldest[0], run2(oldest[0]), signal);
11592
+ }
11593
+ function mirrorTree2(source, target, skip) {
11594
+ (0, import_node_fs17.mkdirSync)(target, { recursive: true });
11595
+ const wanted = /* @__PURE__ */ new Set();
11596
+ for (const entry of (0, import_node_fs17.readdirSync)(source, { withFileTypes: true })) {
11597
+ if (entry.name === skip) continue;
11598
+ wanted.add(entry.name);
11599
+ const from = import_node_path19.default.join(source, entry.name);
11600
+ const to = import_node_path19.default.join(target, entry.name);
11601
+ let existing = null;
11602
+ try {
11603
+ existing = (0, import_node_fs17.lstatSync)(to);
11604
+ } catch (error) {
11605
+ if (!vanished(error)) throw error;
11606
+ }
11607
+ if (entry.isDirectory()) {
11608
+ if (existing && !existing.isDirectory()) (0, import_node_fs17.rmSync)(to, { force: true });
11609
+ mirrorTree2(from, to);
11610
+ } else if (entry.isSymbolicLink()) {
11611
+ const link = (0, import_node_fs17.readlinkSync)(from);
11612
+ if (existing?.isSymbolicLink() && (0, import_node_fs17.readlinkSync)(to) === link) continue;
11613
+ if (existing) (0, import_node_fs17.rmSync)(to, { recursive: true, force: true });
11614
+ (0, import_node_fs17.symlinkSync)(link, to);
11615
+ } else {
11616
+ const stat = (0, import_node_fs17.statSync)(from);
11617
+ if (existing?.isFile() && existing.size === stat.size && (existing.mtimeMs === stat.mtimeMs || (0, import_node_fs17.readFileSync)(from).equals((0, import_node_fs17.readFileSync)(to))))
11618
+ continue;
11619
+ if (existing) (0, import_node_fs17.rmSync)(to, { recursive: true, force: true });
11620
+ const partial = `${to}.${(0, import_node_crypto8.randomUUID)()}`;
11621
+ (0, import_node_fs17.copyFileSync)(from, partial);
11622
+ (0, import_node_fs17.utimesSync)(partial, stat.atime, stat.mtime);
11623
+ (0, import_node_fs17.renameSync)(partial, to);
11624
+ }
11625
+ }
11626
+ for (const name2 of (0, import_node_fs17.readdirSync)(target))
11627
+ if (!wanted.has(name2) && name2 !== skip)
11628
+ (0, import_node_fs17.rmSync)(import_node_path19.default.join(target, name2), { recursive: true, force: true });
11629
+ }
11630
+ function stageFrameworkSource(moduleRoot, slot, frameworkKey) {
11631
+ if (!slot) return moduleRoot;
11632
+ const staged = import_node_path19.default.join(slot, "source");
11633
+ const stagedModule = import_node_path19.default.join(staged, "packages", import_node_path19.default.basename(moduleRoot));
11634
+ if (swiftFrameworkSlotKey(slot) !== frameworkKey) {
11635
+ (0, import_node_fs17.rmSync)(import_node_path19.default.join(slot, SWIFT_FRAMEWORK_SLOT_KEY), { force: true });
11636
+ mirrorTree2(moduleRoot, stagedModule, ".build");
11637
+ mirrorTree2(
11638
+ swiftSharedSdkRoot(moduleRoot, false),
11639
+ import_node_path19.default.join(staged, "packages/peachsim/sdk/ios")
11640
+ );
11641
+ const modules = import_node_path19.default.join(staged, "node_modules");
11642
+ const target = (0, import_node_fs17.realpathSync)(import_node_path19.default.join(moduleRoot, "../../node_modules"));
11643
+ if (!(0, import_node_fs17.existsSync)(modules) || (0, import_node_fs17.readlinkSync)(modules) !== target) {
11644
+ (0, import_node_fs17.rmSync)(modules, { recursive: true, force: true });
11645
+ (0, import_node_fs17.symlinkSync)(target, modules);
11646
+ }
11647
+ (0, import_node_fs17.writeFileSync)(import_node_path19.default.join(slot, SWIFT_FRAMEWORK_SLOT_KEY), frameworkKey);
11648
+ }
11588
11649
  return stagedModule;
11589
11650
  }
11590
11651
  function swiftLinkStamp(args) {
@@ -11620,17 +11681,6 @@ ${args.prebuilt.modules}
11620
11681
  ${statOf(import_node_path19.default.join(args.prebuilt.modules, entry))}`);
11621
11682
  return hash.digest("hex");
11622
11683
  }
11623
- async function pruneFrameworkScratches(keep) {
11624
- const dir = swiftFrameworksDir();
11625
- const idle = (0, import_node_fs17.readdirSync)(dir).filter((name2) => name2 !== keep).map((name2) => ({ name: name2, modified: (0, import_node_fs17.statSync)(import_node_path19.default.join(dir, name2)).mtimeMs })).sort((left, right) => right.modified - left.modified).slice(SWIFT_FRAMEWORK_SCRATCHES_KEPT - 1);
11626
- for (const { name: name2 } of idle)
11627
- await withSwiftRootLock(
11628
- import_node_path19.default.join(dir, name2),
11629
- async () => (0, import_node_fs17.rmSync)(import_node_path19.default.join(dir, name2), { recursive: true, force: true }),
11630
- void 0,
11631
- false
11632
- );
11633
- }
11634
11684
  function retireStaleSwiftLink(root, stamp) {
11635
11685
  const receipt = import_node_path19.default.join(root, SWIFT_LINK_STAMP);
11636
11686
  let previous = null;
@@ -11759,9 +11809,9 @@ function compileSwiftProjectOnce(input, options) {
11759
11809
  );
11760
11810
  }
11761
11811
  const frameworkScratch = swiftFrameworkScratch(frameworkKey);
11762
- const withFrameworkLock = (work) => distribution ? work() : withSwiftRootLock(frameworkScratch, work, options.signal);
11763
- return withFrameworkLock(async (frameworkLease) => {
11764
- const frameworkRoot = stageFrameworkSource(moduleRoot, frameworkKey);
11812
+ const withFrameworkLock = (work) => distribution ? work(null) : withSwiftFrameworkSlot(frameworkKey, options.signal, work);
11813
+ return withFrameworkLock(async (slot, frameworkLease) => {
11814
+ const frameworkRoot = stageFrameworkSource(moduleRoot, slot, frameworkKey);
11765
11815
  report("preparing compiler plugins");
11766
11816
  const pluginsFor = (pluginLease) => ensureMacroPlugins(
11767
11817
  frameworkRoot,
@@ -11795,7 +11845,7 @@ function compileSwiftProjectOnce(input, options) {
11795
11845
  let prebuilt;
11796
11846
  if (!distribution) {
11797
11847
  report("compiling framework products");
11798
- prebuilt = await compileFrameworkProducts({
11848
+ prebuilt = await buildFrameworkProducts(slot, {
11799
11849
  moduleRoot: frameworkRoot,
11800
11850
  frameworkKey,
11801
11851
  input,
@@ -11805,7 +11855,6 @@ function compileSwiftProjectOnce(input, options) {
11805
11855
  plugins: macroPlugins,
11806
11856
  buildOptions
11807
11857
  });
11808
- await pruneFrameworkScratches(frameworkKey);
11809
11858
  }
11810
11859
  if (options.project) removeProjectLinks(root);
11811
11860
  if (retireStaleSwiftLink(