From c5900ef01563e88e6bcbae6557a2eb6584776aad Mon Sep 17 00:00:00 2001 From: dmitry <dmitry.zyryanov@execution.su> Date: Thu, 7 Mar 2019 10:09:43 +0700 Subject: [PATCH 01/10] gulpfile: airhorn comment removed --- login-app/gulpfile.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/login-app/gulpfile.js b/login-app/gulpfile.js index 1a15c08..f57cf1b 100644 --- a/login-app/gulpfile.js +++ b/login-app/gulpfile.js @@ -1,22 +1,3 @@ -/* - * - * Air Horner - * Copyright 2015 Google Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - * - */ - 'use strict'; // Include Gulp & Tools We'll Use -- GitLab From cc05fbd637dfa7ab5f71b0c327b6b1067336735e Mon Sep 17 00:00:00 2001 From: dmitry <dmitry.zyryanov@execution.su> Date: Thu, 7 Mar 2019 10:10:03 +0700 Subject: [PATCH 02/10] gulpfile: suppress 'strict' warning --- login-app/gulpfile.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/login-app/gulpfile.js b/login-app/gulpfile.js index f57cf1b..8f5ce1c 100644 --- a/login-app/gulpfile.js +++ b/login-app/gulpfile.js @@ -1,3 +1,5 @@ +/* eslint-disable strict */ + 'use strict'; // Include Gulp & Tools We'll Use -- GitLab From fb803b2b55bedacdf37c253483bd1e223b4efdba Mon Sep 17 00:00:00 2001 From: dmitry <dmitry.zyryanov@execution.su> Date: Thu, 7 Mar 2019 10:13:52 +0700 Subject: [PATCH 03/10] gulpfile: rid of vars --- login-app/gulpfile.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/login-app/gulpfile.js b/login-app/gulpfile.js index 8f5ce1c..6f79c45 100644 --- a/login-app/gulpfile.js +++ b/login-app/gulpfile.js @@ -3,12 +3,12 @@ 'use strict'; // Include Gulp & Tools We'll Use -var gulp = require('gulp'); -var $ = require('gulp-load-plugins')(); -var del = require('del'); -var runSequence = require('run-sequence'); -var browserSync = require('browser-sync'); -var reload = browserSync.reload; +const gulp = require('gulp'); +const $ = require('gulp-load-plugins')(); +const del = require('del'); +const runSequence = require('run-sequence'); +const browserSync = require('browser-sync'); +const reload = browserSync.reload; // Lint JavaScript gulp.task('jshint', function() { @@ -65,7 +65,7 @@ gulp.task('well-known', function() { // Compile and Automatically Prefix Stylesheets gulp.task('styles', function() { - var AUTOPREFIXER_BROWSERS = [ + const AUTOPREFIXER_BROWSERS = [ 'ie >= 10', 'ie_mob >= 10', 'ff >= 30', @@ -90,7 +90,7 @@ gulp.task('styles', function() { // Concatenate And Minify JavaScript gulp.task('scripts', function() { - var sources = [ + const sources = [ 'app/scripts/*.js']; return gulp.src(sources) @@ -103,7 +103,7 @@ gulp.task('scripts', function() { // Scan Your HTML For Assets & Optimize Them gulp.task('html', function() { - var assets = $.useref.assets({searchPath: '{.tmp,app}'}); + const assets = $.useref.assets({searchPath: '{.tmp,app}'}); return gulp.src('app/**/**/*.html') .pipe(assets) -- GitLab From 4ceb99f7a80709494d728dbbbdead8ba457e8f6d Mon Sep 17 00:00:00 2001 From: dmitry <dmitry.zyryanov@execution.su> Date: Thu, 7 Mar 2019 10:14:19 +0700 Subject: [PATCH 04/10] gulpfile: newlines after imports --- login-app/gulpfile.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/login-app/gulpfile.js b/login-app/gulpfile.js index 6f79c45..fc8efae 100644 --- a/login-app/gulpfile.js +++ b/login-app/gulpfile.js @@ -8,6 +8,8 @@ const $ = require('gulp-load-plugins')(); const del = require('del'); const runSequence = require('run-sequence'); const browserSync = require('browser-sync'); + + const reload = browserSync.reload; // Lint JavaScript -- GitLab From d86e201035c134fa198c9a525564505ba9f83a5b Mon Sep 17 00:00:00 2001 From: dmitry <dmitry.zyryanov@execution.su> Date: Thu, 7 Mar 2019 10:14:39 +0700 Subject: [PATCH 05/10] gulpfile: object destructing --- login-app/gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/login-app/gulpfile.js b/login-app/gulpfile.js index fc8efae..fd66272 100644 --- a/login-app/gulpfile.js +++ b/login-app/gulpfile.js @@ -10,7 +10,7 @@ const runSequence = require('run-sequence'); const browserSync = require('browser-sync'); -const reload = browserSync.reload; +const { reload } = browserSync; // Lint JavaScript gulp.task('jshint', function() { -- GitLab From 13b083a7ff30d4c7bc0fa1e4d077a62705a6b9cb Mon Sep 17 00:00:00 2001 From: dmitry <dmitry.zyryanov@execution.su> Date: Thu, 7 Mar 2019 10:20:02 +0700 Subject: [PATCH 06/10] gulpfile: arrow functions --- login-app/gulpfile.js | 61 +++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/login-app/gulpfile.js b/login-app/gulpfile.js index fd66272..a8e56d9 100644 --- a/login-app/gulpfile.js +++ b/login-app/gulpfile.js @@ -13,60 +13,59 @@ const browserSync = require('browser-sync'); const { reload } = browserSync; // Lint JavaScript -gulp.task('jshint', function() { - return gulp.src(['app/scripts/**/*.js', 'app/styleguide/**/*.js']) +gulp.task('jshint', () => ( + gulp.src(['app/scripts/**/*.js', 'app/styleguide/**/*.js']) .pipe(reload({stream: true, once: true})) .pipe($.jshint()) .pipe($.jshint.reporter('jshint-stylish')) - .pipe($.if(!browserSync.active, $.jshint.reporter('fail'))); -}); + .pipe($.if(!browserSync.active, $.jshint.reporter('fail'))) +)); // Optimize Images -gulp.task('images', function() { - return gulp.src('app/images/**/*') +gulp.task('images', () => ( + gulp.src('app/images/**/*') .pipe($.cache($.imagemin({ progressive: true, interlaced: true }))) .pipe(gulp.dest('dist/images')) - .pipe($.size({title: 'images'})); -}); + .pipe($.size({title: 'images'})) +)); // Copy All Files At The Root Level (app) -gulp.task('copy', function() { - return gulp.src([ +gulp.task('copy', () => ( + gulp.src([ 'app/*', '!app/*.html', 'node_modules/apache-server-configs/dist/.htaccess' ], { dot: true }).pipe(gulp.dest('dist')) - .pipe($.size({title: 'copy'})); -}); + .pipe($.size({title: 'copy'})) +)); // Copy All Filescopy-workerscripts At The Root Level (app) -gulp.task('copy-workerscripts', function() { - return gulp.src('app/scripts/jsqrcode/*.js') +gulp.task('copy-workerscripts', () => ( + gulp.src('app/scripts/jsqrcode/*.js') .pipe(gulp.dest('dist/scripts/jsqrcode/')) - .pipe($.size({title: 'copy-workerscripts'})); -}); + .pipe($.size({title: 'copy-workerscripts'})) +)); // Copy Web Fonts To Dist -gulp.task('fonts', function() { - return gulp.src(['app/fonts/**']) +gulp.task('fonts', () => ( + gulp.src(['app/fonts/**']) .pipe(gulp.dest('dist/fonts')) - .pipe($.size({title: 'fonts'})); -}); + .pipe($.size({title: 'fonts'})) +)); -gulp.task('well-known', function() { - return gulp.src(['app/.well-known/**']) +gulp.task('well-known', () => ( + gulp.src(['app/.well-known/**']) .pipe(gulp.dest('dist/.well-known/')) - .pipe($.size({title: 'well-known'})); -}); + .pipe($.size({title: 'well-known'})) +)); // Compile and Automatically Prefix Stylesheets -gulp.task('styles', function() { - +gulp.task('styles', () => { const AUTOPREFIXER_BROWSERS = [ 'ie >= 10', 'ie_mob >= 10', @@ -91,7 +90,7 @@ gulp.task('styles', function() { }); // Concatenate And Minify JavaScript -gulp.task('scripts', function() { +gulp.task('scripts', () => { const sources = [ 'app/scripts/*.js']; @@ -104,7 +103,7 @@ gulp.task('scripts', function() { }); // Scan Your HTML For Assets & Optimize Them -gulp.task('html', function() { +gulp.task('html', () => { const assets = $.useref.assets({searchPath: '{.tmp,app}'}); return gulp.src('app/**/**/*.html') @@ -137,7 +136,7 @@ gulp.task('html', function() { gulp.task('clean', del.bind(null, ['.tmp', 'dist/*', '!dist/.git'], {dot: true})); // Watch Files For Changes & Reload -gulp.task('serve', ['styles'], function() { +gulp.task('serve', ['styles'], () => { browserSync({ ui: null, port: 8004, @@ -158,7 +157,7 @@ gulp.task('serve', ['styles'], function() { }); // Build and serve the output from the dist build -gulp.task('serve:dist', ['default'], function() { +gulp.task('serve:dist', ['default'], () => { browserSync({ notify: false, logPrefix: 'WSK', @@ -172,7 +171,7 @@ gulp.task('serve:dist', ['default'], function() { }); // Build Production Files, the Default Task -gulp.task('default', ['clean'], function(cb) { +gulp.task('default', ['clean'], (cb) => { runSequence('styles', ['html', 'scripts', 'styles', 'images', 'fonts', 'copy', 'well-known', 'copy-workerscripts'], cb); }); -- GitLab From f5dc5861d23035c4e3c458dc30af0f4aa79cae8d Mon Sep 17 00:00:00 2001 From: dmitry <dmitry.zyryanov@execution.su> Date: Thu, 7 Mar 2019 10:41:22 +0700 Subject: [PATCH 07/10] gulpfile: code reformat --- login-app/gulpfile.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/login-app/gulpfile.js b/login-app/gulpfile.js index a8e56d9..cec7d81 100644 --- a/login-app/gulpfile.js +++ b/login-app/gulpfile.js @@ -15,7 +15,7 @@ const { reload } = browserSync; // Lint JavaScript gulp.task('jshint', () => ( gulp.src(['app/scripts/**/*.js', 'app/styleguide/**/*.js']) - .pipe(reload({stream: true, once: true})) + .pipe(reload({ stream: true, once: true })) .pipe($.jshint()) .pipe($.jshint.reporter('jshint-stylish')) .pipe($.if(!browserSync.active, $.jshint.reporter('fail'))) @@ -29,7 +29,7 @@ gulp.task('images', () => ( interlaced: true }))) .pipe(gulp.dest('dist/images')) - .pipe($.size({title: 'images'})) + .pipe($.size({ title: 'images' })) )); // Copy All Files At The Root Level (app) @@ -41,27 +41,27 @@ gulp.task('copy', () => ( ], { dot: true }).pipe(gulp.dest('dist')) - .pipe($.size({title: 'copy'})) + .pipe($.size({ title: 'copy' })) )); // Copy All Filescopy-workerscripts At The Root Level (app) gulp.task('copy-workerscripts', () => ( gulp.src('app/scripts/jsqrcode/*.js') .pipe(gulp.dest('dist/scripts/jsqrcode/')) - .pipe($.size({title: 'copy-workerscripts'})) + .pipe($.size({ title: 'copy-workerscripts' })) )); // Copy Web Fonts To Dist gulp.task('fonts', () => ( gulp.src(['app/fonts/**']) .pipe(gulp.dest('dist/fonts')) - .pipe($.size({title: 'fonts'})) + .pipe($.size({ title: 'fonts' })) )); gulp.task('well-known', () => ( gulp.src(['app/.well-known/**']) .pipe(gulp.dest('dist/.well-known/')) - .pipe($.size({title: 'well-known'})) + .pipe($.size({ title: 'well-known' })) )); // Compile and Automatically Prefix Stylesheets @@ -86,7 +86,7 @@ gulp.task('styles', () => { // Concatenate And Minify Styles .pipe($.if('*.css', $.csso())) .pipe(gulp.dest('dist/styles')) - .pipe($.size({title: 'styles'})); + .pipe($.size({ title: 'styles' })); }); // Concatenate And Minify JavaScript @@ -95,16 +95,16 @@ gulp.task('scripts', () => { 'app/scripts/*.js']; return gulp.src(sources) - //.pipe($.concat('main.min.js')) - //.pipe($.uglify({preserveComments: 'some'})) - // Output Files + //.pipe($.concat('main.min.js')) + //.pipe($.uglify({preserveComments: 'some'})) + // Output Files .pipe(gulp.dest('dist/scripts')) - .pipe($.size({title: 'scripts'})); + .pipe($.size({ title: 'scripts' })); }); // Scan Your HTML For Assets & Optimize Them gulp.task('html', () => { - const assets = $.useref.assets({searchPath: '{.tmp,app}'}); + const assets = $.useref.assets({ searchPath: '{.tmp,app}' }); return gulp.src('app/**/**/*.html') .pipe(assets) @@ -129,11 +129,11 @@ gulp.task('html', () => { .pipe($.if('*.html', $.minifyHtml())) // Output Files .pipe(gulp.dest('dist')) - .pipe($.size({title: 'html'})); + .pipe($.size({ title: 'html' })); }); // Clean Output Directory -gulp.task('clean', del.bind(null, ['.tmp', 'dist/*', '!dist/.git'], {dot: true})); +gulp.task('clean', del.bind(null, ['.tmp', 'dist/*', '!dist/.git'], { dot: true })); // Watch Files For Changes & Reload gulp.task('serve', ['styles'], () => { @@ -152,7 +152,7 @@ gulp.task('serve', ['styles'], () => { gulp.watch(['app/**/**/**/*.html'], reload); gulp.watch(['app/**/**/**/*.{scss,css}'], ['styles', reload]); - gulp.watch(['app/scripts/**/*.js','app/styleguide/**/*.js'], ['jshint']); + gulp.watch(['app/scripts/**/*.js', 'app/styleguide/**/*.js'], ['jshint']); gulp.watch(['app/images/**/*'], reload); }); -- GitLab From b99059d21d839ae9713a91fd9d9861db080e1498 Mon Sep 17 00:00:00 2001 From: dmitry <dmitry.zyryanov@execution.su> Date: Thu, 7 Mar 2019 10:42:33 +0700 Subject: [PATCH 08/10] gulpfile: trailing commas added --- login-app/gulpfile.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/login-app/gulpfile.js b/login-app/gulpfile.js index cec7d81..7269fe1 100644 --- a/login-app/gulpfile.js +++ b/login-app/gulpfile.js @@ -26,7 +26,7 @@ gulp.task('images', () => ( gulp.src('app/images/**/*') .pipe($.cache($.imagemin({ progressive: true, - interlaced: true + interlaced: true, }))) .pipe(gulp.dest('dist/images')) .pipe($.size({ title: 'images' })) @@ -37,9 +37,9 @@ gulp.task('copy', () => ( gulp.src([ 'app/*', '!app/*.html', - 'node_modules/apache-server-configs/dist/.htaccess' + 'node_modules/apache-server-configs/dist/.htaccess', ], { - dot: true + dot: true, }).pipe(gulp.dest('dist')) .pipe($.size({ title: 'copy' })) )); @@ -75,12 +75,12 @@ gulp.task('styles', () => { 'opera >= 23', 'ios >= 7', 'android >= 4.4', - 'bb >= 10' + 'bb >= 10', ]; // For best performance, don't add Sass partials to `gulp.src` return gulp.src([ - 'app/styles/**/*.css' + 'app/styles/**/*.css', ]) .pipe($.autoprefixer(AUTOPREFIXER_BROWSERS)) // Concatenate And Minify Styles @@ -114,10 +114,10 @@ gulp.task('html', () => { .pipe($.if('*.css', $.uncss({ html: [ 'app/index.html', - 'app/styleguide.html' + 'app/styleguide.html', ], // CSS Selectors for UnCSS to ignore - ignore: [] + ignore: [], }))) // Concatenate And Minify Styles @@ -147,7 +147,7 @@ gulp.task('serve', ['styles'], () => { // Note: this uses an unsigned certificate which on first access // will present a certificate warning in the browser. // https: true, - server: ['.tmp', 'app'] + server: ['.tmp', 'app'], }); gulp.watch(['app/**/**/**/*.html'], reload); @@ -166,7 +166,7 @@ gulp.task('serve:dist', ['default'], () => { // will present a certificate warning in the browser. // https: true, server: 'dist', - baseDir: "dist" + baseDir: "dist", }); }); -- GitLab From a374b3a005cf54ff249980eff074a478c00ebf31 Mon Sep 17 00:00:00 2001 From: dmitry <dmitry.zyryanov@execution.su> Date: Thu, 7 Mar 2019 10:43:22 +0700 Subject: [PATCH 09/10] gulpfile: comment spaces --- login-app/gulpfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/login-app/gulpfile.js b/login-app/gulpfile.js index 7269fe1..84524b3 100644 --- a/login-app/gulpfile.js +++ b/login-app/gulpfile.js @@ -95,8 +95,8 @@ gulp.task('scripts', () => { 'app/scripts/*.js']; return gulp.src(sources) - //.pipe($.concat('main.min.js')) - //.pipe($.uglify({preserveComments: 'some'})) + // .pipe($.concat('main.min.js')) + // .pipe($.uglify({preserveComments: 'some'})) // Output Files .pipe(gulp.dest('dist/scripts')) .pipe($.size({ title: 'scripts' })); -- GitLab From 043686b57ef53ae372ec6a3ff869b3d2d515aa3e Mon Sep 17 00:00:00 2001 From: dmitry <dmitry.zyryanov@execution.su> Date: Thu, 7 Mar 2019 10:43:36 +0700 Subject: [PATCH 10/10] gulpfile: quotes fixed --- login-app/gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/login-app/gulpfile.js b/login-app/gulpfile.js index 84524b3..5e5554d 100644 --- a/login-app/gulpfile.js +++ b/login-app/gulpfile.js @@ -166,7 +166,7 @@ gulp.task('serve:dist', ['default'], () => { // will present a certificate warning in the browser. // https: true, server: 'dist', - baseDir: "dist", + baseDir: 'dist', }); }); -- GitLab