Commit a56f200
Docs: document the --version pin in the SwiftPM scripts doc
The SwiftPM docs still described `--version` as "RN version (default: from
package.json)", which stopped being true once determineVersion started reading
the `artifactsVersionOverride` pin back out of `.spm-injected.json`. Document
the real resolution order and why it matters:
- The `--version` row in "CLI Options" now names all three sources in order —
the flag, the pin a previous `--version` wrote into the marker, then
node_modules/react-native/package.json — and says you pass it once.
- A new "Pinning the React Native version" subsection explains the failure the
pin prevents, which is not self-evident: the resolved version selects which
artifact slots the project is wired to, so a flagless run falling back to
package.json re-points the project at different slots while the marker still
advertises the pinned one. It also states that `deinit` drops the marker and
with it the pin, so a later `add` resolves package.json again unless you pass
`--version`.
- The `.spm-injected.json` row in "What to commit" described the marker only as
a record of the edits `add` made. One appended sentence makes its second role
visible; the row is otherwise untouched, since sibling PRs edit it too.
No advice to repeat `--version` on every invocation existed in the docs to
correct — that workaround was only ever passed on verbally.
The file is not Prettier-formatted on this branch, so it was deliberately not
reformatted: prose stays wrapped near 80 columns and table rows stay on one
line, matching the surrounding style.
[Internal] - Document the `spm --version` pin and its resolution order
Docs-only change; no code or tests touched. Verified against the branch's own
diff that the marker key is `artifactsVersionOverride` (read by
`readArtifactsVersionOverride` in scripts/spm/generate-spm-xcodeproj.js) and
that `determineVersion` in scripts/setup-apple-spm.js resolves flag → pin →
node_modules/react-native/package.json.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent a1e2971 commit a56f200
1 file changed
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
175 | 194 | | |
176 | 195 | | |
177 | 196 | | |
| |||
195 | 214 | | |
196 | 215 | | |
197 | 216 | | |
198 | | - | |
| 217 | + | |
199 | 218 | | |
200 | 219 | | |
201 | 220 | | |
| |||
0 commit comments