@@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url';
55import spawn from 'cross-spawn' ;
66import minimist from 'minimist' ;
77import * as p from '@clack/prompts' ;
8- import { blue , cyan , magenta , red , reset , yellow } from 'kolorist' ;
8+ import { blue , cyan , magenta , yellow } from 'kolorist' ;
99
1010// Avoids autoconversion to number of the project name by defining that the args
1111// non associated with an option ( _ ) needs to be parsed as a string. See #4606
@@ -83,9 +83,9 @@ const defaultTargetDir = 'pp-project';
8383
8484async function init ( ) {
8585 const argTargetDir = formatTargetDir ( argv . _ [ 0 ] ) ;
86- const argTemplate = argv . template || argv . t ;
86+ const argTemplate = argv . template ?? argv . t ;
8787
88- let targetDir = argTargetDir || defaultTargetDir ;
88+ let targetDir = argTargetDir ?? defaultTargetDir ;
8989 const getProjectName = ( ) => ( targetDir === '.' ? path . basename ( path . resolve ( ) ) : targetDir ) ;
9090
9191 p . intro ( 'Create PP Dev Project' ) ;
@@ -110,7 +110,7 @@ async function init() {
110110 process . exit ( 0 ) ;
111111 }
112112
113- targetDir = formatTargetDir ( projectName ) || defaultTargetDir ;
113+ targetDir = formatTargetDir ( projectName ) ?? defaultTargetDir ;
114114 }
115115
116116 if ( fs . existsSync ( targetDir ) && ! isEmpty ( targetDir ) ) {
@@ -197,7 +197,7 @@ async function init() {
197197 }
198198
199199 // determine template
200- const template = selectedVariant || framework . name || argTemplate || 'vanilla' ;
200+ const template = selectedVariant ?? framework . name ?? argTemplate ?? 'vanilla' ;
201201
202202 const pkgInfo = pkgFromUserAgent ( process . env . npm_config_user_agent ) ;
203203 const pkgManager = pkgInfo ? pkgInfo . name : 'npm' ;
@@ -258,14 +258,14 @@ async function init() {
258258 write ( file ) ;
259259 }
260260
261- const pkg = JSON . parse ( fs . readFileSync ( path . join ( templateDir , ` package.json` ) , 'utf-8' ) ) ;
261+ const pkg = JSON . parse ( fs . readFileSync ( path . join ( templateDir , ' package.json' ) , 'utf-8' ) ) ;
262262
263263 pkg . name = packageName || getProjectName ( ) ;
264264
265265 write ( 'package.json' , JSON . stringify ( pkg , null , 2 ) + '\n' ) ;
266266
267267 const addCursorRules = await p . confirm ( {
268- message : 'Add cursor rules?' ,
268+ message : 'Add Cursor rules?' ,
269269 } ) ;
270270
271271 const cdProjectName = path . relative ( cwd , root ) ;
@@ -315,7 +315,7 @@ async function init() {
315315
316316 p . outro ( 'Project created successfully! 🎉' ) ;
317317
318- console . log ( ` \nNext steps:\n` ) ;
318+ console . log ( ' \nNext steps:\n' ) ;
319319
320320 if ( root !== cwd ) {
321321 console . log ( ` cd ${ cdProjectName . includes ( ' ' ) ? `"${ cdProjectName } "` : cdProjectName } ` ) ;
0 commit comments