Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

Commit

Permalink
Merge pull request #732 from ohbarye/drop-dependency-on-gulp-util
Browse files Browse the repository at this point in the history
Replace deprecated dependency gulp-util
  • Loading branch information
JeffreyWay authored Apr 9, 2018
2 parents 683c9d1 + 42356b9 commit cd3b44e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 15 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"license": "MIT",
"homepage": "https://github.com/laravel/elixir",
"dependencies": {
"chalk": "^2.3.0",
"clean-css": "^3.4.12",
"cli-table": "^0.3.1",
"del": "^2.2.0",
Expand All @@ -41,10 +42,11 @@
"gulp-shell": "^0.5.2",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"minimist": "^1.2.0",
"parse-filepath": "^1.0.1",
"path": "^0.12.7",
"q": "^1.4.1",
"replace-ext": "^1.0.0",
"require-dir": "^0.3.2",
"run-sequence": "^1.1.5",
"underscore": "^1.8.3",
Expand Down
11 changes: 7 additions & 4 deletions src/Log.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import gutil from 'gulp-util';
import MinimalTaskReporter from './reporters/MinimalTaskReporter';
import TaskReporter from './reporters/TaskReporter';
import parseArgs from 'minimist';
import chalk from 'chalk';

const env = parseArgs(process.argv.slice(2));

class Log {

/**
* Create a new Logger instance.
*/
constructor() {
this.minimal = gutil.env.minimal;
this.minimal = env.minimal;
}


Expand All @@ -20,7 +23,7 @@ class Log {
*/
heading(heading) {
return this.break().message(
gutil.colors.black(gutil.colors.bgGreen(heading))
chalk.black(chalk.bgGreen(heading))
);
};

Expand Down Expand Up @@ -98,7 +101,7 @@ class Log {
*/
error(message) {
this.break().message(
gutil.colors.bgRed(message)
chalk.bgRed(message)
);

return this;
Expand Down
8 changes: 5 additions & 3 deletions src/bootstrap/SetDependencies.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import gutils from 'gulp-util';
import parseArgs from 'minimist';

const env = parseArgs(process.argv.slice(2));

/**
* This object stores all of the various Elixir tasks.
Expand All @@ -11,15 +13,15 @@ Elixir.mixins = {};
/**
* Determine if Elixir is in "production" mode.
*/
if (Elixir.inProduction = gutils.env.production) {
if (Elixir.inProduction = env.production) {
process.env.NODE_ENV = 'production';
}


/**
* Determine if 'gulp watch' is being run.
*/
Elixir.isWatching = () => gutils.env._.indexOf('watch') > -1;
Elixir.isWatching = () => env._.indexOf('watch') > -1;


/**
Expand Down
6 changes: 3 additions & 3 deletions src/reporters/TaskReporter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs';
import gutil from 'gulp-util';
import chalk from 'chalk';
import Table from 'cli-table';

class TaskReporter {
Expand Down Expand Up @@ -79,10 +79,10 @@ class TaskReporter {
*/
colorize(file) {
if (this.fileExists(file)) {
return gutil.colors.green(file);
return chalk.green(file);
}

return gutil.colors.bgRed(file);
return chalk.bgRed(file);
}


Expand Down
6 changes: 4 additions & 2 deletions src/tasks/GulpBuilder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { has, intersection } from 'underscore';
import gutils from 'gulp-util';
import parseArgs from 'minimist';

const env = parseArgs(process.argv.slice(2));

class GulpBuilder {

Expand Down Expand Up @@ -56,7 +58,7 @@ class GulpBuilder {
* @return {Boolean}
*/
shouldRunAllTasksNamed(name) {
return intersection(gutils.env._, [name, 'watch', 'tdd']).length;
return intersection(env._, [name, 'watch', 'tdd']).length;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/tasks/GulpPaths.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import p from 'path';
import fs from 'fs';
import gutils from 'gulp-util';
import replaceExt from 'replace-ext';

class GulpPaths {

Expand Down Expand Up @@ -81,7 +81,7 @@ class GulpPaths {
* @return {string}
*/
changeExtension(path, newExtension) {
return gutils.replaceExtension(path, newExtension);
return replaceExt(path, newExtension);
}


Expand Down

0 comments on commit cd3b44e

Please sign in to comment.