Skip to content

Commit

Permalink
Docs: Remove references to gulp-util
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 31, 2017
1 parent 3011cf9 commit fbc162f
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 29 deletions.
4 changes: 2 additions & 2 deletions docs/recipes/automate-release-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var runSequence = require('run-sequence');
var conventionalChangelog = require('gulp-conventional-changelog');
var conventionalGithubReleaser = require('conventional-github-releaser');
var bump = require('gulp-bump');
var gutil = require('gulp-util');
var log = require('gulplog');
var git = require('gulp-git');
var fs = require('fs');

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

Expand Down
4 changes: 2 additions & 2 deletions docs/recipes/browserify-multiple-destination.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The below `js` task bundles all the `.js` files under `src/` as entry points and
```js
var gulp = require('gulp');
var browserify = require('browserify');
var gutil = require('gulp-util');
var log = require('gulplog');
var tap = require('gulp-tap');
var buffer = require('gulp-buffer');
var sourcemaps = require('gulp-sourcemaps');
Expand All @@ -21,7 +21,7 @@ gulp.task('js', function () {
// transform file objects using gulp-tap plugin
.pipe(tap(function (file) {

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

// replace file contents with browserify's bundle stream
file.contents = browserify(file.path, {debug: true}).bundle();
Expand Down
4 changes: 2 additions & 2 deletions docs/recipes/browserify-transforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var browserify = require('browserify');
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var gutil = require('gulp-util');
var log = require('gulplog');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var reactify = require('reactify');
Expand All @@ -33,7 +33,7 @@ gulp.task('javascript', function () {
.pipe(sourcemaps.init({loadMaps: true}))
// Add transformation tasks to the pipeline here.
.pipe(uglify())
.on('error', gutil.log)
.on('error', log.error)
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dist/js/'));
});
Expand Down
4 changes: 2 additions & 2 deletions docs/recipes/browserify-uglify-sourcemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var gutil = require('gulp-util');
var log = require('gulplog');

gulp.task('javascript', function () {
// set up the browserify instance on a task basis
Expand All @@ -32,7 +32,7 @@ gulp.task('javascript', function () {
.pipe(sourcemaps.init({loadMaps: true}))
// Add transformation tasks to the pipeline here.
.pipe(uglify())
.on('error', gutil.log)
.on('error', log.error)
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dist/js/'));
});
Expand Down
4 changes: 2 additions & 2 deletions docs/recipes/browserify-with-globs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var globby = require('globby');
var through = require('through2');
var gutil = require('gulp-util');
var log = require('gulplog');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var reactify = require('reactify');
Expand All @@ -33,7 +33,7 @@ gulp.task('javascript', function () {
.pipe(sourcemaps.init({loadMaps: true}))
// Add gulp plugins to the pipeline here.
.pipe(uglify())
.on('error', gutil.log)
.on('error', log.error)
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dist/js/'));

Expand Down
6 changes: 3 additions & 3 deletions docs/recipes/fast-browserify-builds-with-watchify.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var browserify = require('browserify');
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var gutil = require('gulp-util');
var log = require('gulplog');
var sourcemaps = require('gulp-sourcemaps');
var assign = require('lodash.assign');

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

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

function bundle() {
return b.bundle()
// log errors if they happen
.on('error', gutil.log.bind(gutil, 'Browserify Error'))
.on('error', log.error.bind(log, 'Browserify Error'))
.pipe(source('bundle.js'))
// optional, remove if you don't need to buffer file contents
.pipe(buffer())
Expand Down
6 changes: 3 additions & 3 deletions docs/recipes/mocha-test-runner-with-gulp.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ gulp.task('default', function() {
### Running mocha tests when files change

```js
// npm install gulp gulp-mocha gulp-util
// npm install gulp gulp-mocha gulplog

var gulp = require('gulp');
var mocha = require('gulp-mocha');
var gutil = require('gulp-util');
var log = require('gulplog');

gulp.task('mocha', function() {
return gulp.src(['test/*.js'], { read: false })
.pipe(mocha({ reporter: 'list' }))
.on('error', gutil.log);
.on('error', log.error);
});

gulp.task('watch-mocha', function() {
Expand Down
11 changes: 5 additions & 6 deletions docs/writing-a-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ A simple example showing how to detect & handle each form is provided below, for
approach follow the links above.
```js
var PluginError = require('gulp-util').PluginError;
var PluginError = require('plugin-error');

// consts
var PLUGIN_NAME = 'gulp-example';
Expand Down Expand Up @@ -176,11 +176,10 @@ if (someCondition) {
## Useful resources
* [File object](https://github.com/gulpjs/gulp-util/#new-fileobj)
* [PluginError](https://github.com/gulpjs/gulp-util#new-pluginerrorpluginname-message-options)
* [event-stream](https://github.com/dominictarr/event-stream)
* [BufferStream](https://github.com/nfroidure/BufferStream)
* [gulp-util](https://github.com/gulpjs/gulp-util)
* [File object](https://github.com/gulpjs/vinyl)
* [PluginError](https://github.com/gulpjs/plugin-error)
* [through2](https://www.npmjs.com/package/through2)
* [bufferstreams](https://www.npmjs.com/package/bufferstreams)
## Sample plugins
Expand Down
3 changes: 1 addition & 2 deletions docs/writing-a-plugin/dealing-with-streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ Let's implement a plugin prepending some text to files. This plugin supports all

```js
var through = require('through2');
var gutil = require('gulp-util');
var PluginError = gutil.PluginError;
var PluginError = require('plugin-error');

// consts
const PLUGIN_NAME = 'gulp-prefixer';
Expand Down
5 changes: 2 additions & 3 deletions docs/writing-a-plugin/guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
- If you encounter an error **outside** the stream, such as invalid configuration while creating the stream, you may throw it.
1. Prefix any errors with the name of your plugin
- For example: `gulp-replace: Cannot do regexp replace on a stream`
- Use gulp-util's [PluginError](https://github.com/gulpjs/gulp-util#new-pluginerrorpluginname-message-options) class to make this easy
- Use [PluginError](https://github.com/gulpjs/plugin-error) module to make this easy
1. Name your plugin appropriately: it should begin with "gulp-" if it is a gulp plugin
- If it is not a gulp plugin, it should not begin with "gulp-"
1. The type of `file.contents` should always be the same going out as it was when it came in
Expand Down Expand Up @@ -58,8 +58,7 @@ npm is open for everyone, and you are free to make whatever you want but these g
```js
// through2 is a thin wrapper around node transform streams
var through = require('through2');
var gutil = require('gulp-util');
var PluginError = gutil.PluginError;
var PluginError = require('plugin-error');

// Consts
const PLUGIN_NAME = 'gulp-prefixer';
Expand Down
3 changes: 1 addition & 2 deletions docs/writing-a-plugin/using-buffers.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ If your plugin is relying on a buffer based library, you will probably choose to

```js
var through = require('through2');
var gutil = require('gulp-util');
var PluginError = gutil.PluginError;
var PluginError = require('plugin-error');

// consts
const PLUGIN_NAME = 'gulp-prefixer';
Expand Down

0 comments on commit fbc162f

Please sign in to comment.