File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -69,23 +69,21 @@ export const createSolid = (version: string) =>
6969 } ) ) ,
7070 } ) ,
7171 ) ;
72+ // Don't offer javascript if `projectType` is library
73+ const useJS =
74+ projectType === "library" ? false : ! ( await cancelable ( p . confirm ( { message : "Use Typescript?" } ) ) ) ;
75+
7276 const template_opts = getTemplatesList ( projectType ) ;
7377 template ??= await cancelable (
7478 p . select ( {
7579 message : "Which template would you like to use?" ,
7680 initialValue : "ts" ,
77- options : template_opts . map ( ( s : string ) => ( { label : s , value : s } ) ) ,
81+ options : template_opts . filter ( s => useJS ? s : ! s . startsWith ( "js" ) ) . map ( ( s : string ) => ( { label : s , value : s } ) ) ,
7882 } ) ,
7983 ) ;
80-
81- // Don't transpile project if it's already javascript!
82- const transpileToJS =
83- projectType === "library"
84- ? false
85- : template . startsWith ( "js" )
86- ? false
87- : ! ( await cancelable ( p . confirm ( { message : "Use Typescript?" } ) ) ) ;
88-
84+
85+ // Need to transpile if the user wants Jabascript, but their selected template isn't Javascript
86+ const transpileToJS = useJS && ! template . startsWith ( "js" )
8987 if ( projectType === "start" ) {
9088 await spinnerify ( {
9189 startText : "Creating project" ,
You can’t perform that action at this time.
0 commit comments