@@ -68,6 +68,7 @@ async function init() {
68
68
// --with-tests / --tests (equals to `--vitest --cypress`)
69
69
// --vitest
70
70
// --cypress
71
+ // --playwright
71
72
// --eslint
72
73
// --eslint-with-prettier (only support prettier through eslint for simplicity)
73
74
// --force (for force overwriting)
@@ -92,6 +93,7 @@ async function init() {
92
93
argv . tests ??
93
94
argv . vitest ??
94
95
argv . cypress ??
96
+ argv . playwright ??
95
97
argv . eslint
96
98
) === 'boolean'
97
99
@@ -110,6 +112,7 @@ async function init() {
110
112
needsPinia ? : boolean
111
113
needsVitest ? : boolean
112
114
needsCypress ? : boolean
115
+ needsPlaywright ? : boolean
113
116
needsEslint ? : boolean
114
117
needsPrettier ? : boolean
115
118
} = { }
@@ -124,6 +127,7 @@ async function init() {
124
127
// - Install Vue Router for SPA development?
125
128
// - Install Pinia for state management?
126
129
// - Add Cypress for testing?
130
+ // - Add Playwright for end-to-end testing?
127
131
// - Add ESLint for code quality?
128
132
// - Add Prettier for code formatting?
129
133
result = await prompts (
@@ -212,6 +216,19 @@ async function init() {
212
216
active : 'Yes' ,
213
217
inactive : 'No'
214
218
} ,
219
+ {
220
+ name : 'needsPlaywright' ,
221
+ type : ( prev , values ) => {
222
+ if ( isFeatureFlagsUsed || values . needsCypress ) {
223
+ return null
224
+ }
225
+ return 'toggle'
226
+ } ,
227
+ message : 'Add Playwright for End-to-End testing?' ,
228
+ initial : false ,
229
+ active : 'Yes' ,
230
+ inactive : 'No'
231
+ } ,
215
232
{
216
233
name : 'needsEslint' ,
217
234
type : ( ) => ( isFeatureFlagsUsed ? null : 'toggle' ) ,
@@ -256,6 +273,7 @@ async function init() {
256
273
needsRouter = argv . router ,
257
274
needsPinia = argv . pinia ,
258
275
needsCypress = argv . cypress || argv . tests ,
276
+ needsPlaywright = argv . playwright ,
259
277
needsVitest = argv . vitest || argv . tests ,
260
278
needsEslint = argv . eslint || argv [ 'eslint-with-prettier' ] ,
261
279
needsPrettier = argv [ 'eslint-with-prettier' ]
@@ -306,6 +324,9 @@ async function init() {
306
324
if ( needsCypressCT ) {
307
325
render ( 'config/cypress-ct' )
308
326
}
327
+ if ( needsPlaywright ) {
328
+ render ( 'config/playwright' )
329
+ }
309
330
if ( needsTypeScript ) {
310
331
render ( 'config/typescript' )
311
332
@@ -408,6 +429,7 @@ async function init() {
408
429
needsTypeScript,
409
430
needsVitest,
410
431
needsCypress,
432
+ needsPlaywright,
411
433
needsCypressCT,
412
434
needsEslint
413
435
} )
0 commit comments