diff --git a/.gitignore b/.gitignore index a72b52eb..aee282c4 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,7 @@ results npm-debug.log node_modules +yarn.lock +package-lock.json + +.idea diff --git a/.travis.yml b/.travis.yml index 52b91281..ec3a5b93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: node_js node_js: - - "0.10" - - node - - iojs + - "lts/argon" + - "lts/boron" + - "lts/carbon" + - "node" sudo: false diff --git a/CHANGELOG.md b/CHANGELOG.md index b65d4673..c7da85a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Gulp Sass Changelog +## v4.0.0 +**Upcoming** + +* **Breaking change** Drop support for Node for versions that reached end of life (`< 4`). + +## v3.1.0 +**January 9, 2017** + +* **Change** ⬆️ Bump to Node Sass 4.2.0 + +## v3.0.0 +**December 10, 2016** + +* **Breaking change** ⬆️ Bump to Node Sass 4.0.0 + +## v2.3.2 +**June 15, 2016** + +* **Fix** Prevent options from leaking between compilations +* **Chore** Update dependencies + +## v2.1.0 to v2.3.1 + +(missing, please open a PR if you wish to fill the gap) + ## v2.1.0-beta **September 21, 2015** diff --git a/index.js b/index.js index cb7009ec..e46afc5d 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,9 @@ 'use strict'; -var gutil = require('gulp-util'); +var chalk = require('chalk'); +var PluginError = require('plugin-error'); +var replaceExtension = require('replace-ext'); +var stripAnsi = require('strip-ansi'); var through = require('through2'); var clonedeep = require('lodash.clonedeep'); var path = require('path'); @@ -23,13 +26,13 @@ var gulpSass = function gulpSass(options, sync) { return cb(null, file); } if (file.isStream()) { - return cb(new gutil.PluginError(PLUGIN_NAME, 'Streaming not supported')); + return cb(new PluginError(PLUGIN_NAME, 'Streaming not supported')); } if (path.basename(file.path).indexOf('_') === 0) { return cb(); } if (!file.contents.length) { - file.path = gutil.replaceExtension(file.path, '.css'); + file.path = replaceExtension(file.path, '.css'); return cb(null, file); } @@ -100,13 +103,13 @@ var gulpSass = function gulpSass(options, sync) { }); // Replace the map file with the original file name (but new extension) - sassMap.file = gutil.replaceExtension(sassFileSrc, '.css'); + sassMap.file = replaceExtension(sassFileSrc, '.css'); // Apply the map applySourceMap(file, sassMap); } file.contents = sassObj.css; - file.path = gutil.replaceExtension(file.path, '.css'); + file.path = replaceExtension(file.path, '.css'); cb(null, file); }; @@ -122,16 +125,16 @@ var gulpSass = function gulpSass(options, sync) { filePath = filePath ? filePath : file.path; relativePath = path.relative(process.cwd(), filePath); - message += gutil.colors.underline(relativePath) + '\n'; + message += chalk.underline(relativePath) + '\n'; message += error.formatted; error.messageFormatted = message; error.messageOriginal = error.message; - error.message = gutil.colors.stripColor(message); + error.message = stripAnsi(message); error.relativePath = relativePath; - return cb(new gutil.PluginError( + return cb(new PluginError( PLUGIN_NAME, error )); }; @@ -176,7 +179,7 @@ gulpSass.sync = function sync(options) { // Log errors nicely ////////////////////////////// gulpSass.logError = function logError(error) { - var message = new gutil.PluginError('sass', error.messageFormatted).toString(); + var message = new PluginError('sass', error.messageFormatted).toString(); process.stderr.write(message + '\n'); this.emit('end'); }; diff --git a/package.json b/package.json index c9b94376..68165f41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-sass", - "version": "3.1.0", + "version": "4.0.0", "description": "Gulp plugin for sass", "main": "index.js", "scripts": { @@ -20,10 +20,16 @@ "bugs": { "url": "https://github.com/dlmanning/gulp-sass/issues" }, + "engines": { + "node": ">=4.0.0" + }, "dependencies": { - "gulp-util": "^3.0", + "chalk": "^2.3.0", "lodash.clonedeep": "^4.3.2", "node-sass": "^4.2.0", + "plugin-error": "^0.1.2", + "replace-ext": "^1.0.0", + "strip-ansi": "^4.0.0", "through2": "^2.0.0", "vinyl-sourcemaps-apply": "^0.2.0" }, @@ -37,6 +43,7 @@ "gulp-tap": "^0.1.3", "mocha": "^2.2.1", "rimraf": "^2.4.3", - "should": "^8.3.1" + "should": "^8.3.1", + "vinyl": "^2.1.0" } } diff --git a/test/main.js b/test/main.js index 601a4dc3..782ae6f5 100644 --- a/test/main.js +++ b/test/main.js @@ -1,7 +1,7 @@ 'use strict'; var should = require('should'); -var gutil = require('gulp-util'); +var Vinyl = require('vinyl'); var path = require('path'); var fs = require('fs'); var sass = require('../index'); @@ -17,7 +17,7 @@ var createVinyl = function createVinyl(filename, contents) { var base = path.join(__dirname, 'scss'); var filePath = path.join(base, filename); - return new gutil.File({ + return new Vinyl({ 'cwd': __dirname, 'base': base, 'path': filePath,