Skip to content

Commit b6b7d0e

Browse files
committed
replace todos in build task
1 parent 4a914e6 commit b6b7d0e

File tree

2 files changed

+65
-62
lines changed

2 files changed

+65
-62
lines changed

gulpfile.js

Lines changed: 63 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,82 @@
11
var gulp = require('gulp'),
2-
path = require('path'),
3-
jshintReporter = require('jshint-stylish'),
4-
plugins = require('gulp-load-plugins')({
5-
config: path.join(__dirname, 'package.json')
6-
});
2+
path = require('path'),
3+
jshintReporter = require('jshint-stylish'),
4+
plugins = require('gulp-load-plugins')({
5+
config: path.join(__dirname, 'package.json')
6+
});
77

88
var sctiptPath = {
9-
src: {
10-
files: 'src/js/**/*.js'
11-
}
9+
src: {
10+
files: 'src/js/**/*.js'
11+
}
1212
};
1313

14-
gulp.task('jshint', function(done) {
15-
gulp.src(sctiptPath.src.files)
16-
.pipe(plugins.jshint('.jshintrc'))
17-
.pipe(plugins.jshint.reporter(jshintReporter));
18-
done();
14+
gulp.task('jshint', function (done) {
15+
gulp
16+
.src(sctiptPath.src.files)
17+
.pipe(plugins.jshint('.jshintrc'))
18+
.pipe(plugins.jshint.reporter(jshintReporter));
19+
done();
1920
});
2021

21-
gulp.task('build', function() {
22-
var pkg = require('./bower.json');
22+
gulp.task('build', function () {
23+
var pkg = require('./bower.json');
2324

24-
var header = ['/**',
25-
' * <%= pkg.name %>',
26-
' * <%= pkg.description %>',
27-
' * @version v<%= pkg.version %>',
28-
' * @author <%= pkg.author %>',
29-
' * @link <%= pkg.homepage %>',
30-
' * @license <%= pkg.license %>',
31-
' */',
32-
'(function (angular) {',
33-
'',
34-
''].join('\n');
25+
var header = ['/**',
26+
' * <%= pkg.name %>',
27+
' * <%= pkg.description %>',
28+
' * @version v<%= pkg.version %>',
29+
' * @author <%= pkg.author %>',
30+
' * @link <%= pkg.homepage %>',
31+
' * @license <%= pkg.license %>',
32+
' */',
33+
'(function (angular) {',
34+
'',
35+
''].join('\n');
3536

36-
var footer = [
37-
'',
38-
'})(angular);',
39-
''].join('\n');
37+
var footer = [
38+
'',
39+
'})(angular);',
40+
''].join('\n');
4041

41-
gulp.src([
42-
'src/js/vki-core.js',
43-
'src/js/mdKeyboard.js'
44-
])
45-
.pipe(plugins.concat('mdKeyboard.js'))
46-
.pipe(plugins.header(header, {pkg: pkg}))
47-
.pipe(plugins.footer(footer))
48-
.pipe(gulp.dest('./dist/'))
49-
.pipe(plugins.uglify())
50-
.pipe(plugins.concat('mdKeyboard.min.js'))
51-
.pipe(gulp.dest('./dist/'));
42+
gulp
43+
.src([
44+
'src/js/mdKeyboard.js'
45+
])
46+
.pipe(plugins.concat('mdKeyboard.js'))
47+
.pipe(plugins.header(header, {pkg: pkg}))
48+
.pipe(plugins.footer(footer))
49+
.pipe(plugins.replace(/[\r\n]+\s*\/\/.*TODO:+.*/gi, ''))
50+
.pipe(gulp.dest('./dist/'))
51+
.pipe(plugins.uglify())
52+
.pipe(plugins.concat('mdKeyboard.min.js'))
53+
.pipe(gulp.dest('./dist/'));
5254

53-
gulp.src('src/css/mdKeyboard.css')
54-
.pipe(gulp.dest('./dist/'));
55+
gulp.src('src/css/mdKeyboard.css')
56+
.pipe(gulp.dest('./dist/'));
5557
});
5658

57-
gulp.task('default', ['jshint', 'build'], function() {
58-
gulp.watch(sctiptPath.src.files, ['jshint', 'build']);
59+
gulp.task('default', ['jshint', 'build'], function () {
60+
gulp.watch(sctiptPath.src.files, ['jshint', 'build']);
5961
});
6062

61-
gulp.task('changelog', function(done) {
62-
var pkg = require('./bower.json');
63-
var changelog = require('conventional-changelog');
64-
var fs = require('fs');
63+
gulp.task('changelog', function (done) {
64+
var pkg = require('./bower.json');
65+
var changelog = require('conventional-changelog');
66+
var fs = require('fs');
6567

66-
var options = {
67-
repository: pkg.homepage,
68-
version: pkg.version,
69-
file: 'CHANGELOG.md'
70-
};
68+
var options = {
69+
repository: pkg.homepage,
70+
version: pkg.version,
71+
file: 'CHANGELOG.md'
72+
};
7173

72-
var filePath = './' + options.file;
73-
changelog(options, function(err, log) {
74-
if (err) {
75-
throw err;
76-
}
74+
var filePath = './' + options.file;
75+
changelog(options, function (err, log) {
76+
if (err) {
77+
throw err;
78+
}
7779

78-
fs.writeFile(filePath, log, done);
79-
});
80+
fs.writeFile(filePath, log, done);
81+
});
8082
});

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "David Enke"
55
},
66
"dependencies": {},
7-
"description": "Onscreen virtual keyboard for Angular (https://angularjs.org/) using Material (https://material.angularjs.org/) and the Angular Virtual Keyboard by the-darc (https://github.com/the-darc/angular-virtual-keyboard) based on GreyWyvern VKI (http://www.greywyvern.com/code/javascript/keyboard).",
7+
"description": "Onscreen virtual keyboard for Angular (https://angularjs.org/) using Material (https://material.angularjs.org/)inspired by the Angular Virtual Keyboard by the-darc (https://github.com/the-darc/angular-virtual-keyboard).",
88
"devDependencies": {
99
"bower": "^1.7.7",
1010
"conventional-changelog": "0.0.16",
@@ -15,6 +15,7 @@
1515
"gulp-jshint": "^1.9.2",
1616
"gulp-load-plugins": "^0.8.0",
1717
"gulp-uglify": "^1.1.0",
18+
"gulp-replace": "^0.5.4",
1819
"jshint-stylish": "^1.0.0"
1920
},
2021
"directories": {},

0 commit comments

Comments
 (0)