Repository navigation
Commit c7e3497
Document spm.dependencies and the scaffold prerequisite
Summary:
Two things implemented in the code and absent from the docs.
**`spm.dependencies`.** The SwiftPM analog of a podspec's `s.dependency` — how a
library declares it needs another native library — is implemented in
`expand-spm-dependencies.js` and was documented in no doc at all, so a library
author porting a podspec had no way to find the mechanism replacing
`s.dependency`. Added a section next to the other `react-native.config.js`
surfaces, noting it resolves recursively and is a library-author surface rather
than an app one.
**The scaffold prerequisite.** "Community packages without a `Package.swift`" said
the *build* fails. It is `spm add`/`update` that stops, during autolinking
generation, with exit code **2** — deliberately distinct so the Xcode sync hook can
treat it as a hard build error while staying lenient about transient sync failures.
Neither the exit code nor the reason `add`/`update` refuse to auto-scaffold (it
would hide a real gap in the dependency's SPM support) was written down. Also noted
that `scaffold` runs codegen and autolinking but does *not* inject, so a first-time
setup still needs the follow-up `npx react-native spm`, and added a troubleshooting
row keyed on the error text since that is what people will search for.
Changelog: [Internal]
Test Plan:
Traced to `expand-spm-dependencies.js` for the recursive expansion, and to
`reportMissingManifests` in `generate-spm-autolinking.js` plus its handling in
`setup-apple-spm.js`, where the `scaffold` action runs before the shared
codegen/autolinking steps and injection stays gated on `action === 'add'`.
Prettier clean.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent ebac880 commit c7e3497
1 file changed
Lines changed: 38 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
356 | 379 | | |
357 | 380 | | |
358 | 381 | | |
| |||
370 | 393 | | |
371 | 394 | | |
372 | 395 | | |
373 | | - | |
374 | | - | |
375 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
376 | 405 | | |
377 | 406 | | |
378 | 407 | | |
| 408 | + | |
379 | 409 | | |
380 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
381 | 415 | | |
382 | 416 | | |
383 | 417 | | |
| |||
440 | 474 | | |
441 | 475 | | |
442 | 476 | | |
| 477 | + | |
443 | 478 | | |
444 | 479 | | |
445 | 480 | | |
| |||
0 commit comments