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 14:38:58 +01:00
committed by GitHub
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;
let effect: ICanvasEffect | null = effectsRef.current.get(name) || null;
if (effect === null) {
const options = CHAT_EFFECTS.find((e) => e.command === name)?.options;
const definition = CHAT_EFFECTS.find((e) => e.command === name)!;
try {
const { default: Effect } = await import(`../../../effects/${name}`);
effect = new Effect(options);
effectsRef.current.set(name, effect!);
effect = await definition.getRenderer();
effectsRef.current.set(name, effect);
} catch (err) {
logger.warn(`Unable to load effect module at '../../../effects/${name}.`, err);
logger.warn(`Unable to run effect module.`, err);
}
}
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
Please see LICENSE files in the repository root for full details.
*/
*/
import type ICanvasEffect from "../ICanvasEffect";
export type ConfettiOptions = {
type ConfettiOptions = {
/**
* max confetti count
*/
@@ -54,7 +55,7 @@ export const DefaultOptions: ConfettiOptions = {
export default class Confetti implements ICanvasEffect {
private readonly options: ConfettiOptions;
public constructor(options: { [key: string]: any }) {
public constructor(options: Partial<ConfettiOptions>) {
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.
*/
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
*/
@@ -29,7 +31,7 @@ export type Effect<TOptions extends { [key: string]: any }> = {
*/
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
Please see LICENSE files in the repository root for full details.
*/
*/
import type ICanvasEffect from "../ICanvasEffect";
export type FireworksOptions = {
type FireworksOptions = {
/**
* max fireworks count
*/
@@ -55,7 +55,7 @@ export const DefaultOptions: FireworksOptions = {
export default class Fireworks implements ICanvasEffect {
private readonly options: FireworksOptions;
public constructor(options: { [key: string]: any }) {
public constructor(options: Partial<FireworksOptions>) {
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
Please see LICENSE files in the repository root for full details.
*/
*/
import type ICanvasEffect from "../ICanvasEffect";
import { arrayFastClone } from "../../utils/arrays";
export type HeartOptions = {
type HeartOptions = {
/**
* 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 {
private readonly options: HeartOptions;
public constructor(options: { [key: string]: any }) {
public constructor(options: Partial<HeartOptions>) {
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
Please see LICENSE files in the repository root for full details.
*/
*/
import { _t, _td } from "../languageHandler";
import { type ConfettiOptions } from "./confetti";
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";
import { type Effect } from "./effect.ts";
/**
* 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: ["🎊", "🎉"],
msgType: "nic.custom.confetti",
command: "confetti",
description: () => _td("chat_effects|confetti_description"),
fallbackMessage: () => _t("chat_effects|confetti_message") + " 🎉",
options: {
maxCount: 150,
speed: 3,
frameInterval: 15,
alpha: 1.0,
gradient: false,
getRenderer: async () => {
const { default: Effect } = await import("./confetti/index.ts");
return new Effect({
maxCount: 150,
speed: 3,
frameInterval: 15,
alpha: 1.0,
gradient: false,
});
},
} as Effect<ConfettiOptions>,
},
{
emojis: ["🎆"],
msgType: "nic.custom.fireworks",
command: "fireworks",
description: () => _td("chat_effects|fireworks_description"),
fallbackMessage: () => _t("chat_effects|fireworks_message") + " 🎆",
options: {
maxCount: 500,
gravity: 0.05,
getRenderer: async () => {
const { default: Effect } = await import("./fireworks/index.ts");
return new Effect({
maxCount: 500,
gravity: 0.05,
});
},
} as Effect<FireworksOptions>,
},
{
emojis: ["🌧️", "⛈️", "🌦️"],
msgType: "io.element.effect.rainfall",
command: "rainfall",
description: () => _td("chat_effects|rainfall_description"),
fallbackMessage: () => _t("chat_effects|rainfall_message") + " 🌧️",
options: {
maxCount: 600,
speed: 10,
getRenderer: async () => {
const { default: Effect } = await import("./rainfall/index.ts");
return new Effect({
maxCount: 600,
speed: 10,
});
},
} as Effect<RainfallOptions>,
},
{
emojis: ["❄", "🌨"],
msgType: "io.element.effect.snowfall",
command: "snowfall",
description: () => _td("chat_effects|snowfall_description"),
fallbackMessage: () => _t("chat_effects|snowfall_message") + " ❄",
options: {
maxCount: 200,
gravity: 0.05,
maxDrift: 5,
getRenderer: async () => {
const { default: Effect } = await import("./snowfall/index.ts");
return new Effect({
maxCount: 200,
gravity: 0.05,
maxDrift: 5,
});
},
} as Effect<SnowfallOptions>,
},
{
emojis: ["👾", "🌌"],
msgType: "io.element.effects.space_invaders",
command: "spaceinvaders",
description: () => _td("chat_effects|spaceinvaders_description"),
fallbackMessage: () => _t("chat_effects|spaceinvaders_message") + " 👾",
options: {
maxCount: 50,
gravity: 0.01,
getRenderer: async () => {
const { default: Effect } = await import("./spaceinvaders/index.ts");
return new Effect({
maxCount: 50,
gravity: 0.01,
});
},
} as Effect<SpaceInvadersOptions>,
},
{
emojis: ["💝"],
msgType: "io.element.effect.hearts",
command: "hearts",
description: () => _td("chat_effects|hearts_description"),
fallbackMessage: () => _t("chat_effects|hearts_message") + " 💝",
options: {
maxCount: 120,
gravity: 3.2,
getRenderer: async () => {
const { default: Effect } = await import("./hearts/index.ts");
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
Please see LICENSE files in the repository root for full details.
*/
*/
import type ICanvasEffect from "../ICanvasEffect";
import { arrayFastClone } from "../../utils/arrays";
export type RainfallOptions = {
type RainfallOptions = {
/**
* 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 {
private readonly options: RainfallOptions;
public constructor(options: { [key: string]: any }) {
public constructor(options: Partial<RainfallOptions>) {
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
Please see LICENSE files in the repository root for full details.
*/
*/
import type ICanvasEffect from "../ICanvasEffect";
import { arrayFastClone } from "../../utils/arrays";
export type SnowfallOptions = {
type SnowfallOptions = {
/**
* 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 {
private readonly options: SnowfallOptions;
public constructor(options: { [key: string]: any }) {
public constructor(options: Partial<SnowfallOptions>) {
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
Please see LICENSE files in the repository root for full details.
*/
*/
import type ICanvasEffect from "../ICanvasEffect";
import { arrayFastClone } from "../../utils/arrays";
export type SpaceInvadersOptions = {
type SpaceInvadersOptions = {
/**
* The maximum number of invaders to render at a given time
*/
@@ -37,7 +38,7 @@ const GLYPH = "👾";
export default class SpaceInvaders implements ICanvasEffect {
private readonly options: SpaceInvadersOptions;
public constructor(options: { [key: string]: any }) {
public constructor(options: Partial<SpaceInvadersOptions>) {
this.options = { ...DefaultOptions, ...options };
}
+4 -4
View File
@@ -30,12 +30,12 @@
"@element-hq/element-web-playwright-common": "catalog:",
"@nx-tools/nx-container": "^7.2.1",
"@nx/jest": "^22.5.0",
"@types/node": "22",
"@playwright/test": "catalog:",
"@types/node": "22",
"cronstrue": "^3.0.0",
"eslint-plugin-matrix-org": "^3.0.0",
"husky": "^9.0.0",
"knip": "5.87.0",
"knip": "6.1.0",
"lint-staged": "^16.0.0",
"lodash": "^4.17.21",
"mermaid": "^11.13.0",
@@ -67,9 +67,9 @@
"jest-fixed-jsdom": "patches/jest-fixed-jsdom.patch",
"jsdom": "patches/jsdom.patch",
"rollup": "patches/rollup.patch",
"knip": "patches/knip.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": {
"allowedVersions": {
-13
View File
@@ -16,16 +16,3 @@ index d451e0ab75c530b794e6925466e18e798b7df960..ca4eeb240ef200fe8996453276451327
...plugins.map(id => toDeferResolve(id)),
...(plugins.includes('@babel/plugin-transform-runtime')
? [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