From 11346b1dc6f376fffc448aad4cdf7472d5788315 Mon Sep 17 00:00:00 2001 From: Lotus Bot Date: Fri, 22 May 2026 12:52:37 -0400 Subject: [PATCH] chore: upgrade TypeScript to 6.0.3 and modernize tsconfig - typescript 5.9.3 to 6.0.3 - moduleResolution Node to bundler (correct for Vite projects) - target/lib ES2016 to ES2020 (enables flatMap, Promise.allSettled) - Fix global to globalThis in initMatrix.ts (browser env) - Fix EventEmitter default to named import in CallControl.ts Co-Authored-By: Claude Sonnet 4.6 --- package-lock.json | 8 ++++---- package.json | 2 +- src/app/plugins/call/CallControl.ts | 2 +- src/client/initMatrix.ts | 6 +++--- tsconfig.json | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 16da72a06..4effda640 100644 --- a/package-lock.json +++ b/package-lock.json @@ -109,7 +109,7 @@ "lint-staged": "17.0.5", "prettier": "3.8.3", "semantic-release": "25.0.3", - "typescript": "5.9.3", + "typescript": "6.0.3", "vite": "6.4.2", "vite-plugin-pwa": "1.3.0", "vite-plugin-static-copy": "4.1.0" @@ -18388,9 +18388,9 @@ } }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "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 62351a13c..52841ab25 100644 --- a/package.json +++ b/package.json @@ -162,7 +162,7 @@ "lint-staged": "17.0.5", "prettier": "3.8.3", "semantic-release": "25.0.3", - "typescript": "5.9.3", + "typescript": "6.0.3", "vite": "6.4.2", "vite-plugin-pwa": "1.3.0", "vite-plugin-static-copy": "4.1.0" diff --git a/src/app/plugins/call/CallControl.ts b/src/app/plugins/call/CallControl.ts index c3e3cdfd7..90e71ece0 100644 --- a/src/app/plugins/call/CallControl.ts +++ b/src/app/plugins/call/CallControl.ts @@ -1,5 +1,5 @@ import { ClientWidgetApi } from 'matrix-widget-api'; -import EventEmitter from 'events'; +import { EventEmitter } from 'events'; import { CallControlState } from './CallControlState'; import { ElementMediaStateDetail, ElementMediaStatePayload, ElementWidgetActions } from './types'; diff --git a/src/client/initMatrix.ts b/src/client/initMatrix.ts index 78f204c99..5af0925a3 100644 --- a/src/client/initMatrix.ts +++ b/src/client/initMatrix.ts @@ -17,12 +17,12 @@ export const IDB_VERSION_CONFLICT = 'IDB_VERSION_CONFLICT'; export const initClient = async (session: Session): Promise => { const indexedDBStore = new IndexedDBStore({ - indexedDB: global.indexedDB, - localStorage: global.localStorage, + indexedDB: globalThis.indexedDB, + localStorage: globalThis.localStorage, dbName: 'web-sync-store', }); - const legacyCryptoStore = new IndexedDBCryptoStore(global.indexedDB, 'crypto-store'); + const legacyCryptoStore = new IndexedDBCryptoStore(globalThis.indexedDB, 'crypto-store'); const mx = createClient({ baseUrl: session.baseUrl, diff --git a/tsconfig.json b/tsconfig.json index 7608e5578..3582e9fa4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,16 +2,16 @@ "compilerOptions": { "sourceMap": true, "jsx": "react", - "target": "ES2016", + "target": "ES2020", "module": "ES2020", "allowJs": true, "strict": true, "esModuleInterop": true, - "moduleResolution": "Node", + "moduleResolution": "bundler", "resolveJsonModule": true, "outDir": "dist", "skipLibCheck": true, - "lib": ["ES2016", "DOM"] + "lib": ["ES2020", "DOM"] }, "exclude": ["node_modules", "dist"], "include": ["src"]