source: imaps-frontend/node_modules/esrecurse/gulpfile.babel.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 2.9 KB
Line 
1// Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com>
2//
3// Redistribution and use in source and binary forms, with or without
4// modification, are permitted provided that the following conditions are met:
5//
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.
11//
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.
22
23import gulp from 'gulp';
24import mocha from 'gulp-mocha';
25import eslint from 'gulp-eslint';
26import minimist from 'minimist';
27import git from 'gulp-git';
28import bump from 'gulp-bump';
29import filter from 'gulp-filter';
30import tagVersion from 'gulp-tag-version';
31import 'babel-register';
32
33const SOURCE = [
34 '*.js'
35];
36
37let ESLINT_OPTION = {
38 parser: 'babel-eslint',
39 parserOptions: {
40 'sourceType': 'module'
41 },
42 rules: {
43 'quotes': 0,
44 'eqeqeq': 0,
45 'no-use-before-define': 0,
46 'no-shadow': 0,
47 'no-new': 0,
48 'no-underscore-dangle': 0,
49 'no-multi-spaces': 0,
50 'no-native-reassign': 0,
51 'no-loop-func': 0
52 },
53 env: {
54 'node': true
55 }
56};
57
58gulp.task('test', function() {
59 let options = minimist(process.argv.slice(2), {
60 string: 'test',
61 default: {
62 test: 'test/*.js'
63 }
64 }
65 );
66 return gulp.src(options.test).pipe(mocha({reporter: 'spec'}));
67});
68
69gulp.task('lint', () =>
70 gulp.src(SOURCE)
71 .pipe(eslint(ESLINT_OPTION))
72 .pipe(eslint.formatEach('stylish', process.stderr))
73 .pipe(eslint.failOnError())
74);
75
76let 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'))
82 .pipe(tagVersion({
83 prefix: ''
84 }))
85;
86
87gulp.task('travis', [ 'lint', 'test' ]);
88gulp.task('default', [ 'travis' ]);
89
90gulp.task('patch', [ ], () => inc('patch'));
91gulp.task('minor', [ ], () => inc('minor'));
92gulp.task('major', [ ], () => inc('major'));
Note: See TracBrowser for help on using the repository browser.