Skip to content
This repository was archived by the owner on Aug 8, 2020. It is now read-only.

Commit f220065

Browse files
samueleishionsindresorhus
authored andcommitted
Remove gulp-util usage (#28)
1 parent 4a61b28 commit f220065

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
yarn.lock
3+
package-lock.json
34
.nyc_output

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
const gutil = require('gulp-util');
2+
const PluginError = require('plugin-error');
33
const through = require('through2');
44
const dargs = require('dargs');
55
const resolveCwd = require('resolve-cwd');
@@ -21,7 +21,7 @@ module.exports = options => {
2121
}
2222

2323
if (file.isStream()) {
24-
cb(new gutil.PluginError('gulp-ava', 'Streaming not supported'));
24+
cb(new PluginError('gulp-ava', 'Streaming not supported'));
2525
return;
2626
}
2727

@@ -35,7 +35,7 @@ module.exports = options => {
3535
const nycBin = resolveCwd('nyc/bin/nyc.js');
3636

3737
if (!nycBin) {
38-
cb(new gutil.PluginError('gulp-ava', 'Couldn\'t find the `nyc` binary'));
38+
cb(new PluginError('gulp-ava', 'Couldn\'t find the `nyc` binary'));
3939
return;
4040
}
4141

@@ -52,7 +52,7 @@ module.exports = options => {
5252
ps.then(() => {
5353
cb();
5454
}).catch(() => {
55-
cb(new gutil.PluginError('gulp-ava', 'One or more tests failed'));
55+
cb(new PluginError('gulp-ava', 'One or more tests failed'));
5656
});
5757
});
5858
};

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"ava": "^1.0.1",
3737
"dargs": "^6.0.0",
3838
"execa": "^1.0.0",
39-
"gulp-util": "^3.0.8",
39+
"fancy-log": "^1.3.3",
40+
"plugin-error": "^1.0.1",
4041
"resolve-cwd": "^2.0.0",
4142
"through2": "^3.0.0"
4243
},

test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import test from 'ava';
22
import vinylFile from 'vinyl-file';
33
import hooker from 'hooker';
4-
import gutil from 'gulp-util';
4+
import log from 'fancy-log';
55
import ava from '.';
66

77
test.cb('main', t => {
88
const stream = ava();
99

1010
hooker.hook(process.stdout, 'write', (...args) => {
1111
if (/2.*passed/.test(args.join(' '))) {
12-
hooker.unhook(gutil, 'log');
12+
hooker.unhook(log);
1313
t.pass();
1414
t.end();
1515
}

0 commit comments

Comments
 (0)