File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -578,22 +578,19 @@ async function init() {
578578 } ,
579579 )
580580
581+ const bareTemplateConfig = [
582+ { condition : needsTypeScript , template : 'bare/typescript' } ,
583+ { condition : needsVitest , template : 'bare/vitest' } ,
584+ { condition : needsCypressCT , template : 'bare/cypress-ct' } ,
585+ { condition : needsNightwatchCT , template : 'bare/nightwatch-ct' } ,
586+ ]
587+
581588 if ( needsBareboneTemplates ) {
582589 trimBoilerplate ( root )
583590 render ( 'bare/base' )
584- // TODO: refactor the `render` utility to avoid this kind of manual mapping?
585- if ( needsTypeScript ) {
586- render ( 'bare/typescript' )
587- }
588- if ( needsVitest ) {
589- render ( 'bare/vitest' )
590- }
591- if ( needsCypressCT ) {
592- render ( 'bare/cypress-ct' )
593- }
594- if ( needsNightwatchCT ) {
595- render ( 'bare/nightwatch-ct' )
596- }
591+ bareTemplateConfig . forEach ( ( { condition, template } ) => {
592+ if ( condition ) render ( template )
593+ } )
597594 }
598595
599596 // Cleanup.
You can’t perform that action at this time.
0 commit comments