@@ -18,6 +18,7 @@ import generateReadme from './utils/generateReadme'
18
18
import getCommand from './utils/getCommand'
19
19
import getLanguage from './utils/getLanguage'
20
20
import renderEslint from './utils/renderEslint'
21
+ import trimBoilerplate from './utils/trimBoilerplate'
21
22
22
23
function isValidPackageName ( projectName ) {
23
24
return / ^ (?: @ [ a - z 0 - 9 - * ~ ] [ a -z 0 -9 -* ._ ~ ] * \/ ) ? [ a - z 0 - 9 - ~ ] [ a - z 0 - 9 - ._ ~ ] * $ / . test ( projectName )
@@ -83,7 +84,9 @@ async function init() {
83
84
// --playwright
84
85
// --eslint
85
86
// --eslint-with-prettier (only support prettier through eslint for simplicity)
86
- // --force (for force overwriting)
87
+ // in addition to the feature flags, you can also pass the following options:
88
+ // --bare (for a barebone template without example code)
89
+ // --force (for force overwriting without confirming)
87
90
88
91
const args = process . argv . slice ( 2 )
89
92
@@ -319,8 +322,8 @@ async function init() {
319
322
packageName = projectName ?? defaultProjectName ,
320
323
shouldOverwrite = argv . force ,
321
324
needsJsx = argv . jsx ,
322
- needsTypeScript = argv . ts || argv . typescript ,
323
- needsRouter = argv . router || argv [ 'vue-router' ] ,
325
+ needsTypeScript = ( argv . ts || argv . typescript ) as boolean ,
326
+ needsRouter = ( argv . router || argv [ 'vue-router' ] ) as boolean ,
324
327
needsPinia = argv . pinia ,
325
328
needsVitest = argv . vitest || argv . tests ,
326
329
needsPrettier = argv [ 'eslint-with-prettier' ] ,
@@ -563,6 +566,25 @@ async function init() {
563
566
)
564
567
}
565
568
569
+ if ( argv . bare ) {
570
+ trimBoilerplate ( root , { needsTypeScript, needsRouter } )
571
+ render ( 'bare/base' )
572
+
573
+ // TODO: refactor the `render` utility to avoid this kind of manual mapping?
574
+ if ( needsTypeScript ) {
575
+ render ( 'bare/typescript' )
576
+ }
577
+ if ( needsVitest ) {
578
+ render ( 'bare/vitest' )
579
+ }
580
+ if ( needsCypressCT ) {
581
+ render ( 'bare/cypress-ct' )
582
+ }
583
+ if ( needsNightwatchCT ) {
584
+ render ( 'bare/nightwatch-ct' )
585
+ }
586
+ }
587
+
566
588
// Instructions:
567
589
// Supported package managers: pnpm > yarn > bun > npm
568
590
const userAgent = process . env . npm_config_user_agent ?? ''
0 commit comments