Repository navigation
fix(ios): set swiftpmConfig.name so SwiftPM autolinking finds the ReactNativeBlobUtil product - #507
Merged
Conversation
…ctNativeBlobUtil product
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for adding the Package.swift on master.
Problem
In a React Native 0.88.0 app in SwiftPM mode (
npx react-native spm add --deintegrate --yes), master (1a602b3) fails at package resolution:React Native names a library's SwiftPM product with
swiftpmConfig.namefrom its package.json. When that field is missing, it uses the podspec name, which here is the npm namereact-native-blob-util. The Package.swift names the package and productReactNativeBlobUtil, so the two names do not match.Change
One line in package.json:
React Native then links the library as
ReactNativeBlobUtil, which is the link folder that the Package.swift comment expects. CocoaPods builds do not read this field, so they are not affected.Test
Fresh React Native 0.88.0 app, this library as a dependency, with the line added:
npx react-native spm updatelinksReactNativeBlobUtil.xcodebuild … -configuration Debug -destination 'generic/platform=iOS Simulator' buildprintsBUILD SUCCEEDED.TurboModuleRegistry.get('ReactNativeBlobUtil')is present andReactNativeBlobUtil.fs.exists(ReactNativeBlobUtil.fs.dirs.DocumentDir)returnstrue.Without the line, step 2 fails with the error above.
npm has 1.0.0 as the newest version, and it has no Package.swift. After this change, could you publish 1.1.0?