GoonCord/src/index.ts

48 lines
1.5 KiB
TypeScript
Raw Normal View History

import patchErrorBoundary from "@core/debug/patches/patchErrorBoundary";
2024-03-06 01:57:59 +08:00
import initFixes from "@core/fixes";
2024-03-09 07:43:04 +08:00
import { initFetchI18nStrings } from "@core/i18n";
2024-03-06 01:57:59 +08:00
import initSettings from "@core/ui/settings";
2024-07-20 11:23:00 +08:00
import { initVendettaObject } from "@core/vendetta/api";
import { VdPluginManager } from "@core/vendetta/plugins";
2024-10-13 14:03:20 +08:00
import { updateFonts } from "@lib/addons/fonts";
import { initPlugins, updatePlugins } from "@lib/addons/plugins";
2024-10-21 21:35:02 +08:00
import { initThemes } from "@lib/addons/themes";
2024-03-11 15:04:11 +08:00
import { patchCommands } from "@lib/api/commands";
2024-07-30 07:20:22 +08:00
import { patchLogHook } from "@lib/api/debug";
2024-03-11 15:04:11 +08:00
import { injectFluxInterceptor } from "@lib/api/flux";
2024-10-13 14:03:20 +08:00
import { patchJsx } from "@lib/api/react/jsx";
2024-03-07 12:35:07 +08:00
import { logger } from "@lib/utils/logger";
2024-05-20 15:36:33 +08:00
import { patchSettings } from "@ui/settings";
2022-10-18 23:04:55 +01:00
2024-03-11 15:04:11 +08:00
import * as lib from "./lib";
2024-10-13 14:03:20 +08:00
export default async () => {
// Load everything in parallel
2025-10-12 21:32:35 +03:00
2024-03-11 15:04:11 +08:00
await Promise.all([
initThemes(),
2024-03-11 15:04:11 +08:00
injectFluxInterceptor(),
patchSettings(),
patchLogHook(),
patchCommands(),
2024-10-13 11:45:52 +08:00
patchJsx(),
2024-05-20 16:39:51 +08:00
initVendettaObject(),
2024-03-09 07:43:04 +08:00
initFetchI18nStrings(),
2024-03-08 01:06:25 +08:00
initSettings(),
initFixes(),
patchErrorBoundary(),
2025-10-12 21:32:35 +03:00
updatePlugins(),
updateFonts(),
initPlugins(),
VdPluginManager.initPlugins(),
2024-03-11 15:04:11 +08:00
]).then(
// Push them all to unloader
u => u.forEach(f => f && lib.unload.push(f))
);
2022-10-18 23:04:55 +01:00
// Assign window object
2024-03-11 15:04:11 +08:00
window.bunny = lib;
// We good :)
2025-05-22 19:44:10 +03:00
logger.log("Kettu is ready!");
};