diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index fb259637..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/src/@types/global"; import { type setLogLevel as setLKLogLevel } from "livekit-client"; import type { DurationFormat as PolyfillDurationFormat } from "@formatjs/intl-durationformat"; 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/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 f964dada..bde20dc8 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 3000854a..fce95445 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 581b967e..8b2aa91d 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 { type Subscription } from "rxjs"; 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 b82afd5a..6535bcb5 100644 --- a/src/auth/RegisterPage.tsx +++ b/src/auth/RegisterPage.tsx @@ -16,9 +16,9 @@ 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/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..85a43752 100644 --- a/src/auth/useInteractiveLogin.ts +++ b/src/auth/useInteractiveLogin.ts @@ -6,12 +6,12 @@ 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, 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..4972c031 100644 --- a/src/auth/useInteractiveRegistration.ts +++ b/src/auth/useInteractiveRegistration.ts @@ -6,13 +6,13 @@ 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, 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..890c55fe 100644 --- a/src/auth/useRecaptcha.ts +++ b/src/auth/useRecaptcha.ts @@ -6,9 +6,9 @@ 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/lib/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/auth/useRegisterPasswordlessUser.ts b/src/auth/useRegisterPasswordlessUser.ts index 728fe131..c2cbe2d3 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/lib/randomstring"; import { useClient } from "../ClientContext"; import { useInteractiveRegistration } from "../auth/useInteractiveRegistration"; 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..f46218e7 100644 --- a/src/e2ee/matrixKeyProvider.test.ts +++ b/src/e2ee/matrixKeyProvider.test.ts @@ -9,7 +9,7 @@ import { describe, expect, test, vi } from "vitest"; import { type MatrixRTCSession, MatrixRTCSessionEvent, -} from "matrix-js-sdk/src/matrixrtc"; +} 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..44422587 100644 --- a/src/home/CallList.tsx +++ b/src/home/CallList.tsx @@ -6,9 +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 RoomMember } from "matrix-js-sdk/src/models/room-member"; -import { type Room } from "matrix-js-sdk/src/models/room"; +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"; 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 d84d2309..79437ba8 100644 --- a/src/home/UnauthenticatedView.tsx +++ b/src/home/UnauthenticatedView.tsx @@ -6,10 +6,10 @@ 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/lib/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..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/src/client"; -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/src/matrix"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; -import { MatrixRTCSessionManagerEvents } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSessionManager"; -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/initializer.tsx b/src/initializer.tsx index 11c1ee4b..1087dc94 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 ac44db9b..2ebd6045 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"; import { useErrorBoundary } from "../useErrorBoundary"; diff --git a/src/livekit/useECConnectionState.ts b/src/livekit/useECConnectionState.ts index 0c00029e..fa9a3038 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..e70cedf2 100644 --- a/src/otel/OTelCall.ts +++ b/src/otel/OTelCall.ts @@ -6,12 +6,12 @@ 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 { CallEvent } from "matrix-js-sdk/src/webrtc/call"; +import { type MatrixCall } from "matrix-js-sdk"; +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 b4ca5e2d..668b989c 100644 --- a/src/otel/OTelGroupCallMembership.ts +++ b/src/otel/OTelGroupCallMembership.ts @@ -15,26 +15,26 @@ 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, 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/otel/otel.ts b/src/otel/otel.ts index 6df32f2c..a2cd809e 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..b588f053 100644 --- a/src/profile/useProfile.ts +++ b/src/profile/useProfile.ts @@ -5,12 +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 MatrixClient } from "matrix-js-sdk/src/client"; -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, + type MatrixClient, + UserEvent, + type FileType, +} from "matrix-js-sdk"; 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..b630f4b9 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"; -import { type ReactionEventContent } from "matrix-js-sdk/src/types"; +} 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/lib/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/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/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 f0023b22..76765270 100644 --- a/src/room/GroupCallView.test.tsx +++ b/src/room/GroupCallView.test.tsx @@ -14,13 +14,12 @@ import { vi, } 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, 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/src/matrix"; 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/lib/models/relations-container"; import { useState } from "react"; import { TooltipProvider } from "@vector-im/compound-web"; diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 5e307273..3d9b9808 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -13,17 +13,16 @@ import { useMemo, useState, } from "react"; -import { type MatrixClient } from "matrix-js-sdk/src/client"; +import { type MatrixClient, JoinRule, type Room } 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 { 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..f502407c 100644 --- a/src/room/RoomPage.tsx +++ b/src/room/RoomPage.tsx @@ -13,13 +13,13 @@ import { useRef, type JSX, } from "react"; -import { logger } from "matrix-js-sdk/src/logger"; +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 f478eb63..a8dfa836 100644 --- a/src/room/useActiveFocus.ts +++ b/src/room/useActiveFocus.ts @@ -8,14 +8,11 @@ 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 { - type LivekitFocus, - isLivekitFocus, -} from "matrix-js-sdk/src/matrixrtc/LivekitFocus"; +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"; /** * Gets the currently active (livekit) focus for a MatrixRTC session diff --git a/src/room/useJoinRule.ts b/src/room/useJoinRule.ts index 1e1cb059..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/src/matrix"; -import type { Room } from "matrix-js-sdk/src/models/room"; +import type { JoinRule, 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..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/src/logger"; -import { EventType } from "matrix-js-sdk/src/@types/event"; import { + JoinRule, + EventType, + SyncState, + MatrixError, + KnownMembership, ClientEvent, type MatrixClient, type RoomSummary, -} from "matrix-js-sdk/src/client"; -import { SyncState } from "matrix-js-sdk/src/sync"; -import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; -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"; + RoomEvent, + type Room, +} from "matrix-js-sdk"; +import { logger } from "matrix-js-sdk/lib/logger"; +import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc"; 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 1d9ec6f6..fbaa7ed7 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 9dc82043..0555ca3f 100644 --- a/src/settings/FeedbackSettingsTab.tsx +++ b/src/settings/FeedbackSettingsTab.tsx @@ -6,10 +6,10 @@ 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/lib/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 5239802e..7522983e 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..21ed5956 100644 --- a/src/settings/rageshake.ts +++ b/src/settings/rageshake.ts @@ -29,8 +29,8 @@ 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 { secureRandomString } from "matrix-js-sdk/src/randomstring"; +import { type Logger, logger } from "matrix-js-sdk/lib/logger"; +import { secureRandomString } from "matrix-js-sdk/lib/randomstring"; import { type LoggingMethod } from "loglevel"; import type loglevel 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 026bf3a1..b3138348 100644 --- a/src/settings/submit-rageshake.ts +++ b/src/settings/submit-rageshake.ts @@ -6,13 +6,13 @@ 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"; -import { type CryptoApi } from "matrix-js-sdk/src/crypto-api"; +} from "matrix-js-sdk"; +import { type CryptoApi } from "matrix-js-sdk/lib/crypto-api"; import { getLogsForReport } from "./rageshake"; import { useClient } from "../ClientContext"; 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..f0066476 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, @@ -30,7 +30,7 @@ import { isEqual } from "lodash-es"; import { type CallMembership, type MatrixRTCSession, -} from "matrix-js-sdk/src/matrixrtc"; +} 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..25b790d2 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, 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/useTheme.ts b/src/useTheme.ts index c1cad176..e992aee7 100644 --- a/src/useTheme.ts +++ b/src/useTheme.ts @@ -7,7 +7,7 @@ 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 { type IThemeChangeActionRequest } from "matrix-widget-api"; import { getUrlParams } from "./UrlParams"; import { widget } from "./widget"; 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-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 0eac045d..d2375897 100644 --- a/src/utils/displayname.ts +++ b/src/utils/displayname.ts @@ -8,10 +8,10 @@ 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/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 a7813528..a2530ecf 100644 --- a/src/utils/matrix.ts +++ b/src/utils/matrix.ts @@ -5,23 +5,21 @@ 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 { + ClientEvent, calculateRetryBackoff, createClient, - type ICreateClientOpts, + IndexedDBStore, + MemoryStore, Preset, Visibility, -} from "matrix-js-sdk/src/matrix"; -import { ClientEvent } from "matrix-js-sdk/src/client"; -import { type ISyncStateData, type SyncState } from "matrix-js-sdk/src/sync"; -import { logger } from "matrix-js-sdk/src/logger"; -import { secureRandomBase64Url } from "matrix-js-sdk/src/randomstring"; -import { sleep } from "matrix-js-sdk/src/utils"; +} 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 { sleep } from "matrix-js-sdk/lib/utils"; -import type { MatrixClient } from "matrix-js-sdk/src/client"; -import type { Room } from "matrix-js-sdk/src/models/room"; +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/spa.ts b/src/utils/spa.ts index fd597f49..e97d7810 100644 --- a/src/utils/spa.ts +++ b/src/utils/spa.ts @@ -5,9 +5,8 @@ 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 { MatrixError } from "matrix-js-sdk/src/http-api"; -import { logger } from "matrix-js-sdk/src/logger"; +import { type ICreateClientOpts, MatrixError } from "matrix-js-sdk"; +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..c8a93c73 100644 --- a/src/utils/test-viewmodel.ts +++ b/src/utils/test-viewmodel.ts @@ -6,17 +6,16 @@ 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"; +} 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/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/utils/test.ts b/src/utils/test.ts index 9845d51d..039b6983 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..e04ed657 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -5,16 +5,15 @@ 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, 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 4d7d1d76..be12658e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -47,10 +47,5 @@ "plugins": [{ "name": "typescript-eslint-language-service" }] }, - "include": [ - "./node_modules/matrix-js-sdk/src/@types/*.d.ts", - "./src/**/*.ts", - "./src/**/*.tsx", - "./playwright/**/*.ts" - ] + "include": ["./src/**/*.ts", "./src/**/*.tsx", "./playwright/**/*.ts"] }