diff --git a/build/css.js b/build/css.js index d09452e..2a811b2 100644 --- a/build/css.js +++ b/build/css.js @@ -46,11 +46,11 @@ module.exports = (gulp, $) => { * - minify in production * - output */ - gulp.task('css', ['iconfont'], () => { + gulp.task('css', gulp.series(['iconfont'], () => { return gulp.src(config.src.css) .pipe($.less()) .pipe($.autoprefixer()) .pipe($.if(config.minify, $.cleanCss())) .pipe(gulp.dest(config.dist.css)); - }); + })); }; diff --git a/build/docs.js b/build/docs.js index 18700e9..05071ce 100644 --- a/build/docs.js +++ b/build/docs.js @@ -235,7 +235,7 @@ function enhanceRamlObj (ramlObj, internal = false) { module.exports = (gulp, $, flags) => { gulp.task('backend-clone', () => getRepo('git@github.com:mixer/raml.git', 'master')); - gulp.task('backend-doc', ['backend-clone'], () => { + gulp.task('backend-doc', gulp.series(['backend-clone'], () => { let docPath; if (config.backendRamlPath) { docPath = path.join(config.backendRamlPath, 'index.raml'); @@ -264,7 +264,7 @@ module.exports = (gulp, $, flags) => { JSON.stringify(tree) ); }); - }); + })); gulp.task('pull-client-repos', () => { const todo = require('./libraries') diff --git a/build/misc.js b/build/misc.js index 1e9055b..54e6fe3 100644 --- a/build/misc.js +++ b/build/misc.js @@ -43,7 +43,7 @@ function wrappedRequire (filePath) { */ function getPermissions () { try { - return require('@mcph/beam-common').permissions; + return require('@mixer/beam-common').permissions; } catch (err) { if (err.code === 'MODULE_NOT_FOUND') { // eslint-disable-next-line no-console @@ -228,15 +228,15 @@ module.exports = (gulp, $, flags) => { }; }); - gulp.task('html', ['html-raml']); - - gulp.task('html-raml', ['backend-doc', 'pull-client-repos'], () => { + gulp.task('html-raml', gulp.series(['backend-doc', 'pull-client-repos'], () => { return gulp.src(config.src.html) .pipe(dataPipe()) .pipe($.pug(getPugOpts())) .pipe($.if(config.minify, $.minifyHtml())) .pipe(gulp.dest(config.dist.html)); - }); + })); + + gulp.task('html', gulp.series(['html-raml'])); gulp.task('html-quick', () => { return gulp.src(config.src.html) @@ -267,7 +267,7 @@ module.exports = (gulp, $, flags) => { .pipe(gulp.dest(config.dist.js)); }); - gulp.task('lint-json', () => { + gulp.task('lint-json', (done) => { const files = [ 'src/reference/chat/data.json', 'src/reference/interactive/cplusplus/data.json', @@ -282,9 +282,15 @@ module.exports = (gulp, $, flags) => { } fs.writeFileSync(file, `${transformed}\n`); }); + + // Have to do this for some gulp 4 reason + done(); }); - gulp.task('set-internal', () => { + gulp.task('set-internal', (done) => { flags.internal = true; + + // Have to do this for some gulp 4 reason + done(); }); }; diff --git a/gulpfile.js b/gulpfile.js index 42bba81..9f917b1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -16,16 +16,16 @@ require('./build/css')(gulp, $, flags); const defaultTasks = ['html', 'js', 'css', 'images']; -gulp.task('default', defaultTasks); -gulp.task('internal', ['set-internal', ...defaultTasks]); -gulp.task('recompile', ['html-quick', 'js', 'css', 'images']); +gulp.task('default', gulp.series(defaultTasks)); +gulp.task('internal', gulp.series(['set-internal', ...defaultTasks])); +gulp.task('recompile', gulp.series(['html-quick', 'js', 'css', 'images'])); gulp.task('watch', () => { - gulp.watch('src/css/**/*.less', ['css']); - gulp.watch(config.src.html, ['html-quick']); - gulp.watch(config.src.snippets, ['html-quick']); - gulp.watch(config.src.js, ['js']); + gulp.watch('src/css/**/*.less', gulp.series(['css'])); + gulp.watch(config.src.html, gulp.series(['html-quick'])); + gulp.watch(config.src.snippets, gulp.series(['html-quick'])); + gulp.watch(config.src.js, gulp.series(['js'])); if (config.repos && config.repos.backend) { - gulp.watch(path.join(config.repos.backend, '**/*.raml'), ['html-raml']); + gulp.watch(path.join(config.repos.backend, '**/*.raml'), gulp.series(['html-raml'])); } }); diff --git a/package.json b/package.json index 520d8a0..3c8834e 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "eslint-plugin-import": "^1.9.2", "eslint-plugin-jsx-a11y": "^1.5.3", "eslint-plugin-react": "^5.2.2", - "gulp": "^3.9.1", + "gulp": "^4.0.2", "gulp-autoprefixer": "^3.1.0", "gulp-clean-css": "^2.0.10", "gulp-concat": "^2.6.0", @@ -43,17 +43,17 @@ "gulp-data": "^1.2.1", "gulp-iconfont": "^8.0.0", "gulp-if": "^2.0.1", - "gulp-imagemin": "^3.0.1", + "gulp-imagemin": "^6.1.0", "gulp-less": "^3.1.0", "gulp-load-plugins": "^1.2.4", "gulp-minify-html": "^1.0.6", "gulp-pug": "^3.3.0", "gulp-uglify": "^3.0.0", "highlight.js": "^9.5.0", - "http-server": "^0.9.0", + "http-server": "^0.11.1", "js-yaml": "^3.11.0", "lodash": "^4.13.1", - "marked": "^0.3.5", + "marked": "^0.7.0", "node-fetch": "^1.5.3", "npm-run-all": "^4.0.2", "pug-lint": "^2.2.2", @@ -61,6 +61,6 @@ "sticky-kit": "^1.1.3" }, "optionalDependencies": { - "@mcph/beam-common": "^5.0.7" + "@mixer/beam-common": "^6.9.7" } }