Skip to content

[0.87] Honor a library's spm.name when scaffolding its Package.swift #1393

Description

@cipolleschi

Target Branch

0.87

Link to commit or PR to be picked

react/react-native@482acee

Description

Requesting this pick for the SwiftPM preview shipped in 0.87.

The Package.swift scaffolder currently derives every target name from the package name and ignores the documented spm.name override in a library's react-native.config.js. For libraries that need this override, the generated manifest therefore exposes a product name that differs from the name registered by autolinking, causing SwiftPM dependency resolution to fail. This was reported through real-world community integration work in powersync-ja/powersync-js#1076.

This commit makes the scaffolder use the Swift name already resolved by autolinking, while retaining the existing derived-name fallback for callers that do not supply it. It also passes resolved Swift names through sibling dependency references. The change is scoped to SwiftPM manifest scaffolding and its types, and adds focused unit-test coverage (58 added test lines); the upstream PR reports the unit tests passing. Picking it ensures the documented spm.name configuration works in the 0.87 SwiftPM flow.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type Pick RequestPick requests to include commits inside a React Native release

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions