-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prepare for ESM migration by reducing the git difference: - default export on separate line - multi-line task arrays - explicit config paths - chore: update hash of eslint plugin Co-authored-by: Ravi <[email protected]>
- Loading branch information
Showing
72 changed files
with
1,755 additions
and
1,601 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
const path = require('path'); | ||
const rimraf = require('rimraf'); | ||
|
||
const { root } = require('../../config').paths; | ||
const { paths } = require('../../config'); | ||
|
||
module.exports = { | ||
description: 'Clear template rendering artefacts', | ||
task: () => rimraf.sync(path.resolve(root, 'common', 'conf', 'assets')), | ||
const task = { | ||
description: 'Clear template rendering artefacts', | ||
task: () => | ||
rimraf.sync(path.resolve(paths.root, 'common', 'conf', 'assets')), | ||
}; | ||
|
||
module.exports = task; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,34 @@ | ||
const path = require('path'); | ||
const cpy = require('cpy'); | ||
|
||
const { conf, target, hash, src } = require('../../config').paths; | ||
const { paths } = require('../../config'); | ||
|
||
module.exports = { | ||
description: 'Copy assets', | ||
task: () => | ||
Promise.all([ | ||
cpy('curl.js', conf, { | ||
cwd: path.resolve( | ||
path.dirname(require.resolve('curl')), | ||
'..', | ||
'dist', | ||
'curl-with-js-and-domReady' | ||
), | ||
}), | ||
cpy( | ||
['**/head*.css', 'inline/**/*.css'], | ||
path.resolve(conf, 'inline-stylesheets'), | ||
{ | ||
cwd: path.resolve(target, 'stylesheets'), | ||
} | ||
), | ||
cpy(['**/assets.map'], path.resolve(conf), { | ||
cwd: path.resolve(hash, 'assets'), | ||
}), | ||
cpy(['polyfill.io'], path.resolve(conf), { | ||
cwd: path.resolve(src, 'javascripts'), | ||
}), | ||
]), | ||
const task = { | ||
description: 'Copy assets', | ||
task: () => | ||
Promise.all([ | ||
cpy('curl.js', paths.conf, { | ||
cwd: path.resolve( | ||
path.dirname(require.resolve('curl')), | ||
'..', | ||
'dist', | ||
'curl-with-js-and-domReady', | ||
), | ||
}), | ||
cpy( | ||
['**/head*.css', 'inline/**/*.css'], | ||
path.resolve(paths.conf, 'inline-stylesheets'), | ||
{ | ||
cwd: path.resolve(paths.target, 'stylesheets'), | ||
}, | ||
), | ||
cpy(['**/assets.map'], path.resolve(paths.conf), { | ||
cwd: path.resolve(paths.hash, 'assets'), | ||
}), | ||
cpy(['polyfill.io'], path.resolve(paths.conf), { | ||
cwd: path.resolve(paths.src, 'javascripts'), | ||
}), | ||
]), | ||
}; | ||
|
||
module.exports = task; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
module.exports = { | ||
description: 'Compile assets for template rendering in Play', | ||
task: [require('./copy'), require('../inline-svgs')], | ||
const task = { | ||
description: 'Compile assets for template rendering in Play', | ||
task: [ | ||
// prettier: multi-line | ||
require('./copy'), | ||
require('../inline-svgs'), | ||
], | ||
}; | ||
|
||
module.exports = task; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
const path = require('path'); | ||
const rimraf = require('rimraf'); | ||
|
||
const { target, hash } = require('../../config').paths; | ||
const { paths } = require('../../config'); | ||
|
||
module.exports = { | ||
description: 'Clear CSS build artefacts', | ||
task: () => { | ||
rimraf.sync(path.resolve(target, 'stylesheets')); | ||
rimraf.sync(path.resolve(hash, 'stylesheets')); | ||
}, | ||
const task = { | ||
description: 'Clear CSS build artefacts', | ||
task: () => { | ||
rimraf.sync(path.resolve(paths.target, 'stylesheets')); | ||
rimraf.sync(path.resolve(paths.hash, 'stylesheets')); | ||
}, | ||
}; | ||
|
||
module.exports = task; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
module.exports = { | ||
description: 'Compile CSS', | ||
task: [ | ||
require('./clean'), | ||
require('./mkdir'), | ||
require('../images'), | ||
require('./sass'), | ||
], | ||
const task = { | ||
description: 'Compile CSS', | ||
task: [ | ||
// prettier: multi-line | ||
require('./clean'), | ||
require('./mkdir'), | ||
require('../images'), | ||
require('./sass'), | ||
], | ||
}; | ||
|
||
module.exports = task; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
module.exports = { | ||
description: 'Compile CSS', | ||
task: [ | ||
require('./clean'), | ||
require('./mkdir'), | ||
require('../images'), | ||
require('./sass'), | ||
], | ||
const task = { | ||
description: 'Compile CSS', | ||
task: [ | ||
// prettier: multi-line | ||
require('./clean'), | ||
require('./mkdir'), | ||
require('../images'), | ||
require('./sass'), | ||
], | ||
}; | ||
|
||
module.exports = task; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
const mkdirp = require('mkdirp'); | ||
const { target } = require('../../config').paths; | ||
const { paths } = require('../../config'); | ||
|
||
module.exports = { | ||
description: 'Create CSS target directory', | ||
task: () => mkdirp.sync(`${target}/stylesheets`), | ||
const task = { | ||
description: 'Create CSS target directory', | ||
task: () => mkdirp.sync(`${paths.target}/stylesheets`), | ||
}; | ||
|
||
module.exports = task; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,45 @@ | ||
const compile = require('../../../compile-css'); | ||
|
||
module.exports = { | ||
description: 'Compile Sass', | ||
task: [ | ||
{ | ||
description: 'Old IE', | ||
task: () => | ||
compile('old-ie.*.scss', { | ||
browsers: 'Explorer 8', | ||
remify: false, | ||
}), | ||
}, | ||
{ | ||
description: 'IE9', | ||
task: () => | ||
compile('ie9.*.scss', { | ||
browsers: 'Explorer 9', | ||
}), | ||
}, | ||
{ | ||
description: 'Email', | ||
task: () => | ||
compile('head.email-{article,front}.scss', { | ||
remify: false, | ||
}), | ||
}, | ||
{ | ||
description: 'Modern', | ||
task: () => | ||
compile('!(_|ie9|old-ie|*email-article|*email-front)*.scss'), | ||
}, | ||
{ | ||
description: 'Inline', | ||
task: () => compile('inline/*.scss'), | ||
}, | ||
{ | ||
description: 'Atoms', | ||
task: () => compile('atoms/*.scss'), | ||
}, | ||
], | ||
concurrent: true, | ||
const task = { | ||
description: 'Compile Sass', | ||
task: [ | ||
{ | ||
description: 'Old IE', | ||
task: () => | ||
compile('old-ie.*.scss', { | ||
browsers: 'Explorer 8', | ||
remify: false, | ||
}), | ||
}, | ||
{ | ||
description: 'IE9', | ||
task: () => | ||
compile('ie9.*.scss', { | ||
browsers: 'Explorer 9', | ||
}), | ||
}, | ||
{ | ||
description: 'Email', | ||
task: () => | ||
compile('head.email-{article,front}.scss', { | ||
remify: false, | ||
}), | ||
}, | ||
{ | ||
description: 'Modern', | ||
task: () => | ||
compile('!(_|ie9|old-ie|*email-article|*email-front)*.scss'), | ||
}, | ||
{ | ||
description: 'Inline', | ||
task: () => compile('inline/*.scss'), | ||
}, | ||
{ | ||
description: 'Atoms', | ||
task: () => compile('atoms/*.scss'), | ||
}, | ||
], | ||
concurrent: true, | ||
}; | ||
|
||
module.exports = task; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
const path = require('path'); | ||
const cpy = require('cpy'); | ||
|
||
const { vendor, target } = require('../../config').paths; | ||
const { paths } = require('../../config'); | ||
|
||
// Source | ||
const ampIframeHtml = path.join(vendor, 'data/amp-iframe.html'); | ||
const ampIframeHtml = path.join(paths.vendor, 'data/amp-iframe.html'); | ||
|
||
// Destinations | ||
// The static assets | ||
const staticDir = path.resolve(target, 'data', 'vendor'); | ||
const staticDir = path.resolve(paths.target, 'data', 'vendor'); | ||
|
||
module.exports = { | ||
description: 'Copy AMP iframe HTML', | ||
task: () => | ||
cpy(ampIframeHtml, staticDir, { | ||
parents: false, | ||
nodir: false, | ||
}), | ||
const task = { | ||
description: 'Copy AMP iframe HTML', | ||
task: () => | ||
cpy(ampIframeHtml, staticDir, { | ||
parents: false, | ||
nodir: false, | ||
}), | ||
}; | ||
|
||
module.exports = task; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
const path = require('path'); | ||
const rimraf = require('rimraf'); | ||
|
||
const { target, hash } = require('../../config').paths; | ||
const { paths } = require('../../config'); | ||
|
||
module.exports = { | ||
description: 'Clear Data build artefacts', | ||
task: () => { | ||
rimraf.sync(path.resolve(target, 'data')); | ||
rimraf.sync(path.resolve(hash, 'data')); | ||
}, | ||
const task = { | ||
description: 'Clear Data build artefacts', | ||
task: () => { | ||
rimraf.sync(path.resolve(paths.target, 'data')); | ||
rimraf.sync(path.resolve(paths.hash, 'data')); | ||
}, | ||
}; | ||
|
||
module.exports = task; |
Oops, something went wrong.