@@ -3,24 +3,55 @@ import dedent from 'dedent';
33import type { TemplateConfiguration } from './template' ;
44import kleur from 'kleur' ;
55
6- export async function printNextSteps ( {
7- local,
6+ export function printNonLocalLibNextSteps ( config : TemplateConfiguration ) {
7+ const platforms = {
8+ ios : { name : 'iOS' , color : 'cyan' } ,
9+ android : { name : 'Android' , color : 'green' } ,
10+ ...( config . example === 'expo'
11+ ? ( { web : { name : 'Web' , color : 'blue' } } as const )
12+ : null ) ,
13+ } as const ;
14+
15+ console . log (
16+ dedent ( `
17+ ${ kleur . magenta (
18+ `${ kleur . bold ( 'Get started' ) } with the project`
19+ ) } ${ kleur . gray ( ':' ) }
20+
21+ ${ kleur . gray ( '$' ) } yarn
22+ ${ Object . entries ( platforms )
23+ . map (
24+ ( [ script , { name, color } ] ) => `
25+ ${ kleur [ color ] ( `Run the example app on ${ kleur . bold ( name ) } ` ) } ${ kleur . gray (
26+ ':'
27+ ) }
28+
29+ ${ kleur . gray ( '$' ) } yarn example ${ script } `
30+ )
31+ . join ( '\n' ) }
32+
33+ ${ kleur . yellow (
34+ `See ${ kleur . bold ( 'CONTRIBUTING.md' ) } for more details. Good luck!`
35+ ) }
36+ ` )
37+ ) ;
38+ }
39+
40+ export function printLocalLibNextSteps ( {
841 folder,
942 config,
1043 linkedLocalLibrary,
1144 addedNitro,
1245 packageManager,
1346} : {
14- local : boolean ;
1547 folder : string ;
1648 config : TemplateConfiguration ;
1749 linkedLocalLibrary : boolean ;
1850 addedNitro : boolean ;
1951 packageManager : string ;
2052} ) {
21- if ( local ) {
22- console . log (
23- dedent ( `
53+ console . log (
54+ dedent ( `
2455 ${ kleur . magenta (
2556 `${ kleur . bold ( 'Get started' ) } with the project`
2657 ) } ${ kleur . gray ( ':' ) }
@@ -51,40 +82,7 @@ export async function printNextSteps({
5182
5283 ${ kleur . yellow ( `Good luck!` ) }
5384 ` )
54- ) ;
55- } else {
56- const platforms = {
57- ios : { name : 'iOS' , color : 'cyan' } ,
58- android : { name : 'Android' , color : 'green' } ,
59- ...( config . example === 'expo'
60- ? ( { web : { name : 'Web' , color : 'blue' } } as const )
61- : null ) ,
62- } as const ;
63-
64- console . log (
65- dedent ( `
66- ${ kleur . magenta (
67- `${ kleur . bold ( 'Get started' ) } with the project`
68- ) } ${ kleur . gray ( ':' ) }
69-
70- ${ kleur . gray ( '$' ) } yarn
71- ${ Object . entries ( platforms )
72- . map (
73- ( [ script , { name, color } ] ) => `
74- ${ kleur [ color ] ( `Run the example app on ${ kleur . bold ( name ) } ` ) } ${ kleur . gray (
75- ':'
76- ) }
77-
78- ${ kleur . gray ( '$' ) } yarn example ${ script } `
79- )
80- . join ( '\n' ) }
81-
82- ${ kleur . yellow (
83- `See ${ kleur . bold ( 'CONTRIBUTING.md' ) } for more details. Good luck!`
84- ) }
85- ` )
86- ) ;
87- }
85+ ) ;
8886}
8987
9088export function printErrorHelp ( message : string , error : Error ) {
0 commit comments