mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-07 06:58:25 +00:00
Update dependency typescript to v6 (#32927)
* Update dependency typescript to v6 * Switch to unplugin-vts Workaround for https://github.com/qmhc/unplugin-dts/issues/467 And tweak tsconfigs * tweak tsconfig * Make tsc happy --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node16",
|
||||||
|
"module": "Node16",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"target": "es2022",
|
"target": "es2022",
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
"prettier": "^3.0.0",
|
"prettier": "^3.0.0",
|
||||||
"rimraf": "^6.0.0",
|
"rimraf": "^6.0.0",
|
||||||
"tar": "^7.5.8",
|
"tar": "^7.5.8",
|
||||||
"typescript": "5.9.3"
|
"typescript": "6.0.3"
|
||||||
},
|
},
|
||||||
"hakDependencies": {
|
"hakDependencies": {
|
||||||
"matrix-seshat": "4.2.0"
|
"matrix-seshat": "4.2.0"
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ import { PassThrough } from "node:stream";
|
|||||||
* A PassThrough stream that captures all data written to it.
|
* A PassThrough stream that captures all data written to it.
|
||||||
*/
|
*/
|
||||||
class CapturedPassThrough extends PassThrough {
|
class CapturedPassThrough extends PassThrough {
|
||||||
private _chunks = [];
|
private _chunks: any[] = [];
|
||||||
|
|
||||||
public constructor() {
|
public constructor() {
|
||||||
super();
|
super();
|
||||||
super.on("data", this.onData);
|
super.on("data", this.onData);
|
||||||
}
|
}
|
||||||
|
|
||||||
private onData = (chunk): void => {
|
private onData = (chunk: any): void => {
|
||||||
this._chunks.push(chunk);
|
this._chunks.push(chunk);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "bundler",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"target": "es2022",
|
"target": "es2022",
|
||||||
"module": "es2022",
|
"module": "ESNext",
|
||||||
"lib": ["es2022", "dom"],
|
"lib": ["es2024", "dom", "dom.iterable"],
|
||||||
|
"strictNullChecks": false,
|
||||||
"types": ["node"]
|
"types": ["node"]
|
||||||
},
|
},
|
||||||
"include": ["**/*.ts"]
|
"include": ["**/*.ts"]
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Locator, Page } from "@playwright/test";
|
import type { Locator, Page } from "@playwright/test";
|
||||||
import { test, expect } from "../../element-web-test";
|
import { test, expect, type ExtendedToMatchScreenshotOptions } from "../../element-web-test";
|
||||||
import { SettingLevel } from "../../../src/settings/SettingLevel";
|
import { SettingLevel } from "../../../src/settings/SettingLevel";
|
||||||
import { Layout } from "../../../src/settings/enums/Layout";
|
import { Layout } from "../../../src/settings/enums/Layout";
|
||||||
import { type ElementAppPage } from "../../pages/ElementAppPage";
|
import { type ElementAppPage } from "../../pages/ElementAppPage";
|
||||||
@@ -94,7 +94,7 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
|
|||||||
// Assert that rendering of the player settled and the play button is visible before taking a snapshot
|
// Assert that rendering of the player settled and the play button is visible before taking a snapshot
|
||||||
await checkPlayerVisibility(ircTile);
|
await checkPlayerVisibility(ircTile);
|
||||||
|
|
||||||
const screenshotOptions = {
|
const screenshotOptions: ExtendedToMatchScreenshotOptions = {
|
||||||
css: `
|
css: `
|
||||||
/* The timestamp is of inconsistent width depending on the time the test runs at */
|
/* The timestamp is of inconsistent width depending on the time the test runs at */
|
||||||
.mx_MessageTimestamp {
|
.mx_MessageTimestamp {
|
||||||
@@ -120,7 +120,7 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Take a snapshot of mx_EventTile_last on IRC layout
|
// Take a snapshot of mx_EventTile_last on IRC layout
|
||||||
screenshotOptions.clip = await page.locator(".mx_EventTile_last").boundingBox();
|
screenshotOptions.clip = (await page.locator(".mx_EventTile_last").boundingBox()) ?? undefined;
|
||||||
await scrollToBottomOfTimeline(page);
|
await scrollToBottomOfTimeline(page);
|
||||||
await expect(page).toMatchScreenshot(`${detail.replaceAll(" ", "-")}-irc-layout.png`, screenshotOptions);
|
await expect(page).toMatchScreenshot(`${detail.replaceAll(" ", "-")}-irc-layout.png`, screenshotOptions);
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
|
|||||||
const groupTile = page.locator(".mx_EventTile_last[data-layout='group']");
|
const groupTile = page.locator(".mx_EventTile_last[data-layout='group']");
|
||||||
await groupTile.locator(".mx_MessageTimestamp").click();
|
await groupTile.locator(".mx_MessageTimestamp").click();
|
||||||
await checkPlayerVisibility(groupTile);
|
await checkPlayerVisibility(groupTile);
|
||||||
screenshotOptions.clip = await page.locator(".mx_EventTile_last").boundingBox();
|
screenshotOptions.clip = (await page.locator(".mx_EventTile_last").boundingBox()) ?? undefined;
|
||||||
await scrollToBottomOfTimeline(page);
|
await scrollToBottomOfTimeline(page);
|
||||||
await expect(page).toMatchScreenshot(`${detail.replaceAll(" ", "-")}-group-layout.png`, screenshotOptions);
|
await expect(page).toMatchScreenshot(`${detail.replaceAll(" ", "-")}-group-layout.png`, screenshotOptions);
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
|
|||||||
const bubbleTile = page.locator(".mx_EventTile_last[data-layout='bubble']");
|
const bubbleTile = page.locator(".mx_EventTile_last[data-layout='bubble']");
|
||||||
await bubbleTile.locator(".mx_MessageTimestamp").click();
|
await bubbleTile.locator(".mx_MessageTimestamp").click();
|
||||||
await checkPlayerVisibility(bubbleTile);
|
await checkPlayerVisibility(bubbleTile);
|
||||||
screenshotOptions.clip = await page.locator(".mx_EventTile_last").boundingBox();
|
screenshotOptions.clip = (await page.locator(".mx_EventTile_last").boundingBox()) ?? undefined;
|
||||||
await scrollToBottomOfTimeline(page);
|
await scrollToBottomOfTimeline(page);
|
||||||
await expect(page).toMatchScreenshot(`${detail.replaceAll(" ", "-")}-bubble-layout.png`, screenshotOptions);
|
await expect(page).toMatchScreenshot(`${detail.replaceAll(" ", "-")}-bubble-layout.png`, screenshotOptions);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const bobJoin = async (page: Page, bob: Bot) => {
|
|||||||
const bobRooms = cli.getRooms();
|
const bobRooms = cli.getRooms();
|
||||||
if (!bobRooms.length) {
|
if (!bobRooms.length) {
|
||||||
await new Promise<void>((resolve) => {
|
await new Promise<void>((resolve) => {
|
||||||
const onMembership = (_event) => {
|
const onMembership = () => {
|
||||||
cli.off(window.matrixcs.RoomMemberEvent.Membership, onMembership);
|
cli.off(window.matrixcs.RoomMemberEvent.Membership, onMembership);
|
||||||
resolve();
|
resolve();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
|
|||||||
Please see LICENSE files in the repository root for full details.
|
Please see LICENSE files in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { EmittedEvents, Preset } from "matrix-js-sdk/src/matrix";
|
import type { Preset, RoomMemberEvent, RoomStateEvent } from "matrix-js-sdk/src/matrix";
|
||||||
import { expect, test } from "../../element-web-test";
|
import { expect, test } from "../../element-web-test";
|
||||||
import {
|
import {
|
||||||
createRoom,
|
createRoom,
|
||||||
@@ -122,7 +122,7 @@ test.describe("Cryptography", function () {
|
|||||||
const roomId = await bob.evaluate(
|
const roomId = await bob.evaluate(
|
||||||
async (client, { alice }) => {
|
async (client, { alice }) => {
|
||||||
const encryptionStatePromise = new Promise<void>((resolve) => {
|
const encryptionStatePromise = new Promise<void>((resolve) => {
|
||||||
client.on("RoomState.events" as EmittedEvents, (event, _state, _lastStateEvent) => {
|
client.on("RoomState.events" as RoomStateEvent.Events, (event, _state, _lastStateEvent) => {
|
||||||
if (event.getType() === "m.room.encryption") {
|
if (event.getType() === "m.room.encryption") {
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
@@ -253,11 +253,14 @@ test.describe("Cryptography", function () {
|
|||||||
|
|
||||||
// invite Alice
|
// invite Alice
|
||||||
const inviteAlicePromise = new Promise<void>((resolve) => {
|
const inviteAlicePromise = new Promise<void>((resolve) => {
|
||||||
client.on("RoomMember.membership" as EmittedEvents, (_event, member, _oldMembership?) => {
|
client.on(
|
||||||
if (member.userId === alice.userId && member.membership === "invite") {
|
"RoomMember.membership" as RoomMemberEvent.Membership,
|
||||||
resolve();
|
(_event, member, _oldMembership?) => {
|
||||||
}
|
if (member.userId === alice.userId && member.membership === "invite") {
|
||||||
});
|
resolve();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
await client.invite(roomId, alice.userId);
|
await client.invite(roomId, alice.userId);
|
||||||
// wait for the invite to come back so that we encrypt to Alice
|
// wait for the invite to come back so that we encrypt to Alice
|
||||||
@@ -271,11 +274,14 @@ test.describe("Cryptography", function () {
|
|||||||
|
|
||||||
// kick Alice
|
// kick Alice
|
||||||
const kickAlicePromise = new Promise<void>((resolve) => {
|
const kickAlicePromise = new Promise<void>((resolve) => {
|
||||||
client.on("RoomMember.membership" as EmittedEvents, (_event, member, _oldMembership?) => {
|
client.on(
|
||||||
if (member.userId === alice.userId && member.membership === "leave") {
|
"RoomMember.membership" as RoomMemberEvent.Membership,
|
||||||
resolve();
|
(_event, member, _oldMembership?) => {
|
||||||
}
|
if (member.userId === alice.userId && member.membership === "leave") {
|
||||||
});
|
resolve();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
await client.kick(roomId, alice.userId);
|
await client.kick(roomId, alice.userId);
|
||||||
await kickAlicePromise;
|
await kickAlicePromise;
|
||||||
|
|||||||
@@ -166,13 +166,9 @@ async function getDehydratedDeviceIds(client: Client): Promise<string[]> {
|
|||||||
return await client.evaluate(async (client) => {
|
return await client.evaluate(async (client) => {
|
||||||
const userId = client.getUserId();
|
const userId = client.getUserId();
|
||||||
const devices = await client.getCrypto().getUserDeviceInfo([userId]);
|
const devices = await client.getCrypto().getUserDeviceInfo([userId]);
|
||||||
return Array.from(
|
return Array.from(devices.get(userId).values())
|
||||||
devices
|
.filter((d) => d.dehydrated)
|
||||||
.get(userId)
|
.map((d) => d.deviceId);
|
||||||
.values()
|
|
||||||
.filter((d) => d.dehydrated)
|
|
||||||
.map((d) => d.deviceId),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -579,8 +579,8 @@ export async function deleteCachedSecrets(page: Page) {
|
|||||||
await page.evaluate(async () => {
|
await page.evaluate(async () => {
|
||||||
const removeCachedSecrets = new Promise((resolve) => {
|
const removeCachedSecrets = new Promise((resolve) => {
|
||||||
const request = window.indexedDB.open("matrix-js-sdk::matrix-sdk-crypto");
|
const request = window.indexedDB.open("matrix-js-sdk::matrix-sdk-crypto");
|
||||||
request.onsuccess = (event: Event & { target: { result: IDBDatabase } }) => {
|
request.onsuccess = function (this: IDBRequest) {
|
||||||
const db = event.target.result;
|
const db = this.result as IDBDatabase;
|
||||||
const request = db.transaction("core", "readwrite").objectStore("core").delete("private_identity");
|
const request = db.transaction("core", "readwrite").objectStore("core").delete("private_identity");
|
||||||
request.onsuccess = () => {
|
request.onsuccess = () => {
|
||||||
db.close();
|
db.close();
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type { JSHandle } from "@playwright/test";
|
import type { JSHandle } from "@playwright/test";
|
||||||
import type { MatrixEvent, ISendEventResponse, ReceiptType } from "matrix-js-sdk/src/matrix";
|
import type { MatrixEvent, ISendEventResponse, ReceiptType, RelationType } from "matrix-js-sdk/src/matrix";
|
||||||
import { expect } from "../../element-web-test";
|
import { expect } from "../../element-web-test";
|
||||||
import { type ElementAppPage } from "../../pages/ElementAppPage";
|
import { type ElementAppPage } from "../../pages/ElementAppPage";
|
||||||
import { type Bot } from "../../pages/bot";
|
import { type Bot } from "../../pages/bot";
|
||||||
@@ -47,7 +47,7 @@ test.describe("Read receipts", { tag: "@mergequeue" }, () => {
|
|||||||
getId: () => eventResponse.event_id,
|
getId: () => eventResponse.event_id,
|
||||||
threadRootId,
|
threadRootId,
|
||||||
getTs: () => 1,
|
getTs: () => 1,
|
||||||
isRelation: (relType) => {
|
isRelation: (relType: RelationType) => {
|
||||||
return !relType || relType === "m.thread";
|
return !relType || relType === "m.thread";
|
||||||
},
|
},
|
||||||
} as any as MatrixEvent;
|
} as any as MatrixEvent;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Locator, Page } from "@playwright/test";
|
import type { Locator, Page } from "@playwright/test";
|
||||||
import type { ISendEventResponse, EventType, MsgType } from "matrix-js-sdk/src/matrix";
|
import type { ISendEventResponse, EventType, MsgType, IContent } from "matrix-js-sdk/src/matrix";
|
||||||
import { test, expect } from "../../element-web-test";
|
import { test, expect } from "../../element-web-test";
|
||||||
import { SettingLevel } from "../../../src/settings/SettingLevel";
|
import { SettingLevel } from "../../../src/settings/SettingLevel";
|
||||||
import { Layout } from "../../../src/settings/enums/Layout";
|
import { Layout } from "../../../src/settings/enums/Layout";
|
||||||
@@ -50,11 +50,9 @@ const expectAvatar = async (cli: Client, e: Locator, avatarUrl: string): Promise
|
|||||||
};
|
};
|
||||||
|
|
||||||
const sendEvent = async (client: Client, roomId: string, html = false): Promise<ISendEventResponse> => {
|
const sendEvent = async (client: Client, roomId: string, html = false): Promise<ISendEventResponse> => {
|
||||||
const content = {
|
const content: IContent = {
|
||||||
msgtype: "m.text" as MsgType,
|
msgtype: "m.text" as MsgType,
|
||||||
body: "Message",
|
body: "Message",
|
||||||
format: undefined,
|
|
||||||
formatted_body: undefined,
|
|
||||||
};
|
};
|
||||||
if (html) {
|
if (html) {
|
||||||
content.format = "org.matrix.custom.html";
|
content.format = "org.matrix.custom.html";
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export async function waitForRoom(
|
|||||||
return new Promise<Room>((resolve) => {
|
return new Promise<Room>((resolve) => {
|
||||||
const room = matrixClient.getRoom(roomId);
|
const room = matrixClient.getRoom(roomId);
|
||||||
|
|
||||||
if (window[predicateId](room)) {
|
if ((<any>window)[predicateId](room)) {
|
||||||
resolve(room);
|
resolve(room);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ export async function waitForRoom(
|
|||||||
function onEvent(ev: MatrixEvent) {
|
function onEvent(ev: MatrixEvent) {
|
||||||
if (ev.getRoomId() !== roomId) return;
|
if (ev.getRoomId() !== roomId) return;
|
||||||
|
|
||||||
if (window[predicateId](room)) {
|
if ((<any>window)[predicateId](room)) {
|
||||||
matrixClient.removeListener("event" as ClientEvent, onEvent);
|
matrixClient.removeListener("event" as ClientEvent, onEvent);
|
||||||
resolve(room);
|
resolve(room);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export const test = base.extend<TestFixtures>({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
interface ExtendedToMatchScreenshotOptions extends ToMatchScreenshotOptions {
|
export interface ExtendedToMatchScreenshotOptions extends ToMatchScreenshotOptions {
|
||||||
includeDialogBackground?: boolean;
|
includeDialogBackground?: boolean;
|
||||||
showTooltips?: boolean;
|
showTooltips?: boolean;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { type JSHandle, type Page } from "@playwright/test";
|
import { type JSHandle, type Page } from "@playwright/test";
|
||||||
import { type PageFunctionOn } from "playwright-core/types/structs";
|
import { type ElementHandle } from "playwright-core";
|
||||||
|
|
||||||
import { Network } from "./network";
|
import { Network } from "./network";
|
||||||
import type {
|
import type {
|
||||||
@@ -30,6 +30,34 @@ import type {
|
|||||||
import type { RoomMessageEventContent } from "matrix-js-sdk/src/types";
|
import type { RoomMessageEventContent } from "matrix-js-sdk/src/types";
|
||||||
import { type CredentialsOptionalAccessToken } from "./bot";
|
import { type CredentialsOptionalAccessToken } from "./bot";
|
||||||
|
|
||||||
|
/** Types cribbed from playwright-core/types/structs as they are not importable */
|
||||||
|
export type NoHandles<Arg> = Arg extends JSHandle
|
||||||
|
? never
|
||||||
|
: Arg extends object
|
||||||
|
? { [Key in keyof Arg]: NoHandles<Arg[Key]> }
|
||||||
|
: Arg;
|
||||||
|
export type Unboxed<Arg> =
|
||||||
|
Arg extends ElementHandle<infer T>
|
||||||
|
? T
|
||||||
|
: Arg extends JSHandle<infer T>
|
||||||
|
? T
|
||||||
|
: Arg extends NoHandles<Arg>
|
||||||
|
? Arg
|
||||||
|
: Arg extends [infer A0]
|
||||||
|
? [Unboxed<A0>]
|
||||||
|
: Arg extends [infer A0, infer A1]
|
||||||
|
? [Unboxed<A0>, Unboxed<A1>]
|
||||||
|
: Arg extends [infer A0, infer A1, infer A2]
|
||||||
|
? [Unboxed<A0>, Unboxed<A1>, Unboxed<A2>]
|
||||||
|
: Arg extends [infer A0, infer A1, infer A2, infer A3]
|
||||||
|
? [Unboxed<A0>, Unboxed<A1>, Unboxed<A2>, Unboxed<A3>]
|
||||||
|
: Arg extends Array<infer T>
|
||||||
|
? Array<Unboxed<T>>
|
||||||
|
: Arg extends object
|
||||||
|
? { [Key in keyof Arg]: Unboxed<Arg[Key]> }
|
||||||
|
: Arg;
|
||||||
|
export type PageFunctionOn<On, Arg2, R> = string | ((on: On, arg2: Unboxed<Arg2>) => R | Promise<R>);
|
||||||
|
|
||||||
export class Client {
|
export class Client {
|
||||||
public network: Network;
|
public network: Network;
|
||||||
protected client: JSHandle<MatrixClient>;
|
protected client: JSHandle<MatrixClient>;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const DEFAULT_CONFIG = {
|
|||||||
global: {
|
global: {
|
||||||
server_name: "localhost",
|
server_name: "localhost",
|
||||||
private_key: "matrix_key.pem",
|
private_key: "matrix_key.pem",
|
||||||
old_private_keys: null,
|
old_private_keys: null as any,
|
||||||
key_validity_period: "168h0m0s",
|
key_validity_period: "168h0m0s",
|
||||||
cache: {
|
cache: {
|
||||||
max_size_estimated: "1gb",
|
max_size_estimated: "1gb",
|
||||||
@@ -47,7 +47,7 @@ const DEFAULT_CONFIG = {
|
|||||||
room_name: "Server Alerts",
|
room_name: "Server Alerts",
|
||||||
},
|
},
|
||||||
jetstream: {
|
jetstream: {
|
||||||
addresses: null,
|
addresses: null as any,
|
||||||
disable_tls_validation: false,
|
disable_tls_validation: false,
|
||||||
storage_path: "./",
|
storage_path: "./",
|
||||||
topic_prefix: "Dendrite",
|
topic_prefix: "Dendrite",
|
||||||
@@ -67,7 +67,7 @@ const DEFAULT_CONFIG = {
|
|||||||
},
|
},
|
||||||
app_service_api: {
|
app_service_api: {
|
||||||
disable_tls_validation: false,
|
disable_tls_validation: false,
|
||||||
config_files: null,
|
config_files: null as any,
|
||||||
},
|
},
|
||||||
client_api: {
|
client_api: {
|
||||||
registration_disabled: false,
|
registration_disabled: false,
|
||||||
@@ -79,14 +79,14 @@ const DEFAULT_CONFIG = {
|
|||||||
recaptcha_bypass_secret: "",
|
recaptcha_bypass_secret: "",
|
||||||
turn: {
|
turn: {
|
||||||
turn_user_lifetime: "5m",
|
turn_user_lifetime: "5m",
|
||||||
turn_uris: null,
|
turn_uris: null as any,
|
||||||
turn_shared_secret: "",
|
turn_shared_secret: "",
|
||||||
},
|
},
|
||||||
rate_limiting: {
|
rate_limiting: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
threshold: 20,
|
threshold: 20,
|
||||||
cooloff_ms: 500,
|
cooloff_ms: 500,
|
||||||
exempt_user_ids: null,
|
exempt_user_ids: null as any,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
federation_api: {
|
federation_api: {
|
||||||
@@ -140,7 +140,7 @@ const DEFAULT_CONFIG = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mscs: {
|
mscs: {
|
||||||
mscs: null,
|
mscs: null as any,
|
||||||
database: {
|
database: {
|
||||||
connection_string: "file:dendrite-msc.db",
|
connection_string: "file:dendrite-msc.db",
|
||||||
},
|
},
|
||||||
@@ -157,7 +157,7 @@ const DEFAULT_CONFIG = {
|
|||||||
},
|
},
|
||||||
user_api: {
|
user_api: {
|
||||||
bcrypt_cost: 10,
|
bcrypt_cost: 10,
|
||||||
auto_join_rooms: null,
|
auto_join_rooms: null as any,
|
||||||
account_database: {
|
account_database: {
|
||||||
connection_string: "file:dendrite-userapi.db",
|
connection_string: "file:dendrite-userapi.db",
|
||||||
},
|
},
|
||||||
@@ -183,12 +183,12 @@ const DEFAULT_CONFIG = {
|
|||||||
serviceName: "",
|
serviceName: "",
|
||||||
disabled: false,
|
disabled: false,
|
||||||
rpc_metrics: false,
|
rpc_metrics: false,
|
||||||
tags: [],
|
tags: [] as any[],
|
||||||
sampler: null,
|
sampler: null as any,
|
||||||
reporter: null,
|
reporter: null as any,
|
||||||
headers: null,
|
headers: null as any,
|
||||||
baggage_restrictions: null,
|
baggage_restrictions: null as any,
|
||||||
throttler: null,
|
throttler: null as any,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
logging: [
|
logging: [
|
||||||
|
|||||||
@@ -2,12 +2,14 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2022",
|
"target": "es2022",
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
"lib": ["ESNext", "es2022", "dom", "dom.iterable"],
|
"lib": ["es2024", "dom", "dom.iterable"],
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "bundler",
|
||||||
"module": "es2022",
|
"module": "ESNext",
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
|
"strictNullChecks": false,
|
||||||
|
"noImplicitAny": false,
|
||||||
"types": ["node"]
|
"types": ["node"]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
|||||||
Vendored
+8
@@ -0,0 +1,8 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2026 Element Creations Ltd.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||||
|
Please see LICENSE files in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare module "*.css";
|
||||||
Vendored
-9
@@ -8,7 +8,6 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
|
|
||||||
// eslint-disable-next-line no-restricted-imports
|
// eslint-disable-next-line no-restricted-imports
|
||||||
import "matrix-js-sdk/src/@types/global"; // load matrix-js-sdk's type extensions first
|
import "matrix-js-sdk/src/@types/global"; // load matrix-js-sdk's type extensions first
|
||||||
import "@types/modernizr";
|
|
||||||
|
|
||||||
import type { ModuleLoader } from "@element-hq/element-web-module-api";
|
import type { ModuleLoader } from "@element-hq/element-web-module-api";
|
||||||
import type { logger } from "matrix-js-sdk/src/logger";
|
import type { logger } from "matrix-js-sdk/src/logger";
|
||||||
@@ -186,14 +185,6 @@ declare global {
|
|||||||
readonly port: MessagePort;
|
readonly port: MessagePort;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* In future, browsers will support focusVisible option.
|
|
||||||
* See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#focusvisible
|
|
||||||
*/
|
|
||||||
interface FocusOptions {
|
|
||||||
focusVisible: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
// https://github.com/microsoft/TypeScript/issues/28308#issuecomment-650802278
|
// https://github.com/microsoft/TypeScript/issues/28308#issuecomment-650802278
|
||||||
function registerProcessor(
|
function registerProcessor(
|
||||||
name: string,
|
name: string,
|
||||||
|
|||||||
Vendored
+8
@@ -0,0 +1,8 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2026 Element Creations Ltd.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||||
|
Please see LICENSE files in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare module "*.pcss";
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
"lib": ["es2022", "es2024.promise", "dom", "dom.iterable"],
|
"lib": ["es2022", "es2024.promise", "dom", "dom.iterable"],
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"types": ["node"],
|
"types": ["node", "modernizr"],
|
||||||
"paths": {
|
"paths": {
|
||||||
"jest-matrix-react": ["./test/test-utils/jest-matrix-react"],
|
"jest-matrix-react": ["./test/test-utils/jest-matrix-react"],
|
||||||
"rollup/parseAst": ["../../node_modules/rollup/dist/parseAst"]
|
"rollup/parseAst": ["../../node_modules/rollup/dist/parseAst"]
|
||||||
|
|||||||
+2
-1
@@ -68,7 +68,8 @@
|
|||||||
"postcss-mixins": "patches/postcss-mixins.patch",
|
"postcss-mixins": "patches/postcss-mixins.patch",
|
||||||
"app-builder-lib": "patches/app-builder-lib.patch",
|
"app-builder-lib": "patches/app-builder-lib.patch",
|
||||||
"knip": "patches/knip.patch",
|
"knip": "patches/knip.patch",
|
||||||
"plist": "patches/plist.patch"
|
"plist": "patches/plist.patch",
|
||||||
|
"unplugin-dts": "patches/unplugin-dts.patch"
|
||||||
},
|
},
|
||||||
"peerDependencyRules": {
|
"peerDependencyRules": {
|
||||||
"allowedVersions": {
|
"allowedVersions": {
|
||||||
|
|||||||
@@ -40,9 +40,9 @@
|
|||||||
"matrix-widget-api": "^1.17.0",
|
"matrix-widget-api": "^1.17.0",
|
||||||
"rollup-plugin-external-globals": "^0.13.0",
|
"rollup-plugin-external-globals": "^0.13.0",
|
||||||
"semver": "^7.6.3",
|
"semver": "^7.6.3",
|
||||||
"typescript": "^5.7.3",
|
"typescript": "^6.0.0",
|
||||||
|
"unplugin-dts": "1.0.0-beta.6",
|
||||||
"vite": "^8.0.0",
|
"vite": "^8.0.0",
|
||||||
"vite-plugin-dts": "^4.5.0",
|
|
||||||
"vitest": "^4.0.0",
|
"vitest": "^4.0.0",
|
||||||
"vitest-sonar-reporter": "^3.0.0"
|
"vitest-sonar-reporter": "^3.0.0"
|
||||||
},
|
},
|
||||||
@@ -50,8 +50,8 @@
|
|||||||
"@matrix-org/react-sdk-module-api": "*",
|
"@matrix-org/react-sdk-module-api": "*",
|
||||||
"@types/react": "*",
|
"@types/react": "*",
|
||||||
"@types/react-dom": "*",
|
"@types/react-dom": "*",
|
||||||
"matrix-widget-api": "*",
|
|
||||||
"matrix-web-i18n": "*",
|
"matrix-web-i18n": "*",
|
||||||
|
"matrix-widget-api": "*",
|
||||||
"react": "^19"
|
"react": "^19"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
@@ -64,6 +64,5 @@
|
|||||||
"matrix-web-i18n": {
|
"matrix-web-i18n": {
|
||||||
"optional": true
|
"optional": true
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"dependencies": {}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json.schemastore.org/tsconfig",
|
"$schema": "http://json.schemastore.org/tsconfig",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"rootDir": "./src",
|
||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
"lib": ["dom", "es2022", "esnext"],
|
"lib": ["dom", "es2022", "esnext"],
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
import { dirname, resolve } from "node:path";
|
import { dirname, resolve } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import dts from "vite-plugin-dts";
|
import dts from "unplugin-dts/vite";
|
||||||
import externalGlobals from "rollup-plugin-external-globals";
|
import externalGlobals from "rollup-plugin-external-globals";
|
||||||
|
|
||||||
import packageJson from "./package.json" with { type: "json" };
|
import packageJson from "./package.json" with { type: "json" };
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@element-hq/element-web-module-api": "workspace:*",
|
"@element-hq/element-web-module-api": "workspace:*",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"typescript": "^5.8.2",
|
"typescript": "^6.0.0",
|
||||||
"wait-on": "^9.0.4"
|
"wait-on": "^9.0.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ class Toasts {
|
|||||||
* @returns the Locator for the matching toast, or null if it is not
|
* @returns the Locator for the matching toast, or null if it is not
|
||||||
* visible. (null will only be returned if `required` is false.)
|
* visible. (null will only be returned if `required` is false.)
|
||||||
*/
|
*/
|
||||||
|
public async getToast(title: string, timeout?: number, required?: true): Promise<Locator>;
|
||||||
|
public async getToast(title: string, timeout: number | undefined, required: false): Promise<Locator | null>;
|
||||||
public async getToast(title: string, timeout?: number, required = true): Promise<Locator | null> {
|
public async getToast(title: string, timeout?: number, required = true): Promise<Locator | null> {
|
||||||
const toast = this.page.locator(".mx_Toast_toast", { hasText: title }).first();
|
const toast = this.page.locator(".mx_Toast_toast", { hasText: title }).first();
|
||||||
|
|
||||||
@@ -148,7 +150,12 @@ async function clickToastButton(
|
|||||||
timeout?: number,
|
timeout?: number,
|
||||||
required = true,
|
required = true,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const toast = await toasts.getToast(title, timeout, required);
|
let toast: Locator | null;
|
||||||
|
if (required) {
|
||||||
|
toast = await toasts.getToast(title, timeout, true);
|
||||||
|
} else {
|
||||||
|
toast = await toasts.getToast(title, timeout, false);
|
||||||
|
}
|
||||||
|
|
||||||
if (toast) {
|
if (toast) {
|
||||||
await toast.locator(`.mx_Toast_buttons button[data-kind="${button}"]`).click();
|
await toast.locator(`.mx_Toast_buttons button[data-kind="${button}"]`).click();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json.schemastore.org/tsconfig",
|
"$schema": "http://json.schemastore.org/tsconfig",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"rootDir": "./src",
|
||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
"lib": ["dom", "es2022", "esnext"],
|
"lib": ["dom", "es2022", "esnext"],
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
"@fetch-mock/vitest": "^0.2.18",
|
"@fetch-mock/vitest": "^0.2.18",
|
||||||
"@fontsource/inter": "catalog:",
|
"@fontsource/inter": "catalog:",
|
||||||
"@matrix-org/react-sdk-module-api": "^2.5.0",
|
"@matrix-org/react-sdk-module-api": "^2.5.0",
|
||||||
|
"@microsoft/api-extractor": "^7.56.0",
|
||||||
"@playwright/test": "catalog:",
|
"@playwright/test": "catalog:",
|
||||||
"@storybook/addon-a11y": "^10.0.7",
|
"@storybook/addon-a11y": "^10.0.7",
|
||||||
"@storybook/addon-designs": "^11.0.1",
|
"@storybook/addon-designs": "^11.0.1",
|
||||||
@@ -113,8 +114,8 @@
|
|||||||
"typedoc-plugin-markdown": "^4.9.0",
|
"typedoc-plugin-markdown": "^4.9.0",
|
||||||
"typedoc-plugin-missing-exports": "^4.1.2",
|
"typedoc-plugin-missing-exports": "^4.1.2",
|
||||||
"typescript": "catalog:",
|
"typescript": "catalog:",
|
||||||
|
"unplugin-dts": "1.0.0-beta.6",
|
||||||
"vite": "^8.0.0",
|
"vite": "^8.0.0",
|
||||||
"vite-plugin-dts": "^4.5.4",
|
|
||||||
"vite-plugin-node-polyfills": "^0.26.0",
|
"vite-plugin-node-polyfills": "^0.26.0",
|
||||||
"vitest": "^4.0.18",
|
"vitest": "^4.0.18",
|
||||||
"vitest-sonar-reporter": "^3.0.0"
|
"vitest-sonar-reporter": "^3.0.0"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import { dirname, resolve } from "node:path";
|
import { dirname, resolve } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { defineConfig, esmExternalRequirePlugin } from "vite";
|
import { defineConfig, esmExternalRequirePlugin } from "vite";
|
||||||
import dts from "vite-plugin-dts";
|
import dts from "unplugin-dts/vite";
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
@@ -51,10 +51,10 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
dts({
|
dts({
|
||||||
rollupTypes: true,
|
bundleTypes: true,
|
||||||
include: ["src/**/*.{ts,tsx}"],
|
include: ["src/**/*.{ts,tsx}"],
|
||||||
exclude: ["src/**/*.test.{ts,tsx}", "src/**/*.stories.{ts,tsx}"],
|
exclude: ["src/**/*.test.{ts,tsx}", "src/**/*.stories.{ts,tsx}"],
|
||||||
copyDtsFiles: true,
|
copyDtsFiles: false,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/dist/shared/unplugin-dts.Dv6DEU-x.mjs b/dist/shared/unplugin-dts.Dv6DEU-x.mjs
|
||||||
|
index ad5f1183abb26a97ed92068f623ef1eb61fc54ca..5e3e5d0d25fe067ecfd5f3f8ecbd4808139758b9 100644
|
||||||
|
--- a/dist/shared/unplugin-dts.Dv6DEU-x.mjs
|
||||||
|
+++ b/dist/shared/unplugin-dts.Dv6DEU-x.mjs
|
||||||
|
@@ -920,7 +920,7 @@ class Runtime {
|
||||||
|
const maybeEmitted = (sourceFile) => {
|
||||||
|
return !(compilerOptions.noEmitForJsFiles && jsRE.test(sourceFile.fileName)) && !sourceFile.isDeclarationFile && !program.isSourceFileFromExternalLibrary(sourceFile);
|
||||||
|
};
|
||||||
|
- let publicRoot = compilerOptions.rootDir ? ensureAbsolute(resolveConfigDir(compilerOptions.rootDir, root), root) : compilerOptions.composite && compilerOptions.configFilePath ? dirname(compilerOptions.configFilePath) : queryPublicPath(
|
||||||
|
+ let publicRoot = compilerOptions.rootDir ? ensureAbsolute(resolveConfigDir(compilerOptions.rootDir, root), root) : compilerOptions.composite && compilerOptions.configFilePath ? dirname(compilerOptions.configFilePath) : compare(ts.version, '6.0.0', '>=') ? (configPath ? dirname(configPath) : root) : queryPublicPath(
|
||||||
|
program.getSourceFiles().filter(maybeEmitted).map((sourceFile) => sourceFile.fileName)
|
||||||
|
);
|
||||||
|
publicRoot = normalizePath(publicRoot);
|
||||||
Generated
+257
-273
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -6,7 +6,7 @@ packages:
|
|||||||
cleanupUnusedCatalogs: true
|
cleanupUnusedCatalogs: true
|
||||||
catalog:
|
catalog:
|
||||||
# typescript
|
# typescript
|
||||||
typescript: 5.9.3
|
typescript: 6.0.3
|
||||||
# react
|
# react
|
||||||
react: ^19.0.0
|
react: ^19.0.0
|
||||||
react-dom: ^19.0.0
|
react-dom: ^19.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user