From dae94f706cc75e41fc7f1fe6bb283f8c8f9ede06 Mon Sep 17 00:00:00 2001 From: Max Hauser Date: Wed, 13 Nov 2024 17:55:37 +0100 Subject: [PATCH] [chore]: update @types/node to our current nvmrc version (#2959) * update @types/node to our current nvmrc version - and perform needed adaptions * added missing changelog --- CHANGELOG.md | 2 + package-lock.json | 169 ++++++++----------- package.json | 2 +- packages/cli/src/lib/setup/setupMultihost.ts | 51 ++---- 4 files changed, 81 insertions(+), 143 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6380eba5a..a2f043efb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ Placeholder for the next version (at the beginning of the line): ## __WORK IN PROGRESS__ --> +## __WORK IN PROGRESS__ - Lucy +* (@foxriver76) Introduce "Vendor Packages Workflow" (only relevant for vendors - see README.md) ## 7.0.2 (2024-10-28) - Lucy * (@foxriver76) the UI upgrade now runs as the same user as the js-controller diff --git a/package-lock.json b/package-lock.json index 1368be330..824edd434 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "@types/jsonwebtoken": "^8.5.9", "@types/mime-types": "^2.1.1", "@types/mocha": "^10.0.6", - "@types/node": "^18.19.31", + "@types/node": "^20.17.6", "@types/node-forge": "^1.3.0", "@types/node-schedule": "^2.1.0", "@types/pidusage": "^2.0.2", @@ -98,9 +98,9 @@ } }, "node_modules/@alcalzone/esm2cjs": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@alcalzone/esm2cjs/-/esm2cjs-1.3.0.tgz", - "integrity": "sha512-frHlHX3LvZj4E6asyR32PSvpiBuLIaCER3ouiCNjq4qJ7gxxAyVYGswsJH4apX46xQI4I1hc29gci+GeaB4hwQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@alcalzone/esm2cjs/-/esm2cjs-1.4.0.tgz", + "integrity": "sha512-t6MG7T2KZgChePVcJY0Fo3jd59wUxLmwdRxPV7XHXENBZQ70tCdhjhsFGXMRMeypHqrCFTLmv1S4vbPoVD35pw==", "dev": true, "license": "MIT", "dependencies": { @@ -1853,19 +1853,6 @@ "node": "*" } }, - "node_modules/@lerna/create/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@lerna/create/node_modules/p-map": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", @@ -1915,24 +1902,6 @@ "node": ">=8" } }, - "node_modules/@lerna/create/node_modules/tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", - "dev": true, - "license": "ISC", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/@lerna/create/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -3811,13 +3780,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "18.19.50", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.50.tgz", - "integrity": "sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==", + "version": "20.17.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.6.tgz", + "integrity": "sha512-VEI7OdvK2wP7XHnsuXbAJnEpEkF6NjSN45QJlL4VGqZSXsnicpesdTWsg9RISeSdYd3yeRj/y3k5KGjUXYnFwQ==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.19.2" } }, "node_modules/@types/node-forge": { @@ -10705,19 +10674,6 @@ "node": "*" } }, - "node_modules/lerna/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/lerna/node_modules/p-map": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", @@ -10767,24 +10723,6 @@ "node": ">=8" } }, - "node_modules/lerna/node_modules/tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", - "dev": true, - "license": "ISC", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/lerna/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -11544,9 +11482,9 @@ } }, "node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", "dev": true, "funding": [ { @@ -11565,9 +11503,9 @@ } }, "node_modules/micromark-util-encode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", - "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", "dev": true, "funding": [ { @@ -11582,9 +11520,9 @@ "license": "MIT" }, "node_modules/micromark-util-sanitize-uri": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", - "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", "dev": true, "funding": [ { @@ -11604,9 +11542,9 @@ } }, "node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", "dev": true, "funding": [ { @@ -11621,9 +11559,9 @@ "license": "MIT" }, "node_modules/micromark-util-types": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", - "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.1.tgz", + "integrity": "sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ==", "dev": true, "funding": [ { @@ -12154,9 +12092,9 @@ "peer": true }, "node_modules/negotiator": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz", - "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true, "license": "MIT", "engines": { @@ -13487,9 +13425,9 @@ } }, "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", "dev": true, "license": "BlueOak-1.0.0" }, @@ -16572,20 +16510,21 @@ } }, "node_modules/tar": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", - "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "dev": true, "license": "ISC", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", + "minipass": "^3.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">= 10" } }, "node_modules/tar-stream": { @@ -16606,10 +16545,14 @@ } }, "node_modules/tar/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { "node": ">=8" } @@ -17709,9 +17652,9 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "dev": true, "license": "MIT" }, @@ -18797,6 +18740,28 @@ "node": ">=18.0.0" } }, + "packages/controller/node_modules/minipass": { + "version": "5.0.0", + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "packages/controller/node_modules/tar": { + "version": "6.2.1", + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "packages/db-base": { "name": "@iobroker/db-base", "version": "7.0.2", diff --git a/package.json b/package.json index dab195315..915fb6820 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@types/jsonwebtoken": "^8.5.9", "@types/mime-types": "^2.1.1", "@types/mocha": "^10.0.6", - "@types/node": "^18.19.31", + "@types/node": "^20.17.6", "@types/node-forge": "^1.3.0", "@types/node-schedule": "^2.1.0", "@types/pidusage": "^2.0.2", diff --git a/packages/cli/src/lib/setup/setupMultihost.ts b/packages/cli/src/lib/setup/setupMultihost.ts index b6e8cc08e..86e514ea6 100644 --- a/packages/cli/src/lib/setup/setupMultihost.ts +++ b/packages/cli/src/lib/setup/setupMultihost.ts @@ -1,10 +1,11 @@ import fs from 'fs-extra'; import path from 'node:path'; +import readline from 'node:readline'; import { tools } from '@iobroker/js-controller-common'; import { isLocalObjectsDbServer, isLocalStatesDbServer } from '@iobroker/js-controller-common'; import type { Client as ObjectsRedisClient } from '@iobroker/db-objects-redis'; import { MHClient, type BrowseResultEntry } from './multihostClient.js'; -import readline from 'node:readline'; +import readlineSync from 'readline-sync'; import prompt from 'prompt'; interface MHParams { @@ -30,7 +31,7 @@ export class Multihost { } /** - * Retrive config (iobroker.json content) + * Retrieve config (iobroker.json content) */ getConfig(): ioBroker.IoBrokerJson { let config; @@ -257,38 +258,9 @@ export class Multihost { /** * Read password from cli - * - * @param callback */ - readPassword(callback: (password: string) => void): void { - const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout, - }); - - function hidden(query: string, callback: (pw: string) => void): void { - const stdin = process.openStdin(); - process.stdin.on('data', _char => { - const char = _char.toString(); - switch (char) { - case '\n': - case '\r': - case '\u0004': - stdin.pause(); - break; - - default: - process.stdout.write(`\x1B[2K\x1B[200D${query}${new Array(rl.line.length + 1).join('*')}`); - break; - } - }); - - rl.question(query, value => { - callback(value); - }); - } - - hidden('Enter secret phrase for connection: ', password => callback(password)); + readPassword(): string { + return readlineSync.question('Enter secret phrase for connection: ', { hideEchoBack: true }); } /** @@ -400,13 +372,12 @@ export class Multihost { callback(new Error(`Invalid index: ${answer}`)); } else { if (listEntry.auth) { - this.readPassword(password => { - if (password) { - this.connectHelper(mhClient, listEntry.ip!, password, callback); - } else { - callback(new Error('No password entered!')); - } - }); + const password = this.readPassword(); + if (password) { + this.connectHelper(mhClient, listEntry.ip!, password, callback); + } else { + callback(new Error('No password entered!')); + } } else { this.connectHelper(mhClient, listEntry.ip!, '', callback); }