Minimum node version v18 (#3170)

When the next MagicMirror version is released, node v16 will have
reached its end of life.
This commit is contained in:
Kristjan ESPERANTO 2023-08-20 12:55:17 +02:00 committed by GitHub
parent 7dcea98e99
commit 7c64d8fce6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 89 additions and 101 deletions

View File

@ -43,7 +43,7 @@ When submitting a new issue, please supply the following information:
**Platform**: Place your platform here... give us your web browser/Electron version _and_ your hardware (Raspberry Pi 2/3/4, Windows, Mac, Linux, System V UNIX).
**Node Version**: Make sure it's version 16 or later (recommended is 18).
**Node Version**: Make sure it's version 18 or later (recommended is 20).
**MagicMirror² Version**: Please let us know which version of MagicMirror² you are running. It can be found in the `package.json` file.

View File

@ -35,7 +35,7 @@ When submitting a new issue, please supply the following information:
**Platform**: Place your platform here... give us your web browser/Electron version _and_ your hardware (Raspberry Pi 2/3/4, Windows, Mac, Linux, System V UNIX).
**Node Version**: Make sure it's version 16 or later (recommended is 18).
**Node Version**: Make sure it's version 18 or later (recommended is 20).
**MagicMirror² Version**: Please let us know which version of MagicMirror² you are running. It can be found in the `package.json` file.

View File

@ -18,7 +18,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [18.x, 20.x]
steps:
- name: "Checkout code"
uses: actions/checkout@v3

View File

@ -21,6 +21,7 @@ _This release is scheduled to be released on 2023-10-01._
- Update issue template
- Update dependencies incl. electron to v26
- Replace pretty-quick by lint-staged (<https://github.com/azz/pretty-quick/issues/164>)
- Minimum node version is now v18. v16 reached it's end of life.
### Fixed

View File

@ -11,15 +11,8 @@
* @class
*/
async function fetch(url, options = {}) {
// const nodeVersion = process.version.match(/^v(\d+)\.*/)[1];
// if (nodeVersion >= 18) {
// // node version >= 18
// return global.fetch(url, options);
// } else {
// // node version < 18
// const nodefetch = require("node-fetch");
// return nodefetch(url, options);
// }
const nodefetch = require("node-fetch");
return nodefetch(url, options);
}

2
package-lock.json generated
View File

@ -48,7 +48,7 @@
"suncalc": "^1.9.0"
},
"engines": {
"node": ">=16"
"node": ">=18"
},
"optionalDependencies": {
"electron": "^26.0.0"

View File

@ -100,6 +100,6 @@
"fetch": "js/fetch.js"
},
"engines": {
"node": ">=16"
"node": ">=18"
}
}

View File

@ -1,11 +1,8 @@
global.moment = require("moment-timezone");
const { performWebRequest, formatTime } = require("../../../../modules/default/utils");
const nodeVersion = process.version.match(/^v(\d+)\.*/)[1];
describe("Default modules utils tests", () => {
describe("performWebRequest", () => {
if (nodeVersion > 18) {
const locationHost = "localhost:8080";
const locationProtocol = "http";
@ -105,9 +102,6 @@ describe("Default modules utils tests", () => {
expect(response.headers[0].value).toBe("value1");
});
});
} else {
test("Always ok, need one test", () => {});
}
});
describe("formatTime", () => {