File tree Expand file tree Collapse file tree 4 files changed +27
-13
lines changed Expand file tree Collapse file tree 4 files changed +27
-13
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ var request = require('request')
1313var logger = require ( '../lib/logger' )
1414var generate = require ( '../lib/generate' )
1515var checkVersion = require ( '../lib/check-version' )
16- var vue2VersionWarn = require ( '../lib/vue2-version-warn ' )
16+ var warnings = require ( '../lib/warnings ' )
1717
1818/**
1919 * Usage.
@@ -105,9 +105,13 @@ function run () {
105105 if ( template . indexOf ( '#' ) !== - 1 ) {
106106 downloadAndGenerate ( officialTemplate )
107107 } else {
108+ if ( template . indexOf ( '-2.0' ) !== - 1 ) {
109+ warnings . v2SuffixTemplatesDeprecated ( template , inPlace ? '' : name )
110+ return
111+ }
108112 // until official webpack template for Vue 2.0 is released in master/dist branch
109113 if ( template !== 'webpack' ) {
110- vue2VersionWarn ( template , inPlace ? '' : name )
114+ warnings . v2BranchIsNowDefault ( template , inPlace ? '' : name )
111115 }
112116 checkDistBranch ( officialTemplate , downloadAndGenerate )
113117 }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ var chalk = require ( 'chalk' )
2+
3+ module . exports = {
4+ v2SuffixTemplatesDeprecated : function ( template , name ) {
5+ var initCommand = 'vue init ' + template . replace ( '-2.0' , '' ) + ' ' + name
6+
7+ console . log ( chalk . red ( ' This template is deprecated, as the original template now uses Vue 2.0 by default.' ) )
8+ console . log ( )
9+ console . log ( chalk . yellow ( ' Please use this command instead: ' ) + chalk . green ( initCommand ) )
10+ console . log ( )
11+ } ,
12+ v2BranchIsNowDefault : function ( template , name ) {
13+ var vue1InitCommand = 'vue init ' + template + '#1.0' + ' ' + name
14+
15+ console . log ( chalk . red ( ' This will install Vue 2.x version of template.' ) )
16+ console . log ( )
17+ console . log ( chalk . yellow ( ' For Vue 1.x use: ' ) + chalk . green ( vue1InitCommand ) )
18+ console . log ( )
19+ }
20+ }
Original file line number Diff line number Diff line change 11{
22 "name" : " vue-cli" ,
3- "version" : " 2.3.0 " ,
3+ "version" : " 2.3.2 " ,
44 "description" : " A simple CLI for scaffolding Vue.js projects." ,
55 "preferGlobal" : true ,
66 "bin" : {
You can’t perform that action at this time.
0 commit comments