@depup/react-native 0.86.0-depup.49 → 0.87.0-depup.0

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 (1212) hide show
  1. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +19 -24
  2. package/Libraries/Alert/Alert.js +38 -1
  3. package/Libraries/Animated/AnimatedExports.js +22 -0
  4. package/Libraries/Animated/AnimatedExports.js.flow +1 -1
  5. package/Libraries/Animated/AnimatedImplementation.js +120 -3
  6. package/Libraries/Animated/Easing.js +4 -3
  7. package/Libraries/Animated/NativeAnimatedAllowlist.js +37 -0
  8. package/Libraries/Animated/animations/Animation.js +14 -5
  9. package/Libraries/Animated/animations/DecayAnimation.js +1 -0
  10. package/Libraries/Animated/animations/SpringAnimation.js +1 -0
  11. package/Libraries/Animated/animations/TimingAnimation.js +9 -0
  12. package/Libraries/Animated/createAnimatedComponent.js +3 -3
  13. package/Libraries/Animated/nodes/AnimatedColor.js +8 -8
  14. package/Libraries/Animated/nodes/AnimatedInterpolation.js +106 -0
  15. package/Libraries/Animated/nodes/AnimatedProps.js +27 -3
  16. package/Libraries/Animated/nodes/AnimatedValue.js +8 -0
  17. package/Libraries/Animated/nodes/AnimatedValueXY.js +2 -2
  18. package/Libraries/AppDelegate/RCTAppDelegate.h +5 -9
  19. package/Libraries/AppDelegate/RCTAppDelegate.mm +0 -20
  20. package/Libraries/AppDelegate/RCTAppSetupUtils.h +0 -18
  21. package/Libraries/AppDelegate/RCTAppSetupUtils.mm +0 -78
  22. package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +18 -21
  23. package/Libraries/AppDelegate/RCTReactNativeFactory.h +5 -41
  24. package/Libraries/AppDelegate/RCTReactNativeFactory.mm +0 -82
  25. package/Libraries/AppDelegate/RCTRootViewFactory.h +4 -1
  26. package/Libraries/AppDelegate/RCTRootViewFactory.mm +3 -101
  27. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -0
  28. package/Libraries/AppState/AppState.d.ts +4 -1
  29. package/Libraries/AppState/AppState.js +32 -17
  30. package/Libraries/BatchedBridge/MessageQueue.js +42 -51
  31. package/Libraries/BatchedBridge/NativeModules.js +7 -0
  32. package/Libraries/Blob/Blob.js +7 -1
  33. package/Libraries/Blob/FileReader.js +6 -0
  34. package/Libraries/Blob/URLSearchParams.js.flow +1 -1
  35. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +20 -9
  36. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +30 -43
  37. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +59 -49
  38. package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +2 -2
  39. package/Libraries/Components/Button.js +98 -183
  40. package/Libraries/Components/Clipboard/Clipboard.js +5 -0
  41. package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +2 -2
  42. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +8 -69
  43. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +10 -1
  44. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js +2 -0
  45. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +26 -31
  46. package/Libraries/Components/Keyboard/Keyboard.js +23 -60
  47. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +15 -7
  48. package/Libraries/Components/Pressable/Pressable.js +39 -17
  49. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +5 -6
  50. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +4 -4
  51. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +2 -2
  52. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +17 -0
  53. package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +2 -2
  54. package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +2 -2
  55. package/Libraries/Components/RefreshControl/RefreshControl.js +40 -50
  56. package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +2 -2
  57. package/Libraries/Components/SafeAreaView/SafeAreaView.js +8 -8
  58. package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +2 -2
  59. package/Libraries/Components/ScrollView/ScrollView.d.ts +55 -43
  60. package/Libraries/Components/ScrollView/ScrollView.js +205 -118
  61. package/Libraries/Components/ScrollView/ScrollViewCommands.js +4 -4
  62. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
  63. package/Libraries/Components/StatusBar/StatusBar.d.ts +7 -54
  64. package/Libraries/Components/StatusBar/StatusBar.js +84 -160
  65. package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +2 -2
  66. package/Libraries/Components/Switch/Switch.js +76 -75
  67. package/Libraries/Components/Switch/SwitchNativeComponent.js +2 -2
  68. package/Libraries/Components/TextInput/InputAccessoryView.js +13 -61
  69. package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +2 -2
  70. package/Libraries/Components/TextInput/TextInput.d.ts +9 -2
  71. package/Libraries/Components/TextInput/TextInput.flow.js +19 -2
  72. package/Libraries/Components/TextInput/TextInput.js +116 -111
  73. package/Libraries/Components/TextInput/TextInputNativeCommands.js +3 -3
  74. package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +25 -19
  75. package/Libraries/Components/Touchable/Touchable.js +94 -95
  76. package/Libraries/Components/Touchable/TouchableHighlight.js +45 -112
  77. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +13 -25
  78. package/Libraries/Components/Touchable/TouchableOpacity.js +14 -84
  79. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +4 -3
  80. package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +2 -2
  81. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
  82. package/Libraries/Components/View/View.js +83 -86
  83. package/Libraries/Components/View/ViewAccessibility.d.ts +11 -1
  84. package/Libraries/Components/View/ViewAccessibility.js +16 -5
  85. package/Libraries/Components/View/ViewNativeComponent.js +4 -6
  86. package/Libraries/Components/View/ViewPropTypes.js +65 -13
  87. package/Libraries/Core/InitializeCore.js +9 -1
  88. package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
  89. package/Libraries/Core/ReactNativeVersion.js +1 -1
  90. package/Libraries/Core/Timers/JSTimers.js +53 -52
  91. package/Libraries/Core/setUpGlobals.js +9 -4
  92. package/Libraries/Core/setUpNavigator.js +6 -1
  93. package/Libraries/Core/setUpReactDevTools.js +0 -118
  94. package/Libraries/Core/setUpXHR.js +6 -2
  95. package/Libraries/Debugging/DebuggingOverlay.js +2 -2
  96. package/Libraries/Debugging/DebuggingOverlayNativeComponent.js +2 -2
  97. package/Libraries/EventEmitter/NativeEventEmitter.js +29 -0
  98. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +7 -7
  99. package/Libraries/EventEmitter/RCTNativeAppEventEmitter.js +3 -0
  100. package/Libraries/Image/AssetSourceResolver.js +18 -27
  101. package/Libraries/Image/Image.android.js +13 -2
  102. package/Libraries/Image/Image.ios.js +3 -1
  103. package/Libraries/Image/ImageBackground.js +30 -18
  104. package/Libraries/Image/ImageProps.js +116 -117
  105. package/Libraries/Image/ImageSource.d.ts +1 -1
  106. package/Libraries/Image/ImageSource.js +9 -9
  107. package/Libraries/Image/ImageSourceUtils.js +10 -7
  108. package/Libraries/Image/ImageTypes.flow.js +2 -0
  109. package/Libraries/Image/ImageViewNativeComponent.js +1 -1
  110. package/Libraries/Image/RCTImageLoader.mm +60 -63
  111. package/Libraries/Image/RCTImageStoreManager.h +0 -2
  112. package/Libraries/Image/RelativeImageStub.js +1 -1
  113. package/Libraries/Image/resolveAssetSource.js +1 -1
  114. package/Libraries/Interaction/PanResponder.js +102 -97
  115. package/Libraries/LayoutAnimation/LayoutAnimation.js +22 -6
  116. package/Libraries/Linking/Linking.js +24 -23
  117. package/Libraries/Lists/FlatList.d.ts +6 -17
  118. package/Libraries/Lists/FlatList.js +7 -8
  119. package/Libraries/Lists/SectionList.js +7 -0
  120. package/Libraries/Lists/VirtualizedList.js +3 -0
  121. package/Libraries/Lists/VirtualizedSectionList.js +4 -0
  122. package/Libraries/LogBox/LogBox.js +3 -3
  123. package/Libraries/LogBox/UI/AnsiHighlight.js +2 -1
  124. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +2 -2
  125. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +4 -1
  126. package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +3 -1
  127. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +8 -2
  128. package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +9 -2
  129. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +17 -4
  130. package/Libraries/LogBox/UI/LogBoxInspectorSection.js +3 -1
  131. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -1
  132. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -0
  133. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +4 -2
  134. package/Libraries/LogBox/UI/LogBoxMessage.js +18 -5
  135. package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +4 -1
  136. package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +1 -0
  137. package/Libraries/LogBox/UI/LogBoxStyle.js +0 -4
  138. package/Libraries/Modal/Modal.d.ts +5 -4
  139. package/Libraries/Modal/Modal.js +71 -37
  140. package/Libraries/Modal/RCTModalHostViewNativeComponent.js +2 -2
  141. package/Libraries/NativeComponent/BaseViewConfig.android.js +17 -0
  142. package/Libraries/NativeComponent/ViewConfig.js +3 -3
  143. package/Libraries/NativeComponent/ViewConfigIgnore.js +1 -1
  144. package/Libraries/Network/RCTHTTPRequestHandler.h +1 -1
  145. package/Libraries/Performance/Systrace.js +36 -0
  146. package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +4 -2
  147. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +29 -17
  148. package/Libraries/Pressability/Pressability.js +1 -1
  149. package/Libraries/PushNotificationIOS/PushNotificationIOS.js +4 -0
  150. package/Libraries/ReactNative/AppContainer-dev.js +3 -1
  151. package/Libraries/ReactNative/AppRegistry.flow.js +1 -0
  152. package/Libraries/ReactNative/AppRegistry.js +15 -11
  153. package/Libraries/ReactNative/AppRegistryImpl.js +57 -11
  154. package/Libraries/ReactNative/DisplayMode.js +1 -1
  155. package/Libraries/ReactNative/FabricUIManager.js +29 -26
  156. package/Libraries/ReactNative/I18nManager.js +20 -0
  157. package/Libraries/ReactNative/UIManager.js +53 -0
  158. package/Libraries/ReactNative/renderApplication.js +1 -1
  159. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +5 -126
  160. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +5 -41
  161. package/Libraries/Renderer/shims/ReactNativeTypes.js +36 -36
  162. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +4 -4
  163. package/Libraries/Settings/Settings.ios.js +22 -0
  164. package/Libraries/Share/Share.js +25 -28
  165. package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +6 -0
  166. package/Libraries/StyleSheet/StyleSheet.js +42 -2
  167. package/Libraries/StyleSheet/StyleSheet.js.flow +1 -1
  168. package/Libraries/StyleSheet/StyleSheetExports.js +7 -5
  169. package/Libraries/StyleSheet/StyleSheetExports.js.flow +1 -1
  170. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +24 -3
  171. package/Libraries/StyleSheet/StyleSheetTypes.js +34 -6
  172. package/Libraries/StyleSheet/flattenStyle.js +28 -13
  173. package/Libraries/StyleSheet/private/_TransformStyle.js +16 -14
  174. package/Libraries/Text/Text.js +12 -9
  175. package/Libraries/Text/TextEffectNativeComponent.js +31 -0
  176. package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +0 -1
  177. package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +0 -1
  178. package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +0 -1
  179. package/Libraries/Text/TextProps.js +59 -93
  180. package/Libraries/Text/requireNativeTextEffect.js +28 -0
  181. package/Libraries/TurboModule/RCTExport.js +1 -1
  182. package/Libraries/Types/CoreEventTypes.d.ts +8 -0
  183. package/Libraries/Types/CoreEventTypes.js +32 -29
  184. package/Libraries/Types/UIManagerJSInterface.js +2 -2
  185. package/Libraries/Utilities/Appearance.d.ts +32 -17
  186. package/Libraries/Utilities/Appearance.js +35 -18
  187. package/Libraries/Utilities/BackHandler.android.js +13 -28
  188. package/Libraries/Utilities/BackHandler.js.flow +18 -2
  189. package/Libraries/Utilities/DevSettings.js +8 -1
  190. package/Libraries/Utilities/Dimensions.js +18 -12
  191. package/Libraries/Utilities/PixelRatio.js +5 -2
  192. package/Libraries/Utilities/Platform.js.flow +4 -0
  193. package/Libraries/Utilities/PlatformTypes.js +77 -0
  194. package/Libraries/Utilities/differ/deepDiffer.js +5 -2
  195. package/Libraries/Utilities/useColorScheme.js +11 -1
  196. package/Libraries/Utilities/useWindowDimensions.js +6 -0
  197. package/Libraries/Vibration/Vibration.js +14 -11
  198. package/Libraries/vendor/emitter/EventEmitter.js +3 -3
  199. package/README.md +7 -9
  200. package/React/Base/RCTBridge+Private.h +0 -22
  201. package/React/Base/RCTBridge.h +10 -8
  202. package/React/Base/RCTBridge.mm +5 -447
  203. package/React/Base/RCTBridgeDelegate.h +1 -56
  204. package/React/Base/RCTBridgeModule.h +0 -9
  205. package/React/Base/RCTBridgeProxy.h +8 -0
  206. package/React/Base/RCTBridgeProxy.mm +3 -20
  207. package/React/Base/RCTBundleManager.h +0 -3
  208. package/React/Base/RCTBundleManager.m +0 -31
  209. package/React/Base/RCTBundleURLProvider.mm +4 -4
  210. package/React/Base/RCTCallableJSModules.m +0 -18
  211. package/React/Base/RCTConstants.h +1 -0
  212. package/React/Base/RCTConstants.m +1 -0
  213. package/React/Base/RCTConvert.mm +3 -0
  214. package/React/Base/RCTDisplayLink.h +3 -1
  215. package/React/Base/RCTJavaScriptExecutor.h +0 -69
  216. package/React/Base/RCTModuleData.mm +2 -483
  217. package/React/Base/RCTModuleRegistry.m +0 -25
  218. package/React/Base/RCTRootView.m +3 -374
  219. package/React/Base/RCTUtils.h +0 -3
  220. package/React/Base/RCTUtils.mm +17 -27
  221. package/React/Base/RCTVersion.m +1 -1
  222. package/React/Base/RCTViewRegistry.m +1 -29
  223. package/React/Base/Surface/RCTSurface.mm +1 -582
  224. package/React/Base/Surface/RCTSurfaceRootShadowView.m +0 -89
  225. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +0 -1
  226. package/React/CoreModules/PlatformStubs/RCTStatusBarManager.mm +0 -2
  227. package/React/CoreModules/RCTAlertController.mm +1 -0
  228. package/React/CoreModules/RCTAlertManager.mm +0 -5
  229. package/React/CoreModules/RCTLogBox.mm +0 -11
  230. package/React/CoreModules/RCTLogBoxView.h +0 -3
  231. package/React/CoreModules/RCTLogBoxView.mm +0 -31
  232. package/React/CoreModules/RCTPerfMonitor.mm +0 -2
  233. package/React/CoreModules/RCTStatusBarManager.mm +0 -11
  234. package/React/CxxModule/RCTCxxUtils.h +0 -8
  235. package/React/CxxModule/RCTCxxUtils.mm +0 -17
  236. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +179 -7
  237. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +100 -2
  238. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +373 -119
  239. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.cpp +1 -1
  240. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.h +1 -1
  241. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.cpp +71 -71
  242. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.h +96 -96
  243. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.cpp +357 -363
  244. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.h +211 -212
  245. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/RCTComponentViewHelpers.h +107 -107
  246. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.cpp +1 -1
  247. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.h +11 -11
  248. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/States.h +2 -2
  249. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +4 -0
  250. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +4 -0
  251. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +4 -0
  252. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +5 -0
  253. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +0 -1
  254. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +14 -0
  255. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +12 -3
  256. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTVirtualViewContainerState.mm +12 -26
  257. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +39 -4
  258. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +5 -5
  259. package/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm +0 -18
  260. package/React/Fabric/Mounting/RCTComponentViewFactory.mm +9 -5
  261. package/React/Fabric/RCTSurfacePresenter.mm +86 -5
  262. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +2 -0
  263. package/React/I18n/RCTLocalizedString.mm +38 -2
  264. package/React/Modules/RCTEventEmitter.m +30 -10
  265. package/React/Modules/RCTI18nUtil.m +3 -1
  266. package/React/Modules/RCTUIManager.mm +0 -1501
  267. package/React/React-RCTFBReactNativeSpec.podspec +1 -1
  268. package/React/Tests/Text/RCTAttributedTextUtilsTest.mm +27 -0
  269. package/React/Views/RCTModalHostViewController.h +0 -15
  270. package/React/Views/RCTModalHostViewManager.h +0 -24
  271. package/React/Views/RCTShadowView.h +0 -2
  272. package/React/Views/RCTShadowView.m +0 -723
  273. package/React/Views/ScrollView/RCTScrollView.h +0 -81
  274. package/React/Views/ScrollView/RCTScrollableProtocol.h +0 -4
  275. package/React-Core-prebuilt.podspec +45 -17
  276. package/React-Core.podspec +9 -2
  277. package/ReactAndroid/api/ReactAndroid.api +128 -142
  278. package/ReactAndroid/build.gradle.kts +26 -21
  279. package/ReactAndroid/external-artifacts/build.gradle.kts +49 -0
  280. package/ReactAndroid/gradle.properties +1 -1
  281. package/ReactAndroid/hermes-engine/build.gradle.kts +14 -14
  282. package/ReactAndroid/src/debug/AndroidManifest.xml +6 -0
  283. package/ReactAndroid/src/debugOptimized/AndroidManifest.xml +22 -0
  284. package/ReactAndroid/src/main/java/com/facebook/react/BaseReactPackage.kt +3 -7
  285. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +4 -2
  286. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt +4 -6
  287. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +5 -7
  288. package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.kt +212 -0
  289. package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +0 -16
  290. package/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt +6 -1
  291. package/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.kt +1 -0
  292. package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.kt +287 -0
  293. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ColorPropConverter.kt +16 -0
  294. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +15 -2
  295. package/ReactAndroid/src/main/java/com/facebook/react/bridge/interop/InteropModuleRegistry.kt +1 -3
  296. package/ReactAndroid/src/main/java/com/facebook/react/common/build/ReactBuildConfig.kt +4 -0
  297. package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/MapBuffer.kt +50 -2
  298. package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt +63 -22
  299. package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt +33 -0
  300. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +4 -12
  301. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactActivityDelegate.kt +14 -10
  302. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +6 -6
  303. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BundleDownloader.kt +50 -47
  304. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.kt +0 -4
  305. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerFactory.kt +10 -10
  306. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/LocalNetworkPermissionUtil.kt +49 -0
  307. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/MultipartStreamReader.kt +101 -26
  308. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +40 -38
  309. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerBinding.kt +1 -10
  310. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerProviderImpl.kt +0 -3
  311. package/ReactAndroid/src/main/java/com/facebook/react/fabric/ViewTransitionSnapshotManager.kt +15 -11
  312. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.kt +4 -4
  313. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.kt +7 -13
  314. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt +195 -194
  315. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/SynchronousMountItem.kt +12 -8
  316. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +30 -66
  317. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +51 -111
  318. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +11 -23
  319. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +12 -24
  320. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +57 -123
  321. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android.kt +7 -5
  322. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +3 -5
  323. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +11 -23
  324. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlags.kt +0 -24
  325. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlagsDefaults.kt +0 -4
  326. package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.kt +1 -0
  327. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.kt +3 -0
  328. package/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt +50 -0
  329. package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +53 -3
  330. package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt +2 -77
  331. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  332. package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.kt +2 -2
  333. package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +1 -1
  334. package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.kt +9 -4
  335. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +4 -19
  336. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.kt +1 -5
  337. package/ReactAndroid/src/main/java/com/facebook/react/touch/ReactInterceptingViewGroup.kt +4 -4
  338. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +46 -9
  339. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.kt +1 -49
  340. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/HasChildPressedStateDelay.kt +29 -0
  341. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.kt +796 -0
  342. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt +2 -4
  343. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.kt +27 -27
  344. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.kt +184 -0
  345. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.kt +486 -0
  346. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +8 -8
  347. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ShadowNodeRegistry.kt +2 -2
  348. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/SkewMatrixHelper.kt +200 -0
  349. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.kt +3 -0
  350. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.kt +6 -1
  351. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.kt +2 -2
  352. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.kt +7 -1
  353. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.kt +645 -0
  354. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.kt +2 -3
  355. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.kt +142 -0
  356. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupManager.kt +0 -10
  357. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +3 -3
  358. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.kt +527 -0
  359. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.kt +3 -1
  360. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +6 -6
  361. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/ColorStop.kt +6 -0
  362. package/ReactAndroid/src/main/java/com/facebook/react/util/AndroidVersion.kt +7 -0
  363. package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayout.kt +8 -1
  364. package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.kt +0 -3
  365. package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +2 -0
  366. package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.kt +4 -4
  367. package/ReactAndroid/src/main/java/com/facebook/react/views/safeareaview/ReactSafeAreaView.kt +2 -0
  368. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.kt +1640 -0
  369. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.kt +6 -6
  370. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.kt +1317 -0
  371. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollViewManager.kt +7 -7
  372. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.kt +1309 -0
  373. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +6 -6
  374. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt +19 -33
  375. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt +8 -6
  376. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt +4 -4
  377. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/generate-nested-scroll-view.js +13 -20
  378. package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.kt +7 -1
  379. package/ReactAndroid/src/main/java/com/facebook/react/views/text/MutableSpannableLayout.kt +107 -0
  380. package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt +122 -10
  381. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +91 -1
  382. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt +3 -0
  383. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTypefaceUtils.kt +41 -0
  384. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt +48 -2
  385. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextDecorationStyle.kt +200 -0
  386. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextEffectRegistry.kt +45 -0
  387. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextEffectSpanFactory.kt +17 -0
  388. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt +361 -15
  389. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/AnimatedEffectSpan.kt +37 -0
  390. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/{DrawCommandSpan.kt → CanvasEffectSpan.kt} +3 -4
  391. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/CustomStyleSpan.kt +23 -3
  392. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactStrikethroughSpan.kt +30 -3
  393. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactUnderlineSpan.kt +25 -3
  394. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/SetSpanOperation.kt +1 -1
  395. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/StatefulSpan.kt +21 -0
  396. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TextEffectSpan.kt +19 -0
  397. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TouchableSpan.kt +29 -0
  398. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +81 -9
  399. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +4 -0
  400. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +3 -17
  401. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +8 -0
  402. package/ReactAndroid/src/main/java/com/facebook/react/views/view/WindowUtil.kt +2 -0
  403. package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/VirtualViewRenderState.kt +1 -1
  404. package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt +7 -8
  405. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.kt +45 -0
  406. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.kt +27 -0
  407. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.kt +15 -0
  408. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIBase.kt +6 -0
  409. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.kt +27 -0
  410. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.kt +31 -0
  411. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.kt +41 -0
  412. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.kt +37 -0
  413. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt +27 -0
  414. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.kt +31 -0
  415. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.kt +33 -0
  416. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.kt +29 -0
  417. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.kt +43 -0
  418. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.kt +39 -0
  419. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.kt +29 -0
  420. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNative.kt +16 -0
  421. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.kt +12 -2
  422. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.kt +762 -0
  423. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIFinalizer.kt +4 -4
  424. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.kt +27 -0
  425. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.kt +29 -0
  426. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.kt +29 -0
  427. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaProps.kt +24 -2
  428. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.kt +37 -0
  429. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.kt +29 -0
  430. package/ReactAndroid/src/main/jni/CMakeLists.txt +1 -2
  431. package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp +94 -0
  432. package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionDelegateImpl.cpp +3 -0
  433. package/ReactAndroid/src/main/jni/react/fabric/AndroidAnimationChoreographer.h +10 -10
  434. package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +3 -0
  435. package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +12 -15
  436. package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.h +1 -3
  437. package/ReactAndroid/src/main/jni/react/fabric/test/FabricMountingManagerTest.cpp +159 -0
  438. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +69 -153
  439. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +15 -33
  440. package/ReactAndroid/src/main/jni/react/jni/JReactMarker.cpp +10 -24
  441. package/ReactAndroid/src/main/jni/react/jni/JReactMarker.h +0 -2
  442. package/ReactAndroid/src/main/jni/react/mapbuffer/react/common/mapbuffer/JWritableMapBuffer.cpp +13 -0
  443. package/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp +4 -1
  444. package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp +8 -0
  445. package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.h +4 -0
  446. package/ReactAndroid/src/main/res/views/uimanager/values/ids.xml +5 -0
  447. package/ReactAndroid/src/main/res/views/uimanager/values-zu/strings.xml +3 -0
  448. package/ReactApple/RCTAnimatedModuleProvider/React-RCTAnimatedModuleProvider.podspec +63 -0
  449. package/ReactCommon/React-Fabric.podspec +2 -0
  450. package/ReactCommon/ReactCommon.podspec +2 -12
  451. package/ReactCommon/cmake-utils/react-native-flags.cmake +1 -3
  452. package/ReactCommon/cxxreact/CMakeLists.txt +1 -0
  453. package/ReactCommon/cxxreact/ErrorUtils.h +2 -32
  454. package/ReactCommon/cxxreact/Instance.cpp +1 -26
  455. package/ReactCommon/cxxreact/Instance.h +0 -2
  456. package/ReactCommon/cxxreact/NativeToJsBridge.cpp +3 -2
  457. package/ReactCommon/cxxreact/RAMBundleRegistry.cpp +0 -12
  458. package/ReactCommon/cxxreact/RAMBundleRegistry.h +0 -5
  459. package/ReactCommon/cxxreact/React-cxxreact.podspec +2 -1
  460. package/ReactCommon/cxxreact/ReactMarker.cpp +4 -30
  461. package/ReactCommon/cxxreact/ReactMarker.h +38 -21
  462. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  463. package/ReactCommon/cxxreact/TraceSection.h +1 -1
  464. package/ReactCommon/cxxreact/tests/methodcall.cpp +4 -0
  465. package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +6 -79
  466. package/ReactCommon/jserrorhandler/ErrorUtils.cpp +42 -0
  467. package/{React/CxxLogUtils/RCTDefaultCxxLogFunction.h → ReactCommon/jserrorhandler/ErrorUtils.h} +2 -2
  468. package/ReactCommon/jserrorhandler/JsErrorHandler.cpp +1 -1
  469. package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +2 -3
  470. package/ReactCommon/jsi/jsi/hermes-interfaces.h +53 -0
  471. package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +2 -1
  472. package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +3 -14
  473. package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +4 -13
  474. package/ReactCommon/jsinspector-modern/HostAgent.cpp +54 -0
  475. package/ReactCommon/jsinspector-modern/HostTarget.h +0 -7
  476. package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.cpp +10 -7
  477. package/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp +4 -1
  478. package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +7 -0
  479. package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +20 -0
  480. package/ReactCommon/jsinspector-modern/RuntimeTarget.h +16 -0
  481. package/ReactCommon/jsinspector-modern/SessionState.h +31 -0
  482. package/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp +53 -0
  483. package/ReactCommon/jsinspector-modern/tracing/HostTracingProfile.h +14 -1
  484. package/ReactCommon/jsinspector-modern/tracing/TraceRecordingState.h +11 -0
  485. package/ReactCommon/react/bridging/ArrayBuffer.h +180 -0
  486. package/ReactCommon/react/bridging/Bridging.h +1 -0
  487. package/ReactCommon/react/bridging/Convert.h +12 -0
  488. package/ReactCommon/react/bridging/React-bridging.podspec +44 -0
  489. package/ReactCommon/react/bridging/tests/BridgingTest.cpp +185 -11
  490. package/ReactCommon/react/bridging/tests/ClassTest.cpp +22 -0
  491. package/ReactCommon/react/cxxstableapi/CMakeLists.txt +18 -0
  492. package/ReactCommon/react/cxxstableapi/FrameworksGuard.h +35 -0
  493. package/ReactCommon/react/cxxstableapi/PrivateGuard.h +34 -0
  494. package/ReactCommon/react/cxxstableapi/React-cxxstableapi.podspec +34 -0
  495. package/ReactCommon/react/cxxstableapi/UmbrellaGuard.h +53 -0
  496. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +21 -45
  497. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +26 -56
  498. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +134 -242
  499. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +14 -26
  500. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +20 -44
  501. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +43 -97
  502. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +10 -6
  503. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +3 -7
  504. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h +0 -8
  505. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +7 -13
  506. package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h +1 -0
  507. package/ReactCommon/react/nativemodule/core/iostests/RCTTurboModuleTests.mm +49 -0
  508. package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.cpp +4 -0
  509. package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.h +4 -0
  510. package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +1 -1
  511. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
  512. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.h +4 -0
  513. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +4 -0
  514. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +60 -3
  515. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h +0 -9
  516. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +37 -139
  517. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleWithJSIBindings.h +0 -3
  518. package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +6 -0
  519. package/ReactCommon/react/nativemodule/dom/NativeDOM.cpp +10 -4
  520. package/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +1 -0
  521. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +25 -55
  522. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +11 -23
  523. package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +1 -0
  524. package/ReactCommon/react/nativemodule/intersectionobserver/React-intersectionobservernativemodule.podspec +1 -0
  525. package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp +4 -0
  526. package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec +1 -0
  527. package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.h +1 -1
  528. package/ReactCommon/react/nativemodule/webperformance/React-webperformancenativemodule.podspec +1 -0
  529. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +95 -63
  530. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.h +20 -1
  531. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp +7 -10
  532. package/ReactCommon/react/renderer/animated/drivers/FrameAnimationDriver.cpp +20 -1
  533. package/ReactCommon/react/renderer/animated/drivers/FrameAnimationDriver.h +1 -0
  534. package/ReactCommon/react/renderer/animated/nodes/InterpolationAnimatedNode.cpp +67 -6
  535. package/ReactCommon/react/renderer/animated/nodes/InterpolationAnimatedNode.h +12 -0
  536. package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.cpp +25 -13
  537. package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.h +7 -0
  538. package/ReactCommon/react/renderer/animated/tests/AnimationDriverTests.cpp +48 -0
  539. package/ReactCommon/react/renderer/animated/tests/DecayAnimationDriverTest.cpp +245 -0
  540. package/ReactCommon/react/renderer/animated/tests/ManagedPropsMountingOverrideTests.cpp +204 -0
  541. package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.cpp +10 -1
  542. package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h +1 -0
  543. package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +17 -0
  544. package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +0 -2
  545. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +6 -2
  546. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +25 -1
  547. package/ReactCommon/react/renderer/attributedstring/conversions.h +29 -1
  548. package/ReactCommon/react/renderer/attributedstring/primitives.h +4 -2
  549. package/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp +73 -0
  550. package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +6 -0
  551. package/ReactCommon/react/renderer/components/image/ImageProps.cpp +79 -126
  552. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.cpp +4 -0
  553. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.h +4 -0
  554. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropState.h +4 -0
  555. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.cpp +5 -0
  556. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.h +4 -0
  557. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.cpp +5 -0
  558. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.h +4 -0
  559. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.cpp +4 -0
  560. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.h +4 -0
  561. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerInteropComponentDescriptor.h +4 -0
  562. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h +4 -0
  563. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
  564. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +4 -0
  565. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +5 -0
  566. package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.cpp +235 -352
  567. package/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.cpp +30 -46
  568. package/ReactCommon/react/renderer/components/text/BaseParagraphProps.cpp +17 -27
  569. package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +8 -10
  570. package/ReactCommon/react/renderer/components/text/BaseTextShadowNode.cpp +19 -0
  571. package/ReactCommon/react/renderer/components/text/TextEffectComponentDescriptor.h +17 -0
  572. package/ReactCommon/react/renderer/components/text/TextEffectProps.cpp +59 -0
  573. package/ReactCommon/react/renderer/components/text/TextEffectProps.h +30 -0
  574. package/{Libraries/Text/VirtualText/RCTVirtualTextView.mm → ReactCommon/react/renderer/components/text/TextEffectShadowNode.cpp} +4 -6
  575. package/ReactCommon/react/renderer/components/text/TextEffectShadowNode.h +26 -0
  576. package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/HostPlatformParagraphProps.cpp +18 -28
  577. package/ReactCommon/react/renderer/components/text/tests/BaseTextShadowNodeTest.cpp +15 -0
  578. package/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp +42 -50
  579. package/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +168 -754
  580. package/ReactCommon/react/renderer/components/view/AccessibilityProps.h +0 -9
  581. package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +248 -312
  582. package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +0 -6
  583. package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +2 -12
  584. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +73 -27
  585. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h +7 -9
  586. package/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +3 -11
  587. package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +82 -162
  588. package/ReactCommon/react/renderer/components/view/primitives.h +5 -0
  589. package/ReactCommon/react/renderer/components/view/propsConversions.h +74 -42
  590. package/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp +5 -5
  591. package/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp +353 -6
  592. package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +41 -16
  593. package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +19 -0
  594. package/ReactCommon/react/renderer/core/EventEmitter.cpp +20 -4
  595. package/ReactCommon/react/renderer/core/LayoutMetrics.h +3 -0
  596. package/ReactCommon/react/renderer/core/Props.cpp +8 -39
  597. package/ReactCommon/react/renderer/core/Props.h +63 -13
  598. package/ReactCommon/react/renderer/core/RawProps.cpp +20 -3
  599. package/ReactCommon/react/renderer/core/RawProps.h +44 -0
  600. package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +11 -27
  601. package/ReactCommon/react/renderer/core/RawPropsKeyMap.h +3 -3
  602. package/ReactCommon/react/renderer/core/RawPropsParser.cpp +4 -6
  603. package/ReactCommon/react/renderer/core/RawPropsParser.h +3 -3
  604. package/ReactCommon/react/renderer/core/ShadowNode.cpp +27 -19
  605. package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +2 -0
  606. package/ReactCommon/react/renderer/core/StateData.h +4 -4
  607. package/ReactCommon/react/renderer/core/propsConversions.h +3 -7
  608. package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +8 -0
  609. package/ReactCommon/react/renderer/core/tests/FindNodeAtPointTest.cpp +7 -7
  610. package/ReactCommon/react/renderer/core/tests/LayoutableShadowNodeTest.cpp +19 -19
  611. package/ReactCommon/react/renderer/core/tests/PropsConceptsTest.cpp +135 -0
  612. package/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp +43 -53
  613. package/ReactCommon/react/renderer/element/tests/ElementTest.cpp +3 -3
  614. package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/conversions.h +17 -0
  615. package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTSyncImageManager.mm +1 -1
  616. package/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +123 -33
  617. package/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +26 -14
  618. package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +96 -53
  619. package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h +4 -0
  620. package/ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp +96 -1
  621. package/ReactCommon/react/renderer/mounting/Differentiator.cpp +29 -318
  622. package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +105 -33
  623. package/ReactCommon/react/renderer/mounting/ShadowTree.h +2 -0
  624. package/ReactCommon/react/renderer/mounting/tests/DifferentiatorUnflattenTest.cpp +11 -3
  625. package/ReactCommon/react/renderer/mounting/tests/OrderIndexTest.cpp +1 -1
  626. package/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +15 -250
  627. package/ReactCommon/react/renderer/mounting/tests/ShadowTreeReactBranchingTest.cpp +141 -0
  628. package/ReactCommon/react/renderer/mounting/tests/StackingContextTest.cpp +1 -1
  629. package/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt +1 -0
  630. package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +1 -0
  631. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +22 -2
  632. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +13 -2
  633. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.cpp +13 -0
  634. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.h +9 -0
  635. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp +43 -5
  636. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.h +17 -1
  637. package/ReactCommon/react/renderer/runtimescheduler/Task.h +4 -0
  638. package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +113 -8
  639. package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +14 -6
  640. package/ReactCommon/react/renderer/scheduler/Scheduler.h +3 -2
  641. package/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +1 -85
  642. package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +0 -6
  643. package/ReactCommon/react/renderer/scheduler/tests/SchedulerDelegateInvalidationTest.cpp +671 -0
  644. package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +22 -5
  645. package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +4 -2
  646. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +11 -0
  647. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +65 -26
  648. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +193 -1
  649. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h +14 -2
  650. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/TextLayoutManager.mm +2 -1
  651. package/ReactCommon/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp +86 -5
  652. package/ReactCommon/react/renderer/uimanager/UIManager.cpp +89 -94
  653. package/ReactCommon/react/renderer/uimanager/UIManager.h +2 -2
  654. package/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +1 -1
  655. package/ReactCommon/react/renderer/uimanager/tests/FabricUIManagerTest.cpp +144 -3
  656. package/ReactCommon/react/renderer/uimanager/tests/FindShadowNodeByTagTest.cpp +1 -52
  657. package/ReactCommon/react/renderer/uimanager/tests/PointerEventsProcessorTest.cpp +4 -4
  658. package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.cpp +88 -39
  659. package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.h +12 -2
  660. package/ReactCommon/react/runtime/PlatformTimerRegistry.h +10 -0
  661. package/ReactCommon/react/runtime/ReactInstance.cpp +79 -64
  662. package/ReactCommon/react/runtime/hermes/HermesInstance.cpp +0 -89
  663. package/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm +99 -0
  664. package/ReactCommon/react/runtime/iostests/RCTInstanceTests.mm +244 -0
  665. package/ReactCommon/react/runtime/platform/ios/ReactCommon/ObjCTimerRegistry.h +1 -1
  666. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +47 -30
  667. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTJscInstance.mm +3 -2
  668. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.mm +3 -2
  669. package/ReactCommon/react/runtime/tests/cxx/ReactInstanceTest.cpp +27 -3
  670. package/ReactCommon/react/runtime/tests/cxx/RuntimeExecutorShutdownTest.cpp +155 -0
  671. package/ReactCommon/react/utils/Telemetry.h +0 -13
  672. package/ReactCommon/react/utils/tests/Base64Tests.cpp +36 -0
  673. package/ReactCommon/reactperflogger/reactperflogger/ReactPerfettoLogger.cpp +0 -1
  674. package/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm +21 -38
  675. package/ReactCommon/yoga/Yoga.podspec +1 -1
  676. package/ReactCommon/yoga/yoga/YGEnums.cpp +2 -0
  677. package/ReactCommon/yoga/yoga/YGEnums.h +1 -0
  678. package/ReactCommon/yoga/yoga/YGNode.cpp +27 -0
  679. package/ReactCommon/yoga/yoga/YGNode.h +69 -0
  680. package/ReactCommon/yoga/yoga/YGNodeLayout.h +0 -2
  681. package/ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp +2 -1
  682. package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +294 -17
  683. package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.h +1 -1
  684. package/ReactCommon/yoga/yoga/config/Config.h +1 -1
  685. package/ReactCommon/yoga/yoga/enums/Errata.h +1 -0
  686. package/ReactCommon/yoga/yoga/node/LayoutResults.h +8 -0
  687. package/ReactCommon/yoga/yoga/node/Node.cpp +32 -0
  688. package/ReactCommon/yoga/yoga/node/Node.h +33 -0
  689. package/changes.json +6 -14
  690. package/cli.js +3 -182
  691. package/flow/bom.js.flow +42 -42
  692. package/flow/cssom.js.flow +21 -21
  693. package/flow/dom.js.flow +128 -128
  694. package/flow/global.js +6 -0
  695. package/gradle/libs.versions.toml +7 -5
  696. package/index.js +53 -86
  697. package/index.js.flow +53 -23
  698. package/package.json +49 -68
  699. package/react-native.config.js +82 -1
  700. package/scripts/cocoapods/fabric.rb +1 -1
  701. package/scripts/cocoapods/jsengine.rb +1 -1
  702. package/scripts/cocoapods/new_architecture.rb +1 -1
  703. package/scripts/cocoapods/rncore.rb +36 -78
  704. package/scripts/cocoapods/rncore_facades.rb +232 -0
  705. package/scripts/cocoapods/rndependencies.rb +64 -3
  706. package/scripts/cocoapods/rndeps_facades.rb +193 -0
  707. package/scripts/cocoapods/spm.rb +78 -11
  708. package/scripts/cocoapods/utils.rb +5 -7
  709. package/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js +0 -1
  710. package/scripts/codegen/templates/Package.swift.spm-template +97 -0
  711. package/scripts/codegen/templates/ReactCodegen.podspec.template +1 -1
  712. package/scripts/hermes/hermes-utils.js +27 -58
  713. package/scripts/react-native-xcode.sh +20 -0
  714. package/scripts/react_native_pods.rb +71 -21
  715. package/scripts/react_native_pods_utils/script_phases.sh +4 -3
  716. package/scripts/replace-rncore-version.js +57 -86
  717. package/scripts/setup-apple-spm.js +1267 -0
  718. package/scripts/spm/__doc__/rfc-spm-xcframework.md +707 -0
  719. package/scripts/spm/__doc__/spm-autolinking-plugins.md +244 -0
  720. package/scripts/spm/__doc__/spm-header-paths-contract.md +97 -0
  721. package/scripts/spm/__doc__/spm-plugins-assessment.md +128 -0
  722. package/scripts/spm/__doc__/spm-scripts.md +486 -0
  723. package/scripts/spm/autolinking-plugins.js +331 -0
  724. package/scripts/spm/download-spm-artifacts.js +1409 -0
  725. package/scripts/spm/expand-spm-dependencies.js +216 -0
  726. package/scripts/spm/flavored-frameworks.js +1008 -0
  727. package/scripts/spm/generate-spm-autolinking-config.js +221 -0
  728. package/scripts/spm/generate-spm-autolinking.js +1888 -0
  729. package/scripts/spm/generate-spm-package.js +302 -0
  730. package/scripts/spm/generate-spm-xcodeproj.js +2266 -0
  731. package/scripts/spm/read-podspec.js +695 -0
  732. package/scripts/spm/scaffold-package-swift.js +1206 -0
  733. package/scripts/spm/spm-pbxproj.js +654 -0
  734. package/scripts/spm/spm-types.js +520 -0
  735. package/scripts/spm/spm-utils.js +645 -0
  736. package/scripts/spm/sync-spm-autolinking.js +160 -0
  737. package/sdks/.hermesv1version +1 -1
  738. package/sdks/hermes-engine/hermes-engine.podspec +9 -39
  739. package/sdks/hermes-engine/hermes-utils.rb +19 -73
  740. package/sdks/hermes-engine/utils/replace_hermes_version.js +18 -4
  741. package/sdks/hermes-engine/version.properties +1 -2
  742. package/settings.gradle.kts +0 -43
  743. package/src/asset-registry.js +29 -0
  744. package/src/private/animated/NativeAnimatedHelper.js +45 -21
  745. package/src/private/assets/AssetRegistry.js +52 -0
  746. package/src/private/{specs_DEPRECATED/components → components/activityindicator/specs}/ActivityIndicatorViewNativeComponent.js +5 -5
  747. package/src/private/{specs_DEPRECATED/components → components/debuggingoverlay/specs}/DebuggingOverlayNativeComponent.js +8 -8
  748. package/src/private/{specs_DEPRECATED/components → components/drawerlayoutandroid/specs}/AndroidDrawerLayoutNativeComponent.js +8 -8
  749. package/src/private/{specs_DEPRECATED/components → components/inputaccessoryview/specs}/RCTInputAccessoryViewNativeComponent.js +4 -4
  750. package/src/private/{specs_DEPRECATED/components → components/modal/specs}/RCTModalHostViewNativeComponent.js +4 -9
  751. package/src/private/{specs_DEPRECATED/components → components/progressbarandroid/specs}/ProgressBarAndroidNativeComponent.js +5 -5
  752. package/src/private/{specs_DEPRECATED/components → components/refreshcontrol/specs}/AndroidSwipeRefreshLayoutNativeComponent.js +7 -7
  753. package/src/private/{specs_DEPRECATED/components → components/refreshcontrol/specs}/PullToRefreshViewNativeComponent.js +7 -7
  754. package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +2 -2
  755. package/src/private/{specs_DEPRECATED/components → components/safeareaview/specs}/RCTSafeAreaViewNativeComponent.js +3 -3
  756. package/src/private/components/scrollview/HScrollViewNativeComponents.js +1 -1
  757. package/src/private/{specs_DEPRECATED/components → components/scrollview/specs}/AndroidHorizontalScrollContentViewNativeComponent.js +3 -3
  758. package/src/private/{specs_DEPRECATED/components → components/switch/specs}/AndroidSwitchNativeComponent.js +7 -7
  759. package/src/private/{specs_DEPRECATED/components → components/switch/specs}/SwitchNativeComponent.js +10 -7
  760. package/src/private/{specs_DEPRECATED/components → components/unimplementedview/specs}/UnimplementedNativeViewNativeComponent.js +4 -4
  761. package/src/private/components/virtualcollection/Virtual.js +5 -5
  762. package/src/private/components/virtualcollection/VirtualCollectionView.js +2 -6
  763. package/src/private/components/virtualcollection/column/VirtualColumn.js +1 -1
  764. package/src/private/components/virtualcollection/row/VirtualRow.js +1 -1
  765. package/src/private/devsupport/devmenu/elementinspector/Inspector.js +3 -1
  766. package/src/private/devsupport/devmenu/specs/NativeDevMenu.js +4 -4
  767. package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +4 -2
  768. package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsSettingsManager.js +2 -2
  769. package/src/private/featureflags/ReactNativeFeatureFlags.js +46 -70
  770. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +88 -94
  771. package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -2
  772. package/src/private/renderer/events/ReactNativeResponder.js +49 -4
  773. package/src/private/renderer/events/ResponderTouchHistoryStore.js +11 -2
  774. package/src/private/renderer/events/dispatchNativeEvent.js +71 -36
  775. package/src/private/setup/setUpDOM.js +19 -9
  776. package/src/private/setup/setUpIntersectionObserver.js +7 -0
  777. package/src/private/setup/setUpMutationObserver.js +3 -1
  778. package/src/private/specs_DEPRECATED/modules/NativeAccessibilityInfo.js +9 -9
  779. package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +24 -24
  780. package/src/private/specs_DEPRECATED/modules/NativeActionSheetManager.js +28 -28
  781. package/src/private/specs_DEPRECATED/modules/NativeAlertManager.js +1 -1
  782. package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +45 -25
  783. package/src/private/specs_DEPRECATED/modules/NativeAnimatedTurboModule.js +44 -24
  784. package/src/private/specs_DEPRECATED/modules/NativeAppState.js +4 -4
  785. package/src/private/specs_DEPRECATED/modules/NativeAppearance.js +8 -6
  786. package/src/private/specs_DEPRECATED/modules/NativeBlobModule.js +7 -7
  787. package/src/private/specs_DEPRECATED/modules/NativeClipboard.js +3 -3
  788. package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +2 -2
  789. package/src/private/specs_DEPRECATED/modules/NativeDevSettings.js +11 -11
  790. package/src/private/specs_DEPRECATED/modules/NativeDeviceEventManager.js +1 -1
  791. package/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.js +4 -4
  792. package/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.js +7 -7
  793. package/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.js +4 -4
  794. package/src/private/specs_DEPRECATED/modules/NativeFileReaderModule.js +2 -2
  795. package/src/private/specs_DEPRECATED/modules/NativeFrameRateLogger.js +4 -4
  796. package/src/private/specs_DEPRECATED/modules/NativeHeadlessJsTaskSupport.js +2 -2
  797. package/src/private/specs_DEPRECATED/modules/NativeI18nManager.js +1 -1
  798. package/src/private/specs_DEPRECATED/modules/NativeImageEditor.js +13 -13
  799. package/src/private/specs_DEPRECATED/modules/NativeImageLoaderAndroid.js +9 -6
  800. package/src/private/specs_DEPRECATED/modules/NativeImageLoaderIOS.js +6 -6
  801. package/src/private/specs_DEPRECATED/modules/NativeImageStoreAndroid.js +2 -2
  802. package/src/private/specs_DEPRECATED/modules/NativeImageStoreIOS.js +8 -5
  803. package/src/private/specs_DEPRECATED/modules/NativeIntentAndroid.js +5 -5
  804. package/src/private/specs_DEPRECATED/modules/NativeJSCHeapCapture.js +1 -1
  805. package/src/private/specs_DEPRECATED/modules/NativeKeyboardObserver.js +2 -2
  806. package/src/private/specs_DEPRECATED/modules/NativeLinkingManager.js +6 -6
  807. package/src/private/specs_DEPRECATED/modules/NativeLogBox.js +2 -2
  808. package/src/private/specs_DEPRECATED/modules/NativeModalManager.js +2 -2
  809. package/src/private/specs_DEPRECATED/modules/NativeNetworkingAndroid.js +5 -5
  810. package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +6 -6
  811. package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +6 -4
  812. package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsAndroid.js +2 -2
  813. package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsIOS.js +1 -1
  814. package/src/private/specs_DEPRECATED/modules/NativePushNotificationManagerIOS.js +35 -31
  815. package/src/private/specs_DEPRECATED/modules/NativeRedBox.js +2 -2
  816. package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +24 -24
  817. package/src/private/specs_DEPRECATED/modules/NativeSegmentFetcher.js +2 -2
  818. package/src/private/specs_DEPRECATED/modules/NativeSettingsManager.js +3 -3
  819. package/src/private/specs_DEPRECATED/modules/NativeShareModule.js +2 -2
  820. package/src/private/specs_DEPRECATED/modules/NativeSoundManager.js +1 -1
  821. package/src/private/specs_DEPRECATED/modules/NativeSourceCode.js +1 -1
  822. package/src/private/specs_DEPRECATED/modules/NativeStatusBarManagerAndroid.js +5 -17
  823. package/src/private/specs_DEPRECATED/modules/NativeStatusBarManagerIOS.js +10 -15
  824. package/src/private/specs_DEPRECATED/modules/NativeTiming.js +3 -3
  825. package/src/private/specs_DEPRECATED/modules/NativeToastAndroid.js +4 -4
  826. package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +35 -22
  827. package/src/private/specs_DEPRECATED/modules/NativeVibration.js +4 -4
  828. package/src/private/specs_DEPRECATED/modules/NativeWebSocketModule.js +7 -7
  829. package/src/private/types/HostInstance.js +38 -80
  830. package/src/private/viewtransition/specs/NativeViewTransition.js +6 -4
  831. package/src/private/webapis/dom/abort-api/AbortController.js +92 -0
  832. package/src/private/webapis/dom/abort-api/AbortSignal.js +243 -0
  833. package/src/private/webapis/dom/events/CustomEvent.js +1 -1
  834. package/src/private/webapis/dom/events/Event.js +12 -12
  835. package/src/private/webapis/dom/events/EventTarget.js +146 -37
  836. package/src/private/webapis/dom/events/internals/EventInternals.js +36 -0
  837. package/src/private/webapis/dom/events/internals/EventTargetInternals.js +38 -3
  838. package/src/private/webapis/dom/nodes/ReactNativeDocument.js +11 -0
  839. package/src/private/webapis/dom/nodes/ReactNativeElement.js +105 -4
  840. package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +11 -0
  841. package/src/private/webapis/dom/nodes/ReadOnlyElement.js +9 -0
  842. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +34 -7
  843. package/src/private/webapis/dom/nodes/ReadOnlyText.js +33 -0
  844. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +46 -42
  845. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +12 -0
  846. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js.flow +4 -2
  847. package/src/private/webapis/dom/oldstylecollections/NodeList.js +10 -0
  848. package/src/private/webapis/dom/oldstylecollections/NodeList.js.flow +4 -3
  849. package/src/private/webapis/errors/DOMException.js +50 -50
  850. package/src/private/webapis/geometry/DOMRectList.js +12 -0
  851. package/src/private/webapis/geometry/DOMRectList.js.flow +3 -1
  852. package/src/private/webapis/html/events/MessageEvent.js +3 -3
  853. package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +2 -2
  854. package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +13 -0
  855. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +3 -7
  856. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +5 -5
  857. package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +1 -1
  858. package/src/private/webapis/mutationobserver/MutationObserver.js +7 -7
  859. package/src/private/webapis/mutationobserver/MutationRecord.js +12 -0
  860. package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +5 -7
  861. package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +5 -5
  862. package/src/private/webapis/performance/EventTiming.js +3 -3
  863. package/src/private/webapis/performance/PerformanceEntry.js +3 -3
  864. package/src/private/webapis/performance/PerformanceObserver.js +4 -4
  865. package/src/private/webapis/performance/ResourceTiming.js +13 -13
  866. package/src/private/webapis/performance/UserTiming.js +3 -3
  867. package/src/private/webapis/performance/internals/Utilities.js +1 -1
  868. package/src/private/webapis/performance/specs/NativePerformance.js +26 -20
  869. package/src/private/webapis/utils/ArrayLikeUtils.js +1 -1
  870. package/src/private/webapis/websockets/events/CloseEvent.js +3 -3
  871. package/src/private/webapis/xhr/events/ProgressEvent.js +3 -3
  872. package/src/react-private-interface.js +145 -0
  873. package/src/react-private-interface.js.flow +48 -0
  874. package/src/setup-env.js +22 -0
  875. package/src/types/globals.d.ts +33 -1
  876. package/src/unstable-internals-do-not-use.d.ts +214 -0
  877. package/src/unstable-internals-do-not-use.js +76 -0
  878. package/third-party-podspecs/ReactNativeDependencies.podspec +2 -2
  879. package/types/index.d.ts +0 -1
  880. package/types/public/DeprecatedPropertiesAlias.d.ts +0 -4
  881. package/types/public/ReactNativeTypes.d.ts +4 -2
  882. package/types_generated/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +26 -31
  883. package/types_generated/Libraries/Alert/Alert.d.ts +44 -7
  884. package/types_generated/Libraries/Animated/AnimatedEvent.d.ts +2 -2
  885. package/types_generated/Libraries/Animated/AnimatedExports.d.ts +2 -2
  886. package/types_generated/Libraries/Animated/AnimatedImplementation.d.ts +107 -3
  887. package/types_generated/Libraries/Animated/Easing.d.ts +5 -4
  888. package/types_generated/Libraries/Animated/animations/Animation.d.ts +7 -7
  889. package/types_generated/Libraries/Animated/animations/DecayAnimation.d.ts +5 -5
  890. package/types_generated/Libraries/Animated/animations/SpringAnimation.d.ts +49 -49
  891. package/types_generated/Libraries/Animated/animations/TimingAnimation.d.ts +13 -13
  892. package/types_generated/Libraries/Animated/components/AnimatedFlatList.d.ts +3 -3
  893. package/types_generated/Libraries/Animated/components/AnimatedSectionList.d.ts +3 -3
  894. package/types_generated/Libraries/Animated/createAnimatedComponent.d.ts +4 -4
  895. package/types_generated/Libraries/Animated/nodes/AnimatedColor.d.ts +2 -2
  896. package/types_generated/Libraries/Animated/nodes/AnimatedInterpolation.d.ts +9 -9
  897. package/types_generated/Libraries/Animated/nodes/AnimatedNode.d.ts +3 -3
  898. package/types_generated/Libraries/AppState/AppState.d.ts +41 -22
  899. package/types_generated/Libraries/BatchedBridge/NativeModules.d.ts +8 -1
  900. package/types_generated/Libraries/Blob/BlobTypes.d.ts +4 -4
  901. package/types_generated/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +37 -46
  902. package/types_generated/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +92 -43
  903. package/types_generated/Libraries/Components/Button.d.ts +118 -197
  904. package/types_generated/Libraries/Components/Clipboard/Clipboard.d.ts +6 -1
  905. package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.d.ts +44 -63
  906. package/types_generated/Libraries/Components/Keyboard/Keyboard.d.ts +30 -61
  907. package/types_generated/Libraries/Components/Keyboard/KeyboardAvoidingView.d.ts +30 -21
  908. package/types_generated/Libraries/Components/Pressable/Pressable.d.ts +41 -17
  909. package/types_generated/Libraries/Components/Pressable/useAndroidRippleForView.d.ts +6 -6
  910. package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +5 -5
  911. package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.d.ts +18 -1
  912. package/types_generated/Libraries/Components/RefreshControl/RefreshControl.d.ts +35 -52
  913. package/types_generated/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +9 -11
  914. package/types_generated/Libraries/Components/ScrollView/ScrollView.d.ts +212 -88
  915. package/types_generated/Libraries/Components/ScrollView/ScrollViewStickyHeader.d.ts +4 -4
  916. package/types_generated/Libraries/Components/StatusBar/StatusBar.d.ts +29 -62
  917. package/types_generated/Libraries/Components/Switch/Switch.d.ts +75 -70
  918. package/types_generated/Libraries/Components/TextInput/InputAccessoryView.d.ts +16 -65
  919. package/types_generated/Libraries/Components/TextInput/TextInput.d.ts +118 -3
  920. package/types_generated/Libraries/Components/TextInput/TextInput.flow.d.ts +23 -8
  921. package/types_generated/Libraries/Components/ToastAndroid/ToastAndroid.d.ts +18 -18
  922. package/types_generated/Libraries/Components/Touchable/TouchableHighlight.d.ts +24 -13
  923. package/types_generated/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts +27 -64
  924. package/types_generated/Libraries/Components/Touchable/TouchableOpacity.d.ts +18 -6
  925. package/types_generated/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +28 -28
  926. package/types_generated/Libraries/Components/View/View.d.ts +13 -9
  927. package/types_generated/Libraries/Components/View/ViewAccessibility.d.ts +28 -17
  928. package/types_generated/Libraries/Components/View/ViewNativeComponent.d.ts +1 -2
  929. package/types_generated/Libraries/Components/View/ViewPropTypes.d.ts +75 -24
  930. package/types_generated/Libraries/Core/ExtendedError.d.ts +10 -10
  931. package/types_generated/Libraries/EventEmitter/NativeEventEmitter.d.ts +34 -1
  932. package/types_generated/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +4 -1
  933. package/types_generated/Libraries/Image/AssetSourceResolver.d.ts +2 -13
  934. package/types_generated/Libraries/Image/ImageBackground.d.ts +33 -22
  935. package/types_generated/Libraries/Image/ImageProps.d.ts +201 -251
  936. package/types_generated/Libraries/Image/ImageTypes.flow.d.ts +6 -5
  937. package/types_generated/Libraries/Interaction/PanResponder.d.ts +103 -97
  938. package/types_generated/Libraries/LayoutAnimation/LayoutAnimation.d.ts +18 -7
  939. package/types_generated/Libraries/Linking/Linking.d.ts +28 -20
  940. package/types_generated/Libraries/Lists/FlatList.d.ts +17 -18
  941. package/types_generated/Libraries/Lists/SectionList.d.ts +10 -5
  942. package/types_generated/Libraries/Lists/VirtualizedList.d.ts +3 -1
  943. package/types_generated/Libraries/Lists/VirtualizedSectionList.d.ts +3 -1
  944. package/types_generated/Libraries/LogBox/Data/LogBoxData.d.ts +2 -2
  945. package/types_generated/Libraries/LogBox/Data/LogBoxLog.d.ts +2 -2
  946. package/types_generated/Libraries/LogBox/Data/parseLogBoxLog.d.ts +2 -2
  947. package/types_generated/Libraries/LogBox/LogBox.d.ts +4 -1
  948. package/types_generated/Libraries/Modal/Modal.d.ts +70 -35
  949. package/types_generated/Libraries/Network/FormData.d.ts +5 -5
  950. package/types_generated/Libraries/Performance/Systrace.d.ts +11 -1
  951. package/types_generated/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +31 -21
  952. package/types_generated/Libraries/Pressability/Pressability.d.ts +5 -5
  953. package/types_generated/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts +15 -11
  954. package/types_generated/Libraries/ReactNative/AppRegistry.flow.d.ts +5 -5
  955. package/types_generated/Libraries/ReactNative/AppRegistryImpl.d.ts +56 -9
  956. package/types_generated/Libraries/ReactNative/I18nManager.d.ts +20 -1
  957. package/types_generated/Libraries/ReactNative/IPerformanceLogger.flow.d.ts +5 -5
  958. package/types_generated/Libraries/ReactPrivate/ReactNativePrivateInterface.d.ts +6 -22
  959. package/types_generated/Libraries/Renderer/shims/ReactNativeTypes.d.ts +34 -34
  960. package/types_generated/Libraries/Share/Share.d.ts +36 -39
  961. package/types_generated/Libraries/StyleSheet/PlatformColorValueTypes.d.ts +7 -1
  962. package/types_generated/Libraries/StyleSheet/PlatformColorValueTypesIOS.d.ts +3 -3
  963. package/types_generated/Libraries/StyleSheet/StyleSheetTypes.d.ts +202 -181
  964. package/types_generated/Libraries/StyleSheet/private/_TransformStyle.d.ts +3 -3
  965. package/types_generated/Libraries/Text/Text.d.ts +10 -6
  966. package/types_generated/Libraries/Text/TextProps.d.ts +57 -102
  967. package/types_generated/Libraries/TurboModule/RCTExport.d.ts +2 -2
  968. package/types_generated/Libraries/Types/CoreEventTypes.d.ts +14 -8
  969. package/types_generated/Libraries/Utilities/Appearance.d.ts +25 -13
  970. package/types_generated/Libraries/Utilities/BackHandler.d.ts +17 -1
  971. package/types_generated/Libraries/Utilities/DevSettings.d.ts +9 -2
  972. package/types_generated/Libraries/Utilities/Dimensions.d.ts +19 -13
  973. package/types_generated/Libraries/Utilities/PixelRatio.d.ts +6 -3
  974. package/types_generated/Libraries/Utilities/Platform.d.ts +5 -1
  975. package/types_generated/Libraries/Utilities/PlatformTypes.d.ts +65 -6
  976. package/types_generated/Libraries/Utilities/codegenNativeComponent.d.ts +5 -5
  977. package/types_generated/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.d.ts +2 -2
  978. package/types_generated/Libraries/Utilities/differ/deepDiffer.d.ts +2 -2
  979. package/types_generated/Libraries/Utilities/useColorScheme.d.ts +12 -2
  980. package/types_generated/Libraries/Utilities/useWindowDimensions.d.ts +7 -1
  981. package/types_generated/Libraries/Vibration/Vibration.d.ts +14 -6
  982. package/types_generated/index.d.ts +31 -25
  983. package/types_generated/src/private/assets/AssetRegistry.d.ts +42 -0
  984. package/types_generated/src/private/components/virtualcollection/VirtualCollectionView.d.ts +5 -5
  985. package/types_generated/src/private/components/virtualcollection/column/VirtualColumn.d.ts +3 -3
  986. package/types_generated/src/private/components/virtualcollection/row/VirtualRow.d.ts +3 -3
  987. package/types_generated/src/private/components/virtualview/VirtualView.d.ts +7 -7
  988. package/types_generated/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.d.ts +5 -5
  989. package/types_generated/src/private/components/virtualview/VirtualViewNativeComponent.d.ts +5 -5
  990. package/types_generated/src/private/renderer/events/dispatchNativeEvent.d.ts +26 -0
  991. package/types_generated/src/private/specs_DEPRECATED/modules/NativeAppearance.d.ts +6 -5
  992. package/types_generated/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.d.ts +7 -7
  993. package/types_generated/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.d.ts +5 -5
  994. package/types_generated/src/private/specs_DEPRECATED/modules/NativeUIManager.d.ts +8 -8
  995. package/types_generated/src/private/types/HostComponent.d.ts +3 -3
  996. package/types_generated/src/private/types/HostInstance.d.ts +39 -74
  997. package/types_generated/src/private/webapis/dom/events/CustomEvent.d.ts +2 -2
  998. package/types_generated/src/private/webapis/dom/events/Event.d.ts +4 -4
  999. package/types_generated/src/private/webapis/dom/events/EventTarget.d.ts +8 -8
  1000. package/types_generated/src/private/webapis/dom/nodes/ReactNativeDocument.d.ts +3 -1
  1001. package/types_generated/src/private/webapis/dom/nodes/ReactNativeElement.d.ts +57 -4
  1002. package/types_generated/src/private/webapis/dom/nodes/ReadOnlyCharacterData.d.ts +3 -1
  1003. package/types_generated/src/private/webapis/dom/nodes/ReadOnlyElement.d.ts +3 -1
  1004. package/types_generated/src/private/webapis/dom/nodes/ReadOnlyNode.d.ts +4 -2
  1005. package/types_generated/src/private/webapis/dom/nodes/ReadOnlyText.d.ts +3 -1
  1006. package/types_generated/src/private/webapis/dom/nodes/specs/NativeDOM.d.ts +3 -3
  1007. package/types_generated/src/private/webapis/dom/oldstylecollections/HTMLCollection.d.ts +3 -1
  1008. package/types_generated/src/private/webapis/dom/oldstylecollections/NodeList.d.ts +3 -1
  1009. package/types_generated/src/react-private-interface.d.ts +33 -0
  1010. package/Libraries/AppDelegate/RCTArchConfiguratorProtocol.h +0 -38
  1011. package/Libraries/Image/AssetRegistry.js +0 -14
  1012. package/Libraries/Image/RCTImageShadowView.h +0 -17
  1013. package/Libraries/Image/RCTImageShadowView.mm +0 -28
  1014. package/Libraries/Image/RCTImageView.h +0 -32
  1015. package/Libraries/Image/RCTImageView.mm +0 -508
  1016. package/Libraries/Image/RCTImageViewManager.h +0 -17
  1017. package/Libraries/Image/RCTImageViewManager.mm +0 -115
  1018. package/Libraries/Interaction/InteractionManager.d.ts +0 -87
  1019. package/Libraries/Interaction/InteractionManager.js +0 -189
  1020. package/Libraries/Text/BaseText/RCTBaseTextShadowView.h +0 -35
  1021. package/Libraries/Text/BaseText/RCTBaseTextShadowView.mm +0 -162
  1022. package/Libraries/Text/BaseText/RCTBaseTextViewManager.h +0 -21
  1023. package/Libraries/Text/BaseText/RCTBaseTextViewManager.mm +0 -64
  1024. package/Libraries/Text/RCTTextAttributes.h +0 -107
  1025. package/Libraries/Text/RCTTextAttributes.mm +0 -358
  1026. package/Libraries/Text/RawText/RCTRawTextShadowView.h +0 -23
  1027. package/Libraries/Text/RawText/RCTRawTextShadowView.mm +0 -38
  1028. package/Libraries/Text/RawText/RCTRawTextViewManager.h +0 -21
  1029. package/Libraries/Text/RawText/RCTRawTextViewManager.mm +0 -32
  1030. package/Libraries/Text/Text/RCTTextShadowView.h +0 -33
  1031. package/Libraries/Text/Text/RCTTextShadowView.mm +0 -469
  1032. package/Libraries/Text/Text/RCTTextView.h +0 -34
  1033. package/Libraries/Text/Text/RCTTextView.mm +0 -298
  1034. package/Libraries/Text/Text/RCTTextViewManager.h +0 -19
  1035. package/Libraries/Text/Text/RCTTextViewManager.mm +0 -97
  1036. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +0 -21
  1037. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.mm +0 -67
  1038. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.h +0 -21
  1039. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm +0 -28
  1040. package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.h +0 -30
  1041. package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.mm +0 -367
  1042. package/Libraries/Text/TextInput/RCTBaseTextInputView.h +0 -68
  1043. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +0 -849
  1044. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.h +0 -17
  1045. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +0 -181
  1046. package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.h +0 -17
  1047. package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.mm +0 -24
  1048. package/Libraries/Text/TextInput/RCTInputAccessoryView.h +0 -22
  1049. package/Libraries/Text/TextInput/RCTInputAccessoryView.mm +0 -82
  1050. package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.h +0 -17
  1051. package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.mm +0 -78
  1052. package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.h +0 -17
  1053. package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm +0 -33
  1054. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.h +0 -21
  1055. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.mm +0 -43
  1056. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.h +0 -21
  1057. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm +0 -35
  1058. package/Libraries/Text/VirtualText/RCTVirtualTextShadowView.h +0 -17
  1059. package/Libraries/Text/VirtualText/RCTVirtualTextShadowView.mm +0 -42
  1060. package/Libraries/Text/VirtualText/RCTVirtualTextView.h +0 -28
  1061. package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.h +0 -17
  1062. package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm +0 -30
  1063. package/Libraries/Utilities/SceneTracker.js +0 -42
  1064. package/Libraries/Wrapper/Example/RCTWrapperExampleView.h +0 -21
  1065. package/Libraries/Wrapper/Example/RCTWrapperExampleView.m +0 -57
  1066. package/Libraries/Wrapper/Example/RCTWrapperExampleViewController.h +0 -21
  1067. package/Libraries/Wrapper/Example/RCTWrapperExampleViewController.m +0 -27
  1068. package/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.h +0 -25
  1069. package/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.m +0 -50
  1070. package/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.h +0 -23
  1071. package/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.m +0 -35
  1072. package/Libraries/Wrapper/RCTWrapper.h +0 -73
  1073. package/Libraries/Wrapper/RCTWrapperShadowView.h +0 -27
  1074. package/Libraries/Wrapper/RCTWrapperShadowView.m +0 -138
  1075. package/Libraries/Wrapper/RCTWrapperView.h +0 -42
  1076. package/Libraries/Wrapper/RCTWrapperView.m +0 -99
  1077. package/Libraries/Wrapper/RCTWrapperViewControllerHostingView.h +0 -30
  1078. package/Libraries/Wrapper/RCTWrapperViewControllerHostingView.m +0 -137
  1079. package/Libraries/Wrapper/RCTWrapperViewManager.h +0 -25
  1080. package/Libraries/Wrapper/RCTWrapperViewManager.m +0 -31
  1081. package/React/Base/RCTRootContentView.h +0 -43
  1082. package/React/Base/RCTRootContentView.m +0 -111
  1083. package/React/Base/RCTRootViewInternal.h +0 -28
  1084. package/React/CxxBridge/RCTCxxBridge.mm +0 -1572
  1085. package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.h +0 -25
  1086. package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.mm +0 -34
  1087. package/React/CxxBridge/RCTObjcExecutor.h +0 -34
  1088. package/React/CxxBridge/RCTObjcExecutor.mm +0 -150
  1089. package/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm +0 -34
  1090. package/React/CxxModule/DispatchMessageQueueThread.h +0 -50
  1091. package/React/CxxModule/RCTCxxMethod.h +0 -17
  1092. package/React/CxxModule/RCTCxxMethod.mm +0 -147
  1093. package/React/CxxModule/RCTNativeModule.h +0 -34
  1094. package/React/CxxModule/RCTNativeModule.mm +0 -241
  1095. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm +0 -205
  1096. package/React/Tests/Text/RCTTextAttributesTest.mm +0 -49
  1097. package/React/Views/RCTActivityIndicatorView.h +0 -16
  1098. package/React/Views/RCTActivityIndicatorView.m +0 -26
  1099. package/React/Views/RCTActivityIndicatorViewManager.h +0 -23
  1100. package/React/Views/RCTActivityIndicatorViewManager.m +0 -65
  1101. package/React/Views/RCTDebuggingOverlayManager.h +0 -17
  1102. package/React/Views/RCTDebuggingOverlayManager.m +0 -68
  1103. package/React/Views/RCTModalHostView.h +0 -64
  1104. package/React/Views/RCTModalHostView.m +0 -264
  1105. package/React/Views/RCTModalHostViewController.m +0 -74
  1106. package/React/Views/RCTModalHostViewManager.m +0 -131
  1107. package/React/Views/RCTModalManager.h +0 -22
  1108. package/React/Views/RCTModalManager.m +0 -46
  1109. package/React/Views/RCTRootShadowView.h +0 -35
  1110. package/React/Views/RCTRootShadowView.m +0 -53
  1111. package/React/Views/RCTShadowView+Internal.h +0 -18
  1112. package/React/Views/RCTShadowView+Internal.m +0 -23
  1113. package/React/Views/RCTSwitch.h +0 -22
  1114. package/React/Views/RCTSwitch.m +0 -24
  1115. package/React/Views/RCTSwitchManager.h +0 -17
  1116. package/React/Views/RCTSwitchManager.m +0 -70
  1117. package/React/Views/RefreshControl/RCTRefreshControl.h +0 -24
  1118. package/React/Views/RefreshControl/RCTRefreshControl.m +0 -230
  1119. package/React/Views/RefreshControl/RCTRefreshControlManager.h +0 -17
  1120. package/React/Views/RefreshControl/RCTRefreshControlManager.m +0 -47
  1121. package/React/Views/SafeAreaView/RCTSafeAreaShadowView.h +0 -21
  1122. package/React/Views/SafeAreaView/RCTSafeAreaShadowView.m +0 -57
  1123. package/React/Views/SafeAreaView/RCTSafeAreaView.h +0 -27
  1124. package/React/Views/SafeAreaView/RCTSafeAreaView.m +0 -79
  1125. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +0 -25
  1126. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.m +0 -25
  1127. package/React/Views/SafeAreaView/RCTSafeAreaViewManager.h +0 -21
  1128. package/React/Views/SafeAreaView/RCTSafeAreaViewManager.m +0 -32
  1129. package/React/Views/ScrollView/RCTScrollContentShadowView.h +0 -19
  1130. package/React/Views/ScrollView/RCTScrollContentShadowView.m +0 -35
  1131. package/React/Views/ScrollView/RCTScrollContentView.h +0 -19
  1132. package/React/Views/ScrollView/RCTScrollContentView.m +0 -36
  1133. package/React/Views/ScrollView/RCTScrollContentViewManager.h +0 -17
  1134. package/React/Views/ScrollView/RCTScrollContentViewManager.m +0 -31
  1135. package/React/Views/ScrollView/RCTScrollView.m +0 -1168
  1136. package/React/Views/ScrollView/RCTScrollViewManager.h +0 -25
  1137. package/React/Views/ScrollView/RCTScrollViewManager.m +0 -202
  1138. package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +0 -251
  1139. package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.java +0 -315
  1140. package/ReactAndroid/src/main/java/com/facebook/react/common/ClearableSynchronizedPool.kt +0 -51
  1141. package/ReactAndroid/src/main/java/com/facebook/react/fabric/AnimationBackendChoreographer.kt +0 -89
  1142. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java +0 -736
  1143. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +0 -221
  1144. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +0 -399
  1145. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactZIndexedViewGroup.kt +0 -35
  1146. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +0 -346
  1147. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +0 -666
  1148. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +0 -147
  1149. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupDrawingOrderHelper.kt +0 -113
  1150. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java +0 -614
  1151. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +0 -1838
  1152. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.java +0 -1646
  1153. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +0 -1638
  1154. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java +0 -51
  1155. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.java +0 -33
  1156. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.java +0 -33
  1157. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.java +0 -37
  1158. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.java +0 -47
  1159. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.java +0 -41
  1160. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java +0 -33
  1161. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.java +0 -37
  1162. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.java +0 -39
  1163. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.java +0 -35
  1164. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.java +0 -49
  1165. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.java +0 -45
  1166. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.java +0 -35
  1167. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java +0 -928
  1168. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.java +0 -33
  1169. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.java +0 -35
  1170. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.java +0 -35
  1171. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.java +0 -43
  1172. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.java +0 -35
  1173. package/ReactAndroid/src/main/jni/react/fabric/JAnimationBackendChoreographer.cpp +0 -23
  1174. package/ReactAndroid/src/main/jni/react/fabric/JAnimationBackendChoreographer.h +0 -37
  1175. package/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +0 -135
  1176. package/ReactCommon/cxxreact/JSIndexedRAMBundle.h +0 -72
  1177. package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.cpp +0 -143
  1178. package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.h +0 -55
  1179. package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +0 -78
  1180. package/ReactCommon/hermes/inspector-modern/chrome/Registration.h +0 -39
  1181. package/ReactCommon/hermes/inspector-modern/chrome/tests/ConnectionDemuxTests.cpp +0 -148
  1182. package/ReactCommon/react/nativemodule/samples/platform/android/NativeSampleTurboModuleSpec.java +0 -168
  1183. package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.cpp +0 -416
  1184. package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.h +0 -31
  1185. package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.h +0 -134
  1186. package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.mm +0 -290
  1187. package/ReactCommon/react/renderer/core/RawPropsKey.cpp +0 -62
  1188. package/ReactCommon/react/renderer/core/RawPropsKey.h +0 -39
  1189. package/ReactCommon/react/renderer/mounting/internal/DiffMap.h +0 -170
  1190. package/ReactCommon/react/renderer/mounting/internal/LongestIncreasingSubsequence.h +0 -95
  1191. package/ReactCommon/react/renderer/mounting/internal/TinyMap.h +0 -147
  1192. package/ReactCommon/react/renderer/mounting/tests/LongestIncreasingSubsequenceTest.cpp +0 -154
  1193. package/interface.js +0 -21
  1194. package/jest-preset.js +0 -26
  1195. package/rn-get-polyfills.js +0 -13
  1196. package/sdks/.hermesversion +0 -1
  1197. package/src/private/components/virtualcollection/debug/FlingItemOverlay.js +0 -13
  1198. package/types/tsconfig.json +0 -15
  1199. package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.d.ts +0 -14
  1200. package/types_generated/Libraries/Components/ScrollView/ScrollViewNativeComponent.d.ts +0 -21
  1201. package/types_generated/Libraries/Components/ScrollView/ScrollViewNativeComponentType.d.ts +0 -134
  1202. package/types_generated/Libraries/Components/Switch/AndroidSwitchNativeComponent.d.ts +0 -14
  1203. package/types_generated/Libraries/Components/Switch/SwitchNativeComponent.d.ts +0 -14
  1204. package/types_generated/Libraries/Components/Touchable/Touchable.d.ts +0 -262
  1205. package/types_generated/Libraries/Interaction/InteractionManager.d.ts +0 -117
  1206. package/types_generated/Libraries/NativeModules/specs/NativeDialogManagerAndroid.d.ts +0 -17
  1207. package/types_generated/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.d.ts +0 -53
  1208. package/types_generated/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.d.ts +0 -36
  1209. package/types_generated/src/private/specs_DEPRECATED/components/SwitchNativeComponent.d.ts +0 -51
  1210. package/types_generated/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.d.ts +0 -37
  1211. package/types_generated/tsconfig.test.json +0 -16
  1212. /package/ReactCommon/{cxxreact → react/utils}/MoveWrapper.h +0 -0
@@ -0,0 +1,1206 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ /*::
14
+ import type {
15
+ AutolinkedDep,
16
+ AutolinkingIosPlatform,
17
+ PodspecModel,
18
+ ScaffoldResult,
19
+ SpmScaffoldSpec,
20
+ } from './spm-types';
21
+ */
22
+
23
+ /**
24
+ * scaffold-package-swift.js — generates a `Package.swift` into
25
+ * `node_modules/<dep>/` for community RN libraries that don't ship SPM
26
+ * support. The autolinker's existing `isSelfManagedPackage` check
27
+ * (generate-spm-autolinking.js, AUTOGEN_MARKER) treats these scaffolded
28
+ * files as self-managed and references them directly from the aggregator —
29
+ * no autolinker changes required.
30
+ *
31
+ * Three layers:
32
+ * - translatePodspecToSpmTarget(model, dep): pure translation
33
+ * - emitScaffoldedPackageSwift(spec, ctx): pure Swift emission
34
+ * - scaffoldPackageSwiftForDep(dep, ctx): I/O + skip-rule + write
35
+ * - scaffoldAll(opts): orchestrator over autolinking.json
36
+ */
37
+
38
+ const {
39
+ defaultReadConfig,
40
+ defaultResolveDep,
41
+ expandSpmDependencies,
42
+ } = require('./expand-spm-dependencies');
43
+ const {expandSpmSourceGlobs} = require('./generate-spm-autolinking');
44
+ const {readPodspec} = require('./read-podspec');
45
+ const {
46
+ SCAFFOLDER_MARKER,
47
+ makeLogger,
48
+ remotePackageConfig,
49
+ toSwiftName,
50
+ } = require('./spm-utils');
51
+ const fs = require('fs');
52
+ const path = require('path');
53
+
54
+ const {log} = makeLogger('scaffold-package-swift');
55
+
56
+ // SCAFFOLDER_MARKER lives in spm-utils.js (shared, no import cycle). It must NOT
57
+ // contain the autolinker's AUTOGEN_MARKER ('// AUTO-GENERATED by
58
+ // scripts/generate-spm-autolinking.js') — that marker is what the autolinker
59
+ // uses to tell self-managed deps from its own synth output. Our marker is
60
+ // recognized by the scaffolder itself (skip-rule), but invisible to the
61
+ // autolinker (treated as self-managed).
62
+
63
+ // Bump when the emitter's output format changes in a way that requires
64
+ // re-scaffolding existing files (rather than just being a content drift the
65
+ // cache-slot label already handles). v2: swift-tools-version moved to
66
+ // line 1 — pre-v2 scaffolds emit it on a later line, which recent Xcode
67
+ // rejects with "Swift tools version 3.1.0 ... no longer supported". v4: the
68
+ // single `let rnHeaders = appRoot + "/.../ReactHeadersAll"` split into the two
69
+ // `rnCoreHeaders` / `appHeaders` lets (merged tree replaced by two trees), so
70
+ // pre-v4 scaffolds reference a tree that is no longer materialized. v5:
71
+ // header resolution moved to product dependencies (ReactNativeHeaders +
72
+ // ReactAppHeaders binary/headers targets) — the rnCoreHeaders/appHeaders
73
+ // trees no longer exist, so pre-v5 scaffolds carry dead lets and would break
74
+ // if anything still referenced them. v7: the runtime appRoot walker and the
75
+ // siblingPath helper are gone — package paths are plain relative strings
76
+ // computed at scaffold time (the walker anchored on
77
+ // build/xcframeworks/Package.swift, which remote mode no longer writes).
78
+ //
79
+ // Skip-rule contract: when an existing file's version is < this constant,
80
+ // the scaffolder regenerates regardless of --force (the bump implies the
81
+ // existing file is broken under current tooling). A file with the marker
82
+ // but no version line is treated as v1.
83
+ // v8: relative app paths (codegen / xcframeworks) are now computed from the
84
+ // autolinker's libs/<SwiftName> symlink location instead of the real dep.root,
85
+ // fixing a doubled-path resolution failure on fresh SwiftPM resolves.
86
+ // v9: header search paths derived from each subspec's header_mappings_dir
87
+ // (dirname) so namespaced includes (`<reanimated/...>`) resolve. v10:
88
+ // publicHeadersPath derived from the header_mappings_dir namespace root so a
89
+ // package exposes `<namespace/...>` to dependents; pod-style sibling deps
90
+ // (reanimated's `s.dependency "RNWorklets"`) wired to their npm package. v11:
91
+ // sibling .package path uses the libs/<SwiftName> symlink name, not the npm
92
+ // name (fixes "package ... doesn't exist" on resolve). v12: preprocessor
93
+ // defines from pod_target_xcconfig emitted as `.define(...)`. v13: ObjC(++)
94
+ // targets get an ambient-import prefix header (Foundation/UIKit) `-include`d,
95
+ // replacing CocoaPods' generated prefix.pch. v18: React-core deps also get
96
+ // the ReactNativeDependenciesHeaders product (ReactNativeHeaders went
97
+ // pure-RN; folly/glog/boost/... now come from the deps sidecar);
98
+ // publicHeadersPath falls back to "." for root-level-source podspecs
99
+ // (`s.source_files = "*.{h,m,mm}"`) instead of SPM's nonexistent `include/`.
100
+ // v19: scaffolded C++ targets carry DEBUG/NDEBUG config defines so their Fabric
101
+ // ABI matches the prebuilt React.framework (Release strips DebugStringConvertible
102
+ // under NDEBUG). Bumped so existing scaffolds regenerate with the defines.
103
+ const SCAFFOLDER_VERSION = 19;
104
+ const SCAFFOLDER_VERSION_LINE_RE = /^\/\/ AUTO-SCAFFOLDED-VERSION: (\d+)$/m;
105
+
106
+ const AUTOGEN_MARKER =
107
+ '// AUTO-GENERATED by scripts/generate-spm-autolinking.js';
108
+
109
+ // CocoaPods auto-generates a `<Target>-prefix.pch` that imports Foundation +
110
+ // UIKit into every ObjC translation unit, so pod sources can use NSThread /
111
+ // dispatch / UIKit symbols without an explicit import. SPM has no prefix-header
112
+ // mechanism, so we emit this file at the dep root and `-include` it on the
113
+ // target (cSettings + cxxSettings) to reproduce that ambient import. The
114
+ // `__OBJC__` guard makes it inert for plain C/C++ sources, and UIKit is
115
+ // `__has_include`-guarded for platforms that lack it.
116
+ // The config-gated C++ defines the prebuilt React.framework is built with (see
117
+ // packages/react-native/Package.swift). Fabric C++ in autolinked deps must
118
+ // compile with the SAME NDEBUG state or its DebugStringConvertible / ShadowNode
119
+ // ABI diverges from the Release React.framework and the link fails.
120
+ const REACT_CXX_CONFIG_DEFINES = [
121
+ '.define("DEBUG", .when(configuration: .debug))',
122
+ '.define("NDEBUG", .when(configuration: .release))',
123
+ ];
124
+
125
+ const SCAFFOLD_PREFIX_HEADER = 'react-native-spm-prefix.h';
126
+ const SCAFFOLD_PREFIX_HEADER_CONTENTS = `// AUTO-SCAFFOLDED by react-native spm scaffold — mirrors CocoaPods' default
127
+ // prefix header so ObjC sources that rely on an implicit Foundation/UIKit
128
+ // import compile under SPM (which has no prefix-header mechanism). Safe to
129
+ // delete + regenerate via \`npx react-native spm scaffold\`.
130
+ #ifdef __OBJC__
131
+ #import <Foundation/Foundation.h>
132
+ #if __has_include(<UIKit/UIKit.h>)
133
+ #import <UIKit/UIKit.h>
134
+ #endif
135
+ #endif
136
+ `;
137
+
138
+ // Names of deps the scaffolder always refuses to touch — `react-native`
139
+ // itself is handled by the xcframework subpackage, never as an autolinked
140
+ // target.
141
+ const NEVER_SCAFFOLD /*: ReadonlySet<string> */ = new Set(['react-native']);
142
+
143
+ // React-core / React-Fabric / etc. dependency names collapse to a single
144
+ // invariant React header-product set. The app target links the prebuilt
145
+ // runtime frameworks outside SwiftPM. This
146
+ // list matches what `install_modules_dependencies(s)` materializes plus
147
+ // common podspec hand-rolled additions.
148
+ const REACT_CORE_DEP_PREFIXES = [
149
+ 'React-',
150
+ 'React_',
151
+ 'ReactCommon',
152
+ 'RCT-Folly',
153
+ 'RCT',
154
+ 'glog',
155
+ 'boost',
156
+ 'fmt',
157
+ 'DoubleConversion',
158
+ 'Yoga',
159
+ 'hermes-engine',
160
+ ];
161
+
162
+ function isReactCoreDep(name /*: string */) /*: boolean */ {
163
+ return REACT_CORE_DEP_PREFIXES.some(p => name.startsWith(p));
164
+ }
165
+
166
+ // True when the dep ships a `codegenConfig` in package.json — RN's standard
167
+ // marker that the library participates in the New Architecture / codegen. Such
168
+ // a lib's Fabric sources include the app-generated component headers
169
+ // (`<react/renderer/components/<name>/ShadowNodes.h>` etc.), which are vended by
170
+ // the per-app React-GeneratedCode package — so it implicitly depends on React
171
+ // core even when its podspec only wires that via `install_modules_dependencies`
172
+ // (which we strip). Safe/quiet: a missing or unparseable package.json → false.
173
+ function depHasCodegenConfig(depRoot /*: string */) /*: boolean */ {
174
+ try {
175
+ const pkg = JSON.parse(
176
+ fs.readFileSync(path.join(depRoot, 'package.json'), 'utf8'),
177
+ );
178
+ return pkg != null && pkg.codegenConfig != null;
179
+ } catch {
180
+ return false;
181
+ }
182
+ }
183
+
184
+ // Every subdirectory (relative to depRoot) under depRoot/base, recursively —
185
+ // used to expand a CocoaPods `path/**` recursive header search path into the
186
+ // concrete dirs SPM needs (SPM has no recursive search-path syntax). Skips
187
+ // VCS / build / dependency noise.
188
+ function collectSubdirs(
189
+ depRoot /*: string */,
190
+ base /*: string */,
191
+ ) /*: Array<string> */ {
192
+ const SKIP /*: Set<string> */ = new Set([
193
+ 'node_modules',
194
+ 'Pods',
195
+ 'build',
196
+ '.git',
197
+ ]);
198
+ const out /*: Array<string> */ = [];
199
+ const walk = (absDir /*: string */, relDir /*: string */) => {
200
+ let entries /*: Array<{name: string, isDirectory(): boolean}> */ = [];
201
+ try {
202
+ // $FlowFixMe[incompatible-type] Dirent typing
203
+ entries = fs.readdirSync(absDir, {withFileTypes: true});
204
+ } catch {
205
+ return;
206
+ }
207
+ for (const e of entries) {
208
+ // $FlowFixMe[incompatible-type] Dirent.name is string|Buffer in stubs
209
+ const name /*: string */ = e.name;
210
+ if (!e.isDirectory() || name.startsWith('.') || SKIP.has(name)) continue;
211
+ const rel = relDir === '.' ? name : `${relDir}/${name}`;
212
+ out.push(rel);
213
+ walk(path.join(absDir, name), rel);
214
+ }
215
+ };
216
+ walk(path.join(depRoot, base), base === '.' ? '.' : base);
217
+ return out;
218
+ }
219
+
220
+ // ---------------------------------------------------------------------------
221
+ // Translation
222
+ // ---------------------------------------------------------------------------
223
+
224
+ /**
225
+ * Pure: turns a flattened PodspecModel into an SpmScaffoldSpec the emitter
226
+ * can consume. Substitutes Xcode build-setting tokens (`$(PODS_TARGET_SRCROOT)`)
227
+ * against the dep root, buckets dependencies, drops unknown tokens with a
228
+ * warning.
229
+ */
230
+ function translatePodspecToSpmTarget(
231
+ model /*: PodspecModel */,
232
+ dep /*: AutolinkedDep */,
233
+ // Maps a podspec name (e.g. "RNWorklets") to the npm package name of an
234
+ // autolinked sibling (e.g. "react-native-worklets"). Lets us wire a
235
+ // `s.dependency "RNWorklets"` — a pod-style name the `react-native-*`
236
+ // heuristic can't recognize — to the right sibling package. Empty by default.
237
+ podToNpm /*: Map<string, string> */ = new Map(),
238
+ ) /*: SpmScaffoldSpec */ {
239
+ const warnings = [...model.warnings];
240
+
241
+ // Swift target name: ALWAYS toSwiftName(npm-name). The autolinker
242
+ // registers each autolinked dep under that name in its aggregator (and in
243
+ // any sibling spm.dependencies refs), so the scaffolded Package.swift's
244
+ // product/library name must match — otherwise SPM resolution fails with
245
+ // a name mismatch on `.product(name: "X", package: "X")`.
246
+ //
247
+ // The podspec's `header_dir` is captured separately: when it changes the
248
+ // include surface (e.g. `<reanimated/...>` instead of `<ReactNativeReanimated/...>`),
249
+ // header resolution already works via the -I flags from headerSearchPaths
250
+ // (path-style includes like safe-area-context's
251
+ // `<react/renderer/components/safeareacontext/...>` resolve through
252
+ // `-I common/cpp/`). Module-style includes that NEED the target name to
253
+ // match (e.g. reanimated's `<reanimated/X.h>` via SwiftPM's auto-generated
254
+ // module map) require an explicit `spm.name` override in
255
+ // react-native.config.js — handled by the existing autolinker flow, not
256
+ // here.
257
+ const swiftName = toSwiftName(dep.name);
258
+
259
+ // Header search paths — substitute Xcode build-setting tokens against the
260
+ // dep root. Anything we can't substitute is dropped + warned (avoids
261
+ // emitting `$(SOMETHING)` literally into the Swift file).
262
+ const headerSearchPaths /*: Array<string> */ = [];
263
+ const addSearchPath = (p /*: string */) => {
264
+ if (p.length > 0 && !headerSearchPaths.includes(p)) {
265
+ headerSearchPaths.push(p);
266
+ }
267
+ };
268
+ for (const raw of model.headerSearchPaths) {
269
+ let substituted = raw
270
+ .replace(/\$\(PODS_TARGET_SRCROOT\)/g, '.')
271
+ .replace(/\$\{PODS_TARGET_SRCROOT\}/g, '.');
272
+ if (/\$[({]/.test(substituted)) {
273
+ warnings.push(
274
+ `Dropped HEADER_SEARCH_PATHS entry "${raw}" — contains unresolved Xcode token. ` +
275
+ `Add it manually if needed.`,
276
+ );
277
+ continue;
278
+ }
279
+ // CocoaPods `path/**` (or `/*`) = recursive search. SPM has no recursive
280
+ // search-path syntax, so add the base dir + every subdirectory under it.
281
+ const recursive = /\/\*\*?$/.test(substituted);
282
+ substituted = substituted
283
+ .replace(/\/\*\*?$/, '') // strip the glob marker
284
+ .replace(/\/{2,}/g, '/'); // collapse `cpp//` → `cpp/`
285
+ // Strip leading "./" (emitter prefixes with the target path) + trailing "/".
286
+ const base = substituted
287
+ .replace(/^\.\//, '')
288
+ .replace(/^\//, '')
289
+ .replace(/\/$/, '');
290
+ addSearchPath(base === '' ? '.' : base);
291
+ if (recursive) {
292
+ for (const sub of collectSubdirs(dep.root, base === '' ? '.' : base)) {
293
+ addSearchPath(sub);
294
+ }
295
+ }
296
+ }
297
+
298
+ // header_mappings_dir → search path. CocoaPods exposes a subspec's headers
299
+ // under `<basename(mappings_dir)>/...` by copying them into Pods/Headers
300
+ // preserving structure relative to the mappings dir. SPM has no such copy
301
+ // step, so namespaced includes like `<reanimated/apple/sensor/X.h>` (header
302
+ // physically at `apple/reanimated/apple/sensor/X.h`, mappings dir
303
+ // `apple/reanimated`) only resolve if the mappings dir's PARENT (`apple`) is
304
+ // on the search path. Add dirname() of every subspec's mappings dir.
305
+ for (const mappingsDir of model.headerMappingsDirs) {
306
+ const parent = path.posix.dirname(mappingsDir.replace(/^\.\//, ''));
307
+ // dirname of a single-segment dir is "." (root) — already implicitly
308
+ // searched; skip it and anything that doesn't exist on disk.
309
+ if (
310
+ parent.length > 0 &&
311
+ parent !== '.' &&
312
+ !headerSearchPaths.includes(parent) &&
313
+ fs.existsSync(path.join(dep.root, parent))
314
+ ) {
315
+ headerSearchPaths.push(parent);
316
+ }
317
+ }
318
+
319
+ // Bucket dependencies. React-Core / React-jsi / RCT-Folly / glog etc. ALL
320
+ // collapse to the invariant React header products
321
+ // reference because they're bundled in the prebuilt React.xcframework.
322
+ // Sibling RN libs (autolinked or self-managed deps) flow through the
323
+ // existing spm-deps mechanism. Unknown names are dropped with a warning.
324
+ let coreReactNative = false;
325
+ const siblingNames /*: Array<string> */ = [];
326
+ const selfPodspecName = model.name;
327
+ for (const depName of model.dependencies) {
328
+ // Cross-subspec refs like "react-native-safe-area-context/common" are a
329
+ // CocoaPods construct for one subspec depending on another from the
330
+ // SAME podspec. After flattenSubspecs has merged everything into one
331
+ // target the subspec ref is meaningless — drop silently.
332
+ if (depName.includes('/') && depName.startsWith(`${selfPodspecName}/`)) {
333
+ continue;
334
+ }
335
+ const podSibling = podToNpm.get(depName.split('/')[0]);
336
+ if (isReactCoreDep(depName)) {
337
+ coreReactNative = true;
338
+ } else if (depName.startsWith('react-native-')) {
339
+ // Generic cross-subspec ref guard for any "package/subspec" form.
340
+ const baseName = depName.split('/')[0];
341
+ if (!siblingNames.includes(baseName)) {
342
+ siblingNames.push(baseName);
343
+ }
344
+ } else if (podSibling != null && podSibling !== dep.name) {
345
+ // A pod-style dependency name (e.g. reanimated's `s.dependency
346
+ // "RNWorklets"`) that resolves to an autolinked sibling's npm package
347
+ // (react-native-worklets). Wire it as a sibling .package/.product so
348
+ // the dep's cross-package includes (`<worklets/...>`) resolve.
349
+ if (!siblingNames.includes(podSibling)) {
350
+ siblingNames.push(podSibling);
351
+ }
352
+ } else {
353
+ // Could be a non-RN dep ("MMKV", "AFNetworking"). The scaffolder
354
+ // doesn't know how to wire those — surface a warning so user can
355
+ // edit the generated Package.swift.
356
+ warnings.push(
357
+ `Unknown dependency "${depName}" — not wired into the scaffolded Package.swift. Edit manually if needed.`,
358
+ );
359
+ }
360
+ }
361
+
362
+ // New-Architecture libraries declare their React-core dependency via the
363
+ // `install_modules_dependencies(s)` podspec helper (which auto-adds
364
+ // React-Core / React-RCTFabric / React-Codegen), NOT an explicit
365
+ // `s.dependency "React-Core"`. We strip that helper when evaluating the
366
+ // podspec, so the React-core dependency never surfaces in model.dependencies
367
+ // and `coreReactNative` would stay false. The authoritative, RN-standard
368
+ // marker for "this lib participates in the New Architecture / codegen" is a
369
+ // `codegenConfig` block in package.json — when present, the app's codegen has
370
+ // generated `react/renderer/components/<name>/{ShadowNodes,Props,…}.h` that
371
+ // the lib's Fabric sources include via angle brackets. Those generated
372
+ // headers live in the per-app React-GeneratedCode package, so the lib must
373
+ // depend on it (and, transitively, on React core). Treat codegenConfig as
374
+ // an implicit React-core dependency.
375
+ // `codegenConfig` only marks Fabric/New-Arch libraries. A plain ObjC module
376
+ // (e.g. rn-tester's TestLibrary*) that wires React core solely through
377
+ // `install_modules_dependencies(s)` has no codegenConfig — but the helper's
378
+ // presence is itself an authoritative "depends on React core" signal, so
379
+ // treat it the same way.
380
+ if (
381
+ !coreReactNative &&
382
+ (depHasCodegenConfig(dep.root) ||
383
+ model.usesInstallModulesDependencies === true)
384
+ ) {
385
+ coreReactNative = true;
386
+ }
387
+
388
+ // SPM's `sources:` field does NOT accept CocoaPods-style globs — it wants
389
+ // a list of explicit file paths (relative to the target's `path:`).
390
+ // Expand the podspec globs against the actual filesystem so the emitted
391
+ // Package.swift parses cleanly.
392
+ let expandedSources /*: Array<string> */ = [];
393
+ try {
394
+ expandedSources = expandSpmSourceGlobs(dep.root, model.sourceFiles);
395
+ } catch (e) {
396
+ warnings.push(
397
+ `Source glob expansion failed (${e.message}); emitting raw globs — SPM will likely reject them.`,
398
+ );
399
+ expandedSources = model.sourceFiles;
400
+ }
401
+ // Strip files matching exclude_files (podspec's negation list).
402
+ if (model.excludeFiles.length > 0) {
403
+ try {
404
+ // $FlowFixMe[untyped-import] micromatch has no types
405
+ const micromatch = require('micromatch');
406
+ const isExcluded = micromatch.matcher(model.excludeFiles);
407
+ expandedSources = expandedSources.filter(f => !isExcluded(f));
408
+ } catch (e) {
409
+ warnings.push(
410
+ `exclude_files filtering failed (${e.message}); keeping all sources.`,
411
+ );
412
+ }
413
+ }
414
+ // Never self-ingest scaffold artifacts: a re-scaffold runs with the
415
+ // previous run's output on disk, and root-level podspec globs sweep it
416
+ // into sources — `*.{h,...,swift}` matches Package.swift itself, whose
417
+ // `.swift` extension then trips the mixed-language gate into DELETING the
418
+ // manifest it just wrote (alternating scaffold/self-destruct runs); the
419
+ // prefix header and the include/ shim mirror would similarly feed back.
420
+ expandedSources = expandedSources.filter(
421
+ f =>
422
+ f !== SCAFFOLD_PREFIX_HEADER &&
423
+ f !== 'Package.swift' &&
424
+ !f.startsWith('include/'),
425
+ );
426
+
427
+ // Header-map emulation: CocoaPods builds a header map (USE_HEADERMAP=YES by
428
+ // default) so a source can `#import "Foo.h"` by bare name regardless of which
429
+ // subdirectory Foo.h lives in. SPM has no header map, so add every directory
430
+ // that contains a header to the search path. Covers libs (e.g. svg) that
431
+ // spread flat-named headers across many subdirs.
432
+ const headerFiles = expandedSources.filter(f => /\.(h|hh|hpp)$/i.test(f));
433
+ try {
434
+ for (const f of expandSpmSourceGlobs(dep.root, model.publicHeaderFiles)) {
435
+ if (/\.(h|hh|hpp)$/i.test(f)) headerFiles.push(f);
436
+ }
437
+ } catch {
438
+ // public_header_files globbing is best-effort — source_files usually
439
+ // already covers the headers.
440
+ }
441
+ for (const f of headerFiles) {
442
+ const d = path.posix.dirname(f);
443
+ addSearchPath(d === '' ? '.' : d);
444
+ }
445
+
446
+ // ObjC(++) sources may rely on CocoaPods' implicit prefix-header import of
447
+ // Foundation/UIKit. When present, emit + `-include` a prefix header (below).
448
+ // The prefix is `-include`d by bare name, so the dep root (".") must be on
449
+ // the header search path for clang to find it.
450
+ const needsObjCPrefix = expandedSources.some(f => /\.mm?$/.test(f));
451
+ if (needsObjCPrefix && !headerSearchPaths.includes('.')) {
452
+ headerSearchPaths.push('.');
453
+ }
454
+
455
+ // SPM REQUIRES publicHeadersPath to be a real directory inside the target
456
+ // when the target compiles C-family sources (default is "include" which
457
+ // typically doesn't exist in a podspec-shaped dep). Pick the first
458
+ // existing prefix dir from public_header_files / source_files. The
459
+ // chosen dir doesn't need to be the include surface — path-style
460
+ // includes (`<react/renderer/.../X.h>`) resolve via headerSearchPaths
461
+ // instead. publicHeadersPath just has to point at a real dir containing
462
+ // some .h files so SPM accepts the target definition.
463
+ let publicHeadersPath /*: ?string */ = null;
464
+ // Prefer the namespace root (parent of a header_mappings_dir). SPM propagates
465
+ // a target's publicHeadersPath to DEPENDENT packages as a search path, so
466
+ // setting it to e.g. `Common/cpp` (parent of `Common/cpp/worklets`) is what
467
+ // lets a sibling package resolve `<worklets/...>`. Prefer a cross-platform
468
+ // (Common) dir — that holds the C++ API siblings consume — over a
469
+ // platform-specific (apple/) one.
470
+ const mappingsParents = model.headerMappingsDirs
471
+ .map(d => path.posix.dirname(d.replace(/^\.\//, '')))
472
+ .filter(
473
+ p => p.length > 0 && p !== '.' && fs.existsSync(path.join(dep.root, p)),
474
+ );
475
+ if (mappingsParents.length > 0) {
476
+ publicHeadersPath =
477
+ mappingsParents.find(p => /(?:^|\/)common(?:\/|$)/i.test(p)) ??
478
+ mappingsParents[0];
479
+ }
480
+ if (publicHeadersPath == null) {
481
+ for (const glob of [...model.publicHeaderFiles, ...model.sourceFiles]) {
482
+ const prefix = glob.split('/')[0];
483
+ if (
484
+ prefix.length > 0 &&
485
+ !prefix.includes('*') &&
486
+ fs.existsSync(path.join(dep.root, prefix))
487
+ ) {
488
+ publicHeadersPath = prefix;
489
+ break;
490
+ }
491
+ }
492
+ }
493
+ let namespacedShimHeaders /*: Array<string> */ = [];
494
+ if (publicHeadersPath == null) {
495
+ // Root-level podspecs (`s.source_files = "*.{h,m,mm}"`) keep their
496
+ // headers in the package root. CocoaPods exposes them to dependents as
497
+ // `#import <PodName/Header.h>` via header maps; SPM has no equivalent, so
498
+ // the scaffold writer mirrors them into a generated include/<SwiftName>/
499
+ // shim dir and publicHeadersPath points there (also fixing SPM's
500
+ // rejection over the nonexistent default `include/`).
501
+ const rootHeaders = expandedSources.filter(
502
+ f => f.endsWith('.h') && !f.includes('/'),
503
+ );
504
+ if (rootHeaders.length > 0) {
505
+ namespacedShimHeaders = rootHeaders;
506
+ publicHeadersPath = 'include';
507
+ }
508
+ }
509
+ if (publicHeadersPath == null) {
510
+ warnings.push(
511
+ `Could not infer publicHeadersPath from source globs. SPM may reject the target — add a publicHeadersPath manually to the scaffolded Package.swift.`,
512
+ );
513
+ }
514
+
515
+ return {
516
+ swiftName,
517
+ sources: expandedSources,
518
+ headerSearchPaths,
519
+ preprocessorDefines: model.preprocessorDefines,
520
+ needsObjCPrefix,
521
+ coreReactNative,
522
+ siblingNames,
523
+ extraFrameworks: model.frameworks,
524
+ weakFrameworks: model.weakFrameworks,
525
+ compilerFlags: model.compilerFlags,
526
+ publicHeadersPath,
527
+ namespacedShimHeaders,
528
+ resources: model.resources,
529
+ warnings,
530
+ };
531
+ }
532
+
533
+ // ---------------------------------------------------------------------------
534
+ // Swift emission
535
+ // ---------------------------------------------------------------------------
536
+
537
+ /*::
538
+ type EmitContext = {
539
+ // Identifier embedded as a comment so SPM's manifest hash bumps when the
540
+ // active xcframework slot changes (otherwise cached evaluations would
541
+ // keep pointing at the prior slot's headers).
542
+ cacheSlotLabel: ?string,
543
+ // Remote SPM package mode (url/version/identity) — see remotePackageConfig.
544
+ remote?: ?{url: string, version: string, identity: string},
545
+ // Relative path (posix, from the dep's package dir) to the app's codegen
546
+ // package (<appRoot>/build/generated/ios). Computed at scaffold time —
547
+ // safe because the file is re-scaffolded per app/cache slot, and any
548
+ // node_modules relayout implies a reinstall that drops the file anyway.
549
+ codegenPackageDir?: ?string,
550
+ // Relative path to the app's local xcframeworks package
551
+ // (<appRoot>/build/xcframeworks). Only referenced when remote == null.
552
+ localXcfwPackageDir?: ?string,
553
+ };
554
+ */
555
+
556
+ /**
557
+ * Renders the SpmScaffoldSpec to a complete Package.swift string suitable
558
+ * for writing into `node_modules/<dep>/`. Fully declarative: all package
559
+ * references are plain relative paths computed at scaffold time (no runtime
560
+ * discovery — the scaffolder knows both the dep dir and the app root, and
561
+ * re-scaffolds whenever either could have moved).
562
+ */
563
+ function emitScaffoldedPackageSwift(
564
+ spec /*: SpmScaffoldSpec */,
565
+ ctx /*:: ?: EmitContext */ = {cacheSlotLabel: null, remote: null},
566
+ ) /*: string */ {
567
+ const slotComment =
568
+ ctx.cacheSlotLabel != null ? `\n// Cache slot: ${ctx.cacheSlotLabel}` : '';
569
+
570
+ // React headers need NO search paths — they come from the React /
571
+ // ReactNativeHeaders binaryTargets and the ReactAppHeaders product (see
572
+ // the dependencies block below). Per-dep HEADER_SEARCH_PATHS from the
573
+ // podspec are emitted as `.headerSearchPath("<rel>")` so they resolve
574
+ // relative to `path:` ("." below). Custom podspec compiler flags keep
575
+ // using unsafeFlags (rare; surfaced verbatim).
576
+ const customFlagsCxx = spec.compilerFlags.map(f => `"${f}"`);
577
+
578
+ const headerSearchPathDirectives = spec.headerSearchPaths
579
+ .map(p => `.headerSearchPath("${p}")`)
580
+ .join(', ');
581
+
582
+ // Preprocessor defines → `.define("NAME", to: "VALUE", .when(...))`. The
583
+ // value is escaped as a Swift string literal because it may itself contain
584
+ // quotes (e.g. a string-literal macro `-DFOO="[A:false]"`).
585
+ const swiftStr = (s /*: string */) =>
586
+ `"${s.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
587
+ const defineDirectives = (spec.preprocessorDefines ?? [])
588
+ .map(d => {
589
+ const toPart = d.value != null ? `, to: ${swiftStr(d.value)}` : '';
590
+ const condPart =
591
+ d.config === 'debug'
592
+ ? ', .when(configuration: .debug)'
593
+ : d.config === 'release'
594
+ ? ', .when(configuration: .release)'
595
+ : '';
596
+ return `.define(${swiftStr(d.name)}${toPart}${condPart})`;
597
+ })
598
+ .join(', ');
599
+
600
+ const settingsEntries = (extra /*: Array<string> */) => {
601
+ const parts = [
602
+ defineDirectives,
603
+ headerSearchPathDirectives,
604
+ ...extra,
605
+ ].filter(e => e.length > 0);
606
+ return `[${parts.join(', ')}]`;
607
+ };
608
+ // Force-include the ambient-import prefix header on ObjC(++) sources (the
609
+ // `__OBJC__` guard makes it a no-op for plain C/C++). `-include` resolves the
610
+ // bare name via the dep-root header search path (".", ensured in translate).
611
+ const prefixFlag = spec.needsObjCPrefix
612
+ ? `.unsafeFlags(["-include", "${SCAFFOLD_PREFIX_HEADER}"])`
613
+ : '';
614
+ const cSettings = settingsEntries([prefixFlag].filter(e => e.length > 0));
615
+ const cxxSettings = settingsEntries(
616
+ [
617
+ prefixFlag,
618
+ ...(customFlagsCxx.length > 0
619
+ ? [`.unsafeFlags([${customFlagsCxx.join(', ')}])`]
620
+ : []),
621
+ // Match the prebuilt React.framework's config-gated C++ ABI. NDEBUG in
622
+ // Release strips DebugStringConvertible's vtable (and shifts the
623
+ // ShadowNode layout that inherits it), so a Fabric C++ target compiled
624
+ // WITHOUT NDEBUG fails to link against a Release React.framework. Mirrors
625
+ // packages/react-native/Package.swift's own C++ targets.
626
+ ...REACT_CXX_CONFIG_DEFINES,
627
+ ].filter(e => e.length > 0),
628
+ );
629
+
630
+ // Linker frameworks: defaults + podspec-declared extras + weak frameworks.
631
+ // Dedup on render so the user doesn't see duplicate UIKit lines.
632
+ const defaults = ['UIKit', 'Foundation', 'CoreGraphics'];
633
+ const linkedFrameworks = Array.from(
634
+ new Set([...defaults, ...spec.extraFrameworks]),
635
+ );
636
+ const linkerEntries = [
637
+ ...linkedFrameworks.map(f => `.linkedFramework("${f}")`),
638
+ ...spec.weakFrameworks.map(
639
+ f => `.linkedFramework("${f}", .when(platforms: [.iOS]))`,
640
+ ),
641
+ ];
642
+
643
+ // Dependencies block. Always declares ReactNative if any React-core dep
644
+ // was in the podspec; sibling RN deps come from autolinking's existing
645
+ // .package(path: ...) graph — we reference them by toSwiftName(npmName)
646
+ // since that's what the autolinker registers them under.
647
+ const packageDeps /*: Array<string> */ = [];
648
+ const targetDeps /*: Array<string> */ = [];
649
+ if (spec.coreReactNative) {
650
+ // Remote mode: React Native comes from the remote package identity (no
651
+ // app-layout knowledge). The per-app codegen package is generated INTO
652
+ // the app by definition, so it stays a path reference — relative,
653
+ // computed at scaffold time.
654
+ const remote = ctx.remote;
655
+ const rnLabel = remote != null ? remote.identity : 'ReactNative';
656
+ const codegenDir = ctx.codegenPackageDir;
657
+ if (codegenDir == null) {
658
+ throw new Error(
659
+ 'emitScaffoldedPackageSwift: codegenPackageDir is required when the dep depends on React core.',
660
+ );
661
+ }
662
+ if (remote != null) {
663
+ packageDeps.push(
664
+ `.package(url: "${remote.url}", exact: "${remote.version}")`,
665
+ );
666
+ } else {
667
+ const xcfwDir = ctx.localXcfwPackageDir;
668
+ if (xcfwDir == null) {
669
+ throw new Error(
670
+ 'emitScaffoldedPackageSwift: localXcfwPackageDir is required when no remote package is configured.',
671
+ );
672
+ }
673
+ packageDeps.push(`.package(name: "ReactNative", path: "${xcfwDir}")`);
674
+ }
675
+ packageDeps.push(
676
+ `.package(name: "React-GeneratedCode", path: "${codegenDir}")`,
677
+ );
678
+ targetDeps.push(`.product(name: "ReactHeaders", package: "${rnLabel}")`);
679
+ targetDeps.push(
680
+ `.product(name: "ReactNativeHeaders", package: "${rnLabel}")`,
681
+ );
682
+ targetDeps.push(
683
+ `.product(name: "ReactNativeDependenciesHeaders", package: "${rnLabel}")`,
684
+ );
685
+ targetDeps.push(
686
+ '.product(name: "ReactAppHeaders", package: "React-GeneratedCode")',
687
+ );
688
+ }
689
+ for (const siblingName of spec.siblingNames) {
690
+ const swiftSibling = toSwiftName(siblingName);
691
+ // The autolinker references each self-managed (scaffolded) dep through a
692
+ // `libs/<SwiftName>` symlink, and SPM resolves a manifest's relative
693
+ // package paths against that symlink location — so a sibling lives at
694
+ // `../<SwiftName>` (NOT `../<npm-name>`, which would be `libs/<npm-name>`
695
+ // and not exist).
696
+ packageDeps.push(
697
+ `.package(name: "${swiftSibling}", path: "../${swiftSibling}")`,
698
+ );
699
+ targetDeps.push(
700
+ `.product(name: "${swiftSibling}", package: "${swiftSibling}")`,
701
+ );
702
+ }
703
+
704
+ // sources: emit only when the podspec declared them. If empty (regex-fallback
705
+ // podspec), no `sources:`/`exclude:` is emitted and SPM auto-scans the target
706
+ // dir — which for `path: "."` is the entire dep root. That is a known
707
+ // limitation of the regex-fallback path (the pod-ipc parse yields explicit
708
+ // sources); a future improvement could emit an `exclude:` list for the dep's
709
+ // example/test/build dirs.
710
+ const sourcesLine =
711
+ spec.sources.length > 0
712
+ ? `\n sources: [\n${spec.sources.map(s => ` "${s}",`).join('\n')}\n ],`
713
+ : '';
714
+
715
+ const publicHeadersLine =
716
+ spec.publicHeadersPath != null
717
+ ? `\n publicHeadersPath: "${spec.publicHeadersPath}",`
718
+ : '';
719
+
720
+ const resourcesLine =
721
+ spec.resources.length > 0
722
+ ? `\n resources: [${spec.resources.map(r => `.copy("${r}")`).join(', ')}],`
723
+ : '';
724
+
725
+ const packageDepsBlock =
726
+ packageDeps.length > 0
727
+ ? ` dependencies: [\n ${packageDeps.join(',\n ')},\n ],\n`
728
+ : '';
729
+
730
+ const targetDepsLine =
731
+ targetDeps.length > 0
732
+ ? `\n dependencies: [${targetDeps.join(', ')}],`
733
+ : '';
734
+
735
+ return `// swift-tools-version: 6.0
736
+ ${SCAFFOLDER_MARKER}
737
+ // AUTO-SCAFFOLDED-VERSION: ${SCAFFOLDER_VERSION}${slotComment}
738
+ // Edit the contents below if needed and re-run \`npx patch-package <dep-name>\`
739
+ // to persist across \`npm install\`. To regenerate from the podspec, remove
740
+ // this file (or just this marker) and re-run \`npx react-native spm scaffold\`.
741
+ //
742
+ // Package references are plain relative paths, computed when this file was
743
+ // scaffolded. They stay correct because the file is re-scaffolded per app
744
+ // and cache slot, and any node_modules relayout reinstalls this package
745
+ // (dropping the file) anyway.
746
+
747
+ import PackageDescription
748
+
749
+ let package = Package(
750
+ name: "${spec.swiftName}",
751
+ platforms: [.iOS(.v15)],
752
+ products: [
753
+ .library(name: "${spec.swiftName}", targets: ["${spec.swiftName}"]),
754
+ ],
755
+ ${packageDepsBlock} targets: [
756
+ .target(
757
+ name: "${spec.swiftName}",${targetDepsLine}
758
+ path: ".",${sourcesLine}${publicHeadersLine}${resourcesLine}
759
+ cSettings: ${cSettings},
760
+ cxxSettings: ${cxxSettings},
761
+ linkerSettings: [${linkerEntries.join(', ')}]
762
+ ),
763
+ ],
764
+ cxxLanguageStandard: .cxx20
765
+ )
766
+ `;
767
+ }
768
+
769
+ // ---------------------------------------------------------------------------
770
+ // Per-dep orchestrator
771
+ // ---------------------------------------------------------------------------
772
+
773
+ /*::
774
+ type ScaffoldContext = {
775
+ appRoot: string,
776
+ projectRoot: string,
777
+ reactNativeRoot: string,
778
+ // Forces overwrite of files carrying the scaffolder marker. Files
779
+ // WITHOUT the marker (user-edited, upstream-shipped) are never touched.
780
+ force: boolean,
781
+ // When true, no file is written — caller gets the would-be content and
782
+ // can preview.
783
+ dryRun: boolean,
784
+ // Slot label (e.g. "0.87.0-nightly-20260513-6e262624f/debug") embedded as
785
+ // a comment so SPM's manifest hash bumps on slot changes.
786
+ cacheSlotLabel: ?string,
787
+ // podspec-name → npm-name index over all autolinked deps, so pod-style
788
+ // `s.dependency` names (e.g. "RNWorklets") wire to the right sibling.
789
+ podToNpm?: Map<string, string>,
790
+ };
791
+ */
792
+
793
+ /**
794
+ * Decides whether to scaffold one dep, runs the translation + emission,
795
+ * writes the file (unless dryRun). Pure path/skip logic — all I/O via fs.
796
+ */
797
+ function scaffoldPackageSwiftForDep(
798
+ dep /*: AutolinkedDep */,
799
+ ctx /*: ScaffoldContext */,
800
+ ) /*: ScaffoldResult */ {
801
+ const depName = dep.name;
802
+
803
+ if (NEVER_SCAFFOLD.has(depName)) {
804
+ return {
805
+ depName,
806
+ status: 'skipped-is-react-native',
807
+ reason: 'react-native itself is handled by the xcframework package.',
808
+ };
809
+ }
810
+
811
+ // ios platform missing → no native code to wrap.
812
+ if (dep.platforms.ios == null) {
813
+ return {
814
+ depName,
815
+ status: 'skipped-no-ios',
816
+ reason: 'autolinking.json has no ios platform entry.',
817
+ };
818
+ }
819
+
820
+ // Dep can opt out via its own react-native.config.js.
821
+ const cfg = defaultReadConfig(dep.root);
822
+ // $FlowFixMe[prop-missing] config has dynamic shape
823
+ if (cfg != null && cfg.spm != null && cfg.spm.scaffold === false) {
824
+ return {
825
+ depName,
826
+ status: 'skipped-opt-out',
827
+ reason: 'react-native.config.js sets spm.scaffold = false.',
828
+ };
829
+ }
830
+
831
+ const pkgSwiftPath = path.join(dep.root, 'Package.swift');
832
+
833
+ // A self-managed Package.swift may live either at the dep root (legacy
834
+ // convention) or inside ios/ (preferred for community RN libs that want
835
+ // their npm-package root free of SPM artifacts). If a nested manifest
836
+ // exists and is user-authored, skip — writing a stray root manifest would
837
+ // cause the autolinker to prefer the wrong file.
838
+ const nestedPkgSwiftPath = path.join(dep.root, 'ios', 'Package.swift');
839
+ if (!fs.existsSync(pkgSwiftPath) && fs.existsSync(nestedPkgSwiftPath)) {
840
+ const nested = fs.readFileSync(nestedPkgSwiftPath, 'utf8');
841
+ if (
842
+ !nested.includes(AUTOGEN_MARKER) &&
843
+ !nested.includes(SCAFFOLDER_MARKER)
844
+ ) {
845
+ return {
846
+ depName,
847
+ status: 'skipped-self-managed',
848
+ reason:
849
+ 'Existing ios/Package.swift was not produced by this scaffolder. ' +
850
+ 'Leaving it alone.',
851
+ };
852
+ }
853
+ }
854
+
855
+ // Skip rules around existing files.
856
+ if (fs.existsSync(pkgSwiftPath)) {
857
+ const existing = fs.readFileSync(pkgSwiftPath, 'utf8');
858
+ if (existing.includes(AUTOGEN_MARKER)) {
859
+ return {
860
+ depName,
861
+ status: 'skipped-autogen',
862
+ reason:
863
+ 'Existing Package.swift carries the autolinker AUTOGEN marker. ' +
864
+ 'spm update will regenerate the synth wrapper.',
865
+ };
866
+ }
867
+ if (existing.includes(SCAFFOLDER_MARKER)) {
868
+ // Version bump → unconditional regen. A bumped SCAFFOLDER_VERSION
869
+ // implies the emitter's output format changed in a way that requires
870
+ // regenerating existing files; --force is not needed here.
871
+ const vMatch = existing.match(SCAFFOLDER_VERSION_LINE_RE);
872
+ const existingVersion = vMatch != null ? parseInt(vMatch[1], 10) : 1;
873
+ const versionStale = existingVersion < SCAFFOLDER_VERSION;
874
+ if (!ctx.force && !versionStale) {
875
+ // Slot label change is the other auto-regen trigger — bumps SPM's
876
+ // manifest hash so the cache-slot path gets re-resolved.
877
+ const m = existing.match(/^\/\/ Cache slot: (.+)$/m);
878
+ const existingSlot = m != null ? m[1] : null;
879
+ if (ctx.cacheSlotLabel == null || existingSlot === ctx.cacheSlotLabel) {
880
+ return {
881
+ depName,
882
+ status: 'skipped-scaffolder-marker',
883
+ reason:
884
+ 'Already scaffolded for this cache slot. Pass --force to regenerate.',
885
+ };
886
+ }
887
+ }
888
+ if (versionStale) {
889
+ log(
890
+ `Re-scaffolding ${depName} (format v${existingVersion} → v${SCAFFOLDER_VERSION})`,
891
+ );
892
+ }
893
+ // Fall through: regenerate (force, slot changed, or version bumped).
894
+ } else {
895
+ // No marker at all → user-managed or upstream-shipped. Never touch.
896
+ return {
897
+ depName,
898
+ status: 'skipped-self-managed',
899
+ reason:
900
+ 'Existing Package.swift was not produced by this scaffolder. ' +
901
+ 'Leaving it alone.',
902
+ };
903
+ }
904
+ }
905
+
906
+ // Find a podspec to read. autolinking.json may have provided podspecPath;
907
+ // otherwise glob for *.podspec in dep root.
908
+ // $FlowFixMe[prop-missing] dynamic shape from autolinking.json
909
+ let podspecPath /*: ?string */ = dep.platforms.ios.podspecPath ?? null;
910
+ if (podspecPath == null) {
911
+ try {
912
+ const entries = fs.readdirSync(dep.root);
913
+ // Skip a crashed run's leftover patched copy (read-podspec.js stages it
914
+ // as `.spm-scaffold-<pid>-<name>.podspec` next to the original).
915
+ const candidate = entries.find(
916
+ e => e.endsWith('.podspec') && !e.startsWith('.spm-scaffold-'),
917
+ );
918
+ if (candidate != null) {
919
+ podspecPath = path.join(dep.root, candidate);
920
+ }
921
+ } catch {
922
+ // dep.root may not exist; treat as no-podspec
923
+ }
924
+ }
925
+ if (podspecPath == null || !fs.existsSync(podspecPath)) {
926
+ return {
927
+ depName,
928
+ status: 'skipped-no-podspec',
929
+ reason: 'No .podspec found in dep root.',
930
+ };
931
+ }
932
+
933
+ let model;
934
+ try {
935
+ model = readPodspec(podspecPath);
936
+ } catch (e) {
937
+ return {
938
+ depName,
939
+ status: 'error',
940
+ reason: `Podspec read failed: ${e.message}`,
941
+ };
942
+ }
943
+
944
+ const spec = translatePodspecToSpmTarget(
945
+ model,
946
+ dep,
947
+ ctx.podToNpm ?? new Map(),
948
+ );
949
+
950
+ // Mixed-language fail-closed: SPM can't compile Swift + C-family in one
951
+ // target. Don't emit a manifest that would fail with a cryptic "mixed
952
+ // language source files" resolve error — skip with a clear reason (and remove
953
+ // any stale scaffolded manifest so the autolinker reports it distinctly and
954
+ // points the user at opting it out / a binary distribution).
955
+ const hasSwift = spec.sources.some(f => /\.swift$/i.test(f));
956
+ const hasClang = spec.sources.some(f => /\.(mm?|c|cc|cpp|cxx)$/i.test(f));
957
+ if (hasSwift && hasClang) {
958
+ if (!ctx.dryRun && fs.existsSync(pkgSwiftPath)) {
959
+ const existing = fs.readFileSync(pkgSwiftPath, 'utf8');
960
+ if (existing.includes(SCAFFOLDER_MARKER)) {
961
+ fs.rmSync(pkgSwiftPath, {force: true});
962
+ }
963
+ }
964
+ return {
965
+ depName,
966
+ status: 'skipped-mixed-language',
967
+ reason:
968
+ 'has mixed Swift + Objective-C/C++ sources, which SPM cannot compile ' +
969
+ 'in one target (and the bidirectional ObjC↔Swift interop typical of ' +
970
+ 'such libs cannot be split without a circular dependency). Opt it out ' +
971
+ 'via react-native.config.js (platforms.ios = null) or use a prebuilt ' +
972
+ 'xcframework.',
973
+ };
974
+ }
975
+
976
+ // Relative paths into the app, embedded in the scaffolded Package.swift.
977
+ //
978
+ // The manifest is written to <dep.root>/Package.swift, but the autolinker
979
+ // references the dep through a symlink at
980
+ // <appRoot>/build/generated/autolinking/libs/<SwiftName>. On a fresh resolve
981
+ // SwiftPM interprets a manifest's relative `.package(path:)` entries against
982
+ // that SYMLINK location (it does not canonicalize the symlink first), so the
983
+ // paths must be relative to the symlink dir — NOT the real dep.root.
984
+ // Computing from dep.root produced a doubled path
985
+ // (…/autolinking/ios/build/generated/ios) → opaque "package manifest cannot
986
+ // be accessed" resolution failure. posix separators, as SPM expects.
987
+ const symlinkDir = path.join(
988
+ ctx.appRoot,
989
+ 'build',
990
+ 'generated',
991
+ 'autolinking',
992
+ 'libs',
993
+ spec.swiftName,
994
+ );
995
+ const relFromManifest = (...segments /*: Array<string> */) =>
996
+ path
997
+ .relative(symlinkDir, path.join(ctx.appRoot, ...segments))
998
+ .split(path.sep)
999
+ .join('/');
1000
+ const content = emitScaffoldedPackageSwift(spec, {
1001
+ cacheSlotLabel: ctx.cacheSlotLabel,
1002
+ remote: remotePackageConfig(ctx.appRoot),
1003
+ codegenPackageDir: relFromManifest('build', 'generated', 'ios'),
1004
+ localXcfwPackageDir: relFromManifest('build', 'xcframeworks'),
1005
+ });
1006
+
1007
+ // Distinguish "first-time scaffold" (no file at all) from "regenerate"
1008
+ // (file with the scaffolder marker, e.g. slot changed). Used by the
1009
+ // CLI orchestrator to decide whether to prompt for confirmation:
1010
+ // first-time scaffolds touch a node_modules dir the user may not expect,
1011
+ // regens are silent because we're maintaining a file we already own.
1012
+ const previouslyExisted = fs.existsSync(pkgSwiftPath);
1013
+
1014
+ if (!ctx.dryRun) {
1015
+ fs.writeFileSync(pkgSwiftPath, content, 'utf8');
1016
+ // Emit the ambient-import prefix header next to the manifest when the
1017
+ // target has ObjC(++) sources (the manifest `-include`s it by bare name).
1018
+ if (spec.needsObjCPrefix) {
1019
+ fs.writeFileSync(
1020
+ path.join(dep.root, SCAFFOLD_PREFIX_HEADER),
1021
+ SCAFFOLD_PREFIX_HEADER_CONTENTS,
1022
+ 'utf8',
1023
+ );
1024
+ }
1025
+ // Mirror root-level headers into the generated include/<SwiftName>/ shim
1026
+ // dir (publicHeadersPath) so dependents can use the CocoaPods header-map
1027
+ // spelling `#import <SwiftName/Header.h>`.
1028
+ if (spec.namespacedShimHeaders.length > 0) {
1029
+ const shimDir = path.join(dep.root, 'include', spec.swiftName);
1030
+ fs.mkdirSync(shimDir, {recursive: true});
1031
+ for (const header of spec.namespacedShimHeaders) {
1032
+ fs.writeFileSync(
1033
+ path.join(shimDir, header),
1034
+ `// AUTO-SCAFFOLDED by react-native spm scaffold — the namespaced\n` +
1035
+ `// spelling (<${spec.swiftName}/${header}>) of the package-root header,\n` +
1036
+ `// matching how CocoaPods header maps expose it.\n` +
1037
+ `#import "../../${header}"\n`,
1038
+ 'utf8',
1039
+ );
1040
+ }
1041
+ }
1042
+ }
1043
+
1044
+ return {
1045
+ depName,
1046
+ status: 'written',
1047
+ packageSwiftPath: pkgSwiftPath,
1048
+ warnings: spec.warnings,
1049
+ previouslyExisted,
1050
+ };
1051
+ }
1052
+
1053
+ // ---------------------------------------------------------------------------
1054
+ // Multi-dep orchestrator
1055
+ // ---------------------------------------------------------------------------
1056
+
1057
+ /*::
1058
+ type ScaffoldAllOptions = {
1059
+ appRoot: string,
1060
+ projectRoot: string,
1061
+ reactNativeRoot: string,
1062
+ force?: boolean,
1063
+ dryRun?: boolean,
1064
+ cacheSlotLabel?: ?string,
1065
+ autolinkingJsonPath?: string,
1066
+ // npm dep names to skip entirely — used when the user declined the
1067
+ // confirmation prompt for first-time scaffolds. Skipped deps still
1068
+ // appear in the returned results array with status='skipped-opt-out'.
1069
+ skipDeps?: ReadonlyArray<string>,
1070
+ };
1071
+ */
1072
+
1073
+ /**
1074
+ * Walks autolinking.json, scaffolds each iOS-native dep, returns one
1075
+ * ScaffoldResult per dep. Caller (setup-apple-spm.js) prints a structured
1076
+ * summary.
1077
+ */
1078
+ function scaffoldAll(
1079
+ opts /*: ScaffoldAllOptions */,
1080
+ ) /*: Array<ScaffoldResult> */ {
1081
+ const {appRoot, projectRoot, reactNativeRoot} = opts;
1082
+ const autolinkingJsonPath =
1083
+ opts.autolinkingJsonPath ??
1084
+ path.join(appRoot, 'build', 'generated', 'autolinking', 'autolinking.json');
1085
+
1086
+ if (!fs.existsSync(autolinkingJsonPath)) {
1087
+ log(
1088
+ `autolinking.json not found at ${path.relative(appRoot, autolinkingJsonPath)}; nothing to scaffold.`,
1089
+ );
1090
+ return [];
1091
+ }
1092
+
1093
+ /*:: type AutolinkingJson = {dependencies?: ?{[string]: {root?: string, platforms?: {ios?: ?{...}, ...}, ...}}, ...}; */
1094
+ // $FlowFixMe[incompatible-type] JSON.parse returns any
1095
+ const data /*: AutolinkingJson */ = JSON.parse(
1096
+ fs.readFileSync(autolinkingJsonPath, 'utf8'),
1097
+ );
1098
+ const deps = data.dependencies;
1099
+ if (deps == null) {
1100
+ return [];
1101
+ }
1102
+
1103
+ // Narrow the direct autolinking.json entries with an iOS platform, then
1104
+ // expand transitive `spm.dependencies` so the scaffolder covers EXACTLY the
1105
+ // set the autolinker considers. Without this, a transitive native dep that
1106
+ // ships no Package.swift would be flagged by the autolinker but never
1107
+ // scaffolded here — leaving `react-native spm scaffold` unable to clear the
1108
+ // autolinker's missing-manifest error.
1109
+ const results /*: Array<ScaffoldResult> */ = [];
1110
+ const directDeps /*: Array<AutolinkedDep> */ = [];
1111
+ for (const name of Object.keys(deps)) {
1112
+ const raw = deps[name];
1113
+ if (raw == null) continue;
1114
+ const root = raw.root;
1115
+ const ios = raw.platforms?.ios;
1116
+ if (typeof root !== 'string' || ios == null) {
1117
+ results.push({
1118
+ depName: name,
1119
+ status: 'skipped-no-ios',
1120
+ reason: 'no iOS platform in autolinking.json',
1121
+ });
1122
+ continue;
1123
+ }
1124
+ // $FlowFixMe[incompatible-type] `ios` shape is runtime-validated above
1125
+ const iosPlatform /*: AutolinkingIosPlatform */ = ios;
1126
+ directDeps.push({name, root, platforms: {ios: iosPlatform}});
1127
+ }
1128
+
1129
+ let allDeps /*: Array<AutolinkedDep> */ = [];
1130
+ try {
1131
+ allDeps = expandSpmDependencies(directDeps, {
1132
+ readConfig: defaultReadConfig,
1133
+ resolveDep: defaultResolveDep,
1134
+ });
1135
+ } catch (e) {
1136
+ // A transitive-resolution failure shouldn't abort the whole scaffold pass;
1137
+ // fall back to the direct deps so at least those get manifests.
1138
+ log(`Transitive spm.dependencies expansion failed: ${e.message}`);
1139
+ allDeps = directDeps;
1140
+ }
1141
+
1142
+ // Index every autolinked dep's podspec name → its npm name, so a dep that
1143
+ // depends on a sibling by its pod name (reanimated's `s.dependency
1144
+ // "RNWorklets"`) can be wired to the sibling's package (react-native-worklets).
1145
+ // The podspec file basename is the pod name for RN-ecosystem libs (and is
1146
+ // cheap — no `pod ipc` pre-pass).
1147
+ const podToNpm /*: Map<string, string> */ = new Map();
1148
+ for (const dep of allDeps) {
1149
+ const podspecPath = dep.platforms?.ios?.podspecPath;
1150
+ if (typeof podspecPath === 'string' && podspecPath.length > 0) {
1151
+ podToNpm.set(path.basename(podspecPath, '.podspec'), dep.name);
1152
+ } else {
1153
+ // Transitive entries synthesized by expandSpmDependencies (declared via
1154
+ // `spm.dependencies` in react-native.config.js) carry no podspecPath —
1155
+ // discover the podspec at the dep root so podspec-name sibling deps
1156
+ // (e.g. `s.dependency "TestLibraryCommon"`) still wire to their npm
1157
+ // package.
1158
+ try {
1159
+ for (const f of fs.readdirSync(dep.root)) {
1160
+ if (f.endsWith('.podspec') && !f.startsWith('.spm-scaffold-')) {
1161
+ podToNpm.set(path.basename(f, '.podspec'), dep.name);
1162
+ }
1163
+ }
1164
+ } catch {
1165
+ // unreadable dep root — sibling wiring falls back to the warning path
1166
+ }
1167
+ }
1168
+ }
1169
+
1170
+ const ctx /*: ScaffoldContext */ = {
1171
+ appRoot,
1172
+ projectRoot,
1173
+ reactNativeRoot,
1174
+ force: opts.force === true,
1175
+ dryRun: opts.dryRun === true,
1176
+ cacheSlotLabel: opts.cacheSlotLabel ?? null,
1177
+ podToNpm,
1178
+ };
1179
+ const skipSet /*: Set<string> */ = new Set(opts.skipDeps ?? []);
1180
+
1181
+ for (const dep of allDeps) {
1182
+ if (skipSet.has(dep.name)) {
1183
+ results.push({
1184
+ depName: dep.name,
1185
+ status: 'skipped-opt-out',
1186
+ reason: 'User declined scaffolding for this dep.',
1187
+ });
1188
+ continue;
1189
+ }
1190
+ try {
1191
+ results.push(scaffoldPackageSwiftForDep(dep, ctx));
1192
+ } catch (e) {
1193
+ results.push({depName: dep.name, status: 'error', reason: e.message});
1194
+ }
1195
+ }
1196
+ return results;
1197
+ }
1198
+
1199
+ module.exports = {
1200
+ scaffoldAll,
1201
+ scaffoldPackageSwiftForDep,
1202
+ translatePodspecToSpmTarget,
1203
+ emitScaffoldedPackageSwift,
1204
+ SCAFFOLDER_MARKER,
1205
+ SCAFFOLDER_VERSION,
1206
+ };