chore: Make the logging consistent and pretty (#1925)

This commit is contained in:
Pavan Kumar Sunkara
2018-07-24 16:22:13 +02:00
committed by Evan You
parent 0effec2b97
commit 17f37187f0
3 changed files with 4 additions and 10 deletions

View File

@@ -141,7 +141,6 @@ module.exports = class Creator extends EventEmitter {
}
// run generator
log()
log(`🚀 Invoking generators...`)
this.emit('creation', { event: 'invoking-generators' })
const plugins = await this.resolvePlugins(preset.plugins)
@@ -163,7 +162,6 @@ module.exports = class Creator extends EventEmitter {
}
// run complete cbs if any (injected by generators)
log()
logWithSpinner('⚓', `Running completion hooks...`)
this.emit('creation', { event: 'completion-hooks' })
for (const cb of createCompleteCbs) {

View File

@@ -6,7 +6,6 @@ const {
log,
error,
hasProjectYarn,
stopSpinner,
resolvePluginId,
resolveModule,
loadModule
@@ -30,9 +29,6 @@ async function add (pluginName, options = {}, context = process.cwd()) {
const packageManager = loadOptions().packageManager || (hasProjectYarn(context) ? 'yarn' : 'npm')
await installPackage(context, packageManager, null, packageName)
stopSpinner()
log()
log(`${chalk.green('✔')} Successfully installed plugin: ${chalk.cyan(packageName)}`)
log()

View File

@@ -131,6 +131,7 @@ async function runGenerator (context, plugin, pkg = getPkg(context)) {
if (!isTestOrDebug && depsChanged) {
log(`📦 Installing additional dependencies...`)
log()
const packageManager =
loadOptions().packageManager || (hasProjectYarn(context) ? 'yarn' : 'npm')
await installDeps(context, packageManager)
@@ -141,12 +142,11 @@ async function runGenerator (context, plugin, pkg = getPkg(context)) {
for (const cb of createCompleteCbs) {
await cb()
}
stopSpinner()
log()
}
stopSpinner()
log()
log(` Successfully invoked generator for plugin: ${chalk.cyan(plugin.id)}`)
log(`${chalk.green('✔')} Successfully invoked generator for plugin: ${chalk.cyan(plugin.id)}`)
if (!process.env.VUE_CLI_TEST && hasProjectGit(context)) {
const { stdout } = await execa('git', [
'ls-files',