@@ -18,11 +18,15 @@ module.exports = Generator.extend({
18
18
this . log (
19
19
chalk . cyan ( 'I simply get down to business of generating, no questions asked!' )
20
20
+ '\n'
21
- + chalk . yellow ( 'Libraries you ask? I use npm (or optionally gulp) as task runner and jest for testing.' )
21
+ + chalk . yellow ( 'Libraries you ask? I use npm as task runner and jest for testing.' )
22
22
+ '\n'
23
23
+ chalk . gray ( 'Can you change these? Of course, it\'s your code. I get out of the way after scaffolding.' )
24
24
) ;
25
25
26
+ if ( this . options . gulp ) {
27
+ throw new Error ( 'Gulp option is no longer supported.' ) ;
28
+ }
29
+
26
30
done ( ) ;
27
31
} ,
28
32
@@ -35,7 +39,7 @@ module.exports = Generator.extend({
35
39
} ,
36
40
37
41
testFiles : function ( ) {
38
- if ( this . options . mocha || this . options . gulp ) {
42
+ if ( this . options . mocha ) {
39
43
// 2.0.0-beta: copying the spec file needs templating due to the ts-node problem on windows
40
44
// this.directory('test', 'test');
41
45
this . fs . copyTpl (
@@ -70,22 +74,15 @@ module.exports = Generator.extend({
70
74
} ,
71
75
72
76
vsCodeFiles : function ( ) {
73
- if ( this . options . gulp ) {
74
- this . fs . copy (
75
- this . templatePath ( '_vscode/tasks_gulp.json' ) ,
76
- this . destinationPath ( '.vscode/tasks.json' )
77
- ) ;
78
- } else {
79
- this . fs . copy (
80
- this . templatePath ( '_vscode/tasks.json' ) ,
81
- this . destinationPath ( '.vscode/tasks.json' )
82
- ) ;
83
- }
77
+ this . fs . copy (
78
+ this . templatePath ( '_vscode/tasks.json' ) ,
79
+ this . destinationPath ( '.vscode/tasks.json' )
80
+ ) ;
84
81
this . fs . copy (
85
82
this . templatePath ( '_vscode/settings.json' ) ,
86
83
this . destinationPath ( '.vscode/settings.json' )
87
84
) ;
88
- if ( ! ( this . options . gulp || this . options . mocha || this . options . ava ) ) { // copy launch.json only for default jest configuration
85
+ if ( ! ( this . options . mocha || this . options . ava ) ) { // copy launch.json only for default jest configuration
89
86
this . fs . copy (
90
87
this . templatePath ( '_vscode/launch.json' ) ,
91
88
this . destinationPath ( '.vscode/launch.json' )
@@ -96,66 +93,46 @@ module.exports = Generator.extend({
96
93
rootFiles : function ( ) {
97
94
const today = new Date ( ) ;
98
95
99
- if ( this . options . gulp ) { // copy gulp files
96
+ if ( this . options . mocha ) { // copy mocha files
100
97
this . fs . copyTpl (
101
- this . templatePath ( '_package_gulp .json' ) ,
98
+ this . templatePath ( '_package_mocha .json' ) ,
102
99
this . destinationPath ( 'package.json' ) ,
103
100
{ appname : _ . kebabCase ( path . basename ( process . cwd ( ) ) ) }
104
101
) ;
105
-
106
102
this . fs . copy (
107
- this . templatePath ( '_gulpfile.js' ) ,
108
- this . destinationPath ( 'gulpfile.js' ) ,
103
+ this . templatePath ( 'travis_mocha.yml' ) ,
104
+ this . destinationPath ( '.travis.yml' )
105
+ ) ;
106
+ } else if ( this . options . ava ) { // copy ava files
107
+ this . fs . copyTpl (
108
+ this . templatePath ( '_package_ava.json' ) ,
109
+ this . destinationPath ( 'package.json' ) ,
109
110
{ appname : _ . kebabCase ( path . basename ( process . cwd ( ) ) ) }
110
111
) ;
111
-
112
112
this . fs . copy (
113
- this . templatePath ( 'README_gulp.md' ) ,
114
- this . destinationPath ( 'README.md' )
113
+ this . templatePath ( 'travis_ava.yml' ) ,
114
+ this . destinationPath ( '.travis.yml' )
115
+ ) ;
116
+ this . fs . copy (
117
+ this . templatePath ( '_tsconfig.test.json' ) ,
118
+ this . destinationPath ( 'tsconfig.test.json' )
119
+ ) ;
120
+ } else { // copy files for default jest configuration
121
+ this . fs . copyTpl (
122
+ this . templatePath ( '_package.json' ) ,
123
+ this . destinationPath ( 'package.json' ) ,
124
+ { appname : _ . kebabCase ( path . basename ( process . cwd ( ) ) ) }
115
125
) ;
116
- } else {
117
- if ( this . options . mocha ) { // copy mocha files
118
- this . fs . copyTpl (
119
- this . templatePath ( '_package_mocha.json' ) ,
120
- this . destinationPath ( 'package.json' ) ,
121
- { appname : _ . kebabCase ( path . basename ( process . cwd ( ) ) ) }
122
- ) ;
123
- this . fs . copy (
124
- this . templatePath ( 'travis_mocha.yml' ) ,
125
- this . destinationPath ( '.travis.yml' )
126
- ) ;
127
- } else if ( this . options . ava ) { // copy ava files
128
- this . fs . copyTpl (
129
- this . templatePath ( '_package_ava.json' ) ,
130
- this . destinationPath ( 'package.json' ) ,
131
- { appname : _ . kebabCase ( path . basename ( process . cwd ( ) ) ) }
132
- ) ;
133
- this . fs . copy (
134
- this . templatePath ( 'travis_ava.yml' ) ,
135
- this . destinationPath ( '.travis.yml' )
136
- ) ;
137
- this . fs . copy (
138
- this . templatePath ( '_tsconfig.test.json' ) ,
139
- this . destinationPath ( 'tsconfig.test.json' )
140
- ) ;
141
- } else { // copy files for default jest configuration
142
- this . fs . copyTpl (
143
- this . templatePath ( '_package.json' ) ,
144
- this . destinationPath ( 'package.json' ) ,
145
- { appname : _ . kebabCase ( path . basename ( process . cwd ( ) ) ) }
146
- ) ;
147
- this . fs . copy (
148
- this . templatePath ( 'travis.yml' ) ,
149
- this . destinationPath ( '.travis.yml' )
150
- ) ;
151
- }
152
- // copy readme for non-gulp configurations
153
126
this . fs . copy (
154
- this . templatePath ( 'README.md ' ) ,
155
- this . destinationPath ( 'README.md ' )
127
+ this . templatePath ( 'travis.yml ' ) ,
128
+ this . destinationPath ( '.travis.yml ' )
156
129
) ;
157
130
}
158
- // copy files for default jest configuration
131
+ // copy files common for all configurations
132
+ this . fs . copy (
133
+ this . templatePath ( 'README.md' ) ,
134
+ this . destinationPath ( 'README.md' )
135
+ ) ;
159
136
this . fs . copy (
160
137
this . templatePath ( '_tsconfig.json' ) ,
161
138
this . destinationPath ( 'tsconfig.json' )
0 commit comments