Skip to content

docs(swiftpm): correct SwiftPM docs to match current scripts - #58968

Closed
chrfalch wants to merge 5 commits into
mainfrom
chrfalch/rn-swiftpm-docs-update
Closed

chrfalch wants to merge 5 commits into
mainfrom
chrfalch/rn-swiftpm-docs-update

Conversation

@chrfalch

@chrfalch chrfalch commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary:

Several statements in the SwiftPM docs no longer match the scripts on main. This PR corrects them. It changes docs only.

  • scripts/spm/__docs__: CLI options, the three causes of exit code 2, what sync does and when it re-runs, which command writes each file, the header products a hand-written library depends on, and remote mode. Adds a table of environment variables.
  • scripts/ios-prebuild/__docs__: the SwiftPM statements about where dependency and Hermes headers go.

Where the code has a known gap, the docs describe the current behavior. Examples: npx react-native spm does not forward --configCommand, and spm scaffold also changes the .xcodeproj.

A second commit simplifies the same docs: it removes repeated statements and splits long sentences. No facts change. The header resolution details move to spm-header-paths-contract.md.

Changelog:

[INTERNAL] [CHANGED] - Correct SwiftPM docs to match current scripts

Test Plan:

  • npx prettier --check packages/react-native/scripts/{spm,ios-prebuild}/__docs__/*.md: all files pass.
  • Each changed statement was checked against the code on main. Relative links and anchors in changed lines resolve.

Fix statements in the SwiftPM and ios-prebuild __docs__ that no longer
match the code: CLI options, exit code 2 causes, what sync does and when
it re-runs, which command writes each file, header products, remote mode,
and header sidecar layout. Add an environment variables table.
@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 Oct 9, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 9, 2026
Remove repeated statements, split long sentences, and move the header
resolution details into spm-header-paths-contract.md. No facts change.
tree. RN owns the merge, so a re-sync reproduces the same `Package.swift`
byte-for-byte (idempotent). Package and product contributions are **deduped by
name** across plugins.
The plugin returns **data**. It never writes into React Native's generated tree.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this contract easier to scan! Could we add watchPaths to the “Return (contributions, all optional)” table above? It is part of PluginResult and documented earlier, but the summary table currently skips it. Would listing it as contributing to the auto-sync staleness inputs help plugin authors discover it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, added in a767b7d: watchPaths is now a row in the return table, linking to its section. It also says that invalid entries are dropped with a warning rather than being fatal, unlike flavoredFrameworks and scriptPhases.

@chrfalch
chrfalch requested a review from cipolleschi October 14, 2026 12:37
@meta-codesync

meta-codesync Bot commented Oct 14, 2026

Copy link
Copy Markdown

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D125209110.

@meta-codesync meta-codesync Bot closed this in 649c946 Oct 15, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 15, 2026
@meta-codesync

meta-codesync Bot commented Oct 15, 2026

Copy link
Copy Markdown

@cipolleschi merged this pull request in 649c946.

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. Merged This PR has been merged. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants