From f19504f8282702bc6945a3d97acbee1a1fbe1b8d Mon Sep 17 00:00:00 2001 From: Ven Date: Wed, 25 Jan 2023 03:25:29 +0100 Subject: [PATCH] split up webpack commons into categories & type everything (#455) --- src/Vencord.ts | 4 +- src/components/PluginSettings/index.tsx | 4 +- .../VencordSettings/BackupRestoreTab.tsx | 2 +- src/components/VencordSettings/ThemesTab.tsx | 2 +- src/components/VencordSettings/index.tsx | 4 +- src/ipcMain/updater/git.ts | 2 +- src/ipcMain/updater/http.ts | 2 +- src/plugins/settings.tsx | 4 +- src/plugins/spotifyControls/SpotifyStore.ts | 4 - src/plugins/viewRaw.tsx | 2 +- src/utils/misc.tsx | 28 -- src/utils/modal.tsx | 76 ++++- src/webpack/common.tsx | 312 ------------------ src/webpack/common/components.ts | 53 +++ src/webpack/common/index.ts | 27 ++ src/webpack/common/internal.tsx | 36 ++ src/webpack/common/menu.ts | 51 +++ src/webpack/common/react.ts | 33 ++ src/webpack/common/stores.ts | 54 +++ src/webpack/common/types/components.d.ts | 284 ++++++++++++++++ src/webpack/common/types/fluxEvents.d.ts | 40 +++ src/webpack/common/types/menu.d.ts | 68 ++++ src/webpack/common/types/utils.d.ts | 98 ++++++ src/webpack/common/utils.ts | 112 +++++++ 24 files changed, 930 insertions(+), 372 deletions(-) delete mode 100644 src/webpack/common.tsx create mode 100644 src/webpack/common/components.ts create mode 100644 src/webpack/common/index.ts create mode 100644 src/webpack/common/internal.tsx create mode 100644 src/webpack/common/menu.ts create mode 100644 src/webpack/common/react.ts create mode 100644 src/webpack/common/stores.ts create mode 100644 src/webpack/common/types/components.d.ts create mode 100644 src/webpack/common/types/fluxEvents.d.ts create mode 100644 src/webpack/common/types/menu.d.ts create mode 100644 src/webpack/common/types/utils.d.ts create mode 100644 src/webpack/common/utils.ts diff --git a/src/Vencord.ts b/src/Vencord.ts index 82d5af0a..ac8579bf 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -32,7 +32,7 @@ import { PlainSettings, Settings } from "./api/settings"; import { patches, PMLogger, startAllPlugins } from "./plugins"; import { checkForUpdates, rebuild, update, UpdateLogger } from "./utils/updater"; import { onceReady } from "./webpack"; -import { Router } from "./webpack/common"; +import { SettingsRouter } from "./webpack/common"; export let Components: any; @@ -71,7 +71,7 @@ async function init() { "View Update", () => { popNotice(); - Router.open("VencordUpdater"); + SettingsRouter.open("VencordUpdater"); } ); }, 10_000); diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx index f439753c..34e6828f 100644 --- a/src/components/PluginSettings/index.tsx +++ b/src/components/PluginSettings/index.tsx @@ -326,7 +326,9 @@ export default ErrorBoundary.wrap(function PluginSettings() {
{plugins}
- + + + Required Plugins diff --git a/src/components/VencordSettings/BackupRestoreTab.tsx b/src/components/VencordSettings/BackupRestoreTab.tsx index 546db35f..2ea04527 100644 --- a/src/components/VencordSettings/BackupRestoreTab.tsx +++ b/src/components/VencordSettings/BackupRestoreTab.tsx @@ -45,7 +45,7 @@ function BackupRestoreTab() {