summaryrefslogtreecommitdiffstatshomepage
path: root/core/scripts/js/jqueryui-check.js
diff options
context:
space:
mode:
authorcatch <catch@35733.no-reply.drupal.org>2019-12-06 12:27:58 +0000
committercatch <catch@35733.no-reply.drupal.org>2019-12-06 12:27:58 +0000
commit75ac95e895d53035f34338fb0b2548bd9e1c97a9 (patch)
tree9241042436a0993c418e86f2a29f6e61bc43c40a /core/scripts/js/jqueryui-check.js
parente49e554766540238c0b9370d7c9ee73416b7c7d3 (diff)
downloaddrupal-75ac95e895d53035f34338fb0b2548bd9e1c97a9.tar.gz
drupal-75ac95e895d53035f34338fb0b2548bd9e1c97a9.zip
Issue #3087685 by zrpnr, bnjmnm, randomyao22, lauriii, xjm, Wim Leers, catch, nod_: Remove deprecated jQuery UI components and fork remaining source code into core
Diffstat (limited to 'core/scripts/js/jqueryui-check.js')
-rw-r--r--core/scripts/js/jqueryui-check.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/core/scripts/js/jqueryui-check.js b/core/scripts/js/jqueryui-check.js
new file mode 100644
index 000000000000..b1600ae46ac6
--- /dev/null
+++ b/core/scripts/js/jqueryui-check.js
@@ -0,0 +1,23 @@
+const chalk = require('chalk');
+const fs = require('fs');
+const log = require('./log');
+const Terser = require('terser');
+
+module.exports = filePath => {
+ log(`'${filePath}' is being checked.`);
+ // Transform the file.
+ const file = fs.readFileSync(filePath, 'utf-8');
+ const result = Terser.minify(file);
+ const fileName = filePath.slice(0, -3);
+ fs.readFile(`${fileName}-min.js`, function read(err, data) {
+ if (err) {
+ log(chalk.red(err));
+ process.exitCode = 1;
+ return;
+ }
+ if (result.code !== data.toString()) {
+ log(chalk.red(`'${filePath}' is not updated.`));
+ process.exitCode = 1;
+ }
+ });
+};