1 // Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com>
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
12 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15 // ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
16 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 import gulp from 'gulp';
24 import mocha from 'gulp-mocha';
25 import eslint from 'gulp-eslint';
26 import minimist from 'minimist';
27 import git from 'gulp-git';
28 import bump from 'gulp-bump';
29 import filter from 'gulp-filter';
30 import tagVersion from 'gulp-tag-version';
31 import 'babel-register';
38 parser: 'babel-eslint',
40 'sourceType': 'module'
45 'no-use-before-define': 0,
48 'no-underscore-dangle': 0,
50 'no-native-reassign': 0,
58 gulp.task('test', function() {
59 let options = minimist(process.argv.slice(2), {
66 return gulp.src(options.test).pipe(mocha({reporter: 'spec'}));
69 gulp.task('lint', () =>
71 .pipe(eslint(ESLINT_OPTION))
72 .pipe(eslint.formatEach('stylish', process.stderr))
73 .pipe(eslint.failOnError())
76 let inc = importance =>
77 gulp.src(['./package.json'])
78 .pipe(bump({type: importance}))
79 .pipe(gulp.dest('./'))
80 .pipe(git.commit('Bumps package version'))
81 .pipe(filter('package.json'))
87 gulp.task('travis', [ 'lint', 'test' ]);
88 gulp.task('default', [ 'travis' ]);
90 gulp.task('patch', [ ], () => inc('patch'));
91 gulp.task('minor', [ ], () => inc('minor'));
92 gulp.task('major', [ ], () => inc('major'));