Skip to content

Commit 0181223

Browse files
author
Guillaume Chau
committed
feat(ui): auto select features
1 parent 7e5bf61 commit 0181223

File tree

1 file changed

+15
-8
lines changed
  • packages/@vue/cli-ui/src/graphql-api/connectors

1 file changed

+15
-8
lines changed

packages/@vue/cli-ui/src/graphql-api/connectors/projects.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ async function initCreator (context) {
8484
installProgress.on('log', onInstallLog)
8585

8686
// Presets
87+
const manualPreset = {
88+
id: '__manual__',
89+
name: 'views.project-create.tabs.presets.manual.name',
90+
description: 'views.project-create.tabs.presets.manual.description',
91+
link: null,
92+
features: []
93+
}
8794
const presetsData = creator.getPresets()
8895
presets = [
8996
...Object.keys(presetsData).map(
@@ -103,13 +110,7 @@ async function initCreator (context) {
103110
return info
104111
}
105112
),
106-
{
107-
id: '__manual__',
108-
name: 'views.project-create.tabs.presets.manual.name',
109-
description: 'views.project-create.tabs.presets.manual.description',
110-
link: null,
111-
features: []
112-
}
113+
manualPreset
113114
]
114115

115116
// Features
@@ -122,7 +123,7 @@ async function initCreator (context) {
122123
description: data.description || null,
123124
link: data.link || null,
124125
plugins: data.plugins || null,
125-
enabled: false
126+
enabled: !!data.checked
126127
})
127128
),
128129
{
@@ -135,6 +136,12 @@ async function initCreator (context) {
135136
}
136137
]
137138

139+
manualPreset.features = features.filter(
140+
f => f.enabled
141+
).map(
142+
f => f.id
143+
)
144+
138145
// Prompts
139146
await prompts.reset()
140147
creator.injectedPrompts.forEach(prompts.add)

0 commit comments

Comments
 (0)