Skip to content

Hold an app's spm.modules names to the same rules as a library's - #58060

Open
chrfalch wants to merge 1 commit into
spm/reserved-name-guardfrom
spm/spm-modules-guard
Open

Hold an app's spm.modules names to the same rules as a library's#58060
chrfalch wants to merge 1 commit into
spm/reserved-name-guardfrom
spm/spm-modules-guard

Conversation

@chrfalch

Copy link
Copy Markdown
Collaborator

Summary:

An app declares extra native modules through spm.modules in its react-native.config.js. Those names went into the generated package graph unvalidated, and two of the ways they can go wrong fail silently.

This PR fixes this by using the same Swift name collision detection/resolving as we introduced in #58044

NOTE: #58044 must be merged before this one so that we can change the base branch for this one to main

Changelog:

[IOS] [FIXED] - Reject colliding or invalid spm.modules names instead of silently dropping a module from the build

Test Plan:

✅ Unit tests/CI

`spm.modules` names go into the generated manifest exactly as written, with no
validation at all: a name React Native reserves produced the same opaque
SwiftPM duplicate-name failure a library's name did, a name that is not a Swift
identifier produced a manifest SwiftPM refuses to parse, and two modules — or a
module and an autolinked library — could quietly claim the same target name.

Run the reserved-name and charset checks the library surface already has, and
check each name against the targets already emitted, so the app author is told
which entry to rename in their own react-native.config.js.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 21, 2026
@chrfalch
chrfalch requested a review from cipolleschi August 21, 2026 13:41
@github-actions

Copy link
Copy Markdown

Caution

Invalid Base Branch

The base branch for this PR is spm/reserved-name-guard, which is not main or a -stable branch.
Are you sure you want to target this branch?

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant