Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add a prompt to skip example code#787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
haoqunjiang merged 3 commits intovuejs:mainfromhaoqunjiang:feat-bare-prompt
Jul 26, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletionsindex.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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) {
Expand DownExpand Up@@ -251,6 +252,9 @@ async function init() {
features: [],
e2eFramework: undefined,
experimentFeatures: [],

// TODO: default to true sometime in the future
needsBareboneTemplates: false,
}

intro(
Expand DownExpand Up@@ -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
Copy link
MemberAuthor

@haoqunjianghaoqunjiangJul 23, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not a must.

But when working on the many experimental features I'm planning, I can't help but think that defaulting to barebone templates would make life easier for those who want to try out these new features.

Demo code is still useful for newcomers and for educational purposes, though.

cexbrayat reacted with thumbs up emoji
initialValue: false,
}),
)
}

const { features, experimentFeatures, needsBareboneTemplates } = result

const needsTypeScript = argv.ts || argv.typescript || features.includes('typescript')
const needsJsx = argv.jsx || features.includes('jsx')
Expand DownExpand Up@@ -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?
Expand DownExpand Up@@ -629,7 +645,7 @@ async function init() {
)
}

if (argv.bare) {
if (needsBareboneTemplates) {
removeCSSImport(root, needsTypeScript, needsCypressCT)
if (needsRouter) {
emptyRouterConfig(root, needsTypeScript)
Expand Down
3 changes: 3 additions & 0 deletionslocales/en-US.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"
},
Expand Down
3 changes: 3 additions & 0 deletionslocales/fr-FR.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"
},
Expand Down
3 changes: 3 additions & 0 deletionslocales/tr-TR.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"
},
Expand Down
3 changes: 3 additions & 0 deletionslocales/zh-Hans.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,6 +72,9 @@
"needsRolldownVite": {
"message": "rolldown-vite(试验阶段)"
},
"needsBareboneTemplates": {
"message": "跳过所有示例代码,创建一个空白的 Vue 项目?"
},
"errors": {
"operationCancelled": "操作取消"
},
Expand Down
3 changes: 3 additions & 0 deletionslocales/zh-Hant.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,6 +72,9 @@
"needsRolldownVite": {
"message": "rolldown-vite(試驗性功能)"
},
"needsBareboneTemplates": {
"message": "跳過所有範例程式碼,建立一個空白的 Vue 專案?"
},
"errors": {
"operationCancelled": "操作取消"
},
Expand Down
4 changes: 4 additions & 0 deletionstemplate/bare/base/src/App.vue
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,10 @@

<template>
<h1>You did it!</h1>
<p>
Visit <a href="https://vuejs.org/" target="_blank" rel="noopener">vuejs.org</a> to read the
documentation
</p>
</template>

<style scoped></style>
4 changes: 4 additions & 0 deletionstemplate/bare/typescript/src/App.vue
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,10 @@

<template>
<h1>You did it!</h1>
<p>
Visit <a href="https://vuejs.org/" target="_blank" rel="noopener">vuejs.org</a> to read the
documentation
</p>
</template>

<style scoped></style>
1 change: 1 addition & 0 deletionsutils/getLanguage.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -41,6 +41,7 @@ interface Language {
needsExperimentalFeatures: LanguageItem
needsOxlint: LanguageItem
needsRolldownVite: LanguageItem
needsBareboneTemplates: LanguageItem
errors: {
operationCancelled: string
}
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp