mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-23 04:58:56 -05:00
feat(ui): auto select features
This commit is contained in:
@@ -84,6 +84,13 @@ async function initCreator (context) {
|
||||
installProgress.on('log', onInstallLog)
|
||||
|
||||
// Presets
|
||||
const manualPreset = {
|
||||
id: '__manual__',
|
||||
name: 'views.project-create.tabs.presets.manual.name',
|
||||
description: 'views.project-create.tabs.presets.manual.description',
|
||||
link: null,
|
||||
features: []
|
||||
}
|
||||
const presetsData = creator.getPresets()
|
||||
presets = [
|
||||
...Object.keys(presetsData).map(
|
||||
@@ -103,13 +110,7 @@ async function initCreator (context) {
|
||||
return info
|
||||
}
|
||||
),
|
||||
{
|
||||
id: '__manual__',
|
||||
name: 'views.project-create.tabs.presets.manual.name',
|
||||
description: 'views.project-create.tabs.presets.manual.description',
|
||||
link: null,
|
||||
features: []
|
||||
}
|
||||
manualPreset
|
||||
]
|
||||
|
||||
// Features
|
||||
@@ -122,7 +123,7 @@ async function initCreator (context) {
|
||||
description: data.description || null,
|
||||
link: data.link || null,
|
||||
plugins: data.plugins || null,
|
||||
enabled: false
|
||||
enabled: !!data.checked
|
||||
})
|
||||
),
|
||||
{
|
||||
@@ -135,6 +136,12 @@ async function initCreator (context) {
|
||||
}
|
||||
]
|
||||
|
||||
manualPreset.features = features.filter(
|
||||
f => f.enabled
|
||||
).map(
|
||||
f => f.id
|
||||
)
|
||||
|
||||
// Prompts
|
||||
await prompts.reset()
|
||||
creator.injectedPrompts.forEach(prompts.add)
|
||||
|
||||
Reference in New Issue
Block a user