Commit 68bbbba
feat(spm): redesign
Replace the ambiguous `init`/`--from-scratch` (with its silent
in-place→from-scratch fall-through that could rename a user's project to
.legacy) with four clear verbs:
add inject SPM into the existing .xcodeproj, in place (idempotent;
fail-loud on a CocoaPods-integrated pbxproj). --deintegrate runs
`pod deintegrate` + strips RN from the Podfile + removes the
leftover empty Pods group.
update re-run the pipeline + refresh the injection.
deinit surgical inverse of add (reverse exactly what .spm-injected.json
records → byte-identical revert; no prompt).
scaffold unchanged.
sync/codegen/download stay but are hidden from primary help.
Zero-arg `npx react-native spm` auto-resolves: injected→update; a fresh
CocoaPods project (safe-gate: stock Podfile + git-clean pbxproj/Podfile)→
add --deintegrate; else strict add.
- Delete the from-scratch xcodeproj generator + legacy-migration/Podfile-patch
machinery and the now-dead whole-file-generation helpers in spm-pbxproj.js.
- Add surgical pbxproj removal primitives (removeObjectByUuid,
removeArrayMembersByUuid, removeField, removeArrayStringValues,
removeEmptyPodsGroup); injection now records its exact edits in
.spm-injected.json so deinit can reverse them.
- Merge flags: --skip/force-download → --download <auto|skip|force>;
--local-xcframework + --artifacts-dir → --artifacts <path>. Remove
--skip-xcodeproj/--force-xcodeproj/--bundle-identifier/--entry-file and the
--platform-name CLI shim.
- generate-spm-package now throws on artifact-slot failures (incl. missing
ReactNativeHeaders) instead of a silent exitCode+return.
- Update CLI registration, __doc__/spm-scripts.md, and the spm test suite.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>react-native spm to add/update/deinit; drop from-scratch generator1 parent d9e0a80 commit 68bbbba
12 files changed
Lines changed: 1236 additions & 3010 deletions
File tree
- packages/react-native
- scripts
- spm
- __doc__
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
| 119 | + | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | 127 | | |
136 | 128 | | |
137 | 129 | | |
138 | 130 | | |
139 | 131 | | |
140 | | - | |
141 | | - | |
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 | | - | |
| 132 | + | |
| 133 | + | |
167 | 134 | | |
168 | 135 | | |
169 | 136 | | |
170 | 137 | | |
171 | | - | |
| 138 | + | |
172 | 139 | | |
173 | 140 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | 141 | | |
179 | 142 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | 143 | | |
185 | | - | |
| 144 | + | |
186 | 145 | | |
187 | 146 | | |
188 | | - | |
| 147 | + | |
189 | 148 | | |
190 | | - | |
| 149 | + | |
| 150 | + | |
191 | 151 | | |
192 | 152 | | |
193 | | - | |
| 153 | + | |
194 | 154 | | |
195 | | - | |
| 155 | + | |
| 156 | + | |
196 | 157 | | |
197 | 158 | | |
198 | | - | |
| 159 | + | |
199 | 160 | | |
200 | | - | |
| 161 | + | |
201 | 162 | | |
202 | 163 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
| 164 | + | |
| 165 | + | |
218 | 166 | | |
219 | 167 | | |
220 | 168 | | |
| |||
224 | 172 | | |
225 | 173 | | |
226 | 174 | | |
227 | | - | |
228 | | - | |
229 | 175 | | |
230 | | - | |
231 | 176 | | |
232 | | - | |
233 | 177 | | |
| 178 | + | |
| 179 | + | |
234 | 180 | | |
235 | 181 | | |
236 | 182 | | |
| |||
239 | 185 | | |
240 | 186 | | |
241 | 187 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
| 188 | + | |
251 | 189 | | |
252 | 190 | | |
253 | 191 | | |
| |||
0 commit comments