From c921d1cb45b34de8c5c06767b59f8c9789552cbb Mon Sep 17 00:00:00 2001 From: serpixel Date: Mon, 5 Oct 2026 22:19:17 +0200 Subject: [PATCH] Add Swift Package Manager manifest (react-native spm scaffold) Generated with RN 0.87.1's `react-native spm scaffold` from the podspec and validated with `swift package dump-package` (swift-tools-version 6.0). The two React path dependencies resolve through RN 0.87's autolinking alias at app resolve time (same shape react-native-safe-area-context ships); they do not resolve in a bare clone. CocoaPods users are unaffected. --- Package.swift | 50 +++++++++++++++++++++++++++++++++++++++ react-native-spm-prefix.h | 10 ++++++++ 2 files changed, 60 insertions(+) create mode 100644 Package.swift create mode 100644 react-native-spm-prefix.h diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..360849fe --- /dev/null +++ b/Package.swift @@ -0,0 +1,50 @@ +// swift-tools-version: 6.0 +// AUTO-SCAFFOLDED by react-native spm scaffold — safe to edit & commit via patch-package. +// AUTO-SCAFFOLDED-VERSION: 19 +// Cache slot: 0.87.1/dual-flavor +// Edit the contents below if needed and re-run `npx patch-package ` +// to persist across `npm install`. To regenerate from the podspec, remove +// this file (or just this marker) and re-run `npx react-native spm scaffold`. +// +// Package references are plain relative paths, computed when this file was +// scaffolded. They stay correct because the file is re-scaffolded per app +// and cache slot, and any node_modules relayout reinstalls this package +// (dropping the file) anyway. + +import PackageDescription + +let package = Package( + name: "Slider", + platforms: [.iOS(.v15)], + products: [ + .library(name: "Slider", targets: ["Slider"]), + ], + dependencies: [ + .package(name: "ReactNative", path: "../../../../xcframeworks"), + .package(name: "React-GeneratedCode", path: "../../../ios"), + ], + targets: [ + .target( + name: "Slider", + dependencies: [.product(name: "ReactHeaders", package: "ReactNative"), .product(name: "ReactNativeHeaders", package: "ReactNative"), .product(name: "ReactNativeDependenciesHeaders", package: "ReactNative"), .product(name: "ReactAppHeaders", package: "React-GeneratedCode")], + path: ".", + sources: [ + "common/cpp/react/renderer/components/RNCSlider/RNCSliderComponentDescriptor.h", + "common/cpp/react/renderer/components/RNCSlider/RNCSliderMeasurementsManager.cpp", + "common/cpp/react/renderer/components/RNCSlider/RNCSliderMeasurementsManager.h", + "common/cpp/react/renderer/components/RNCSlider/RNCSliderShadowNode.cpp", + "common/cpp/react/renderer/components/RNCSlider/RNCSliderShadowNode.h", + "common/cpp/react/renderer/components/RNCSlider/RNCSliderState.h", + "ios/RNCSlider.h", + "ios/RNCSlider.m", + "ios/RNCSliderComponentView.h", + "ios/RNCSliderComponentView.mm", + ], + publicHeadersPath: "ios", + cSettings: [.headerSearchPath("common/cpp"), .headerSearchPath("common/cpp/react/renderer/components/RNCSlider"), .headerSearchPath("ios"), .headerSearchPath("."), .unsafeFlags(["-include", "react-native-spm-prefix.h"])], + cxxSettings: [.headerSearchPath("common/cpp"), .headerSearchPath("common/cpp/react/renderer/components/RNCSlider"), .headerSearchPath("ios"), .headerSearchPath("."), .unsafeFlags(["-include", "react-native-spm-prefix.h"]), .unsafeFlags(["-DFOLLY_NO_CONFIG", "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", "-Wno-comma", "-Wno-shorten-64-to-32", "-DRCT_NEW_ARCH_ENABLED=1"]), .define("DEBUG", .when(configuration: .debug)), .define("NDEBUG", .when(configuration: .release))], + linkerSettings: [.linkedFramework("UIKit"), .linkedFramework("Foundation"), .linkedFramework("CoreGraphics")] + ), + ], + cxxLanguageStandard: .cxx20 +) diff --git a/react-native-spm-prefix.h b/react-native-spm-prefix.h new file mode 100644 index 00000000..af5cea05 --- /dev/null +++ b/react-native-spm-prefix.h @@ -0,0 +1,10 @@ +// AUTO-SCAFFOLDED by react-native spm scaffold — mirrors CocoaPods' default +// prefix header so ObjC sources that rely on an implicit Foundation/UIKit +// import compile under SPM (which has no prefix-header mechanism). Safe to +// delete + regenerate via `npx react-native spm scaffold`. +#ifdef __OBJC__ +#import +#if __has_include() +#import +#endif +#endif