Skip to content

Commit

Permalink
Drop dependency on deprecated gulp-util (#31)
Browse files Browse the repository at this point in the history
Closes #30
  • Loading branch information
TheDancingCode authored and lahmatiy committed Jan 2, 2018
1 parent f488df3 commit 1060fcd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions index.js
@@ -1,7 +1,7 @@
'use strict';

var csso = require('csso'),
gutil = require('gulp-util'),
PluginError = require('plugin-error'),
Transform = require('stream').Transform,
applySourceMap = require('vinyl-sourcemaps-apply');

Expand Down Expand Up @@ -42,7 +42,7 @@ module.exports = function (options) {
error = processParseError(source, inputFile, error.parseError, error.message);
}

cb(new gutil.PluginError('gulp-csso', error));
cb(new PluginError('gulp-csso', error));
}

if (file.isNull()) {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -24,12 +24,13 @@
],
"dependencies": {
"csso": "^3.0.0",
"gulp-util": "^3.0.6",
"plugin-error": "^0.1.2",
"vinyl-sourcemaps-apply": "^0.2.1"
},
"devDependencies": {
"tap-spec": "^4.1.0",
"tape": "^4.2.1"
"tape": "^4.2.1",
"vinyl": "^2.1.0"
},
"main": "index.js"
}
8 changes: 4 additions & 4 deletions test.js
Expand Up @@ -3,7 +3,7 @@
var csso = require('./'),
test = require('tape'),
Stream = require('stream'),
gutil = require('gulp-util'),
Vinyl = require('vinyl'),
fs = require('fs'),

basestyle = 'h1 { color: yellow; } \n h1 { font-size: 2em; }',
Expand All @@ -20,7 +20,7 @@ function readSourceMapTestFile(ext) {
}

function fixture (contents) {
return new gutil.File({
return new Vinyl({
contents: contents,
cwd: __dirname,
base: __dirname,
Expand All @@ -29,7 +29,7 @@ function fixture (contents) {
}

function sourceMapFixture (contents, sourceMap) {
var file = new gutil.File({
var file = new Vinyl({
contents: new Buffer(contents),
cwd: __dirname,
base: __dirname,
Expand Down Expand Up @@ -106,7 +106,7 @@ test('should throw an error in stream mode', function (t) {

var stream = csso();

var file = fixture(new Stream());
var file = fixture(new Stream.Readable());

var write = function () {
stream.write(file);
Expand Down

0 comments on commit 1060fcd

Please sign in to comment.