Skip to content

Commit 31373e0

Browse files
committed
Updated dependencies
1 parent 842ea7c commit 31373e0

File tree

7 files changed

+6164
-3314
lines changed

7 files changed

+6164
-3314
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ install:
1111
after_success: npm run coveralls
1212
node_js:
1313
- "node"
14-
- "6"
15-
- "5"
16-
- "4"
14+
- "14"
15+
- "12"
16+
- "10"

automation/building.js

+29-29
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ var fs = require('fs');
1010
var settings = require('./settings.json');
1111
var shared = require('./shared.js');
1212

13-
gulp.task("clean", function(){
14-
return gulp.src(["bin/", "dist/"], {read: false})
13+
gulp.task("clean", gulp.series(function () {
14+
return gulp.src(["bin/", "dist/"], { read: false })
1515
.pipe(clean());
16-
});
16+
}));
1717

1818

19-
gulp.task("babel", function () {
19+
gulp.task("babel", gulp.series(function () {
2020
return babelFunc();
21-
});
21+
}));
2222

2323

24-
function babelFunc(){
24+
function babelFunc() {
2525
return gulp.src("src/**/*")
2626
.pipe(babel({
2727
presets: ['es2015', 'stage-3']
@@ -30,30 +30,30 @@ function babelFunc(){
3030
}
3131

3232

33-
gulp.task("webpack", ["babel"], function () {
33+
gulp.task("webpack", gulp.series(["babel"], function () {
3434
return webpackFunc();
35-
});
35+
}));
3636

3737

38-
function webpackFunc(){
38+
function webpackFunc() {
3939
return gulp.src('bin/JsBarcode.js')
4040
.pipe(gulpWebpack(
4141
{
4242
output: {
4343
filename: 'JsBarcode.all.js'
4444
}
4545
}
46-
, webpack))
46+
, webpack))
4747
.pipe(gulp.dest("dist/"));
4848
}
4949

5050

51-
gulp.task("webpack-min", ["babel"], function () {
51+
gulp.task("webpack-min", gulp.series(["babel"], function () {
5252
return webpackMin('all');
53-
});
53+
}));
5454

5555

56-
function webpackMin(name, dest){
56+
function webpackMin(name, dest) {
5757
dest = dest || './';
5858
return gulp.src('bin/JsBarcode.js')
5959
.pipe(gulpWebpack(
@@ -63,69 +63,69 @@ function webpackMin(name, dest){
6363
},
6464
plugins: [new webpack.optimize.UglifyJsPlugin()]
6565
}
66-
, webpack))
67-
.pipe(header(settings.banner, require(settings.baseDir + 'package.json') ))
66+
, webpack))
67+
.pipe(header(settings.banner, require(settings.baseDir + 'package.json')))
6868
.pipe(gulp.dest("dist/" + dest));
6969
}
7070

7171

72-
gulp.task("webpack-all", function (cb) {
72+
gulp.task("webpack-all", gulp.series(function (cb) {
7373
var barcodes = require('./barcode-building.json');
7474

7575
// Move the real barcodes/index.js out of the way while compiling the individual barcodes
7676
fs.renameSync("src/barcodes/index.js", "src/barcodes/index.tmp.js");
7777

7878
// Take a barcode from the barcodes array, call the functions to compile that
7979
// format and have a callback when it has finished.
80-
function loopBarcode(i){
81-
if(i < barcodes.length){
82-
createBarcodeInclude(barcodes[i], function(){
80+
function loopBarcode(i) {
81+
if (i < barcodes.length) {
82+
createBarcodeInclude(barcodes[i], function () {
8383
loopBarcode(i + 1);
8484
});
8585
}
86-
else{
86+
else {
8787
fs.renameSync("src/barcodes/index.tmp.js", "src/barcodes/index.js");
8888
cb(); // Done
8989
}
9090
}
9191

9292
loopBarcode(0);
93-
});
93+
}));
9494

9595

9696
// Takes information about a barcode formatSize
9797
// Modifies the barcodes/index.js file to only import the specified format
9898
// and then does a recompilation and minifies everything with webpack
99-
function createBarcodeInclude(barcode, callback){
99+
function createBarcodeInclude(barcode, callback) {
100100
var toFile = "";
101101
toFile += "import {" + barcode.names + "} from '" + barcode.barcodeFile + "'";
102102
toFile += "\n";
103103
toFile += "export default {" + barcode.names + "}";
104104

105105
// Write a new barcodes/index file that only includes the specified barcode
106-
fs.writeFile("src/barcodes/index.js", toFile, function(){
106+
fs.writeFile("src/barcodes/index.js", toFile, function () {
107107
// Remove the compiled barcodes/index file (if it exist)
108-
if(fs.existsSync("bin/barcodes/index.js")){
108+
if (fs.existsSync("bin/barcodes/index.js")) {
109109
fs.unlinkSync("bin/barcodes/index.js");
110110
}
111111
// Re-compile with babel and webpack everything
112-
babelFunc().on('end', function(){
112+
babelFunc().on('end', function () {
113113
webpackMin(barcode.name, 'barcodes/').on('end', callback);
114114
});
115115
});
116116
}
117117

118118

119-
gulp.task('compress', function(cb) {
119+
gulp.task('compress', gulp.series(function (cb) {
120120
runSequence(
121121
"clean",
122122
"webpack-all",
123123
"webpack",
124124
"webpack-min",
125125
cb
126126
);
127-
});
127+
}));
128128

129-
gulp.task('compile', ['babel']);
129+
gulp.task('compile', gulp.series(['babel']));
130130

131-
gulp.task('compile-web', ['webpack']);
131+
gulp.task('compile-web', gulp.series(['webpack']));

automation/releasing.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,43 @@ var settings = require('./settings.json');
1414
var shared = require('./shared.js');
1515

1616

17-
gulp.task('git-release', ['compress'], function(cb){
17+
gulp.task('git-release', gulp.series(['compress'], function (cb) {
1818
var pkg = require(settings.baseDir + 'package.json');
1919
var v = 'v' + pkg.version;
2020
var message = ':package: Release ' + v;
2121

2222
updateReadmeFileSizes();
2323

2424
gulp.src(['./package.json', './bower.json', './README.md', './bin/', './dist'])
25-
.pipe(git.add({args: '--all --force'}))
25+
.pipe(git.add({ args: '--all --force' }))
2626
.pipe(git.commit(message));
2727

28-
git.push('origin', 'master', function(){
29-
git.tag(v, message, function(){
30-
git.push('origin', 'master', {args: '--tags'}, cb);
28+
git.push('origin', 'master', function () {
29+
git.tag(v, message, function () {
30+
git.push('origin', 'master', { args: '--tags' }, cb);
3131
});
3232
});
33-
});
33+
}));
3434

3535

3636
// Bump (increase) the version number
37-
gulp.task('bump-patch', function(){
37+
gulp.task('bump-patch', function () {
3838
return gulp.src(['./package.json', './bower.json'])
39-
.pipe(bump({type:'patch'}))
39+
.pipe(bump({ type: 'patch' }))
4040
.pipe(gulp.dest('./'));
4141
});
4242

4343

44-
gulp.task('bump-minor', function(){
44+
gulp.task('bump-minor', function () {
4545
return gulp.src(['./package.json', './bower.json'])
46-
.pipe(bump({type:'minor'}))
46+
.pipe(bump({ type: 'minor' }))
4747
.pipe(gulp.dest('./'));
4848
});
4949

5050

51-
gulp.task('bump-major', function(){
51+
gulp.task('bump-major', function () {
5252
return gulp.src(['./package.json', './bower.json'])
53-
.pipe(bump({type:'major'}))
53+
.pipe(bump({ type: 'major' }))
5454
.pipe(gulp.dest('./'));
5555
});
5656

@@ -61,7 +61,7 @@ gulp.task('npm', function (done) {
6161
});
6262

6363

64-
gulp.task('github-release', function(done) {
64+
gulp.task('github-release', function (done) {
6565
var pkg = require(settings.baseDir + './package.json');
6666
var v = 'v' + pkg.version;
6767
var name = "JsBarcode " + v;
@@ -78,17 +78,17 @@ gulp.task('github-release', function(done) {
7878

7979

8080

81-
gulp.task('release', ['lint'], function(callback){
81+
gulp.task('release', gulp.series(['lint'], function (callback) {
8282
runSequence(
8383
'git-release',
8484
'github-release',
8585
'npm',
8686
callback
8787
);
88-
});
88+
}));
8989

9090

91-
gulp.task('patch', function(){
91+
gulp.task('patch', function () {
9292
runSequence(
9393
'bump-patch',
9494
'release',
@@ -97,7 +97,7 @@ gulp.task('patch', function(){
9797
});
9898

9999

100-
gulp.task('minor', function(){
100+
gulp.task('minor', function () {
101101
runSequence(
102102
'bump-minor',
103103
'release',
@@ -106,15 +106,15 @@ gulp.task('minor', function(){
106106
});
107107

108108

109-
gulp.task('major', function(){
109+
gulp.task('major', function () {
110110
runSequence(
111111
'bump-major',
112112
'release',
113113
releaseDone
114114
);
115115
});
116116

117-
function releaseDone (error) {
117+
function releaseDone(error) {
118118
if (error) {
119119
console.log(error.message);
120120
}
@@ -124,7 +124,7 @@ function releaseDone (error) {
124124
}
125125

126126

127-
function updateReadmeFileSizes(){
127+
function updateReadmeFileSizes() {
128128
var files = require('./barcode-building.json');
129129
var readme = fs.readFileSync('README.md', "utf-8");
130130

@@ -136,7 +136,7 @@ function updateReadmeFileSizes(){
136136
readme = readme.replace(allRegexp, "| *" + formatSize(allFilesize) + "* |$1");
137137

138138
// Update all barcodes files
139-
for(var i in files){
139+
for (var i in files) {
140140
var filename = shared.minifiedFilename(files[i].name);
141141

142142
var fileData = fs.readFileSync('dist/barcodes/' + filename);
@@ -152,11 +152,11 @@ function updateReadmeFileSizes(){
152152

153153

154154
// Util functions
155-
RegExp.escape = function(s) {
155+
RegExp.escape = function (s) {
156156
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
157157
};
158158

159-
function formatSize(bytes){
159+
function formatSize(bytes) {
160160
var kilobytes = Math.round(bytes / 1024 * 10) / 10;
161161

162162
return kilobytes + " kB";

gulpfile.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ require('./automation/releasing.js');
1010
require('./automation/misc.js');
1111

1212

13-
gulp.task('watch', ['compile'], function() {
13+
gulp.task('watch', gulp.series(['compile'], function () {
1414
gulp.watch("src/**/*", ['compile']);
15-
});
15+
}));
1616

17-
gulp.task('watch-web', ['webpack'], function() {
17+
gulp.task('watch-web', gulp.series(['webpack'], function () {
1818
gulp.watch("src/**/*", ['webpack']);
19-
});
19+
}));

0 commit comments

Comments
 (0)