Skip to content

Commit 327ff60

Browse files
authored
Add option for Node.js 22, use 20 as default (#1112)
1 parent 221e474 commit 327ff60

File tree

40 files changed

+213
-70
lines changed

40 files changed

+213
-70
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
(at the beginning of a new line)
77
-->
88
## __WORK IN PROGRESS__
9+
* (AlCalzone) Add Node.js 22 as a supported version, set 20 as the default choice (#1112)
910
* (AlCalzone) Update CI workflows for the adapter creator (#1111)
1011

1112
## 2.6.4 (2024-09-13)

src/lib/core/questions.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,15 +555,17 @@ export const questionGroups: QuestionGroup[] = [
555555
optional: true,
556556
message:
557557
"What's the minimum Node.js version you want to support?",
558-
initial: "18",
559-
choices: ["18", "20"],
558+
initial: "20",
559+
choices: ["18", "20", "22"],
560560
migrate: (ctx) => {
561561
if (ctx.hasDevDependency("@tsconfig/node18")) {
562562
return "18";
563563
} else if (ctx.hasDevDependency("@tsconfig/node20")) {
564564
return "20";
565+
} else if (ctx.hasDevDependency("@tsconfig/node22")) {
566+
return "22";
565567
} else {
566-
return "18";
568+
return "20";
567569
}
568570
},
569571
},
@@ -979,7 +981,7 @@ export interface Answers {
979981
| "code coverage"
980982
| "devcontainer"
981983
)[];
982-
nodeVersion?: "18" | "20";
984+
nodeVersion?: "18" | "20" | "22";
983985
title?: string;
984986
license?: string;
985987
licenseInformation?: LicenseInformation;

templates/_github/workflows/test-and-release.yml.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const templateFunction: TemplateFunction = answers => {
1414
const useReleaseScript = answers.releaseScript === "yes";
1515
const isGitHub = answers.target === "github";
1616

17-
const ltsNodeVersion = "18.x";
18-
const adapterTestVersions = ["18.x", "20.x"];
17+
const ltsNodeVersion = "20.x";
18+
const adapterTestVersions = ["18.x", "20.x", "22.x"];
1919
const adapterTestOS = ["ubuntu-latest", "windows-latest", "macos-latest"];
2020

2121
const adapterName = answers.adapterName;

templates/package.json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const templateFunction: TemplateFunction = async answers => {
2323
const useNyc = answers.tools && answers.tools.indexOf("code coverage") > -1;
2424
const useReleaseScript = answers.releaseScript === "yes";
2525

26-
const minNodeVersion = answers.nodeVersion ?? "18";
26+
const minNodeVersion = answers.nodeVersion ?? "20";
2727

2828
const dependencyPromises = [
2929
...(isAdapter ? ["@iobroker/adapter-core"] : [])

templates/tsconfig.json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export = (answers => {
66
const useTypeChecking = answers.tools && answers.tools.indexOf("type checking") > -1;
77
if (!useTypeScript && !useTypeChecking) return;
88

9-
const minNodeVersion = answers.nodeVersion ?? "18";
9+
const minNodeVersion = answers.nodeVersion ?? "20";
1010

1111
let include: string;
1212
let exclude: string;

test/baselines/ReleaseScript_JS/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"url": "https://github.com/AlCalzone/ioBroker.test-adapter.git"
2020
},
2121
"engines": {
22-
"node": ">= 18"
22+
"node": ">= 20"
2323
},
2424
"dependencies": {
2525
"@iobroker/adapter-core": "^3.1.6"

test/baselines/ReleaseScript_TS/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"url": "https://github.com/AlCalzone/ioBroker.test-adapter.git"
2020
},
2121
"engines": {
22-
"node": ">= 18"
22+
"node": ">= 20"
2323
},
2424
"dependencies": {
2525
"@iobroker/adapter-core": "^3.1.6"
@@ -31,11 +31,11 @@
3131
"@alcalzone/release-script-plugin-manual-review": "^3.7.0",
3232
"@iobroker/adapter-dev": "^1.3.0",
3333
"@iobroker/testing": "^4.1.3",
34-
"@tsconfig/node18": "^18.2.4",
34+
"@tsconfig/node20": "^20.1.4",
3535
"@types/chai-as-promised": "^7.1.8",
3636
"@types/chai": "^4.3.19",
3737
"@types/mocha": "^10.0.8",
38-
"@types/node": "^18.19.50",
38+
"@types/node": "^20.16.5",
3939
"@types/proxyquire": "^1.3.31",
4040
"@types/sinon": "^17.0.3",
4141
"@types/sinon-chai": "^3.2.12",

test/baselines/TS_Prettier/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
"url": "https://github.com/AlCalzone/ioBroker.test-adapter.git"
2020
},
2121
"engines": {
22-
"node": ">= 18"
22+
"node": ">= 20"
2323
},
2424
"dependencies": {
2525
"@iobroker/adapter-core": "^3.1.6"
2626
},
2727
"devDependencies": {
2828
"@iobroker/adapter-dev": "^1.3.0",
2929
"@iobroker/testing": "^4.1.3",
30-
"@tsconfig/node18": "^18.2.4",
30+
"@tsconfig/node20": "^20.1.4",
3131
"@types/chai-as-promised": "^7.1.8",
3232
"@types/chai": "^4.3.19",
3333
"@types/mocha": "^10.0.8",
34-
"@types/node": "^18.19.50",
34+
"@types/node": "^20.16.5",
3535
"@types/proxyquire": "^1.3.31",
3636
"@types/sinon": "^17.0.3",
3737
"@types/sinon-chai": "^3.2.12",

test/baselines/TS_SingleQuotes/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Created with @iobroker/create-adapter v2.6.3
2+
* Created with @iobroker/create-adapter v2.6.4
33
*/
44

55
// The adapter-core module gives you access to the core ioBroker functions

test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/.create-adapter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@
3434
"type": "free",
3535
"license": "MIT"
3636
},
37-
"creatorVersion": "2.6.3"
37+
"creatorVersion": "2.6.4"
3838
}

0 commit comments

Comments
 (0)