diff --git a/index.ts b/index.ts index da5d99f9..4d77d090 100755 --- a/index.ts +++ b/index.ts @@ -100,6 +100,7 @@ type PromptResult = { features?: (typeof FEATURE_OPTIONS)[number]['value'][] e2eFramework?: 'cypress' | 'nightwatch' | 'playwright' experimentFeatures?: (typeof EXPERIMENTAL_FEATURE_OPTIONS)[number]['value'][] + needsBareboneTemplates?: boolean } function isValidPackageName(projectName) { @@ -251,6 +252,9 @@ async function init() { features: [], e2eFramework: undefined, experimentFeatures: [], + + // TODO: default to true sometime in the future + needsBareboneTemplates: false, } intro( @@ -352,7 +356,19 @@ async function init() { ) } - const { features, experimentFeatures } = result + if (argv.bare) { + result.needsBareboneTemplates = true + } else if (!isFeatureFlagsUsed) { + result.needsBareboneTemplates = await unwrapPrompt( + confirm({ + message: language.needsBareboneTemplates.message, + // TODO: default to true sometime in the future + initialValue: false, + }), + ) + } + + const { features, experimentFeatures, needsBareboneTemplates } = result const needsTypeScript = argv.ts || argv.typescript || features.includes('typescript') const needsJsx = argv.jsx || features.includes('jsx') @@ -562,7 +578,7 @@ async function init() { }, ) - if (argv.bare) { + if (needsBareboneTemplates) { trimBoilerplate(root) render('bare/base') // TODO: refactor the `render` utility to avoid this kind of manual mapping? @@ -629,7 +645,7 @@ async function init() { ) } - if (argv.bare) { + if (needsBareboneTemplates) { removeCSSImport(root, needsTypeScript, needsCypressCT) if (needsRouter) { emptyRouterConfig(root, needsTypeScript) diff --git a/locales/en-US.json b/locales/en-US.json index 57c6790e..d5ab60a6 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -72,6 +72,9 @@ "needsRolldownVite": { "message": "rolldown-vite (experimental)" }, + "needsBareboneTemplates": { + "message": "Skip all example code and start with a blank Vue project?" + }, "errors": { "operationCancelled": "Operation cancelled" }, diff --git a/locales/fr-FR.json b/locales/fr-FR.json index a8b6d1be..3a2f2289 100644 --- a/locales/fr-FR.json +++ b/locales/fr-FR.json @@ -72,6 +72,9 @@ "needsRolldownVite": { "message": "rolldown-vite (expérimental)" }, + "needsBareboneTemplates": { + "message": "Ignorer tout le code d'exemple et commencer avec un projet Vue vierge\u00a0?" + }, "errors": { "operationCancelled": "Operation annulée" }, diff --git a/locales/tr-TR.json b/locales/tr-TR.json index c42b6823..bafa1893 100644 --- a/locales/tr-TR.json +++ b/locales/tr-TR.json @@ -72,6 +72,9 @@ "needsRolldownVite": { "message": "rolldown-vite (deneysel)" }, + "needsBareboneTemplates": { + "message": "Tüm örnek kodları atlayıp boş bir Vue projesi ile başlansın mı?" + }, "errors": { "operationCancelled": "İşlem iptal edildi" }, diff --git a/locales/zh-Hans.json b/locales/zh-Hans.json index db41975c..9fe1e22f 100644 --- a/locales/zh-Hans.json +++ b/locales/zh-Hans.json @@ -72,6 +72,9 @@ "needsRolldownVite": { "message": "rolldown-vite(试验阶段)" }, + "needsBareboneTemplates": { + "message": "跳过所有示例代码,创建一个空白的 Vue 项目?" + }, "errors": { "operationCancelled": "操作取消" }, diff --git a/locales/zh-Hant.json b/locales/zh-Hant.json index 53046101..ec0c1f1a 100644 --- a/locales/zh-Hant.json +++ b/locales/zh-Hant.json @@ -72,6 +72,9 @@ "needsRolldownVite": { "message": "rolldown-vite(試驗性功能)" }, + "needsBareboneTemplates": { + "message": "跳過所有範例程式碼,建立一個空白的 Vue 專案?" + }, "errors": { "operationCancelled": "操作取消" }, diff --git a/template/bare/base/src/App.vue b/template/bare/base/src/App.vue index d3d95dda..6ec9f603 100644 --- a/template/bare/base/src/App.vue +++ b/template/bare/base/src/App.vue @@ -2,6 +2,10 @@ diff --git a/template/bare/typescript/src/App.vue b/template/bare/typescript/src/App.vue index 9a8afec5..abfd315f 100644 --- a/template/bare/typescript/src/App.vue +++ b/template/bare/typescript/src/App.vue @@ -2,6 +2,10 @@ diff --git a/utils/getLanguage.ts b/utils/getLanguage.ts index ade2c606..5d81d2a0 100644 --- a/utils/getLanguage.ts +++ b/utils/getLanguage.ts @@ -41,6 +41,7 @@ interface Language { needsExperimentalFeatures: LanguageItem needsOxlint: LanguageItem needsRolldownVite: LanguageItem + needsBareboneTemplates: LanguageItem errors: { operationCancelled: string }