Repository navigation
Declare the SwiftPM name in package.json - #778
Merged
janicduplessis merged 2 commits intoSep 28, 2026
Merged
Conversation
janicduplessis
approved these changes
Sep 28, 2026
Collaborator
|
Thanks! |
Contributor
Author
|
Thanks for the quick merge, @janicduplessis :) |
Collaborator
|
No problem! We are reworking our release process so might take a little bit more time to be out on npm since I want to use this one to test it out. |
This was referenced Sep 28, 2026
Merged
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.
Summary
React Native's SwiftPM autolinker now takes a library's Swift name from its podspec when
package.jsondeclares no name (react/react-native#58290). The podspec for this library is namedreact-native-safe-area-context. The library product inPackage.swiftis namedReactNativeSafeAreaContext. Because the two names differ, a new React Native app built with SwiftPM fails package resolution:This PR adds
"swiftpmConfig": { "name": "ReactNativeSafeAreaContext" }topackage.json. React Native reads this field before it looks at the podspec, so the autolinker now asks for the product thatPackage.swiftdeclares.Package.swiftdoes not change, so the module name and the header import prefix stay the same.A new test in
src/__tests__/swiftpm-test.tschecks thatswiftpmConfig.nameinpackage.jsonmatches the library product name inPackage.swift. The file header comment now describes where the name comes from.Test Plan
Before the
package.jsonchange, the new test failed (Expected: "ReactNativeSafeAreaContext",Received: undefined). After the change, the result isTests: 5 passed, 5 total.eslint,prettier --check, andyarn validate:typescriptpass on the changed files.