Skip to content

Commit fbc162f

Browse files
committed
Docs: Remove references to gulp-util
1 parent 3011cf9 commit fbc162f

11 files changed

+25
-29
lines changed

docs/recipes/automate-release-workflow.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var runSequence = require('run-sequence');
1010
var conventionalChangelog = require('gulp-conventional-changelog');
1111
var conventionalGithubReleaser = require('conventional-github-releaser');
1212
var bump = require('gulp-bump');
13-
var gutil = require('gulp-util');
13+
var log = require('gulplog');
1414
var git = require('gulp-git');
1515
var fs = require('fs');
1616

@@ -38,7 +38,7 @@ gulp.task('bump-version', function () {
3838
// use minimist (https://www.npmjs.com/package/minimist) to determine with a
3939
// command argument whether you are doing a 'major', 'minor' or a 'patch' change.
4040
return gulp.src(['./bower.json', './package.json'])
41-
.pipe(bump({type: "patch"}).on('error', gutil.log))
41+
.pipe(bump({type: "patch"}).on('error', log.error))
4242
.pipe(gulp.dest('./'));
4343
});
4444

docs/recipes/browserify-multiple-destination.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The below `js` task bundles all the `.js` files under `src/` as entry points and
88
```js
99
var gulp = require('gulp');
1010
var browserify = require('browserify');
11-
var gutil = require('gulp-util');
11+
var log = require('gulplog');
1212
var tap = require('gulp-tap');
1313
var buffer = require('gulp-buffer');
1414
var sourcemaps = require('gulp-sourcemaps');
@@ -21,7 +21,7 @@ gulp.task('js', function () {
2121
// transform file objects using gulp-tap plugin
2222
.pipe(tap(function (file) {
2323

24-
gutil.log('bundling ' + file.path);
24+
log.info('bundling ' + file.path);
2525

2626
// replace file contents with browserify's bundle stream
2727
file.contents = browserify(file.path, {debug: true}).bundle();

docs/recipes/browserify-transforms.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var browserify = require('browserify');
1313
var gulp = require('gulp');
1414
var source = require('vinyl-source-stream');
1515
var buffer = require('vinyl-buffer');
16-
var gutil = require('gulp-util');
16+
var log = require('gulplog');
1717
var uglify = require('gulp-uglify');
1818
var sourcemaps = require('gulp-sourcemaps');
1919
var reactify = require('reactify');
@@ -33,7 +33,7 @@ gulp.task('javascript', function () {
3333
.pipe(sourcemaps.init({loadMaps: true}))
3434
// Add transformation tasks to the pipeline here.
3535
.pipe(uglify())
36-
.on('error', gutil.log)
36+
.on('error', log.error)
3737
.pipe(sourcemaps.write('./'))
3838
.pipe(gulp.dest('./dist/js/'));
3939
});

docs/recipes/browserify-uglify-sourcemap.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var source = require('vinyl-source-stream');
1717
var buffer = require('vinyl-buffer');
1818
var uglify = require('gulp-uglify');
1919
var sourcemaps = require('gulp-sourcemaps');
20-
var gutil = require('gulp-util');
20+
var log = require('gulplog');
2121

2222
gulp.task('javascript', function () {
2323
// set up the browserify instance on a task basis
@@ -32,7 +32,7 @@ gulp.task('javascript', function () {
3232
.pipe(sourcemaps.init({loadMaps: true}))
3333
// Add transformation tasks to the pipeline here.
3434
.pipe(uglify())
35-
.on('error', gutil.log)
35+
.on('error', log.error)
3636
.pipe(sourcemaps.write('./'))
3737
.pipe(gulp.dest('./dist/js/'));
3838
});

docs/recipes/browserify-with-globs.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var source = require('vinyl-source-stream');
1414
var buffer = require('vinyl-buffer');
1515
var globby = require('globby');
1616
var through = require('through2');
17-
var gutil = require('gulp-util');
17+
var log = require('gulplog');
1818
var uglify = require('gulp-uglify');
1919
var sourcemaps = require('gulp-sourcemaps');
2020
var reactify = require('reactify');
@@ -33,7 +33,7 @@ gulp.task('javascript', function () {
3333
.pipe(sourcemaps.init({loadMaps: true}))
3434
// Add gulp plugins to the pipeline here.
3535
.pipe(uglify())
36-
.on('error', gutil.log)
36+
.on('error', log.error)
3737
.pipe(sourcemaps.write('./'))
3838
.pipe(gulp.dest('./dist/js/'));
3939

docs/recipes/fast-browserify-builds-with-watchify.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var browserify = require('browserify');
1414
var gulp = require('gulp');
1515
var source = require('vinyl-source-stream');
1616
var buffer = require('vinyl-buffer');
17-
var gutil = require('gulp-util');
17+
var log = require('gulplog');
1818
var sourcemaps = require('gulp-sourcemaps');
1919
var assign = require('lodash.assign');
2020

@@ -31,12 +31,12 @@ var b = watchify(browserify(opts));
3131

3232
gulp.task('js', bundle); // so you can run `gulp js` to build the file
3333
b.on('update', bundle); // on any dep update, runs the bundler
34-
b.on('log', gutil.log); // output build logs to terminal
34+
b.on('log', log.info); // output build logs to terminal
3535

3636
function bundle() {
3737
return b.bundle()
3838
// log errors if they happen
39-
.on('error', gutil.log.bind(gutil, 'Browserify Error'))
39+
.on('error', log.error.bind(log, 'Browserify Error'))
4040
.pipe(source('bundle.js'))
4141
// optional, remove if you don't need to buffer file contents
4242
.pipe(buffer())

docs/recipes/mocha-test-runner-with-gulp.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ gulp.task('default', function() {
2222
### Running mocha tests when files change
2323

2424
```js
25-
// npm install gulp gulp-mocha gulp-util
25+
// npm install gulp gulp-mocha gulplog
2626

2727
var gulp = require('gulp');
2828
var mocha = require('gulp-mocha');
29-
var gutil = require('gulp-util');
29+
var log = require('gulplog');
3030

3131
gulp.task('mocha', function() {
3232
return gulp.src(['test/*.js'], { read: false })
3333
.pipe(mocha({ reporter: 'list' }))
34-
.on('error', gutil.log);
34+
.on('error', log.error);
3535
});
3636

3737
gulp.task('watch-mocha', function() {

docs/writing-a-plugin/README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ A simple example showing how to detect & handle each form is provided below, for
126126
approach follow the links above.
127127
128128
```js
129-
var PluginError = require('gulp-util').PluginError;
129+
var PluginError = require('plugin-error');
130130

131131
// consts
132132
var PLUGIN_NAME = 'gulp-example';
@@ -176,11 +176,10 @@ if (someCondition) {
176176
177177
## Useful resources
178178
179-
* [File object](https://github.com/gulpjs/gulp-util/#new-fileobj)
180-
* [PluginError](https://github.com/gulpjs/gulp-util#new-pluginerrorpluginname-message-options)
181-
* [event-stream](https://github.com/dominictarr/event-stream)
182-
* [BufferStream](https://github.com/nfroidure/BufferStream)
183-
* [gulp-util](https://github.com/gulpjs/gulp-util)
179+
* [File object](https://github.com/gulpjs/vinyl)
180+
* [PluginError](https://github.com/gulpjs/plugin-error)
181+
* [through2](https://www.npmjs.com/package/through2)
182+
* [bufferstreams](https://www.npmjs.com/package/bufferstreams)
184183
185184
186185
## Sample plugins

docs/writing-a-plugin/dealing-with-streams.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ Let's implement a plugin prepending some text to files. This plugin supports all
1212

1313
```js
1414
var through = require('through2');
15-
var gutil = require('gulp-util');
16-
var PluginError = gutil.PluginError;
15+
var PluginError = require('plugin-error');
1716

1817
// consts
1918
const PLUGIN_NAME = 'gulp-prefixer';

docs/writing-a-plugin/guidelines.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
- If you encounter an error **outside** the stream, such as invalid configuration while creating the stream, you may throw it.
3131
1. Prefix any errors with the name of your plugin
3232
- For example: `gulp-replace: Cannot do regexp replace on a stream`
33-
- Use gulp-util's [PluginError](https://github.com/gulpjs/gulp-util#new-pluginerrorpluginname-message-options) class to make this easy
33+
- Use [PluginError](https://github.com/gulpjs/plugin-error) module to make this easy
3434
1. Name your plugin appropriately: it should begin with "gulp-" if it is a gulp plugin
3535
- If it is not a gulp plugin, it should not begin with "gulp-"
3636
1. The type of `file.contents` should always be the same going out as it was when it came in
@@ -58,8 +58,7 @@ npm is open for everyone, and you are free to make whatever you want but these g
5858
```js
5959
// through2 is a thin wrapper around node transform streams
6060
var through = require('through2');
61-
var gutil = require('gulp-util');
62-
var PluginError = gutil.PluginError;
61+
var PluginError = require('plugin-error');
6362

6463
// Consts
6564
const PLUGIN_NAME = 'gulp-prefixer';

docs/writing-a-plugin/using-buffers.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ If your plugin is relying on a buffer based library, you will probably choose to
99

1010
```js
1111
var through = require('through2');
12-
var gutil = require('gulp-util');
13-
var PluginError = gutil.PluginError;
12+
var PluginError = require('plugin-error');
1413

1514
// consts
1615
const PLUGIN_NAME = 'gulp-prefixer';

0 commit comments

Comments
 (0)