Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All task runner require calls are static #27255

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tools/__tasks__/compile/conf/index.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
13 changes: 9 additions & 4 deletions tools/__tasks__/compile/css/index.dev.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
13 changes: 9 additions & 4 deletions tools/__tasks__/compile/css/index.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
10 changes: 7 additions & 3 deletions tools/__tasks__/compile/data/index.dev.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
11 changes: 8 additions & 3 deletions tools/__tasks__/compile/data/index.js
Original file line number Diff line number Diff line change
@@ -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;
10 changes: 7 additions & 3 deletions tools/__tasks__/compile/data/index.watch.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
3 changes: 2 additions & 1 deletion tools/__tasks__/compile/hash/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {
Expand Down
2 changes: 0 additions & 2 deletions tools/__tasks__/compile/images/icons.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env node

const { paths } = require('../../config');

const fs = require('fs');
Expand Down
13 changes: 9 additions & 4 deletions tools/__tasks__/compile/images/index.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
16 changes: 11 additions & 5 deletions tools/__tasks__/compile/index.dev.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
19 changes: 13 additions & 6 deletions tools/__tasks__/compile/index.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
16 changes: 11 additions & 5 deletions tools/__tasks__/compile/index.watch.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
10 changes: 7 additions & 3 deletions tools/__tasks__/compile/javascript/index.atoms.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
20 changes: 13 additions & 7 deletions tools/__tasks__/compile/javascript/index.dev.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
19 changes: 13 additions & 6 deletions tools/__tasks__/compile/javascript/index.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
13 changes: 9 additions & 4 deletions tools/__tasks__/compile/javascript/index.watch.js
Original file line number Diff line number Diff line change
@@ -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,
],
};

Expand Down
6 changes: 2 additions & 4 deletions tools/__tasks__/compile/javascript/webpack-atoms.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 2 additions & 4 deletions tools/__tasks__/compile/javascript/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 2 additions & 4 deletions tools/__tasks__/compile/javascript/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 5 additions & 2 deletions tools/__tasks__/test/index.js
Original file line number Diff line number Diff line change
@@ -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,
};
Expand Down
Loading
Loading