From adb5934f0bd7817814ab5bc0216ffd3d6673b935 Mon Sep 17 00:00:00 2001 From: Timo Date: Thu, 13 Mar 2025 13:58:43 +0100 Subject: [PATCH 1/7] temp --- src/@types/global.d.ts | 2 +- src/App.tsx | 2 +- src/Avatar.test.tsx | 2 +- src/Avatar.tsx | 2 +- src/ClientContext.tsx | 6 +++--- src/ErrorView.tsx | 2 +- src/FullScreenView.tsx | 2 +- src/IndexedDBWorker.ts | 2 +- src/UrlParams.ts | 2 +- src/UserMenuContainer.tsx | 2 +- src/analytics/PosthogAnalytics.ts | 4 ++-- src/analytics/PosthogEvents.ts | 4 ++-- src/analytics/PosthogSpanProcessor.ts | 2 +- src/auth/RegisterPage.tsx | 2 +- src/auth/useInteractiveLogin.ts | 2 +- src/auth/useInteractiveRegistration.ts | 4 ++-- src/auth/useRecaptcha.ts | 2 +- src/button/ReactionToggleButton.test.tsx | 2 +- src/button/ReactionToggleButton.tsx | 2 +- src/e2ee/matrixKeyProvider.test.ts | 5 +---- src/e2ee/matrixKeyProvider.ts | 4 ++-- src/grid/Grid.tsx | 2 +- src/home/CallList.test.tsx | 2 +- src/home/CallList.tsx | 2 +- src/home/RegisteredView.tsx | 4 ++-- src/home/UnauthenticatedView.tsx | 2 +- src/home/useGroupCallRooms.ts | 8 ++++---- src/initializer.tsx | 2 +- src/livekit/MediaDevicesContext.tsx | 2 +- src/livekit/openIDSFU.ts | 8 ++++---- src/livekit/useECConnectionState.ts | 2 +- src/livekit/useLiveKit.ts | 4 ++-- src/main.tsx | 4 ++-- src/otel/OTelCall.ts | 2 +- src/otel/OTelGroupCallMembership.ts | 4 ++-- src/otel/otel.ts | 2 +- src/profile/useProfile.ts | 4 ++-- src/reactions/ReactionsReader.test.tsx | 4 ++-- src/reactions/ReactionsReader.ts | 8 ++++---- src/reactions/useReactionsSender.tsx | 6 +++--- src/room/AppSelectionModal.tsx | 2 +- src/room/CallEndedView.tsx | 4 ++-- src/room/CallEventAudioRenderer.test.tsx | 2 +- src/room/GroupCallView.test.tsx | 8 ++++---- src/room/GroupCallView.tsx | 8 ++++---- src/room/InCallView.tsx | 6 +++--- src/room/InviteModal.test.tsx | 2 +- src/room/InviteModal.tsx | 2 +- src/room/LobbyView.tsx | 4 ++-- src/room/MuteStates.ts | 2 +- src/room/RoomAuthView.tsx | 2 +- src/room/RoomPage.tsx | 2 +- src/room/useActiveFocus.ts | 6 +++--- src/room/useJoinRule.ts | 4 ++-- src/room/useLoadGroupCall.ts | 8 ++++---- src/room/useRoomAvatar.ts | 2 +- src/room/useRoomName.ts | 2 +- src/room/useRoomState.ts | 6 +----- src/room/useSwitchCamera.ts | 2 +- src/rtcSessionHelpers.test.ts | 4 ++-- src/rtcSessionHelpers.ts | 8 ++++---- src/settings/DeveloperSettingsTab.tsx | 2 +- src/settings/FeedbackSettingsTab.tsx | 2 +- src/settings/ProfileSettingsTab.tsx | 4 ++-- src/settings/RageshakeButton.tsx | 2 +- src/settings/SettingsModal.tsx | 2 +- src/settings/rageshake.ts | 2 +- src/settings/settings.ts | 2 +- src/settings/submit-rageshake.ts | 4 ++-- src/soundUtils.ts | 2 +- src/state/CallViewModel.test.ts | 7 ++----- src/state/CallViewModel.ts | 10 +++------- src/state/MediaViewModel.ts | 2 +- src/state/TileStore.ts | 2 +- src/tile/GridTile.test.tsx | 2 +- src/tile/MediaView.tsx | 2 +- src/tile/SpotlightTile.tsx | 2 +- src/useAudioContext.tsx | 2 +- src/useEvents.ts | 2 +- src/useMatrixRTCSessionJoinState.ts | 4 ++-- src/useMatrixRTCSessionMemberships.ts | 6 +++--- src/useWakeLock.ts | 2 +- src/utils/displayname.ts | 4 ++-- src/utils/matrix.ts | 8 ++++---- src/utils/spa.ts | 4 ++-- src/utils/test-viewmodel.ts | 9 +++------ src/utils/test.ts | 4 ++-- src/vitest.setup.ts | 2 +- src/widget.ts | 8 ++++---- tsconfig.json | 6 +----- 90 files changed, 152 insertions(+), 173 deletions(-) diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index fb259637..2922ca06 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import "matrix-js-sdk/src/@types/global"; +import "matrix-js-sdk/lib/types"; import { type setLogLevel as setLKLogLevel } from "livekit-client"; import type { DurationFormat as PolyfillDurationFormat } from "@formatjs/intl-durationformat"; diff --git a/src/App.tsx b/src/App.tsx index 5b74b4dd..549a98f2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,7 +9,7 @@ import { type FC, type JSX, Suspense, useEffect, useState } from "react"; import { BrowserRouter, Route, useLocation, Routes } from "react-router-dom"; import * as Sentry from "@sentry/react"; import { TooltipProvider } from "@vector-im/compound-web"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { HomePage } from "./home/HomePage"; import { LoginPage } from "./auth/LoginPage"; diff --git a/src/Avatar.test.tsx b/src/Avatar.test.tsx index 0f2d3464..a02963e0 100644 --- a/src/Avatar.test.tsx +++ b/src/Avatar.test.tsx @@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details. import { afterEach, expect, test, vi } from "vitest"; import { render, screen } from "@testing-library/react"; -import { type MatrixClient } from "matrix-js-sdk/src/client"; +import { type MatrixClient } from "matrix-js-sdk"; import { type FC, type PropsWithChildren } from "react"; import { ClientContextProvider } from "./ClientContext"; diff --git a/src/Avatar.tsx b/src/Avatar.tsx index 1a9bac89..d862dbb1 100644 --- a/src/Avatar.tsx +++ b/src/Avatar.tsx @@ -13,7 +13,7 @@ import { useEffect, } from "react"; import { Avatar as CompoundAvatar } from "@vector-im/compound-web"; -import { type MatrixClient } from "matrix-js-sdk/src/client"; +import { type MatrixClient } from "matrix-js-sdk"; import { useClientState } from "./ClientContext"; diff --git a/src/ClientContext.tsx b/src/ClientContext.tsx index 0fbff564..25db3ca0 100644 --- a/src/ClientContext.tsx +++ b/src/ClientContext.tsx @@ -17,9 +17,9 @@ import { type JSX, } from "react"; import { useNavigate } from "react-router-dom"; -import { logger } from "matrix-js-sdk/src/logger"; -import { type ISyncStateData, type SyncState } from "matrix-js-sdk/src/sync"; -import { ClientEvent, type MatrixClient } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/lib/logger"; +import { type ISyncStateData, type SyncState } from "matrix-js-sdk/lib/sync"; +import { ClientEvent, type MatrixClient } from "matrix-js-sdk"; import type { WidgetApi } from "matrix-widget-api"; import { ErrorPage } from "./FullScreenView"; diff --git a/src/ErrorView.tsx b/src/ErrorView.tsx index 8da84ba9..ed4103c5 100644 --- a/src/ErrorView.tsx +++ b/src/ErrorView.tsx @@ -15,7 +15,7 @@ import { type ReactElement, } from "react"; import { useTranslation } from "react-i18next"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { RageshakeButton } from "./settings/RageshakeButton"; import styles from "./ErrorView.module.css"; diff --git a/src/FullScreenView.tsx b/src/FullScreenView.tsx index c8655229..e3c33480 100644 --- a/src/FullScreenView.tsx +++ b/src/FullScreenView.tsx @@ -9,7 +9,7 @@ import { type FC, type ReactElement, type ReactNode, useEffect } from "react"; import classNames from "classnames"; import { useTranslation } from "react-i18next"; import * as Sentry from "@sentry/react"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { ErrorIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { Header, HeaderLogo, LeftNav, RightNav } from "./Header"; diff --git a/src/IndexedDBWorker.ts b/src/IndexedDBWorker.ts index c40e83c7..478c2b02 100644 --- a/src/IndexedDBWorker.ts +++ b/src/IndexedDBWorker.ts @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { IndexedDBStoreWorker } from "matrix-js-sdk/src/indexeddb-worker"; +import { IndexedDBStoreWorker } from "matrix-js-sdk/lib/indexeddb-worker"; // eslint-disable-next-line @typescript-eslint/no-explicit-any const remoteWorker = new IndexedDBStoreWorker((self as any).postMessage); diff --git a/src/UrlParams.ts b/src/UrlParams.ts index fda4a95f..4cf24704 100644 --- a/src/UrlParams.ts +++ b/src/UrlParams.ts @@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details. import { useMemo } from "react"; import { useLocation } from "react-router-dom"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { Config } from "./config/Config"; import { type EncryptionSystem } from "./e2ee/sharedKeyManagement"; diff --git a/src/UserMenuContainer.tsx b/src/UserMenuContainer.tsx index e50154a6..edc2f118 100644 --- a/src/UserMenuContainer.tsx +++ b/src/UserMenuContainer.tsx @@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details. import { type FC, useCallback, useState } from "react"; import { useNavigate, useLocation } from "react-router-dom"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { useClientLegacy } from "./ClientContext"; import { useProfile } from "./profile/useProfile"; diff --git a/src/analytics/PosthogAnalytics.ts b/src/analytics/PosthogAnalytics.ts index e0e7d9e9..23a1fbb0 100644 --- a/src/analytics/PosthogAnalytics.ts +++ b/src/analytics/PosthogAnalytics.ts @@ -10,8 +10,8 @@ import posthog, { type PostHog, type Properties, } from "posthog-js"; -import { logger } from "matrix-js-sdk/src/logger"; -import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { logger } from "matrix-js-sdk/lib/logger"; +import { type MatrixClient } from "matrix-js-sdk"; import { Buffer } from "buffer"; import { widget } from "../widget"; diff --git a/src/analytics/PosthogEvents.ts b/src/analytics/PosthogEvents.ts index 39d560b3..f0f059f5 100644 --- a/src/analytics/PosthogEvents.ts +++ b/src/analytics/PosthogEvents.ts @@ -6,8 +6,8 @@ Please see LICENSE in the repository root for full details. */ import { type DisconnectReason } from "livekit-client"; -import { logger } from "matrix-js-sdk/src/logger"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc"; +import { logger } from "matrix-js-sdk/lib/logger"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import { type IPosthogEvent, diff --git a/src/analytics/PosthogSpanProcessor.ts b/src/analytics/PosthogSpanProcessor.ts index 176a2104..a0046200 100644 --- a/src/analytics/PosthogSpanProcessor.ts +++ b/src/analytics/PosthogSpanProcessor.ts @@ -11,7 +11,7 @@ import { type Span, } from "@opentelemetry/sdk-trace-base"; import { hrTimeToMilliseconds } from "@opentelemetry/core"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { PosthogAnalytics } from "./PosthogAnalytics"; diff --git a/src/auth/RegisterPage.tsx b/src/auth/RegisterPage.tsx index bb2c09a4..bad7b7e6 100644 --- a/src/auth/RegisterPage.tsx +++ b/src/auth/RegisterPage.tsx @@ -18,7 +18,7 @@ import { useNavigate, useLocation } from "react-router-dom"; import { captureException } from "@sentry/react"; import { sleep } from "matrix-js-sdk/src/utils"; import { Trans, useTranslation } from "react-i18next"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { Button, Text } from "@vector-im/compound-web"; import { FieldRow, InputField, ErrorMessage } from "../input/Input"; diff --git a/src/auth/useInteractiveLogin.ts b/src/auth/useInteractiveLogin.ts index 2a6d35fa..b255c1bf 100644 --- a/src/auth/useInteractiveLogin.ts +++ b/src/auth/useInteractiveLogin.ts @@ -11,7 +11,7 @@ import { createClient, type LoginResponse, type MatrixClient, -} from "matrix-js-sdk/src/matrix"; +} from "matrix-js-sdk"; import { initClient } from "../utils/matrix"; import { type Session } from "../ClientContext"; diff --git a/src/auth/useInteractiveRegistration.ts b/src/auth/useInteractiveRegistration.ts index d486cd3d..983d0a71 100644 --- a/src/auth/useInteractiveRegistration.ts +++ b/src/auth/useInteractiveRegistration.ts @@ -11,8 +11,8 @@ import { createClient, type MatrixClient, type RegisterResponse, -} from "matrix-js-sdk/src/matrix"; -import { logger } from "matrix-js-sdk/src/logger"; +} from "matrix-js-sdk"; +import { logger } from "matrix-js-sdk/lib/logger"; import { initClient } from "../utils/matrix"; import { type Session } from "../ClientContext"; diff --git a/src/auth/useRecaptcha.ts b/src/auth/useRecaptcha.ts index 1abf7f27..9d24eb83 100644 --- a/src/auth/useRecaptcha.ts +++ b/src/auth/useRecaptcha.ts @@ -8,7 +8,7 @@ Please see LICENSE in the repository root for full details. import { useEffect, useCallback, useRef, useState } from "react"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; import { useTranslation } from "react-i18next"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { translatedError } from "../TranslatedError"; declare global { diff --git a/src/button/ReactionToggleButton.test.tsx b/src/button/ReactionToggleButton.test.tsx index 90865d25..269eabed 100644 --- a/src/button/ReactionToggleButton.test.tsx +++ b/src/button/ReactionToggleButton.test.tsx @@ -10,7 +10,7 @@ import { expect, test } from "vitest"; import { TooltipProvider } from "@vector-im/compound-web"; import { userEvent } from "@testing-library/user-event"; import { type ReactNode } from "react"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import { ReactionToggleButton } from "./ReactionToggleButton"; import { ElementCallReactionEventType } from "../reactions"; diff --git a/src/button/ReactionToggleButton.tsx b/src/button/ReactionToggleButton.tsx index 68988581..f1a6f0aa 100644 --- a/src/button/ReactionToggleButton.tsx +++ b/src/button/ReactionToggleButton.tsx @@ -22,7 +22,7 @@ import { useState, } from "react"; import { useTranslation } from "react-i18next"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import classNames from "classnames"; import { useObservableState } from "observable-hooks"; import { map } from "rxjs"; diff --git a/src/e2ee/matrixKeyProvider.test.ts b/src/e2ee/matrixKeyProvider.test.ts index 48781759..aa224792 100644 --- a/src/e2ee/matrixKeyProvider.test.ts +++ b/src/e2ee/matrixKeyProvider.test.ts @@ -6,10 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { describe, expect, test, vi } from "vitest"; -import { - type MatrixRTCSession, - MatrixRTCSessionEvent, -} from "matrix-js-sdk/src/matrixrtc"; +import { type MatrixRTCSession, MatrixRTCSessionEvent } from "matrix-js-sdk/lib/matrixrtc"; import { KeyProviderEvent } from "livekit-client"; import { MatrixKeyProvider } from "./matrixKeyProvider"; diff --git a/src/e2ee/matrixKeyProvider.ts b/src/e2ee/matrixKeyProvider.ts index 3b066d95..c5f6c879 100644 --- a/src/e2ee/matrixKeyProvider.ts +++ b/src/e2ee/matrixKeyProvider.ts @@ -6,11 +6,11 @@ Please see LICENSE in the repository root for full details. */ import { BaseKeyProvider, createKeyMaterialFromBuffer } from "livekit-client"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { type MatrixRTCSession, MatrixRTCSessionEvent, -} from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; +} from "matrix-js-sdk/lib/matrixrtc"; export class MatrixKeyProvider extends BaseKeyProvider { private rtcSession?: MatrixRTCSession; diff --git a/src/grid/Grid.tsx b/src/grid/Grid.tsx index d1df51f9..65525446 100644 --- a/src/grid/Grid.tsx +++ b/src/grid/Grid.tsx @@ -32,7 +32,7 @@ import { } from "react"; import useMeasure from "react-use-measure"; import classNames from "classnames"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { useObservableEagerState } from "observable-hooks"; import { fromEvent, map, startWith } from "rxjs"; diff --git a/src/home/CallList.test.tsx b/src/home/CallList.test.tsx index b898bd70..ad0d06e0 100644 --- a/src/home/CallList.test.tsx +++ b/src/home/CallList.test.tsx @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { render, type RenderResult } from "@testing-library/react"; -import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk"; import { MemoryRouter } from "react-router-dom"; import { describe, expect, it } from "vitest"; diff --git a/src/home/CallList.tsx b/src/home/CallList.tsx index efc3a08d..a176b14d 100644 --- a/src/home/CallList.tsx +++ b/src/home/CallList.tsx @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { Link } from "react-router-dom"; -import { type MatrixClient } from "matrix-js-sdk/src/client"; +import { type MatrixClient } from "matrix-js-sdk"; import { type RoomMember } from "matrix-js-sdk/src/models/room-member"; import { type Room } from "matrix-js-sdk/src/models/room"; import { type FC, useCallback, type MouseEvent, useState } from "react"; diff --git a/src/home/RegisteredView.tsx b/src/home/RegisteredView.tsx index 9d44dfc5..af2d5f26 100644 --- a/src/home/RegisteredView.tsx +++ b/src/home/RegisteredView.tsx @@ -12,10 +12,10 @@ import { type FormEventHandler, type FC, } from "react"; -import { type MatrixClient } from "matrix-js-sdk/src/client"; +import { type MatrixClient } from "matrix-js-sdk"; import { useTranslation } from "react-i18next"; import { Heading, Text } from "@vector-im/compound-web"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { Button } from "@vector-im/compound-web"; import { useNavigate } from "react-router-dom"; diff --git a/src/home/UnauthenticatedView.tsx b/src/home/UnauthenticatedView.tsx index ced13985..f3d56668 100644 --- a/src/home/UnauthenticatedView.tsx +++ b/src/home/UnauthenticatedView.tsx @@ -9,7 +9,7 @@ import { type FC, useCallback, useState, type FormEventHandler } from "react"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; import { Trans, useTranslation } from "react-i18next"; import { Button, Heading, Text } from "@vector-im/compound-web"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { useNavigate } from "react-router-dom"; import { useClient } from "../ClientContext"; diff --git a/src/home/useGroupCallRooms.ts b/src/home/useGroupCallRooms.ts index 349275f3..799b287c 100644 --- a/src/home/useGroupCallRooms.ts +++ b/src/home/useGroupCallRooms.ts @@ -5,13 +5,13 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type MatrixClient } from "matrix-js-sdk/src/client"; +import { type MatrixClient } from "matrix-js-sdk"; import { type Room, RoomEvent } from "matrix-js-sdk/src/models/room"; import { type RoomMember } from "matrix-js-sdk/src/models/room-member"; import { useState, useEffect } from "react"; -import { EventTimeline, EventType, JoinRule } from "matrix-js-sdk/src/matrix"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; -import { MatrixRTCSessionManagerEvents } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSessionManager"; +import { EventTimeline, EventType, JoinRule } from "matrix-js-sdk"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; +import { MatrixRTCSessionManagerEvents } from "matrix-js-sdk/lib/matrixrtcManager"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { getKeyForRoom } from "../e2ee/sharedKeyManagement"; diff --git a/src/initializer.tsx b/src/initializer.tsx index 0879490b..24e298cd 100644 --- a/src/initializer.tsx +++ b/src/initializer.tsx @@ -14,7 +14,7 @@ import i18n, { import { initReactI18next } from "react-i18next"; import LanguageDetector from "i18next-browser-languagedetector"; import * as Sentry from "@sentry/react"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { shouldPolyfill as shouldPolyfillSegmenter } from "@formatjs/intl-segmenter/should-polyfill"; import { shouldPolyfill as shouldPolyfillDurationFormat } from "@formatjs/intl-durationformat/should-polyfill"; import { diff --git a/src/livekit/MediaDevicesContext.tsx b/src/livekit/MediaDevicesContext.tsx index 2c2a62bb..c2fc63e5 100644 --- a/src/livekit/MediaDevicesContext.tsx +++ b/src/livekit/MediaDevicesContext.tsx @@ -19,7 +19,7 @@ import { import { createMediaDeviceObserver } from "@livekit/components-core"; import { map, startWith } from "rxjs"; import { useObservableEagerState } from "observable-hooks"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { useSetting, diff --git a/src/livekit/openIDSFU.ts b/src/livekit/openIDSFU.ts index 0f455a38..0c7f36db 100644 --- a/src/livekit/openIDSFU.ts +++ b/src/livekit/openIDSFU.ts @@ -5,11 +5,11 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type IOpenIDToken, type MatrixClient } from "matrix-js-sdk/src/matrix"; -import { logger } from "matrix-js-sdk/src/logger"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; +import { type IOpenIDToken, type MatrixClient } from "matrix-js-sdk"; +import { logger } from "matrix-js-sdk/lib/logger"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import { useEffect, useState } from "react"; -import { type LivekitFocus } from "matrix-js-sdk/src/matrixrtc/LivekitFocus"; +import { type LivekitFocus } from "matrix-js-sdk/lib/matrixrtc"; import { useActiveLivekitFocus } from "../room/useActiveFocus"; diff --git a/src/livekit/useECConnectionState.ts b/src/livekit/useECConnectionState.ts index e575abef..5ae2537b 100644 --- a/src/livekit/useECConnectionState.ts +++ b/src/livekit/useECConnectionState.ts @@ -15,7 +15,7 @@ import { Track, } from "livekit-client"; import { useCallback, useEffect, useRef, useState } from "react"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import * as Sentry from "@sentry/react"; import { type SFUConfig, sfuConfigEquals } from "./openIDSFU"; diff --git a/src/livekit/useLiveKit.ts b/src/livekit/useLiveKit.ts index ef4c0ef7..0500a04d 100644 --- a/src/livekit/useLiveKit.ts +++ b/src/livekit/useLiveKit.ts @@ -15,8 +15,8 @@ import { } from "livekit-client"; import { useEffect, useMemo, useRef } from "react"; import E2EEWorker from "livekit-client/e2ee-worker?worker"; -import { logger } from "matrix-js-sdk/src/logger"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; +import { logger } from "matrix-js-sdk/lib/logger"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import { defaultLiveKitOptions } from "./options"; import { type SFUConfig } from "./openIDSFU"; diff --git a/src/main.tsx b/src/main.tsx index f6200e0e..bfa20443 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -9,12 +9,12 @@ Please see LICENSE in the repository root for full details. // function gets set. It needs to be not in the same file as we use // createClient, or the typescript transpiler gets confused about // dependency references. -import "matrix-js-sdk/src/browser-index"; +import "matrix-js-sdk/lib/browser-index"; import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; import "./index.css"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { setLogExtension as setLKLogExtension, setLogLevel as setLKLogLevel, diff --git a/src/otel/OTelCall.ts b/src/otel/OTelCall.ts index c1b525d9..f212ef67 100644 --- a/src/otel/OTelCall.ts +++ b/src/otel/OTelCall.ts @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { type Span } from "@opentelemetry/api"; -import { type MatrixCall } from "matrix-js-sdk/src/matrix"; +import { type MatrixCall } from "matrix-js-sdk"; import { CallEvent } from "matrix-js-sdk/src/webrtc/call"; import { type TransceiverStats, diff --git a/src/otel/OTelGroupCallMembership.ts b/src/otel/OTelGroupCallMembership.ts index b4ca5e2d..7445a2cb 100644 --- a/src/otel/OTelGroupCallMembership.ts +++ b/src/otel/OTelGroupCallMembership.ts @@ -15,8 +15,8 @@ import { type MatrixClient, type MatrixEvent, type RoomMember, -} from "matrix-js-sdk/src/matrix"; -import { logger } from "matrix-js-sdk/src/logger"; +} from "matrix-js-sdk"; +import { logger } from "matrix-js-sdk/lib/logger"; import { type CallError, type CallState, diff --git a/src/otel/otel.ts b/src/otel/otel.ts index 6bd1ee4c..4cfd0018 100644 --- a/src/otel/otel.ts +++ b/src/otel/otel.ts @@ -11,7 +11,7 @@ import { WebTracerProvider } from "@opentelemetry/sdk-trace-web"; import opentelemetry, { type Tracer } from "@opentelemetry/api"; import { Resource } from "@opentelemetry/resources"; import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { PosthogSpanProcessor } from "../analytics/PosthogSpanProcessor"; import { Config } from "../config/Config"; diff --git a/src/profile/useProfile.ts b/src/profile/useProfile.ts index 1fb545fe..bc68d30b 100644 --- a/src/profile/useProfile.ts +++ b/src/profile/useProfile.ts @@ -5,12 +5,12 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type MatrixClient } from "matrix-js-sdk/src/client"; +import { type MatrixClient } from "matrix-js-sdk"; import { type MatrixEvent } from "matrix-js-sdk/src/models/event"; import { type User, UserEvent } from "matrix-js-sdk/src/models/user"; import { type FileType } from "matrix-js-sdk/src/http-api"; import { useState, useCallback, useEffect } from "react"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; interface ProfileLoadState { success: boolean; diff --git a/src/reactions/ReactionsReader.test.tsx b/src/reactions/ReactionsReader.test.tsx index 43928fa4..b8acf5c7 100644 --- a/src/reactions/ReactionsReader.test.tsx +++ b/src/reactions/ReactionsReader.test.tsx @@ -7,14 +7,14 @@ Please see LICENSE in the repository root for full details. import { renderHook } from "@testing-library/react"; import { afterEach, test, vitest } from "vitest"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import { RoomEvent as MatrixRoomEvent, MatrixEvent, type IRoomTimelineData, EventType, MatrixEventEvent, -} from "matrix-js-sdk/src/matrix"; +} from "matrix-js-sdk"; import { ReactionsReader, REACTION_ACTIVE_TIME_MS } from "./ReactionsReader"; import { diff --git a/src/reactions/ReactionsReader.ts b/src/reactions/ReactionsReader.ts index bcddd03d..ae9fa4e3 100644 --- a/src/reactions/ReactionsReader.ts +++ b/src/reactions/ReactionsReader.ts @@ -9,15 +9,15 @@ import { type CallMembership, MatrixRTCSessionEvent, type MatrixRTCSession, -} from "matrix-js-sdk/src/matrixrtc"; -import { logger } from "matrix-js-sdk/src/logger"; -import { type MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/matrix"; +} from "matrix-js-sdk/lib/matrixrtc"; +import { logger } from "matrix-js-sdk/lib/logger"; +import { type MatrixEvent, MatrixEventEvent } from "matrix-js-sdk"; import { type ReactionEventContent } from "matrix-js-sdk/src/types"; import { RelationType, EventType, RoomEvent as MatrixRoomEvent, -} from "matrix-js-sdk/src/matrix"; +} from "matrix-js-sdk"; import { BehaviorSubject, delay, type Subscription } from "rxjs"; import { diff --git a/src/reactions/useReactionsSender.tsx b/src/reactions/useReactionsSender.tsx index ec692f52..85f1505c 100644 --- a/src/reactions/useReactionsSender.tsx +++ b/src/reactions/useReactionsSender.tsx @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { EventType, RelationType } from "matrix-js-sdk/src/matrix"; +import { EventType, RelationType } from "matrix-js-sdk"; import { createContext, useContext, @@ -14,8 +14,8 @@ import { useMemo, type JSX, } from "react"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; -import { logger } from "matrix-js-sdk/src/logger"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; +import { logger } from "matrix-js-sdk/lib/logger"; import { useObservableEagerState } from "observable-hooks"; import { useMatrixRTCSessionMemberships } from "../useMatrixRTCSessionMemberships"; diff --git a/src/room/AppSelectionModal.tsx b/src/room/AppSelectionModal.tsx index 84827add..c57abfca 100644 --- a/src/room/AppSelectionModal.tsx +++ b/src/room/AppSelectionModal.tsx @@ -15,7 +15,7 @@ import { import { useTranslation } from "react-i18next"; import { Button, Text } from "@vector-im/compound-web"; import { PopOutIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { Modal } from "../Modal"; import { useRoomEncryptionSystem } from "../e2ee/sharedKeyManagement"; diff --git a/src/room/CallEndedView.tsx b/src/room/CallEndedView.tsx index 88f84a24..43aa96e2 100644 --- a/src/room/CallEndedView.tsx +++ b/src/room/CallEndedView.tsx @@ -6,11 +6,11 @@ Please see LICENSE in the repository root for full details. */ import { type FC, type FormEventHandler, useCallback, useState } from "react"; -import { type MatrixClient } from "matrix-js-sdk/src/client"; +import { type MatrixClient } from "matrix-js-sdk"; import { Trans, useTranslation } from "react-i18next"; import { Button, Heading, Text } from "@vector-im/compound-web"; import { useNavigate } from "react-router-dom"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import styles from "./CallEndedView.module.css"; import feedbackStyle from "../input/FeedbackInput.module.css"; diff --git a/src/room/CallEventAudioRenderer.test.tsx b/src/room/CallEventAudioRenderer.test.tsx index a4eae058..281bbafd 100644 --- a/src/room/CallEventAudioRenderer.test.tsx +++ b/src/room/CallEventAudioRenderer.test.tsx @@ -16,7 +16,7 @@ import { afterEach, } from "vitest"; import { act } from "react"; -import { type CallMembership } from "matrix-js-sdk/src/matrixrtc"; +import { type CallMembership } from "matrix-js-sdk/lib/matrixrtc"; import { mockRtcMembership } from "../utils/test"; import { diff --git a/src/room/GroupCallView.test.tsx b/src/room/GroupCallView.test.tsx index 0a57d081..aad1827b 100644 --- a/src/room/GroupCallView.test.tsx +++ b/src/room/GroupCallView.test.tsx @@ -7,13 +7,13 @@ Please see LICENSE in the repository root for full details. import { beforeEach, expect, type MockedFunction, test, vitest } from "vitest"; import { render, waitFor, screen } from "@testing-library/react"; -import { type MatrixClient } from "matrix-js-sdk/src/client"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc"; +import { type MatrixClient } from "matrix-js-sdk"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import { of } from "rxjs"; -import { JoinRule, type RoomState } from "matrix-js-sdk/src/matrix"; +import { JoinRule, type RoomState } from "matrix-js-sdk"; import { BrowserRouter } from "react-router-dom"; import userEvent from "@testing-library/user-event"; -import { type RelationsContainer } from "matrix-js-sdk/src/models/relations-container"; +import { type RelationsContainer } from "matrix-js-sdk"; import { useState } from "react"; import { type MuteStates } from "./MuteStates"; diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 9ebd7e3b..06fcfa4e 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -13,17 +13,17 @@ import { useMemo, useState, } from "react"; -import { type MatrixClient } from "matrix-js-sdk/src/client"; +import { type MatrixClient } from "matrix-js-sdk"; import { Room as LivekitRoom, isE2EESupported as isE2EESupportedBrowser, } from "livekit-client"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { MatrixRTCSessionEvent, type MatrixRTCSession, -} from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; -import { JoinRule, type Room } from "matrix-js-sdk/src/matrix"; +} from "matrix-js-sdk/lib/matrixrtc"; +import { JoinRule, type Room } from "matrix-js-sdk"; import { useNavigate } from "react-router-dom"; import type { IWidgetApiRequest } from "matrix-widget-api"; diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 17ca63bb..53742fc2 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -11,7 +11,7 @@ import { useLocalParticipant, } from "@livekit/components-react"; import { ConnectionState, type Room } from "livekit-client"; -import { type MatrixClient } from "matrix-js-sdk/src/client"; +import { type MatrixClient } from "matrix-js-sdk"; import { type FC, type PointerEvent, @@ -26,11 +26,11 @@ import { type JSX, } from "react"; import useMeasure from "react-use-measure"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import classNames from "classnames"; import { BehaviorSubject, map } from "rxjs"; import { useObservable, useObservableEagerState } from "observable-hooks"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import LogoMark from "../icons/LogoMark.svg?react"; import LogoType from "../icons/LogoType.svg?react"; diff --git a/src/room/InviteModal.test.tsx b/src/room/InviteModal.test.tsx index bb1a4c2b..79f3f928 100644 --- a/src/room/InviteModal.test.tsx +++ b/src/room/InviteModal.test.tsx @@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details. import { render, screen } from "@testing-library/react"; import { expect, test, vi } from "vitest"; -import { type Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk"; import { axe } from "vitest-axe"; import { BrowserRouter } from "react-router-dom"; import userEvent from "@testing-library/user-event"; diff --git a/src/room/InviteModal.tsx b/src/room/InviteModal.tsx index a5a86233..8ee68cb8 100644 --- a/src/room/InviteModal.tsx +++ b/src/room/InviteModal.tsx @@ -13,7 +13,7 @@ import { useState, } from "react"; import { useTranslation } from "react-i18next"; -import { type Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk"; import { Button, Text } from "@vector-im/compound-web"; import { LinkIcon, diff --git a/src/room/LobbyView.tsx b/src/room/LobbyView.tsx index 66458fb6..0a93675e 100644 --- a/src/room/LobbyView.tsx +++ b/src/room/LobbyView.tsx @@ -7,10 +7,10 @@ Please see LICENSE in the repository root for full details. import { type FC, useCallback, useMemo, useState, type JSX } from "react"; import { useTranslation } from "react-i18next"; -import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk"; import { Button } from "@vector-im/compound-web"; import classNames from "classnames"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { usePreviewTracks } from "@livekit/components-react"; import { type LocalVideoTrack, Track } from "livekit-client"; import { useObservable } from "observable-hooks"; diff --git a/src/room/MuteStates.ts b/src/room/MuteStates.ts index ecf7cf44..e57ba7d5 100644 --- a/src/room/MuteStates.ts +++ b/src/room/MuteStates.ts @@ -13,7 +13,7 @@ import { useMemo, } from "react"; import { type IWidgetApiRequest } from "matrix-widget-api"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { type MediaDevice, diff --git a/src/room/RoomAuthView.tsx b/src/room/RoomAuthView.tsx index 645bd18b..d01089cc 100644 --- a/src/room/RoomAuthView.tsx +++ b/src/room/RoomAuthView.tsx @@ -8,7 +8,7 @@ Please see LICENSE in the repository root for full details. import { type FC, useCallback, useState } from "react"; import { useLocation } from "react-router-dom"; import { Trans, useTranslation } from "react-i18next"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { Button, Heading, Text } from "@vector-im/compound-web"; import styles from "./RoomAuthView.module.css"; diff --git a/src/room/RoomPage.tsx b/src/room/RoomPage.tsx index e96790c5..58039aaa 100644 --- a/src/room/RoomPage.tsx +++ b/src/room/RoomPage.tsx @@ -13,7 +13,7 @@ import { useRef, type JSX, } from "react"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { Trans, useTranslation } from "react-i18next"; import { CheckIcon, diff --git a/src/room/useActiveFocus.ts b/src/room/useActiveFocus.ts index f478eb63..28012643 100644 --- a/src/room/useActiveFocus.ts +++ b/src/room/useActiveFocus.ts @@ -8,14 +8,14 @@ Please see LICENSE in the repository root for full details. import { type MatrixRTCSession, MatrixRTCSessionEvent, -} from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; +} from "matrix-js-sdk/lib/matrixrtc"; import { useCallback, useEffect, useState } from "react"; import { deepCompare } from "matrix-js-sdk/src/utils"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { type LivekitFocus, isLivekitFocus, -} from "matrix-js-sdk/src/matrixrtc/LivekitFocus"; +} from "matrix-js-sdk/lib/matrixrtc"; /** * Gets the currently active (livekit) focus for a MatrixRTC session diff --git a/src/room/useJoinRule.ts b/src/room/useJoinRule.ts index 1e1cb059..d2a7143f 100644 --- a/src/room/useJoinRule.ts +++ b/src/room/useJoinRule.ts @@ -6,9 +6,9 @@ Please see LICENSE in the repository root for full details. */ import { useCallback } from "react"; -import { type JoinRule } from "matrix-js-sdk/src/matrix"; +import { type JoinRule } from "matrix-js-sdk"; -import type { Room } from "matrix-js-sdk/src/models/room"; +import type { Room } from "matrix-js-sdk"; import { useRoomState } from "./useRoomState"; export function useJoinRule(room: Room): JoinRule { diff --git a/src/room/useLoadGroupCall.ts b/src/room/useLoadGroupCall.ts index 9000ffd5..e53dc3b5 100644 --- a/src/room/useLoadGroupCall.ts +++ b/src/room/useLoadGroupCall.ts @@ -13,18 +13,18 @@ import { type ComponentType, type SVGAttributes, } from "react"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { EventType } from "matrix-js-sdk/src/@types/event"; import { ClientEvent, type MatrixClient, type RoomSummary, -} from "matrix-js-sdk/src/client"; +} from "matrix-js-sdk"; import { SyncState } from "matrix-js-sdk/src/sync"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import { RoomEvent, type Room } from "matrix-js-sdk/src/models/room"; import { KnownMembership } from "matrix-js-sdk/src/types"; -import { JoinRule, MatrixError } from "matrix-js-sdk/src/matrix"; +import { JoinRule, MatrixError } from "matrix-js-sdk"; import { useTranslation } from "react-i18next"; import { AdminIcon, diff --git a/src/room/useRoomAvatar.ts b/src/room/useRoomAvatar.ts index 2e84338e..7287c652 100644 --- a/src/room/useRoomAvatar.ts +++ b/src/room/useRoomAvatar.ts @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { useCallback } from "react"; -import { type Room } from "matrix-js-sdk/src/models/room"; +import { type Room } from "matrix-js-sdk"; import { useRoomState } from "./useRoomState"; diff --git a/src/room/useRoomName.ts b/src/room/useRoomName.ts index 2994a602..2b7459a3 100644 --- a/src/room/useRoomName.ts +++ b/src/room/useRoomName.ts @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type Room, RoomEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, RoomEvent } from "matrix-js-sdk"; import { useState } from "react"; import { useTypedEventEmitter } from "../useEvents"; diff --git a/src/room/useRoomState.ts b/src/room/useRoomState.ts index f7ddfc17..51a209ab 100644 --- a/src/room/useRoomState.ts +++ b/src/room/useRoomState.ts @@ -5,13 +5,9 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { - type RoomState, - RoomStateEvent, -} from "matrix-js-sdk/src/models/room-state"; import { useCallback, useMemo, useState } from "react"; +import { type RoomState, RoomStateEvent, type Room } from "matrix-js-sdk"; -import type { Room } from "matrix-js-sdk/src/models/room"; import { useTypedEventEmitter } from "../useEvents"; /** diff --git a/src/room/useSwitchCamera.ts b/src/room/useSwitchCamera.ts index 67880fb9..121ffb10 100644 --- a/src/room/useSwitchCamera.ts +++ b/src/room/useSwitchCamera.ts @@ -20,7 +20,7 @@ import { TrackEvent, } from "livekit-client"; import { useObservable, useObservableEagerState } from "observable-hooks"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { useMediaDevices } from "../livekit/MediaDevicesContext"; import { platform } from "../Platform"; diff --git a/src/rtcSessionHelpers.test.ts b/src/rtcSessionHelpers.test.ts index 8d0b95d3..fe7465b3 100644 --- a/src/rtcSessionHelpers.test.ts +++ b/src/rtcSessionHelpers.test.ts @@ -5,9 +5,9 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import { expect, onTestFinished, test, vi } from "vitest"; -import { AutoDiscovery } from "matrix-js-sdk/src/autodiscovery"; +import { AutoDiscovery } from "matrix-js-sdk/lib/autodiscovery"; import EventEmitter from "events"; import { enterRTCSession, leaveRTCSession } from "../src/rtcSessionHelpers"; diff --git a/src/rtcSessionHelpers.ts b/src/rtcSessionHelpers.ts index 0f43fd90..eab376a8 100644 --- a/src/rtcSessionHelpers.ts +++ b/src/rtcSessionHelpers.ts @@ -5,15 +5,15 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; -import { logger } from "matrix-js-sdk/src/logger"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; +import { logger } from "matrix-js-sdk/lib/logger"; import { isLivekitFocus, isLivekitFocusConfig, type LivekitFocus, type LivekitFocusActive, -} from "matrix-js-sdk/src/matrixrtc/LivekitFocus"; -import { AutoDiscovery } from "matrix-js-sdk/src/autodiscovery"; +} from "matrix-js-sdk/lib/matrixrtc"; +import { AutoDiscovery } from "matrix-js-sdk/lib/autodiscovery"; import { PosthogAnalytics } from "./analytics/PosthogAnalytics"; import { Config } from "./config/Config"; diff --git a/src/settings/DeveloperSettingsTab.tsx b/src/settings/DeveloperSettingsTab.tsx index 7f5e236b..fa42292c 100644 --- a/src/settings/DeveloperSettingsTab.tsx +++ b/src/settings/DeveloperSettingsTab.tsx @@ -17,7 +17,7 @@ import { showConnectionStats as showConnectionStatsSetting, useNewMembershipManagerSetting, } from "./settings"; -import type { MatrixClient } from "matrix-js-sdk/src/client"; +import type { MatrixClient } from "matrix-js-sdk"; import type { Room as LivekitRoom } from "livekit-client"; import styles from "./DeveloperSettingsTab.module.css"; interface Props { diff --git a/src/settings/FeedbackSettingsTab.tsx b/src/settings/FeedbackSettingsTab.tsx index 5dcaedc3..ee9911b8 100644 --- a/src/settings/FeedbackSettingsTab.tsx +++ b/src/settings/FeedbackSettingsTab.tsx @@ -9,7 +9,7 @@ import { type ChangeEvent, type FC, useCallback } from "react"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; import { Trans, useTranslation } from "react-i18next"; import { Button, Text } from "@vector-im/compound-web"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { FieldRow, InputField, ErrorMessage } from "../input/Input"; import { useSubmitRageshake, useRageshakeRequest } from "./submit-rageshake"; diff --git a/src/settings/ProfileSettingsTab.tsx b/src/settings/ProfileSettingsTab.tsx index cfb6d727..7a4ac077 100644 --- a/src/settings/ProfileSettingsTab.tsx +++ b/src/settings/ProfileSettingsTab.tsx @@ -6,9 +6,9 @@ Please see LICENSE in the repository root for full details. */ import { type FC, useCallback, useEffect, useMemo, useRef } from "react"; -import { type MatrixClient } from "matrix-js-sdk/src/client"; +import { type MatrixClient } from "matrix-js-sdk"; import { useTranslation } from "react-i18next"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { useProfile } from "../profile/useProfile"; import { FieldRow, InputField, ErrorMessage } from "../input/Input"; diff --git a/src/settings/RageshakeButton.tsx b/src/settings/RageshakeButton.tsx index 43ffd7d5..f4e7bea3 100644 --- a/src/settings/RageshakeButton.tsx +++ b/src/settings/RageshakeButton.tsx @@ -8,7 +8,7 @@ Please see LICENSE in the repository root for full details. import { useTranslation } from "react-i18next"; import { type FC, useCallback, type JSX } from "react"; import { Button } from "@vector-im/compound-web"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { Config } from "../config/Config"; import styles from "./RageshakeButton.module.css"; diff --git a/src/settings/SettingsModal.tsx b/src/settings/SettingsModal.tsx index 04c2a924..0d246415 100644 --- a/src/settings/SettingsModal.tsx +++ b/src/settings/SettingsModal.tsx @@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details. import { type FC, useState } from "react"; import { useTranslation } from "react-i18next"; -import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk"; import { Root as Form } from "@vector-im/compound-web"; import { type Room as LivekitRoom } from "livekit-client"; diff --git a/src/settings/rageshake.ts b/src/settings/rageshake.ts index d96f660b..1d5e581d 100644 --- a/src/settings/rageshake.ts +++ b/src/settings/rageshake.ts @@ -29,7 +29,7 @@ Please see LICENSE in the repository root for full details. import EventEmitter from "events"; import { throttle } from "lodash-es"; -import { type Logger, logger } from "matrix-js-sdk/src/logger"; +import { type Logger, logger } from "matrix-js-sdk/lib/logger"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; import { type LoggingMethod } from "loglevel"; diff --git a/src/settings/settings.ts b/src/settings/settings.ts index ee43acc6..7babcfde 100644 --- a/src/settings/settings.ts +++ b/src/settings/settings.ts @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { BehaviorSubject, type Observable } from "rxjs"; import { useObservableEagerState } from "observable-hooks"; diff --git a/src/settings/submit-rageshake.ts b/src/settings/submit-rageshake.ts index 9f38deb7..b7b91a58 100644 --- a/src/settings/submit-rageshake.ts +++ b/src/settings/submit-rageshake.ts @@ -6,12 +6,12 @@ Please see LICENSE in the repository root for full details. */ import { type ComponentProps, useCallback, useEffect, useState } from "react"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { ClientEvent, type MatrixClient, type MatrixEvent, -} from "matrix-js-sdk/src/matrix"; +} from "matrix-js-sdk"; import { type CryptoApi } from "matrix-js-sdk/src/crypto-api"; import { getLogsForReport } from "./rageshake"; diff --git a/src/soundUtils.ts b/src/soundUtils.ts index 2c259c73..3e774802 100644 --- a/src/soundUtils.ts +++ b/src/soundUtils.ts @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { isFailure } from "./utils/fetch"; diff --git a/src/state/CallViewModel.test.ts b/src/state/CallViewModel.test.ts index d489ad20..dfdf7d90 100644 --- a/src/state/CallViewModel.test.ts +++ b/src/state/CallViewModel.test.ts @@ -17,7 +17,7 @@ import { skip, switchMap, } from "rxjs"; -import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk"; import { ConnectionState, type LocalParticipant, @@ -27,10 +27,7 @@ import { } from "livekit-client"; import * as ComponentsCore from "@livekit/components-core"; import { isEqual } from "lodash-es"; -import { - type CallMembership, - type MatrixRTCSession, -} from "matrix-js-sdk/src/matrixrtc"; +import { type CallMembership, type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import { CallViewModel, type Layout } from "./CallViewModel"; import { diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index ce104396..8fd6f819 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -18,11 +18,7 @@ import { type RemoteParticipant, Track, } from "livekit-client"; -import { - RoomStateEvent, - type Room, - type RoomMember, -} from "matrix-js-sdk/src/matrix"; +import { RoomStateEvent, type Room, type RoomMember } from "matrix-js-sdk"; import { BehaviorSubject, EMPTY, @@ -49,12 +45,12 @@ import { timer, withLatestFrom, } from "rxjs"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { type CallMembership, type MatrixRTCSession, MatrixRTCSessionEvent, -} from "matrix-js-sdk/src/matrixrtc"; +} from "matrix-js-sdk/lib/matrixrtc"; import { ViewModel } from "./ViewModel"; import { diff --git a/src/state/MediaViewModel.ts b/src/state/MediaViewModel.ts index dba86f62..2e03e894 100644 --- a/src/state/MediaViewModel.ts +++ b/src/state/MediaViewModel.ts @@ -26,7 +26,7 @@ import { RoomEvent as LivekitRoomEvent, RemoteTrack, } from "livekit-client"; -import { type RoomMember } from "matrix-js-sdk/src/matrix"; +import { type RoomMember } from "matrix-js-sdk"; import { BehaviorSubject, type Observable, diff --git a/src/state/TileStore.ts b/src/state/TileStore.ts index 9ecf099e..85bf8bc7 100644 --- a/src/state/TileStore.ts +++ b/src/state/TileStore.ts @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { BehaviorSubject } from "rxjs"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { type MediaViewModel, type UserMediaViewModel } from "./MediaViewModel"; import { GridTileViewModel, SpotlightTileViewModel } from "./TileViewModel"; diff --git a/src/tile/GridTile.test.tsx b/src/tile/GridTile.test.tsx index dd1f4b43..b6f111e4 100644 --- a/src/tile/GridTile.test.tsx +++ b/src/tile/GridTile.test.tsx @@ -10,7 +10,7 @@ import { test, expect } from "vitest"; import { render, screen } from "@testing-library/react"; import { axe } from "vitest-axe"; import { of } from "rxjs"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import { GridTile } from "./GridTile"; import { mockRtcMembership, withRemoteMedia } from "../utils/test"; diff --git a/src/tile/MediaView.tsx b/src/tile/MediaView.tsx index 419a9c81..faf12a82 100644 --- a/src/tile/MediaView.tsx +++ b/src/tile/MediaView.tsx @@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details. import { type TrackReferenceOrPlaceholder } from "@livekit/components-core"; import { animated } from "@react-spring/web"; -import { type RoomMember } from "matrix-js-sdk/src/matrix"; +import { type RoomMember } from "matrix-js-sdk"; import { type ComponentProps, type ReactNode, forwardRef } from "react"; import { useTranslation } from "react-i18next"; import classNames from "classnames"; diff --git a/src/tile/SpotlightTile.tsx b/src/tile/SpotlightTile.tsx index 338e84d4..33c24299 100644 --- a/src/tile/SpotlightTile.tsx +++ b/src/tile/SpotlightTile.tsx @@ -26,7 +26,7 @@ import { useObservableEagerState, useObservableRef } from "observable-hooks"; import { useTranslation } from "react-i18next"; import classNames from "classnames"; import { type TrackReferenceOrPlaceholder } from "@livekit/components-core"; -import { type RoomMember } from "matrix-js-sdk/src/matrix"; +import { type RoomMember } from "matrix-js-sdk"; import { MediaView } from "./MediaView"; import styles from "./SpotlightTile.module.css"; diff --git a/src/useAudioContext.tsx b/src/useAudioContext.tsx index 71e22700..d96b9fdc 100644 --- a/src/useAudioContext.tsx +++ b/src/useAudioContext.tsx @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { useState, useEffect } from "react"; import { diff --git a/src/useEvents.ts b/src/useEvents.ts index edce695c..c19145eb 100644 --- a/src/useEvents.ts +++ b/src/useEvents.ts @@ -11,7 +11,7 @@ import type { Listener, ListenerMap, TypedEventEmitter, -} from "matrix-js-sdk/src/models/typed-event-emitter"; +} from "matrix-js-sdk/lib/models/typed-event-emitter"; // Shortcut for registering a listener on an EventTarget export function useEventTarget( diff --git a/src/useMatrixRTCSessionJoinState.ts b/src/useMatrixRTCSessionJoinState.ts index b4f608ab..5e7ea110 100644 --- a/src/useMatrixRTCSessionJoinState.ts +++ b/src/useMatrixRTCSessionJoinState.ts @@ -5,11 +5,11 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { type MatrixRTCSession, MatrixRTCSessionEvent, -} from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; +} from "matrix-js-sdk/lib/matrixrtc"; import { useEffect, useState } from "react"; export function useMatrixRTCSessionJoinState( diff --git a/src/useMatrixRTCSessionMemberships.ts b/src/useMatrixRTCSessionMemberships.ts index b3ec2993..69b2a12d 100644 --- a/src/useMatrixRTCSessionMemberships.ts +++ b/src/useMatrixRTCSessionMemberships.ts @@ -5,12 +5,12 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { logger } from "matrix-js-sdk/src/logger"; -import { type CallMembership } from "matrix-js-sdk/src/matrixrtc/CallMembership"; +import { logger } from "matrix-js-sdk/lib/logger"; +import { type CallMembership } from "matrix-js-sdk/lib/matrixrtc"; import { type MatrixRTCSession, MatrixRTCSessionEvent, -} from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; +} from "matrix-js-sdk/lib/matrixrtc"; import { useCallback, useEffect, useState } from "react"; export function useMatrixRTCSessionMemberships( diff --git a/src/useWakeLock.ts b/src/useWakeLock.ts index b962adc3..76db91cd 100644 --- a/src/useWakeLock.ts +++ b/src/useWakeLock.ts @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { useEffect } from "react"; /** diff --git a/src/utils/displayname.ts b/src/utils/displayname.ts index 0eac045d..1e175368 100644 --- a/src/utils/displayname.ts +++ b/src/utils/displayname.ts @@ -10,8 +10,8 @@ import { removeHiddenChars as removeHiddenCharsUncached, } from "matrix-js-sdk/src/utils"; -import type { Room } from "matrix-js-sdk/src/matrix"; -import type { CallMembership } from "matrix-js-sdk/src/matrixrtc"; +import type { Room } from "matrix-js-sdk"; +import type { CallMembership } from "matrix-js-sdk/lib/matrixrtc"; // Calling removeHiddenChars() can be slow on Safari, so we cache the results. // To illustrate a simple benchmark: diff --git a/src/utils/matrix.ts b/src/utils/matrix.ts index f1801b97..b5f35f94 100644 --- a/src/utils/matrix.ts +++ b/src/utils/matrix.ts @@ -12,13 +12,13 @@ import { type ICreateClientOpts, Preset, Visibility, -} from "matrix-js-sdk/src/matrix"; -import { ClientEvent } from "matrix-js-sdk/src/client"; +} from "matrix-js-sdk"; +import { ClientEvent } from "matrix-js-sdk"; import { type ISyncStateData, type SyncState } from "matrix-js-sdk/src/sync"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { secureRandomBase64Url } from "matrix-js-sdk/src/randomstring"; -import type { MatrixClient } from "matrix-js-sdk/src/client"; +import type { MatrixClient } from "matrix-js-sdk"; import type { Room } from "matrix-js-sdk/src/models/room"; import IndexedDBWorker from "../IndexedDBWorker?worker"; import { generateUrlSearchParams, getUrlParams } from "../UrlParams"; diff --git a/src/utils/spa.ts b/src/utils/spa.ts index fd597f49..a826c542 100644 --- a/src/utils/spa.ts +++ b/src/utils/spa.ts @@ -5,9 +5,9 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type ICreateClientOpts } from "matrix-js-sdk/src/client"; +import { type ICreateClientOpts } from "matrix-js-sdk"; import { MatrixError } from "matrix-js-sdk/src/http-api"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import { Config } from "../config/Config"; import { fallbackICEServerAllowed, initClient } from "./matrix"; diff --git a/src/utils/test-viewmodel.ts b/src/utils/test-viewmodel.ts index 7fe37c20..e9982d3d 100644 --- a/src/utils/test-viewmodel.ts +++ b/src/utils/test-viewmodel.ts @@ -6,12 +6,9 @@ Please see LICENSE in the repository root for full details. */ import { ConnectionState } from "livekit-client"; -import { type MatrixClient } from "matrix-js-sdk/src/client"; -import { type RoomMember } from "matrix-js-sdk/src/matrix"; -import { - type CallMembership, - type MatrixRTCSession, -} from "matrix-js-sdk/src/matrixrtc"; +import { type MatrixClient } from "matrix-js-sdk"; +import { type RoomMember } from "matrix-js-sdk"; +import { type CallMembership, type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import { BehaviorSubject, of } from "rxjs"; import { vitest } from "vitest"; import { type RelationsContainer } from "matrix-js-sdk/src/models/relations-container"; diff --git a/src/utils/test.ts b/src/utils/test.ts index b6f0ecc3..dd3cafaa 100644 --- a/src/utils/test.ts +++ b/src/utils/test.ts @@ -13,14 +13,14 @@ import { MatrixEvent, type Room, TypedEventEmitter, -} from "matrix-js-sdk/src/matrix"; +} from "matrix-js-sdk"; import { CallMembership, type Focus, MatrixRTCSessionEvent, type MatrixRTCSessionEventHandlerMap, type SessionMembershipData, -} from "matrix-js-sdk/src/matrixrtc"; +} from "matrix-js-sdk/lib/matrixrtc"; import { type LocalParticipant, type LocalTrackPublication, diff --git a/src/vitest.setup.ts b/src/vitest.setup.ts index b97b78ff..b31d9f0c 100644 --- a/src/vitest.setup.ts +++ b/src/vitest.setup.ts @@ -14,7 +14,7 @@ import { initReactI18next } from "react-i18next"; import { afterEach } from "vitest"; import { cleanup } from "@testing-library/react"; import "vitest-axe/extend-expect"; -import { logger } from "matrix-js-sdk/src/logger"; +import { logger } from "matrix-js-sdk/lib/logger"; import "@testing-library/jest-dom/vitest"; import EN from "../locales/en/app.json"; diff --git a/src/widget.ts b/src/widget.ts index e9b931fa..8bb920ad 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -5,16 +5,16 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { logger } from "matrix-js-sdk/src/logger"; -import { EventType } from "matrix-js-sdk/src/@types/event"; -import { createRoomWidgetClient } from "matrix-js-sdk/src/matrix"; +import { logger } from "matrix-js-sdk/lib/logger"; +import { EventType } from "matrix-js-sdk/lib/types"; +import { createRoomWidgetClient } from "matrix-js-sdk"; import { WidgetApi, MatrixCapabilities, WidgetApiToWidgetAction, } from "matrix-widget-api"; -import type { MatrixClient } from "matrix-js-sdk/src/client"; +import type { MatrixClient } from "matrix-js-sdk"; import type { IWidgetApiRequest } from "matrix-widget-api"; import { LazyEventEmitter } from "./LazyEventEmitter"; import { getUrlParams } from "./UrlParams"; diff --git a/tsconfig.json b/tsconfig.json index a7c1714b..33a11e51 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -47,9 +47,5 @@ "plugins": [{ "name": "typescript-eslint-language-service" }] }, - "include": [ - "./node_modules/matrix-js-sdk/src/@types/*.d.ts", - "./src/**/*.ts", - "./src/**/*.tsx" - ] + "include": ["./src/**/*.ts", "./src/**/*.tsx"] } From 46f5c44db06f48672b856d8621278cbd69985db2 Mon Sep 17 00:00:00 2001 From: Timo Date: Thu, 13 Mar 2025 16:58:14 +0100 Subject: [PATCH 2/7] temp2 --- package.json | 3 +-- renovate.json | 5 ----- src/@types/matrix-js-sdk.d.ts | 2 +- src/ClientContext.tsx | 2 +- src/auth/RegisterPage.tsx | 2 +- src/auth/useInteractiveLogin.ts | 2 +- src/auth/useInteractiveRegistration.ts | 2 +- src/auth/useRecaptcha.ts | 2 +- src/auth/useRegisterPasswordlessUser.ts | 2 +- src/home/CallList.tsx | 4 ++-- src/home/UnauthenticatedView.tsx | 2 +- src/home/useGroupCallRooms.ts | 21 ++++++++++++------- src/otel/OTelCall.ts | 4 ++-- src/otel/OTelCallAbstractMediaStreamSpan.ts | 2 +- src/otel/OTelCallFeedMediaStreamSpan.ts | 2 +- src/otel/OTelCallMediaStreamTrackSpan.ts | 2 +- .../OTelCallTransceiverMediaStreamSpan.ts | 2 +- src/otel/OTelGroupCallMembership.ts | 6 +++--- src/otel/ObjectFlattener.test.ts | 4 ++-- src/otel/ObjectFlattener.ts | 6 +++--- src/profile/useProfile.ts | 9 +++++--- src/reactions/ReactionsReader.ts | 2 +- src/reactions/index.ts | 2 +- src/room/GroupCallView.tsx | 2 +- src/room/InCallView.tsx | 2 +- src/room/MuteStates.ts | 2 +- src/room/RoomPage.tsx | 2 +- src/room/checkForParallelCalls.test.ts | 2 +- src/room/checkForParallelCalls.ts | 3 +-- src/room/useActiveFocus.ts | 7 ++----- src/room/useLoadGroupCall.ts | 14 +++++++------ src/settings/FeedbackSettingsTab.tsx | 2 +- src/settings/rageshake.ts | 2 +- src/settings/submit-rageshake.ts | 2 +- src/useTheme.test.ts | 2 +- src/useTheme.ts | 4 ++-- src/utils/displayname-integration.test.ts | 6 +++--- src/utils/displayname.ts | 2 +- src/utils/matrix.ts | 11 +++++----- src/utils/spa.ts | 3 +-- src/utils/test-viewmodel.ts | 7 +++++-- src/widget.ts | 4 ++-- yarn.lock | 2 +- 43 files changed, 87 insertions(+), 84 deletions(-) diff --git a/package.json b/package.json index cacd969b..2cf05609 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,6 @@ "vitest-axe": "^1.0.0-pre.3" }, "resolutions": { - "@livekit/components-core/rxjs": "^7.8.1", - "matrix-widget-api": "1.11.0" + "@livekit/components-core/rxjs": "^7.8.1" } } diff --git a/renovate.json b/renovate.json index 31709cf0..23ed1be2 100644 --- a/renovate.json +++ b/renovate.json @@ -24,11 +24,6 @@ "matchDepNames": ["matrix-js-sdk"], "enabled": false }, - { - "groupName": "matrix-widget-api", - "matchDepNames": ["matrix-widget-api"], - "extends": ["schedule:weekly"] - }, { "groupName": "Compound", "matchPackageNames": ["@vector-im/compound-{/,}**"], diff --git a/src/@types/matrix-js-sdk.d.ts b/src/@types/matrix-js-sdk.d.ts index faebc4fa..a9f2e066 100644 --- a/src/@types/matrix-js-sdk.d.ts +++ b/src/@types/matrix-js-sdk.d.ts @@ -11,7 +11,7 @@ import { } from "../reactions"; // Extend Matrix JS SDK types via Typescript declaration merging to support unspecced event fields and types -declare module "matrix-js-sdk/src/types" { +declare module "matrix-js-sdk/lib/types" { export interface TimelineEvents { [ElementCallReactionEventType]: ECallReactionEventContent; } diff --git a/src/ClientContext.tsx b/src/ClientContext.tsx index 25db3ca0..01f5e848 100644 --- a/src/ClientContext.tsx +++ b/src/ClientContext.tsx @@ -21,7 +21,7 @@ import { logger } from "matrix-js-sdk/lib/logger"; import { type ISyncStateData, type SyncState } from "matrix-js-sdk/lib/sync"; import { ClientEvent, type MatrixClient } from "matrix-js-sdk"; -import type { WidgetApi } from "matrix-widget-api"; +import type { WidgetApi } from "matrix-js-sdk/lib/matrix-widget-api"; import { ErrorPage } from "./FullScreenView"; import { widget } from "./widget"; import { diff --git a/src/auth/RegisterPage.tsx b/src/auth/RegisterPage.tsx index bad7b7e6..bd056d08 100644 --- a/src/auth/RegisterPage.tsx +++ b/src/auth/RegisterPage.tsx @@ -16,7 +16,7 @@ import { } from "react"; import { useNavigate, useLocation } from "react-router-dom"; import { captureException } from "@sentry/react"; -import { sleep } from "matrix-js-sdk/src/utils"; +import { sleep } from "matrix-js-sdk/lib/utils"; import { Trans, useTranslation } from "react-i18next"; import { logger } from "matrix-js-sdk/lib/logger"; import { Button, Text } from "@vector-im/compound-web"; diff --git a/src/auth/useInteractiveLogin.ts b/src/auth/useInteractiveLogin.ts index b255c1bf..85a43752 100644 --- a/src/auth/useInteractiveLogin.ts +++ b/src/auth/useInteractiveLogin.ts @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { useCallback } from "react"; -import { InteractiveAuth } from "matrix-js-sdk/src/interactive-auth"; +import { InteractiveAuth } from "matrix-js-sdk"; import { createClient, type LoginResponse, diff --git a/src/auth/useInteractiveRegistration.ts b/src/auth/useInteractiveRegistration.ts index 983d0a71..4972c031 100644 --- a/src/auth/useInteractiveRegistration.ts +++ b/src/auth/useInteractiveRegistration.ts @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { useState, useEffect, useCallback, useRef } from "react"; -import { InteractiveAuth } from "matrix-js-sdk/src/interactive-auth"; +import { InteractiveAuth } from "matrix-js-sdk"; import { createClient, type MatrixClient, diff --git a/src/auth/useRecaptcha.ts b/src/auth/useRecaptcha.ts index 9d24eb83..738d5569 100644 --- a/src/auth/useRecaptcha.ts +++ b/src/auth/useRecaptcha.ts @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { useEffect, useCallback, useRef, useState } from "react"; -import { secureRandomString } from "matrix-js-sdk/src/randomstring"; +import { secureRandomString } from "matrix-js-sdk"; import { useTranslation } from "react-i18next"; import { logger } from "matrix-js-sdk/lib/logger"; diff --git a/src/auth/useRegisterPasswordlessUser.ts b/src/auth/useRegisterPasswordlessUser.ts index 6dad6ebd..e1160a89 100644 --- a/src/auth/useRegisterPasswordlessUser.ts +++ b/src/auth/useRegisterPasswordlessUser.ts @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { useCallback } from "react"; -import { secureRandomString } from "matrix-js-sdk/src/randomstring"; +import { secureRandomString } from "matrix-js-sdk"; import { useClient } from "../ClientContext"; import { useInteractiveRegistration } from "../auth/useInteractiveRegistration"; diff --git a/src/home/CallList.tsx b/src/home/CallList.tsx index a176b14d..b80ff8da 100644 --- a/src/home/CallList.tsx +++ b/src/home/CallList.tsx @@ -7,8 +7,8 @@ Please see LICENSE in the repository root for full details. import { Link } from "react-router-dom"; import { type MatrixClient } from "matrix-js-sdk"; -import { type RoomMember } from "matrix-js-sdk/src/models/room-member"; -import { type Room } from "matrix-js-sdk/src/models/room"; +import { type RoomMember } from "matrix-js-sdk"; +import { type Room } from "matrix-js-sdk"; import { type FC, useCallback, type MouseEvent, useState } from "react"; import { useTranslation } from "react-i18next"; import { IconButton, Text } from "@vector-im/compound-web"; diff --git a/src/home/UnauthenticatedView.tsx b/src/home/UnauthenticatedView.tsx index f3d56668..be34f8f6 100644 --- a/src/home/UnauthenticatedView.tsx +++ b/src/home/UnauthenticatedView.tsx @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { type FC, useCallback, useState, type FormEventHandler } from "react"; -import { secureRandomString } from "matrix-js-sdk/src/randomstring"; +import { secureRandomString } from "matrix-js-sdk"; import { Trans, useTranslation } from "react-i18next"; import { Button, Heading, Text } from "@vector-im/compound-web"; import { logger } from "matrix-js-sdk/lib/logger"; diff --git a/src/home/useGroupCallRooms.ts b/src/home/useGroupCallRooms.ts index 799b287c..45b893e3 100644 --- a/src/home/useGroupCallRooms.ts +++ b/src/home/useGroupCallRooms.ts @@ -5,14 +5,21 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type MatrixClient } from "matrix-js-sdk"; -import { type Room, RoomEvent } from "matrix-js-sdk/src/models/room"; -import { type RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { + type MatrixClient, + type RoomMember, + type Room, + RoomEvent, + EventTimeline, + EventType, + JoinRule, + KnownMembership, +} from "matrix-js-sdk"; import { useState, useEffect } from "react"; -import { EventTimeline, EventType, JoinRule } from "matrix-js-sdk"; -import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; -import { MatrixRTCSessionManagerEvents } from "matrix-js-sdk/lib/matrixrtcManager"; -import { KnownMembership } from "matrix-js-sdk/src/types"; +import { + MatrixRTCSessionManagerEvents, + type MatrixRTCSession, +} from "matrix-js-sdk/lib/matrixrtc"; import { getKeyForRoom } from "../e2ee/sharedKeyManagement"; diff --git a/src/otel/OTelCall.ts b/src/otel/OTelCall.ts index f212ef67..e70cedf2 100644 --- a/src/otel/OTelCall.ts +++ b/src/otel/OTelCall.ts @@ -7,11 +7,11 @@ Please see LICENSE in the repository root for full details. import { type Span } from "@opentelemetry/api"; import { type MatrixCall } from "matrix-js-sdk"; -import { CallEvent } from "matrix-js-sdk/src/webrtc/call"; +import { CallEvent } from "matrix-js-sdk/lib/webrtc/call"; import { type TransceiverStats, type CallFeedStats, -} from "matrix-js-sdk/src/webrtc/stats/statsReport"; +} from "matrix-js-sdk/lib/webrtc/stats/statsReport"; import { ObjectFlattener } from "./ObjectFlattener"; import { ElementCallOpenTelemetry } from "./otel"; diff --git a/src/otel/OTelCallAbstractMediaStreamSpan.ts b/src/otel/OTelCallAbstractMediaStreamSpan.ts index b6718d72..69e41547 100644 --- a/src/otel/OTelCallAbstractMediaStreamSpan.ts +++ b/src/otel/OTelCallAbstractMediaStreamSpan.ts @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import opentelemetry, { type Span } from "@opentelemetry/api"; -import { type TrackStats } from "matrix-js-sdk/src/webrtc/stats/statsReport"; +import { type TrackStats } from "matrix-js-sdk/lib/webrtc/stats/statsReport"; import { type ElementCallOpenTelemetry } from "./otel"; import { OTelCallMediaStreamTrackSpan } from "./OTelCallMediaStreamTrackSpan"; diff --git a/src/otel/OTelCallFeedMediaStreamSpan.ts b/src/otel/OTelCallFeedMediaStreamSpan.ts index 0ea3a37a..59c780a5 100644 --- a/src/otel/OTelCallFeedMediaStreamSpan.ts +++ b/src/otel/OTelCallFeedMediaStreamSpan.ts @@ -9,7 +9,7 @@ import { type Span } from "@opentelemetry/api"; import { type CallFeedStats, type TrackStats, -} from "matrix-js-sdk/src/webrtc/stats/statsReport"; +} from "matrix-js-sdk/lib/webrtc/stats/statsReport"; import { type ElementCallOpenTelemetry } from "./otel"; import { OTelCallAbstractMediaStreamSpan } from "./OTelCallAbstractMediaStreamSpan"; diff --git a/src/otel/OTelCallMediaStreamTrackSpan.ts b/src/otel/OTelCallMediaStreamTrackSpan.ts index 830a64b2..c81acd4f 100644 --- a/src/otel/OTelCallMediaStreamTrackSpan.ts +++ b/src/otel/OTelCallMediaStreamTrackSpan.ts @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type TrackStats } from "matrix-js-sdk/src/webrtc/stats/statsReport"; +import { type TrackStats } from "matrix-js-sdk/lib/webrtc/stats/statsReport"; import opentelemetry, { type Span } from "@opentelemetry/api"; import { type ElementCallOpenTelemetry } from "./otel"; diff --git a/src/otel/OTelCallTransceiverMediaStreamSpan.ts b/src/otel/OTelCallTransceiverMediaStreamSpan.ts index 6eb7ed91..675d793e 100644 --- a/src/otel/OTelCallTransceiverMediaStreamSpan.ts +++ b/src/otel/OTelCallTransceiverMediaStreamSpan.ts @@ -9,7 +9,7 @@ import { type Span } from "@opentelemetry/api"; import { type TrackStats, type TransceiverStats, -} from "matrix-js-sdk/src/webrtc/stats/statsReport"; +} from "matrix-js-sdk/lib/webrtc/stats/statsReport"; import { type ElementCallOpenTelemetry } from "./otel"; import { OTelCallAbstractMediaStreamSpan } from "./OTelCallAbstractMediaStreamSpan"; diff --git a/src/otel/OTelGroupCallMembership.ts b/src/otel/OTelGroupCallMembership.ts index 7445a2cb..668b989c 100644 --- a/src/otel/OTelGroupCallMembership.ts +++ b/src/otel/OTelGroupCallMembership.ts @@ -22,19 +22,19 @@ import { type CallState, type MatrixCall, type VoipEvent, -} from "matrix-js-sdk/src/webrtc/call"; +} from "matrix-js-sdk/lib/webrtc/call"; import { type CallsByUserAndDevice, type GroupCallError, GroupCallEvent, type GroupCallStatsReport, -} from "matrix-js-sdk/src/webrtc/groupCall"; +} from "matrix-js-sdk/lib/webrtc/groupCall"; import { type ConnectionStatsReport, type ByteSentStatsReport, type SummaryStatsReport, type CallFeedReport, -} from "matrix-js-sdk/src/webrtc/stats/statsReport"; +} from "matrix-js-sdk/lib/webrtc/stats/statsReport"; import { ElementCallOpenTelemetry } from "./otel"; import { ObjectFlattener } from "./ObjectFlattener"; diff --git a/src/otel/ObjectFlattener.test.ts b/src/otel/ObjectFlattener.test.ts index 4c2cb07a..5685617c 100644 --- a/src/otel/ObjectFlattener.test.ts +++ b/src/otel/ObjectFlattener.test.ts @@ -5,12 +5,12 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type GroupCallStatsReport } from "matrix-js-sdk/src/webrtc/groupCall"; +import { type GroupCallStatsReport } from "matrix-js-sdk/lib/webrtc/groupCall"; import { type AudioConcealment, type ByteSentStatsReport, type ConnectionStatsReport, -} from "matrix-js-sdk/src/webrtc/stats/statsReport"; +} from "matrix-js-sdk/lib/webrtc/stats/statsReport"; import { describe, expect, it } from "vitest"; import { ObjectFlattener } from "../../src/otel/ObjectFlattener"; diff --git a/src/otel/ObjectFlattener.ts b/src/otel/ObjectFlattener.ts index e36c269e..a963c743 100644 --- a/src/otel/ObjectFlattener.ts +++ b/src/otel/ObjectFlattener.ts @@ -5,13 +5,13 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ import { type Attributes } from "@opentelemetry/api"; -import { type VoipEvent } from "matrix-js-sdk/src/webrtc/call"; -import { type GroupCallStatsReport } from "matrix-js-sdk/src/webrtc/groupCall"; +import { type VoipEvent } from "matrix-js-sdk/lib/webrtc/call"; +import { type GroupCallStatsReport } from "matrix-js-sdk/lib/webrtc/groupCall"; import { type ByteSentStatsReport, type ConnectionStatsReport, type SummaryStatsReport, -} from "matrix-js-sdk/src/webrtc/stats/statsReport"; +} from "matrix-js-sdk/lib/webrtc/stats/statsReport"; export class ObjectFlattener { public static flattenReportObject( diff --git a/src/profile/useProfile.ts b/src/profile/useProfile.ts index bc68d30b..8f68747f 100644 --- a/src/profile/useProfile.ts +++ b/src/profile/useProfile.ts @@ -6,9 +6,12 @@ Please see LICENSE in the repository root for full details. */ import { type MatrixClient } from "matrix-js-sdk"; -import { type MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { type User, UserEvent } from "matrix-js-sdk/src/models/user"; -import { type FileType } from "matrix-js-sdk/src/http-api"; +import { + type MatrixEvent, + type User, + UserEvent, + type FileType, +} from "matrix-js-sdk"; import { useState, useCallback, useEffect } from "react"; import { logger } from "matrix-js-sdk/lib/logger"; diff --git a/src/reactions/ReactionsReader.ts b/src/reactions/ReactionsReader.ts index ae9fa4e3..b630f4b9 100644 --- a/src/reactions/ReactionsReader.ts +++ b/src/reactions/ReactionsReader.ts @@ -12,7 +12,7 @@ import { } from "matrix-js-sdk/lib/matrixrtc"; import { logger } from "matrix-js-sdk/lib/logger"; import { type MatrixEvent, MatrixEventEvent } from "matrix-js-sdk"; -import { type ReactionEventContent } from "matrix-js-sdk/src/types"; +import { type ReactionEventContent } from "matrix-js-sdk/lib/types"; import { RelationType, EventType, diff --git a/src/reactions/index.ts b/src/reactions/index.ts index 31b28fe5..d3c2d9c9 100644 --- a/src/reactions/index.ts +++ b/src/reactions/index.ts @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type RelationType } from "matrix-js-sdk/src/types"; +import { type RelationType } from "matrix-js-sdk"; import catSoundOgg from "../sound/reactions/cat.ogg?url"; import catSoundMp3 from "../sound/reactions/cat.mp3?url"; diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 06fcfa4e..c6e7e3a8 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -26,7 +26,7 @@ import { import { JoinRule, type Room } from "matrix-js-sdk"; import { useNavigate } from "react-router-dom"; -import type { IWidgetApiRequest } from "matrix-widget-api"; +import type { IWidgetApiRequest } from "matrix-js-sdk/lib/matrix-widget-api"; import { ElementWidgetActions, type JoinCallData, diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 53742fc2..99f8a282 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -34,7 +34,7 @@ import { logger } from "matrix-js-sdk/lib/logger"; import LogoMark from "../icons/LogoMark.svg?react"; import LogoType from "../icons/LogoType.svg?react"; -import type { IWidgetApiRequest } from "matrix-widget-api"; +import type { IWidgetApiRequest } from "matrix-js-sdk/lib/matrix-widget-api"; import { EndCallButton, MicButton, diff --git a/src/room/MuteStates.ts b/src/room/MuteStates.ts index e57ba7d5..af78d2eb 100644 --- a/src/room/MuteStates.ts +++ b/src/room/MuteStates.ts @@ -12,7 +12,7 @@ import { useEffect, useMemo, } from "react"; -import { type IWidgetApiRequest } from "matrix-widget-api"; +import { type IWidgetApiRequest } from "matrix-js-sdk/lib/matrix-widget-api"; import { logger } from "matrix-js-sdk/lib/logger"; import { diff --git a/src/room/RoomPage.tsx b/src/room/RoomPage.tsx index 58039aaa..f502407c 100644 --- a/src/room/RoomPage.tsx +++ b/src/room/RoomPage.tsx @@ -13,13 +13,13 @@ import { useRef, type JSX, } from "react"; +import { type MatrixError } from "matrix-js-sdk"; import { logger } from "matrix-js-sdk/lib/logger"; import { Trans, useTranslation } from "react-i18next"; import { CheckIcon, UnknownSolidIcon, } from "@vector-im/compound-design-tokens/assets/web/icons"; -import { type MatrixError } from "matrix-js-sdk/src/http-api"; import { useClientLegacy } from "../ClientContext"; import { ErrorPage, FullScreenView, LoadingPage } from "../FullScreenView"; diff --git a/src/room/checkForParallelCalls.test.ts b/src/room/checkForParallelCalls.test.ts index 932cba98..2d14c79a 100644 --- a/src/room/checkForParallelCalls.test.ts +++ b/src/room/checkForParallelCalls.test.ts @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { vi, type Mocked, test, expect } from "vitest"; -import { type RoomState } from "matrix-js-sdk/src/models/room-state"; +import { type RoomState } from "matrix-js-sdk"; import { PosthogAnalytics } from "../../src/analytics/PosthogAnalytics"; import { checkForParallelCalls } from "../../src/room/checkForParallelCalls"; diff --git a/src/room/checkForParallelCalls.ts b/src/room/checkForParallelCalls.ts index d8c91ea0..ab947176 100644 --- a/src/room/checkForParallelCalls.ts +++ b/src/room/checkForParallelCalls.ts @@ -5,8 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { EventType } from "matrix-js-sdk/src/@types/event"; -import { type RoomState } from "matrix-js-sdk/src/models/room-state"; +import { EventType, type RoomState } from "matrix-js-sdk"; import { PosthogAnalytics } from "../analytics/PosthogAnalytics"; diff --git a/src/room/useActiveFocus.ts b/src/room/useActiveFocus.ts index 28012643..a8dfa836 100644 --- a/src/room/useActiveFocus.ts +++ b/src/room/useActiveFocus.ts @@ -10,12 +10,9 @@ import { MatrixRTCSessionEvent, } from "matrix-js-sdk/lib/matrixrtc"; import { useCallback, useEffect, useState } from "react"; -import { deepCompare } from "matrix-js-sdk/src/utils"; +import { deepCompare } from "matrix-js-sdk/lib/utils"; import { logger } from "matrix-js-sdk/lib/logger"; -import { - type LivekitFocus, - isLivekitFocus, -} from "matrix-js-sdk/lib/matrixrtc"; +import { type LivekitFocus, isLivekitFocus } from "matrix-js-sdk/lib/matrixrtc"; /** * Gets the currently active (livekit) focus for a MatrixRTC session diff --git a/src/room/useLoadGroupCall.ts b/src/room/useLoadGroupCall.ts index e53dc3b5..ab6ccf64 100644 --- a/src/room/useLoadGroupCall.ts +++ b/src/room/useLoadGroupCall.ts @@ -13,18 +13,20 @@ import { type ComponentType, type SVGAttributes, } from "react"; -import { logger } from "matrix-js-sdk/lib/logger"; -import { EventType } from "matrix-js-sdk/src/@types/event"; import { + JoinRule, + EventType, + SyncState, + MatrixError, + KnownMembership, ClientEvent, type MatrixClient, type RoomSummary, + RoomEvent, + type Room, } from "matrix-js-sdk"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { logger } from "matrix-js-sdk/lib/logger"; import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; -import { RoomEvent, type Room } from "matrix-js-sdk/src/models/room"; -import { KnownMembership } from "matrix-js-sdk/src/types"; -import { JoinRule, MatrixError } from "matrix-js-sdk"; import { useTranslation } from "react-i18next"; import { AdminIcon, diff --git a/src/settings/FeedbackSettingsTab.tsx b/src/settings/FeedbackSettingsTab.tsx index ee9911b8..2e330a28 100644 --- a/src/settings/FeedbackSettingsTab.tsx +++ b/src/settings/FeedbackSettingsTab.tsx @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { type ChangeEvent, type FC, useCallback } from "react"; -import { secureRandomString } from "matrix-js-sdk/src/randomstring"; +import { secureRandomString } from "matrix-js-sdk"; import { Trans, useTranslation } from "react-i18next"; import { Button, Text } from "@vector-im/compound-web"; import { logger } from "matrix-js-sdk/lib/logger"; diff --git a/src/settings/rageshake.ts b/src/settings/rageshake.ts index 1d5e581d..5e37d5b7 100644 --- a/src/settings/rageshake.ts +++ b/src/settings/rageshake.ts @@ -30,7 +30,7 @@ Please see LICENSE in the repository root for full details. import EventEmitter from "events"; import { throttle } from "lodash-es"; import { type Logger, logger } from "matrix-js-sdk/lib/logger"; -import { secureRandomString } from "matrix-js-sdk/src/randomstring"; +import { secureRandomString } from "matrix-js-sdk"; import { type LoggingMethod } from "loglevel"; import type loglevel from "loglevel"; diff --git a/src/settings/submit-rageshake.ts b/src/settings/submit-rageshake.ts index b7b91a58..c1b7d659 100644 --- a/src/settings/submit-rageshake.ts +++ b/src/settings/submit-rageshake.ts @@ -12,7 +12,7 @@ import { type MatrixClient, type MatrixEvent, } from "matrix-js-sdk"; -import { type CryptoApi } from "matrix-js-sdk/src/crypto-api"; +import { type CryptoApi } from "matrix-js-sdk/lib/crypto-api"; import { getLogsForReport } from "./rageshake"; import { useClient } from "../ClientContext"; diff --git a/src/useTheme.test.ts b/src/useTheme.test.ts index 6e471462..7e8868fa 100644 --- a/src/useTheme.test.ts +++ b/src/useTheme.test.ts @@ -16,7 +16,7 @@ import { vi, } from "vitest"; import EventEmitter from "events"; -import { WidgetApiToWidgetAction } from "matrix-widget-api"; +import { WidgetApiToWidgetAction } from "matrix-js-sdk/lib/matrix-widget-api"; import { useTheme } from "./useTheme"; import { getUrlParams } from "./UrlParams"; diff --git a/src/useTheme.ts b/src/useTheme.ts index c1cad176..93ee55d4 100644 --- a/src/useTheme.ts +++ b/src/useTheme.ts @@ -6,8 +6,8 @@ Please see LICENSE in the repository root for full details. */ import { useEffect, useLayoutEffect, useRef, useState } from "react"; -import { WidgetApiToWidgetAction } from "matrix-widget-api"; -import { type IThemeChangeActionRequest } from "matrix-widget-api/lib/interfaces/ThemeChangeAction"; +import { WidgetApiToWidgetAction } from "matrix-js-sdk/lib/matrix-widget-api"; +import { type IThemeChangeActionRequest } from "matrix-js-sdk/lib/matrix-widget-api"; import { getUrlParams } from "./UrlParams"; import { widget } from "./widget"; diff --git a/src/utils/displayname-integration.test.ts b/src/utils/displayname-integration.test.ts index 8dd72d8c..5ba42e70 100644 --- a/src/utils/displayname-integration.test.ts +++ b/src/utils/displayname-integration.test.ts @@ -14,14 +14,14 @@ import { mockMatrixRoom } from "./test"; // Ideally these tests would be in ./displayname.test.ts but I can't figure out how to // just spy on the removeHiddenChars() function without impacting the other tests. // So, these tests are in this separate test file. -vi.mock("matrix-js-sdk/src/utils"); +vi.mock("matrix-js-sdk/lib/utils"); describe("shouldDisambiguate", () => { // eslint-disable-next-line @typescript-eslint/consistent-type-imports - let jsUtils: typeof import("matrix-js-sdk/src/utils"); + let jsUtils: typeof import("matrix-js-sdk/lib/utils"); beforeAll(async () => { - jsUtils = await import("matrix-js-sdk/src/utils"); + jsUtils = await import("matrix-js-sdk/lib/utils"); vi.spyOn(jsUtils, "removeHiddenChars").mockImplementation((str) => str); }); afterEach(() => { diff --git a/src/utils/displayname.ts b/src/utils/displayname.ts index 1e175368..d2375897 100644 --- a/src/utils/displayname.ts +++ b/src/utils/displayname.ts @@ -8,7 +8,7 @@ Please see LICENSE in the repository root for full details. import { removeDirectionOverrideChars, removeHiddenChars as removeHiddenCharsUncached, -} from "matrix-js-sdk/src/utils"; +} from "matrix-js-sdk/lib/utils"; import type { Room } from "matrix-js-sdk"; import type { CallMembership } from "matrix-js-sdk/lib/matrixrtc"; diff --git a/src/utils/matrix.ts b/src/utils/matrix.ts index b5f35f94..27bc3bc8 100644 --- a/src/utils/matrix.ts +++ b/src/utils/matrix.ts @@ -5,8 +5,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { IndexedDBStore } from "matrix-js-sdk/src/store/indexeddb"; -import { MemoryStore } from "matrix-js-sdk/src/store/memory"; +import { IndexedDBStore } from "matrix-js-sdk"; +import { MemoryStore } from "matrix-js-sdk"; import { createClient, type ICreateClientOpts, @@ -14,12 +14,11 @@ import { Visibility, } from "matrix-js-sdk"; import { ClientEvent } from "matrix-js-sdk"; -import { type ISyncStateData, type SyncState } from "matrix-js-sdk/src/sync"; +import { type ISyncStateData, type SyncState } from "matrix-js-sdk/lib/sync"; import { logger } from "matrix-js-sdk/lib/logger"; -import { secureRandomBase64Url } from "matrix-js-sdk/src/randomstring"; +import { secureRandomBase64Url } from "matrix-js-sdk"; -import type { MatrixClient } from "matrix-js-sdk"; -import type { Room } from "matrix-js-sdk/src/models/room"; +import type { MatrixClient, Room } from "matrix-js-sdk"; import IndexedDBWorker from "../IndexedDBWorker?worker"; import { generateUrlSearchParams, getUrlParams } from "../UrlParams"; import { Config } from "../config/Config"; diff --git a/src/utils/spa.ts b/src/utils/spa.ts index a826c542..e97d7810 100644 --- a/src/utils/spa.ts +++ b/src/utils/spa.ts @@ -5,8 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type ICreateClientOpts } from "matrix-js-sdk"; -import { MatrixError } from "matrix-js-sdk/src/http-api"; +import { type ICreateClientOpts, MatrixError } from "matrix-js-sdk"; import { logger } from "matrix-js-sdk/lib/logger"; import { Config } from "../config/Config"; diff --git a/src/utils/test-viewmodel.ts b/src/utils/test-viewmodel.ts index e9982d3d..9723d8ed 100644 --- a/src/utils/test-viewmodel.ts +++ b/src/utils/test-viewmodel.ts @@ -8,10 +8,13 @@ Please see LICENSE in the repository root for full details. import { ConnectionState } from "livekit-client"; import { type MatrixClient } from "matrix-js-sdk"; import { type RoomMember } from "matrix-js-sdk"; -import { type CallMembership, type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; +import { + type CallMembership, + type MatrixRTCSession, +} from "matrix-js-sdk/lib/matrixrtc"; import { BehaviorSubject, of } from "rxjs"; import { vitest } from "vitest"; -import { type RelationsContainer } from "matrix-js-sdk/src/models/relations-container"; +import { type RelationsContainer } from "matrix-js-sdk"; import EventEmitter from "events"; import { E2eeType } from "../e2ee/e2eeType"; diff --git a/src/widget.ts b/src/widget.ts index 8bb920ad..f7fe053d 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -12,10 +12,10 @@ import { WidgetApi, MatrixCapabilities, WidgetApiToWidgetAction, -} from "matrix-widget-api"; +} from "matrix-js-sdk/lib/matrix-widget-api"; import type { MatrixClient } from "matrix-js-sdk"; -import type { IWidgetApiRequest } from "matrix-widget-api"; +import type { IWidgetApiRequest } from "matrix-js-sdk/lib/matrix-widget-api"; import { LazyEventEmitter } from "./LazyEventEmitter"; import { getUrlParams } from "./UrlParams"; import { Config } from "./config/Config"; diff --git a/yarn.lock b/yarn.lock index c6b9c56b..9b560160 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6512,7 +6512,7 @@ matrix-events-sdk@0.0.1: unhomoglyph "^1.0.6" uuid "11" -matrix-widget-api@1.11.0, matrix-widget-api@^1.10.0: +matrix-widget-api@^1.10.0: version "1.11.0" resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-1.11.0.tgz#2f548b11a7c0df789d5d4fdb5cc9ef7af8aef3da" integrity sha512-ED/9hrJqDWVLeED0g1uJnYRhINh3ZTquwurdM+Hc8wLVJIQ8G/r7A7z74NC+8bBIHQ1Jo7i1Uq5CoJp/TzFYrA== From f0545ced65e7408e561623697e2b50a8c632a052 Mon Sep 17 00:00:00 2001 From: Timo Date: Thu, 13 Mar 2025 18:15:58 +0100 Subject: [PATCH 3/7] make it work withotu js-sdk changes --- src/ClientContext.tsx | 2 +- src/auth/useRecaptcha.ts | 2 +- src/auth/useRegisterPasswordlessUser.ts | 2 +- src/home/UnauthenticatedView.tsx | 2 +- src/room/GroupCallView.test.tsx | 2 +- src/room/GroupCallView.tsx | 2 +- src/room/InCallView.tsx | 2 +- src/room/MuteStates.ts | 2 +- src/settings/FeedbackSettingsTab.tsx | 2 +- src/settings/rageshake.ts | 2 +- src/useTheme.test.ts | 2 +- src/useTheme.ts | 4 ++-- src/utils/matrix.ts | 2 +- src/utils/test-viewmodel.ts | 2 +- src/widget.ts | 6 +++--- yarn.lock | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/ClientContext.tsx b/src/ClientContext.tsx index 01f5e848..25db3ca0 100644 --- a/src/ClientContext.tsx +++ b/src/ClientContext.tsx @@ -21,7 +21,7 @@ import { logger } from "matrix-js-sdk/lib/logger"; import { type ISyncStateData, type SyncState } from "matrix-js-sdk/lib/sync"; import { ClientEvent, type MatrixClient } from "matrix-js-sdk"; -import type { WidgetApi } from "matrix-js-sdk/lib/matrix-widget-api"; +import type { WidgetApi } from "matrix-widget-api"; import { ErrorPage } from "./FullScreenView"; import { widget } from "./widget"; import { diff --git a/src/auth/useRecaptcha.ts b/src/auth/useRecaptcha.ts index 738d5569..890c55fe 100644 --- a/src/auth/useRecaptcha.ts +++ b/src/auth/useRecaptcha.ts @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { useEffect, useCallback, useRef, useState } from "react"; -import { secureRandomString } from "matrix-js-sdk"; +import { secureRandomString } from "matrix-js-sdk/lib/randomstring"; import { useTranslation } from "react-i18next"; import { logger } from "matrix-js-sdk/lib/logger"; diff --git a/src/auth/useRegisterPasswordlessUser.ts b/src/auth/useRegisterPasswordlessUser.ts index e1160a89..e7c0626d 100644 --- a/src/auth/useRegisterPasswordlessUser.ts +++ b/src/auth/useRegisterPasswordlessUser.ts @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { useCallback } from "react"; -import { secureRandomString } from "matrix-js-sdk"; +import { secureRandomString } from "matrix-js-sdk/lib/randomstring"; import { useClient } from "../ClientContext"; import { useInteractiveRegistration } from "../auth/useInteractiveRegistration"; diff --git a/src/home/UnauthenticatedView.tsx b/src/home/UnauthenticatedView.tsx index be34f8f6..a0ef7c96 100644 --- a/src/home/UnauthenticatedView.tsx +++ b/src/home/UnauthenticatedView.tsx @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { type FC, useCallback, useState, type FormEventHandler } from "react"; -import { secureRandomString } from "matrix-js-sdk"; +import { secureRandomString } from "matrix-js-sdk/lib/randomstring"; import { Trans, useTranslation } from "react-i18next"; import { Button, Heading, Text } from "@vector-im/compound-web"; import { logger } from "matrix-js-sdk/lib/logger"; diff --git a/src/room/GroupCallView.test.tsx b/src/room/GroupCallView.test.tsx index aad1827b..0283bef1 100644 --- a/src/room/GroupCallView.test.tsx +++ b/src/room/GroupCallView.test.tsx @@ -13,7 +13,7 @@ import { of } from "rxjs"; import { JoinRule, type RoomState } from "matrix-js-sdk"; import { BrowserRouter } from "react-router-dom"; import userEvent from "@testing-library/user-event"; -import { type RelationsContainer } from "matrix-js-sdk"; +import { type RelationsContainer } from "matrix-js-sdk/lib/models/relations-container"; import { useState } from "react"; import { type MuteStates } from "./MuteStates"; diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index c6e7e3a8..06fcfa4e 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -26,7 +26,7 @@ import { import { JoinRule, type Room } from "matrix-js-sdk"; import { useNavigate } from "react-router-dom"; -import type { IWidgetApiRequest } from "matrix-js-sdk/lib/matrix-widget-api"; +import type { IWidgetApiRequest } from "matrix-widget-api"; import { ElementWidgetActions, type JoinCallData, diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 99f8a282..53742fc2 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -34,7 +34,7 @@ import { logger } from "matrix-js-sdk/lib/logger"; import LogoMark from "../icons/LogoMark.svg?react"; import LogoType from "../icons/LogoType.svg?react"; -import type { IWidgetApiRequest } from "matrix-js-sdk/lib/matrix-widget-api"; +import type { IWidgetApiRequest } from "matrix-widget-api"; import { EndCallButton, MicButton, diff --git a/src/room/MuteStates.ts b/src/room/MuteStates.ts index af78d2eb..e57ba7d5 100644 --- a/src/room/MuteStates.ts +++ b/src/room/MuteStates.ts @@ -12,7 +12,7 @@ import { useEffect, useMemo, } from "react"; -import { type IWidgetApiRequest } from "matrix-js-sdk/lib/matrix-widget-api"; +import { type IWidgetApiRequest } from "matrix-widget-api"; import { logger } from "matrix-js-sdk/lib/logger"; import { diff --git a/src/settings/FeedbackSettingsTab.tsx b/src/settings/FeedbackSettingsTab.tsx index 2e330a28..07a0202e 100644 --- a/src/settings/FeedbackSettingsTab.tsx +++ b/src/settings/FeedbackSettingsTab.tsx @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { type ChangeEvent, type FC, useCallback } from "react"; -import { secureRandomString } from "matrix-js-sdk"; +import { secureRandomString } from "matrix-js-sdk/lib/randomstring"; import { Trans, useTranslation } from "react-i18next"; import { Button, Text } from "@vector-im/compound-web"; import { logger } from "matrix-js-sdk/lib/logger"; diff --git a/src/settings/rageshake.ts b/src/settings/rageshake.ts index 5e37d5b7..21ed5956 100644 --- a/src/settings/rageshake.ts +++ b/src/settings/rageshake.ts @@ -30,7 +30,7 @@ Please see LICENSE in the repository root for full details. import EventEmitter from "events"; import { throttle } from "lodash-es"; import { type Logger, logger } from "matrix-js-sdk/lib/logger"; -import { secureRandomString } from "matrix-js-sdk"; +import { secureRandomString } from "matrix-js-sdk/lib/randomstring"; import { type LoggingMethod } from "loglevel"; import type loglevel from "loglevel"; diff --git a/src/useTheme.test.ts b/src/useTheme.test.ts index 7e8868fa..6e471462 100644 --- a/src/useTheme.test.ts +++ b/src/useTheme.test.ts @@ -16,7 +16,7 @@ import { vi, } from "vitest"; import EventEmitter from "events"; -import { WidgetApiToWidgetAction } from "matrix-js-sdk/lib/matrix-widget-api"; +import { WidgetApiToWidgetAction } from "matrix-widget-api"; import { useTheme } from "./useTheme"; import { getUrlParams } from "./UrlParams"; diff --git a/src/useTheme.ts b/src/useTheme.ts index 93ee55d4..e992aee7 100644 --- a/src/useTheme.ts +++ b/src/useTheme.ts @@ -6,8 +6,8 @@ Please see LICENSE in the repository root for full details. */ import { useEffect, useLayoutEffect, useRef, useState } from "react"; -import { WidgetApiToWidgetAction } from "matrix-js-sdk/lib/matrix-widget-api"; -import { type IThemeChangeActionRequest } from "matrix-js-sdk/lib/matrix-widget-api"; +import { WidgetApiToWidgetAction } from "matrix-widget-api"; +import { type IThemeChangeActionRequest } from "matrix-widget-api"; import { getUrlParams } from "./UrlParams"; import { widget } from "./widget"; diff --git a/src/utils/matrix.ts b/src/utils/matrix.ts index 27bc3bc8..acc7fa11 100644 --- a/src/utils/matrix.ts +++ b/src/utils/matrix.ts @@ -16,7 +16,7 @@ import { import { ClientEvent } from "matrix-js-sdk"; import { type ISyncStateData, type SyncState } from "matrix-js-sdk/lib/sync"; import { logger } from "matrix-js-sdk/lib/logger"; -import { secureRandomBase64Url } from "matrix-js-sdk"; +import { secureRandomBase64Url } from "matrix-js-sdk/lib/randomstring"; import type { MatrixClient, Room } from "matrix-js-sdk"; import IndexedDBWorker from "../IndexedDBWorker?worker"; diff --git a/src/utils/test-viewmodel.ts b/src/utils/test-viewmodel.ts index 9723d8ed..ca358c2c 100644 --- a/src/utils/test-viewmodel.ts +++ b/src/utils/test-viewmodel.ts @@ -14,7 +14,7 @@ import { } from "matrix-js-sdk/lib/matrixrtc"; import { BehaviorSubject, of } from "rxjs"; import { vitest } from "vitest"; -import { type RelationsContainer } from "matrix-js-sdk"; +import { type RelationsContainer } from "matrix-js-sdk/lib/models/relations-container"; import EventEmitter from "events"; import { E2eeType } from "../e2ee/e2eeType"; diff --git a/src/widget.ts b/src/widget.ts index f7fe053d..d3124dc9 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -6,16 +6,16 @@ Please see LICENSE in the repository root for full details. */ import { logger } from "matrix-js-sdk/lib/logger"; -import { EventType } from "matrix-js-sdk/lib/types"; +import { EventType } from "matrix-js-sdk"; import { createRoomWidgetClient } from "matrix-js-sdk"; import { WidgetApi, MatrixCapabilities, WidgetApiToWidgetAction, -} from "matrix-js-sdk/lib/matrix-widget-api"; +} from "matrix-widget-api"; import type { MatrixClient } from "matrix-js-sdk"; -import type { IWidgetApiRequest } from "matrix-js-sdk/lib/matrix-widget-api"; +import type { IWidgetApiRequest } from "matrix-widget-api"; import { LazyEventEmitter } from "./LazyEventEmitter"; import { getUrlParams } from "./UrlParams"; import { Config } from "./config/Config"; diff --git a/yarn.lock b/yarn.lock index 9b560160..c6b9c56b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6512,7 +6512,7 @@ matrix-events-sdk@0.0.1: unhomoglyph "^1.0.6" uuid "11" -matrix-widget-api@^1.10.0: +matrix-widget-api@1.11.0, matrix-widget-api@^1.10.0: version "1.11.0" resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-1.11.0.tgz#2f548b11a7c0df789d5d4fdb5cc9ef7af8aef3da" integrity sha512-ED/9hrJqDWVLeED0g1uJnYRhINh3ZTquwurdM+Hc8wLVJIQ8G/r7A7z74NC+8bBIHQ1Jo7i1Uq5CoJp/TzFYrA== From 6f93a037cf6c593da13d2d6d62e7d47771756e7c Mon Sep 17 00:00:00 2001 From: Timo Date: Thu, 13 Mar 2025 18:36:01 +0100 Subject: [PATCH 4/7] import cleanups --- package.json | 3 ++- renovate.json | 5 +++++ src/@types/global.d.ts | 1 - src/home/CallList.tsx | 4 +--- src/profile/useProfile.ts | 2 +- src/room/GroupCallView.test.tsx | 3 +-- src/room/GroupCallView.tsx | 3 +-- src/room/useJoinRule.ts | 3 +-- src/utils/matrix.ts | 9 ++++----- src/utils/test-viewmodel.ts | 3 +-- src/widget.ts | 3 +-- 11 files changed, 18 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 2cf05609..cacd969b 100644 --- a/package.json +++ b/package.json @@ -125,6 +125,7 @@ "vitest-axe": "^1.0.0-pre.3" }, "resolutions": { - "@livekit/components-core/rxjs": "^7.8.1" + "@livekit/components-core/rxjs": "^7.8.1", + "matrix-widget-api": "1.11.0" } } diff --git a/renovate.json b/renovate.json index 23ed1be2..31709cf0 100644 --- a/renovate.json +++ b/renovate.json @@ -24,6 +24,11 @@ "matchDepNames": ["matrix-js-sdk"], "enabled": false }, + { + "groupName": "matrix-widget-api", + "matchDepNames": ["matrix-widget-api"], + "extends": ["schedule:weekly"] + }, { "groupName": "Compound", "matchPackageNames": ["@vector-im/compound-{/,}**"], diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index 2922ca06..ac5ed913 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -5,7 +5,6 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import "matrix-js-sdk/lib/types"; import { type setLogLevel as setLKLogLevel } from "livekit-client"; import type { DurationFormat as PolyfillDurationFormat } from "@formatjs/intl-durationformat"; diff --git a/src/home/CallList.tsx b/src/home/CallList.tsx index b80ff8da..2e3d1db3 100644 --- a/src/home/CallList.tsx +++ b/src/home/CallList.tsx @@ -6,15 +6,13 @@ Please see LICENSE in the repository root for full details. */ import { Link } from "react-router-dom"; -import { type MatrixClient } from "matrix-js-sdk"; -import { type RoomMember } from "matrix-js-sdk"; -import { type Room } from "matrix-js-sdk"; import { type FC, useCallback, type MouseEvent, useState } from "react"; import { useTranslation } from "react-i18next"; import { IconButton, Text } from "@vector-im/compound-web"; import { CloseIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import classNames from "classnames"; +import type { RoomMember, Room, MatrixClient } from "matrix-js-sdk"; import { Avatar, Size } from "../Avatar"; import styles from "./CallList.module.css"; import { getRelativeRoomUrl } from "../utils/matrix"; diff --git a/src/profile/useProfile.ts b/src/profile/useProfile.ts index 8f68747f..b588f053 100644 --- a/src/profile/useProfile.ts +++ b/src/profile/useProfile.ts @@ -5,10 +5,10 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type MatrixClient } from "matrix-js-sdk"; import { type MatrixEvent, type User, + type MatrixClient, UserEvent, type FileType, } from "matrix-js-sdk"; diff --git a/src/room/GroupCallView.test.tsx b/src/room/GroupCallView.test.tsx index 0283bef1..655096f1 100644 --- a/src/room/GroupCallView.test.tsx +++ b/src/room/GroupCallView.test.tsx @@ -7,10 +7,9 @@ Please see LICENSE in the repository root for full details. import { beforeEach, expect, type MockedFunction, test, vitest } from "vitest"; import { render, waitFor, screen } from "@testing-library/react"; -import { type MatrixClient } from "matrix-js-sdk"; +import { type MatrixClient, JoinRule, type RoomState } from "matrix-js-sdk"; import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; import { of } from "rxjs"; -import { JoinRule, type RoomState } from "matrix-js-sdk"; import { BrowserRouter } from "react-router-dom"; import userEvent from "@testing-library/user-event"; import { type RelationsContainer } from "matrix-js-sdk/lib/models/relations-container"; diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 06fcfa4e..d5cd27e8 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -13,7 +13,7 @@ import { useMemo, useState, } from "react"; -import { type MatrixClient } from "matrix-js-sdk"; +import { type MatrixClient, JoinRule, type Room } from "matrix-js-sdk"; import { Room as LivekitRoom, isE2EESupported as isE2EESupportedBrowser, @@ -23,7 +23,6 @@ import { MatrixRTCSessionEvent, type MatrixRTCSession, } from "matrix-js-sdk/lib/matrixrtc"; -import { JoinRule, type Room } from "matrix-js-sdk"; import { useNavigate } from "react-router-dom"; import type { IWidgetApiRequest } from "matrix-widget-api"; diff --git a/src/room/useJoinRule.ts b/src/room/useJoinRule.ts index d2a7143f..ae17e162 100644 --- a/src/room/useJoinRule.ts +++ b/src/room/useJoinRule.ts @@ -6,9 +6,8 @@ Please see LICENSE in the repository root for full details. */ import { useCallback } from "react"; -import { type JoinRule } from "matrix-js-sdk"; -import type { Room } from "matrix-js-sdk"; +import type { JoinRule, Room } from "matrix-js-sdk"; import { useRoomState } from "./useRoomState"; export function useJoinRule(room: Room): JoinRule { diff --git a/src/utils/matrix.ts b/src/utils/matrix.ts index acc7fa11..963ca962 100644 --- a/src/utils/matrix.ts +++ b/src/utils/matrix.ts @@ -5,20 +5,19 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { IndexedDBStore } from "matrix-js-sdk"; -import { MemoryStore } from "matrix-js-sdk"; import { + ClientEvent, createClient, - type ICreateClientOpts, + IndexedDBStore, + MemoryStore, Preset, Visibility, } from "matrix-js-sdk"; -import { ClientEvent } from "matrix-js-sdk"; import { type ISyncStateData, type SyncState } from "matrix-js-sdk/lib/sync"; import { logger } from "matrix-js-sdk/lib/logger"; import { secureRandomBase64Url } from "matrix-js-sdk/lib/randomstring"; -import type { MatrixClient, Room } from "matrix-js-sdk"; +import type { ICreateClientOpts, MatrixClient, Room } from "matrix-js-sdk"; import IndexedDBWorker from "../IndexedDBWorker?worker"; import { generateUrlSearchParams, getUrlParams } from "../UrlParams"; import { Config } from "../config/Config"; diff --git a/src/utils/test-viewmodel.ts b/src/utils/test-viewmodel.ts index ca358c2c..c8a93c73 100644 --- a/src/utils/test-viewmodel.ts +++ b/src/utils/test-viewmodel.ts @@ -6,8 +6,6 @@ Please see LICENSE in the repository root for full details. */ import { ConnectionState } from "livekit-client"; -import { type MatrixClient } from "matrix-js-sdk"; -import { type RoomMember } from "matrix-js-sdk"; import { type CallMembership, type MatrixRTCSession, @@ -17,6 +15,7 @@ import { vitest } from "vitest"; import { type RelationsContainer } from "matrix-js-sdk/lib/models/relations-container"; import EventEmitter from "events"; +import type { RoomMember, MatrixClient } from "matrix-js-sdk"; import { E2eeType } from "../e2ee/e2eeType"; import { CallViewModel } from "../state/CallViewModel"; import { mockLivekitRoom, mockMatrixRoom, MockRTCSession } from "./test"; diff --git a/src/widget.ts b/src/widget.ts index d3124dc9..e04ed657 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -6,8 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { logger } from "matrix-js-sdk/lib/logger"; -import { EventType } from "matrix-js-sdk"; -import { createRoomWidgetClient } from "matrix-js-sdk"; +import { EventType, createRoomWidgetClient } from "matrix-js-sdk"; import { WidgetApi, MatrixCapabilities, From ae339ea5ccaebb7b62df92f000cb54d9902a60ec Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 27 Mar 2025 14:47:01 -0400 Subject: [PATCH 5/7] Fix formatting issues --- src/e2ee/matrixKeyProvider.test.ts | 5 ++++- src/state/CallViewModel.test.ts | 5 ++++- tsconfig.json | 6 +----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/e2ee/matrixKeyProvider.test.ts b/src/e2ee/matrixKeyProvider.test.ts index aa224792..f46218e7 100644 --- a/src/e2ee/matrixKeyProvider.test.ts +++ b/src/e2ee/matrixKeyProvider.test.ts @@ -6,7 +6,10 @@ Please see LICENSE in the repository root for full details. */ import { describe, expect, test, vi } from "vitest"; -import { type MatrixRTCSession, MatrixRTCSessionEvent } from "matrix-js-sdk/lib/matrixrtc"; +import { + type MatrixRTCSession, + MatrixRTCSessionEvent, +} from "matrix-js-sdk/lib/matrixrtc"; import { KeyProviderEvent } from "livekit-client"; import { MatrixKeyProvider } from "./matrixKeyProvider"; diff --git a/src/state/CallViewModel.test.ts b/src/state/CallViewModel.test.ts index dfdf7d90..f0066476 100644 --- a/src/state/CallViewModel.test.ts +++ b/src/state/CallViewModel.test.ts @@ -27,7 +27,10 @@ import { } from "livekit-client"; import * as ComponentsCore from "@livekit/components-core"; import { isEqual } from "lodash-es"; -import { type CallMembership, type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; +import { + type CallMembership, + type MatrixRTCSession, +} from "matrix-js-sdk/lib/matrixrtc"; import { CallViewModel, type Layout } from "./CallViewModel"; import { diff --git a/tsconfig.json b/tsconfig.json index 0f035c10..be12658e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -47,9 +47,5 @@ "plugins": [{ "name": "typescript-eslint-language-service" }] }, - "include": [ - "./src/**/*.ts", - "./src/**/*.tsx", - "./playwright/**/*.ts" - ] + "include": ["./src/**/*.ts", "./src/**/*.tsx", "./playwright/**/*.ts"] } From eb18cbef78ce2e9335fbc2548fcc9738d441b395 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 27 Mar 2025 16:04:03 -0400 Subject: [PATCH 6/7] Consolidate imports --- src/useMatrixRTCSessionMemberships.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/useMatrixRTCSessionMemberships.ts b/src/useMatrixRTCSessionMemberships.ts index 69b2a12d..25b790d2 100644 --- a/src/useMatrixRTCSessionMemberships.ts +++ b/src/useMatrixRTCSessionMemberships.ts @@ -6,8 +6,8 @@ Please see LICENSE in the repository root for full details. */ import { logger } from "matrix-js-sdk/lib/logger"; -import { type CallMembership } from "matrix-js-sdk/lib/matrixrtc"; import { + type CallMembership, type MatrixRTCSession, MatrixRTCSessionEvent, } from "matrix-js-sdk/lib/matrixrtc"; From aab4efe03a4bb7146d24d04920420bc4bad8cc83 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 27 Mar 2025 16:09:59 -0400 Subject: [PATCH 7/7] Use type imports consistently --- src/home/CallList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/home/CallList.tsx b/src/home/CallList.tsx index 2e3d1db3..44422587 100644 --- a/src/home/CallList.tsx +++ b/src/home/CallList.tsx @@ -6,13 +6,13 @@ Please see LICENSE in the repository root for full details. */ import { Link } from "react-router-dom"; +import { type RoomMember, type Room, type MatrixClient } from "matrix-js-sdk"; import { type FC, useCallback, type MouseEvent, useState } from "react"; import { useTranslation } from "react-i18next"; import { IconButton, Text } from "@vector-im/compound-web"; import { CloseIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import classNames from "classnames"; -import type { RoomMember, Room, MatrixClient } from "matrix-js-sdk"; import { Avatar, Size } from "../Avatar"; import styles from "./CallList.module.css"; import { getRelativeRoomUrl } from "../utils/matrix";