Skip to content

Commit

Permalink
Drop dependency on deprecated gulp-util (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDancingCode authored and rejas committed Aug 30, 2018
1 parent d1d6d30 commit 2472b9d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"svgo"
],
"dependencies": {
"gulp-util": "^3.0.4",
"plugin-error": "^0.1.2",
"svgo": "^0.7.0"
},
"devDependencies": {
Expand All @@ -47,7 +47,8 @@
"eslint-config-cssnano": "^3.0.0",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-import": "^2.0.1",
"nyc": "^10.0.0"
"nyc": "^10.0.0",
"vinyl": "^2.1.0"
},
"eslintConfig": {
"extends": "cssnano"
Expand Down
12 changes: 6 additions & 6 deletions src/__tests__/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Stream from 'stream';
import {expect} from 'chai';
import ava from 'ava';
import gutil from 'gulp-util';
import Vinyl from 'vinyl';
import svgmin from '..';

const head = '<?xml version="1.0" encoding="utf-8"?>';
Expand All @@ -22,7 +22,7 @@ function makeTest (plugins, content, expected) {
resolve();
});

stream.write(new gutil.File({contents: new Buffer(content)}));
stream.write(new Vinyl({contents: new Buffer(content)}));
});
}

Expand All @@ -35,7 +35,7 @@ ava('should let null files pass through', () => {
resolve();
});

stream.write(new gutil.File({
stream.write(new Vinyl({
path: 'null.md',
contents: null,
}));
Expand Down Expand Up @@ -69,7 +69,7 @@ ava('should allow disabling multiple plugins', () => {

ava('should allow per file options, such as keeping the doctype', () => {
return new Promise(resolve => {
const file = new gutil.File({contents: new Buffer(raw)});
const file = new Vinyl({contents: new Buffer(raw)});

const stream = svgmin(data => {
expect(data).to.equal(file);
Expand All @@ -87,8 +87,8 @@ ava('should allow per file options, such as keeping the doctype', () => {

ava('in stream mode must emit error', (t) => {
const stream = svgmin();
const fakeFile = new gutil.File({
contents: new Stream(),
const fakeFile = new Vinyl({
contents: new Stream.Readable(),
});

const doWrite = function () {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Transform} from 'stream';
import SVGOptim from 'svgo';
import {PluginError} from 'gulp-util';
import PluginError from 'plugin-error';

const PLUGIN_NAME = 'gulp-svgmin';

Expand Down

0 comments on commit 2472b9d

Please sign in to comment.