@@ -100,6 +100,7 @@ type PromptResult = {
100
100
features ?: ( typeof FEATURE_OPTIONS ) [ number ] [ 'value' ] [ ]
101
101
e2eFramework ?: 'cypress' | 'nightwatch' | 'playwright'
102
102
experimentFeatures ?: ( typeof EXPERIMENTAL_FEATURE_OPTIONS ) [ number ] [ 'value' ] [ ]
103
+ needsBareboneTemplates ?: boolean
103
104
}
104
105
105
106
function isValidPackageName ( projectName ) {
@@ -251,6 +252,9 @@ async function init() {
251
252
features : [ ] ,
252
253
e2eFramework : undefined ,
253
254
experimentFeatures : [ ] ,
255
+
256
+ // TODO: default to true sometime in the future
257
+ needsBareboneTemplates : false ,
254
258
}
255
259
256
260
intro (
@@ -352,7 +356,19 @@ async function init() {
352
356
)
353
357
}
354
358
355
- const { features , experimentFeatures } = result
359
+ if ( argv . bare ) {
360
+ result . needsBareboneTemplates = true
361
+ } else if ( ! isFeatureFlagsUsed ) {
362
+ result . needsBareboneTemplates = await unwrapPrompt (
363
+ confirm ( {
364
+ message : language . needsBareboneTemplates . message ,
365
+ // TODO: default to true sometime in the future
366
+ initialValue : false ,
367
+ } ) ,
368
+ )
369
+ }
370
+
371
+ const { features , experimentFeatures , needsBareboneTemplates } = result
356
372
357
373
const needsTypeScript = argv . ts || argv . typescript || features . includes ( 'typescript' )
358
374
const needsJsx = argv . jsx || features . includes ( 'jsx' )
@@ -562,7 +578,7 @@ async function init() {
562
578
} ,
563
579
)
564
580
565
- if ( argv . bare ) {
581
+ if ( needsBareboneTemplates ) {
566
582
trimBoilerplate ( root )
567
583
render ( 'bare/base' )
568
584
// TODO: refactor the `render` utility to avoid this kind of manual mapping?
@@ -629,7 +645,7 @@ async function init() {
629
645
)
630
646
}
631
647
632
- if ( argv . bare ) {
648
+ if ( needsBareboneTemplates ) {
633
649
removeCSSImport ( root , needsTypeScript , needsCypressCT )
634
650
if ( needsRouter ) {
635
651
emptyRouterConfig ( root , needsTypeScript )
0 commit comments