-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
76 lines (68 loc) · 1.63 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/**
* @file
* Gulp tasks for this project.
*/
'use strict';
var gulp = require('gulp'),
eslint = require('gulp-eslint'),
jscs = require('gulp-jscs'),
bump = require('gulp-bump'),
gulpHelp = require('gulp-help')(gulp),
jsFilePatterns = [
'gulpfile.js',
'*.js',
'bin/*.js'
];
/**
* @task lint
* Runs JSCS and ESLint on code files.
*/
gulp.task('lint', 'Runs JSCS and ESLint on code files.', function() {
return gulp.src(jsFilePatterns)
.pipe(eslint())
.pipe(eslint.format())
.pipe(jscs());
});
/**
* @task watch
* Runs lint tasks when files are changed.
*/
gulp.task('watch', 'Runs lint tasks when files are changed.', function() {
gulp.watch(jsFilePatterns, ['lint']);
});
/**
* @task bump-prerelease
* Increment prerelease version by 1.
*/
gulp.task('bump-prerelease', 'Increment prerelease version by 1.', function () {
gulp.src('./package.json')
.pipe(bump({type: 'prerelease'}))
.pipe(gulp.dest('./'));
});
/**
* @task bump-patch
* Increment patch version by 1.
*/
gulp.task('bump-patch', 'Increment patch version by 1.', function () {
gulp.src('./package.json')
.pipe(bump({type: 'patch'}))
.pipe(gulp.dest('./'));
});
/**
* @task bump-minor
* Increment minor version by 1.
*/
gulp.task('bump-minor', 'Increment minor version by 1.', function () {
gulp.src('./package.json')
.pipe(bump({type: 'minor'}))
.pipe(gulp.dest('./'));
});
/**
* @task bump-major
* Increment major version by 1.
*/
gulp.task('bump-major', 'Increment major version by 1.', function () {
gulp.src('./package.json')
.pipe(bump({type: 'major'}))
.pipe(gulp.dest('./'));
});