-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
executable file
·58 lines (52 loc) · 1.42 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
// Disable OS pop-up notifications on each mixing process.
process.env.DISABLE_NOTIFIER = true;
const gulp = require('gulp');
//const pandoc = require('gulp-pandoc');
const jsdoc = require('gulp-jsdoc3');
const jshint = require('gulp-jshint');
const mocha = require('gulp-mocha');
gulp.task('default', ['doc']);
gulp.task('test', ['jshint', 'unit']);
gulp.task('doc', (cb) =>
{
gulp
.src(['README.md', './lib/*.js'], {read: false})
.pipe(jsdoc(cb));
});
// gulp.task('doc', function ()
// {
// gulp.src('*.md')
// .pipe(pandoc({
// from: 'markdown_github+implicit_header_references',
// to: 'html',
// ext: '.html',
// args: ['--standalone']
// }))
// .pipe(gulp.dest('doc/'));
// });
// TODO Not quite working. Errors are thrown, but on success "0 passed".
gulp.task('unit', () =>
{
return gulp
.src('test/*.js', {read: false})
// `gulp-mocha` needs filepaths so you can't have any plugins before it
.pipe(mocha({reporter: 'spec'}));
});
gulp.task('jshint', () =>
{
return gulp
.src(['*.js', 'lib/*.js', 'test/*.js'])
.pipe(jshint({
curly: true,
esversion: 6,
funcscope: true,
latedef: true,
laxbreak: true, // TODO In the next JSHint release it will probably possible to get rid of this deprecated option (https://github.com/jshint/jshint/issues/2793).
node: true,
nonew: true,
singleGroups: true,
undef: true,
unused: true
}))
.pipe(jshint.reporter('jshint-stylish'));
});