build: automatically glob all patch files

This commit is contained in:
Vendicated
2025-05-16 20:43:27 +02:00
parent d9a7e81f71
commit 1a673f2318
6 changed files with 40 additions and 23 deletions

10
src/module.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
/*
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2025 Vendicated and Vesktop contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
declare module "__patches__" {
const never: never;
export default never;
}

View File

@@ -7,9 +7,9 @@
import "./themedSplash";
import "./ipcCommands";
import "./appBadge";
import "./patches";
import "./fixes";
import "./arrpc";
import "__patches__"; // auto generated by the build script
export * as Components from "./components";

View File

@@ -13,12 +13,12 @@ addPatch({
replacement: {
// eslint-disable-next-line no-useless-escape
match: /(\i)\.\i\.getState\(\).neverShowModal/,
replace: "$& || $self.shouldIgnore($1)"
replace: "$& || $self.shouldIgnoreDevice($1)"
}
}
],
shouldIgnore(state: any) {
shouldIgnoreDevice(state: any) {
return Object.keys(state?.default?.lastDeviceConnected ?? {})?.[0] === "vencord-screen-share";
}
});

View File

@@ -1,19 +0,0 @@
/*
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
// TODO: Possibly auto generate glob if we have more patches in the future
import "./enableNotificationsByDefault";
import "./platformClass";
import "./allowDevToolsKeybind";
import "./hideSwitchDevice";
import "./hideVenmicInput";
import "./screenShareFixes";
import "./spellCheck";
import "./windowsTitleBar";
import "./streamerMode";
import "./windowMethods";
import "./hideDownloadAppsButton";
import "./fixAutoGainToggle";