Skip to content

Commit d4aa129

Browse files
GaryB432ospatil
authored andcommitted
remove legacy gulp support and use strict mode, closes #38 (#39)
* use strict mode, closes #38 * remove gulp * disallow gulp option * Reinstate the version. It will be bumped during release.
1 parent ac16599 commit d4aa129

14 files changed

+44
-306
lines changed

README-1x.md

Lines changed: 0 additions & 62 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
[![Build Status](https://secure.travis-ci.org/ospatil/generator-node-typescript.png?branch=master)](https://travis-ci.org/ospatil/generator-node-typescript)
33
[![npm version](https://badge.fury.io/js/generator-node-typescript.svg)](http://badge.fury.io/js/generator-node-typescript)
44

5-
> For my 1.x release documentation for TypeScript 1.8, refer to [readme file for 1.x release](./README-1x.md).
6-
75
Bonjour! I'm a minimal [Yeoman](http://yeoman.io) generator for creating NodeJS packages using TypeScript. I let you quickly setup a project with latest available tools and best practices.
86

97
I use:

generators/app/index.js

Lines changed: 39 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@ module.exports = Generator.extend({
1818
this.log(
1919
chalk.cyan('I simply get down to business of generating, no questions asked!')
2020
+ '\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.')
2222
+ '\n'
2323
+ chalk.gray('Can you change these? Of course, it\'s your code. I get out of the way after scaffolding.')
2424
);
2525

26+
if (this.options.gulp) {
27+
throw new Error('Gulp option is no longer supported.');
28+
}
29+
2630
done();
2731
},
2832

@@ -35,7 +39,7 @@ module.exports = Generator.extend({
3539
},
3640

3741
testFiles: function () {
38-
if (this.options.mocha || this.options.gulp) {
42+
if (this.options.mocha) {
3943
// 2.0.0-beta: copying the spec file needs templating due to the ts-node problem on windows
4044
// this.directory('test', 'test');
4145
this.fs.copyTpl(
@@ -70,22 +74,15 @@ module.exports = Generator.extend({
7074
},
7175

7276
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+
);
8481
this.fs.copy(
8582
this.templatePath('_vscode/settings.json'),
8683
this.destinationPath('.vscode/settings.json')
8784
);
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
8986
this.fs.copy(
9087
this.templatePath('_vscode/launch.json'),
9188
this.destinationPath('.vscode/launch.json')
@@ -96,66 +93,46 @@ module.exports = Generator.extend({
9693
rootFiles: function () {
9794
const today = new Date();
9895

99-
if (this.options.gulp) { // copy gulp files
96+
if (this.options.mocha) { // copy mocha files
10097
this.fs.copyTpl(
101-
this.templatePath('_package_gulp.json'),
98+
this.templatePath('_package_mocha.json'),
10299
this.destinationPath('package.json'),
103100
{ appname: _.kebabCase(path.basename(process.cwd())) }
104101
);
105-
106102
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'),
109110
{ appname: _.kebabCase(path.basename(process.cwd())) }
110111
);
111-
112112
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())) }
115125
);
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
153126
this.fs.copy(
154-
this.templatePath('README.md'),
155-
this.destinationPath('README.md')
127+
this.templatePath('travis.yml'),
128+
this.destinationPath('.travis.yml')
156129
);
157130
}
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+
);
159136
this.fs.copy(
160137
this.templatePath('_tsconfig.json'),
161138
this.destinationPath('tsconfig.json')

generators/app/templates/README_gulp.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

generators/app/templates/_gulpfile.js

Lines changed: 0 additions & 56 deletions
This file was deleted.

generators/app/templates/_package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"ts-node": "^3.2.0",
4444
"tslint": "^5.0.0",
4545
"tslint-config-prettier": "^1.1.0",
46-
"typescript": "^2.0.0"
46+
"typescript": "^2.3.0"
4747
},
4848
"engines": {
4949
"node": ">=6.0.0"

generators/app/templates/_package_ava.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"ts-node": "^3.2.0",
4141
"tslint": "^5.0.0",
4242
"tslint-config-prettier": "^1.1.0",
43-
"typescript": "^2.0.0"
43+
"typescript": "^2.3.0"
4444
},
4545
"engines": {
4646
"node": ">=6.0.0"

generators/app/templates/_package_gulp.json

Lines changed: 0 additions & 39 deletions
This file was deleted.

generators/app/templates/_package_mocha.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"ts-node": "^3.0.0",
3939
"tslint": "^5.0.0",
4040
"tslint-config-prettier": "^1.1.0",
41-
"typescript": "^2.0.0",
41+
"typescript": "^2.3.0",
4242
"coveralls": "^2.0.0"
4343
},
4444
"engines": {

generators/app/templates/_tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"esnext"
88
],
99
"target": "es2015",
10-
"noImplicitAny": true,
10+
"strict": true,
1111
"outDir": "./lib",
1212
"preserveConstEnums": true,
1313
"removeComments": true,

generators/app/templates/_tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"target": "es5",
55
"outDir": "lib_test",
66
"declaration": false,
7-
"noImplicitAny": true,
7+
"strict": true,
88
"removeComments": true,
99
"inlineSourceMap": true
1010
},

0 commit comments

Comments
 (0)