Skip to content
This repository was archived by the owner on Sep 15, 2023. It is now read-only.

Commit 6626413

Browse files
dillonbaileybenjtinsley
authored andcommitted
Replace gulp-util
Signed-off-by: Dillon Bailey <dillon@honestfox.com.au>
1 parent 12475be commit 6626413

File tree

10 files changed

+55
-46
lines changed

10 files changed

+55
-46
lines changed

extras/tasks/iconFont/generateIconSass.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ var gulp = require('gulp')
22
var render = require('gulp-nunjucks-render')
33
var rename = require('gulp-rename')
44
var handleErrors = require('../../lib/handleErrors')
5-
var gutil = require('gulp-util')
5+
var log = require('fancy-log')
6+
var colors = require('ansi-colors')
67
var data = require('gulp-data')
78

89
module.exports = function(config) {
910
return function(glyphs, options) {
10-
gutil.log(gutil.colors.blue('Generating ' + config.sassDest + '/' + config.sassOutputName))
11+
log(colors.blue('Generating ' + config.sassDest + '/' + config.sassOutputName))
1112
render.nunjucks.configure(config.nunjucks, { watch: false })
1213

1314
return gulp.src(config.template)
1415
.pipe(data({
1516
icons: glyphs.map(function(glyph) {
16-
gutil.log(gutil.colors.green('+ adding ' + glyph.name + ' glyph'))
17+
log(colors.green('+ adding ' + glyph.name + ' glyph'))
1718
return {
1819
name: glyph.name,
1920
code: glyph.unicode[0].charCodeAt(0).toString(16).toUpperCase()

extras/tasks/server.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ var compress = require('compression')
22
var config = require('../config')
33
var express = require('express')
44
var gulp = require('gulp')
5-
var gutil = require('gulp-util')
5+
var log = require('fancy-log')
6+
var colors = require('ansi-colors')
67
var logger = require('morgan')
78
var open = require('open')
89
var path = require('path')
@@ -26,7 +27,7 @@ var serverTask = function() {
2627
.use('/', express.static(settings.root, settings.staticOptions))
2728
.listen(settings.port)
2829

29-
gutil.log('production server started on ' + gutil.colors.green(url))
30+
log('production server started on ' + colors.green(url))
3031
open(url)
3132
}
3233

gulpfile.js/lib/compileLogger.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
var gutil = require("gulp-util")
1+
var PluginError = require('plugin-error')
2+
var log = require('fancy-log')
3+
var colors = require('ansi-colors')
24
var prettifyTime = require('./prettifyTime')
35
var handleErrors = require('./handleErrors')
46

57
module.exports = function(err, stats) {
6-
if(err) throw new gutil.PluginError("webpack", err)
8+
if(err) throw new PluginError("webpack", err)
79

810
var statColor = stats.compilation.warnings.length < 1 ? 'green' : 'yellow'
911

@@ -14,7 +16,7 @@ module.exports = function(err, stats) {
1416
})
1517
} else {
1618
var compileTime = prettifyTime(stats.endTime - stats.startTime)
17-
gutil.log(gutil.colors[statColor](stats))
18-
gutil.log('Compiled with', gutil.colors.cyan('webpack'), 'in', gutil.colors.magenta(compileTime))
19+
log(colors[statColor](stats))
20+
log('Compiled with', colors.cyan('webpack'), 'in', colors.magenta(compileTime))
1921
}
2022
}

gulpfile.js/tasks/http2-upgrade.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
const gulp = require('gulp')
2-
const gutil = require('gulp-util')
2+
const log = require('fancy-log')
3+
const colors = require('ansi-colors')
34
const mergeStream = require('merge-stream')
45
const path = require('path')
56
const del = require('del')
67

78
gulp.task('http2-upgrade', function() {
89
del([path.resolve(process.env.PWD, PATH_CONFIG.src, PATH_CONFIG.stylesheets.src)], { force: true })
9-
gutil.log(gutil.colors.green('Cleaned stylesheets directory'))
10+
log(colors.green('Cleaned stylesheets directory'))
1011

1112
const configStream = gulp.src('extras/http2/**/*')
1213
.pipe(gulp.dest(process.env.PWD))
1314

1415
const srcStream = gulp.src(['src/stylesheets', 'src/javascripts', 'src/html'])
1516
.pipe(gulp.dest(path.join(process.env.PWD, PATH_CONFIG.src)))
1617

17-
gutil.log(gutil.colors.green('Created HTTP/2 ready stylesheets directory'))
18-
gutil.log(gutil.colors.green('Added some HTTP/2 helpers to the html directory'))
19-
gutil.log(gutil.colors.green('Created config/path-config.json'))
18+
log(colors.green('Created HTTP/2 ready stylesheets directory'))
19+
log(colors.green('Added some HTTP/2 helpers to the html directory'))
20+
log(colors.green('Created config/path-config.json'))
2021

2122
return mergeStream(configStream, srcStream)
2223
})

gulpfile.js/tasks/init-config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
var gulp = require('gulp')
2-
var gutil = require('gulp-util')
2+
var log = require('fancy-log')
3+
var colors = require('ansi-colors')
34
var path = require('path')
45
var merge = require('merge-stream')
56

67
gulp.task('init-config', function() {
78
var configStream = gulp.src(['gulpfile.js/path-config.json', 'gulpfile.js/task-config.js'])
89
.pipe(gulp.dest(path.join(process.env.PWD, 'config')))
910

10-
gutil.log(gutil.colors.green('Adding default path-config.json and task-config.js files to ./config/'))
11+
log(colors.green('Adding default path-config.json and task-config.js files to ./config/'))
1112

1213
return configStream
1314
})

gulpfile.js/tasks/init-craft.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const gulp = require('gulp')
2-
const gutil = require('gulp-util')
2+
const log = require('fancy-log')
3+
const colors = require('ansi-colors')
34
const mergeStream = require('merge-stream')
45
const path = require('path')
56

@@ -11,11 +12,11 @@ gulp.task('init-craft', function() {
1112
.pipe(gulp.dest(path.join(process.env.PWD, PATH_CONFIG.src)))
1213

1314

14-
gutil.log(gutil.colors.green('Added gulpRev plugin to craft/plugins/gulprev!'))
15-
gutil.log(gutil.colors.green('Created config/path-config.json'))
16-
gutil.log(gutil.colors.green('Created config/task-config.js'))
17-
gutil.log(
18-
gutil.colors.green(`Blendid is configured for Craft!
15+
log(colors.green('Added gulpRev plugin to craft/plugins/gulprev!'))
16+
log(colors.green('Created config/path-config.json'))
17+
log(colors.green('Created config/task-config.js'))
18+
log(
19+
colors.green(`Blendid is configured for Craft!
1920
2021
Next Steps
2122
==========

gulpfile.js/tasks/init-drupal.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const gulp = require('gulp')
2-
const gutil = require('gulp-util')
2+
const log = require('fancy-log')
3+
const colors = require('ansi-colors')
34
const rename = require('gulp-rename')
45
const replace = require('gulp-replace')
56
const mergeStream = require('merge-stream')
@@ -18,15 +19,15 @@ gulp.task('init-drupal', function() {
1819
const srcStream = gulp.src(['extras/drupal/src/**/*', '*.gitkeep'])
1920
.pipe(gulp.dest(path.join(process.env.PWD, PATH_CONFIG.src)))
2021

21-
gutil.log(gutil.colors.green('Created config/path-config.json'))
22-
gutil.log(gutil.colors.green('Created config/task-config.js'))
23-
gutil.log(gutil.colors.green('Created config/install/'+ envBasename +'.settings.yml'))
24-
gutil.log(gutil.colors.green('Created config/schema/'+ envBasename +'.schema.yml'))
25-
gutil.log(gutil.colors.green('Created '+ envBasename +'.info.yml'))
26-
gutil.log(gutil.colors.green('Created '+ envBasename +'.libraries.yml'))
27-
gutil.log(gutil.colors.green('Created '+ envBasename +'.theme'))
28-
gutil.log(
29-
gutil.colors.green(`Blendid is configured for Drupal!
22+
log(colors.green('Created config/path-config.json'))
23+
log(colors.green('Created config/task-config.js'))
24+
log(colors.green('Created config/install/'+ envBasename +'.settings.yml'))
25+
log(colors.green('Created config/schema/'+ envBasename +'.schema.yml'))
26+
log(colors.green('Created '+ envBasename +'.info.yml'))
27+
log(colors.green('Created '+ envBasename +'.libraries.yml'))
28+
log(colors.green('Created '+ envBasename +'.theme'))
29+
log(
30+
colors.green(`Blendid is configured for Drupal!
3031
3132
Next Steps
3233
==========

gulpfile.js/tasks/init-rails.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
var gulp = require('gulp')
2-
var gutil = require('gulp-util')
2+
var log = require('fancy-log')
3+
var colors = require('ansi-colors')
34

45
gulp.task('init-rails', function() {
56
var stream = gulp.src(['extras/rails/**/*', '*!README.md'])
67
.pipe(gulp.dest(process.env.PWD))
78

8-
gutil.log(gutil.colors.green('Created app/helpers/blendid_asset_helper.rb'))
9-
gutil.log(gutil.colors.green('Created config/initializers/blendid.rb'))
10-
gutil.log(gutil.colors.green('Created config/deploy.rb.example'))
11-
gutil.log(
12-
gutil.colors.yellow(`
9+
log(colors.green('Created app/helpers/blendid_asset_helper.rb'))
10+
log(colors.green('Created config/initializers/blendid.rb'))
11+
log(colors.green('Created config/deploy.rb.example'))
12+
log(
13+
colors.yellow(`
1314
1415
Using Capistrano? Add the following to deploy.rb so assets will compile on deploy:
15-
`), gutil.colors.magenta(`
16+
`), colors.magenta(`
1617
namespace :deploy do
1718
namespace :npm do
1819
task :install, :roles => :app do
@@ -26,11 +27,11 @@ end
2627
# Run NPM install after assets:precompile
2728
before "deploy:assets:precompile", "deploy:npm:install"
2829
29-
`), gutil.colors.magenta(`
30+
`), colors.magenta(`
3031
3132
Make sure to add 'public/assets' to your .gitignore file.
3233
33-
`), gutil.colors.magenta(`
34+
`), colors.magenta(`
3435
Update the script and stylesheet tags in your layout with the blendid asset helpers:
3536
3637
<link rel="stylesheet" href="<%= blendid_css_path('app.css') %>" />

gulpfile.js/tasks/init.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var gulp = require('gulp')
2-
var gutil = require('gulp-util')
2+
var log = require('fancy-log')
3+
var colors = require('ansi-colors')
34
var path = require('path')
45
var merge = require('merge-stream')
56

@@ -13,10 +14,10 @@ gulp.task('init', function() {
1314
var srcStream = gulp.src(['src/**/*', '*.gitkeep'])
1415
.pipe(gulp.dest(path.join(process.env.PWD, PATH_CONFIG.src)))
1516

16-
gutil.log(gutil.colors.green('Generating default Blendid project files'))
17-
gutil.log(gutil.colors.yellow(`
17+
log(colors.green('Generating default Blendid project files'))
18+
log(colors.yellow(`
1819
To start the dev server:
19-
`), gutil.colors.magenta(`
20+
`), colors.magenta(`
2021
yarn run blendid
2122
,`))
2223

gulpfile.js/tasks/rev/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
if(!TASK_CONFIG.production.rev) return
22

33
var gulp = require('gulp')
4-
var gutil = require('gulp-util')
54
var gulpSequence = require('gulp-sequence')
65

76
var updateHtml = TASK_CONFIG.html ? 'update-html' : false

0 commit comments

Comments
 (0)