diff --git a/tools/__tasks__/compile/conf/index.js b/tools/__tasks__/compile/conf/index.js index 9e2898d5650..24a4597c400 100644 --- a/tools/__tasks__/compile/conf/index.js +++ b/tools/__tasks__/compile/conf/index.js @@ -1,9 +1,12 @@ +const copy = require('./copy.js'); +const inlineSVGs = require('../inline-svgs/index.js'); + const task = { description: 'Compile assets for template rendering in Play', task: [ // prettier: multi-line - require('./copy'), - require('../inline-svgs'), + copy, + inlineSVGs, ], }; diff --git a/tools/__tasks__/compile/css/index.dev.js b/tools/__tasks__/compile/css/index.dev.js index ab0f461335e..6ca6e39d66c 100644 --- a/tools/__tasks__/compile/css/index.dev.js +++ b/tools/__tasks__/compile/css/index.dev.js @@ -1,11 +1,16 @@ +const clean = require('./clean.js'); +const mkdir = require('./mkdir.js'); +const images = require('../images/index.js'); +const sass = require('./sass.js'); + const task = { description: 'Compile CSS', task: [ // prettier: multi-line - require('./clean'), - require('./mkdir'), - require('../images'), - require('./sass'), + clean, + mkdir, + images, + sass, ], }; diff --git a/tools/__tasks__/compile/css/index.js b/tools/__tasks__/compile/css/index.js index ab0f461335e..6ca6e39d66c 100644 --- a/tools/__tasks__/compile/css/index.js +++ b/tools/__tasks__/compile/css/index.js @@ -1,11 +1,16 @@ +const clean = require('./clean.js'); +const mkdir = require('./mkdir.js'); +const images = require('../images/index.js'); +const sass = require('./sass.js'); + const task = { description: 'Compile CSS', task: [ // prettier: multi-line - require('./clean'), - require('./mkdir'), - require('../images'), - require('./sass'), + clean, + mkdir, + images, + sass, ], }; diff --git a/tools/__tasks__/compile/data/index.dev.js b/tools/__tasks__/compile/data/index.dev.js index 0219475dc03..6e4e1b950c5 100644 --- a/tools/__tasks__/compile/data/index.dev.js +++ b/tools/__tasks__/compile/data/index.dev.js @@ -1,10 +1,14 @@ +const clean = require('./clean.js'); +const download = require('./download.js'); +const amp = require('./amp.js'); + const task = { description: 'Clean download and build data assets (dev)', task: [ // prettier: multi-line - require('./clean'), - require('./download'), - require('./amp'), + clean, + download, + amp, ], }; diff --git a/tools/__tasks__/compile/data/index.js b/tools/__tasks__/compile/data/index.js index ed94c89af48..ee7ab43f258 100644 --- a/tools/__tasks__/compile/data/index.js +++ b/tools/__tasks__/compile/data/index.js @@ -1,10 +1,15 @@ +const clean = require('./clean.js'); +const download = require('./download.js'); +const amp = require('./amp.js'); + const task = { description: 'Clean download and build data assets', task: [ // prettier: multi-line - require('./clean'), - require('./download'), - require('./amp'), + clean, + download, + amp, ], }; + module.exports = task; diff --git a/tools/__tasks__/compile/data/index.watch.js b/tools/__tasks__/compile/data/index.watch.js index a24d24796b0..ea88e83551b 100644 --- a/tools/__tasks__/compile/data/index.watch.js +++ b/tools/__tasks__/compile/data/index.watch.js @@ -1,10 +1,14 @@ +const clean = require('./clean.js'); +const download = require('./download.js'); +const amp = require('./amp.js'); + const task = { description: 'Clean, download and build data assets (watch)', task: [ // prettier: multi-line - require('./clean'), - require('./download'), - require('./amp'), + clean, + download, + amp, ], }; diff --git a/tools/__tasks__/compile/hash/index.js b/tools/__tasks__/compile/hash/index.js index 6580e3d1b39..c347ee8229d 100644 --- a/tools/__tasks__/compile/hash/index.js +++ b/tools/__tasks__/compile/hash/index.js @@ -9,12 +9,13 @@ const pify = require('pify'); const writeFile = pify(fs.writeFile); +const clean = require('./clean.js'); const { paths } = require('../../config'); const task = { description: 'Version assets', task: [ - require('./clean'), + clean, { description: 'Hash assets', task: () => { diff --git a/tools/__tasks__/compile/images/icons.js b/tools/__tasks__/compile/images/icons.js index 72da1f8311b..2b7e520286d 100644 --- a/tools/__tasks__/compile/images/icons.js +++ b/tools/__tasks__/compile/images/icons.js @@ -1,5 +1,3 @@ -#!/usr/bin/env node - const { paths } = require('../../config'); const fs = require('fs'); diff --git a/tools/__tasks__/compile/images/index.js b/tools/__tasks__/compile/images/index.js index 3be860817e8..c250bc2cf5a 100644 --- a/tools/__tasks__/compile/images/index.js +++ b/tools/__tasks__/compile/images/index.js @@ -1,11 +1,16 @@ +const clean = require('./clean.js'); +const copy = require('./copy.js'); +const icons = require('./icons.js'); +const svg = require('./svg.js'); + const task = { description: 'Compile images', task: [ // prettier: multi-line - require('./clean'), - require('./copy'), - require('./icons'), - require('./svg'), + clean, + copy, + icons, + svg, ], }; diff --git a/tools/__tasks__/compile/index.dev.js b/tools/__tasks__/compile/index.dev.js index 1bdda0b6e92..d26cee3c2e5 100644 --- a/tools/__tasks__/compile/index.dev.js +++ b/tools/__tasks__/compile/index.dev.js @@ -1,12 +1,18 @@ +const clean = require('./conf/clean.js'); +const css = require('./css/index.dev.js'); +const data = require('./data/index.dev.js'); +const javascript = require('./javascript/index.dev.js'); +const conf = require('./conf/index.js'); + const task = { description: 'Compile assets for development', task: [ // prettier: multi-line - require('./conf/clean'), - require('./css/index.dev'), - require('./data/index.dev'), - require('./javascript/index.dev'), - require('./conf'), + clean, + css, + data, + javascript, + conf, ], }; diff --git a/tools/__tasks__/compile/index.js b/tools/__tasks__/compile/index.js index 4632a11987c..9a5a73e8417 100755 --- a/tools/__tasks__/compile/index.js +++ b/tools/__tasks__/compile/index.js @@ -1,13 +1,20 @@ +const clean = require('./conf/clean.js'); +const css = require('./css/index.js'); +const data = require('./data/index.js'); +const javascript = require('./javascript/index.js'); +const hash = require('./hash/index.js'); +const conf = require('./conf/index.js'); + const task = { description: 'Compile assets for production', task: [ // prettier: multi-line - require('./conf/clean'), - require('./css'), - require('./data'), - require('./javascript'), - require('./hash'), - require('./conf'), + clean, + css, + data, + javascript, + hash, + conf, ], }; diff --git a/tools/__tasks__/compile/index.watch.js b/tools/__tasks__/compile/index.watch.js index cbabca5e61e..e9d781a8c60 100644 --- a/tools/__tasks__/compile/index.watch.js +++ b/tools/__tasks__/compile/index.watch.js @@ -1,12 +1,18 @@ +const clean = require('./conf/clean.js'); +const css = require('./css/index.dev.js'); +const data = require('./data/index.watch.js'); +const javascript = require('./javascript/index.watch.js'); +const conf = require('./conf/index.js'); + const task = { description: 'Compile assets for development', task: [ // prettier: multi-line - require('./conf/clean'), - require('./css/index.dev'), - require('./data/index.watch'), - require('./javascript/index.watch'), - require('./conf'), + clean, + css, + data, + javascript, + conf, ], }; diff --git a/tools/__tasks__/compile/javascript/index.atoms.js b/tools/__tasks__/compile/javascript/index.atoms.js index 8a2ebaf90e4..a2e5dd7e942 100644 --- a/tools/__tasks__/compile/javascript/index.atoms.js +++ b/tools/__tasks__/compile/javascript/index.atoms.js @@ -1,10 +1,14 @@ +const clean = require('./clean'); +const inlineSVGs = require('../inline-svgs'); +const webpackAtoms = require('./webpack-atoms'); + const task = { description: 'Compile JS', task: [ // prettier: multi-line - require('./clean'), - require('../inline-svgs'), - require('./webpack-atoms'), + clean, + inlineSVGs, + webpackAtoms, ], }; diff --git a/tools/__tasks__/compile/javascript/index.dev.js b/tools/__tasks__/compile/javascript/index.dev.js index c7d0773bd4b..f40e69b7e2e 100644 --- a/tools/__tasks__/compile/javascript/index.dev.js +++ b/tools/__tasks__/compile/javascript/index.dev.js @@ -1,14 +1,20 @@ +const inlineSVGs = require('../inline-svgs/index.js'); +const clean = require('./clean.js'); +const copy = require('./copy.js'); +const webpack = require('./webpack.dev'); +const webpackDCR = require('./webpack-dcr.dev'); +const bundlePolyfills = require('./bundle-polyfills'); + const task = { description: 'Prepare JS for development', task: [ // prettier: multi-line - require('../inline-svgs'), - require('./clean'), - require('./copy'), - require('../../commercial/compile'), - require('./webpack.dev'), - require('./webpack-dcr.dev'), - require('./bundle-polyfills'), + inlineSVGs, + clean, + copy, + webpack, + webpackDCR, + bundlePolyfills, ], }; diff --git a/tools/__tasks__/compile/javascript/index.js b/tools/__tasks__/compile/javascript/index.js index 8b9ad2d69c1..1283f43a338 100644 --- a/tools/__tasks__/compile/javascript/index.js +++ b/tools/__tasks__/compile/javascript/index.js @@ -1,13 +1,20 @@ +const clean = require('./clean.js'); +const inlineSVGs = require('../inline-svgs/index.js'); +const copy = require('./copy.js'); +const webpack = require('./webpack.js'); +const webpackAtoms = require('./webpack-atoms.js'); +const bundlePolyfills = require('./bundle-polyfills.js'); + const task = { description: 'Compile JS', task: [ // prettier: multi-line - require('./clean'), - require('../inline-svgs'), - require('./copy'), - require('./webpack'), - require('./webpack-atoms'), - require('./bundle-polyfills'), + clean, + inlineSVGs, + copy, + webpack, + webpackAtoms, + bundlePolyfills, ], }; diff --git a/tools/__tasks__/compile/javascript/index.watch.js b/tools/__tasks__/compile/javascript/index.watch.js index d5b4315f814..397b7a74bf7 100644 --- a/tools/__tasks__/compile/javascript/index.watch.js +++ b/tools/__tasks__/compile/javascript/index.watch.js @@ -1,11 +1,16 @@ +const inlineSVGs = require('../inline-svgs/index.js'); +const clean = require('./clean.js'); +const copy = require('./copy.js'); +const bundlePolyfills = require('./bundle-polyfills.js'); + const task = { description: 'Prepare JS for development', task: [ // prettier: multi-line - require('../inline-svgs'), - require('./clean'), - require('./copy'), - require('./bundle-polyfills'), + inlineSVGs, + clean, + copy, + bundlePolyfills, ], }; diff --git a/tools/__tasks__/compile/javascript/webpack-atoms.js b/tools/__tasks__/compile/javascript/webpack-atoms.js index 7a62a6dabeb..3ef41e062b6 100644 --- a/tools/__tasks__/compile/javascript/webpack-atoms.js +++ b/tools/__tasks__/compile/javascript/webpack-atoms.js @@ -6,15 +6,13 @@ const webpack = require('webpack'); const chalk = require('chalk'); const config = require('../../../../webpack.config.atoms.js'); +const reporter = require('../../../webpack-progress-reporter.js'); const task = { description: 'Create Webpack bundles for atoms', task: () => new Observable((observer) => { - config.plugins = [ - require('../../../webpack-progress-reporter')(observer), - ...config.plugins, - ]; + config.plugins = [reporter(observer), ...config.plugins]; const bundler = webpack(config); diff --git a/tools/__tasks__/compile/javascript/webpack.dev.js b/tools/__tasks__/compile/javascript/webpack.dev.js index acb73fcc0e5..76b4f20b279 100644 --- a/tools/__tasks__/compile/javascript/webpack.dev.js +++ b/tools/__tasks__/compile/javascript/webpack.dev.js @@ -6,15 +6,13 @@ const webpack = require('webpack'); const chalk = require('chalk'); const config = require('../../../../webpack.config.dev.js'); +const reporter = require('../../../webpack-progress-reporter.js'); const task = { description: 'Create Webpack bundles', task: () => new Observable((observer) => { - config.plugins = [ - require('../../../webpack-progress-reporter')(observer), - ...config.plugins, - ]; + config.plugins = [reporter(observer), ...config.plugins]; const bundler = webpack(config); diff --git a/tools/__tasks__/compile/javascript/webpack.js b/tools/__tasks__/compile/javascript/webpack.js index 79435c0bf0d..606f6bdb9cb 100644 --- a/tools/__tasks__/compile/javascript/webpack.js +++ b/tools/__tasks__/compile/javascript/webpack.js @@ -6,15 +6,13 @@ const webpack = require('webpack'); const chalk = require('chalk'); const config = require('../../../../webpack.config.prod.js'); +const reporter = require('../../../webpack-progress-reporter.js'); const task = { description: 'Create Webpack bundles', task: () => new Observable((observer) => { - config.plugins = [ - require('../../../webpack-progress-reporter')(observer), - ...config.plugins, - ]; + config.plugins = [reporter(observer), ...config.plugins]; const bundler = webpack(config); diff --git a/tools/__tasks__/test/index.js b/tools/__tasks__/test/index.js index cc55b1f6828..98ee2592270 100644 --- a/tools/__tasks__/test/index.js +++ b/tools/__tasks__/test/index.js @@ -1,9 +1,12 @@ +const data = require('../compile/data/index.js'); +const javascript = require('./javascript/index.js'); + const task = { description: 'Test assets', task: [ // prettier: multi-line - require('../compile/data'), - require('./javascript'), + data, + javascript, ], concurrent: true, }; diff --git a/tools/__tasks__/validate-head/index.js b/tools/__tasks__/validate-head/index.js index 044406ec767..71ff7f2b4b5 100644 --- a/tools/__tasks__/validate-head/index.js +++ b/tools/__tasks__/validate-head/index.js @@ -1,9 +1,12 @@ +const javascript = require('./javascript.js'); +const sass = require('./sass.js'); + const task = { description: 'Validate commits', task: [ // prettier: multi-line - require('./javascript'), - require('./sass'), + javascript, + sass, ], concurrent: true, }; diff --git a/tools/__tasks__/validate/index.js b/tools/__tasks__/validate/index.js index 9bcaf89ee4f..02030b2bced 100644 --- a/tools/__tasks__/validate/index.js +++ b/tools/__tasks__/validate/index.js @@ -1,11 +1,16 @@ +const javascript = require('./javascript.js'); +const typescript = require('./typescript.js'); +const sass = require('./sass.js'); +const checkForDisallowedStrings = require('./check-for-disallowed-strings.js'); + const task = { description: 'Lint assets', task: [ // prettier: multi-line - require('./javascript'), - require('./typescript'), - require('./sass'), - require('./check-for-disallowed-strings'), + javascript, + typescript, + sass, + checkForDisallowedStrings, ], concurrent: true, };