From ddd21d36da4dbe0bb9f25603c2098cb35bc7ceae Mon Sep 17 00:00:00 2001 From: Charles Samborski Date: Fri, 29 Dec 2017 23:32:40 +0100 Subject: [PATCH 1/2] Drop dependency on deprecated `gulp-util` Closes slushjs/gulp-install#52 --- .gitignore | 2 ++ index.js | 9 +++++---- package.json | 4 +++- test/install-test.js | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index d99bfce..2187f6e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .DS_Store node_modules/ temp/ +package-lock.json +yarn.lock diff --git a/index.js b/index.js index ded69ce..9a74604 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,8 @@ const path = require('path'); const through2 = require('through2'); const dargs = require('dargs'); -const gutil = require('gulp-util'); +const fancyLog = require('fancy-log'); +const chalk = require('chalk'); const groupBy = require('lodash.groupby'); const PQueue = require('p-queue'); const commandRunner = require('./lib/command-runner'); @@ -85,7 +86,7 @@ module.exports = function (opts = {}, done = noop) { return cb(); } if (skipInstall()) { - log('Skipping install.', 'Run `' + gutil.colors.yellow(formatCommands(toRun)) + '` manually'); + log('Skipping install.', 'Run `' + chalk.yellow(formatCommands(toRun)) + '` manually'); return cb(); } const groupedCommands = groupBy(toRun, 'cmd'); @@ -103,7 +104,7 @@ module.exports = function (opts = {}, done = noop) { function logFailure(command) { return promise => { return promise.catch(err => { - log(err.message, ', run `' + gutil.colors.yellow(formatCommand(command)) + '` manually'); + log(err.message, ', run `' + chalk.yellow(formatCommand(command)) + '` manually'); throw err; }); }; @@ -113,7 +114,7 @@ function log(...args) { if (isTest()) { return; } - gutil.log(...args); + fancyLog(...args); } function formatCommands(cmds) { diff --git a/package.json b/package.json index 77d9b68..906079e 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,9 @@ }, "homepage": "https://github.com/slushjs/gulp-install", "dependencies": { + "chalk": "^2.3.0", "dargs": "^5.1.0", - "gulp-util": "^3.0.7", + "fancy-log": "^1.3.2", "lodash.groupby": "^4.6.0", "p-queue": "^1.0.0", "through2": "^2.0.3", @@ -34,6 +35,7 @@ "chai": "^3.2.0", "mocha": "^3.2.0", "standard-version": "^4.0.0", + "vinyl": "^2.1.0", "xo": "^0.18.0" }, "xo": { diff --git a/test/install-test.js b/test/install-test.js index e35bf78..9934536 100644 --- a/test/install-test.js +++ b/test/install-test.js @@ -3,7 +3,7 @@ 'use strict'; const path = require('path'); const chai = require('chai'); -const gutil = require('gulp-util'); +const Vinyl = require('vinyl'); const commandRunner = require('../lib/command-runner'); const install = require('../.'); @@ -12,7 +12,7 @@ const args = process.argv.slice(); function fixture(file) { const filepath = path.join(__dirname, file); - return new gutil.File({ + return new Vinyl({ path: filepath, cwd: __dirname, base: path.join(__dirname, path.dirname(file)), From 43e75a679dcfb9ac541723f2883a08b54b2b1658 Mon Sep 17 00:00:00 2001 From: Charles Samborski Date: Fri, 6 Apr 2018 18:19:03 +0200 Subject: [PATCH 2/2] Update .gitignore --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2187f6e..d99bfce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ .DS_Store node_modules/ temp/ -package-lock.json -yarn.lock