Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore]: Upgrade repository to node22 and add testing for node22 #2960

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- master
- 4.0.x
tags: # for automatic releases
# normal versions
- "v[0-9]+.[0-9]+.[0-9]+"
Expand Down Expand Up @@ -43,7 +42,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-20.04, macos-latest]
node: [18, 20]
node: [18, 20, 22]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -123,11 +122,11 @@ jobs:
if: steps.automerge.outputs.mergeResult == 'merged'
uses: actions/checkout@v4

- name: Use Node.js 18
- name: Use Node.js
if: steps.automerge.outputs.mergeResult == 'merged'
uses: actions/setup-node@v4
with:
node-version: 18
node-version-file: '.nvmrc'

- name: Determine version
if: steps.automerge.outputs.mergeResult == 'merged'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ ioBroker
/packages/controller/iob-vendor.json
build
lerna-debug.log
.nx
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
37,198 changes: 18,914 additions & 18,284 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"iobroker.js-controller": "file:packages/controller"
},
"devDependencies": {
"@alcalzone/esm2cjs": "^1.1.2",
"@alcalzone/esm2cjs": "^1.3.0",
"@alcalzone/pak": "^0.11.0",
"@alcalzone/release-script": "~3.8.0",
"@alcalzone/release-script-plugin-iobroker": "~3.7.0",
Expand All @@ -30,7 +30,7 @@
"@iobroker/types": "file:packages/types-public",
"@iobroker/types-dev": "file:packages/types-dev",
"@microsoft/api-extractor": "^7.43.0",
"@tsconfig/node18": "^18.2.2",
"@tsconfig/node22": "^22.0.0",
"@types/chai": "^4.3.3",
"@types/chai-as-promised": "^7.1.5",
"@types/debug": "^4.1.12",
Expand All @@ -57,7 +57,7 @@
"chai-as-promised": "^7.1.1",
"cpy-cli": "^4.2.0",
"fs-extra": "^11.1.0",
"lerna": "^7.1.4",
"lerna": "^7.4.2",
"mocha": "^10.4.0",
"prettier": "^3.0.1",
"semver": "^7.5.2",
Expand All @@ -66,10 +66,10 @@
"ts-json-schema-generator": "~1.2.0",
"ts-node": "^10.9.2",
"tsc-alias": "^1.8.8",
"typedoc": "^0.25.12",
"typedoc-plugin-markdown": "^3.17.1",
"typedoc-plugin-missing-exports": "^2.2.0",
"typescript": "~5.4.2"
"typedoc": "^0.26.11",
"typedoc-plugin-markdown": "^4.2.10",
"typedoc-plugin-missing-exports": "^3.0.0",
"typescript": "~5.6.3"
},
"scripts": {
"clean": "rimraf packages/*/build packages/*/*.tsbuildinfo",
Expand Down
1 change: 1 addition & 0 deletions packages/adapter/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@iobroker/types-dev" />
export { Adapter, AdapterClass } from '@/lib/adapter/adapter.js';
export { Validator } from '@/lib/adapter/validator.js';
export * from '@/lib/_Types.js';
2 changes: 1 addition & 1 deletion packages/adapter/src/lib/adapter/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import type NodeSchedule from 'node-schedule';
import yargs from 'yargs/yargs';

// local version is always the same as controller version, since lerna exact: true is used
import packJson from '@iobroker/js-controller-adapter/package.json' assert { type: 'json' };
import packJson from '@iobroker/js-controller-adapter/package.json' with { type: 'json' };

const controllerVersion = packJson.version;

Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@iobroker/types-dev" />
export { execute } from '@/lib/setup.js';
export { dbConnectAsync } from '@/lib/setup/dbConnection.js';
export { Vendor } from '@/lib/setup/setupVendor.js';
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@iobroker/types-dev" />
export {
getStatesConstructor,
statesDbHasServer,
Expand Down
12 changes: 1 addition & 11 deletions packages/controller/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
/**
* application.controller
*
* Controls Adapter-Processes
*
* Copyright 2013-2024 bluefox <[email protected]>,
* 2013-2014 hobbyquaker <[email protected]>
* MIT License
*
*/

/// <reference types="@iobroker/types-dev" />
import schedule from 'node-schedule';
import os from 'node:os';
import fs from 'fs-extra';
Expand Down
4 changes: 4 additions & 0 deletions packages/controller/test/_Types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/// <reference types="@iobroker/types-dev" />
import type { AdapterClass } from '@iobroker/js-controller-adapter';
import type { Client as StatesInRedisClient } from '@iobroker/db-states-redis';
import type { Client as ObjectsInRedisClient } from '@iobroker/db-objects-redis';

export interface TestContext extends Mocha.Context {
/** The adapter instance */
adapter: AdapterClass;
/** The states DB */
states: StatesInRedisClient;
/** The objects db */
objects: ObjectsInRedisClient;
/** Allow to unregister handler by setting null */
onAdapterStateChanged: ioBroker.StateChangeHandler | null;
Expand Down
1 change: 1 addition & 0 deletions packages/db-objects-redis/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@iobroker/types-dev" />
/**
* Get the default port for the database
*
Expand Down
1 change: 1 addition & 0 deletions packages/db-states-redis/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@iobroker/types-dev" />
export { StateRedisClient as Client } from '@/lib/states/statesInRedisClient.js';
export { interview } from '@/lib/states/interview.js';
/**
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@tsconfig/node18/tsconfig.json",
"extends": "@tsconfig/node22/tsconfig.json",
"compilerOptions": {
// Pass js files through to the build dir
// but don't complain about errors
Expand Down
Loading