Skip to content

Commit d1e308c

Browse files
CopilotApollon77
andauthored
Add missing migration files for PRs #1153 and #1154 and remove Node.js 18 from CI templates (#1157)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com> Co-authored-by: Ingo Fischer <github@fischer-ka.de>
1 parent 4bba48c commit d1e308c

File tree

8 files changed

+135
-6
lines changed

8 files changed

+135
-6
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Fix outdated jsonConfig schema URL in VSCode settings
2+
3+
The VSCode settings for JSON Config schema validation have been updated to use the official schema location. If you have an existing adapter with VSCode configuration, you should update the schema URL for better IntelliSense and validation.
4+
5+
## What changed
6+
7+
The jsonConfig schema URL has been updated from the old location to the official source:
8+
9+
**Old URL (deprecated):**
10+
```
11+
https://raw.githubusercontent.com/ioBroker/adapter-react-v5/main/schemas/jsonConfig.json
12+
```
13+
14+
**New URL (official):**
15+
```
16+
https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json
17+
```
18+
19+
## How to update your adapter
20+
21+
Open `.vscode/settings.json` in your adapter directory and locate the `json.schemas` section. Update the jsonConfig schema URL:
22+
23+
```diff
24+
{
25+
"json.schemas": [
26+
{
27+
"fileMatch": ["io-package.json"],
28+
"url": "https://json.schemastore.org/io-package"
29+
},
30+
{
31+
"fileMatch": [
32+
"admin/jsonConfig.json",
33+
"admin/jsonCustom.json",
34+
"admin/jsonTab.json"
35+
],
36+
- "url": "https://raw.githubusercontent.com/ioBroker/adapter-react-v5/main/schemas/jsonConfig.json"
37+
+ "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json"
38+
}
39+
]
40+
}
41+
```
42+
43+
## Benefits
44+
45+
- Uses the official, actively maintained schema from ioBroker.admin
46+
- Ensures accurate validation and IntelliSense for JSON Config files
47+
- Future-proofs your development environment against schema changes
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Remove Node.js 18 support from adapter creator
2+
3+
Node.js 18 is approaching end-of-life and new adapters should target more recent Node.js versions. The adapter creator now only supports Node.js 20 and 22 as minimum version options.
4+
5+
## What changed
6+
7+
- **Removed Node.js 18** from the available minimum version choices
8+
- **Updated migration logic** to automatically upgrade existing projects using Node.js 18 to Node.js 20
9+
- **Updated TypeScript interfaces** to reflect the new supported versions (`"20" | "22"`)
10+
11+
## Migration behavior
12+
13+
When migrating existing adapters that currently use Node.js 18 (`@tsconfig/node18` dependency), the tool will automatically select **Node.js 20** as the target version instead. This ensures a smooth upgrade path for existing projects while preventing new adapters from being created with outdated Node.js versions.
14+
15+
## Manual migration for existing adapters
16+
17+
If you have an existing adapter currently targeting Node.js 18, you should manually upgrade to Node.js 20 or 22:
18+
19+
### 1. Update package.json engines field
20+
21+
```diff
22+
{
23+
"engines": {
24+
- "node": ">= 18"
25+
+ "node": ">= 20"
26+
}
27+
}
28+
```
29+
30+
### 2. Update Node.js type definitions
31+
32+
```bash
33+
npm i -D @types/node@20
34+
```
35+
36+
### 3. Update TypeScript configuration base
37+
38+
First, uninstall the old tsconfig base:
39+
```bash
40+
npm uninstall -D @tsconfig/node18
41+
```
42+
43+
Then install the new one:
44+
```bash
45+
npm i -D @tsconfig/node20
46+
```
47+
48+
### 4. Update tsconfig.json
49+
50+
```diff
51+
{
52+
- "extends": "@tsconfig/node18/tsconfig.json",
53+
+ "extends": "@tsconfig/node20/tsconfig.json",
54+
// ...
55+
}
56+
```
57+
58+
### 5. Update GitHub Actions workflow
59+
60+
Edit `.github/workflows/test-and-release.yml`:
61+
62+
```diff
63+
steps:
64+
- uses: ioBroker/testing-action-check@v1
65+
with:
66+
- node-version: '18.x'
67+
+ node-version: '20.x'
68+
lint: true
69+
70+
strategy:
71+
matrix:
72+
- node-version: [18.x, 20.x, 22.x]
73+
+ node-version: [20.x, 22.x]
74+
os: [ubuntu-latest, windows-latest, macos-latest]
75+
```
76+
77+
## Benefits
78+
79+
- **Better security**: Node.js 20+ includes important security improvements
80+
- **Enhanced performance**: Newer Node.js versions offer better performance
81+
- **Modern features**: Access to the latest JavaScript and Node.js features
82+
- **Long-term support**: Node.js 20 is an LTS version with extended support until 2026

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const templateFunction: TemplateFunction = answers => {
1515
const isGitHub = answers.target === "github";
1616

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

2121
const adapterName = answers.adapterName;

test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/.github/workflows/test-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
runs-on: ${{ matrix.os }}
4141
strategy:
4242
matrix:
43-
node-version: [18.x, 20.x, 22.x]
43+
node-version: [20.x, 22.x]
4444
os: [ubuntu-latest, windows-latest, macos-latest]
4545

4646
steps:

test/baselines/adapter_JS_React/.github/workflows/test-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
runs-on: ${{ matrix.os }}
4141
strategy:
4242
matrix:
43-
node-version: [18.x, 20.x, 22.x]
43+
node-version: [20.x, 22.x]
4444
os: [ubuntu-latest, windows-latest, macos-latest]
4545

4646
steps:

test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.github/workflows/test-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ${{ matrix.os }}
4242
strategy:
4343
matrix:
44-
node-version: [18.x, 20.x, 22.x]
44+
node-version: [20.x, 22.x]
4545
os: [ubuntu-latest, windows-latest, macos-latest]
4646

4747
steps:

test/baselines/adapter_TS_React/.github/workflows/test-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ${{ matrix.os }}
4242
strategy:
4343
matrix:
44-
node-version: [18.x, 20.x, 22.x]
44+
node-version: [20.x, 22.x]
4545
os: [ubuntu-latest, windows-latest, macos-latest]
4646

4747
steps:

test/baselines/portal-github/.github/workflows/test-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ${{ matrix.os }}
4242
strategy:
4343
matrix:
44-
node-version: [18.x, 20.x, 22.x]
44+
node-version: [20.x, 22.x]
4545
os: [ubuntu-latest, windows-latest, macos-latest]
4646

4747
steps:

0 commit comments

Comments
 (0)