Skip to content

Commit 584d7b0

Browse files
[4.4] Node 20 (joomla#42331)
* Node 20 Signed-off-by: Dimitris Grammatikogiannis <[email protected]> * Update build.js * sign drone config --------- Signed-off-by: Dimitris Grammatikogiannis <[email protected]> Co-authored-by: Richard Fath <[email protected]>
1 parent ff0670e commit 584d7b0

File tree

8 files changed

+154
-185
lines changed

8 files changed

+154
-185
lines changed

.drone.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ steps:
3939
- ./libraries/vendor/bin/phan
4040

4141
- name: npm
42-
image: node:18-bullseye-slim
42+
image: node:20-bullseye-slim
4343
depends_on: [ phpcs ]
4444
volumes:
4545
- name: npm-cache
@@ -471,6 +471,6 @@ trigger:
471471

472472
---
473473
kind: signature
474-
hmac: e6258dbb42f2d93905d0ed3496ccca6e9133d6fd9867ff3b22ccb8b810a01a3e
474+
hmac: 668e2a3bfab925caf4bc0062eaf622d2527f3b8d805e21b663ff1dd89897a431
475475

476476
...

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Build Status
55
---------------------
66
| Drone-CI | AppVeyor | PHP | Node | npm |
77
| ------------- | ------------- | ------------- | ------------- | ------------- |
8-
| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=4.4-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/4.4-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V7.2.5-green)](https://www.php.net/) | [![node-lts](https://img.shields.io/badge/Node-V18.0-green)](https://nodejs.org/en/) | [![npm](https://img.shields.io/badge/npm-v9.6.7-green)](https://nodejs.org/en/) |
8+
| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=4.4-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/4.4-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V7.2.5-green)](https://www.php.net/) | [![node-lts](https://img.shields.io/badge/Node-V20.0-green)](https://nodejs.org/en/) | [![npm](https://img.shields.io/badge/npm-v10.1.0-green)](https://nodejs.org/en/) |
99

1010
Overview
1111
---------------------

build/build.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ const { Timer } = require('./build-modules-js/utils/timer.es6.js');
3939
const options = require('../package.json');
4040
const settings = require('./build-modules-js/settings.json');
4141

42+
43+
const handleError = (err, terminateCode) => {
44+
console.error(err); // eslint-disable-line no-console
45+
process.exit(terminateCode);
46+
};
47+
48+
if (semver.gte(semver.minVersion(options.engines.node), semver.clean(process.version))) {
49+
handleError(`Node version ${semver.clean(process.version)} is not supported, please upgrade to Node version ${semver.clean(options.engines.node)}`, 1);
50+
}
51+
4252
// The command line
4353
const Program = new Command();
4454

@@ -47,12 +57,6 @@ if ('settings' in settings) {
4757
options.settings = settings.settings;
4858
}
4959

50-
const handleError = (err, terminateCode) => {
51-
// eslint-disable-next-line no-console
52-
console.error(err);
53-
process.exit(terminateCode);
54-
};
55-
5660
const allowedVersion = () => {
5761
if (!semver.satisfies(process.version.substring(1), options.engines.node)) {
5862
handleError(`Command line tools require Node Version ${options.engines.node} but found ${process.version}`, -1);
@@ -167,9 +171,5 @@ if (cliOptions.prepare) {
167171
))
168172
.then(() => bench.stop('Build'))
169173
.then(() => { process.exit(0); })
170-
.catch((err) => {
171-
// eslint-disable-next-line no-console
172-
console.error(err);
173-
process.exit(-1);
174-
});
174+
.catch((err) => handleError(err, -1));
175175
}

0 commit comments

Comments
 (0)