Commit 9df65a4
Honor a library's spm.name when scaffolding its Package.swift
The scaffolder derived every target name with `toSwiftName(dep.name)`, ignoring
the `spm.name` override in the library's own react-native.config.js. A library
setting that override got a manifest whose product name differed from the name
the autolinker registers it under, and SPM failed resolution on
`.product(name: "X", package: "X")` — the exact mismatch the override exists to
prevent.
Use the name the autolinker already resolved (`dep.swiftName`), falling back to
`toSwiftName` when a caller runs the translation without it. Sibling references
resolve the same way, through the new `SpmScaffoldSpec.siblingSwiftNames`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 54696dd commit 9df65a4
3 files changed
Lines changed: 97 additions & 12 deletions
File tree
- packages/react-native/scripts/spm
- __tests__
Lines changed: 58 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
143 | 174 | | |
144 | 175 | | |
145 | 176 | | |
| |||
604 | 635 | | |
605 | 636 | | |
606 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
607 | 650 | | |
608 | 651 | | |
609 | 652 | | |
| |||
745 | 788 | | |
746 | 789 | | |
747 | 790 | | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
748 | 806 | | |
749 | 807 | | |
750 | 808 | | |
| |||
Lines changed: 34 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
238 | 241 | | |
239 | 242 | | |
240 | 243 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
| |||
251 | 255 | | |
252 | 256 | | |
253 | 257 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 258 | + | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
512 | 514 | | |
513 | 515 | | |
514 | 516 | | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
515 | 525 | | |
516 | 526 | | |
517 | 527 | | |
| |||
520 | 530 | | |
521 | 531 | | |
522 | 532 | | |
| 533 | + | |
523 | 534 | | |
524 | 535 | | |
525 | 536 | | |
| |||
687 | 698 | | |
688 | 699 | | |
689 | 700 | | |
690 | | - | |
| 701 | + | |
| 702 | + | |
691 | 703 | | |
692 | 704 | | |
693 | 705 | | |
| |||
787 | 799 | | |
788 | 800 | | |
789 | 801 | | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
790 | 805 | | |
791 | 806 | | |
792 | 807 | | |
| |||
945 | 960 | | |
946 | 961 | | |
947 | 962 | | |
| 963 | + | |
948 | 964 | | |
949 | 965 | | |
950 | 966 | | |
| |||
1167 | 1183 | | |
1168 | 1184 | | |
1169 | 1185 | | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
1170 | 1193 | | |
1171 | 1194 | | |
1172 | 1195 | | |
| |||
1175 | 1198 | | |
1176 | 1199 | | |
1177 | 1200 | | |
| 1201 | + | |
1178 | 1202 | | |
1179 | 1203 | | |
1180 | 1204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
486 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
487 | 489 | | |
488 | 490 | | |
| 491 | + | |
489 | 492 | | |
490 | 493 | | |
491 | 494 | | |
| |||
0 commit comments