-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
56 lines (51 loc) · 1.39 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
var gulp = require('gulp'),
concat = require('gulp-concat'),
umd = require('gulp-umd'),
jsdoc = require('gulp-jsdoc3');
var src = [
'src/haveapi/client.js',
'src/haveapi/hooks.js',
'src/haveapi/http.js',
'src/haveapi/authentication.js',
'src/haveapi/authentication/base.js',
'src/haveapi/authentication/basic.js',
'src/haveapi/authentication/oauth2.js',
'src/haveapi/authentication/token.js',
'src/haveapi/base_resource.js',
'src/haveapi/resource.js',
'src/haveapi/action.js',
'src/haveapi/action_state.js',
'src/haveapi/response.js',
'src/haveapi/local_response.js',
'src/haveapi/resource_instance.js',
'src/haveapi/resource_instance_list.js',
'src/haveapi/parameters.js',
'src/haveapi/validator.js',
'src/haveapi/validators/*.js',
'src/haveapi/exceptions.js',
'src/*.js',
];
gulp.task('scripts', function() {
return gulp.src(src)
.pipe(concat('haveapi-client.js'))
.pipe(umd({
exports: function (file) {
return 'HaveAPI';
},
namespace: function (file) {
return 'HaveAPI';
}
}))
.pipe(gulp.dest('./dist/'));
});
gulp.task('doc', function (cb) {
gulp.src(src.concat(['README.md']), {read: false}).pipe(jsdoc({
plugins: ["plugins/markdown"],
opts: { destination: "html_doc" }
}, cb));
});
gulp.task('watch', function() {
gulp.watch('src/*.js', ['scripts', 'doc']);
gulp.watch('src/**/*.js', ['scripts', 'doc']);
});
gulp.task('default', gulp.series('scripts'));