Skip to content

Commit

Permalink
Remove gulp-util
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlacy committed Dec 25, 2017
1 parent 029e104 commit f222454
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

var through = require('through2');
var stylus = require('accord').load('stylus');
var gutil = require('gulp-util');
var rext = require('replace-ext');
var extname = require('path').extname;
var assign = require('lodash.assign');
var PluginError = require('plugin-error');
var applySourceMap = require('vinyl-sourcemaps-apply');

function guErr(err) {
return new gutil.PluginError('gulp-stylus', err);
return new PluginError('gulp-stylus', err);
}

module.exports = function (options) {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"main": "./index.js",
"dependencies": {
"accord": "^0.26.3",
"gulp-util": "^3.0.6",
"lodash.assign": "^3.2.0",
"plugin-error": "^0.1.2",
"replace-ext": "0.0.1",
"stylus": "^0.54.0",
"through2": "^2.0.0",
Expand All @@ -21,7 +21,8 @@
"devDependencies": {
"gulp-sourcemaps": "^1.5.2",
"mocha": "^2.3.2",
"should": "^8.0.2"
"should": "^8.0.2",
"vinyl": "^2.1.0"
},
"engines": {
"node": ">= 4.2.0"
Expand Down
24 changes: 12 additions & 12 deletions test/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

var should = require('should');
var gutil = require('gulp-util');
var sourcemaps = require('gulp-sourcemaps');
var File = require('vinyl');
var originalStylus = require('stylus');
var stylus = require('../');
var fs = require('fs');
Expand All @@ -15,7 +15,7 @@ describe('gulp-stylus', function() {
it('should render stylus .styl to CSS .css', function(done) {
var stream = stylus();

var fakeFile = new gutil.File({
var fakeFile = new File({
base: 'test/fixtures',
cwd: 'test/',
path: 'test/fixtures/normal.styl',
Expand All @@ -35,7 +35,7 @@ describe('gulp-stylus', function() {

it ('should compress when called', function(done) {
var stream = stylus({compress: true});
var fakeFile = new gutil.File({
var fakeFile = new File({
base: 'test/fixtures',
cwd: 'test/',
path: 'test/fixtures/normal.styl',
Expand All @@ -57,7 +57,7 @@ describe('gulp-stylus', function() {

it ('should import other .styl files', function(done) {
var stream = stylus({import: __dirname + '/fixtures/one.styl'});
var fakeFile = new gutil.File({
var fakeFile = new File({
base: 'test/fixtures',
cwd: 'test/',
path: 'test/fixtures/normal.styl',
Expand All @@ -78,7 +78,7 @@ describe('gulp-stylus', function() {

it ('should define variables in .styl files', function(done) {
var stream = stylus({define: {'white': '#fff'}});
var fakeFile = new gutil.File({
var fakeFile = new File({
base: 'test/fixtures',
cwd: 'test/',
path: 'test/fixtures/define.styl',
Expand All @@ -99,7 +99,7 @@ describe('gulp-stylus', function() {

it ('should support defining variables in .styl files using gulp-data (data object attached to file)', function(done) {
var stream = stylus();
var fakeFile = new gutil.File({
var fakeFile = new File({
base: 'test/fixtures',
cwd: 'test/',
path: 'test/fixtures/define.styl',
Expand Down Expand Up @@ -127,7 +127,7 @@ describe('gulp-stylus', function() {
it('should skip css files', function(done) {
var stream = stylus();

var fakeFile = new gutil.File({
var fakeFile = new File({
base: 'test/fixtures',
cwd: 'test/',
path: 'test/fixtures/ie8.css',
Expand All @@ -151,7 +151,7 @@ describe('gulp-stylus', function() {

var file = 'test/fixtures/error.styl';

var fakeFile = new gutil.File({
var fakeFile = new File({
base: 'test/fixtures',
cwd: 'test/',
path: file,
Expand All @@ -170,7 +170,7 @@ describe('gulp-stylus', function() {

it ('should import nested and reverse recursive files', function(done) {
var stream = stylus();
var fakeFile = new gutil.File({
var fakeFile = new File({
base: 'test/fixtures',
cwd: 'test/',
path: 'test/fixtures/import.styl',
Expand All @@ -190,7 +190,7 @@ describe('gulp-stylus', function() {
it ('should generate sourcemaps', function(done) {
var stream = stylus({sourcemap: true});

var fakeFile = new gutil.File({
var fakeFile = new File({
base: 'test/fixtures',
cwd: 'test/',
path: 'test/fixtures/normal.styl',
Expand All @@ -217,7 +217,7 @@ describe('gulp-stylus', function() {
it ('should generate sourcemaps with gulp-sourcemaps', function(done) {
var stream = sourcemaps.init();

var fakeFile = new gutil.File({
var fakeFile = new File({
base: 'test/fixtures',
cwd: 'test/',
path: 'test/fixtures/normal.styl',
Expand Down Expand Up @@ -246,7 +246,7 @@ describe('gulp-stylus', function() {
it ('should use native stylus sourcemap options when provided', function(done) {
var stream = sourcemaps.init();

var fakeFile = new gutil.File({
var fakeFile = new File({
base: 'test',
cwd: 'test/',
path: 'test/fixtures/normal.styl',
Expand Down

0 comments on commit f222454

Please sign in to comment.