-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
61 lines (50 loc) · 1.66 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
var fs = require('fs'),
gulp = require('gulp'),
clean = require('gulp-clean'),
babel = require('gulp-babel'),
jscs = require('gulp-jscs'),
jshint = require('gulp-jshint'),
esdoc = require('gulp-esdoc'),
ghPages = require('gulp-gh-pages'),
stylish = require('jshint-stylish');
gulp.task('clean-jsdoc', function () {
return gulp.src('./jsdoc', { read: false })
.pipe(clean());
});
gulp.task('clean-lib', function () {
return gulp.src('./lib', { read: false })
.pipe(clean());
});
gulp.task('jshint', function() {
return gulp.src('./src/**/*.es6')
.pipe(jshint({ lookup: true, esnext: true }))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('jscs', function() {
return gulp.src('./src/**/*.es6')
.pipe(jscs({ esnext: true }))
.pipe(gulp.dest('src'));
});
gulp.task('codestyle', ['jshint', 'jscs']);
gulp.task('compile', ['clean-lib'], function () {
return gulp.src('./src/**/*.es6')
.pipe(babel({ optional: 'runtime' }))
.pipe(gulp.dest('lib'));
});
gulp.task('pretest', ['codestyle', 'compile']);
gulp.task('esdoc', ['clean-jsdoc'], function () {
var esdocConfig = fs.readFileSync('./esdoc.json', 'utf-8');
esdocConfig = JSON.parse(esdocConfig);
gulp.src("./src")
.pipe(esdoc(esdocConfig));
});
gulp.task('copy-logo', ['esdoc'], function() {
return gulp.src('./logo.gif')
.pipe(gulp.dest('./jsdoc'));
});
gulp.task('ghPages', ['esdoc', 'copy-logo'], function () {
return gulp.src('./jsdoc/**/*')
.pipe(ghPages());
});
gulp.task('publish-doc', ['esdoc', 'copy-logo', 'ghPages']);