From 493e5d44599f272ec19c094fe29831a4236ec1fc Mon Sep 17 00:00:00 2001 From: serpixel Date: Mon, 5 Oct 2026 22:14:38 +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. Needed for React Native 0.87 SwiftPM autolinking, where autolinked native libraries without a manifest fail the package resolve. --- Package.swift | 53 +++++++++++++++++++++++++++++++++++++++ react-native-spm-prefix.h | 10 ++++++++ 2 files changed, 63 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..db1ef847 --- /dev/null +++ b/Package.swift @@ -0,0 +1,53 @@ +// 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: "Datetimepicker", + platforms: [.iOS(.v15)], + products: [ + .library(name: "Datetimepicker", targets: ["Datetimepicker"]), + ], + dependencies: [ + .package(name: "ReactNative", path: "../../../../xcframeworks"), + .package(name: "React-GeneratedCode", path: "../../../ios"), + ], + targets: [ + .target( + name: "Datetimepicker", + dependencies: [.product(name: "ReactHeaders", package: "ReactNative"), .product(name: "ReactNativeHeaders", package: "ReactNative"), .product(name: "ReactNativeDependenciesHeaders", package: "ReactNative"), .product(name: "ReactAppHeaders", package: "React-GeneratedCode")], + path: ".", + sources: [ + "ios/RNDateTimePicker.h", + "ios/RNDateTimePicker.m", + "ios/RNDateTimePickerManager.h", + "ios/RNDateTimePickerManager.m", + "ios/RNDateTimePickerShadowView.h", + "ios/RNDateTimePickerShadowView.m", + "ios/fabric/RNDateTimePickerComponentView.h", + "ios/fabric/RNDateTimePickerComponentView.mm", + "ios/fabric/cpp/react/renderer/components/RNDateTimePicker/ComponentDescriptors.h", + "ios/fabric/cpp/react/renderer/components/RNDateTimePicker/RNDateTimePickerState.cpp", + "ios/fabric/cpp/react/renderer/components/RNDateTimePicker/RNDateTimePickerState.h", + "ios/fabric/cpp/react/renderer/components/RNDateTimePicker/ShadowNodes.cpp", + "ios/fabric/cpp/react/renderer/components/RNDateTimePicker/ShadowNodes.h", + ], + publicHeadersPath: "ios", + cSettings: [.headerSearchPath("ios"), .headerSearchPath("ios/fabric"), .headerSearchPath("ios/fabric/cpp/react/renderer/components/RNDateTimePicker"), .headerSearchPath("."), .unsafeFlags(["-include", "react-native-spm-prefix.h"])], + cxxSettings: [.headerSearchPath("ios"), .headerSearchPath("ios/fabric"), .headerSearchPath("ios/fabric/cpp/react/renderer/components/RNDateTimePicker"), .headerSearchPath("."), .unsafeFlags(["-include", "react-native-spm-prefix.h"]), .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