Update dependency knip to v6 (#33008)

* Update dependency knip to v6

* Make knip 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:
renovate[bot]
2026-04-02 13:38:58 +00:00
committed by GitHub
co-authored by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Michael Telatynski
parent 2d3e2fcb70
commit 063e0802f4
12 changed files with 650 additions and 529 deletions
@@ -27,13 +27,12 @@ const EffectsOverlay: FunctionComponent<IProps> = ({ roomWidth }) => {
if (!name) return null; if (!name) return null;
let effect: ICanvasEffect | null = effectsRef.current.get(name) || null; let effect: ICanvasEffect | null = effectsRef.current.get(name) || null;
if (effect === null) { if (effect === null) {
const options = CHAT_EFFECTS.find((e) => e.command === name)?.options; const definition = CHAT_EFFECTS.find((e) => e.command === name)!;
try { try {
const { default: Effect } = await import(`../../../effects/${name}`); effect = await definition.getRenderer();
effect = new Effect(options); effectsRef.current.set(name, effect);
effectsRef.current.set(name, effect!);
} catch (err) { } catch (err) {
logger.warn(`Unable to load effect module at '../../../effects/${name}.`, err); logger.warn(`Unable to run effect module.`, err);
} }
} }
return effect; return effect;
+4 -3
View File
@@ -6,10 +6,11 @@ Copyright 2020 Nordeck IT + Consulting GmbH.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial 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. Please see LICENSE files in the repository root for full details.
*/ */
import type ICanvasEffect from "../ICanvasEffect"; import type ICanvasEffect from "../ICanvasEffect";
export type ConfettiOptions = { type ConfettiOptions = {
/** /**
* max confetti count * max confetti count
*/ */
@@ -54,7 +55,7 @@ export const DefaultOptions: ConfettiOptions = {
export default class Confetti implements ICanvasEffect { export default class Confetti implements ICanvasEffect {
private readonly options: ConfettiOptions; private readonly options: ConfettiOptions;
public constructor(options: { [key: string]: any }) { public constructor(options: Partial<ConfettiOptions>) {
this.options = { ...DefaultOptions, ...options }; this.options = { ...DefaultOptions, ...options };
} }
+5 -3
View File
@@ -7,7 +7,9 @@ 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.
*/ */
export type Effect<TOptions extends { [key: string]: any }> = { import type ICanvasEffect from "./ICanvasEffect.ts";
export type Effect = {
/** /**
* one or more emojis that will trigger this effect * one or more emojis that will trigger this effect
*/ */
@@ -29,7 +31,7 @@ export type Effect<TOptions extends { [key: string]: any }> = {
*/ */
fallbackMessage: () => string; fallbackMessage: () => string;
/** /**
* animation options * animation options TODO
*/ */
options: TOptions; getRenderer(): Promise<ICanvasEffect>;
}; };
+3 -3
View File
@@ -6,11 +6,11 @@ Copyright 2020 Nordeck IT + Consulting GmbH.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial 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. Please see LICENSE files in the repository root for full details.
*/ */
import type ICanvasEffect from "../ICanvasEffect"; import type ICanvasEffect from "../ICanvasEffect";
export type FireworksOptions = { type FireworksOptions = {
/** /**
* max fireworks count * max fireworks count
*/ */
@@ -55,7 +55,7 @@ export const DefaultOptions: FireworksOptions = {
export default class Fireworks implements ICanvasEffect { export default class Fireworks implements ICanvasEffect {
private readonly options: FireworksOptions; private readonly options: FireworksOptions;
public constructor(options: { [key: string]: any }) { public constructor(options: Partial<FireworksOptions>) {
this.options = { ...DefaultOptions, ...options }; this.options = { ...DefaultOptions, ...options };
} }
+4 -3
View File
@@ -5,11 +5,12 @@ Copyright 2022 Arseny Uskov
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial 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. Please see LICENSE files in the repository root for full details.
*/ */
import type ICanvasEffect from "../ICanvasEffect"; import type ICanvasEffect from "../ICanvasEffect";
import { arrayFastClone } from "../../utils/arrays"; import { arrayFastClone } from "../../utils/arrays";
export type HeartOptions = { type HeartOptions = {
/** /**
* The maximum number of hearts to render at a given time * The maximum number of hearts to render at a given time
*/ */
@@ -51,7 +52,7 @@ const KEY_FRAME_INTERVAL = 15; // 15ms, roughly
export default class Hearts implements ICanvasEffect { export default class Hearts implements ICanvasEffect {
private readonly options: HeartOptions; private readonly options: HeartOptions;
public constructor(options: { [key: string]: any }) { public constructor(options: Partial<HeartOptions>) {
this.options = { ...DefaultOptions, ...options }; this.options = { ...DefaultOptions, ...options };
} }
+50 -37
View File
@@ -5,88 +5,101 @@ Copyright 2020 Nordeck IT + Consulting GmbH.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial 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. Please see LICENSE files in the repository root for full details.
*/ */
import { _t, _td } from "../languageHandler"; import { _t, _td } from "../languageHandler";
import { type ConfettiOptions } from "./confetti"; import { type Effect } from "./effect.ts";
import { type Effect } from "./effect";
import { type FireworksOptions } from "./fireworks";
import { type RainfallOptions } from "./rainfall";
import { type SnowfallOptions } from "./snowfall";
import { type SpaceInvadersOptions } from "./spaceinvaders";
import { type HeartOptions } from "./hearts";
/** /**
* This configuration defines room effects that can be triggered by custom message types and emojis * This configuration defines room effects that can be triggered by custom message types and emojis
*/ */
export const CHAT_EFFECTS: Array<Effect<{ [key: string]: any }>> = [ export const CHAT_EFFECTS: Array<Effect> = [
{ {
emojis: ["🎊", "🎉"], emojis: ["🎊", "🎉"],
msgType: "nic.custom.confetti", msgType: "nic.custom.confetti",
command: "confetti", command: "confetti",
description: () => _td("chat_effects|confetti_description"), description: () => _td("chat_effects|confetti_description"),
fallbackMessage: () => _t("chat_effects|confetti_message") + " 🎉", fallbackMessage: () => _t("chat_effects|confetti_message") + " 🎉",
options: { getRenderer: async () => {
maxCount: 150, const { default: Effect } = await import("./confetti/index.ts");
speed: 3, return new Effect({
frameInterval: 15, maxCount: 150,
alpha: 1.0, speed: 3,
gradient: false, frameInterval: 15,
alpha: 1.0,
gradient: false,
});
}, },
} as Effect<ConfettiOptions>, },
{ {
emojis: ["🎆"], emojis: ["🎆"],
msgType: "nic.custom.fireworks", msgType: "nic.custom.fireworks",
command: "fireworks", command: "fireworks",
description: () => _td("chat_effects|fireworks_description"), description: () => _td("chat_effects|fireworks_description"),
fallbackMessage: () => _t("chat_effects|fireworks_message") + " 🎆", fallbackMessage: () => _t("chat_effects|fireworks_message") + " 🎆",
options: { getRenderer: async () => {
maxCount: 500, const { default: Effect } = await import("./fireworks/index.ts");
gravity: 0.05, return new Effect({
maxCount: 500,
gravity: 0.05,
});
}, },
} as Effect<FireworksOptions>, },
{ {
emojis: ["🌧️", "⛈️", "🌦️"], emojis: ["🌧️", "⛈️", "🌦️"],
msgType: "io.element.effect.rainfall", msgType: "io.element.effect.rainfall",
command: "rainfall", command: "rainfall",
description: () => _td("chat_effects|rainfall_description"), description: () => _td("chat_effects|rainfall_description"),
fallbackMessage: () => _t("chat_effects|rainfall_message") + " 🌧️", fallbackMessage: () => _t("chat_effects|rainfall_message") + " 🌧️",
options: { getRenderer: async () => {
maxCount: 600, const { default: Effect } = await import("./rainfall/index.ts");
speed: 10, return new Effect({
maxCount: 600,
speed: 10,
});
}, },
} as Effect<RainfallOptions>, },
{ {
emojis: ["❄", "🌨"], emojis: ["❄", "🌨"],
msgType: "io.element.effect.snowfall", msgType: "io.element.effect.snowfall",
command: "snowfall", command: "snowfall",
description: () => _td("chat_effects|snowfall_description"), description: () => _td("chat_effects|snowfall_description"),
fallbackMessage: () => _t("chat_effects|snowfall_message") + " ❄", fallbackMessage: () => _t("chat_effects|snowfall_message") + " ❄",
options: { getRenderer: async () => {
maxCount: 200, const { default: Effect } = await import("./snowfall/index.ts");
gravity: 0.05, return new Effect({
maxDrift: 5, maxCount: 200,
gravity: 0.05,
maxDrift: 5,
});
}, },
} as Effect<SnowfallOptions>, },
{ {
emojis: ["👾", "🌌"], emojis: ["👾", "🌌"],
msgType: "io.element.effects.space_invaders", msgType: "io.element.effects.space_invaders",
command: "spaceinvaders", command: "spaceinvaders",
description: () => _td("chat_effects|spaceinvaders_description"), description: () => _td("chat_effects|spaceinvaders_description"),
fallbackMessage: () => _t("chat_effects|spaceinvaders_message") + " 👾", fallbackMessage: () => _t("chat_effects|spaceinvaders_message") + " 👾",
options: { getRenderer: async () => {
maxCount: 50, const { default: Effect } = await import("./spaceinvaders/index.ts");
gravity: 0.01, return new Effect({
maxCount: 50,
gravity: 0.01,
});
}, },
} as Effect<SpaceInvadersOptions>, },
{ {
emojis: ["💝"], emojis: ["💝"],
msgType: "io.element.effect.hearts", msgType: "io.element.effect.hearts",
command: "hearts", command: "hearts",
description: () => _td("chat_effects|hearts_description"), description: () => _td("chat_effects|hearts_description"),
fallbackMessage: () => _t("chat_effects|hearts_message") + " 💝", fallbackMessage: () => _t("chat_effects|hearts_message") + " 💝",
options: { getRenderer: async () => {
maxCount: 120, const { default: Effect } = await import("./hearts/index.ts");
gravity: 3.2, return new Effect({
maxCount: 120,
gravity: 3.2,
});
}, },
} as Effect<HeartOptions>, },
]; ];
+4 -3
View File
@@ -5,11 +5,12 @@ Copyright 2021 Josias Allestad
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial 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. Please see LICENSE files in the repository root for full details.
*/ */
import type ICanvasEffect from "../ICanvasEffect"; import type ICanvasEffect from "../ICanvasEffect";
import { arrayFastClone } from "../../utils/arrays"; import { arrayFastClone } from "../../utils/arrays";
export type RainfallOptions = { type RainfallOptions = {
/** /**
* The maximum number of raindrops to render at a given time * The maximum number of raindrops to render at a given time
*/ */
@@ -38,7 +39,7 @@ const KEY_FRAME_INTERVAL = 15;
export default class Rainfall implements ICanvasEffect { export default class Rainfall implements ICanvasEffect {
private readonly options: RainfallOptions; private readonly options: RainfallOptions;
public constructor(options: { [key: string]: any }) { public constructor(options: Partial<RainfallOptions>) {
this.options = { ...DefaultOptions, ...options }; this.options = { ...DefaultOptions, ...options };
} }
+4 -3
View File
@@ -4,11 +4,12 @@ Copyright 2020-2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial 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. Please see LICENSE files in the repository root for full details.
*/ */
import type ICanvasEffect from "../ICanvasEffect"; import type ICanvasEffect from "../ICanvasEffect";
import { arrayFastClone } from "../../utils/arrays"; import { arrayFastClone } from "../../utils/arrays";
export type SnowfallOptions = { type SnowfallOptions = {
/** /**
* The maximum number of snowflakes to render at a given time * The maximum number of snowflakes to render at a given time
*/ */
@@ -43,7 +44,7 @@ const KEY_FRAME_INTERVAL = 15; // 15ms, roughly
export default class Snowfall implements ICanvasEffect { export default class Snowfall implements ICanvasEffect {
private readonly options: SnowfallOptions; private readonly options: SnowfallOptions;
public constructor(options: { [key: string]: any }) { public constructor(options: Partial<SnowfallOptions>) {
this.options = { ...DefaultOptions, ...options }; this.options = { ...DefaultOptions, ...options };
} }
+4 -3
View File
@@ -4,11 +4,12 @@ Copyright 2021-2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial 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. Please see LICENSE files in the repository root for full details.
*/ */
import type ICanvasEffect from "../ICanvasEffect"; import type ICanvasEffect from "../ICanvasEffect";
import { arrayFastClone } from "../../utils/arrays"; import { arrayFastClone } from "../../utils/arrays";
export type SpaceInvadersOptions = { type SpaceInvadersOptions = {
/** /**
* The maximum number of invaders to render at a given time * The maximum number of invaders to render at a given time
*/ */
@@ -37,7 +38,7 @@ const GLYPH = "👾";
export default class SpaceInvaders implements ICanvasEffect { export default class SpaceInvaders implements ICanvasEffect {
private readonly options: SpaceInvadersOptions; private readonly options: SpaceInvadersOptions;
public constructor(options: { [key: string]: any }) { public constructor(options: Partial<SpaceInvadersOptions>) {
this.options = { ...DefaultOptions, ...options }; this.options = { ...DefaultOptions, ...options };
} }
+4 -4
View File
@@ -30,12 +30,12 @@
"@element-hq/element-web-playwright-common": "catalog:", "@element-hq/element-web-playwright-common": "catalog:",
"@nx-tools/nx-container": "^7.2.1", "@nx-tools/nx-container": "^7.2.1",
"@nx/jest": "^22.5.0", "@nx/jest": "^22.5.0",
"@types/node": "22",
"@playwright/test": "catalog:", "@playwright/test": "catalog:",
"@types/node": "22",
"cronstrue": "^3.0.0", "cronstrue": "^3.0.0",
"eslint-plugin-matrix-org": "^3.0.0", "eslint-plugin-matrix-org": "^3.0.0",
"husky": "^9.0.0", "husky": "^9.0.0",
"knip": "5.87.0", "knip": "6.1.0",
"lint-staged": "^16.0.0", "lint-staged": "^16.0.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mermaid": "^11.13.0", "mermaid": "^11.13.0",
@@ -67,9 +67,9 @@
"jest-fixed-jsdom": "patches/jest-fixed-jsdom.patch", "jest-fixed-jsdom": "patches/jest-fixed-jsdom.patch",
"jsdom": "patches/jsdom.patch", "jsdom": "patches/jsdom.patch",
"rollup": "patches/rollup.patch", "rollup": "patches/rollup.patch",
"knip": "patches/knip.patch",
"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"
}, },
"peerDependencyRules": { "peerDependencyRules": {
"allowedVersions": { "allowedVersions": {
-13
View File
@@ -16,16 +16,3 @@ index d451e0ab75c530b794e6925466e18e798b7df960..ca4eeb240ef200fe8996453276451327
...plugins.map(id => toDeferResolve(id)), ...plugins.map(id => toDeferResolve(id)),
...(plugins.includes('@babel/plugin-transform-runtime') ...(plugins.includes('@babel/plugin-transform-runtime')
? [toDeferResolve('@babel/runtime', { optional: true })] ? [toDeferResolve('@babel/runtime', { optional: true })]
diff --git a/dist/typescript/pragmas/custom.js b/dist/typescript/pragmas/custom.js
index 6ab98ae60cf8f07047a0ad7132c11a0da780bfbc..7c8818e81cde7e4ee9c11084d55043441e37208e 100644
--- a/dist/typescript/pragmas/custom.js
+++ b/dist/typescript/pragmas/custom.js
@@ -2,7 +2,7 @@ import { IMPORT_FLAGS } from "../../constants.js";
import { getEnvSpecifier } from "../../plugins/vitest/helpers.js";
import { isAbsolute, isInternal } from "../../util/path.js";
import { getLeadingComments, stripQuotes } from "../ast-helpers.js";
-const VITEST_ENV = /@(vitest|jest)-environment\s+(\S+)/g;
+const VITEST_ENV = /@(vitest)-environment\s+(\S+)/g;
export const collectCustomImports = (sourceFile) => {
const comments = getLeadingComments(sourceFile);
if (!comments.length)
+564 -449
View File
File diff suppressed because it is too large Load Diff