From 4779a83574a8803214f5e2cfcd796010b7544ad1 Mon Sep 17 00:00:00 2001 From: HRS Date: Sun, 2 Aug 2026 21:46:39 +0200 Subject: [PATCH] chore: upgrade typescript to 6.0.3 TypeScript 7 (native Go compiler) is not viable yet: typescript-eslint has no release supporting it (programmatic Program API used by typescript-eslint is not implemented in the native compiler yet, hard crashes on lint). Upgraded to 6.0.3, the latest release on the JS-based (Strada) line, which typescript-eslint still supports. Since TS 6.0, @types packages are no longer auto-included by default unless referenced by an explicit import or listed in 'types'. The usb package's own .d.ts relies on ambient globals from @types/w3c-web-usb without importing/referencing it, so it silently stopped resolving (usb itself targets typescript ^6.0.3, so this is a config gap on our side, not a bug in usb). Added an explicit 'types: ["w3c-web-usb"]' to restore resolution without disabling lib checking project-wide. @types/node globals (process, Buffer, etc.) keep resolving fine without being listed since they're pulled in transitively via triple-slash references whenever a node builtin module is imported. --- package-lock.json | 6 ++++-- package.json | 4 ++-- tsconfig.json | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index d0d28aeb..7ec8560f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,7 +60,7 @@ "pino-pretty": "^13.1.3", "socket.io-client": "^4.8.3", "supertest": "^7.2.2", - "typescript": "^5.9.3", + "typescript": "^6.0.3", "typescript-eslint": "^8.57.1", "vitest": "^4.0.16", "vitest-mock-extended": "^3.1.0", @@ -9259,7 +9259,9 @@ } }, "node_modules/typescript": { - "version": "5.9.3", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index dcf7bd8f..427441f5 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "@sinclair/typebox": "^0.34.47", "@stoprocent/noble": "^2.3.17", "@timesplinter/pimple": "^2.1.1", + "@timesplinter/sequential-task-queue": "^1.4.0", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "buttplug": "^3.2.2", @@ -23,7 +24,6 @@ "read-last-lines": "^1.8.0", "reflect-metadata": "^0.1.13", "say": "^0.16.0", - "@timesplinter/sequential-task-queue": "^1.4.0", "serialport": "^13.0.0", "socket.io": "^4.8.3", "speaker": "https://github.com/SlvCtrlPlus/node-speaker/releases/download/v0.1.0/speaker-v0.1.0.tgz", @@ -58,7 +58,7 @@ "pino-pretty": "^13.1.3", "socket.io-client": "^4.8.3", "supertest": "^7.2.2", - "typescript": "^5.9.3", + "typescript": "^6.0.3", "typescript-eslint": "^8.57.1", "vitest": "^4.0.16", "vitest-mock-extended": "^3.1.0", diff --git a/tsconfig.json b/tsconfig.json index cee57dc6..3e6bd4b5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,9 @@ "strict": true, "resolveJsonModule": true, "esModuleInterop": true, + "types": [ + "w3c-web-usb" + ], "rootDir": "./src", "outDir": "./dist", "paths": {