@@ -78,6 +78,7 @@ async function init() {
78
78
// --playwright
79
79
// --eslint
80
80
// --eslint-with-prettier (only support prettier through eslint for simplicity)
81
+ // --tailwind
81
82
// --force (for force overwriting)
82
83
const argv = minimist ( process . argv . slice ( 2 ) , {
83
84
alias : {
@@ -102,7 +103,8 @@ async function init() {
102
103
argv . vitest ??
103
104
argv . cypress ??
104
105
argv . playwright ??
105
- argv . eslint
106
+ argv . eslint ??
107
+ argv . tailwind
106
108
) === 'boolean'
107
109
108
110
let targetDir = argv . _ [ 0 ]
@@ -122,6 +124,7 @@ async function init() {
122
124
needsE2eTesting ? : false | 'cypress' | 'playwright'
123
125
needsEslint ? : boolean
124
126
needsPrettier ? : boolean
127
+ needsTailwind ? : boolean
125
128
} = { }
126
129
127
130
try {
@@ -137,6 +140,7 @@ async function init() {
137
140
// - Add Playwright for end-to-end testing?
138
141
// - Add ESLint for code quality?
139
142
// - Add Prettier for code formatting?
143
+ // - Add Tailwind for styling?
140
144
result = await prompts (
141
145
[
142
146
{
@@ -252,6 +256,14 @@ async function init() {
252
256
initial : false ,
253
257
active : 'Yes' ,
254
258
inactive : 'No'
259
+ } ,
260
+ {
261
+ name : 'needsTailwind' ,
262
+ type : ( ) => ( isFeatureFlagsUsed ? null : 'toggle' ) ,
263
+ message : 'Add TailwindCss for styling?' ,
264
+ initial : false ,
265
+ active : 'Yes' ,
266
+ inactive : 'No'
255
267
}
256
268
] ,
257
269
{
@@ -277,7 +289,8 @@ async function init() {
277
289
needsPinia = argv . pinia ,
278
290
needsVitest = argv . vitest || argv . tests ,
279
291
needsEslint = argv . eslint || argv [ 'eslint-with-prettier' ] ,
280
- needsPrettier = argv [ 'eslint-with-prettier' ]
292
+ needsPrettier = argv [ 'eslint-with-prettier' ] ,
293
+ needsTailwind = argv [ 'tailwind' ]
281
294
} = result
282
295
283
296
const { needsE2eTesting } = result
@@ -357,6 +370,11 @@ async function init() {
357
370
renderEslint ( root , { needsTypeScript, needsCypress, needsCypressCT, needsPrettier } )
358
371
}
359
372
373
+ // Render tailwind config
374
+ if ( needsTailwind ) {
375
+ render ( 'config/tailwind' )
376
+ }
377
+
360
378
// Render code template.
361
379
// prettier-ignore
362
380
const codeTemplate =
@@ -440,14 +458,17 @@ async function init() {
440
458
needsCypress,
441
459
needsPlaywright,
442
460
needsCypressCT,
443
- needsEslint
461
+ needsEslint,
462
+ needsTailwind
444
463
} )
445
464
)
446
465
447
466
console . log ( `\nDone. Now run:\n` )
448
467
if ( root !== cwd ) {
449
468
const cdProjectName = path . relative ( cwd , root )
450
- console . log ( ` ${ bold ( green ( `cd ${ cdProjectName . includes ( ' ' ) ? `"${ cdProjectName } "` : cdProjectName } ` ) ) } ` )
469
+ console . log (
470
+ ` ${ bold ( green ( `cd ${ cdProjectName . includes ( ' ' ) ? `"${ cdProjectName } "` : cdProjectName } ` ) ) } `
471
+ )
451
472
}
452
473
console . log ( ` ${ bold ( green ( getCommand ( packageManager , 'install' ) ) ) } ` )
453
474
if ( needsPrettier ) {
0 commit comments