Skip to content

Commit a88203d

Browse files
committed
chore: merge branch 'dev' into next-minor
2 parents 2e20b7a + 3e16924 commit a88203d

File tree

22 files changed

+111
-70
lines changed

22 files changed

+111
-70
lines changed

packages/@vue/cli-ui-addon-webpack/src/components/WebpackDashboard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export default {
9696
.title
9797
color lighten($vue-ui-color-dark, 60%)
9898
font-size 20px
99-
font-weight lighter
99+
font-weight 300
100100
text-align center
101101
margin-bottom $padding-item
102102
@@ -108,7 +108,7 @@ export default {
108108
.info-block
109109
v-box()
110110
box-center()
111-
font-weight lighter
111+
font-weight 300
112112
text-align center
113113
114114
.label

packages/@vue/cli-ui-addon-widgets/src/components/Welcome.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default {
6969
7070
.title
7171
font-size 32px
72-
font-weight lighter
72+
font-weight 300
7373
text-align center
7474
margin-bottom ($padding-item * 2)
7575

packages/@vue/cli-ui/apollo-server/connectors/logs.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/** @typedef {'warn' | 'error' | 'info' | 'done'} LogType */
2+
3+
/**
4+
* @typedef Log
5+
* @prop {string} id
6+
* @prop {string} date
7+
* @prop {LogType} type
8+
* @prop {string} tag
9+
* @prop {string} message
10+
*/
11+
112
const shortId = require('shortid')
213
const { events } = require('@vue/cli-shared-utils/lib/logger')
314
const { generateTitle } = require('@vue/cli/lib/util/clearConsole')
@@ -6,9 +17,15 @@ const channels = require('../channels')
617
// Context
718
const getContext = require('../context')
819

20+
/** @type {Log []} */
921
let logs = []
1022

23+
/**
24+
* @param {Log} log
25+
* @param {any} context
26+
*/
1127
exports.add = function (log, context) {
28+
/** @type {Log} */
1229
const item = {
1330
id: shortId.generate(),
1431
date: new Date().toISOString(),

packages/@vue/cli-ui/apollo-server/connectors/projects.js

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const Creator = require('@vue/cli/lib/Creator')
55
const { getPromptModules } = require('@vue/cli/lib/util/createTools')
66
const { getFeatures } = require('@vue/cli/lib/util/features')
77
const { defaults } = require('@vue/cli/lib/options')
8-
const { toShortPluginId, clearModule } = require('@vue/cli-shared-utils')
8+
const { toShortPluginId, execa } = require('@vue/cli-shared-utils')
99
const { progress: installProgress } = require('@vue/cli/lib/util/installDeps')
1010
const parseGitConfig = require('parse-git-config')
1111
// Connectors
@@ -15,6 +15,7 @@ const prompts = require('./prompts')
1515
const folders = require('./folders')
1616
const plugins = require('./plugins')
1717
const locales = require('./locales')
18+
const logs = require('./logs')
1819
// Context
1920
const getContext = require('../context')
2021
// Utils
@@ -258,52 +259,23 @@ async function create (input, context) {
258259

259260
const targetDir = path.join(cwd.get(), input.folder)
260261

261-
// Delete existing folder
262-
if (fs.existsSync(targetDir)) {
263-
if (input.force) {
264-
setProgress({
265-
info: 'Cleaning folder...'
266-
})
267-
await folders.delete(targetDir)
268-
setProgress({
269-
info: null
270-
})
271-
} else {
272-
throw new Error(`Folder ${targetDir} already exists`)
273-
}
274-
}
275-
276262
cwd.set(targetDir, context)
277263
creator.context = targetDir
278264

279-
process.env.VUE_CLI_CONTEXT = targetDir
280-
clearModule('@vue/cli-service/webpack.config.js', targetDir)
281-
282265
const inCurrent = input.folder === '.'
283-
const name = inCurrent ? path.relative('../', process.cwd()) : input.folder
284-
creator.name = name.toLowerCase()
266+
const name = creator.name = (inCurrent ? path.relative('../', process.cwd()) : input.folder).toLowerCase()
285267

286268
// Answers
287269
const answers = prompts.getAnswers()
288270
await prompts.reset()
289-
let index
290271

291272
// Config files
273+
let index
292274
if ((index = answers.features.indexOf('use-config-files')) !== -1) {
293275
answers.features.splice(index, 1)
294276
answers.useConfigFiles = 'files'
295277
}
296278

297-
const createOptions = {
298-
packageManager: input.packageManager
299-
}
300-
// Git
301-
if (input.enableGit && input.gitCommitMessage) {
302-
createOptions.git = input.gitCommitMessage
303-
} else {
304-
createOptions.git = input.enableGit
305-
}
306-
307279
// Preset
308280
answers.preset = input.preset
309281
if (input.save) {
@@ -329,7 +301,49 @@ async function create (input, context) {
329301
})
330302

331303
// Create
332-
await creator.create(createOptions, preset)
304+
const args = [
305+
'--skipGetStarted'
306+
]
307+
if (input.packageManager) args.push('--packageManager', input.packageManager)
308+
if (input.bar) args.push('--bare')
309+
if (input.force) args.push('--force')
310+
// Git
311+
if (input.enableGit && input.gitCommitMessage) {
312+
args.push('--git', input.gitCommitMessage)
313+
} else if (!input.enableGit) {
314+
args.push('--no-git')
315+
}
316+
// Preset
317+
args.push('--inlinePreset', JSON.stringify(preset))
318+
319+
log('create', name, args)
320+
321+
const child = execa('vue', [
322+
'create',
323+
name,
324+
...args
325+
], {
326+
cwd: cwd.get(),
327+
stdio: ['inherit', 'pipe', 'inherit']
328+
})
329+
330+
const onData = buffer => {
331+
const text = buffer.toString().trim()
332+
if (text) {
333+
setProgress({
334+
info: text
335+
})
336+
logs.add({
337+
type: 'info',
338+
message: text
339+
}, context)
340+
}
341+
}
342+
343+
child.stdout.on('data', onData)
344+
345+
await child
346+
333347
removeCreator()
334348

335349
notify({

packages/@vue/cli-ui/apollo-server/schema/project.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ enum ProjectType {
4444
input ProjectCreateInput {
4545
folder: String!
4646
force: Boolean!
47+
bare: Boolean!
4748
packageManager: PackageManager
4849
preset: String!
4950
remote: String

packages/@vue/cli-ui/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@
280280
"options": {
281281
"label": "Additional options",
282282
"force": "Overwrite target folder if it exists",
283+
"bare": "Scaffold project without beginner instructions",
283284
"git-title": "Git repository",
284285
"git": "Initialize git repository (recommended)",
285286
"git-commit-message": "Initial commit message (optional)"

packages/@vue/cli-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"@vue/cli-plugin-eslint": "^3.5.1",
6767
"@vue/cli-service": "^3.5.3",
6868
"@vue/eslint-config-standard": "^4.0.0",
69-
"@vue/ui": "^0.5.5",
69+
"@vue/ui": "^0.8.2",
7070
"ansi_up": "^3.0.0",
7171
"cross-env": "^5.1.5",
7272
"eslint": "^5.8.0",

packages/@vue/cli-ui/src/components/app/ProgressScreen.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@
3232
</div>
3333

3434
<div class="secondary-info">
35-
<div v-if="progress.info" class="info">
36-
{{ progress.info }}
37-
</div>
35+
<div
36+
v-if="progress.info"
37+
class="info"
38+
v-html="ansiColors(progress.info)"
39+
/>
3840

3941
<VueLoadingBar
4042
v-if="progress.progress !== -1"

packages/@vue/cli-ui/src/components/app/ProjectQuickDropdown.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
:value="projectCurrent.favorite"
1414
:icon="projectCurrent.favorite ? 'star' : 'star_border'"
1515
class="extend-left"
16-
@input="toggleCurrentFavorite()"
16+
@update="toggleCurrentFavorite()"
1717
>
1818
{{ $t('org.vue.components.project-select-list-item.tooltips.favorite') }}
1919
</VueSwitch>

packages/@vue/cli-ui/src/components/app/TopBar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
3232
.title
3333
font-size 28px
34-
font-weight lighter
34+
font-weight 300
3535
</style>

packages/@vue/cli-ui/src/components/content/StepWizard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export default {
112112
padding $padding-item
113113
font-size 24px
114114
text-align center
115-
font-weight lighter
115+
font-weight 300
116116
117117
&.hide-tabs
118118
>>> .tabs

packages/@vue/cli-ui/src/components/project-create/ProjectCreate.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@
108108
>
109109
{{ $t('org.vue.views.project-create.tabs.details.form.options.force') }}
110110
</VueSwitch>
111+
112+
<VueSwitch
113+
v-model="formData.bare"
114+
class="extend-left bare"
115+
>
116+
{{ $t('org.vue.views.project-create.tabs.details.form.options.bare') }}
117+
</VueSwitch>
111118
</VueFormField>
112119

113120
<VueFormField
@@ -466,6 +473,7 @@ function formDataFactory () {
466473
return {
467474
folder: '',
468475
force: false,
476+
bare: false,
469477
enableGit: true,
470478
gitCommitMessage: '',
471479
packageManager: undefined,
@@ -629,6 +637,7 @@ export default {
629637
input: {
630638
folder: this.formData.folder,
631639
force: this.formData.force,
640+
bare: this.formData.bare,
632641
enableGit: this.formData.enableGit,
633642
gitCommitMessage: this.formData.gitCommitMessage,
634643
packageManager: this.formData.packageManager,

packages/@vue/cli-ui/src/components/prompt/PromptCheckbox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
:value="isCheckboxSelected(choice)"
1717
:disabled="choice.disabled"
1818
class="right"
19-
@input="value => asnwerCheckbox(choice, value)"
19+
@update="value => asnwerCheckbox(choice, value)"
2020
>
2121
{{ $t(choice.name) }}
2222
</VueSwitch>

packages/@vue/cli-ui/src/components/prompt/PromptColor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<VueInput
1717
slot="trigger"
1818
:value="value(prompt.value)"
19-
@input="value => answer(value)"
19+
@update="value => answer(value)"
2020
>
2121
<div slot="right" class="color-preview">
2222
<div class="color-swatch" :style="{

packages/@vue/cli-ui/src/components/prompt/PromptConfirm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<VueSwitch
77
:value="value(prompt.value)"
88
class="extend-left"
9-
@input="value => answer(value)"
9+
@update="value => answer(value)"
1010
>
1111
<ListItemInfo
1212
:name="$t(prompt.message)"

packages/@vue/cli-ui/src/components/prompt/PromptInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<VueInput
1515
:value="value(prompt.value)"
1616
:type="prompt.type === 'password' ? 'password' : 'text'"
17-
@input="value => answer(value)"
17+
@update="value => answer(value)"
1818
/>
1919
</div>
2020
</div>

packages/@vue/cli-ui/src/components/prompt/PromptList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="prompt-input">
1414
<VueSelect
1515
:value="value(prompt.value)"
16-
@input="value => answer(value)"
16+
@update="value => answer(value)"
1717
>
1818
<VueSelectButton
1919
v-for="(choice, index) of prompt.choices"

packages/@vue/cli-ui/src/components/prompt/PromptsList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default {
7979
.group-name
8080
padding $padding-item $padding-item ($padding-item / 2)
8181
font-size 1.6em
82-
font-weight lighter
82+
font-weight 300
8383
color $vue-ui-color-accent
8484
.vue-ui-dark-mode &
8585
color lighten($vue-ui-color-accent, 60%)

packages/@vue/cli-ui/src/i18n.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function autoDetect () {
5454
name: 'VueTimeago',
5555
locale: i18n.locale,
5656
locales: {
57-
[i18n.locale]: require(`date-fns/locale/${dateFnsLocale}`)
57+
[i18n.locale]: require(`date-fns/locale/${dateFnsLocale}/index.js`)
5858
}
5959
}))
6060
}

packages/@vue/cli/bin/vue.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ program
6363
.option('-c, --clone', 'Use git clone when fetching remote preset')
6464
.option('-x, --proxy', 'Use specified proxy when creating project')
6565
.option('-b, --bare', 'Scaffold project without beginner instructions')
66+
.option('--skipGetStarted', 'Skip displaying "Get started" instructions')
6667
.action((name, cmd) => {
6768
const options = cleanArgs(cmd)
6869

packages/@vue/cli/lib/Creator.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,13 @@ module.exports = class Creator extends EventEmitter {
210210
stopSpinner()
211211
log()
212212
log(`🎉 Successfully created project ${chalk.yellow(name)}.`)
213-
log(
214-
`👉 Get started with the following commands:\n\n` +
215-
(this.context === process.cwd() ? `` : chalk.cyan(` ${chalk.gray('$')} cd ${name}\n`)) +
216-
chalk.cyan(` ${chalk.gray('$')} ${packageManager === 'yarn' ? 'yarn serve' : 'npm run serve'}`)
217-
)
213+
if (!cliOptions.skipGetStarted) {
214+
log(
215+
`👉 Get started with the following commands:\n\n` +
216+
(this.context === process.cwd() ? `` : chalk.cyan(` ${chalk.gray('$')} cd ${name}\n`)) +
217+
chalk.cyan(` ${chalk.gray('$')} ${packageManager === 'yarn' ? 'yarn serve' : 'npm run serve'}`)
218+
)
219+
}
218220
log()
219221
this.emit('creation', { event: 'done' })
220222

0 commit comments

Comments
 (0)