Skip to content

Commit 2bbe2fa

Browse files
committed
Meta tweaks
1 parent de0537f commit 2bbe2fa

File tree

4 files changed

+66
-59
lines changed

4 files changed

+66
-59
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ function transformFilename(file) {
4343
});
4444
}
4545

46-
const getManifestFile = opts => vinylFile.read(opts.path, opts).catch(err => {
47-
if (err.code === 'ENOENT') {
46+
const getManifestFile = opts => vinylFile.read(opts.path, opts).catch(error => {
47+
if (error.code === 'ENOENT') {
4848
return new Vinyl(opts);
4949
}
5050

51-
throw err;
51+
throw error;
5252
});
5353

5454
const plugin = () => {

package.json

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
{
2-
"name": "gulp-rev",
3-
"version": "8.1.1",
4-
"description": "Static asset revisioning by appending content hash to filenames: unicorn.css => unicorn-d41d8cd98f.css",
5-
"license": "MIT",
6-
"repository": "sindresorhus/gulp-rev",
7-
"author": {
8-
"name": "Sindre Sorhus",
9-
"email": "[email protected]",
10-
"url": "sindresorhus.com"
11-
},
12-
"engines": {
13-
"node": ">=6"
14-
},
15-
"scripts": {
16-
"test": "xo && ava"
17-
},
18-
"files": [
19-
"index.js"
20-
],
21-
"keywords": [
22-
"gulpplugin",
23-
"rev",
24-
"revving",
25-
"revision",
26-
"hash",
27-
"optimize",
28-
"version",
29-
"versioning",
30-
"cache",
31-
"expire",
32-
"static",
33-
"asset",
34-
"assets"
35-
],
36-
"dependencies": {
37-
"modify-filename": "^1.1.0",
38-
"plugin-error": "^1.0.1",
39-
"rev-hash": "^2.0.0",
40-
"rev-path": "^2.0.0",
41-
"sort-keys": "^2.0.0",
42-
"through2": "^2.0.0",
43-
"vinyl": "^2.1.0",
44-
"vinyl-file": "^3.0.0"
45-
},
46-
"devDependencies": {
47-
"ava": "*",
48-
"p-event": "^1.0.0",
49-
"xo": "*"
50-
}
2+
"name": "gulp-rev",
3+
"version": "8.1.1",
4+
"description": "Static asset revisioning by appending content hash to filenames: unicorn.css => unicorn-d41d8cd98f.css",
5+
"license": "MIT",
6+
"repository": "sindresorhus/gulp-rev",
7+
"author": {
8+
"name": "Sindre Sorhus",
9+
"email": "[email protected]",
10+
"url": "sindresorhus.com"
11+
},
12+
"engines": {
13+
"node": ">=6"
14+
},
15+
"scripts": {
16+
"test": "xo && ava"
17+
},
18+
"files": [
19+
"index.js"
20+
],
21+
"keywords": [
22+
"gulpplugin",
23+
"rev",
24+
"revving",
25+
"revision",
26+
"hash",
27+
"optimize",
28+
"version",
29+
"versioning",
30+
"cache",
31+
"expire",
32+
"static",
33+
"asset",
34+
"assets"
35+
],
36+
"dependencies": {
37+
"modify-filename": "^1.1.0",
38+
"plugin-error": "^1.0.1",
39+
"rev-hash": "^2.0.0",
40+
"rev-path": "^2.0.0",
41+
"sort-keys": "^2.0.0",
42+
"through2": "^2.0.0",
43+
"vinyl": "^2.1.0",
44+
"vinyl-file": "^3.0.0"
45+
},
46+
"devDependencies": {
47+
"ava": "^0.25.0",
48+
"p-event": "^2.1.0",
49+
"xo": "^0.23.0"
50+
}
5151
}

readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const gulp = require('gulp');
9797
const rev = require('gulp-rev');
9898

9999
gulp.task('default', () =>
100-
// by default, gulp would pick `assets/css` as the base,
100+
// By default, Gulp would pick `assets/css` as the base,
101101
// so we need to set it explicitly:
102102
gulp.src(['assets/css/*.css', 'assets/js/*.js'], {base: 'assets'})
103103
.pipe(gulp.dest('build/assets')) // copy original assets to build dir
@@ -124,15 +124,15 @@ const gulp = require('gulp');
124124
const rev = require('gulp-rev');
125125

126126
gulp.task('default', () =>
127-
// by default, gulp would pick `assets/css` as the base,
127+
// By default, Gulp would pick `assets/css` as the base,
128128
// so we need to set it explicitly:
129129
gulp.src(['assets/css/*.css', 'assets/js/*.js'], {base: 'assets'})
130130
.pipe(gulp.dest('build/assets'))
131131
.pipe(rev())
132132
.pipe(gulp.dest('build/assets'))
133133
.pipe(rev.manifest({
134134
base: 'build/assets',
135-
merge: true // merge with the existing manifest if one exists
135+
merge: true // Merge with the existing manifest if one exists
136136
}))
137137
.pipe(gulp.dest('build/assets'))
138138
);
@@ -158,7 +158,7 @@ gulp.task('default', () =>
158158
.pipe(rev())
159159
.pipe(sourcemaps.write('.'))
160160
.pipe(gulp.dest('dist'))
161-
)
161+
);
162162
```
163163

164164

test/helpers/index.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
import Vinyl from 'vinyl';
22

3-
function createFile({path, revOrigPath, revOrigBase, origName, revName, cwd, base, contents = ''}) {
3+
export default function createFile({
4+
path,
5+
revOrigPath,
6+
revOrigBase,
7+
origName,
8+
revName,
9+
cwd,
10+
base,
11+
contents = ''
12+
}) {
413
const file = new Vinyl({
514
path,
615
cwd,
@@ -14,5 +23,3 @@ function createFile({path, revOrigPath, revOrigBase, origName, revName, cwd, bas
1423

1524
return file;
1625
}
17-
18-
export default createFile;

0 commit comments

Comments
 (0)