@@ -71,7 +71,6 @@ type ArgName =
71
71
| 'repo-url'
72
72
| 'languages'
73
73
| 'type'
74
- | 'example'
75
74
| 'react-native-version' ;
76
75
77
76
type ProjectLanguages =
@@ -91,8 +90,6 @@ type ProjectType =
91
90
| 'view-legacy'
92
91
| 'library' ;
93
92
94
- type ProjectExample = 'expo' | 'native' ;
95
-
96
93
type Answers = {
97
94
slug : string ;
98
95
description : string ;
@@ -102,7 +99,6 @@ type Answers = {
102
99
repoUrl : string ;
103
100
languages : ProjectLanguages ;
104
101
type ?: ProjectType ;
105
- example ?: ProjectExample ;
106
102
reactNativeVersion ?: string ;
107
103
} ;
108
104
@@ -139,36 +135,48 @@ const LANGUAGE_CHOICES: {
139
135
} ,
140
136
] ;
141
137
142
- const TYPE_CHOICES : { title : string ; value : ProjectType } [ ] = [
143
- {
144
- title : 'Turbo module with backward compat (experimental)' ,
145
- value : 'module-mixed' ,
146
- } ,
138
+ const NEWARCH_DESCRIPTION = 'requires new architecture (experimental)' ;
139
+ const BACKCOMPAT_DESCRIPTION = 'supports new architecture (experimental)' ;
140
+
141
+ const TYPE_CHOICES : {
142
+ title : string ;
143
+ value : ProjectType ;
144
+ description : string ;
145
+ } [ ] = [
147
146
{
148
- title : 'Turbo module (experimental)' ,
149
- value : 'module-new' ,
147
+ title : 'JavaScript library' ,
148
+ value : 'library' ,
149
+ description : 'supports Expo Go and Web' ,
150
150
} ,
151
151
{
152
152
title : 'Native module' ,
153
153
value : 'module-legacy' ,
154
+ description : 'bridge for native APIs to JS' ,
154
155
} ,
155
156
{
156
- title : 'Fabric view with backward compat (experimental)' ,
157
- value : 'view-mixed' ,
157
+ title : 'Native view' ,
158
+ value : 'view-legacy' ,
159
+ description : 'bridge for native views to JS' ,
158
160
} ,
159
161
{
160
- title : 'Fabric view (experimental)' ,
161
- value : 'view-new' ,
162
+ title : 'Turbo module with backward compat' ,
163
+ value : 'module-mixed' ,
164
+ description : BACKCOMPAT_DESCRIPTION ,
162
165
} ,
163
- { title : 'Native view' , value : 'view-legacy' } ,
164
- { title : 'JavaScript library' , value : 'library' } ,
165
- ] ;
166
-
167
- const EXAMPLE_CHOICES : { title : string ; value : ProjectExample } [ ] = [
168
- { title : 'JavaScript only (with Expo and Web support)' , value : 'expo' } ,
169
166
{
170
- title : 'Native (to use other libraries with native code)' ,
171
- value : 'native' ,
167
+ title : 'Turbo module' ,
168
+ value : 'module-new' ,
169
+ description : NEWARCH_DESCRIPTION ,
170
+ } ,
171
+ {
172
+ title : 'Fabric view with backward compat' ,
173
+ value : 'view-mixed' ,
174
+ description : BACKCOMPAT_DESCRIPTION ,
175
+ } ,
176
+ {
177
+ title : 'Fabric view' ,
178
+ value : 'view-new' ,
179
+ description : NEWARCH_DESCRIPTION ,
172
180
} ,
173
181
] ;
174
182
@@ -205,10 +213,6 @@ const args: Record<ArgName, yargs.Options> = {
205
213
description : 'Type of library you want to develop' ,
206
214
choices : TYPE_CHOICES . map ( ( { value } ) => value ) ,
207
215
} ,
208
- 'example' : {
209
- description : 'Type of example app' ,
210
- choices : EXAMPLE_CHOICES . map ( ( { value } ) => value ) ,
211
- } ,
212
216
'react-native-version' : {
213
217
description : 'Version of React Native to use, uses latest if not specified' ,
214
218
type : 'string' ,
@@ -362,12 +366,6 @@ async function create(argv: yargs.Arguments<any>) {
362
366
} ) ;
363
367
} ,
364
368
} ,
365
- 'example' : {
366
- type : ( _ , values ) => ( values . type === 'library' ? 'select' : null ) ,
367
- name : 'example' ,
368
- message : 'What type of example app do you want to generate?' ,
369
- choices : EXAMPLE_CHOICES ,
370
- } ,
371
369
} ;
372
370
373
371
const {
@@ -379,7 +377,6 @@ async function create(argv: yargs.Arguments<any>) {
379
377
repoUrl,
380
378
type = 'module-mixed' ,
381
379
languages = type === 'library' ? 'js' : 'java-objc' ,
382
- example = 'native' ,
383
380
reactNativeVersion,
384
381
} = {
385
382
...argv ,
@@ -456,6 +453,7 @@ async function create(argv: yargs.Arguments<any>) {
456
453
? 'mixed'
457
454
: 'legacy' ;
458
455
456
+ const example = type === 'library' ? 'expo' : 'native' ;
459
457
const project = slug . replace ( / ^ ( r e a c t - n a t i v e - | @ [ ^ / ] + \/ ) / , '' ) ;
460
458
461
459
let namespace : string | undefined ;
@@ -555,15 +553,7 @@ async function create(argv: yargs.Arguments<any>) {
555
553
556
554
if ( languages === 'js' ) {
557
555
await copyDir ( JS_FILES , folder ) ;
558
-
559
- if ( example === 'expo' ) {
560
- await copyDir ( EXPO_FILES , folder ) ;
561
- } else {
562
- await copyDir (
563
- path . join ( EXAMPLE_FILES , 'example' ) ,
564
- path . join ( folder , 'example' )
565
- ) ;
566
- }
556
+ await copyDir ( EXPO_FILES , folder ) ;
567
557
} else {
568
558
await copyDir (
569
559
path . join ( EXAMPLE_FILES , 'example' ) ,
0 commit comments