peachsim 0.1.2935 → 0.1.2937

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 (345) hide show
  1. package/LICENSE +6 -8
  2. package/cli/account-gate.ts +20 -3
  3. package/cli/app-bundle-resources.ts +66 -19
  4. package/cli/catalog/meta.ts +2 -106
  5. package/cli/command-agent.ts +7 -0
  6. package/cli/command-registry.ts +0 -1
  7. package/cli/commands/control.ts +13 -5
  8. package/cli/commands/daemon.ts +4 -2
  9. package/cli/commands/device.ts +78 -8
  10. package/cli/commands/do-chain.ts +11 -8
  11. package/cli/commands/inspect/core.ts +4 -9
  12. package/cli/commands/inspect/settling.ts +1 -0
  13. package/cli/commands/logout.ts +6 -1
  14. package/cli/commands/map.ts +2 -6
  15. package/cli/commands/package.ts +112 -57
  16. package/cli/commands/shell-url.ts +0 -1
  17. package/cli/download-auth.ts +2 -0
  18. package/cli/drivers/playwright-provisioning.ts +10 -38
  19. package/cli/github-workflow-identity.ts +8 -0
  20. package/cli/internal-child-contract.ts +1 -0
  21. package/cli/internal-child.ts +5 -0
  22. package/cli/main.ts +2 -10
  23. package/cli/outbound-endpoints.ts +26 -0
  24. package/detox/index.ts +227 -131
  25. package/dist-lib/agent-daemon-client.cjs +1 -1
  26. package/dist-lib/agent-events.cjs +1 -1
  27. package/dist-lib/attached-projects.cjs +1 -1
  28. package/dist-lib/auth/shared-session.cjs +1 -1
  29. package/dist-lib/backend-origin.cjs +1 -1
  30. package/dist-lib/beta.cjs +1 -1
  31. package/dist-lib/beta.mjs +2 -2
  32. package/dist-lib/bridge-constants.cjs +1 -1
  33. package/dist-lib/bridge-contract-input.cjs +47 -3
  34. package/dist-lib/bridge-contract-input.mjs +6 -6
  35. package/dist-lib/bridge-contract.cjs +10 -1
  36. package/dist-lib/bridge-contract.mjs +3 -3
  37. package/dist-lib/bundle-channel.cjs +12779 -9515
  38. package/dist-lib/capture-contract.cjs +39 -17
  39. package/dist-lib/capture-contract.mjs +3 -3
  40. package/dist-lib/cloud-contract.cjs +1 -1
  41. package/dist-lib/cloud-contract.mjs +3 -3
  42. package/dist-lib/cloud-test-args.cjs +1 -1
  43. package/dist-lib/cloud-test-args.mjs +2 -2
  44. package/dist-lib/cloud.cjs +1 -1
  45. package/dist-lib/cloud.mjs +8 -8
  46. package/dist-lib/config.cjs +1 -1
  47. package/dist-lib/config.mjs +6 -6
  48. package/dist-lib/detox/index.cjs +200 -132
  49. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  50. package/dist-lib/esm-chunks/{acorn-Q5TRRYSO.mjs → acorn-IIBLEO25.mjs} +3 -3
  51. package/dist-lib/esm-chunks/{chunk-UDWBTBVG.mjs → chunk-4FTPQKPT.mjs} +10 -1
  52. package/dist-lib/esm-chunks/chunk-4WIDTRBB.mjs +10232 -0
  53. package/dist-lib/esm-chunks/{chunk-LCMFYMT7.mjs → chunk-5QZOQ3NZ.mjs} +1 -1
  54. package/dist-lib/esm-chunks/{chunk-BJ2OGUX7.mjs → chunk-CIY67HNL.mjs} +39 -17
  55. package/dist-lib/esm-chunks/{chunk-SKQTNQYE.mjs → chunk-CQFEMJ64.mjs} +1 -1
  56. package/dist-lib/esm-chunks/{chunk-AXWVXRHX.mjs → chunk-CWVMCW23.mjs} +1 -1
  57. package/dist-lib/esm-chunks/{chunk-MTALOHQR.mjs → chunk-F6DZ4DS2.mjs} +1 -1
  58. package/dist-lib/esm-chunks/{chunk-I4R7IZRD.mjs → chunk-HJMF6O7L.mjs} +74 -46
  59. package/dist-lib/esm-chunks/chunk-I6T4PXJF.mjs +154 -0
  60. package/dist-lib/esm-chunks/{chunk-XWAUZKIA.mjs → chunk-IJU3JMWM.mjs} +1 -1
  61. package/dist-lib/esm-chunks/{chunk-CXWUIOCH.mjs → chunk-KODEPXQC.mjs} +4 -4
  62. package/dist-lib/esm-chunks/{chunk-WJE5QHSD.mjs → chunk-LD4K2VBL.mjs} +155 -36
  63. package/dist-lib/esm-chunks/{chunk-2TSM64HI.mjs → chunk-LTE7YMEG.mjs} +1 -1
  64. package/dist-lib/esm-chunks/{chunk-3GGOXUJA.mjs → chunk-M3CSKAJE.mjs} +1 -1
  65. package/dist-lib/esm-chunks/{chunk-7G5UETIG.mjs → chunk-NA6DJPB6.mjs} +43 -1
  66. package/dist-lib/esm-chunks/{chunk-MSUHMNAI.mjs → chunk-NNAX24FS.mjs} +1 -1
  67. package/dist-lib/esm-chunks/{chunk-VDJA4LP4.mjs → chunk-PZPJJBAS.mjs} +1 -1
  68. package/dist-lib/esm-chunks/{chunk-UEEEJVQA.mjs → chunk-QXSTHMWN.mjs} +1 -1
  69. package/dist-lib/esm-chunks/{chunk-S2RJB5I7.mjs → chunk-RBPVK5YI.mjs} +1 -1
  70. package/dist-lib/esm-chunks/{chunk-VRAXNGYT.mjs → chunk-SCT5OFDV.mjs} +1 -1
  71. package/dist-lib/esm-chunks/{chunk-T3M73LGP.mjs → chunk-U3CJGYSP.mjs} +50 -6
  72. package/dist-lib/esm-chunks/{chunk-SLUGTGQQ.mjs → chunk-VXTOQ522.mjs} +12 -6
  73. package/dist-lib/esm-chunks/{chunk-EL44SZMV.mjs → chunk-WMSVGYTH.mjs} +1 -1
  74. package/dist-lib/esm-chunks/{chunk-FEDEPSEV.mjs → chunk-WRWINRWK.mjs} +1 -1
  75. package/dist-lib/esm-chunks/{chunk-BNO52N2S.mjs → chunk-YZF2USRD.mjs} +1905 -8760
  76. package/dist-lib/esm-chunks/{chunk-TQLKYMVP.mjs → chunk-ZNHR6C3L.mjs} +1 -1
  77. package/dist-lib/esm-chunks/{download-auth-registry-G75MIT55.mjs → download-auth-registry-AHS5MSIB.mjs} +4 -4
  78. package/dist-lib/esm-chunks/{metro-layout-parser-FXLUDTYT.mjs → metro-layout-parser-24ZYK5UP.mjs} +3 -3
  79. package/dist-lib/esm-chunks/{swift-package-prebuilt-524D4MA2.mjs → swift-package-prebuilt-L4YNXQRD.mjs} +15 -15
  80. package/dist-lib/esm-chunks/{swift-sdk-app-module-EX544YJY.mjs → swift-sdk-app-module-RM652JSW.mjs} +87 -71
  81. package/dist-lib/esm-chunks/{swift-sdk-image-LOTMWVM7.mjs → swift-sdk-image-5PQ44UJT.mjs} +15 -15
  82. package/dist-lib/esm-chunks/{swift-sdk-image-producer-UO6B3M4U.mjs → swift-sdk-image-producer-GD3SM6YI.mjs} +5 -5
  83. package/dist-lib/esm-chunks/swift-sdk-later-data-62QYJ2KH.mjs +590 -0
  84. package/dist-lib/expo-swift-bundle.cjs +21037 -17896
  85. package/dist-lib/expo-swift-metadata.cjs +8 -2
  86. package/dist-lib/expo-swift-metadata.mjs +9 -8
  87. package/dist-lib/home-paths.cjs +1 -1
  88. package/dist-lib/host/bridge-host.cjs +22481 -18741
  89. package/dist-lib/host/fetch-proxy-handler.cjs +21079 -17980
  90. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  91. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  92. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  93. package/dist-lib/host/websocket-proxy.cjs +1 -1
  94. package/dist-lib/index.cjs +68 -38
  95. package/dist-lib/kotlin-host.cjs +97 -21
  96. package/dist-lib/menu.cjs +1 -1
  97. package/dist-lib/menu.mjs +3 -3
  98. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  99. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  100. package/dist-lib/metro-production-bundle.cjs +23 -1
  101. package/dist-lib/metro-production-bundle.mjs +24 -4
  102. package/dist-lib/native-app-identity-project.cjs +3582 -571
  103. package/dist-lib/native-app-identity-project.mjs +1024 -398
  104. package/dist-lib/native-app-identity.cjs +1 -1
  105. package/dist-lib/native-app-identity.mjs +6 -6
  106. package/dist-lib/native-firebase-metadata.cjs +1 -1
  107. package/dist-lib/native-firebase-metadata.mjs +3 -3
  108. package/dist-lib/pdfium-raster.cjs +1 -1
  109. package/dist-lib/pdfium-raster.mjs +2 -2
  110. package/dist-lib/plist.cjs +1 -1
  111. package/dist-lib/plist.mjs +3 -3
  112. package/dist-lib/profiles.cjs +1 -1
  113. package/dist-lib/public-brand.cjs +1 -1
  114. package/dist-lib/public-origins-lib-esm.json +132 -116
  115. package/dist-lib/public-origins-lib.json +215 -173
  116. package/dist-lib/react-native-host-modules.cjs +1 -1
  117. package/dist-lib/react-native-host-modules.mjs +2 -2
  118. package/dist-lib/reap-browser.cjs +17 -1
  119. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  120. package/dist-lib/sdk.cjs +6 -7
  121. package/dist-lib/sdk.mjs +13 -14
  122. package/dist-lib/skills.cjs +23216 -19650
  123. package/dist-lib/swift-compile.cjs +4337 -2905
  124. package/dist-lib/swift-compile.mjs +15 -13
  125. package/dist-lib/swift-package.cjs +1 -1
  126. package/dist-lib/swift-package.mjs +3 -3
  127. package/dist-lib/swift-submit.cjs +1 -1
  128. package/dist-lib/swift-submit.mjs +6 -6
  129. package/dist-lib/swift-svg-raster.cjs +1 -1
  130. package/dist-lib/swift-svg-raster.mjs +2 -2
  131. package/dist-lib/swift-toolchain.cjs +19 -1
  132. package/dist-lib/swift.cjs +1 -1
  133. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  134. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  135. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  136. package/dist-lib/vendor/acorn.cjs +1 -1
  137. package/dist-lib/vendor/stream-json.cjs +1 -1
  138. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  139. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  140. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  141. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  142. package/dist-lib/vendor/sucrase.cjs +1 -1
  143. package/dist-lib/vendor/terser.cjs +1 -1
  144. package/dist-lib/vendor/valibot.cjs +1 -1
  145. package/dist-lib/vendor/ws.cjs +94 -32
  146. package/dist-lib/vendor/zod.cjs +1 -1
  147. package/dist-lib/worklet-executable.cjs +8 -5
  148. package/dist-lib/worklet-executable.mjs +9 -6
  149. package/dist-types/packages/peach-engine/src/canvaskit-artifact-urls.d.ts +2 -1
  150. package/dist-types/packages/peach-engine/src/capture/compositor-presentation-recording.d.ts +1 -0
  151. package/dist-types/packages/peach-engine/src/engine/generated/canvaskit-artifact-hashes.d.ts +26 -0
  152. package/dist-types/packages/peach-engine/src/engine/guest-scene-inspect.d.ts +1 -1
  153. package/dist-types/packages/peach-engine/src/engine/inspect-info.d.ts +1 -0
  154. package/dist-types/packages/peach-engine/src/engine/metalTypes.d.ts +32 -2
  155. package/dist-types/packages/peach-engine/src/engine/portalContract.d.ts +24 -0
  156. package/dist-types/packages/peach-engine/src/engine/remote-display-protocol.d.ts +12 -2
  157. package/dist-types/packages/peach-engine/src/guest/http-cookie-storage.d.ts +73 -0
  158. package/dist-types/packages/peach-engine/src/guest/native-evaluation-lease.d.ts +5 -0
  159. package/dist-types/packages/peach-engine/src/guest/nitro-jsi-host.d.ts +3 -1
  160. package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +225 -9
  161. package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +4 -1
  162. package/dist-types/packages/peach-engine/src/ios/duo-vertical-bar-geometry.d.ts +0 -1
  163. package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +1 -0
  164. package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-compositor.d.ts +1 -0
  165. package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-contract.d.ts +44 -10
  166. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +4 -3
  167. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -4
  168. package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +2 -0
  169. package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +1 -1
  170. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -27
  171. package/dist-types/packages/peach-engine/src/render-worker/reanimated-readiness.d.ts +2 -6
  172. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +11 -3
  173. package/dist-types/packages/peach-engine/src/settings/devices.d.ts +3 -1
  174. package/dist-types/packages/peach-engine/src/settings/duo-fold.d.ts +1 -1
  175. package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +1 -1
  176. package/dist-types/packages/peach-globals/src/app-bundle-resources.d.ts +10 -0
  177. package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +1 -1
  178. package/dist-types/packages/peach-globals/src/hostStorageBridgeContract.d.ts +1 -0
  179. package/dist-types/packages/peach-globals/src/index.d.ts +2 -2
  180. package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +9 -6
  181. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +11 -0
  182. package/dist-types/packages/peach-globals/src/oneWidgetContract.d.ts +28 -0
  183. package/package.json +2 -2
  184. package/runtime-companion.json +1 -1
  185. package/sdk/ios/System/Library/Frameworks/CoreHaptics.framework/Headers/CoreHaptics.h +251 -0
  186. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INImage.h +14 -0
  187. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntent.h +18 -0
  188. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentIdentifiers.h +30 -0
  189. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentResponse.h +12 -0
  190. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INInteraction.h +35 -0
  191. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectCollection.h +0 -7
  192. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectSection.h +0 -7
  193. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INOutgoingMessageType.h +7 -0
  194. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPerson.h +36 -0
  195. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPersonHandle.h +22 -0
  196. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent+UserNotifications.h +6 -0
  197. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent.h +33 -0
  198. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSpeakableString.h +24 -0
  199. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/Intents.h +11 -7
  200. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +1 -1
  201. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +1 -1
  202. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +0 -8
  203. package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MetalTypes.h +8 -0
  204. package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/SLServiceTypes.h +9 -0
  205. package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/Social.h +1 -0
  206. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotification.h +1 -1
  207. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAction.h +2 -2
  208. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAttachment.h +1 -1
  209. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationCategory.h +1 -1
  210. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h +2 -2
  211. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h +1 -1
  212. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationResponse.h +2 -2
  213. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSound.h +1 -1
  214. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationTrigger.h +5 -5
  215. package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
  216. package/sdk/ios/wasm/include/unistd.h +1 -0
  217. package/src/acorn-program.ts +3 -0
  218. package/src/audio-codec-archives.ts +141 -0
  219. package/src/bridge-contract-input.ts +61 -1
  220. package/src/bridge-contract.ts +45 -4
  221. package/src/bundle-channel.mjs +44 -30
  222. package/src/capture-contract.ts +57 -39
  223. package/src/conformance-comparison-contract.ts +2 -0
  224. package/src/expo-discovery-cache.ts +0 -2
  225. package/src/expo-macro-host.ts +8 -3
  226. package/src/expo-native-compiler-digest.ts +0 -1
  227. package/src/expo-native-prebuilt.ts +1 -1
  228. package/src/expo-native-workspace.ts +83 -45
  229. package/src/expo-pod-prebuilt.ts +1 -0
  230. package/src/expo-swift-host.ts +158 -77
  231. package/src/expo-swift-legacy-runtime-source.ts +12 -1
  232. package/src/expo-swift-view-source.ts +51 -20
  233. package/src/expo-workspace-exclusion.ts +7 -1
  234. package/src/expoSwiftContract.ts +10 -1
  235. package/src/ffmpeg-source-build.ts +123 -59
  236. package/src/genrule-archives.ts +7 -2
  237. package/src/genrule-library-builds.ts +101 -18
  238. package/src/host/bridge-host.ts +10 -1
  239. package/src/installed-native-libraries.ts +147 -23
  240. package/src/installed-package-versions.ts +30 -0
  241. package/src/ios-rn-bundle-request.ts +3 -1
  242. package/src/ios-rn-bundle.ts +38 -27
  243. package/src/ios-rn-compile.ts +23 -6
  244. package/src/ios-rn-startup.ts +2 -1
  245. package/src/java-module-abi.ts +4 -3
  246. package/src/kotlin-host.ts +4 -4
  247. package/src/kotlin-library-sources.ts +8 -5
  248. package/src/metro-production-bundle.ts +24 -0
  249. package/src/native-firebase-config.ts +2 -0
  250. package/src/native-framework-compiler.ts +5 -0
  251. package/src/native-package-slice-build.ts +3 -0
  252. package/src/native-package-slice.ts +15 -10
  253. package/src/native-preparation.ts +4 -1
  254. package/src/native-static-libraries.ts +107 -33
  255. package/src/nativeRuntimePackageIndex.ts +1 -4
  256. package/src/nitro-adapter.lock.json +286 -286
  257. package/src/nitro-app-providers.ts +20 -8
  258. package/src/nitro-compile.ts +131 -37
  259. package/src/nitro-dependencies.ts +42 -8
  260. package/src/nitro-source.ts +40 -36
  261. package/src/nitro-superset.lock.json +4 -4
  262. package/src/nitroAdapterContract.ts +32 -7
  263. package/src/nitroContract.ts +21 -37
  264. package/src/one-direct-host-source.ts +247 -140
  265. package/src/one-fabric.ts +129 -0
  266. package/src/one-native-controls-package.ts +95 -21
  267. package/src/one-native-controls-release.ts +147 -14
  268. package/src/one-native-source.ts +4 -1
  269. package/src/one-nitro-inputs.ts +1 -1
  270. package/src/one-nitro-source.ts +45 -1
  271. package/src/one-sdk/source.ts +10 -41
  272. package/src/one-widget-metadata.ts +2 -2
  273. package/src/one-widget-package.ts +1 -1
  274. package/src/oneSdkContract.ts +3 -0
  275. package/src/playwright-browser-paths.ts +30 -0
  276. package/src/pods-install.ts +6 -2
  277. package/src/pods-post-install.ts +2 -2
  278. package/src/pods-project.ts +10 -0
  279. package/src/podspec-ruby-stdlib.ts +73 -0
  280. package/src/podspec-ruby.ts +1 -1
  281. package/src/podspec-sources.ts +31 -13
  282. package/src/process-group.ts +135 -5
  283. package/src/published-swift-sdk.ts +25 -1
  284. package/src/react-native-bridge-modules.ts +35 -3
  285. package/src/react-native-core-build.ts +14 -2
  286. package/src/react-native-core.ts +12 -2
  287. package/src/rive-runtime-dependencies.ts +178 -40
  288. package/src/serverDiscoveryContract.ts +1 -1
  289. package/src/storageSnapshotContract.ts +1 -1
  290. package/src/swift-app-data-store.ts +35 -0
  291. package/src/swift-compile.ts +403 -121
  292. package/src/swift-compiler-digest.ts +4 -0
  293. package/src/swift-darwin-records.ts +6 -0
  294. package/src/swift-distribution-mirror.ts +10 -1
  295. package/src/swift-distribution.lock.json +19 -18
  296. package/src/swift-distribution.ts +17 -1
  297. package/src/swift-entry-module.ts +1 -0
  298. package/src/swift-guest-compile.ts +8 -1
  299. package/src/swift-host.ts +79 -23
  300. package/src/swift-installed-targets.ts +51 -20
  301. package/src/swift-objc-standin.ts +60 -8
  302. package/src/swift-packages.ts +104 -24
  303. package/src/swift-project-user.ts +2 -1
  304. package/src/swift-reproducible.ts +99 -1
  305. package/src/swift-root-lock.ts +52 -46
  306. package/src/swift-sdk-app-module.ts +65 -13
  307. package/src/swift-sdk-image-producer.ts +2 -1
  308. package/src/swift-sdk-image.ts +23 -8
  309. package/src/swift-sdk-later-data.ts +294 -44
  310. package/src/swift-sdk-surface.ts +233 -55
  311. package/src/swift-shared-sdk.ts +7 -0
  312. package/src/swift-standin-builtin-behavior.ts +18 -0
  313. package/src/swift-standin-emit.ts +242 -54
  314. package/src/swift-standins.ts +184 -38
  315. package/src/swift-startup-split.ts +19 -9
  316. package/src/swift-toolchain.ts +18 -0
  317. package/src/swift-wasm-prune.ts +179 -9
  318. package/src/swift-xcframework.ts +16 -0
  319. package/src/swiftContract.ts +4 -1
  320. package/src/swiftSdkLinkContract.ts +2 -0
  321. package/src/swiftTargetContract.ts +1 -0
  322. package/src/turbo-bundle.ts +6 -3
  323. package/src/turbo-codegen-intake.ts +106 -16
  324. package/src/turbo-compile.ts +89 -68
  325. package/src/turbo-fabric-app.ts +287 -23
  326. package/src/turbo-provider-host.ts +122 -31
  327. package/src/turbo-runtime.lock.json +26 -26
  328. package/src/turbo-source.ts +374 -157
  329. package/src/vite-plugin.ts +48 -112
  330. package/src/wasm-binary-sections.ts +40 -0
  331. package/src/wasm-code-immediates.ts +35 -5
  332. package/src/widget-extension-bundle.ts +15 -1
  333. package/src/worklet-executable.ts +2 -1
  334. package/src/worklet-kernel.ts +5 -3
  335. package/src/worklets-babel.ts +2 -1
  336. package/src/xcode-project.ts +151 -53
  337. package/src/xcode-scheme-actions.ts +104 -0
  338. package/cli/commands/canvas.ts +0 -1204
  339. package/dist-lib/esm-chunks/chunk-B5QD2KEV.mjs +0 -2787
  340. package/dist-lib/vendor/magic-string.cjs +0 -1693
  341. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +0 -127
  342. package/src/appBundleResourcesContract.ts +0 -51
  343. package/src/canvas-groups.ts +0 -28
  344. package/src/canvas-map-layout.ts +0 -161
  345. package/src/oneWidgetContract.ts +0 -134
@@ -1,27 +1,41 @@
1
- /*! peach v0.1.2935 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2937 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
3
  swiftNativePin
4
- } from "./esm-chunks/chunk-SLUGTGQQ.mjs";
4
+ } from "./esm-chunks/chunk-VXTOQ522.mjs";
5
5
  import {
6
6
  NATIVE_GRAPH_SDK_VERSION,
7
- sha256Hex
8
- } from "./esm-chunks/chunk-B5QD2KEV.mjs";
7
+ bindPrivateWasmSymbols,
8
+ fetchNativeEntry,
9
+ guestWasmSymbols,
10
+ nativeEntryKey,
11
+ nativeEntryPrefix,
12
+ objcSdkIntakeFlags,
13
+ readArMembers,
14
+ sha256Hex,
15
+ swiftModuleRelease,
16
+ swiftModuleSdk,
17
+ swiftModuleToolchain,
18
+ swiftObjCRuntimeFlags,
19
+ swiftSdkPaths
20
+ } from "./esm-chunks/chunk-4WIDTRBB.mjs";
9
21
  import {
10
22
  cacheDir
11
- } from "./esm-chunks/chunk-3GGOXUJA.mjs";
23
+ } from "./esm-chunks/chunk-M3CSKAJE.mjs";
12
24
  import {
25
+ SWIFT_WASM_TRIPLE,
13
26
  privateSwiftRelease,
14
27
  swiftCacheDir,
15
28
  swiftEnvironment,
16
- swiftToolchainBin
17
- } from "./esm-chunks/chunk-WJE5QHSD.mjs";
18
- import "./esm-chunks/chunk-7G5UETIG.mjs";
29
+ swiftToolchainBin,
30
+ wasmThreadFlags
31
+ } from "./esm-chunks/chunk-LD4K2VBL.mjs";
32
+ import "./esm-chunks/chunk-NA6DJPB6.mjs";
19
33
  import {
20
34
  SWIFT_OBJCXX_LANGUAGE_FLAG,
21
35
  isSwiftNativeTranslationUnit,
22
36
  moduleMapName,
23
37
  moduleMapTokens
24
- } from "./esm-chunks/chunk-XWAUZKIA.mjs";
38
+ } from "./esm-chunks/chunk-IJU3JMWM.mjs";
25
39
  import {
26
40
  androidMergedResourceValuesDirectory,
27
41
  extractNativeAppIdentityFromFiles,
@@ -39,28 +53,28 @@ import {
39
53
  xcodeBuildFileBuildsForIos,
40
54
  xcodePathResolver,
41
55
  xcodeTargetMemberVisitor
42
- } from "./esm-chunks/chunk-CXWUIOCH.mjs";
43
- import "./esm-chunks/chunk-VRAXNGYT.mjs";
56
+ } from "./esm-chunks/chunk-KODEPXQC.mjs";
57
+ import "./esm-chunks/chunk-SCT5OFDV.mjs";
44
58
  import {
45
59
  buildPlist,
46
60
  parsePlist,
47
61
  parsePlistSource,
48
62
  parseXmlPlist
49
- } from "./esm-chunks/chunk-LCMFYMT7.mjs";
50
- import "./esm-chunks/chunk-MTALOHQR.mjs";
51
- import "./esm-chunks/chunk-EL44SZMV.mjs";
52
- import "./esm-chunks/chunk-AXWVXRHX.mjs";
63
+ } from "./esm-chunks/chunk-5QZOQ3NZ.mjs";
64
+ import "./esm-chunks/chunk-F6DZ4DS2.mjs";
65
+ import "./esm-chunks/chunk-WMSVGYTH.mjs";
66
+ import "./esm-chunks/chunk-CWVMCW23.mjs";
53
67
  import {
54
68
  isRecord
55
- } from "./esm-chunks/chunk-VDJA4LP4.mjs";
69
+ } from "./esm-chunks/chunk-PZPJJBAS.mjs";
56
70
  import {
57
71
  __publicField
58
- } from "./esm-chunks/chunk-2TSM64HI.mjs";
72
+ } from "./esm-chunks/chunk-LTE7YMEG.mjs";
59
73
 
60
74
  // src/native-app-identity-project.ts
61
- import fs11 from "node:fs";
75
+ import fs13 from "node:fs";
62
76
  import { createRequire as createRequire2 } from "node:module";
63
- import path11 from "node:path";
77
+ import path13 from "node:path";
64
78
 
65
79
  // src/plist-bytes.ts
66
80
  import assert from "node:assert/strict";
@@ -196,8 +210,8 @@ function parsePlistBytes(source, parseXml = parsePlistSource) {
196
210
  // src/xcode-project.ts
197
211
  import { execFileSync as execFileSync3, spawnSync as spawnSync2 } from "node:child_process";
198
212
  import { createHash as createHash9 } from "node:crypto";
199
- import fs10 from "node:fs";
200
- import path10 from "node:path";
213
+ import fs12 from "node:fs";
214
+ import path12 from "node:path";
201
215
 
202
216
  // src/bazel-project.ts
203
217
  import { execFileSync } from "node:child_process";
@@ -265,12 +279,12 @@ function parseRule(raw) {
265
279
  const rule = raw.target.rule;
266
280
  if (typeof rule.name !== "string" || typeof rule.ruleClass !== "string") return null;
267
281
  const attrs = /* @__PURE__ */ new Map();
268
- for (const attribute of Array.isArray(rule.attribute) ? rule.attribute : []) {
269
- if (!isRecord(attribute) || typeof attribute.name !== "string") continue;
270
- attrs.set(attribute.name, {
271
- list: Array.isArray(attribute.stringListValue) ? attribute.stringListValue.filter((item) => typeof item === "string") : [],
272
- value: typeof attribute.stringValue === "string" ? attribute.stringValue : null,
273
- bool: typeof attribute.booleanValue === "boolean" ? attribute.booleanValue : null
282
+ for (const attribute2 of Array.isArray(rule.attribute) ? rule.attribute : []) {
283
+ if (!isRecord(attribute2) || typeof attribute2.name !== "string") continue;
284
+ attrs.set(attribute2.name, {
285
+ list: Array.isArray(attribute2.stringListValue) ? attribute2.stringListValue.filter((item) => typeof item === "string") : [],
286
+ value: typeof attribute2.stringValue === "string" ? attribute2.stringValue : null,
287
+ bool: typeof attribute2.booleanValue === "boolean" ? attribute2.booleanValue : null
274
288
  });
275
289
  }
276
290
  return {
@@ -323,14 +337,14 @@ function bazelGraph(root, label, configuration) {
323
337
  const digest = createHash("sha256").update(JSON.stringify([GRAPH_FORMAT, label, flags, QUERIED_RULES])).update(graphInputsDigest(root)).digest("hex").slice(0, 24);
324
338
  const file = path.join(root, ".build", "peach-bazel", `graph-${digest}.json`);
325
339
  const bazel = bazelBinary(root);
326
- const run = (args) => execFileSync(bazel, args, {
340
+ const run2 = (args) => execFileSync(bazel, args, {
327
341
  cwd: root,
328
342
  encoding: "utf8",
329
343
  maxBuffer: 1 << 30,
330
344
  stdio: ["ignore", "pipe", "pipe"]
331
345
  });
332
346
  if (!fs.existsSync(file)) {
333
- const application = run(["query", label, "--output=streamed_jsonproto"]);
347
+ const application = run2(["query", label, "--output=streamed_jsonproto"]);
334
348
  const app2 = parseRule({ target: JSON.parse(application.trim().split("\n")[0]) });
335
349
  if (!app2?.ruleClass.endsWith("_application"))
336
350
  throw new Error(
@@ -343,13 +357,13 @@ function bazelGraph(root, label, configuration) {
343
357
  const infoplists = app2.attrs.get("infoplists")?.list ?? [];
344
358
  const roots = [...deps, ...strings, ...resources];
345
359
  const query = `kind("${QUERIED_RULES.join("|")}", deps(set(${roots.join(" ")})))${infoplists.length > 0 ? ` + set(${infoplists.join(" ")})` : ""}`;
346
- const output = run(["cquery", query, ...flags, "--output=jsonproto"]);
360
+ const output = run2(["cquery", query, ...flags, "--output=jsonproto"]);
347
361
  const configured = JSON.parse(output);
348
362
  const clangLabels = (isRecord(configured) && Array.isArray(configured.results) ? configured.results : []).flatMap((raw) => {
349
363
  const rule = parseRule(raw);
350
364
  return rule?.ruleClass === "cc_library" ? [rule.label] : [];
351
365
  });
352
- const clang2 = clangLabels.length === 0 ? '{"results":[]}' : run([
366
+ const clang2 = clangLabels.length === 0 ? '{"results":[]}' : run2([
353
367
  "cquery",
354
368
  `set(${[...new Set(clangLabels)].join(" ")})`,
355
369
  ...flags.filter(
@@ -358,15 +372,15 @@ function bazelGraph(root, label, configuration) {
358
372
  ...CLANG_CONFIGURATION_FLAGS,
359
373
  "--output=jsonproto"
360
374
  ]);
361
- const defaults = run([
375
+ const defaults = run2([
362
376
  "cquery",
363
377
  query,
364
378
  ...flags,
365
379
  "--output=starlark",
366
380
  '--starlark:expr=str(target.label) + "\\t" + " ".join([f.short_path for f in target.files.to_list() if not f.is_source])'
367
381
  ]);
368
- const info2 = run(["info", "output_base", "execution_root"]);
369
- const bin = run(["cquery", deps[0], ...flags, "--output=files"]).split("\n").find((line) => line.includes("/bin/"));
382
+ const info2 = run2(["info", "output_base", "execution_root"]);
383
+ const bin = run2(["cquery", deps[0], ...flags, "--output=files"]).split("\n").find((line) => line.includes("/bin/"));
370
384
  if (!bin) throw new Error(`bazel cquery names no output for ${deps[0]}`);
371
385
  fs.mkdirSync(path.dirname(file), { recursive: true });
372
386
  fs.writeFileSync(
@@ -573,8 +587,8 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options2 =
573
587
  const moduleNameOf = (rule) => rule.attrs.get("module_name")?.value || splitLabel(rule.label).pkg.concat("_", splitLabel(rule.label).name).replace(/[^A-Za-z0-9_]/g, "_");
574
588
  const moduleMapOf = (rule) => path.join(products, "modulemaps", moduleNameOf(rule), "module.modulemap");
575
589
  const idOf = (rule) => `${root}/BUILD#${rule.label}`;
576
- const collectResources = (rule, attribute) => {
577
- for (const raw of rule.attrs.get(attribute)?.list ?? []) {
590
+ const collectResources = (rule, attribute2) => {
591
+ for (const raw of rule.attrs.get(attribute2)?.list ?? []) {
578
592
  const target = graph.rules.get(canonicalLabel(raw, rule.label));
579
593
  if (target?.ruleClass === "apple_resource_bundle") {
580
594
  const bundle = `${target.attrs.get("bundle_name")?.value || splitLabel(target.label).name}.bundle`;
@@ -1229,6 +1243,56 @@ import {
1229
1243
  writeFileSync
1230
1244
  } from "node:fs";
1231
1245
  import { join } from "node:path";
1246
+ var errorCode = (error) => error instanceof Error && "code" in error ? error.code : void 0;
1247
+ function processAlive(pid) {
1248
+ try {
1249
+ process.kill(pid, 0);
1250
+ return true;
1251
+ } catch (error) {
1252
+ return errorCode(error) !== "ESRCH";
1253
+ }
1254
+ }
1255
+ function tryAcquireNumberedLock(directory, detail = "") {
1256
+ mkdirSync(directory, { recursive: true });
1257
+ const claim = join(directory, `claim-${process.pid}-${randomUUID()}`);
1258
+ for (; ; ) {
1259
+ const numbers = readdirSync(directory).filter((name) => /^\d+$/.test(name)).map(Number);
1260
+ const top = Math.max(-1, ...numbers);
1261
+ let holder = "free";
1262
+ if (top >= 0) {
1263
+ try {
1264
+ holder = readFileSync(join(directory, String(top)), "utf8");
1265
+ } catch (error) {
1266
+ if (errorCode(error) === "ENOENT") continue;
1267
+ throw error;
1268
+ }
1269
+ }
1270
+ if (holder !== "free" && processAlive(Number(holder.split("\n")[0]))) return null;
1271
+ const held = join(directory, String(top + 1));
1272
+ writeFileSync(claim, `${process.pid}${detail ? `
1273
+ ${detail}` : ""}`);
1274
+ try {
1275
+ linkSync(claim, held);
1276
+ } catch (error) {
1277
+ if (errorCode(error) === "EEXIST") continue;
1278
+ throw error;
1279
+ } finally {
1280
+ rmSync(claim, { force: true });
1281
+ }
1282
+ if (readdirSync(directory).some((name) => Number(name) > top + 1)) {
1283
+ rmSync(held, { force: true });
1284
+ continue;
1285
+ }
1286
+ for (const number of numbers) rmSync(join(directory, String(number)), { force: true });
1287
+ let released = false;
1288
+ return () => {
1289
+ if (released) return;
1290
+ released = true;
1291
+ writeFileSync(claim, "free");
1292
+ renameSync(claim, held);
1293
+ };
1294
+ }
1295
+ }
1232
1296
 
1233
1297
  // src/rive-runtime-dependencies.ts
1234
1298
  import { execFileSync as execFileSync2 } from "node:child_process";
@@ -1237,6 +1301,351 @@ import fs2 from "node:fs";
1237
1301
  import os2 from "node:os";
1238
1302
  import path2 from "node:path";
1239
1303
  import { setTimeout as sleep } from "node:timers/promises";
1304
+ var RIVE_RUNTIME_BUNDLE = "dependencies.tar.gz";
1305
+ var RIVE_RUNTIME_SOURCES = {
1306
+ v6204: {
1307
+ name: "rive-runtime-6.20.4",
1308
+ revision: "7ab5bc0dcbb49467c451622c862029f2bd56e4ca",
1309
+ withCanvas: false
1310
+ },
1311
+ v6211: {
1312
+ name: "rive-runtime-6.21.1",
1313
+ revision: "c8252fe1f774c4b807d656621d1f93df6c5b92aa",
1314
+ withCanvas: false
1315
+ },
1316
+ v6280: {
1317
+ name: "rive-runtime-6.28.0",
1318
+ revision: "b9966d5effb9aece78c70934f0bd245523e47a18",
1319
+ withCanvas: true
1320
+ },
1321
+ v6281: {
1322
+ name: "rive-runtime-6.28.1",
1323
+ revision: "e04bb30881261a94643c9fede9be32ac620359d7",
1324
+ withCanvas: true
1325
+ }
1326
+ };
1327
+ var RECIPE = "rive-runtime-sim-2-private-yoga";
1328
+ var CONFIG = "release";
1329
+ var RUNTIME_LIBRARIES = [
1330
+ "rive_harfbuzz",
1331
+ "rive_yoga",
1332
+ "rive_sheenbidi",
1333
+ "miniaudio",
1334
+ "rive",
1335
+ "luau_vm"
1336
+ ];
1337
+ function riveRuntimeDependencyEntry({ name, revision, withCanvas }, { release, wasmSdkChecksum }) {
1338
+ const inputs = {
1339
+ upstream: revision,
1340
+ recipe: RECIPE,
1341
+ compiler: release,
1342
+ sdkChecksum: wasmSdkChecksum,
1343
+ canvas: String(withCanvas),
1344
+ target: SWIFT_WASM_TRIPLE
1345
+ };
1346
+ return { name, inputs, key: nativeEntryKey(inputs) };
1347
+ }
1348
+ async function buildRiveRuntimeDependencies(checkout, moduleRoot, source) {
1349
+ const entry = riveRuntimeDependencyEntry(source, {
1350
+ release: swiftModuleRelease(moduleRoot),
1351
+ wasmSdkChecksum: swiftModuleSdk(moduleRoot).wasmSdkChecksum
1352
+ });
1353
+ const native = process.platform === "darwin" ? await compileRiveRuntimeDependencies(
1354
+ checkout,
1355
+ moduleRoot,
1356
+ source.withCanvas,
1357
+ entry.key
1358
+ ) : void 0;
1359
+ const dependencies = path2.join(checkout, "dependencies");
1360
+ const stagedKey = native?.key ?? entry.key;
1361
+ const ready = () => {
1362
+ const stamp = path2.join(dependencies, ".peach-build");
1363
+ return fs2.existsSync(stamp) && fs2.readFileSync(stamp, "utf8") === stagedKey;
1364
+ };
1365
+ const release = await acquireBuildLock(dependencies + ".peach-lock");
1366
+ try {
1367
+ if (ready()) return;
1368
+ const staging = fs2.mkdtempSync(path2.join(checkout, ".peach-rive-"));
1369
+ try {
1370
+ if (native) {
1371
+ execFileSync2("cp", ["-Rc", native.output + "/.", staging]);
1372
+ bindRiveYoga(path2.join(staging, CONFIG), native.archiver);
1373
+ } else {
1374
+ const published = fetchNativeEntry("slice", entry.name, entry.key);
1375
+ if (!published)
1376
+ throw new Error(
1377
+ "RiveRuntime needs the Mac-built dependencies at " + nativeEntryPrefix("slice", entry.name, entry.key)
1378
+ );
1379
+ execFileSync2("tar", [
1380
+ "-xzf",
1381
+ path2.join(published, RIVE_RUNTIME_BUNDLE),
1382
+ "--no-same-owner",
1383
+ "--no-same-permissions",
1384
+ "-C",
1385
+ staging
1386
+ ]);
1387
+ }
1388
+ fs2.writeFileSync(path2.join(staging, ".peach-build"), stagedKey);
1389
+ fs2.chmodSync(staging, 493);
1390
+ fs2.rmSync(dependencies, { recursive: true, force: true });
1391
+ fs2.renameSync(staging, dependencies);
1392
+ } finally {
1393
+ fs2.rmSync(staging, { recursive: true, force: true });
1394
+ }
1395
+ } finally {
1396
+ release();
1397
+ }
1398
+ }
1399
+ async function compileRiveRuntimeDependencies(checkout, moduleRoot, withCanvas, entryKey) {
1400
+ const { toolchainBin } = swiftModuleToolchain(moduleRoot);
1401
+ const sdk = swiftSdkPaths(moduleRoot, toolchainBin);
1402
+ const minimum = 13e4;
1403
+ const common = [
1404
+ `--target=${SWIFT_WASM_TRIPLE}`,
1405
+ ...wasmThreadFlags,
1406
+ `--sysroot=${sdk.sysroot}`,
1407
+ "-fwasm-exceptions",
1408
+ "-mllvm",
1409
+ "-wasm-enable-sjlj",
1410
+ ...objcSdkIntakeFlags(sdk.darwin, toolchainBin, minimum),
1411
+ "-Wno-unused-command-line-argument"
1412
+ ];
1413
+ const objc = [...swiftObjCRuntimeFlags, "-fobjc-exceptions"];
1414
+ const xcode = execFileSync2("xcodebuild", ["-version"], { encoding: "utf8" });
1415
+ const key = createHash2("sha256").update(JSON.stringify([entryKey, toolchainBin, common, objc, xcode])).digest("hex").slice(0, 32);
1416
+ const output = path2.join(cacheDir(), "rive-runtime", key);
1417
+ const complete = path2.join(output, ".complete");
1418
+ if (!fs2.existsSync(complete)) {
1419
+ const release = await acquireBuildLock(output + ".lock");
1420
+ try {
1421
+ if (!fs2.existsSync(complete))
1422
+ build(checkout, output, toolchainBin, common, objc, withCanvas);
1423
+ } finally {
1424
+ release();
1425
+ }
1426
+ }
1427
+ return { key, output, archiver: path2.join(toolchainBin, "llvm-ar") };
1428
+ }
1429
+ async function acquireBuildLock(lock) {
1430
+ let release = tryAcquireNumberedLock(lock);
1431
+ while (!release) {
1432
+ await sleep(1e3);
1433
+ release = tryAcquireNumberedLock(lock);
1434
+ }
1435
+ return release;
1436
+ }
1437
+ function bindRiveYoga(libraries, archiver) {
1438
+ const symbols = /* @__PURE__ */ new Map();
1439
+ const yoga = readArMembers(fs2.readFileSync(path2.join(libraries, "librive_yoga_sim.a")));
1440
+ for (const { bytes } of yoga) {
1441
+ const { defined, globals, tags } = guestWasmSymbols(bytes);
1442
+ for (const name of defined) {
1443
+ if (!globals.includes(name) && !tags.includes(name))
1444
+ symbols.set(name, `rive_yoga_${name}`);
1445
+ }
1446
+ }
1447
+ if (!symbols.size)
1448
+ throw new Error("RiveRuntime: the bundled Yoga archive defines no symbols");
1449
+ for (const filename of fs2.readdirSync(libraries).filter((name) => name.endsWith(".a"))) {
1450
+ const archive = path2.join(libraries, filename);
1451
+ const members = readArMembers(fs2.readFileSync(archive));
1452
+ const bound = members.map(({ bytes }) => {
1453
+ const { defined, undefined: references } = guestWasmSymbols(bytes);
1454
+ return [...defined, ...references].some((name) => symbols.has(name)) ? bindPrivateWasmSymbols(bytes, symbols, "rive_yoga") : bytes;
1455
+ });
1456
+ if (bound.every((bytes, index) => bytes === members[index].bytes)) continue;
1457
+ const scratch = fs2.mkdtempSync(path2.join(libraries, ".yoga-"));
1458
+ try {
1459
+ const objects = members.map(({ name }, index) => {
1460
+ const member = `${index}-${path2.basename(name)}`;
1461
+ fs2.writeFileSync(path2.join(scratch, member), bound[index]);
1462
+ return member;
1463
+ });
1464
+ execFileSync2(archiver, ["rcsD", filename, ...objects], { cwd: scratch });
1465
+ fs2.renameSync(path2.join(scratch, filename), archive);
1466
+ } finally {
1467
+ fs2.rmSync(scratch, { recursive: true, force: true });
1468
+ }
1469
+ }
1470
+ }
1471
+ function build(checkout, output, toolchainBin, common, objc, withCanvas) {
1472
+ const work = `${output}.${process.pid}.work`;
1473
+ fs2.rmSync(work, { recursive: true, force: true });
1474
+ fs2.mkdirSync(work, { recursive: true });
1475
+ const source = path2.join(work, "rive-ios");
1476
+ execFileSync2("cp", ["-Rc", checkout, source]);
1477
+ fs2.rmSync(path2.join(source, "dependencies"), { recursive: true, force: true });
1478
+ const runtime = path2.join(source, "submodules/rive-runtime");
1479
+ const scripts = path2.join(runtime, "build");
1480
+ const logFile = path2.join(work, "build.log");
1481
+ const log = { file: logFile, fd: fs2.openSync(logFile, "w") };
1482
+ const canvas = withCanvas ? [
1483
+ "--with_rive_canvas",
1484
+ `--systemscript=${path2.join(source, "scripts/premake_options.lua")}`
1485
+ ] : [];
1486
+ const premakeArgs = [
1487
+ "--with_rive_layout",
1488
+ "--with_rive_audio=system",
1489
+ "--with_rive_text",
1490
+ "--with_rive_scripting",
1491
+ ...canvas
1492
+ ].join(" ");
1493
+ const base = {
1494
+ ...process.env,
1495
+ RIVE_RUNTIME_DIR: runtime,
1496
+ RIVE_PLS_DIR: path2.join(runtime, "renderer"),
1497
+ RIVE_PREMAKE_ARGS: premakeArgs
1498
+ };
1499
+ const premakeFile = `--file=${path2.join(runtime, "premake5_v2.lua")}`;
1500
+ run(
1501
+ path2.join(scripts, "build_rive.sh"),
1502
+ ["nobuild", premakeFile, "iossim", CONFIG],
1503
+ source,
1504
+ base,
1505
+ log
1506
+ );
1507
+ const tools = writeTools(path2.join(work, "tools"), toolchainBin, common, objc);
1508
+ const premakeDir = path2.join(
1509
+ scripts,
1510
+ "dependencies/premake-core/bin/v5.0.0-beta7_release"
1511
+ );
1512
+ const env = {
1513
+ ...base,
1514
+ PATH: [tools, scripts, process.env.PATH].join(path2.delimiter),
1515
+ PREMAKE_PATH: scripts
1516
+ };
1517
+ const dependencies = path2.join(source, "dependencies");
1518
+ const libraries = path2.join(dependencies, CONFIG);
1519
+ const includes = path2.join(dependencies, "includes");
1520
+ for (const directory of ["renderer", "rive", "cg_renderer"])
1521
+ fs2.mkdirSync(path2.join(includes, directory), { recursive: true });
1522
+ fs2.mkdirSync(libraries, { recursive: true });
1523
+ run(
1524
+ path2.join(scripts, "build_rive.sh"),
1525
+ [premakeFile, "iossim", CONFIG, "clean"],
1526
+ source,
1527
+ env,
1528
+ log
1529
+ );
1530
+ const runtimeOut = path2.join(source, `out/iossim_universal_${CONFIG}`);
1531
+ for (const name of RUNTIME_LIBRARIES)
1532
+ fs2.copyFileSync(
1533
+ path2.join(runtimeOut, `lib${name}.a`),
1534
+ path2.join(libraries, `lib${name}_sim.a`)
1535
+ );
1536
+ fs2.cpSync(path2.join(runtime, "include"), path2.join(includes, "rive", "include"), {
1537
+ recursive: true
1538
+ });
1539
+ const jobs = String(Number(process.env.TM_EXEC_CPU_CORES) || os2.availableParallelism());
1540
+ const component = (directory, target, args, headers) => {
1541
+ const cwd = path2.join(runtime, directory);
1542
+ const out = `out/iphonesimulator_${CONFIG}`;
1543
+ run(
1544
+ path2.join(premakeDir, "premake5"),
1545
+ [
1546
+ ...args,
1547
+ `--config=${CONFIG}`,
1548
+ `--out=${out}`,
1549
+ "--arch=universal",
1550
+ `--scripts=${scripts}`,
1551
+ "--os=ios",
1552
+ "--variant=emulator",
1553
+ "gmake2"
1554
+ ],
1555
+ cwd,
1556
+ env,
1557
+ log
1558
+ );
1559
+ run("make", ["-C", out, "-j", jobs, target], cwd, env, log);
1560
+ fs2.copyFileSync(
1561
+ path2.join(cwd, out, `lib${target}.a`),
1562
+ path2.join(libraries, `lib${target}_sim.a`)
1563
+ );
1564
+ if (headers)
1565
+ fs2.cpSync(path2.join(cwd, "include"), path2.join(includes, headers, "include"), {
1566
+ recursive: true
1567
+ });
1568
+ };
1569
+ component("cg_renderer", "rive_cg_renderer", [], "cg_renderer");
1570
+ component(
1571
+ "renderer",
1572
+ "rive_pls_renderer",
1573
+ [...canvas, "--file=premake5_pls_renderer.lua", "--with_objc_exceptions"],
1574
+ "renderer"
1575
+ );
1576
+ component(
1577
+ "decoders",
1578
+ "rive_decoders",
1579
+ ["--file=premake5_v2.lua", "--no_rive_jpeg", "--no_rive_png", "--no_rive_webp"],
1580
+ null
1581
+ );
1582
+ for (const entry of fs2.readdirSync(dependencies)) {
1583
+ const vm = path2.join(dependencies, entry, "VM/include");
1584
+ if (entry.startsWith("luigi-rosso_luau_") && fs2.existsSync(vm))
1585
+ fs2.cpSync(vm, path2.join(includes, "luau"), { recursive: true });
1586
+ const miniaudio = path2.join(dependencies, entry, "miniaudio.h");
1587
+ if (entry.includes("miniaudio") && fs2.existsSync(miniaudio)) {
1588
+ fs2.mkdirSync(path2.join(includes, "miniaudio"), { recursive: true });
1589
+ fs2.copyFileSync(miniaudio, path2.join(includes, "miniaudio/miniaudio.h"));
1590
+ }
1591
+ }
1592
+ fs2.closeSync(log.fd);
1593
+ fs2.rmSync(output, { recursive: true, force: true });
1594
+ fs2.mkdirSync(output, { recursive: true });
1595
+ for (const directory of [CONFIG, "includes"])
1596
+ fs2.renameSync(path2.join(dependencies, directory), path2.join(output, directory));
1597
+ fs2.renameSync(log.file, path2.join(output, "build.log"));
1598
+ fs2.writeFileSync(path2.join(output, ".complete"), "");
1599
+ fs2.rmSync(work, { recursive: true, force: true });
1600
+ }
1601
+ function run(command, args, cwd, env, log) {
1602
+ try {
1603
+ execFileSync2(command, args, { cwd, env, stdio: ["ignore", log.fd, log.fd] });
1604
+ } catch {
1605
+ throw new Error(
1606
+ `RiveRuntime: ${path2.basename(command)} ${args.join(" ")} failed; see ${log.file}`
1607
+ );
1608
+ }
1609
+ }
1610
+ function writeTools(directory, toolchainBin, common, objc) {
1611
+ const quote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
1612
+ const words = (values) => values.map(quote).join(" ");
1613
+ fs2.mkdirSync(directory, { recursive: true });
1614
+ const write = (name, text2) => fs2.writeFileSync(path2.join(directory, name), `#!/bin/bash
1615
+ ${text2}`, { mode: 493 });
1616
+ for (const name of ["clang", "clang++"])
1617
+ write(
1618
+ name,
1619
+ `args=(); objc=()
1620
+ while (( $# )); do
1621
+ case "$1" in
1622
+ -arch|-isysroot) shift 2 ;;
1623
+ --target=*-apple-*|-mios-version-min=*|-mios-simulator-version-min=*|-fembed-bitcode|-flto|-flto=*) shift ;;
1624
+ *.m|*.mm) objc=(${words(objc)}); args+=("$1"); shift ;;
1625
+ *) args+=("$1"); shift ;;
1626
+ esac
1627
+ done
1628
+ exec ${quote(path2.join(toolchainBin, name))} ${words(common)} "\${objc[@]}" "\${args[@]}"
1629
+ `
1630
+ );
1631
+ write("ar", `exec ${quote(path2.join(toolchainBin, "llvm-ar"))} "$@"
1632
+ `);
1633
+ write(
1634
+ "libtool",
1635
+ `out=; objects=()
1636
+ while (( $# )); do
1637
+ case "$1" in
1638
+ -o) out="$2"; shift 2 ;;
1639
+ -static|-no_warning_for_no_symbols) shift ;;
1640
+ *) objects+=("$1"); shift ;;
1641
+ esac
1642
+ done
1643
+ rm -f "$out"
1644
+ exec ${quote(path2.join(toolchainBin, "llvm-ar"))} rcs "$out" "\${objects[@]}"
1645
+ `
1646
+ );
1647
+ return directory;
1648
+ }
1240
1649
 
1241
1650
  // src/swift-shipped-archives.json
1242
1651
  var swift_shipped_archives_default = {
@@ -1291,6 +1700,66 @@ var SHIPPED_MODULES = new Map(
1291
1700
  );
1292
1701
 
1293
1702
  // src/swift-packages.ts
1703
+ var riveRuntimeProject = {
1704
+ project: "RiveRuntime.xcodeproj",
1705
+ target: "RiveRuntime",
1706
+ module: "RiveRuntime",
1707
+ configuration: "Release",
1708
+ machOType: "mh_dylib"
1709
+ };
1710
+ function riveRuntimeRecipe(source) {
1711
+ return {
1712
+ ...riveRuntimeProject,
1713
+ revision: source.revision,
1714
+ prepare: (checkout, moduleRoot) => buildRiveRuntimeDependencies(checkout, moduleRoot, source)
1715
+ };
1716
+ }
1717
+ var riveRuntime6204 = riveRuntimeRecipe(RIVE_RUNTIME_SOURCES.v6204);
1718
+ var riveRuntime6211 = riveRuntimeRecipe(RIVE_RUNTIME_SOURCES.v6211);
1719
+ var riveRuntime6281 = riveRuntimeRecipe(RIVE_RUNTIME_SOURCES.v6281);
1720
+ var sourceFrameworkRecipes = /* @__PURE__ */ new Map([
1721
+ [
1722
+ "438de2c5afb7dde20b640af35dd841961aa2aa4d2719e40c92d48bd2aa5dca56",
1723
+ {
1724
+ revision: "a49e7c2148ac9e38bd35ef4f13bc9d6ea3ff0b81",
1725
+ project: "Sentry.xcodeproj",
1726
+ target: "Sentry",
1727
+ module: "Sentry",
1728
+ configuration: "Release",
1729
+ machOType: "staticlib"
1730
+ }
1731
+ ],
1732
+ [
1733
+ "780558374b95d370e8b604097f9ccb2cac328fdd18c4b8542a58ece83d2548d2",
1734
+ {
1735
+ revision: "5421f94cc859eb65f5ae3866165a053aa634431e",
1736
+ project: "Sentry.xcodeproj",
1737
+ target: "Sentry",
1738
+ module: "Sentry",
1739
+ configuration: "Release",
1740
+ machOType: "staticlib",
1741
+ settings: { CARTHAGE: "YES" }
1742
+ }
1743
+ ],
1744
+ [
1745
+ "159842b63ab14ed1615fcace752c57b2633b3d3be6fadd4f643a1c8323b70e48",
1746
+ {
1747
+ revision: "5561a15a4836efe5d068a366b60599b7b794af70",
1748
+ project: "Simperium.xcodeproj",
1749
+ target: "Simperium_iOS",
1750
+ module: "Simperium",
1751
+ configuration: "Release",
1752
+ machOType: "mh_dylib"
1753
+ }
1754
+ ],
1755
+ ["660bb765c3ac35a6b427b9e03a37fe16eb40b88c735078cd5a35b8c1a36e9976", riveRuntime6204],
1756
+ ["2b326bbdd4bf36494f1fd1f063c9ba46e23d193dc51c30f6956450dc06ab2b32", riveRuntime6211],
1757
+ [
1758
+ "b571537569a087d3637f26d416502dbdbb6f0bdc7b8f329379b40f696b093406",
1759
+ riveRuntimeRecipe(RIVE_RUNTIME_SOURCES.v6280)
1760
+ ],
1761
+ ["6912ebf2cb6b5b99cac9a255f7d205cf8edf59a22fbdacd561a36d3820cc9baa", riveRuntime6281]
1762
+ ]);
1294
1763
  var execFileAsync = promisify(execFile);
1295
1764
 
1296
1765
  // src/expo-macro-host.ts
@@ -1337,7 +1806,10 @@ function hostMacro(root) {
1337
1806
  }
1338
1807
  if (header.equals(Buffer.from([127, 69, 76, 70]))) return { binary: installed };
1339
1808
  const release = privateSwiftRelease() ?? swiftNativePin().distribution.release;
1340
- const stamp = createHash4("sha256").update(`${release}\0${process.arch}\0host-syntax\0`);
1809
+ const host = path4.resolve(swiftToolchainBin(release), "../lib/swift/host");
1810
+ const stamp = createHash4("sha256").update(
1811
+ `${release}\0${process.arch}\0host-syntax\0${host}\0`
1812
+ );
1341
1813
  const sources = path4.join(source, "Sources");
1342
1814
  const swiftFiles = fs4.readdirSync(sources, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".swift")).sort();
1343
1815
  for (const file of [
@@ -1350,7 +1822,7 @@ function hostMacro(root) {
1350
1822
  const cache = path4.join(swiftCacheDir(), "expo-macro-host", stamp.digest("hex"));
1351
1823
  return {
1352
1824
  binary: path4.join(cache, "ExpoModulesMacros"),
1353
- build: { cache, release, source, sources, swiftFiles }
1825
+ build: { cache, release, host, source, sources, swiftFiles }
1354
1826
  };
1355
1827
  }
1356
1828
  function expoMacroBinary(root) {
@@ -1701,7 +2173,7 @@ import { join as join4, relative, sep } from "node:path";
1701
2173
  import { createHash as createHash6 } from "node:crypto";
1702
2174
  import { readFileSync as readFileSync2 } from "node:fs";
1703
2175
  import { join as join2 } from "node:path";
1704
- var swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"839661007eb801f3e3ec055a1f00c0e8b7a3d3be7f4bf1fc389ee6b5c2a290a6","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"2c235d7947d94c8a9f84b305f5453da8647c5c9f8180a38c59631868685b8723","swift-coverage/package.ts":"0f595bd55bcbd22bb337395f175d2aba23624d60f44d3309a61929629cc9b200","swift-coverage/xcode.ts":"059dd3b47d1ce4fe43acef97277c64b57507399866725a2144289eaa6ef8c1d4","swift-coverage/xcode-assets.ts":"a9314d1de1df0ce639a4402b66f89f8b20537f3fdadf0b7cf7355e6ac5b09f54","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"b7f31dd9c3c554bd69bff75cc9985a11032a394b405acc4b82be8f140a2a8676","swift-coverage/xcode-packages.ts":"d6b3d7fb1f5e32b4b08727927b794030d2f1285c7e3c41d7e8ab2e244a3d8c36","swift-coverage/xcode-strings.ts":"ef711d2a9039a08eb7d407546018ab22aafb0e883a65fc838bf864f5c5c9f85b","swift-coverage/reader.ts":"2562d668fd959c4ae3d24b765d3281b8d03251e8de65ec62bda305ba79f7d8c3","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"c48f98a53cd4a4e373e3c9501bc6e61a3122327b5a14023cf2002f5f3b1f2157","swift-package.ts":"f38b5d90724d3e98314d32b5934d9c3490cf9dde2d14391f29053e12310b6641","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"2554cb52cbc92147b4f71a2869829c12d7d909d6f5fc20fa4ee2f63a23319cf9","home-paths.ts":"93ce28fe049019acecf2a09b505aeb90df7505d64f4be89415771f966cb1b0c0","xcode-header-search.ts":"2c258ad4baf28df5e1134df8ada465637806da80912986c48e090b0a5fd34483","xcode-project.ts":"53c650529903e12842a1cd1562b62258e24a02f09823a13ed7750d6466ca1739","xcode-target-members.ts":"2379e6d411c5d63fa65ddc24c4e4fc8bfcd001b5be109b694c848fe62908db86","xcode-json-project.ts":"df6d6db28e0c8cfdf1f480e1e32d35f12c9cf1936642d5dda923889fb18a8fd6","openstep-plist.ts":"26ff311946e21d1b13f99be2767192b6fd52a339a0d2ccc9cc658a496dffca18"}') : swiftCoverageSourceDigests(join2(import.meta.dirname, ".."));
2176
+ var swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"839661007eb801f3e3ec055a1f00c0e8b7a3d3be7f4bf1fc389ee6b5c2a290a6","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"2c235d7947d94c8a9f84b305f5453da8647c5c9f8180a38c59631868685b8723","swift-coverage/package.ts":"0f595bd55bcbd22bb337395f175d2aba23624d60f44d3309a61929629cc9b200","swift-coverage/xcode.ts":"059dd3b47d1ce4fe43acef97277c64b57507399866725a2144289eaa6ef8c1d4","swift-coverage/xcode-assets.ts":"a9314d1de1df0ce639a4402b66f89f8b20537f3fdadf0b7cf7355e6ac5b09f54","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"b7f31dd9c3c554bd69bff75cc9985a11032a394b405acc4b82be8f140a2a8676","swift-coverage/xcode-packages.ts":"d6b3d7fb1f5e32b4b08727927b794030d2f1285c7e3c41d7e8ab2e244a3d8c36","swift-coverage/xcode-strings.ts":"ef711d2a9039a08eb7d407546018ab22aafb0e883a65fc838bf864f5c5c9f85b","swift-coverage/reader.ts":"2562d668fd959c4ae3d24b765d3281b8d03251e8de65ec62bda305ba79f7d8c3","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"c48f98a53cd4a4e373e3c9501bc6e61a3122327b5a14023cf2002f5f3b1f2157","swift-package.ts":"f38b5d90724d3e98314d32b5934d9c3490cf9dde2d14391f29053e12310b6641","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"98ab8d8e902c473d3e39ec6ffd9675152fac2fc2cc5bdd722b0fd6160e3cde59","home-paths.ts":"93ce28fe049019acecf2a09b505aeb90df7505d64f4be89415771f966cb1b0c0","xcode-header-search.ts":"2c258ad4baf28df5e1134df8ada465637806da80912986c48e090b0a5fd34483","xcode-project.ts":"98ec381762320ad18ba70b2e8f80da401019f59f0b7787b1f40478a807a2af73","xcode-target-members.ts":"2379e6d411c5d63fa65ddc24c4e4fc8bfcd001b5be109b694c848fe62908db86","xcode-json-project.ts":"df6d6db28e0c8cfdf1f480e1e32d35f12c9cf1936642d5dda923889fb18a8fd6","openstep-plist.ts":"26ff311946e21d1b13f99be2767192b6fd52a339a0d2ccc9cc658a496dffca18"}') : swiftCoverageSourceDigests(join2(import.meta.dirname, ".."));
1705
2177
 
1706
2178
  // src/swift-coverage/xcode-asset-symbols.ts
1707
2179
  import { existsSync, readdirSync as readdirSync2, readFileSync as readFileSync3 } from "node:fs";
@@ -1890,8 +2362,8 @@ var assetSymbolSettingKeys = [
1890
2362
  import fs7 from "node:fs";
1891
2363
  import path6 from "node:path";
1892
2364
  function relativeInside(root, file) {
1893
- const relative2 = path6.relative(root, file);
1894
- return relative2 === ".." || relative2.startsWith(`..${path6.sep}`) || path6.isAbsolute(relative2) ? null : relative2;
2365
+ const relative3 = path6.relative(root, file);
2366
+ return relative3 === ".." || relative3.startsWith(`..${path6.sep}`) || path6.isAbsolute(relative3) ? null : relative3;
1895
2367
  }
1896
2368
 
1897
2369
  // src/swift-xcframework.ts
@@ -1932,8 +2404,8 @@ function simulatorNativeLibrary(dir) {
1932
2404
  name = path7.basename(bundle, ".framework");
1933
2405
  file = path7.join(bundle, name);
1934
2406
  }
1935
- const relative2 = path7.relative(dir, file);
1936
- if (relative2.startsWith("..") || path7.isAbsolute(relative2))
2407
+ const relative3 = path7.relative(dir, file);
2408
+ if (relative3.startsWith("..") || path7.isAbsolute(relative3))
1937
2409
  throw new Error(`${dir}: library escapes its XCFramework`);
1938
2410
  if (framework) {
1939
2411
  matches.push({ name, file, slice, kind: "framework" });
@@ -1949,11 +2421,58 @@ function simulatorNativeLibrary(dir) {
1949
2421
  return matches[0];
1950
2422
  }
1951
2423
 
1952
- // src/xcode-intents.ts
1953
- import { createHash as createHash8 } from "node:crypto";
2424
+ // src/workspace-root.ts
1954
2425
  import fs9 from "node:fs";
1955
2426
  import path8 from "node:path";
1956
2427
 
2428
+ // ../one-bundler/src/workspaceRoot.ts
2429
+ import { existsSync as existsSync2, readFileSync as readFileSync5 } from "node:fs";
2430
+ import { dirname, join as join5, matchesGlob, posix, relative as relative2, sep as sep2 } from "node:path";
2431
+ function declaresWorkspaceMember(directory, app) {
2432
+ const manifest = join5(directory, "package.json");
2433
+ if (!existsSync2(manifest)) return false;
2434
+ const { workspaces } = JSON.parse(readFileSync5(manifest, "utf8"));
2435
+ const patterns = Array.isArray(workspaces) ? workspaces : workspaces?.packages;
2436
+ if (!Array.isArray(patterns)) return false;
2437
+ const member = relative2(directory, app).split(sep2).join("/");
2438
+ let included = false;
2439
+ for (const pattern of patterns) {
2440
+ if (typeof pattern !== "string") continue;
2441
+ const exclude = pattern.startsWith("!");
2442
+ const glob = posix.normalize(exclude ? pattern.slice(1) : pattern).replace(/\/$/, "");
2443
+ if (!matchesGlob(member, glob)) continue;
2444
+ if (exclude) return false;
2445
+ included = true;
2446
+ }
2447
+ return included;
2448
+ }
2449
+
2450
+ // src/workspace-root.ts
2451
+ var LOCKFILES = [
2452
+ "pnpm-workspace.yaml",
2453
+ "pnpm-lock.yaml",
2454
+ "package-lock.json",
2455
+ "yarn.lock",
2456
+ "bun.lock",
2457
+ "bun.lockb"
2458
+ ];
2459
+ function findWorkspaceRoot(app) {
2460
+ let nearest = null;
2461
+ let declared = null;
2462
+ for (let dir = app; ; dir = path8.dirname(dir)) {
2463
+ if (LOCKFILES.some((name) => fs9.existsSync(path8.join(dir, name)))) {
2464
+ nearest ?? (nearest = dir);
2465
+ if (dir !== app && declaresWorkspaceMember(dir, app)) declared = dir;
2466
+ }
2467
+ if (path8.dirname(dir) === dir) return declared ?? nearest ?? app;
2468
+ }
2469
+ }
2470
+
2471
+ // src/xcode-intents.ts
2472
+ import { createHash as createHash8 } from "node:crypto";
2473
+ import fs10 from "node:fs";
2474
+ import path9 from "node:path";
2475
+
1957
2476
  // src/intent-definition/fields.ts
1958
2477
  import assert2 from "node:assert/strict";
1959
2478
 
@@ -3494,17 +4013,17 @@ function preparePortableIntent(definition, derivedDirectory, prefix, language, m
3494
4013
  throw new Error(`${definition}: invalid intent code generation language ${language}`);
3495
4014
  if (prefix) identifier(prefix);
3496
4015
  if (module) identifier(module);
3497
- const source = fs9.readFileSync(definition);
4016
+ const source = fs10.readFileSync(definition);
3498
4017
  const key = createHash8("sha256").update(
3499
4018
  JSON.stringify([intentCompilerRevision, definition, prefix, language, module])
3500
4019
  ).update("\0").update(source).digest("hex");
3501
- const cache = path8.join(derivedDirectory, "IntentDefinitions");
3502
- const output = path8.join(cache, key);
3503
- const localization = definition.split(path8.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
3504
- const compiledRelative = path8.join("Resources", localization, path8.basename(definition));
3505
- const compiled = path8.join(output, compiledRelative);
3506
- const generated = path8.join(output, "Sources");
3507
- if (fs9.existsSync(compiled) && fs9.existsSync(generated)) return { compiled, generated };
4020
+ const cache = path9.join(derivedDirectory, "IntentDefinitions");
4021
+ const output = path9.join(cache, key);
4022
+ const localization = definition.split(path9.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
4023
+ const compiledRelative = path9.join("Resources", localization, path9.basename(definition));
4024
+ const compiled = path9.join(output, compiledRelative);
4025
+ const generated = path9.join(output, "Sources");
4026
+ if (fs10.existsSync(compiled) && fs10.existsSync(generated)) return { compiled, generated };
3508
4027
  let metadata;
3509
4028
  let sources;
3510
4029
  try {
@@ -3514,30 +4033,30 @@ function preparePortableIntent(definition, derivedDirectory, prefix, language, m
3514
4033
  } catch (cause) {
3515
4034
  throw new Error(`could not compile intent definition ${definition}`, { cause });
3516
4035
  }
3517
- fs9.mkdirSync(cache, { recursive: true });
3518
- const stage = fs9.mkdtempSync(path8.join(cache, ".compile-"));
4036
+ fs10.mkdirSync(cache, { recursive: true });
4037
+ const stage = fs10.mkdtempSync(path9.join(cache, ".compile-"));
3519
4038
  try {
3520
- const sourceDirectory = path8.join(stage, "Sources");
3521
- const resource = path8.join(stage, compiledRelative);
3522
- fs9.mkdirSync(sourceDirectory);
3523
- fs9.mkdirSync(path8.dirname(resource), { recursive: true });
3524
- fs9.writeFileSync(resource, metadata);
4039
+ const sourceDirectory = path9.join(stage, "Sources");
4040
+ const resource = path9.join(stage, compiledRelative);
4041
+ fs10.mkdirSync(sourceDirectory);
4042
+ fs10.mkdirSync(path9.dirname(resource), { recursive: true });
4043
+ fs10.writeFileSync(resource, metadata);
3525
4044
  for (const [file, contents] of sources)
3526
- fs9.writeFileSync(path8.join(sourceDirectory, file), contents);
4045
+ fs10.writeFileSync(path9.join(sourceDirectory, file), contents);
3527
4046
  try {
3528
- fs9.renameSync(stage, output);
4047
+ fs10.renameSync(stage, output);
3529
4048
  } catch (error) {
3530
- if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY" || !fs9.existsSync(compiled) || !fs9.existsSync(generated))
4049
+ if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY" || !fs10.existsSync(compiled) || !fs10.existsSync(generated))
3531
4050
  throw error;
3532
4051
  }
3533
4052
  return { compiled, generated };
3534
4053
  } finally {
3535
- fs9.rmSync(stage, { recursive: true, force: true });
4054
+ fs10.rmSync(stage, { recursive: true, force: true });
3536
4055
  }
3537
4056
  }
3538
4057
 
3539
4058
  // src/xcode-json-project.ts
3540
- import path9 from "node:path";
4059
+ import path10 from "node:path";
3541
4060
  var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
3542
4061
  var text = (value) => typeof value === "string" ? value : void 0;
3543
4062
  var items = (value) => Array.isArray(value) ? value : [];
@@ -3594,7 +4113,7 @@ var PHASE_ISA = {
3594
4113
  function readXcodeJsonProject(xcodeproj, source) {
3595
4114
  const json = Bun.JSON5.parse(source);
3596
4115
  if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
3597
- const projectDir = path9.dirname(xcodeproj);
4116
+ const projectDir = path10.dirname(xcodeproj);
3598
4117
  const objects = {};
3599
4118
  let next = 0;
3600
4119
  const add = (entry, id) => {
@@ -3607,7 +4126,7 @@ function readXcodeJsonProject(xcodeproj, source) {
3607
4126
  const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
3608
4127
  if (base) {
3609
4128
  if (base[1] === "PROJECT")
3610
- return { sourceTree: "<absolute>", path: path9.join(projectDir, base[2]) };
4129
+ return { sourceTree: "<absolute>", path: path10.join(projectDir, base[2]) };
3611
4130
  if (base[1] === "PRODUCTS")
3612
4131
  return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
3613
4132
  return null;
@@ -3615,7 +4134,7 @@ function readXcodeJsonProject(xcodeproj, source) {
3615
4134
  const unescaped = raw.replaceAll("\\<", "<");
3616
4135
  if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
3617
4136
  if (unescaped.startsWith("~")) return null;
3618
- return groupDir === null ? null : { sourceTree: "<absolute>", path: path9.join(groupDir, unescaped) };
4137
+ return groupDir === null ? null : { sourceTree: "<absolute>", path: path10.join(groupDir, unescaped) };
3619
4138
  };
3620
4139
  const memberships = [];
3621
4140
  const folders = [];
@@ -3626,7 +4145,7 @@ function readXcodeJsonProject(xcodeproj, source) {
3626
4145
  const kind = text(entry.kind) ?? "file-reference";
3627
4146
  const raw = text(entry.path) ?? "";
3628
4147
  const located = raw === "" ? null : locate(raw, parent.dir);
3629
- const name = text(entry.name) ?? path9.basename(raw);
4148
+ const name = text(entry.name) ?? path10.basename(raw);
3630
4149
  const node = { id: "", name, dir: null, parent, children: [] };
3631
4150
  if (kind === "group" || kind === "variant-group" || kind === "version-group") {
3632
4151
  node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
@@ -3730,14 +4249,14 @@ function readXcodeJsonProject(xcodeproj, source) {
3730
4249
  const reference = specialized.has(name) ? specialized.get(name) : file;
3731
4250
  const base = lookup(reference);
3732
4251
  const anchor = isObject(reference) ? lookupNode(reference.anchor, root)?.id : null;
3733
- const relative2 = isObject(reference) ? text(reference["relative-path"]) : null;
4252
+ const relative3 = isObject(reference) ? text(reference["relative-path"]) : null;
3734
4253
  return add({
3735
4254
  isa: "XCBuildConfiguration",
3736
4255
  name,
3737
4256
  buildSettings: settings,
3738
- ...base ? { baseConfigurationReference: base } : anchor && relative2 ? {
4257
+ ...base ? { baseConfigurationReference: base } : anchor && relative3 ? {
3739
4258
  baseConfigurationReferenceAnchor: anchor,
3740
- baseConfigurationReferenceRelativePath: relative2
4259
+ baseConfigurationReferenceRelativePath: relative3
3741
4260
  } : {}
3742
4261
  });
3743
4262
  })
@@ -3747,7 +4266,7 @@ function readXcodeJsonProject(xcodeproj, source) {
3747
4266
  if (!isObject(entry)) continue;
3748
4267
  const repository = text(entry.repository);
3749
4268
  const local = text(entry.path);
3750
- const name = local !== void 0 ? path9.basename(path9.resolve(path9.dirname(xcodeproj), local)) : path9.basename(repository ?? "").replace(/\.git$/, "");
4269
+ const name = local !== void 0 ? path10.basename(path10.resolve(path10.dirname(xcodeproj), local)) : path10.basename(repository ?? "").replace(/\.git$/, "");
3751
4270
  const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
3752
4271
  isa: "XCRemoteSwiftPackageReference",
3753
4272
  repositoryURL: repository ?? "",
@@ -3920,6 +4439,56 @@ function isJsonObject(value) {
3920
4439
  return typeof value === "object" && value !== null && !Array.isArray(value);
3921
4440
  }
3922
4441
 
4442
+ // src/xcode-scheme-actions.ts
4443
+ import fs11 from "node:fs";
4444
+ import path11 from "node:path";
4445
+ function decodeXml(text2) {
4446
+ return text2.replaceAll("&quot;", '"').replaceAll("&apos;", "'").replaceAll("&lt;", "<").replaceAll("&gt;", ">").replace(
4447
+ /&#(x[0-9a-f]+|[0-9]+);/gi,
4448
+ (_, code) => String.fromCodePoint(
4449
+ code[0] === "x" || code[0] === "X" ? Number.parseInt(code.slice(1), 16) : Number(code)
4450
+ )
4451
+ ).replaceAll("&amp;", "&");
4452
+ }
4453
+ var attribute = (text2, key) => {
4454
+ const value = new RegExp(`\\b${key}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
4455
+ return value === void 0 ? void 0 : decodeXml(value);
4456
+ };
4457
+ function schemeFiles(xcodeproj) {
4458
+ const users = path11.join(xcodeproj, "xcuserdata");
4459
+ return [
4460
+ path11.join(xcodeproj, "xcshareddata"),
4461
+ ...fs11.statSync(users, { throwIfNoEntry: false })?.isDirectory() ? fs11.readdirSync(users).sort().map((user) => path11.join(users, user)) : []
4462
+ ].flatMap((data) => {
4463
+ const directory = path11.join(data, "xcschemes");
4464
+ return fs11.existsSync(directory) ? fs11.readdirSync(directory).filter((name) => name.endsWith(".xcscheme")).sort().map((name) => path11.join(directory, name)) : [];
4465
+ });
4466
+ }
4467
+ function preActions(file) {
4468
+ const build2 = /<BuildAction\b[^>]*>([\s\S]*?)<\/BuildAction>/.exec(
4469
+ fs11.readFileSync(file, "utf8")
4470
+ )?.[1];
4471
+ const pre = build2 && /<PreActions>([\s\S]*?)<\/PreActions>/.exec(build2)?.[1];
4472
+ if (!pre) return [];
4473
+ return [...pre.matchAll(/<ExecutionAction\b([^>]*)>([\s\S]*?)<\/ExecutionAction>/g)].filter(([, head]) => attribute(head, "ActionType")?.endsWith("ShellScriptAction")).map(([, , body], index) => {
4474
+ const content = /<ActionContent\b([^>]*)>/.exec(body)?.[1] ?? "";
4475
+ const buildable = /<EnvironmentBuildable>[\s\S]*?<BuildableReference\b([^>]*)>/.exec(body)?.[1];
4476
+ return {
4477
+ id: `SchemePreAction-${index}`,
4478
+ name: attribute(content, "title") ?? "Run Script",
4479
+ script: attribute(content, "scriptText") ?? "",
4480
+ shell: attribute(content, "shellToInvoke") ?? "/bin/sh",
4481
+ environmentTarget: buildable && attribute(buildable, "BlueprintIdentifier")
4482
+ };
4483
+ });
4484
+ }
4485
+ function schemeBuildPreActions(xcodeproj, scheme) {
4486
+ const file = schemeFiles(xcodeproj).find(
4487
+ (candidate) => path11.basename(candidate) === `${scheme}.xcscheme`
4488
+ );
4489
+ return file ? preActions(file) : [];
4490
+ }
4491
+
3923
4492
  // src/xcode-swift-features.ts
3924
4493
  var upcomingFeatures = [
3925
4494
  ["CONCISE_MAGIC_FILE", "ConciseMagicFile", "swift6", true],
@@ -4027,28 +4596,28 @@ var CONDITIONS = {
4027
4596
  variant: "normal"
4028
4597
  };
4029
4598
  function walkFiles(dir) {
4030
- if (!fs10.existsSync(dir)) return [];
4599
+ if (!fs12.existsSync(dir)) return [];
4031
4600
  const out = [];
4032
- for (const entry of fs10.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
4601
+ for (const entry of fs12.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
4033
4602
  if (entry.name.startsWith(".")) continue;
4034
- const full = path10.join(dir, entry.name);
4603
+ const full = path12.join(dir, entry.name);
4035
4604
  if (entry.isDirectory()) out.push(...walkFiles(full));
4036
4605
  else if (entry.isFile()) out.push(full);
4037
4606
  }
4038
4607
  return out;
4039
4608
  }
4040
- var isDirectory = (dir) => fs10.existsSync(dir) && fs10.statSync(dir).isDirectory();
4609
+ var isDirectory = (dir) => fs12.existsSync(dir) && fs12.statSync(dir).isDirectory();
4041
4610
  function readXcconfig(file, read) {
4042
- if (read.includes(file) || !fs10.existsSync(file)) return {};
4611
+ if (read.includes(file) || !fs12.existsSync(file)) return {};
4043
4612
  read.push(file);
4044
4613
  const settings = {};
4045
- for (const raw of fs10.readFileSync(file, "utf8").split("\n")) {
4614
+ for (const raw of fs12.readFileSync(file, "utf8").split("\n")) {
4046
4615
  const line = raw.replace(/\/\/.*$/, "").trim();
4047
4616
  const include = /^#include\??\s+"([^"]+)"/.exec(line);
4048
4617
  if (include) {
4049
4618
  Object.assign(
4050
4619
  settings,
4051
- readXcconfig(path10.resolve(path10.dirname(file), include[1]), read)
4620
+ readXcconfig(path12.resolve(path12.dirname(file), include[1]), read)
4052
4621
  );
4053
4622
  continue;
4054
4623
  }
@@ -4093,32 +4662,29 @@ function applyOperator(value, operator) {
4093
4662
  return value.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
4094
4663
  case "standardizepath":
4095
4664
  if (value === ".") return value;
4096
- if (path10.posix.isAbsolute(value))
4097
- return path10.posix.normalize(value).replace(/(?<=.)\/$/, "");
4665
+ if (path12.posix.isAbsolute(value))
4666
+ return path12.posix.normalize(value).replace(/(?<=.)\/$/, "");
4098
4667
  return value.split("/").filter((component) => component !== "" && component !== ".").join("/");
4099
4668
  }
4100
4669
  throw new Error(`unsupported build setting operator :${operator}`);
4101
4670
  }
4102
- function decodeXml(text2) {
4103
- return text2.replaceAll("&quot;", '"').replaceAll("&apos;", "'").replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&amp;", "&");
4104
- }
4105
4671
  function workspaceReferences(workspace) {
4106
- const data = path10.join(workspace, "contents.xcworkspacedata");
4107
- if (!fs10.existsSync(data))
4672
+ const data = path12.join(workspace, "contents.xcworkspacedata");
4673
+ if (!fs12.existsSync(data))
4108
4674
  throw new Error(`${workspace} has no contents.xcworkspacedata`);
4109
- const container = path10.dirname(workspace);
4675
+ const container = path12.dirname(workspace);
4110
4676
  const locate = (location, base) => {
4111
4677
  const colon = location.indexOf(":");
4112
4678
  const kind = location.slice(0, colon);
4113
4679
  const rest = location.slice(colon + 1);
4114
- if (kind === "group") return path10.resolve(base, rest);
4115
- if (kind === "container" || kind === "self") return path10.resolve(container, rest);
4116
- if (kind === "absolute") return path10.resolve(rest);
4117
- throw new Error(`${path10.basename(workspace)} has an unsupported location ${location}`);
4680
+ if (kind === "group") return path12.resolve(base, rest);
4681
+ if (kind === "container" || kind === "self") return path12.resolve(container, rest);
4682
+ if (kind === "absolute") return path12.resolve(rest);
4683
+ throw new Error(`${path12.basename(workspace)} has an unsupported location ${location}`);
4118
4684
  };
4119
4685
  const groups = [container];
4120
4686
  const references = [];
4121
- for (const [, closing, tag, attributes, selfClosing] of fs10.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
4687
+ for (const [, closing, tag, attributes, selfClosing] of fs12.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
4122
4688
  if (closing) {
4123
4689
  if (tag === "Group") groups.pop();
4124
4690
  continue;
@@ -4169,8 +4735,8 @@ function remotePackageRequirements(projects) {
4169
4735
  var loaded = /* @__PURE__ */ new Map();
4170
4736
  function xcodeProjectFile(xcodeproj) {
4171
4737
  for (const name of ["project.pbxproj", "project.xcproj"]) {
4172
- const file = path10.join(xcodeproj, name);
4173
- if (fs10.existsSync(file)) return file;
4738
+ const file = path12.join(xcodeproj, name);
4739
+ if (fs12.existsSync(file)) return file;
4174
4740
  }
4175
4741
  return null;
4176
4742
  }
@@ -4178,7 +4744,7 @@ function loadProject(xcodeproj) {
4178
4744
  const projectFile = xcodeProjectFile(xcodeproj);
4179
4745
  if (!projectFile)
4180
4746
  throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
4181
- const source = fs10.readFileSync(projectFile, "utf8");
4747
+ const source = fs12.readFileSync(projectFile, "utf8");
4182
4748
  const digest = createHash9("sha256").update(source).digest("hex");
4183
4749
  const cached = loaded.get(projectFile);
4184
4750
  if (cached?.digest === digest) return cached.project;
@@ -4195,10 +4761,10 @@ function loadProject(xcodeproj) {
4195
4761
  if (!project || project.isa !== "PBXProject") {
4196
4762
  throw new Error(`${projectFile} has no PBXProject root`);
4197
4763
  }
4198
- const projectDir = fs10.realpathSync.native(
4199
- path10.resolve(path10.dirname(xcodeproj), str(project.projectDirPath) ?? "")
4764
+ const projectDir = fs12.realpathSync.native(
4765
+ path12.resolve(path12.dirname(xcodeproj), str(project.projectDirPath) ?? "")
4200
4766
  );
4201
- const resolvePath = xcodePathResolver(objects, projectDir, path10.join);
4767
+ const resolvePath = xcodePathResolver(objects, projectDir, path12.join);
4202
4768
  const result = {
4203
4769
  xcodeproj,
4204
4770
  projectFile,
@@ -4243,7 +4809,7 @@ function expandValue(value, settings) {
4243
4809
  return value;
4244
4810
  }
4245
4811
  function processedInfoPlist(name, file, settings, settingKeys) {
4246
- const source = file ? parsePlist(fs10.readFileSync(file, "utf8")) : {};
4812
+ const source = file ? parsePlist(fs12.readFileSync(file, "utf8")) : {};
4247
4813
  if (!source || typeof source !== "object" || Array.isArray(source) || source instanceof Date || Buffer.isBuffer(source))
4248
4814
  throw new Error(`${name} Info.plist must contain a dictionary`);
4249
4815
  const info = {};
@@ -4280,13 +4846,13 @@ function targetSettings(ref, configuration, builtins, options2 = {}, overrides =
4280
4846
  const name = str(config.name) ?? configuration;
4281
4847
  const base = str(config.baseConfigurationReference);
4282
4848
  const anchor = str(config.baseConfigurationReferenceAnchor);
4283
- const relative2 = str(config.baseConfigurationReferenceRelativePath);
4849
+ const relative3 = str(config.baseConfigurationReferenceRelativePath);
4284
4850
  const own = isDict(config.buildSettings) ? config.buildSettings : {};
4285
4851
  const directory = anchor ? project.resolvePath(anchor) : null;
4286
- const baseFile = base ? project.resolvePath(base) : directory && relative2 ? path10.resolve(directory, relative2) : null;
4287
- if ((options2.requireSources !== false || options2.installedPods) && (base || anchor || relative2) && (!baseFile || !fs10.existsSync(baseFile)))
4852
+ const baseFile = base ? project.resolvePath(base) : directory && relative3 ? path12.resolve(directory, relative3) : null;
4853
+ if ((options2.requireSources !== false || options2.installedPods) && (base || anchor || relative3) && (!baseFile || !fs12.existsSync(baseFile)))
4288
4854
  throw new Error(
4289
- `Unable to open base configuration reference file '${baseFile ?? base ?? relative2 ?? anchor}'`
4855
+ `Unable to open base configuration reference file '${baseFile ?? base ?? relative3 ?? anchor}'`
4290
4856
  );
4291
4857
  const read = [];
4292
4858
  const fromFile = baseFile ? readXcconfig(baseFile, read) : {};
@@ -4378,15 +4944,32 @@ function hostMacroPluginFlags(flags) {
4378
4944
  if (flags[index - 1] !== "-load-plugin-executable") return flag;
4379
4945
  const separator = flag.lastIndexOf("#");
4380
4946
  if (separator < 0) return flag;
4381
- const root = path10.dirname(path10.dirname(flag.slice(0, separator)));
4382
- const manifest = path10.join(root, "package.json");
4383
- if (!fs10.existsSync(manifest)) return flag;
4384
- const pkg = JSON.parse(fs10.readFileSync(manifest, "utf8"));
4947
+ const root = path12.dirname(path12.dirname(flag.slice(0, separator)));
4948
+ const manifest = path12.join(root, "package.json");
4949
+ if (!fs12.existsSync(manifest)) return flag;
4950
+ const pkg = JSON.parse(fs12.readFileSync(manifest, "utf8"));
4385
4951
  if (!isRecord(pkg) || typeof pkg.name !== "string" || !EXPO_MACRO_PACKAGES.includes(pkg.name))
4386
4952
  return flag;
4387
4953
  return expoMacroBinary(root) + flag.slice(separator);
4388
4954
  });
4389
4955
  }
4956
+ function ownNamedPackages(script, from) {
4957
+ const root = findWorkspaceRoot(from);
4958
+ for (const [, name] of script.matchAll(/node_modules\/((?:@[\w.-]+\/)?[\w.-]+)/g))
4959
+ for (let dir = from; relativeInside(root, dir) !== null; dir = path12.dirname(dir)) {
4960
+ const pkg = path12.join(dir, "node_modules", name);
4961
+ const stat = fs12.lstatSync(pkg, { throwIfNoEntry: false });
4962
+ if (!stat) continue;
4963
+ if (stat.isSymbolicLink() || walkFiles(pkg).some((file) => fs12.statSync(file).nlink > 1)) {
4964
+ const own = `${pkg}.peach-own`;
4965
+ fs12.rmSync(own, { recursive: true, force: true });
4966
+ fs12.cpSync(fs12.realpathSync(pkg), own, { recursive: true, verbatimSymlinks: true });
4967
+ fs12.rmSync(pkg, { recursive: true, force: true });
4968
+ fs12.renameSync(own, pkg);
4969
+ }
4970
+ break;
4971
+ }
4972
+ }
4390
4973
  function scriptCommand(shell, script) {
4391
4974
  const [executable, ...args] = settingList(shell);
4392
4975
  if (!executable) throw new Error("Xcode Run Script shellPath is empty");
@@ -4395,26 +4978,26 @@ function scriptCommand(shell, script) {
4395
4978
  return [executable, ...args, "-c", script];
4396
4979
  }
4397
4980
  function expandSearchPath(directory, rules2) {
4398
- if (path10.basename(directory) !== "**") return [directory];
4981
+ if (path12.basename(directory) !== "**") return [directory];
4399
4982
  const expanded = [];
4400
4983
  const seen = /* @__PURE__ */ new Set();
4401
- const queue = [path10.dirname(directory)];
4984
+ const queue = [path12.dirname(directory)];
4402
4985
  for (let at = 0; at < queue.length; at++) {
4403
4986
  const current = queue[at];
4404
4987
  let real;
4405
4988
  try {
4406
- real = fs10.realpathSync.native(current);
4989
+ real = fs12.realpathSync.native(current);
4407
4990
  } catch {
4408
4991
  continue;
4409
4992
  }
4410
- if (!fs10.statSync(real).isDirectory() || seen.has(real)) continue;
4993
+ if (!fs12.statSync(real).isDirectory() || seen.has(real)) continue;
4411
4994
  seen.add(real);
4412
4995
  expanded.push(current);
4413
- for (const entry of fs10.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
4996
+ for (const entry of fs12.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
4414
4997
  if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
4415
4998
  if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
4416
4999
  continue;
4417
- queue.push(path10.join(current, entry.name));
5000
+ queue.push(path12.join(current, entry.name));
4418
5001
  }
4419
5002
  }
4420
5003
  return expanded;
@@ -4425,7 +5008,7 @@ function searchedLinkerFlags(projectDir, settings, libraryDirectories) {
4425
5008
  const rules2 = recursiveSearchRules(settings);
4426
5009
  const directories = new Set(
4427
5010
  settingList(settings("LIBRARY_SEARCH_PATHS")).flatMap(
4428
- (raw) => expandSearchPath(path10.resolve(projectDir, expand(raw, settings)), rules2)
5011
+ (raw) => expandSearchPath(path12.resolve(projectDir, expand(raw, settings)), rules2)
4429
5012
  )
4430
5013
  );
4431
5014
  const resolved = [];
@@ -4438,18 +5021,18 @@ function searchedLinkerFlags(projectDir, settings, libraryDirectories) {
4438
5021
  }
4439
5022
  let archive;
4440
5023
  for (const directory of directories) {
4441
- const file = (extension) => path10.join(directory, `lib${name}.${extension}`);
5024
+ const file = (extension) => path12.join(directory, `lib${name}.${extension}`);
4442
5025
  const dylib = file("dylib");
4443
- const parent = path10.dirname(dylib);
5026
+ const parent = path12.dirname(dylib);
4444
5027
  let present = libraryDirectories.get(parent);
4445
5028
  if (present === void 0) {
4446
- present = fs10.existsSync(parent);
5029
+ present = fs12.existsSync(parent);
4447
5030
  libraryDirectories.set(parent, present);
4448
5031
  }
4449
5032
  if (!present) continue;
4450
- if (fs10.existsSync(dylib) || fs10.existsSync(file("tbd"))) break;
5033
+ if (fs12.existsSync(dylib) || fs12.existsSync(file("tbd"))) break;
4451
5034
  const staticLibrary = file("a");
4452
- if (!fs10.existsSync(staticLibrary)) continue;
5035
+ if (!fs12.existsSync(staticLibrary)) continue;
4453
5036
  archive = staticLibrary;
4454
5037
  break;
4455
5038
  }
@@ -4547,7 +5130,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
4547
5130
  for (const token of tokens) {
4548
5131
  if (token.startsWith("-")) break;
4549
5132
  const file = resolve(token);
4550
- if (file?.endsWith(".xcassets")) catalogs.push(path10.resolve(projectDir, file));
5133
+ if (file?.endsWith(".xcassets")) catalogs.push(path12.resolve(projectDir, file));
4551
5134
  }
4552
5135
  }
4553
5136
  return catalogs;
@@ -4592,16 +5175,16 @@ function shellCopies(script, settings, projectDir) {
4592
5175
  if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
4593
5176
  return [];
4594
5177
  copies.push({
4595
- from: path10.resolve(projectDir, operands[0]),
4596
- to: path10.resolve(projectDir, operands[1])
5178
+ from: path12.resolve(projectDir, operands[0]),
5179
+ to: path12.resolve(projectDir, operands[1])
4597
5180
  });
4598
5181
  }
4599
5182
  return copies;
4600
5183
  }
4601
5184
  function fileListEntries(file, absolute) {
4602
- return fs10.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
5185
+ return fs12.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
4603
5186
  }
4604
- function targetMembers(ref, settings, options2, settingKeys, projectInputs, preparePodSources) {
5187
+ function targetMembers(ref, settings, options2, settingKeys, projectInputs, preparePodSources, prepareSchemeActions) {
4605
5188
  const { project, target, id: targetId } = ref;
4606
5189
  const targetName = str(target.name) ?? targetId;
4607
5190
  const sources = /* @__PURE__ */ new Set();
@@ -4613,36 +5196,57 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs, prep
4613
5196
  const copiedFiles = [];
4614
5197
  let generatedInfoPlist = false;
4615
5198
  const declaredInfoPlist = settings("INFOPLIST_FILE");
4616
- const infoPlistOutput = declaredInfoPlist ? path10.resolve(project.projectDir, declaredInfoPlist) : null;
5199
+ const infoPlistOutput = declaredInfoPlist ? path12.resolve(project.projectDir, declaredInfoPlist) : null;
4617
5200
  const isPreparedOutput = (file) => file === infoPlistOutput || options2.requireSources !== false && file.endsWith(".swift");
4618
5201
  let absentSources = false;
4619
5202
  if (options2.prepareGeneratedSources === true && options2.requireSources !== false)
4620
5203
  project.visitMembers(
4621
5204
  targetId,
4622
- xcodePathResolver(project.objects, project.projectDir, path10.join, settings),
4623
- (file) => isDirectory(file) ? walkFiles(file) : fs10.existsSync(file) ? [file] : [],
4624
- path10.join,
5205
+ xcodePathResolver(project.objects, project.projectDir, path12.join, settings),
5206
+ (file) => isDirectory(file) ? walkFiles(file) : fs12.existsSync(file) ? [file] : [],
5207
+ path12.join,
4625
5208
  (file, kind) => {
4626
- if (kind !== "header" && kind !== "resource" && !fs10.existsSync(file))
5209
+ if (kind !== "header" && kind !== "resource" && !fs12.existsSync(file))
4627
5210
  absentSources = true;
4628
5211
  }
4629
5212
  );
4630
5213
  let beforeSources = true;
4631
- for (const phaseId of list(target.buildPhases)) {
4632
- const phase = project.object(phaseId);
5214
+ const preActions2 = prepareSchemeActions ? schemeBuildPreActions(project.xcodeproj, targetName).map((action) => ({
5215
+ ...action,
5216
+ environment: action.environmentTarget === targetId
5217
+ })) : [];
5218
+ const phases = [
5219
+ ...preActions2.map((action) => ({
5220
+ phaseId: action.id,
5221
+ preAction: action,
5222
+ phase: {
5223
+ isa: "PBXShellScriptBuildPhase",
5224
+ name: action.name,
5225
+ shellPath: action.shell,
5226
+ shellScript: action.script
5227
+ }
5228
+ })),
5229
+ ...list(target.buildPhases).map((phaseId) => ({
5230
+ phaseId,
5231
+ phase: project.object(phaseId)
5232
+ }))
5233
+ ];
5234
+ for (const { phaseId, preAction, phase } of phases) {
4633
5235
  if (phase?.isa === "PBXSourcesBuildPhase") beforeSources = false;
4634
5236
  if (phase?.isa !== "PBXShellScriptBuildPhase") continue;
4635
5237
  const script = str(phase.name) ?? phaseId;
4636
- for (const catalog of shellAssetCatalogs(
4637
- str(phase.shellScript) ?? "",
4638
- settings,
4639
- project.projectDir
4640
- ))
4641
- for (const file of walkFiles(catalog)) resources.add(file);
4642
- copiedFiles.push(
4643
- ...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
4644
- );
4645
- const absolute = (raw) => path10.resolve(project.projectDir, expand(raw, settings));
5238
+ if (!preAction) {
5239
+ for (const catalog of shellAssetCatalogs(
5240
+ str(phase.shellScript) ?? "",
5241
+ settings,
5242
+ project.projectDir
5243
+ ))
5244
+ for (const file of walkFiles(catalog)) resources.add(file);
5245
+ copiedFiles.push(
5246
+ ...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
5247
+ );
5248
+ }
5249
+ const absolute = (raw) => path12.resolve(project.projectDir, expand(raw, settings));
4646
5250
  const inputs = list(phase.inputPaths).map(absolute);
4647
5251
  const outputs = list(phase.outputPaths).map(absolute);
4648
5252
  const fileLists = /* @__PURE__ */ new Map();
@@ -4651,7 +5255,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs, prep
4651
5255
  kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
4652
5256
  ).map((raw) => {
4653
5257
  const file = absolute(raw);
4654
- if (!fs10.existsSync(file)) {
5258
+ if (!fs12.existsSync(file)) {
4655
5259
  return { file, entries: [] };
4656
5260
  }
4657
5261
  return { file, entries: fileListEntries(file, absolute) };
@@ -4672,22 +5276,23 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs, prep
4672
5276
  ...fileLists.get("OUTPUT").map((item) => item.file)
4673
5277
  ];
4674
5278
  if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
4675
- for (const file of inputFiles) if (fs10.existsSync(file)) projectInputs.add(file);
5279
+ for (const file of inputFiles) if (fs12.existsSync(file)) projectInputs.add(file);
4676
5280
  }
4677
5281
  const undeclaredGenerator = absentSources && beforeSources && allOutputs.length === 0 && str(phase.runOnlyForDeploymentPostprocessing) !== "1";
4678
- const podSourcePhase = preparePodSources && beforeSources && script.startsWith("[CP-User] ") && str(phase.runOnlyForDeploymentPostprocessing) !== "1";
4679
- if (options2.prepareGeneratedSources === true && (allOutputs.some(isPreparedOutput) || undeclaredGenerator) || podSourcePhase) {
4680
- const phaseDir = path10.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
5282
+ const sourcePhaseMode = preAction ? prepareSchemeActions : beforeSources && script.startsWith("[CP-User] ") && str(phase.runOnlyForDeploymentPostprocessing) !== "1" ? preparePodSources : void 0;
5283
+ const sourcePhase = sourcePhaseMode !== void 0;
5284
+ if (options2.prepareGeneratedSources === true && (allOutputs.some(isPreparedOutput) || undeclaredGenerator) || sourcePhase) {
5285
+ const phaseDir = path12.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
4681
5286
  for (const lists of fileLists.values())
4682
5287
  for (const { file } of lists)
4683
- if (!fs10.existsSync(file))
5288
+ if (!fs12.existsSync(file))
4684
5289
  throw new Error(
4685
5290
  `${targetName}: Run Script "${script}" missing file list ${file}`
4686
5291
  );
4687
5292
  const env = {
4688
5293
  ...process.env,
4689
5294
  ...Object.fromEntries(
4690
- [...settingKeys].filter((key2) => /^[A-Za-z_][A-Za-z0-9_]*$/.test(key2)).map((key2) => [key2, settings(key2)])
5295
+ [...preAction && !preAction.environment ? [] : settingKeys].filter((key2) => /^[A-Za-z_][A-Za-z0-9_]*$/.test(key2)).map((key2) => [key2, settings(key2)])
4691
5296
  )
4692
5297
  };
4693
5298
  const declared = { INPUT: inputs, OUTPUT: outputs };
@@ -4699,7 +5304,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs, prep
4699
5304
  const lists = fileLists.get(kind);
4700
5305
  env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
4701
5306
  lists.forEach((_item, index) => {
4702
- env[`SCRIPT_${kind}_FILE_LIST_${index}`] = path10.join(
5307
+ env[`SCRIPT_${kind}_FILE_LIST_${index}`] = path12.join(
4703
5308
  phaseDir,
4704
5309
  `${kind}-${index}.xcfilelist`
4705
5310
  );
@@ -4715,23 +5320,23 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs, prep
4715
5320
  if (expoScanner) signature.update("\0").update(expoScanner);
4716
5321
  for (const file of inputFiles) {
4717
5322
  signature.update(file);
4718
- if (fs10.existsSync(file)) {
4719
- const stat = fs10.statSync(file);
5323
+ if (fs12.existsSync(file)) {
5324
+ const stat = fs12.statSync(file);
4720
5325
  signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
4721
5326
  } else signature.update("missing");
4722
5327
  }
4723
5328
  const stamp = signature.digest("hex");
4724
5329
  const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
4725
- const receipt = podSourcePhase && preparePodSources === "prepared" ? path10.join(phaseDir, "source-phase.sha256") : null;
4726
- if ((preparedSourcePhases.get(key) === stamp || receipt && fs10.existsSync(receipt) && fs10.readFileSync(receipt, "utf8") === stamp) && allOutputs.every((file) => fs10.existsSync(file)))
5330
+ const receipt = sourcePhaseMode === "prepared" ? path12.join(phaseDir, "source-phase.sha256") : null;
5331
+ if ((preparedSourcePhases.get(key) === stamp || receipt && fs12.existsSync(receipt) && fs12.readFileSync(receipt, "utf8") === stamp) && allOutputs.every((file) => fs12.existsSync(file)))
4727
5332
  continue;
4728
- fs10.mkdirSync(phaseDir, { recursive: true });
5333
+ fs12.mkdirSync(phaseDir, { recursive: true });
4729
5334
  if (process.platform === "linux") {
4730
5335
  const bin = swiftToolchainBin(
4731
5336
  privateSwiftRelease() ?? swiftNativePin().distribution.release
4732
5337
  );
4733
- const startup = path10.join(phaseDir, "peach-tools.sh");
4734
- fs10.writeFileSync(
5338
+ const startup = path12.join(phaseDir, "peach-tools.sh");
5339
+ fs12.writeFileSync(
4735
5340
  startup,
4736
5341
  'if [[ -n "$PEACH_PHASE_BASH_ENV" ]]; then source "$PEACH_PHASE_BASH_ENV"; fi\nexport PATH="$PEACH_PHASE_TOOLCHAIN:$PATH"\n'
4737
5342
  );
@@ -4740,24 +5345,24 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs, prep
4740
5345
  env.PEACH_PHASE_TOOLCHAIN = bin;
4741
5346
  env.PEACH_PHASE_BASH_ENV = env.BASH_ENV;
4742
5347
  env.BASH_ENV = startup;
4743
- env.PATH = [bin, env.PATH].filter(Boolean).join(path10.delimiter);
5348
+ env.PATH = [bin, env.PATH].filter(Boolean).join(path12.delimiter);
4744
5349
  }
4745
- fs10.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
4746
- fs10.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
5350
+ fs12.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
5351
+ fs12.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
4747
5352
  for (const output of allOutputs)
4748
- fs10.mkdirSync(path10.dirname(output), { recursive: true });
5353
+ fs12.mkdirSync(path12.dirname(output), { recursive: true });
4749
5354
  for (const [kind, lists] of fileLists)
4750
5355
  lists.forEach((item, index) => {
4751
- fs10.writeFileSync(
5356
+ fs12.writeFileSync(
4752
5357
  env[`SCRIPT_${kind}_FILE_LIST_${index}`],
4753
5358
  `${item.entries.join("\n")}
4754
5359
  `
4755
5360
  );
4756
5361
  });
4757
5362
  if (expoProvider) {
4758
- const preloadPath = path10.join(phaseDir, "expo-scan-host.cjs");
4759
- fs10.mkdirSync(phaseDir, { recursive: true });
4760
- fs10.writeFileSync(
5363
+ const preloadPath = path12.join(phaseDir, "expo-scan-host.cjs");
5364
+ fs12.mkdirSync(phaseDir, { recursive: true });
5365
+ fs12.writeFileSync(
4761
5366
  preloadPath,
4762
5367
  [
4763
5368
  "const cp = require('node:child_process');",
@@ -4775,6 +5380,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs, prep
4775
5380
  const quoted = `"${preloadPath.replace(/["\\]/g, "\\$&")}"`;
4776
5381
  env.NODE_OPTIONS = [env.NODE_OPTIONS, `--require ${quoted}`].filter(Boolean).join(" ");
4777
5382
  }
5383
+ if (sourcePhaseMode === "prepared") ownNamedPackages(rawScript, project.projectDir);
4778
5384
  try {
4779
5385
  const [shell, ...args] = scriptCommand(
4780
5386
  str(phase.shellPath) ?? "/bin/sh",
@@ -4796,21 +5402,21 @@ ${output}`
4796
5402
  );
4797
5403
  }
4798
5404
  const missing = allOutputs.filter(
4799
- (file) => file === infoPlistOutput && !fs10.existsSync(file)
5405
+ (file) => file === infoPlistOutput && !fs12.existsSync(file)
4800
5406
  );
4801
5407
  if (missing.length > 0)
4802
5408
  throw new Error(
4803
5409
  `${targetName}: Run Script "${script}" did not produce ${missing.join(", ")}`
4804
5410
  );
4805
- if (receipt) fs10.writeFileSync(receipt, stamp);
5411
+ if (receipt) fs12.writeFileSync(receipt, stamp);
4806
5412
  preparedSourcePhases.set(key, stamp);
4807
5413
  }
4808
5414
  }
4809
5415
  project.visitMembers(
4810
5416
  targetId,
4811
- xcodePathResolver(project.objects, project.projectDir, path10.join, settings),
4812
- (file) => isDirectory(file) ? walkFiles(file) : fs10.existsSync(file) ? [file] : [],
4813
- path10.join,
5417
+ xcodePathResolver(project.objects, project.projectDir, path12.join, settings),
5418
+ (file) => isDirectory(file) ? walkFiles(file) : fs12.existsSync(file) ? [file] : [],
5419
+ path12.join,
4814
5420
  (file, kind, bundleName) => {
4815
5421
  if (kind === "header") {
4816
5422
  headers.add(file);
@@ -4821,9 +5427,9 @@ ${output}`
4821
5427
  if (bundleName) resourceNames[file] = bundleName;
4822
5428
  return;
4823
5429
  }
4824
- if (!fs10.existsSync(file)) {
5430
+ if (!fs12.existsSync(file)) {
4825
5431
  if (options2.requireSources === false) return;
4826
- const script = scriptForOutput.get(path10.normalize(file));
5432
+ const script = scriptForOutput.get(path12.normalize(file));
4827
5433
  throw new Error(
4828
5434
  script ? `${targetName}: missing generated source ${file} (Run Script "${script}" declares it in outputPaths; run the script or check in its output)` : `${targetName}: missing source ${file}`
4829
5435
  );
@@ -4832,23 +5438,23 @@ ${output}`
4832
5438
  if (file.endsWith(".swift")) sources.add(file);
4833
5439
  }
4834
5440
  );
4835
- if (options2.prepareGeneratedSources && options2.requireSources !== false) {
5441
+ if (options2.prepareGeneratedSources && (options2.requireSources !== false || options2.compileInterfaceResources)) {
4836
5442
  const interfaceFiles = [...resources].filter(
4837
- (file) => /\.(storyboard|xib)$/.test(file) && !file.split(path10.sep).some((part) => part.endsWith(".bundle"))
5443
+ (file) => /\.(storyboard|xib)$/.test(file) && !file.split(path12.sep).some((part) => part.endsWith(".bundle"))
4838
5444
  );
4839
5445
  let launchName = settings("INFOPLIST_KEY_UILaunchStoryboardName");
4840
- if (process.platform !== "darwin" && !launchName && infoPlistOutput && fs10.existsSync(infoPlistOutput)) {
4841
- const info = parsePlist(fs10.readFileSync(infoPlistOutput, "utf8"));
5446
+ if (process.platform !== "darwin" && !launchName && infoPlistOutput && fs12.existsSync(infoPlistOutput)) {
5447
+ const info = parsePlist(fs12.readFileSync(infoPlistOutput, "utf8"));
4842
5448
  const declared = isRecord(info) ? info.UILaunchStoryboardName : void 0;
4843
5449
  if (typeof declared === "string") launchName = expand(declared, settings);
4844
5450
  }
4845
5451
  const interfaceOutputs = /* @__PURE__ */ new Set();
4846
5452
  for (const file of interfaceFiles) {
4847
- const localization = file.split(path10.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
5453
+ const localization = file.split(path12.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
4848
5454
  const isStoryboard = file.endsWith(".storyboard");
4849
5455
  const extension = isStoryboard ? ".storyboardc" : ".nib";
4850
- const name = path10.basename(file, path10.extname(file));
4851
- const output = path10.join(
5456
+ const name = path12.basename(file, path12.extname(file));
5457
+ const output = path12.join(
4852
5458
  settings("DERIVED_FILE_DIR"),
4853
5459
  "InterfaceBuilder",
4854
5460
  localization,
@@ -4867,28 +5473,29 @@ ${output}`
4867
5473
  const inputs = JSON.stringify([
4868
5474
  1,
4869
5475
  args,
4870
- createHash9("sha256").update(fs10.readFileSync(file)).digest("hex")
5476
+ createHash9("sha256").update(fs12.readFileSync(file)).digest("hex")
4871
5477
  ]);
4872
5478
  const developer = settings("DEVELOPER_DIR");
4873
- const cached = fs10.existsSync(output) && fs10.existsSync(stamp) ? fs10.readFileSync(stamp, "utf8").split("\n") : [];
5479
+ const cached = fs12.existsSync(output) && fs12.existsSync(stamp) ? fs12.readFileSync(stamp, "utf8").split("\n") : [];
4874
5480
  projectInputs.add(file);
4875
5481
  resources.delete(file);
4876
5482
  if (cached[0] !== inputs || process.platform === "darwin" && cached[1] !== developer) {
4877
5483
  if (process.platform !== "darwin") {
4878
- if (isStoryboard && name === launchName) continue;
5484
+ if (isStoryboard && name === launchName || options2.requireSources === false)
5485
+ continue;
4879
5486
  throw new Error(
4880
5487
  `${targetName}: Interface Builder compilation requires macOS and Xcode`
4881
5488
  );
4882
5489
  }
4883
- fs10.rmSync(output, { recursive: true, force: true });
4884
- fs10.rmSync(stamp, { force: true });
4885
- fs10.mkdirSync(path10.dirname(output), { recursive: true });
5490
+ fs12.rmSync(output, { recursive: true, force: true });
5491
+ fs12.rmSync(stamp, { force: true });
5492
+ fs12.mkdirSync(path12.dirname(output), { recursive: true });
4886
5493
  execFileSync3("xcrun", ["ibtool", "--compile", output, file, ...args], {
4887
5494
  cwd: project.projectDir,
4888
5495
  stdio: ["ignore", "pipe", "pipe"],
4889
5496
  timeout: runScriptTimeoutMs
4890
5497
  });
4891
- fs10.writeFileSync(stamp, `${inputs}
5498
+ fs12.writeFileSync(stamp, `${inputs}
4892
5499
  ${developer}
4893
5500
  `);
4894
5501
  }
@@ -4930,34 +5537,34 @@ ${developer}
4930
5537
  function commonAncestor(dirs) {
4931
5538
  let common = dirs[0];
4932
5539
  for (const dir of dirs) {
4933
- while (common !== path10.dirname(common) && path10.relative(common, dir).startsWith(".."))
4934
- common = path10.dirname(common);
5540
+ while (common !== path12.dirname(common) && path12.relative(common, dir).startsWith(".."))
5541
+ common = path12.dirname(common);
4935
5542
  }
4936
5543
  return common;
4937
5544
  }
4938
- var isPodsProject = (xcodeproj) => path10.basename(xcodeproj) === "Pods.xcodeproj" && path10.basename(path10.dirname(xcodeproj)) === "Pods";
5545
+ var isPodsProject = (xcodeproj) => path12.basename(xcodeproj) === "Pods.xcodeproj" && path12.basename(path12.dirname(xcodeproj)) === "Pods";
4939
5546
  function installedPodsSandbox(pods) {
4940
- const podfileLock = path10.join(path10.dirname(pods), "Podfile.lock");
4941
- const manifestLock = path10.join(pods, "Manifest.lock");
4942
- if (!fs10.existsSync(podfileLock))
5547
+ const podfileLock = path12.join(path12.dirname(pods), "Podfile.lock");
5548
+ const manifestLock = path12.join(pods, "Manifest.lock");
5549
+ if (!fs12.existsSync(podfileLock))
4943
5550
  throw new Error(
4944
- `${pods} has no ${podfileLock}: run \`pod install\` in ${path10.dirname(pods)}`
5551
+ `${pods} has no ${podfileLock}: run \`pod install\` in ${path12.dirname(pods)}`
4945
5552
  );
4946
- if (!fs10.existsSync(manifestLock) || !fs10.readFileSync(manifestLock).equals(fs10.readFileSync(podfileLock)))
5553
+ if (!fs12.existsSync(manifestLock) || !fs12.readFileSync(manifestLock).equals(fs12.readFileSync(podfileLock)))
4947
5554
  throw new Error(
4948
- `The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${path10.dirname(pods)}`
5555
+ `The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${path12.dirname(pods)}`
4949
5556
  );
4950
5557
  const specChecksums = {};
4951
- const lines = fs10.readFileSync(manifestLock, "utf8").split("\n");
5558
+ const lines = fs12.readFileSync(manifestLock, "utf8").split("\n");
4952
5559
  const start = lines.indexOf("SPEC CHECKSUMS:");
4953
5560
  for (const line of start === -1 ? [] : lines.slice(start + 1)) {
4954
5561
  const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
4955
5562
  if (!entry) break;
4956
5563
  specChecksums[entry[1]] = entry[2];
4957
5564
  }
4958
- const specs = path10.join(pods, "Local Podspecs");
4959
- const generated = path10.join(pods, POD_GRAPH_SPECIFICATIONS);
4960
- if (fs10.existsSync(generated))
5565
+ const specs = path12.join(pods, "Local Podspecs");
5566
+ const generated = path12.join(pods, POD_GRAPH_SPECIFICATIONS);
5567
+ if (fs12.existsSync(generated))
4961
5568
  return {
4962
5569
  podfileLock,
4963
5570
  manifestLock,
@@ -4965,15 +5572,15 @@ function installedPodsSandbox(pods) {
4965
5572
  localPodspecs: readPodGraphSpecifications(generated),
4966
5573
  specificationFiles: [generated]
4967
5574
  };
4968
- const specificationFiles = isDirectory(specs) ? fs10.readdirSync(specs).filter((name) => name.endsWith(".podspec.json")).sort().map((name) => path10.join(specs, name)) : [];
5575
+ const specificationFiles = isDirectory(specs) ? fs12.readdirSync(specs).filter((name) => name.endsWith(".podspec.json")).sort().map((name) => path12.join(specs, name)) : [];
4969
5576
  return {
4970
5577
  podfileLock,
4971
5578
  manifestLock,
4972
5579
  specChecksums,
4973
5580
  localPodspecs: new Map(
4974
5581
  specificationFiles.map((file) => [
4975
- path10.basename(file, ".podspec.json"),
4976
- fs10.readFileSync(file, "utf8")
5582
+ path12.basename(file, ".podspec.json"),
5583
+ fs12.readFileSync(file, "utf8")
4977
5584
  ])
4978
5585
  ),
4979
5586
  specificationFiles
@@ -4988,14 +5595,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
4988
5595
  if (!xcodeProjectFile(xcodeproj)) {
4989
5596
  if (installedPods && isPodsProject(xcodeproj))
4990
5597
  throw new Error(
4991
- `${path10.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${path10.dirname(path10.dirname(xcodeproj))}`
5598
+ `${path12.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${path12.dirname(path12.dirname(xcodeproj))}`
4992
5599
  );
4993
5600
  return;
4994
5601
  }
4995
- const key = fs10.realpathSync.native(xcodeproj);
4996
- if (projectAt.has(key) || !installedPods && key.split(path10.sep).includes("Pods"))
5602
+ const key = fs12.realpathSync.native(xcodeproj);
5603
+ if (projectAt.has(key) || !installedPods && key.split(path12.sep).includes("Pods"))
4997
5604
  return;
4998
- if (isPodsProject(key)) cocoapods = installedPodsSandbox(path10.dirname(key));
5605
+ if (isPodsProject(key)) cocoapods = installedPodsSandbox(path12.dirname(key));
4999
5606
  const project = loadProject(key);
5000
5607
  projectAt.set(key, project);
5001
5608
  projects.push(project);
@@ -5011,12 +5618,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
5011
5618
  for (const reference of listed)
5012
5619
  if (reference.endsWith(".xcodeproj")) addProject(reference);
5013
5620
  if (projects.length === 0) {
5014
- throw new Error(`${path10.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
5621
+ throw new Error(`${path12.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
5015
5622
  }
5016
- const podfile = path10.join(path10.dirname(xcodeprojOrWorkspace), "Podfile");
5017
- if (installedPods && !cocoapods && fs10.existsSync(podfile))
5623
+ const podfile = path12.join(path12.dirname(xcodeprojOrWorkspace), "Podfile");
5624
+ if (installedPods && !cocoapods && fs12.existsSync(podfile))
5018
5625
  throw new Error(
5019
- `${podfile} is not installed into ${path10.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${path10.dirname(podfile)} and open the workspace it writes`
5626
+ `${podfile} is not installed into ${path12.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${path12.dirname(podfile)} and open the workspace it writes`
5020
5627
  );
5021
5628
  return { listed, projects, projectAt, cocoapods };
5022
5629
  }
@@ -5054,7 +5661,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options2 = {}) {
5054
5661
  return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options2)).map((ref) => str(ref.target.name) ?? ref.id);
5055
5662
  }
5056
5663
  function defaultXcodeAppTarget(xcodeproj) {
5057
- const project = loadProject(fs10.realpathSync.native(xcodeproj));
5664
+ const project = loadProject(fs12.realpathSync.native(xcodeproj));
5058
5665
  for (const [id, target] of Object.entries(project.objects)) {
5059
5666
  if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
5060
5667
  if (isIosAppTarget({ project, id, target }, { requireSources: false }))
@@ -5062,49 +5669,49 @@ function defaultXcodeAppTarget(xcodeproj) {
5062
5669
  }
5063
5670
  }
5064
5671
  function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
5065
- const container = fs10.realpathSync.native(xcodeprojOrWorkspace);
5672
+ const container = fs12.realpathSync.native(xcodeprojOrWorkspace);
5066
5673
  const { projects } = workspaceProjects(container);
5067
5674
  const containers = [
5068
5675
  .../* @__PURE__ */ new Set([container, ...projects.map((project2) => project2.xcodeproj)])
5069
5676
  ];
5070
5677
  const found = containers.flatMap(
5071
5678
  (dir) => [
5072
- path10.join(dir, "xcshareddata"),
5073
- ...isDirectory(path10.join(dir, "xcuserdata")) ? fs10.readdirSync(path10.join(dir, "xcuserdata")).sort().map((user) => path10.join(dir, "xcuserdata", user)) : []
5679
+ path12.join(dir, "xcshareddata"),
5680
+ ...isDirectory(path12.join(dir, "xcuserdata")) ? fs12.readdirSync(path12.join(dir, "xcuserdata")).sort().map((user) => path12.join(dir, "xcuserdata", user)) : []
5074
5681
  ].map((data) => ({
5075
5682
  dir,
5076
- file: path10.join(data, "xcschemes", `${scheme}.xcscheme`)
5683
+ file: path12.join(data, "xcschemes", `${scheme}.xcscheme`)
5077
5684
  }))
5078
- ).find((candidate) => fs10.existsSync(candidate.file));
5685
+ ).find((candidate) => fs12.existsSync(candidate.file));
5079
5686
  if (!found) {
5080
5687
  const known = containers.flatMap(
5081
- (dir) => fs10.existsSync(path10.join(dir, "xcshareddata", "xcschemes")) ? fs10.readdirSync(path10.join(dir, "xcshareddata", "xcschemes")).filter((name2) => name2.endsWith(".xcscheme")).map((name2) => name2.slice(0, -".xcscheme".length)).sort() : []
5688
+ (dir) => fs12.existsSync(path12.join(dir, "xcshareddata", "xcschemes")) ? fs12.readdirSync(path12.join(dir, "xcshareddata", "xcschemes")).filter((name2) => name2.endsWith(".xcscheme")).map((name2) => name2.slice(0, -".xcscheme".length)).sort() : []
5082
5689
  );
5083
5690
  throw new Error(
5084
- `${path10.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
5691
+ `${path12.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
5085
5692
  );
5086
5693
  }
5087
5694
  const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
5088
- fs10.readFileSync(found.file, "utf8")
5695
+ fs12.readFileSync(found.file, "utf8")
5089
5696
  );
5090
- const attribute = (text2, name2) => {
5697
+ const attribute2 = (text2, name2) => {
5091
5698
  const value = new RegExp(`\\b${name2}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
5092
5699
  return value === void 0 ? void 0 : decodeXml(value);
5093
5700
  };
5094
5701
  const launchBody = launch?.[2] ?? "";
5095
5702
  const runnable = /<BuildableProductRunnable\b[\s\S]*?<BuildableReference\b([^>]*)>/.exec(launchBody);
5096
- const configuration = launch ? attribute(launch[1], "buildConfiguration") : void 0;
5097
- const blueprint = runnable ? attribute(runnable[1], "BlueprintIdentifier") : void 0;
5098
- const referenced = runnable ? attribute(runnable[1], "ReferencedContainer") : void 0;
5703
+ const configuration = launch ? attribute2(launch[1], "buildConfiguration") : void 0;
5704
+ const blueprint = runnable ? attribute2(runnable[1], "BlueprintIdentifier") : void 0;
5705
+ const referenced = runnable ? attribute2(runnable[1], "ReferencedContainer") : void 0;
5099
5706
  if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
5100
5707
  throw new Error(`scheme ${scheme} runs no application target`);
5101
5708
  }
5102
- const projectPath = path10.resolve(
5103
- path10.dirname(found.dir),
5709
+ const projectPath = path12.resolve(
5710
+ path12.dirname(found.dir),
5104
5711
  referenced.slice("container:".length)
5105
5712
  );
5106
5713
  const project = projects.find(
5107
- (candidate) => fs10.existsSync(projectPath) && candidate.xcodeproj === fs10.realpathSync.native(projectPath)
5714
+ (candidate) => fs12.existsSync(projectPath) && candidate.xcodeproj === fs12.realpathSync.native(projectPath)
5108
5715
  );
5109
5716
  const target = project && projectTargets(project).find((ref) => ref.id === blueprint);
5110
5717
  const name = target && str(target.target.name);
@@ -5120,43 +5727,43 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
5120
5727
  );
5121
5728
  }
5122
5729
  const storeKit = /<StoreKitConfigurationFileReference\b([^>]*)>/.exec(launchBody);
5123
- const identifier2 = storeKit && attribute(storeKit[1], "identifier");
5730
+ const identifier2 = storeKit && attribute2(storeKit[1], "identifier");
5124
5731
  if (!identifier2) return { target: name, configuration };
5125
- const workspace = path10.extname(container) === ".xcodeproj" ? path10.join(container, "project.xcworkspace") : container;
5126
- const storeKitConfiguration = fs10.realpathSync.native(
5127
- path10.resolve(workspace, identifier2)
5732
+ const workspace = path12.extname(container) === ".xcodeproj" ? path12.join(container, "project.xcworkspace") : container;
5733
+ const storeKitConfiguration = fs12.realpathSync.native(
5734
+ path12.resolve(workspace, identifier2)
5128
5735
  );
5129
- if (path10.extname(storeKitConfiguration) !== ".storekit")
5736
+ if (path12.extname(storeKitConfiguration) !== ".storekit")
5130
5737
  throw new Error(
5131
5738
  `scheme ${scheme} names a StoreKit configuration without a .storekit extension`
5132
5739
  );
5133
- if (relativeInside(path10.dirname(container), storeKitConfiguration) === null)
5740
+ if (relativeInside(path12.dirname(container), storeKitConfiguration) === null)
5134
5741
  throw new Error(`scheme ${scheme} names a StoreKit configuration outside its project`);
5135
5742
  return { target: name, configuration, storeKitConfiguration };
5136
5743
  }
5137
5744
  var NativeAppTargetSelectionError = class extends Error {
5138
5745
  };
5139
5746
  function selectIosAppTarget(projectRoot, iosTarget) {
5140
- const nested = path10.join(projectRoot, "ios");
5141
- const iosRoot = fs10.existsSync(nested) ? nested : projectRoot;
5142
- const entries = fs10.readdirSync(iosRoot, { withFileTypes: true });
5747
+ const nested = path12.join(projectRoot, "ios");
5748
+ const iosRoot = fs12.existsSync(nested) ? nested : projectRoot;
5749
+ const entries = fs12.readdirSync(iosRoot, { withFileTypes: true });
5143
5750
  const projects = (entries.some((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")) ? entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).map((entry) => ({
5144
- xcodeproj: path10.join(iosRoot, entry.name),
5751
+ xcodeproj: path12.join(iosRoot, entry.name),
5145
5752
  workspace: null
5146
5753
  })) : entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcworkspace")).flatMap((entry) => {
5147
- const workspace = path10.join(iosRoot, entry.name);
5754
+ const workspace = path12.join(iosRoot, entry.name);
5148
5755
  return workspaceReferences(workspace).map((xcodeproj2) => ({
5149
5756
  xcodeproj: xcodeproj2,
5150
5757
  workspace
5151
5758
  }));
5152
5759
  }).filter(
5153
- ({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(path10.sep).includes("Pods") && fs10.existsSync(xcodeproj2)
5760
+ ({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(path12.sep).includes("Pods") && fs12.existsSync(xcodeproj2)
5154
5761
  ).filter(
5155
5762
  ({ xcodeproj: xcodeproj2 }) => listXcodeAppTargets(xcodeproj2, { requireSources: false }).length > 0
5156
5763
  )).map(({ xcodeproj: xcodeproj2, workspace }) => ({
5157
5764
  xcodeproj: xcodeproj2,
5158
5765
  workspace,
5159
- name: path10.basename(xcodeproj2)
5766
+ name: path12.basename(xcodeproj2)
5160
5767
  }));
5161
5768
  if (projects.length === 0) return null;
5162
5769
  if (projects.length > 1 && !iosTarget) {
@@ -5195,13 +5802,13 @@ function selectIosAppTarget(projectRoot, iosTarget) {
5195
5802
  if (!target) throw new Error("native app identity has no iOS application target");
5196
5803
  if (!iosTarget) {
5197
5804
  const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
5198
- const container = fs10.existsSync(workspace) ? workspace : xcodeproj;
5805
+ const container = fs12.existsSync(workspace) ? workspace : xcodeproj;
5199
5806
  const hasScheme = [container, xcodeproj].some((dir) => {
5200
- if (fs10.existsSync(path10.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
5807
+ if (fs12.existsSync(path12.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
5201
5808
  return true;
5202
- const users = path10.join(dir, "xcuserdata");
5203
- return fs10.existsSync(users) && fs10.readdirSync(users).some(
5204
- (user) => fs10.existsSync(path10.join(users, user, "xcschemes", `${target}.xcscheme`))
5809
+ const users = path12.join(dir, "xcuserdata");
5810
+ return fs12.existsSync(users) && fs12.readdirSync(users).some(
5811
+ (user) => fs12.existsSync(path12.join(users, user, "xcschemes", `${target}.xcscheme`))
5205
5812
  );
5206
5813
  });
5207
5814
  if (hasScheme) target = readXcodeScheme(container, target).target;
@@ -5212,8 +5819,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
5212
5819
  );
5213
5820
  return { xcodeproj, target, workspace: project.workspace };
5214
5821
  }
5215
- var workspaceResolvedFile = (xcodeprojOrWorkspace) => path10.join(
5216
- xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : path10.join(xcodeprojOrWorkspace, "project.xcworkspace"),
5822
+ var workspaceResolvedFile = (xcodeprojOrWorkspace) => path12.join(
5823
+ xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : path12.join(xcodeprojOrWorkspace, "project.xcworkspace"),
5217
5824
  "xcshareddata",
5218
5825
  "swiftpm",
5219
5826
  "Package.resolved"
@@ -5230,7 +5837,7 @@ var SwiftPackageResolutionRequired = class extends Error {
5230
5837
  function readXcodeAppTarget(input, targetName, configurationName, options2 = {}) {
5231
5838
  if (isBazelPackage(input))
5232
5839
  return readBazelAppTarget(input, targetName, configurationName, options2);
5233
- const xcodeprojOrWorkspace = fs10.realpathSync.native(input);
5840
+ const xcodeprojOrWorkspace = fs12.realpathSync.native(input);
5234
5841
  const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
5235
5842
  const { listed, projects, projectAt, cocoapods } = workspaceProjects(
5236
5843
  xcodeprojOrWorkspace,
@@ -5241,7 +5848,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5241
5848
  (ref) => options2.frameworkMachOType ? ref.target.name === targetName && FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "") : isIosAppTarget(ref, options2) || targetName !== void 0 && ref.target.name === targetName && ref.target.productType === APP_EXTENSION
5242
5849
  );
5243
5850
  const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
5244
- const container = path10.basename(xcodeprojOrWorkspace);
5851
+ const container = path12.basename(xcodeprojOrWorkspace);
5245
5852
  const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
5246
5853
  if (named.length !== 1) {
5247
5854
  if (options2.frameworkMachOType)
@@ -5265,20 +5872,23 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5265
5872
  (name) => name.toLowerCase().startsWith(configurationName.toLowerCase())
5266
5873
  ) ?? appConfigNames.find(
5267
5874
  (name) => name.toLowerCase().includes(configurationName.toLowerCase())
5268
- ) ?? str(appConfigs?.defaultConfigurationName) ?? configurationName;
5875
+ ) ?? // a release build of an app without a Release configuration (Eigen
5876
+ // has Debug and QA) takes one cocoapods classifies as release: any
5877
+ // configuration not named Debug, as pods-install maps them
5878
+ (configurationName === "Release" ? appConfigNames.find((name) => name !== "Debug") : void 0) ?? str(appConfigs?.defaultConfigurationName) ?? configurationName;
5269
5879
  const byProduct = /* @__PURE__ */ new Map();
5270
5880
  for (const ref of allTargets) {
5271
5881
  const product = ref.project.object(str(ref.target.productReference));
5272
5882
  const file = str(product?.path);
5273
- if (file && !byProduct.has(path10.basename(file)))
5274
- byProduct.set(path10.basename(file), ref);
5883
+ if (file && !byProduct.has(path12.basename(file)))
5884
+ byProduct.set(path12.basename(file), ref);
5275
5885
  }
5276
5886
  const proxied = (project, proxyId) => {
5277
5887
  const proxy = project.object(proxyId);
5278
5888
  if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
5279
5889
  const portal = str(proxy.containerPortal);
5280
5890
  const portalPath = project.resolvePath(portal ?? "");
5281
- const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && fs10.existsSync(portalPath) ? projectAt.get(fs10.realpathSync.native(portalPath)) : void 0;
5891
+ const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && fs12.existsSync(portalPath) ? projectAt.get(fs12.realpathSync.native(portalPath)) : void 0;
5282
5892
  const remote = str(proxy.remoteGlobalIDString);
5283
5893
  if (!owner || !remote) return void 0;
5284
5894
  return projectTargets(owner).find(
@@ -5295,7 +5905,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5295
5905
  const buildFile = project.object(buildFileId);
5296
5906
  if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
5297
5907
  const file = project.object(str(buildFile.fileRef));
5298
- const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(path10.basename(str(file.path) ?? "")) : void 0;
5908
+ const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(path12.basename(str(file.path) ?? "")) : void 0;
5299
5909
  if (resolved)
5300
5910
  found.push({
5301
5911
  target: resolved,
@@ -5376,7 +5986,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5376
5986
  const otherProduct = productName(other);
5377
5987
  for (const { file, visibility } of headerPhase(other)) {
5378
5988
  if (visibility === "Project") continue;
5379
- const key = `${otherProduct}/${path10.basename(file)}`;
5989
+ const key = `${otherProduct}/${path12.basename(file)}`;
5380
5990
  if (!headers.has(key)) headers.set(key, file);
5381
5991
  }
5382
5992
  }
@@ -5406,8 +6016,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5406
6016
  ref.project.visitMembers(
5407
6017
  ref.id,
5408
6018
  ref.project.resolvePath,
5409
- (file) => isDirectory(file) ? walkFiles(file) : fs10.existsSync(file) ? [file] : [],
5410
- path10.join,
6019
+ (file) => isDirectory(file) ? walkFiles(file) : fs12.existsSync(file) ? [file] : [],
6020
+ path12.join,
5411
6021
  (file, kind) => {
5412
6022
  if (kind === "header") found.push(file);
5413
6023
  }
@@ -5423,12 +6033,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5423
6033
  for (const ref of projectTargets(project)) {
5424
6034
  const product = productName(ref);
5425
6035
  for (const { file, visibility } of headerPhase(ref)) {
5426
- const name = path10.basename(file);
6036
+ const name = path12.basename(file);
5427
6037
  if (!entries.has(name))
5428
6038
  entries.set(name, visibility !== "Project" ? `${product}/${name}` : file);
5429
6039
  }
5430
6040
  for (const file of synchronizedHeaders(ref)) {
5431
- const name = path10.basename(file);
6041
+ const name = path12.basename(file);
5432
6042
  if (!entries.has(name)) entries.set(name, file);
5433
6043
  }
5434
6044
  }
@@ -5438,7 +6048,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5438
6048
  if (folder === null) continue;
5439
6049
  for (const file of walkFiles(folder)) {
5440
6050
  if (!HEADER_FILE.test(file)) continue;
5441
- const name = path10.basename(file);
6051
+ const name = path12.basename(file);
5442
6052
  if (!entries.has(name)) entries.set(name, file);
5443
6053
  }
5444
6054
  }
@@ -5446,18 +6056,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5446
6056
  for (const id of Object.keys(project.objects)) {
5447
6057
  if (project.object(id)?.isa !== "PBXFileReference") continue;
5448
6058
  const file = project.resolvePath(id);
5449
- if (file && HEADER_FILE.test(file) && !entries.has(path10.basename(file)))
5450
- entries.set(path10.basename(file), file);
6059
+ if (file && HEADER_FILE.test(file) && !entries.has(path12.basename(file)))
6060
+ entries.set(path12.basename(file), file);
5451
6061
  }
5452
6062
  const map = [...entries];
5453
6063
  projectHeaderMaps.set(project, map);
5454
6064
  return map;
5455
6065
  };
5456
6066
  const xcconfigs = /* @__PURE__ */ new Set();
5457
- const buildDir = (project) => path10.join(project.projectDir, ".build/peach-xcode/Build");
6067
+ const buildDir = (project) => path12.join(project.projectDir, ".build/peach-xcode/Build");
5458
6068
  const workspaceBuild = {
5459
- SYMROOT: path10.join(buildDir(app.project), "Products"),
5460
- OBJROOT: path10.join(buildDir(app.project), "Intermediates.noindex")
6069
+ SYMROOT: path12.join(buildDir(app.project), "Products"),
6070
+ OBJROOT: path12.join(buildDir(app.project), "Intermediates.noindex")
5461
6071
  };
5462
6072
  const resolveTargetSettings = (ref) => {
5463
6073
  const name = str(ref.target.name) ?? ref.id;
@@ -5473,16 +6083,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5473
6083
  TARGET_NAME: name,
5474
6084
  TARGETNAME: "$(TARGET_NAME)",
5475
6085
  PROJECT: "$(PROJECT_NAME)",
5476
- PROJECT_NAME: path10.basename(ref.project.xcodeproj, ".xcodeproj"),
6086
+ PROJECT_NAME: path12.basename(ref.project.xcodeproj, ".xcodeproj"),
5477
6087
  PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
5478
6088
  PROJECT_FILE_PATH: ref.project.xcodeproj,
5479
6089
  SRCROOT: ref.project.projectDir,
5480
6090
  SOURCE_ROOT: ref.project.projectDir,
5481
6091
  PROJECT_DIR: ref.project.projectDir,
5482
- SYMROOT: path10.join(buildDir(ref.project), "Products"),
6092
+ SYMROOT: path12.join(buildDir(ref.project), "Products"),
5483
6093
  BUILD_DIR: "$(SYMROOT)",
5484
6094
  BUILD_ROOT: "$(SYMROOT)",
5485
- OBJROOT: path10.join(buildDir(ref.project), "Intermediates.noindex"),
6095
+ OBJROOT: path12.join(buildDir(ref.project), "Intermediates.noindex"),
5486
6096
  CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
5487
6097
  BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
5488
6098
  TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
@@ -5553,10 +6163,11 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5553
6163
  options2.nativeModules && !nativeTargets.has(ref) ? ref === app ? { ...options2, requireSources: false } : { ...options2, requireSources: false, prepareGeneratedSources: false } : options2,
5554
6164
  keys,
5555
6165
  xcconfigs,
5556
- options2.nativeModules?.includes(name) ? options2.prepareNativeSources : void 0
6166
+ options2.nativeModules?.includes(name) ? options2.prepareNativeSources : void 0,
6167
+ ref === app ? options2.prepareNativeSources : void 0
5557
6168
  );
5558
6169
  const searchRules = recursiveSearchRules(settings2);
5559
- const absolute = (file) => path10.resolve(ref.project.projectDir, file);
6170
+ const absolute = (file) => path12.resolve(ref.project.projectDir, file);
5560
6171
  const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
5561
6172
  const product = settings2("PRODUCT_NAME");
5562
6173
  const compatibilityPhases = list(ref.target.buildPhases).flatMap((id) => {
@@ -5586,7 +6197,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5586
6197
  `${name}: Swift compatibility header phase has no Swift producer sources`
5587
6198
  );
5588
6199
  const building = options2.prepareGeneratedSources && options2.requireSources !== false;
5589
- const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? path10.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
6200
+ const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? path12.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
5590
6201
  if (versioning) {
5591
6202
  const version = settings2("CURRENT_PROJECT_VERSION");
5592
6203
  const custom = [
@@ -5599,7 +6210,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5599
6210
  ].filter((key) => settings2(key));
5600
6211
  if (custom.length)
5601
6212
  throw new Error(
5602
- `${name}: Xcode generates ${path10.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
6213
+ `${name}: Xcode generates ${path12.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
5603
6214
  );
5604
6215
  const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
5605
6216
  const [major, minor] = version.split(".");
@@ -5612,9 +6223,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5612
6223
  ` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number};`,
5613
6224
  ""
5614
6225
  ].join("\n");
5615
- if (!fs10.existsSync(versioning) || fs10.readFileSync(versioning, "utf8") !== unit) {
5616
- fs10.mkdirSync(path10.dirname(versioning), { recursive: true });
5617
- fs10.writeFileSync(versioning, unit);
6226
+ if (!fs12.existsSync(versioning) || fs12.readFileSync(versioning, "utf8") !== unit) {
6227
+ fs12.mkdirSync(path12.dirname(versioning), { recursive: true });
6228
+ fs12.writeFileSync(versioning, unit);
5618
6229
  }
5619
6230
  allSources.push(versioning);
5620
6231
  }
@@ -5633,7 +6244,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5633
6244
  }
5634
6245
  const ownHeaders = /* @__PURE__ */ new Map();
5635
6246
  for (const { file, visibility } of headerFiles) {
5636
- const name2 = path10.basename(file);
6247
+ const name2 = path12.basename(file);
5637
6248
  const published = visibility !== "Project";
5638
6249
  if (!ownHeaders.has(name2))
5639
6250
  ownHeaders.set(name2, published ? `${product}/${name2}` : file);
@@ -5641,35 +6252,35 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5641
6252
  ownHeaders.set(`${product}/${name2}`, file);
5642
6253
  }
5643
6254
  for (const file of synchronizedHeaders(ref)) {
5644
- const name2 = path10.basename(file);
6255
+ const name2 = path12.basename(file);
5645
6256
  if (ownHeaders.has(name2)) continue;
5646
6257
  ownHeaders.set(name2, file);
5647
6258
  const qualified = `${product}/${name2}`;
5648
6259
  if (!ownHeaders.has(qualified)) ownHeaders.set(qualified, file);
5649
6260
  }
5650
6261
  const nonFrameworkHeaders = nonFrameworkHeadersOf(ref.project);
5651
- const wrapper = path10.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
5652
- const publicHeaders = path10.resolve(
6262
+ const wrapper = path12.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
6263
+ const publicHeaders = path12.resolve(
5653
6264
  settings2("BUILT_PRODUCTS_DIR"),
5654
- settings2("PUBLIC_HEADERS_FOLDER_PATH") || path10.join(wrapper, "Headers")
6265
+ settings2("PUBLIC_HEADERS_FOLDER_PATH") || path12.join(wrapper, "Headers")
5655
6266
  );
5656
- const privateHeaders = path10.resolve(
6267
+ const privateHeaders = path12.resolve(
5657
6268
  settings2("BUILT_PRODUCTS_DIR"),
5658
- settings2("PRIVATE_HEADERS_FOLDER_PATH") || path10.join(wrapper, "PrivateHeaders")
6269
+ settings2("PRIVATE_HEADERS_FOLDER_PATH") || path12.join(wrapper, "PrivateHeaders")
5659
6270
  );
5660
6271
  const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
5661
- const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? path10.join(path10.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
5662
- const frameworkCompatibility = frameworkUmbrella && moduleMap && fs10.existsSync(moduleMap) && fs10.existsSync(frameworkUmbrella) ? {
6272
+ const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? path12.join(path12.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
6273
+ const frameworkCompatibility = frameworkUmbrella && moduleMap && fs12.existsSync(moduleMap) && fs12.existsSync(frameworkUmbrella) ? {
5663
6274
  framework: true,
5664
6275
  moduleMap,
5665
6276
  umbrella: frameworkUmbrella,
5666
- outputModuleMap: path10.join(wrapper, "Modules", "module.modulemap"),
5667
- outputUmbrella: path10.join(
6277
+ outputModuleMap: path12.join(wrapper, "Modules", "module.modulemap"),
6278
+ outputUmbrella: path12.join(
5668
6279
  wrapper,
5669
6280
  "Headers",
5670
- path10.basename(frameworkUmbrella)
6281
+ path12.basename(frameworkUmbrella)
5671
6282
  ),
5672
- outputHeader: path10.join(
6283
+ outputHeader: path12.join(
5673
6284
  wrapper,
5674
6285
  "Headers",
5675
6286
  settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
@@ -5683,10 +6294,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5683
6294
  outputUmbrella: compatibility.outputUmbrella,
5684
6295
  outputHeader: compatibility.outputHeader
5685
6296
  } : frameworkCompatibility;
5686
- const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && path10.relative(path10.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(path10.sep)[0] !== ".." && fs10.existsSync(moduleMap) ? fs10.readdirSync(path10.dirname(moduleMap)).flatMap((entry) => {
6297
+ const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && path12.relative(path12.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(path12.sep)[0] !== ".." && fs12.existsSync(moduleMap) ? fs12.readdirSync(path12.dirname(moduleMap)).flatMap((entry) => {
5687
6298
  if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
5688
- const file = path10.join(path10.dirname(moduleMap), entry);
5689
- return fs10.existsSync(file) ? [file] : [];
6299
+ const file = path12.join(path12.dirname(moduleMap), entry);
6300
+ return fs12.existsSync(file) ? [file] : [];
5690
6301
  }) : [];
5691
6302
  const fileFlags = {};
5692
6303
  for (const phaseId of list(ref.target.buildPhases)) {
@@ -5772,15 +6383,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5772
6383
  // xcode searches its products' include directory before
5773
6384
  // HEADER_SEARCH_PATHS and the target's derived sources after.
5774
6385
  headerSearchPaths: [
5775
- path10.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
6386
+ path12.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
5776
6387
  ...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
5777
6388
  (raw) => expandSearchPath(absolute(raw), searchRules)
5778
6389
  ),
5779
- path10.join(
6390
+ path12.join(
5780
6391
  `${settings2("DERIVED_FILE_DIR")}-normal`,
5781
6392
  settings2("CURRENT_ARCH")
5782
6393
  ),
5783
- path10.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
6394
+ path12.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
5784
6395
  settings2("DERIVED_FILE_DIR")
5785
6396
  ],
5786
6397
  userHeaderSearchPaths: settingList(
@@ -5810,6 +6421,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5810
6421
  )
5811
6422
  ],
5812
6423
  cxxFlags: [
6424
+ ...settings2("GCC_ENABLE_CPP_RTTI") === "NO" ? ["-fno-rtti"] : [],
5813
6425
  ...cxxStandard && cxxStandard !== "compiler-default" ? [`-std=${CXX_STANDARD_ALIASES[cxxStandard] ?? cxxStandard}`] : [],
5814
6426
  // clang.xcspec's hidden CLANG_DISABLE_CXX_MODULES (default
5815
6427
  // YES) keeps c++ and objective-c++ units out of modules when
@@ -5830,9 +6442,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5830
6442
  ...headerFiles.flatMap(
5831
6443
  ({ file, visibility }) => visibility === "Project" ? [] : [
5832
6444
  [
5833
- path10.join(
6445
+ path12.join(
5834
6446
  visibility === "Public" ? publicHeaders : privateHeaders,
5835
- path10.basename(file)
6447
+ path12.basename(file)
5836
6448
  ),
5837
6449
  file
5838
6450
  ]
@@ -5854,17 +6466,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5854
6466
  );
5855
6467
  return file && HEADER_FILE.test(file) ? [
5856
6468
  [
5857
- path10.resolve(
6469
+ path12.resolve(
5858
6470
  settings2("BUILT_PRODUCTS_DIR"),
5859
6471
  destination,
5860
- path10.basename(file)
6472
+ path12.basename(file)
5861
6473
  ),
5862
6474
  file
5863
6475
  ]
5864
6476
  ] : [];
5865
6477
  });
5866
6478
  }),
5867
- ...moduleMap ? [[path10.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
6479
+ ...moduleMap ? [[path12.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
5868
6480
  ]) : Object.fromEntries([
5869
6481
  ...podHeaders.map((file) => [file, file]),
5870
6482
  ...moduleMap ? [[moduleMap, moduleMap]] : []
@@ -5883,23 +6495,23 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5883
6495
  const phase = ref.project.object(phaseId);
5884
6496
  if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy XCFrameworks")
5885
6497
  return [];
5886
- const absolute = (raw) => path10.resolve(ref.project.projectDir, expand(raw, settings2));
6498
+ const absolute = (raw) => path12.resolve(ref.project.projectDir, expand(raw, settings2));
5887
6499
  const files = (paths, lists) => [
5888
6500
  ...list(paths).map(absolute),
5889
6501
  ...list(lists).flatMap((raw) => {
5890
6502
  const file = absolute(raw);
5891
- if (!fs10.existsSync(file)) return [];
6503
+ if (!fs12.existsSync(file)) return [];
5892
6504
  xcconfigs.add(file);
5893
6505
  return fileListEntries(file, absolute);
5894
6506
  })
5895
6507
  ];
5896
6508
  const destinations = new Set(
5897
6509
  files(phase.outputPaths, phase.outputFileListPaths).map(
5898
- (file) => path10.dirname(file)
6510
+ (file) => path12.dirname(file)
5899
6511
  )
5900
6512
  );
5901
6513
  const slices = files(phase.inputPaths, phase.inputFileListPaths).flatMap(
5902
- (file) => file.endsWith(".xcframework") && fs10.existsSync(file) ? [simulatorNativeLibrary(file)?.slice ?? []].flat() : []
6514
+ (file) => file.endsWith(".xcframework") && fs12.existsSync(file) ? [simulatorNativeLibrary(file)?.slice ?? []].flat() : []
5903
6515
  );
5904
6516
  return destinations.size === 1 && slices.length > 0 ? [{ destination: [...destinations][0], slices }] : [];
5905
6517
  })
@@ -5908,7 +6520,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5908
6520
  for (const { destination, slices } of xcframeworkCopies) {
5909
6521
  const rest = relativeInside(destination, directory);
5910
6522
  if (rest === null) continue;
5911
- const found = slices.map((slice) => path10.join(slice, rest)).filter((candidate) => isDirectory(candidate));
6523
+ const found = slices.map((slice) => path12.join(slice, rest)).filter((candidate) => isDirectory(candidate));
5912
6524
  if (found.length) return found;
5913
6525
  }
5914
6526
  return [directory];
@@ -5921,16 +6533,29 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5921
6533
  objc.userHeaderSearchPaths = objc.userHeaderSearchPaths.flatMap(copiedSearchPath);
5922
6534
  objc.frameworkSearchPaths = objc.frameworkSearchPaths.flatMap(copiedSearchPath);
5923
6535
  }
5924
- for (const { ref, module: module2, settings: settings2 } of builtTargets)
5925
- module2.targetDependencies = [
5926
- .../* @__PURE__ */ new Set([
6536
+ const targetModules = new Map(builtTargets.map(({ ref, module: module2 }) => [ref, module2]));
6537
+ const targetDependencies = new Map(
6538
+ builtTargets.map(({ ref, settings: settings2 }) => [
6539
+ ref,
6540
+ [
5927
6541
  ...dependenciesOf(ref),
5928
6542
  ...frameworkFlagLinks(ref, settings2("OTHER_LDFLAGS")).map((link) => link.target)
5929
- ])
5930
- ].flatMap((dependency) => {
5931
- const target = builtTargets.find((candidate) => candidate.ref === dependency);
5932
- return target ? [target.module.targetIdentity] : [];
5933
- });
6543
+ ]
6544
+ ])
6545
+ );
6546
+ for (const { ref, module: module2 } of builtTargets) {
6547
+ const dependencies = new Set(targetDependencies.get(ref));
6548
+ for (const dependency of dependencies) {
6549
+ if (dependency.target.isa === "PBXAggregateTarget") {
6550
+ for (const nested of targetDependencies.get(dependency) ?? [])
6551
+ dependencies.add(nested);
6552
+ } else {
6553
+ const target = targetModules.get(dependency);
6554
+ if (target && dependency !== ref)
6555
+ module2.targetDependencies.push(target.targetIdentity);
6556
+ }
6557
+ }
6558
+ }
5934
6559
  const { settings, productSettings, keys: settingKeys, module } = builtTargets.at(-1);
5935
6560
  const selectedTargets = options2.nativeModules ? builtTargets.filter((target) => nativeTargets.has(target.ref)) : builtTargets;
5936
6561
  const frameworkTargets = selectedTargets.filter((target) => target !== builtTargets.at(-1)).filter(({ ref }) => MODULE_PRODUCTS.has(str(ref.target.productType) ?? "")).map(({ ref, module: module2, settings: settings2, productSettings: productSettings2, keys }) => {
@@ -5938,7 +6563,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5938
6563
  const generate = settings2("GENERATE_INFOPLIST_FILE") === "YES";
5939
6564
  if (!FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "") || !plistSetting && !generate || module2.generatedInfoPlist && !options2.prepareGeneratedSources)
5940
6565
  return { ref, framework: module2 };
5941
- const file = plistSetting ? path10.resolve(ref.project.projectDir, plistSetting) : null;
6566
+ const file = plistSetting ? path12.resolve(ref.project.projectDir, plistSetting) : null;
5942
6567
  if (file) xcconfigs.add(file);
5943
6568
  const info2 = processedInfoPlist(module2.name, file, productSettings2, keys);
5944
6569
  if (generate) {
@@ -5954,7 +6579,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5954
6579
  });
5955
6580
  const frameworks = frameworkTargets.map(({ framework }) => framework);
5956
6581
  const podSourceDirs = builtTargets.slice(0, -1).flatMap(
5957
- ({ ref, module: module2 }) => isPodsProject(ref.project.xcodeproj) ? [...module2.allSources, ...module2.objc?.headers ?? []].map((file) => path10.dirname(file)).filter((dir) => fs10.existsSync(dir)) : []
6582
+ ({ ref, module: module2 }) => isPodsProject(ref.project.xcodeproj) ? [...module2.allSources, ...module2.objc?.headers ?? []].map((file) => path12.dirname(file)).filter((dir) => fs12.existsSync(dir)) : []
5958
6583
  );
5959
6584
  const resourceProducts = [];
5960
6585
  const bundleTargets = builtTargets.filter(
@@ -5965,7 +6590,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5965
6590
  const phase = owner.ref.project.object(phaseId);
5966
6591
  if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
5967
6592
  continue;
5968
- const absolute = (raw) => path10.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
6593
+ const absolute = (raw) => path12.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
5969
6594
  const entries = (paths) => paths.flatMap((raw) => {
5970
6595
  const file = absolute(raw);
5971
6596
  xcconfigs.add(file);
@@ -5981,7 +6606,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5981
6606
  ].filter((file) => file.endsWith(".bundle"));
5982
6607
  if (inputs.length !== outputs.length)
5983
6608
  throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
5984
- const destinationRoot = path10.join(
6609
+ const destinationRoot = path12.join(
5985
6610
  owner.settings("TARGET_BUILD_DIR"),
5986
6611
  owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
5987
6612
  );
@@ -5990,24 +6615,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
5990
6615
  const file = str(
5991
6616
  target.ref.project.object(str(target.ref.target.productReference))?.path
5992
6617
  );
5993
- return file && path10.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
6618
+ return file && path12.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
5994
6619
  });
5995
6620
  if (!product && !isDirectory(input2))
5996
6621
  throw new Error(
5997
6622
  `${owner.module.name}: resource bundle input has no selected producer: ${input2}`
5998
6623
  );
5999
- const destination = path10.relative(destinationRoot, outputs[index]);
6000
- if (destination === ".." || destination.startsWith(`..${path10.sep}`) || path10.isAbsolute(destination) || path10.basename(input2) !== path10.basename(destination))
6624
+ const destination = path12.relative(destinationRoot, outputs[index]);
6625
+ if (destination === ".." || destination.startsWith(`..${path12.sep}`) || path12.isAbsolute(destination) || path12.basename(input2) !== path12.basename(destination))
6001
6626
  throw new Error(
6002
6627
  `${owner.module.name}: invalid resource bundle copy destination`
6003
6628
  );
6004
- const infoFile = product ? path10.resolve(
6629
+ const infoFile = product ? path12.resolve(
6005
6630
  product.ref.project.projectDir,
6006
6631
  product.settings("INFOPLIST_FILE")
6007
6632
  ) : null;
6008
6633
  if (infoFile) xcconfigs.add(infoFile);
6009
6634
  const prefix = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
6010
- const bundlePath = prefix + destination.split(path10.sep).join("/");
6635
+ const bundlePath = prefix + destination.split(path12.sep).join("/");
6011
6636
  if (resourceProducts.some((resource) => resource.path === bundlePath))
6012
6637
  throw new Error(
6013
6638
  `${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
@@ -6018,20 +6643,20 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6018
6643
  resources: product.module.resources,
6019
6644
  infoPlist: buildPlist(
6020
6645
  expandValue(
6021
- parsePlist(fs10.readFileSync(infoFile, "utf8")),
6646
+ parsePlist(fs12.readFileSync(infoFile, "utf8")),
6022
6647
  product.productSettings
6023
6648
  )
6024
6649
  )
6025
6650
  } : {
6026
- resources: fs10.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => path10.join(entry.parentPath, entry.name)).sort(),
6651
+ resources: fs12.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => path12.join(entry.parentPath, entry.name)).sort(),
6027
6652
  sourceRoot: input2
6028
6653
  }
6029
6654
  });
6030
6655
  }
6031
6656
  }
6032
6657
  }
6033
- const infoPlistFile = settings("INFOPLIST_FILE") ? path10.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
6034
- const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? path10.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
6658
+ const infoPlistFile = settings("INFOPLIST_FILE") ? path12.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
6659
+ const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? path12.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
6035
6660
  const infoPlistPending = module.generatedInfoPlist && !options2.prepareGeneratedSources;
6036
6661
  const info = processedInfoPlist(
6037
6662
  module.name,
@@ -6040,7 +6665,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6040
6665
  settingKeys
6041
6666
  );
6042
6667
  const bundleIdentifier = productSettings("PRODUCT_BUNDLE_IDENTIFIER") || (typeof info.CFBundleIdentifier === "string" ? info.CFBundleIdentifier : "");
6043
- const entitlements = entitlementsFile ? parsePlist(fs10.readFileSync(entitlementsFile, "utf8")) : void 0;
6668
+ const entitlements = entitlementsFile ? parsePlist(fs12.readFileSync(entitlementsFile, "utf8")) : void 0;
6044
6669
  const signingGroups = entitlementsFile ? readSigningGroups(
6045
6670
  entitlements,
6046
6671
  (value) => expand(value, (key) => {
@@ -6078,7 +6703,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6078
6703
  };
6079
6704
  }
6080
6705
  const localPackageDirs = [
6081
- ...listed.filter((reference) => fs10.existsSync(path10.join(reference, "Package.swift"))),
6706
+ ...listed.filter((reference) => fs12.existsSync(path12.join(reference, "Package.swift"))),
6082
6707
  ...projects.flatMap(
6083
6708
  (project) => Object.entries(project.objects).flatMap(([id, entry]) => {
6084
6709
  if (!isDict(entry)) return [];
@@ -6088,19 +6713,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6088
6713
  const packages = [];
6089
6714
  while (pending.length > 0) {
6090
6715
  const dir = pending.pop();
6091
- if (fs10.existsSync(path10.join(dir, "Package.swift"))) {
6716
+ if (fs12.existsSync(path12.join(dir, "Package.swift"))) {
6092
6717
  packages.push(dir);
6093
6718
  continue;
6094
6719
  }
6095
6720
  if (!isDirectory(dir)) continue;
6096
- for (const child of fs10.readdirSync(dir, { withFileTypes: true }))
6721
+ for (const child of fs12.readdirSync(dir, { withFileTypes: true }))
6097
6722
  if (child.isDirectory() && !child.name.startsWith("."))
6098
- pending.push(path10.join(dir, child.name));
6723
+ pending.push(path12.join(dir, child.name));
6099
6724
  }
6100
6725
  return packages;
6101
6726
  }
6102
- const candidate = entry.isa === "XCLocalSwiftPackageReference" ? path10.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
6103
- return candidate && fs10.existsSync(path10.join(candidate, "Package.swift")) ? [candidate] : [];
6727
+ const candidate = entry.isa === "XCLocalSwiftPackageReference" ? path12.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
6728
+ return candidate && fs12.existsSync(path12.join(candidate, "Package.swift")) ? [candidate] : [];
6104
6729
  })
6105
6730
  )
6106
6731
  ];
@@ -6135,7 +6760,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6135
6760
  if ((flag === "-framework" || flag === "-weak_framework") && name)
6136
6761
  sdkFrameworks.add(name);
6137
6762
  });
6138
- const absolute = (raw) => path10.resolve(ref.project.projectDir, expand(raw, settings2));
6763
+ const absolute = (raw) => path12.resolve(ref.project.projectDir, expand(raw, settings2));
6139
6764
  const requested = options2.nativeModules;
6140
6765
  const includeBinary = (name, dir) => {
6141
6766
  if (!requested || nativeTargets.has(ref) || requested.includes(name) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module2) => requested.includes(module2)))
@@ -6147,14 +6772,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6147
6772
  for (const directory of expandSearchPath(absolute(raw), searchRules)) {
6148
6773
  if (frameworkSearchDirectories.has(directory)) continue;
6149
6774
  frameworkSearchDirectories.add(directory);
6150
- if (!fs10.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
6775
+ if (!fs12.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
6151
6776
  continue;
6152
- for (const entry of fs10.readdirSync(directory, { withFileTypes: true })) {
6777
+ for (const entry of fs12.readdirSync(directory, { withFileTypes: true })) {
6153
6778
  const name = /^(.+)\.framework$/.exec(entry.name)?.[1];
6154
6779
  if (!name || byProduct.has(entry.name) || searchedFrameworks.has(name))
6155
6780
  continue;
6156
- const file = path10.join(directory, entry.name);
6157
- if (fs10.statSync(file, { throwIfNoEntry: false })?.isDirectory())
6781
+ const file = path12.join(directory, entry.name);
6782
+ if (fs12.statSync(file, { throwIfNoEntry: false })?.isDirectory())
6158
6783
  searchedFrameworks.set(name, file);
6159
6784
  }
6160
6785
  }
@@ -6162,13 +6787,13 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6162
6787
  }
6163
6788
  for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
6164
6789
  const dir = absolute(raw);
6165
- const modulemap = path10.join(dir, "module.modulemap");
6166
- if (!fs10.existsSync(modulemap)) continue;
6167
- const contents = fs10.readFileSync(modulemap, "utf8");
6790
+ const modulemap = path12.join(dir, "module.modulemap");
6791
+ if (!fs12.existsSync(modulemap)) continue;
6792
+ const contents = fs12.readFileSync(modulemap, "utf8");
6168
6793
  const tokens = moduleMapTokens(contents);
6169
6794
  if (!tokens.includes("link") && tokens.some((token, index) => {
6170
6795
  const header = tokens[index + 1];
6171
- return token === "header" && header?.startsWith('"') && sourceHeaders.has(path10.resolve(dir, header.slice(1, -1)));
6796
+ return token === "header" && header?.startsWith('"') && sourceHeaders.has(path12.resolve(dir, header.slice(1, -1)));
6172
6797
  }))
6173
6798
  continue;
6174
6799
  const name = moduleMapName(contents);
@@ -6180,7 +6805,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6180
6805
  const inputs = list(phase.inputPaths).map(absolute);
6181
6806
  for (const raw of list(phase.inputFileListPaths)) {
6182
6807
  const file = absolute(raw);
6183
- if (!fs10.existsSync(file)) continue;
6808
+ if (!fs12.existsSync(file)) continue;
6184
6809
  xcconfigs.add(file);
6185
6810
  inputs.push(...fileListEntries(file, absolute));
6186
6811
  }
@@ -6245,7 +6870,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6245
6870
  ...productAttributes.get(dependencyId)?.length ? { attributes: productAttributes.get(dependencyId) } : {},
6246
6871
  source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
6247
6872
  kind: "local",
6248
- dir: path10.resolve(
6873
+ dir: path12.resolve(
6249
6874
  project.projectDir,
6250
6875
  str(reference.relativePath) ?? ""
6251
6876
  )
@@ -6279,14 +6904,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6279
6904
  continue;
6280
6905
  }
6281
6906
  if (tree === "BUILT_PRODUCTS_DIR" || tree === "DEVELOPER_DIR" || // a target in the workspace builds it, so it exists only after that build
6282
- byProduct.has(path10.basename(rawPath)))
6907
+ byProduct.has(path12.basename(rawPath)))
6283
6908
  continue;
6284
6909
  const resolved = fileId ? project.resolvePath(fileId) : null;
6285
- if (fileId && resolved !== null && !fs10.existsSync(resolved)) {
6286
- const parts = resolved.split(path10.sep);
6910
+ if (fileId && resolved !== null && !fs12.existsSync(resolved)) {
6911
+ const parts = resolved.split(path12.sep);
6287
6912
  const pods = parts.lastIndexOf("Pods");
6288
- const sandbox = parts.slice(0, pods + 1).join(path10.sep);
6289
- if (!options2.installedPods && options2.requireSources === false && pods > 0 && fs10.existsSync(path10.join(path10.dirname(sandbox), "Podfile")))
6913
+ const sandbox = parts.slice(0, pods + 1).join(path12.sep);
6914
+ if (!options2.installedPods && options2.requireSources === false && pods > 0 && fs12.existsSync(path12.join(path12.dirname(sandbox), "Podfile")))
6290
6915
  continue;
6291
6916
  if (!ios_sdk_frameworks_default.frameworks.includes(name))
6292
6917
  throw new Error(
@@ -6314,7 +6939,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6314
6939
  ({ product }) => !options2.nativeModules || nativeTargets.has(built.ref) || options2.nativeModules.includes(product)
6315
6940
  );
6316
6941
  const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
6317
- let packageResolved = fs10.existsSync(resolvedFile) ? [fs10.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => path10.join(dir, "Package.resolved")))].filter((file) => fs10.existsSync(file)).map((file) => fs10.realpathSync.native(file)).sort();
6942
+ let packageResolved = fs12.existsSync(resolvedFile) ? [fs12.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => path12.join(dir, "Package.resolved")))].filter((file) => fs12.existsSync(file)).map((file) => fs12.realpathSync.native(file)).sort();
6318
6943
  if (packageResolved.length === 0) {
6319
6944
  const requirements = remotePackageRequirements(projects);
6320
6945
  if (requirements.length > 0) {
@@ -6361,28 +6986,21 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6361
6986
  return compatibility ? [[compatibility.outputModuleMap, compatibility.moduleMap]] : [];
6362
6987
  })
6363
6988
  ),
6364
- ...options2.nativeModules ? {
6365
- sources: [],
6366
- allSources: [],
6367
- resources: [],
6368
- objc: void 0,
6369
- swift: void 0
6370
- } : {},
6371
6989
  rootDir: commonAncestor(
6372
6990
  [
6373
- workspace ? path10.dirname(workspace) : app.project.projectDir,
6991
+ workspace ? path12.dirname(workspace) : app.project.projectDir,
6374
6992
  ...used.map((project) => project.projectDir),
6375
6993
  ...localPackageDirs,
6376
6994
  ...linkedProducts.flatMap(
6377
- ({ source }) => source.kind === "local" && fs10.existsSync(source.dir) ? [source.dir] : []
6995
+ ({ source }) => source.kind === "local" && fs12.existsSync(source.dir) ? [source.dir] : []
6378
6996
  ),
6379
6997
  ...new Set(podSourceDirs),
6380
6998
  // a target's own files may sit beside the project, such as an asset
6381
6999
  // catalog one folder up, and xcode builds them from there
6382
7000
  ...new Set(
6383
- [...module.allSources, ...module.resources].filter((file) => fs10.existsSync(file)).map((file) => path10.dirname(file))
7001
+ [...module.allSources, ...module.resources].filter((file) => fs12.existsSync(file)).map((file) => path12.dirname(file))
6384
7002
  )
6385
- ].map((dir) => fs10.realpathSync.native(dir))
7003
+ ].map((dir) => fs12.realpathSync.native(dir))
6386
7004
  ),
6387
7005
  projectFiles: [
6388
7006
  .../* @__PURE__ */ new Set([
@@ -6408,7 +7026,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6408
7026
  resourceProducts,
6409
7027
  linkedProducts,
6410
7028
  localPackageDirs: [
6411
- ...new Set(localPackageDirs.map((dir) => fs10.realpathSync.native(dir)))
7029
+ ...new Set(localPackageDirs.map((dir) => fs12.realpathSync.native(dir)))
6412
7030
  ].sort(),
6413
7031
  binaryFrameworks: [...binaryFrameworks].map(([name, file]) => ({ name, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
6414
7032
  sdkFrameworks: [...sdkFrameworks].filter(
@@ -6418,7 +7036,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
6418
7036
  appTargets: appTargetNames,
6419
7037
  configuration,
6420
7038
  settings,
6421
- cocoapods
7039
+ cocoapods,
7040
+ ...options2.nativeModules ? {
7041
+ sources: [],
7042
+ allSources: [],
7043
+ resources: [],
7044
+ objc: void 0,
7045
+ swift: void 0,
7046
+ postBundleScripts: []
7047
+ } : {}
6422
7048
  };
6423
7049
  }
6424
7050
 
@@ -6513,7 +7139,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
6513
7139
  const rtcAppGroupIdentifier = nonEmptyString(dictionary2.RTCAppGroupIdentifier);
6514
7140
  const screenShareExtensionBundleId = typeof dictionary2.ScreenShareExtensionBundleId === "string" ? dictionary2.ScreenShareExtensionBundleId : void 0;
6515
7141
  const rootModuleName = readRootModuleName(
6516
- app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && fs11.existsSync(file)).map((file) => fs11.readFileSync(file, "utf8"))
7142
+ app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && fs13.existsSync(file)).map((file) => fs13.readFileSync(file, "utf8"))
6517
7143
  );
6518
7144
  const identity = {
6519
7145
  ...app.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: app.keychainAccessGroups },
@@ -6538,7 +7164,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
6538
7164
  googleSignIn: readGoogleSignInConfiguration(
6539
7165
  dictionary2,
6540
7166
  Object.fromEntries(
6541
- app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parsePlistBytes(fs11.readFileSync(file), parseInfoPlist)])
7167
+ app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parsePlistBytes(fs13.readFileSync(file), parseInfoPlist)])
6542
7168
  )
6543
7169
  ),
6544
7170
  supportedInterfaceOrientations,
@@ -6548,11 +7174,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
6548
7174
  bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => value),
6549
7175
  appIconArtwork: resolveNativeAppIconArtwork(
6550
7176
  app.resources,
6551
- (file) => fs11.readFileSync(file, "utf8"),
7177
+ (file) => fs13.readFileSync(file, "utf8"),
6552
7178
  (file) => {
6553
- const extension = path11.extname(file).toLowerCase();
7179
+ const extension = path13.extname(file).toLowerCase();
6554
7180
  const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
6555
- return `data:${contentType};base64,${fs11.readFileSync(file).toString("base64")}`;
7181
+ return `data:${contentType};base64,${fs13.readFileSync(file).toString("base64")}`;
6556
7182
  },
6557
7183
  icons,
6558
7184
  app.appIconName,
@@ -6589,11 +7215,11 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
6589
7215
  const read = selectNativeAppIdentityReader(platform, {
6590
7216
  android: () => null,
6591
7217
  ios: () => {
6592
- const nested = path11.join(projectRoot, "ios");
6593
- const iosRoot = fs11.existsSync(nested) ? nested : projectRoot;
7218
+ const nested = path13.join(projectRoot, "ios");
7219
+ const iosRoot = fs13.existsSync(nested) ? nested : projectRoot;
6594
7220
  const prefix = iosRoot === nested ? "ios/" : "";
6595
7221
  const files = {};
6596
- for (const entry of fs11.readdirSync(iosRoot, { withFileTypes: true })) {
7222
+ for (const entry of fs13.readdirSync(iosRoot, { withFileTypes: true })) {
6597
7223
  if (entry.name === "Pods") continue;
6598
7224
  if (entry.isDirectory()) {
6599
7225
  const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : [
@@ -6601,17 +7227,17 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
6601
7227
  "AppDelegate.swift",
6602
7228
  "AppDelegate.mm",
6603
7229
  "AppDelegate.m",
6604
- ...fs11.readdirSync(path11.join(iosRoot, entry.name)).filter((name) => name.endsWith(".entitlements"))
7230
+ ...fs13.readdirSync(path13.join(iosRoot, entry.name)).filter((name) => name.endsWith(".entitlements"))
6605
7231
  ];
6606
7232
  for (const name of names) {
6607
- const relative2 = `${prefix}${entry.name}/${name}`;
6608
- const file = path11.join(projectRoot, relative2);
6609
- if (fs11.existsSync(file)) files[relative2] = fs11.readFileSync(file, "utf8");
7233
+ const relative3 = `${prefix}${entry.name}/${name}`;
7234
+ const file = path13.join(projectRoot, relative3);
7235
+ if (fs13.existsSync(file)) files[relative3] = fs13.readFileSync(file, "utf8");
6610
7236
  }
6611
7237
  } else if (/AppDelegate\.(?:swift|mm|m)$|\.entitlements$/.test(entry.name)) {
6612
- const relative2 = `${prefix}${entry.name}`;
6613
- const file = path11.join(projectRoot, relative2);
6614
- if (fs11.existsSync(file)) files[relative2] = fs11.readFileSync(file, "utf8");
7238
+ const relative3 = `${prefix}${entry.name}`;
7239
+ const file = path13.join(projectRoot, relative3);
7240
+ if (fs13.existsSync(file)) files[relative3] = fs13.readFileSync(file, "utf8");
6615
7241
  }
6616
7242
  }
6617
7243
  const identity = extractNativeAppIdentityFromFiles(
@@ -6628,41 +7254,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
6628
7254
  function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
6629
7255
  const files = {};
6630
7256
  if (androidMergedManifest) {
6631
- const file = path11.resolve(projectRoot, androidMergedManifest);
6632
- if (!fs11.existsSync(file)) return null;
6633
- files[androidMergedManifest] = fs11.readFileSync(file, "utf8");
7257
+ const file = path13.resolve(projectRoot, androidMergedManifest);
7258
+ if (!fs13.existsSync(file)) return null;
7259
+ files[androidMergedManifest] = fs13.readFileSync(file, "utf8");
6634
7260
  } else {
6635
- const androidRoot = path11.join(projectRoot, "android");
6636
- if (!fs11.existsSync(androidRoot)) return null;
7261
+ const androidRoot = path13.join(projectRoot, "android");
7262
+ if (!fs13.existsSync(androidRoot)) return null;
6637
7263
  const collect = (directory) => {
6638
- for (const entry of fs11.readdirSync(directory, { withFileTypes: true })) {
6639
- const file = path11.join(directory, entry.name);
7264
+ for (const entry of fs13.readdirSync(directory, { withFileTypes: true })) {
7265
+ const file = path13.join(directory, entry.name);
6640
7266
  if (entry.isDirectory()) collect(file);
6641
7267
  else if (entry.isFile() && entry.name === "AndroidManifest.xml")
6642
- files[path11.relative(projectRoot, file).split(path11.sep).join("/")] = fs11.readFileSync(file, "utf8");
7268
+ files[path13.relative(projectRoot, file).split(path13.sep).join("/")] = fs13.readFileSync(file, "utf8");
6643
7269
  }
6644
7270
  };
6645
- for (const module of fs11.readdirSync(androidRoot, { withFileTypes: true })) {
7271
+ for (const module of fs13.readdirSync(androidRoot, { withFileTypes: true })) {
6646
7272
  if (!module.isDirectory()) continue;
6647
- const outputs = path11.join(
7273
+ const outputs = path13.join(
6648
7274
  androidRoot,
6649
7275
  module.name,
6650
7276
  "build/intermediates/merged_manifests"
6651
7277
  );
6652
- if (fs11.existsSync(outputs)) collect(outputs);
7278
+ if (fs13.existsSync(outputs)) collect(outputs);
6653
7279
  }
6654
7280
  }
6655
7281
  for (const manifest of Object.keys(files)) {
6656
7282
  const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
6657
7283
  if (!resourceDirectory) continue;
6658
- const absolute = path11.resolve(projectRoot, resourceDirectory);
6659
- if (!fs11.existsSync(absolute)) continue;
6660
- for (const entry of fs11.readdirSync(absolute, { withFileTypes: true })) {
7284
+ const absolute = path13.resolve(projectRoot, resourceDirectory);
7285
+ if (!fs13.existsSync(absolute)) continue;
7286
+ for (const entry of fs13.readdirSync(absolute, { withFileTypes: true })) {
6661
7287
  if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
6662
- for (const resource of fs11.readdirSync(path11.join(absolute, entry.name))) {
7288
+ for (const resource of fs13.readdirSync(path13.join(absolute, entry.name))) {
6663
7289
  if (!resource.endsWith(".xml")) continue;
6664
7290
  const file = `${resourceDirectory}/${entry.name}/${resource}`;
6665
- files[file] = fs11.readFileSync(path11.resolve(projectRoot, file), "utf8");
7291
+ files[file] = fs13.readFileSync(path13.resolve(projectRoot, file), "utf8");
6666
7292
  }
6667
7293
  }
6668
7294
  }
@@ -6683,7 +7309,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
6683
7309
  parseInfoPlist,
6684
7310
  buildSdkVersion
6685
7311
  );
6686
- const projectManifestPath = path11.join(projectRoot, "package.json");
7312
+ const projectManifestPath = path13.join(projectRoot, "package.json");
6687
7313
  const projectRequire = createRequire2(projectManifestPath);
6688
7314
  let reanimatedManifestPath;
6689
7315
  try {
@@ -6697,22 +7323,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
6697
7323
  throw error;
6698
7324
  }
6699
7325
  const installedManifest = JSON.parse(
6700
- fs11.readFileSync(reanimatedManifestPath, "utf8")
7326
+ fs13.readFileSync(reanimatedManifestPath, "utf8")
6701
7327
  );
6702
7328
  const installedVersion = isRecord(installedManifest) ? nonEmptyString(installedManifest.version) : void 0;
6703
7329
  if (!installedVersion) throw new Error("Reanimated package version is malformed");
6704
7330
  if (Number.parseInt(installedVersion, 10) < 4) return identity;
6705
7331
  const defaults = JSON.parse(
6706
- fs11.readFileSync(
6707
- path11.join(
6708
- path11.dirname(reanimatedManifestPath),
7332
+ fs13.readFileSync(
7333
+ path13.join(
7334
+ path13.dirname(reanimatedManifestPath),
6709
7335
  "src/featureFlags/staticFlags.json"
6710
7336
  ),
6711
7337
  "utf8"
6712
7338
  )
6713
7339
  );
6714
7340
  if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
6715
- const manifest = JSON.parse(fs11.readFileSync(projectManifestPath, "utf8"));
7341
+ const manifest = JSON.parse(fs13.readFileSync(projectManifestPath, "utf8"));
6716
7342
  const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
6717
7343
  const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
6718
7344
  if (overrides !== void 0 && !isRecord(overrides)) {