Commit 71f3874
feat: ask to use recommended template (#564)
## Summary
This is an effort to implement a recommended template. See the [Golden
Template
RFC](react-native-community/discussions-and-proposals#721)
for context.
This adds a new parameter called `--with-recommended-options` and the
corresponding question to the CLI.
Here's how the CLI prompt looks like:

This also adds the text `(Recommended)` at the end of the recommended
options (View + Module with backward compats and Kotlin + Obj-c at the
moment).
## Test plan
### A. Happy Path
1. Run `create-react-native-library` and answer the mail address, git
repo, etc. questions.
2. Make sure the CLI asks `Do you want to customize the library type and
languages?`.
3. Select `Use recommended defaults`.
4. Wait until the library is generated and make sure the library is a
view + module, kotlin + objective-c library.
### B. Pick Customize
1. Run `create-react-native-library` and answer the mail address, git
repo, etc. questions.
2. Make sure the CLI asks `Do you want to customize the library type and
languages?`.
3. Select `Customize`.
4. Make sure the `Fabric view and Turbo module with backward compat`
option has the `(Recommended)` text.
### C. Pass `--with-recommended-options`
1. Run `create-react-native-library` with `--with-recommended-options`
parameter.
2. Make sure the library doesn't ask you about library or type
selection.
3. Make sure the generated library uses the golden template.
### D. Pass `--with-recommended-options` with bad parameters
1. Run `create-react-native-library` with `--with-recommended-options`
and `--type module-view-new`.
2. Make sure it emits an error.
---------
Co-authored-by: Satyajit Sahoo <[email protected]>1 parent a75cf32 commit 71f3874
1 file changed
+64
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| |||
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| |||
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
151 | | - | |
| 153 | + | |
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
| |||
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
222 | 234 | | |
223 | 235 | | |
224 | 236 | | |
| |||
265 | 277 | | |
266 | 278 | | |
267 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
268 | 284 | | |
269 | 285 | | |
270 | 286 | | |
| |||
432 | 448 | | |
433 | 449 | | |
434 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
435 | 467 | | |
436 | 468 | | |
437 | 469 | | |
438 | 470 | | |
439 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
440 | 487 | | |
441 | 488 | | |
442 | 489 | | |
443 | 490 | | |
444 | 491 | | |
445 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
446 | 499 | | |
447 | 500 | | |
448 | 501 | | |
449 | 502 | | |
450 | 503 | | |
451 | 504 | | |
452 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
453 | 513 | | |
454 | 514 | | |
455 | 515 | | |
| |||
0 commit comments