@@ -3,14 +3,15 @@ const os = require('os')
3
3
const path = require ( 'path' )
4
4
const chalk = require ( 'chalk' )
5
5
const debug = require ( 'debug' )
6
+ const emoji = require ( 'node-emoji' )
6
7
const inquirer = require ( 'inquirer' )
7
8
const Generator = require ( './Generator' )
8
9
const installDeps = require ( './util/installDeps' )
9
10
const PromptModuleAPI = require ( './PromptModuleAPI' )
10
11
const writeFileTree = require ( './util/writeFileTree' )
12
+ const { logWithSpinner, stopSpinner } = require ( './util/spinner' )
11
13
12
14
const {
13
- info,
14
15
error,
15
16
hasYarn,
16
17
clearConsole
@@ -53,15 +54,15 @@ module.exports = class Creator {
53
54
} else if ( answers . mode === 'default' ) {
54
55
options = defaultOptions
55
56
} else {
57
+ // manual
56
58
options = {
57
59
packageManager : answers . packageManager ,
58
60
plugins : { }
59
61
}
62
+ // run cb registered by prompt modules to finalize the options
63
+ this . promptCompleteCbs . forEach ( cb => cb ( answers , options ) )
60
64
}
61
65
62
- // run cb registered by prompt modules to finalize the options
63
- this . promptCompleteCbs . forEach ( cb => cb ( answers , options ) )
64
-
65
66
// save options
66
67
if ( answers . mode === 'manual' && answers . save ) {
67
68
this . saveOptions ( options )
@@ -75,7 +76,7 @@ module.exports = class Creator {
75
76
debug ( 'options' ) ( options )
76
77
77
78
// write base package.json to disk
78
- info ( `Creating project in ${ chalk . cyan ( targetDir ) } .` )
79
+ logWithSpinner ( emoji . get ( 'sparkles' ) , `Creating project in ${ chalk . green ( targetDir ) } .` )
79
80
writeFileTree ( targetDir , {
80
81
'package.json' : JSON . stringify ( {
81
82
name,
@@ -85,7 +86,7 @@ module.exports = class Creator {
85
86
} )
86
87
87
88
// install deps
88
- info ( `Installing dependencies with ${ options . packageManager } . This may take a while...` )
89
+ logWithSpinner ( emoji . get ( 'electric_plug' ) , `Installing CLI plugins. This might take a while...` )
89
90
const deps = Object . keys ( options . plugins )
90
91
if ( process . env . VUE_CLI_DEBUG ) {
91
92
// in development, use linked packages
@@ -95,21 +96,23 @@ module.exports = class Creator {
95
96
await installDeps ( options . packageManager , targetDir , deps )
96
97
}
97
98
99
+ logWithSpinner ( emoji . get ( 'gear' ) , `Invoking generators...` )
98
100
// run generator
99
101
const generator = new Generator ( targetDir , options )
100
102
await generator . generate ( )
101
103
102
104
// install deps again (new deps injected by generators)
105
+ logWithSpinner ( emoji . get ( 'package' ) , `Installing additional dependencies...` )
103
106
await installDeps ( options . packageManager , targetDir )
104
-
105
- // TODO run vue-cli-service init
107
+ stopSpinner ( )
108
+ console . log ( ` ${ chalk . green ( '✔' ) } Successfully created project ${ chalk . green ( name ) } .` )
106
109
}
107
110
108
111
resolveIntroPrompts ( ) {
109
112
const modePrompt = {
110
113
name : 'mode' ,
111
114
type : 'list' ,
112
- message : `Hi there! Please pick a project creation mode:` ,
115
+ message : `Please pick a project creation mode:` ,
113
116
choices : [
114
117
{
115
118
name : 'Zero-configuration with defaults' ,
0 commit comments