Skip to content

Commit ef05833

Browse files
XhmikosRfmal
authored andcommitted
feat: replace the deprecated gulp-util package
fixes #43
1 parent 8f8007b commit ef05833

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var inlineSource = require('inline-source'),
2-
gutil = require('gulp-util'),
2+
PluginError = require('plugin-error'),
33
path = require('path'),
44
through = require('through2');
55

@@ -17,7 +17,7 @@ function gulpInlineSource (options) {
1717
}
1818

1919
if (file.isStream()) {
20-
this.emit('error', new gutil.PluginError(PLUGIN_NAME, 'Streaming not supported'));
20+
this.emit('error', new PluginError(PLUGIN_NAME, 'Streaming not supported'));
2121
return cb();
2222
}
2323

@@ -34,7 +34,7 @@ function gulpInlineSource (options) {
3434

3535
inlineSource(file.contents.toString(), fileOptions, function (err, html) {
3636
if (err) {
37-
self.emit('error', new gutil.PluginError(PLUGIN_NAME, err));
37+
self.emit('error', new PluginError(PLUGIN_NAME, err));
3838
} else {
3939
file.contents = new Buffer(html || '');
4040
self.push(file);

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
2020
},
2121
"dependencies": {
22-
"gulp-util": "~3.0.6",
22+
"plugin-error": "~1.0.1",
2323
"inline-source": "~5.2.6",
2424
"through2": "~2.0.0"
2525
},
@@ -31,7 +31,8 @@
3131
"husky": "^0.13.3",
3232
"semantic-release": "^6.3.2",
3333
"tape": "^4.0.1",
34-
"validate-commit-msg": "^2.12.1"
34+
"validate-commit-msg": "^2.12.1",
35+
"vinyl": "^2.1.0"
3536
},
3637
"config": {
3738
"commitizen": {

test/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
'use strict';
22

33
var path = require('path'),
4-
gutil = require('gulp-util'),
4+
Vinyl = require('vinyl'),
55
fs = require('fs'),
66
test = require('tape'),
77
inlinesource = require('../');
88

99
function getFile (filePath, contents) {
10-
return new gutil.File({
10+
return new Vinyl({
1111
path: filePath,
1212
base: path.dirname(filePath),
1313
contents: contents || fs.readFileSync(filePath)

0 commit comments

Comments
 (0)