@@ -71,7 +71,6 @@ type ArgName =
7171 | 'repo-url'
7272 | 'languages'
7373 | 'type'
74- | 'example'
7574 | 'react-native-version' ;
7675
7776type ProjectLanguages =
@@ -91,8 +90,6 @@ type ProjectType =
9190 | 'view-legacy'
9291 | 'library' ;
9392
94- type ProjectExample = 'expo' | 'native' ;
95-
9693type Answers = {
9794 slug : string ;
9895 description : string ;
@@ -102,7 +99,6 @@ type Answers = {
10299 repoUrl : string ;
103100 languages : ProjectLanguages ;
104101 type ?: ProjectType ;
105- example ?: ProjectExample ;
106102 reactNativeVersion ?: string ;
107103} ;
108104
@@ -139,36 +135,48 @@ const LANGUAGE_CHOICES: {
139135 } ,
140136] ;
141137
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+ } [ ] = [
147146 {
148- title : 'Turbo module (experimental)' ,
149- value : 'module-new' ,
147+ title : 'JavaScript library' ,
148+ value : 'library' ,
149+ description : 'supports Expo Go and Web' ,
150150 } ,
151151 {
152152 title : 'Native module' ,
153153 value : 'module-legacy' ,
154+ description : 'bridge for native APIs to JS' ,
154155 } ,
155156 {
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' ,
158160 } ,
159161 {
160- title : 'Fabric view (experimental)' ,
161- value : 'view-new' ,
162+ title : 'Turbo module with backward compat' ,
163+ value : 'module-mixed' ,
164+ description : BACKCOMPAT_DESCRIPTION ,
162165 } ,
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' } ,
169166 {
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 ,
172180 } ,
173181] ;
174182
@@ -205,10 +213,6 @@ const args: Record<ArgName, yargs.Options> = {
205213 description : 'Type of library you want to develop' ,
206214 choices : TYPE_CHOICES . map ( ( { value } ) => value ) ,
207215 } ,
208- 'example' : {
209- description : 'Type of example app' ,
210- choices : EXAMPLE_CHOICES . map ( ( { value } ) => value ) ,
211- } ,
212216 'react-native-version' : {
213217 description : 'Version of React Native to use, uses latest if not specified' ,
214218 type : 'string' ,
@@ -362,12 +366,6 @@ async function create(argv: yargs.Arguments<any>) {
362366 } ) ;
363367 } ,
364368 } ,
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- } ,
371369 } ;
372370
373371 const {
@@ -379,7 +377,6 @@ async function create(argv: yargs.Arguments<any>) {
379377 repoUrl,
380378 type = 'module-mixed' ,
381379 languages = type === 'library' ? 'js' : 'java-objc' ,
382- example = 'native' ,
383380 reactNativeVersion,
384381 } = {
385382 ...argv ,
@@ -456,6 +453,7 @@ async function create(argv: yargs.Arguments<any>) {
456453 ? 'mixed'
457454 : 'legacy' ;
458455
456+ const example = type === 'library' ? 'expo' : 'native' ;
459457 const project = slug . replace ( / ^ ( r e a c t - n a t i v e - | @ [ ^ / ] + \/ ) / , '' ) ;
460458
461459 let namespace : string | undefined ;
@@ -555,15 +553,7 @@ async function create(argv: yargs.Arguments<any>) {
555553
556554 if ( languages === 'js' ) {
557555 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 ) ;
567557 } else {
568558 await copyDir (
569559 path . join ( EXAMPLE_FILES , 'example' ) ,
0 commit comments