forked from assemble/assemble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verbfile.js
51 lines (43 loc) · 1.24 KB
/
verbfile.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
var istanbul = require('gulp-istanbul');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var verb = require('verb');
verb.helper('require', function () {
return require.apply(require, arguments);
});
verb.helper('resolve', function (name) {
var base = path.resolve(process.cwd(), 'node_modules', name);
var pkg = require(path.join(base, 'package.json'));
var cwd = path.join(base, pkg.main);
var res = {};
res.pkg = pkg;
res.cwd = relative(cwd);
res.dest = pkg.homepage;
return res;
});
verb.task('readme', function () {
verb.src('.verb.md')
.pipe(verb.dest('./'));
});
verb.task('apidocs', function () {
verb.src('docs/_verb/*.md')
.pipe(verb.dest('docs'));
});
verb.task('lint', function() {
/* deps:jshint-stylish */
verb.src(['index.js', 'lib/**/*.js', 'test/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
verb.task('test', function (cb) {
verb.src(['index.js', 'lib/**/*.js', 'bin/*.js'])
.pipe(istanbul())
.pipe(istanbul.hookRequire())
.on('finish', function () {
verb.src('test/*.js')
.pipe(mocha())
.pipe(istanbul.writeReports())
.on('end', cb);
});
});
verb.task('default', ['test', 'lint', 'readme', 'apidocs']);