Path aliases, better lazyWebpack (#268)

This commit is contained in:
Ven 2022-11-28 13:37:55 +01:00 committed by GitHub
parent 7a4402f142
commit bad96b7887
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
138 changed files with 572 additions and 547 deletions

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import IpcEvents from "../src/utils/IpcEvents";
import * as DataStore from "../src/api/DataStore";
import IpcEvents from "../src/utils/IpcEvents";
// Discord deletes this so need to store in variable
const { localStorage } = window;

View File

@ -15,7 +15,7 @@ You don't need to run `pnpm build` every time you make a change. Instead, use `p
3. In `index.ts`, copy-paste the following template code:
```ts
import definePlugin from "../../utils/types";
import definePlugin from "@utils/types";
export default definePlugin({
name: "Epic Plugin",

View File

@ -16,10 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import IPC_EVENTS from "@utils/IpcEvents";
import { IpcRenderer, ipcRenderer } from "electron";
import IPC_EVENTS from "./utils/IpcEvents";
function assertEventAllowed(event: string) {
if (!(event in IPC_EVENTS)) throw new Error(`Event ${event} not allowed.`);
}

View File

@ -16,15 +16,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { mergeDefaults } from "@utils/misc";
import { findByCodeLazy, findByPropsLazy, waitFor } from "@webpack";
import { Message } from "discord-types/general";
import type { PartialDeep } from "type-fest";
import { lazyWebpack, mergeDefaults } from "../../utils/misc";
import { filters, waitFor } from "../../webpack";
import { Argument } from "./types";
const createBotMessage = lazyWebpack(filters.byCode('username:"Clyde"'));
const MessageSender = lazyWebpack(filters.byProps("receiveMessage"));
const createBotMessage = findByCodeLazy('username:"Clyde"');
const MessageSender = findByPropsLazy("receiveMessage");
let SnowflakeUtils: any;
waitFor("fromTimestamp", m => SnowflakeUtils = m);

View File

@ -16,7 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { makeCodeblock } from "../../utils/misc";
import { makeCodeblock } from "@utils/misc";
import { sendBotMessage } from "./commandHelpers";
import { ApplicationCommandInputType, ApplicationCommandOptionType, ApplicationCommandType, Argument, Command, CommandContext, Option } from "./types";

View File

@ -16,11 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import Logger from "@utils/Logger";
import { MessageStore } from "@webpack/common";
import type { Channel, Message } from "discord-types/general";
import Logger from "../utils/Logger";
import { MessageStore } from "../webpack/common";
const MessageEventsLogger = new Logger("MessageEvents", "#e5c890");
export interface Emoji {

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { waitFor } from "../webpack";
import { waitFor } from "@webpack";
let NoticesModule: any;
waitFor(m => m.show && m.dismiss && !m.suppressAll, m => NoticesModule = m);

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import Logger from "../utils/Logger";
import Logger from "@utils/Logger";
const logger = new Logger("ServerListAPI");

View File

@ -16,13 +16,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import plugins from "~plugins";
import IpcEvents from "@utils/IpcEvents";
import Logger from "@utils/Logger";
import { mergeDefaults } from "@utils/misc";
import { OptionType } from "@utils/types";
import { React } from "@webpack/common";
import IpcEvents from "../utils/IpcEvents";
import Logger from "../utils/Logger";
import { mergeDefaults } from "../utils/misc";
import { OptionType } from "../utils/types";
import { React } from "../webpack/common";
import plugins from "~plugins";
const logger = new Logger("Settings");
export interface Settings {

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { React, TextInput } from "../webpack/common";
import { React, TextInput } from "@webpack/common";
// TODO: Refactor settings to use this as well
interface TextInputProps {

View File

@ -16,8 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import IpcEvents from "../utils/IpcEvents";
import { Button } from "../webpack/common";
import IpcEvents from "@utils/IpcEvents";
import { Button } from "@webpack/common";
import { Heart } from "./Heart";
export default function DonateButton(props: any) {

View File

@ -16,9 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import Logger from "../utils/Logger";
import { LazyComponent } from "../utils/misc";
import { Margins, React } from "../webpack/common";
import Logger from "@utils/Logger";
import { LazyComponent } from "@utils/misc";
import { Margins, React } from "@webpack/common";
import { ErrorCard } from "./ErrorCard";
interface Props {

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Card } from "../webpack/common";
import { Card } from "@webpack/common";
interface Props {
style?: React.CSSProperties;

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import type { React } from "../webpack/common";
import type { React } from "@webpack/common";
export function Flex(props: React.PropsWithChildren<{
flexDirection?: React.CSSProperties["flexDirection"];

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { React } from "../webpack/common";
import { React } from "@webpack/common";
interface Props extends React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
disabled?: boolean;

View File

@ -16,12 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import monacoHtml from "~fileContent/monacoWin.html";
import { debounce } from "@utils/debounce";
import IpcEvents from "@utils/IpcEvents";
import { Queue } from "@utils/Queue";
import { find } from "@webpack";
import { debounce } from "../utils/debounce";
import IpcEvents from "../utils/IpcEvents";
import { Queue } from "../utils/Queue";
import { find } from "../webpack/webpack";
import monacoHtml from "~fileContent/monacoWin.html";
const queue = new Queue();
const setCss = debounce((css: string) => {

View File

@ -16,10 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { debounce } from "../utils/debounce";
import { makeCodeblock } from "../utils/misc";
import { Button, Clipboard, Forms, Margins, Parser, React, Switch, Text, TextInput } from "../webpack/common";
import { search } from "../webpack/webpack";
import { debounce } from "@utils/debounce";
import { makeCodeblock } from "@utils/misc";
import { search } from "@webpack";
import { Button, Clipboard, Forms, Margins, Parser, React, Switch, Text, TextInput } from "@webpack/common";
import { CheckedTextInput } from "./CheckedTextInput";
import ErrorBoundary from "./ErrorBoundary";

View File

@ -16,17 +16,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { generateId } from "@api/Commands";
import { useSettings } from "@api/settings";
import { LazyComponent } from "@utils/misc";
import { ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "@utils/modal";
import { proxyLazy } from "@utils/proxyLazy";
import { OptionType, Plugin } from "@utils/types";
import { findByCode, findByPropsLazy } from "@webpack";
import { Button, FluxDispatcher, Forms, React, Text, Tooltip, UserStore, UserUtils } from "@webpack/common";
import { User } from "discord-types/general";
import { Constructor } from "type-fest";
import { generateId } from "../../api/Commands";
import { useSettings } from "../../api/settings";
import { LazyComponent, lazyWebpack } from "../../utils/misc";
import { ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "../../utils/modal";
import { proxyLazy } from "../../utils/proxyLazy";
import { OptionType, Plugin } from "../../utils/types";
import { filters, findByCode } from "../../webpack";
import { Button, FluxDispatcher, Forms, React, Text, Tooltip, UserStore, UserUtils } from "../../webpack/common";
import ErrorBoundary from "../ErrorBoundary";
import { Flex } from "../Flex";
import {
@ -40,7 +40,7 @@ import {
} from "./components";
const UserSummaryItem = LazyComponent(() => findByCode("defaultRenderUser", "showDefaultAvatarsForNullUsers"));
const AvatarStyles = lazyWebpack(filters.byProps("moreUsers", "emptyUser", "avatarContainer", "clickableAvatar"));
const AvatarStyles = findByPropsLazy("moreUsers", "emptyUser", "avatarContainer", "clickableAvatar");
const UserRecord: Constructor<Partial<User>> = proxyLazy(() => UserStore.getCurrentUser().constructor) as any;
interface PluginModalProps extends ModalProps {

View File

@ -16,8 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { PluginOptionBoolean } from "../../../utils/types";
import { Forms, React, Select } from "../../../webpack/common";
import { PluginOptionBoolean } from "@utils/types";
import { Forms, React, Select } from "@webpack/common";
import { ISettingElementProps } from ".";
export function SettingBooleanComponent({ option, pluginSettings, id, onChange, onError }: ISettingElementProps<PluginOptionBoolean>) {

View File

@ -16,7 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { PluginOptionComponent } from "../../../utils/types";
import { PluginOptionComponent } from "@utils/types";
import { ISettingElementProps } from ".";
export function SettingCustomComponent({ option, onChange, onError }: ISettingElementProps<PluginOptionComponent>) {

View File

@ -16,8 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { OptionType, PluginOptionNumber } from "../../../utils/types";
import { Forms, React, TextInput } from "../../../webpack/common";
import { OptionType, PluginOptionNumber } from "@utils/types";
import { Forms, React, TextInput } from "@webpack/common";
import { ISettingElementProps } from ".";
const MAX_SAFE_NUMBER = BigInt(Number.MAX_SAFE_INTEGER);

View File

@ -16,8 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { PluginOptionSelect } from "../../../utils/types";
import { Forms, React, Select } from "../../../webpack/common";
import { PluginOptionSelect } from "@utils/types";
import { Forms, React, Select } from "@webpack/common";
import { ISettingElementProps } from ".";
export function SettingSelectComponent({ option, pluginSettings, onChange, onError, id }: ISettingElementProps<PluginOptionSelect>) {

View File

@ -16,8 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { PluginOptionSlider } from "../../../utils/types";
import { Forms, React, Slider } from "../../../webpack/common";
import { PluginOptionSlider } from "@utils/types";
import { Forms, React, Slider } from "@webpack/common";
import { ISettingElementProps } from ".";
export function makeRange(start: number, end: number, step = 1) {

View File

@ -16,8 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { PluginOptionString } from "../../../utils/types";
import { Forms, React, TextInput } from "../../../webpack/common";
import { PluginOptionString } from "@utils/types";
import { Forms, React, TextInput } from "@webpack/common";
import { ISettingElementProps } from ".";
export function SettingTextComponent({ option, pluginSettings, id, onChange, onError }: ISettingElementProps<PluginOptionString>) {

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { PluginOptionBase } from "../../../utils/types";
import { PluginOptionBase } from "@utils/types";
export interface ISettingElementProps<T extends PluginOptionBase> {
option: T;
@ -35,3 +35,4 @@ export * from "./SettingNumericComponent";
export * from "./SettingSelectComponent";
export * from "./SettingSliderComponent";
export * from "./SettingTextComponent";

View File

@ -16,18 +16,19 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { showNotice } from "@api/Notices";
import { Settings, useSettings } from "@api/settings";
import { ChangeList } from "@utils/ChangeList";
import Logger from "@utils/Logger";
import { classes, LazyComponent } from "@utils/misc";
import { openModalLazy } from "@utils/modal";
import { Plugin } from "@utils/types";
import { findByCode, findByPropsLazy } from "@webpack";
import { Alerts, Button, Forms, Margins, Parser, React, Select, Switch, Text, TextInput, Toasts, Tooltip } from "@webpack/common";
import Plugins from "~plugins";
import { showNotice } from "../../api/Notices";
import { Settings, useSettings } from "../../api/settings";
import { startDependenciesRecursive, startPlugin, stopPlugin } from "../../plugins";
import { ChangeList } from "../../utils/ChangeList";
import Logger from "../../utils/Logger";
import { classes, LazyComponent, lazyWebpack } from "../../utils/misc";
import { openModalLazy } from "../../utils/modal";
import { Plugin } from "../../utils/types";
import { filters, findByCode } from "../../webpack";
import { Alerts, Button, Forms, Margins, Parser, React, Select, Switch, Text, TextInput, Toasts, Tooltip } from "../../webpack/common";
import ErrorBoundary from "../ErrorBoundary";
import { ErrorCard } from "../ErrorCard";
import { Flex } from "../Flex";
@ -37,7 +38,7 @@ import * as styles from "./styles";
const logger = new Logger("PluginSettings", "#a6d189");
const InputStyles = lazyWebpack(filters.byProps("inputDefault", "inputWrapper"));
const InputStyles = findByPropsLazy("inputDefault", "inputWrapper");
const CogWheel = LazyComponent(() => findByCode("18.564C15.797 19.099 14.932 19.498 14 19.738V22H10V19.738C9.069"));
const InfoIcon = LazyComponent(() => findByCode("4.4408921e-16 C4.4771525,-1.77635684e-15 4.4408921e-16"));

View File

@ -16,8 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { downloadSettingsBackup, uploadSettingsBackup } from "../../utils/settingsSync";
import { Button, Card, Forms, Margins, Text } from "../../webpack/common";
import { downloadSettingsBackup, uploadSettingsBackup } from "@utils/settingsSync";
import { Button, Card, Forms, Margins, Text } from "@webpack/common";
import ErrorBoundary from "../ErrorBoundary";
import { Flex } from "../Flex";

View File

@ -16,11 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { classes, useAwaiter } from "@utils/misc";
import { changes, checkForUpdates, getRepo, isNewer, rebuild, update, updateError, UpdateLogger } from "@utils/updater";
import { Alerts, Button, Card, Forms, Margins, Parser, React, Toasts } from "@webpack/common";
import gitHash from "~git-hash";
import { classes, useAwaiter } from "../../utils/misc";
import { changes, checkForUpdates, getRepo, isNewer, rebuild, update, updateError, UpdateLogger } from "../../utils/updater";
import { Alerts, Button, Card, Forms, Margins, Parser, React, Toasts } from "../../webpack/common";
import ErrorBoundary from "../ErrorBoundary";
import { ErrorCard } from "../ErrorCard";
import { Flex } from "../Flex";

View File

@ -17,10 +17,11 @@
*/
import { useSettings } from "../../api/settings";
import IpcEvents from "../../utils/IpcEvents";
import { useAwaiter } from "../../utils/misc";
import { Button, Card, Forms, React, Switch } from "../../webpack/common";
import { useSettings } from "@api/settings";
import IpcEvents from "@utils/IpcEvents";
import { useAwaiter } from "@utils/misc";
import { Button, Card, Forms, React, Switch } from "@webpack/common";
import DonateButton from "../DonateButton";
import ErrorBoundary from "../ErrorBoundary";

View File

@ -16,11 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { findByCodeLazy } from "@webpack";
import { Forms, Router, Text } from "@webpack/common";
import cssText from "~fileContent/settingsStyles.css";
import { lazyWebpack } from "../../utils/misc";
import { filters } from "../../webpack";
import { Forms, React, Router, Text } from "../../webpack/common";
import ErrorBoundary from "../ErrorBoundary";
import BackupRestoreTab from "./BackupRestoreTab";
import PluginsTab from "./PluginsTab";
@ -33,7 +33,7 @@ document.head.appendChild(style);
const st = (style: string) => `vcSettings${style}`;
const TabBar = lazyWebpack(filters.byCode('[role="tab"][aria-disabled="false"]'));
const TabBar = findByCodeLazy('[role="tab"][aria-disabled="false"]');
interface SettingsProps {
tab: string;

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { isOutdated, rebuild, update } from "../utils/updater";
import { isOutdated, rebuild, update } from "@utils/updater";
export async function handleComponentFailed() {
if (isOutdated) {

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import Logger from "../utils/Logger";
import Logger from "@utils/Logger";
if (IS_DEV) {
var traces = {} as Record<string, [number, any[]]>;

View File

@ -18,6 +18,9 @@
import "./updater";
import { debounce } from "@utils/debounce";
import IpcEvents from "@utils/IpcEvents";
import { Queue } from "@utils/Queue";
import { BrowserWindow, desktopCapturer, ipcMain, shell } from "electron";
import { mkdirSync, readFileSync, watch } from "fs";
import { open, readFile, writeFile } from "fs/promises";
@ -25,9 +28,6 @@ import { join } from "path";
import monacoHtml from "~fileContent/../components/monacoWin.html;base64";
import { debounce } from "../utils/debounce";
import IpcEvents from "../utils/IpcEvents";
import { Queue } from "../utils/Queue";
import { ALLOWED_PROTOCOLS, QUICKCSS_PATH, SETTINGS_DIR, SETTINGS_FILE } from "./constants";
mkdirSync(SETTINGS_DIR, { recursive: true });

View File

@ -16,12 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import IpcEvents from "@utils/IpcEvents";
import { execFile as cpExecFile } from "child_process";
import { ipcMain } from "electron";
import { join } from "path";
import { promisify } from "util";
import IpcEvents from "../../utils/IpcEvents";
import { calculateHashes, serializeErrors } from "./common";
const VENCORD_SRC_DIR = join(__dirname, "..");

View File

@ -16,6 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { VENCORD_USER_AGENT } from "@utils/constants";
import IpcEvents from "@utils/IpcEvents";
import { ipcMain } from "electron";
import { writeFile } from "fs/promises";
import { join } from "path";
@ -23,8 +25,6 @@ import { join } from "path";
import gitHash from "~git-hash";
import gitRemote from "~git-remote";
import { VENCORD_USER_AGENT } from "../../utils/constants";
import IpcEvents from "../../utils/IpcEvents";
import { get } from "../simpleGet";
import { calculateHashes, serializeErrors } from "./common";

2
src/modules.d.ts vendored
View File

@ -20,7 +20,7 @@
/// <reference types="standalone-electron-types"/>
declare module "~plugins" {
const plugins: Record<string, import("./utils/types").Plugin>;
const plugins: Record<string, import("@utils/types").Plugin>;
export default plugins;
}

View File

@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { onceDefined } from "@utils/onceDefined";
import electron, { app, BrowserWindowConstructorOptions } from "electron";
import { readFileSync } from "fs";
import { dirname, join } from "path";
@ -23,7 +24,6 @@ import { dirname, join } from "path";
import { initIpc } from "./ipcMain";
import { installExt } from "./ipcMain/extensions";
import { readSettings } from "./ipcMain/index";
import { onceDefined } from "./utils/onceDefined";
console.log("[Vencord] Starting up...");

View File

@ -16,10 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Settings } from "../api/settings";
import { Devs } from "../utils/constants";
import { makeLazy } from "../utils/misc";
import definePlugin, { OptionType } from "../utils/types";
import { Settings } from "@api/settings";
import { Devs } from "@utils/constants";
import { makeLazy } from "@utils/misc";
import definePlugin, { OptionType } from "@utils/types";
export default definePlugin({
name: "BetterNotesBox",

View File

@ -16,14 +16,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { get, set } from "@api/DataStore";
import { Devs } from "@utils/constants";
import Logger from "@utils/Logger";
import definePlugin from "@utils/types";
import { ChannelStore, FluxDispatcher } from "@webpack/common";
import { Message } from "discord-types/general";
import { get, set } from "../api/DataStore";
import { Devs } from "../utils/constants";
import Logger from "../utils/Logger";
import definePlugin from "../utils/types";
import { ChannelStore, FluxDispatcher } from "../webpack/common";
let style: HTMLStyleElement;
const KEY = "HideAttachments_HiddenIds";

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "TimeBarAllActivities",

View File

@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin, { OptionType } from "../utils/types";
import { Settings } from "../Vencord";
import { Settings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
enum Methods {
Random,

View File

@ -16,17 +16,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { BadgePosition, ProfileBadge } from "../api/Badges";
import DonateButton from "../components/DonateButton";
import ErrorBoundary from "../components/ErrorBoundary";
import { Flex } from "../components/Flex";
import { Heart } from "../components/Heart";
import { Devs } from "../utils/constants";
import IpcEvents from "../utils/IpcEvents";
import Logger from "../utils/Logger";
import { closeModal, Modals, openModal } from "../utils/modal";
import definePlugin from "../utils/types";
import { Forms, Margins } from "../webpack/common";
import { BadgePosition, ProfileBadge } from "@api/Badges";
import DonateButton from "@components/DonateButton";
import ErrorBoundary from "@components/ErrorBoundary";
import { Flex } from "@components/Flex";
import { Heart } from "@components/Heart";
import { Devs } from "@utils/constants";
import IpcEvents from "@utils/IpcEvents";
import Logger from "@utils/Logger";
import { closeModal, Modals, openModal } from "@utils/modal";
import definePlugin from "@utils/types";
import { Forms, Margins } from "@webpack/common";
const CONTRIBUTOR_BADGE = "https://media.discordapp.net/stickers/1026517526106087454.webp";

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "CommandsAPI",

View File

@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { migratePluginSettings } from "../api/settings";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { migratePluginSettings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
// duplicate values have multiple branches with different types. Just include all to be safe
const nameMap = {

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "MessageAccessoriesAPI",

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "MessageEventsAPI",

View File

@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { migratePluginSettings } from "../api/settings";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { migratePluginSettings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
migratePluginSettings("NoticesAPI", "NoticesApi");

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "ServerListAPI",

View File

@ -16,13 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { popNotice, showNotice } from "../api/Notices";
import { Link } from "../components/Link";
import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin from "../utils/types";
import { filters, mapMangledModuleLazy } from "../webpack";
import { FluxDispatcher, Forms, Toasts } from "../webpack/common";
import { popNotice, showNotice } from "@api/Notices";
import { Link } from "@components/Link";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { filters, findByCodeLazy, mapMangledModuleLazy } from "@webpack";
import { FluxDispatcher, Forms, Toasts } from "@webpack/common";
const assetManager = mapMangledModuleLazy(
"getAssetImage: size must === [number, number] for Twitch",
@ -31,7 +30,7 @@ const assetManager = mapMangledModuleLazy(
}
);
const rpcManager = lazyWebpack(filters.byCode(".APPLICATION_RPC("));
const rpcManager = findByCodeLazy(".APPLICATION_RPC(");
async function lookupAsset(applicationId: string, key: string): Promise<string> {
return (await assetManager.getAsset(applicationId, [key, undefined]))[0];

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin, { OptionType } from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
export default definePlugin({
name: "BANger",

View File

@ -17,8 +17,8 @@
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "BetterGifAltText",

View File

@ -16,10 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { migratePluginSettings, Settings } from "../api/settings";
import { Devs } from "../utils/constants";
import definePlugin, { OptionType } from "../utils/types";
import { Clipboard, Toasts } from "../webpack/common";
import { migratePluginSettings, Settings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { Clipboard, Toasts } from "@webpack/common";
migratePluginSettings("BetterRoleDot", "ClickableRoleDot");
export default definePlugin({

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "BetterUploadButton",

View File

@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Settings } from "../api/settings";
import { Devs } from "../utils/constants";
import definePlugin, { OptionType } from "../utils/types";
import { Settings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
let style: HTMLStyleElement;

View File

@ -16,11 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Settings } from "../api/settings";
import ErrorBoundary from "../components/ErrorBoundary";
import { Devs } from "../utils/constants";
import definePlugin, { OptionType } from "../utils/types";
import { React } from "../webpack/common";
import { Settings } from "@api/settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { React } from "@webpack/common";
function formatDuration(ms: number) {
// here be dragons (moment fucking sucks)

View File

@ -22,10 +22,11 @@ import {
MessageObject,
removePreEditListener,
removePreSendListener
} from "../../api/MessageEvents";
import { migratePluginSettings } from "../../api/settings";
import { Devs } from "../../utils/constants";
import definePlugin from "../../utils/types";
} from "@api/MessageEvents";
import { migratePluginSettings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { defaultRules } from "./defaultRules";
// From lodash

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
const WEB_ONLY = (f: string) => () => {
throw new Error(`'${f}' is Discord Desktop only.`);

View File

@ -16,12 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { ApplicationCommandOptionType, sendBotMessage } from "../api/Commands";
import { findOption } from "../api/Commands/commandHelpers";
import { ApplicationCommandInputType } from "../api/Commands/types";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { findByCode, findByProps } from "../webpack";
import { ApplicationCommandOptionType, sendBotMessage } from "@api/Commands";
import { findOption } from "@api/Commands/commandHelpers";
import { ApplicationCommandInputType } from "@api/Commands/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { findByCode, findByProps } from "@webpack";
const DRAFT_TYPE = 0;

View File

@ -16,10 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { ApplicationCommandOptionType, sendBotMessage } from "../api/Commands";
import { ApplicationCommandInputType } from "../api/Commands/types";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { ApplicationCommandOptionType, sendBotMessage } from "@api/Commands";
import { ApplicationCommandInputType } from "@api/Commands/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "UrbanDictionary",

View File

@ -16,20 +16,20 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { migratePluginSettings, Settings } from "../api/settings";
import { CheckedTextInput } from "../components/CheckedTextInput";
import { Devs } from "../utils/constants";
import Logger from "../utils/Logger";
import { lazyWebpack, makeLazy } from "../utils/misc";
import { ModalContent, ModalHeader, ModalRoot, openModal } from "../utils/modal";
import definePlugin from "../utils/types";
import { filters } from "../webpack";
import { Forms, GuildStore, Margins, Menu, PermissionStore, React, Toasts, Tooltip, UserStore } from "../webpack/common";
import { migratePluginSettings, Settings } from "@api/settings";
import { CheckedTextInput } from "@components/CheckedTextInput";
import { Devs } from "@utils/constants";
import Logger from "@utils/Logger";
import { makeLazy } from "@utils/misc";
import { ModalContent, ModalHeader, ModalRoot, openModal } from "@utils/modal";
import definePlugin from "@utils/types";
import { findByCodeLazy, findByPropsLazy } from "@webpack";
import { Forms, GuildStore, Margins, Menu, PermissionStore, React, Toasts, Tooltip, UserStore } from "@webpack/common";
const MANAGE_EMOJIS_AND_STICKERS = 1n << 30n;
const GuildEmojiStore = lazyWebpack(filters.byProps("getGuilds", "getGuildEmoji"));
const uploadEmoji = lazyWebpack(filters.byCode('"EMOJI_UPLOAD_START"', "GUILD_EMOJIS("));
const GuildEmojiStore = findByPropsLazy("getGuilds", "getGuildEmoji");
const uploadEmoji = findByCodeLazy('"EMOJI_UPLOAD_START"', "GUILD_EMOJIS(");
function getGuildCandidates(isAnimated: boolean) {
const meId = UserStore.getCurrentUser().id;

View File

@ -16,14 +16,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin, { OptionType } from "../utils/types";
import { Settings } from "../Vencord";
import { filters } from "../webpack";
import { Forms, React } from "../webpack/common";
import { Settings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack";
import { Forms, React } from "@webpack/common";
const KbdStyles = lazyWebpack(filters.byProps("key", "removeBuildOverride"));
const KbdStyles = findByPropsLazy("key", "removeBuildOverride");
export default definePlugin({
name: "Experiments",

View File

@ -16,18 +16,16 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { addPreEditListener, addPreSendListener, removePreEditListener, removePreSendListener } from "../api/MessageEvents";
import { migratePluginSettings } from "../api/settings";
import { Devs } from "../utils/constants";
import { ApngDisposeOp, getGifEncoder, importApngJs } from "../utils/dependencies";
import { lazyWebpack } from "../utils/misc";
import definePlugin, { OptionType } from "../utils/types";
import { Settings } from "../Vencord";
import { filters } from "../webpack";
import { ChannelStore, UserStore } from "../webpack/common";
import { addPreEditListener, addPreSendListener, removePreEditListener, removePreSendListener } from "@api/MessageEvents";
import { migratePluginSettings, Settings } from "@api/settings";
import { Devs } from "@utils/constants";
import { ApngDisposeOp, getGifEncoder, importApngJs } from "@utils/dependencies";
import definePlugin, { OptionType } from "@utils/types";
import { findByCodeLazy, findByPropsLazy } from "@webpack";
import { ChannelStore, UserStore } from "@webpack/common";
const DRAFT_TYPE = 0;
const promptToUpload = lazyWebpack(filters.byCode("UPLOAD_FILE_LIMIT_ERROR"));
const promptToUpload = findByCodeLazy("UPLOAD_FILE_LIMIT_ERROR");
interface BaseSticker {
available: boolean;
@ -225,8 +223,8 @@ export default definePlugin({
return;
}
const EmojiStore = lazyWebpack(filters.byProps("getCustomEmojiById"));
const StickerStore = lazyWebpack(filters.byProps("getAllGuildStickers")) as {
const EmojiStore = findByPropsLazy("getCustomEmojiById");
const StickerStore = findByPropsLazy("getAllGuildStickers") as {
getPremiumPacks(): StickerPack[];
getAllGuildStickers(): Map<string, Sticker[]>;
getStickerById(id: string): Sticker | undefined;

View File

@ -16,11 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { ApplicationCommandOptionType } from "../api/Commands";
import { makeRange } from "../components/PluginSettings/components";
import { Devs } from "../utils/constants";
import definePlugin, { OptionType } from "../utils/types";
import { Settings } from "../Vencord";
import { ApplicationCommandOptionType } from "@api/Commands";
import { Settings } from "@api/settings";
import { makeRange } from "@components/PluginSettings/components";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
export default definePlugin({
name: "Fart2",

View File

@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { waitFor } from "../webpack";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { waitFor } from "@webpack";
let GuildStore;
waitFor(["getGuild"], m => GuildStore = m);

View File

@ -16,10 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { ApplicationCommandInputType, sendBotMessage } from "../api/Commands";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { findByProps } from "../webpack";
import { ApplicationCommandInputType, sendBotMessage } from "@api/Commands";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { findByProps } from "@webpack";
export default definePlugin({
name: "FriendInvites",

View File

@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { addPreSendListener, MessageObject, removePreSendListener } from "../api/MessageEvents";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { addPreSendListener, MessageObject, removePreSendListener } from "@api/MessageEvents";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
const re = /https?:\/\/twitter\.com(?=\/\w+?\/status\/)/g;

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "iLoveSpam",

View File

@ -16,11 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { DataStore } from "../api";
import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin from "../utils/types";
import { filters } from "../webpack";
import * as DataStore from "@api/DataStore";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { findByPropsLazy } from "@webpack";
interface MatchAndReplace {
match: RegExp;
@ -28,7 +27,7 @@ interface MatchAndReplace {
}
/** Used to re-render the Registered Games tab to update how our button looks like */
const RunningGameStoreModule = lazyWebpack(filters.byProps("IgnoreActivities_reRenderGames"));
const RunningGameStoreModule = findByPropsLazy("IgnoreActivities_reRenderGames");
let ignoredActivitiesCache: string[] = [];

View File

@ -16,13 +16,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { registerCommand, unregisterCommand } from "@api/Commands";
import { Settings } from "@api/settings";
import Logger from "@utils/Logger";
import { Patch, Plugin } from "@utils/types";
import Plugins from "~plugins";
import { registerCommand, unregisterCommand } from "../api/Commands";
import { Settings } from "../api/settings";
import { traceFunction } from "../debug/Tracer";
import Logger from "../utils/Logger";
import { Patch, Plugin } from "../utils/types";
const logger = new Logger("PluginManager", "#a6d189");

View File

@ -16,10 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { DataStore } from "../api";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { ChannelStore, FluxDispatcher, NavigationRouter, SelectedChannelStore, SelectedGuildStore } from "../webpack/common";
import * as DataStore from "@api/DataStore";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { ChannelStore, FluxDispatcher, NavigationRouter, SelectedChannelStore, SelectedGuildStore } from "@webpack/common";
export interface LogoutEvent {
type: "LOGOUT";

View File

@ -16,43 +16,43 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Link } from "../components/Link";
import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin, { OptionType } from "../utils/types";
import { Settings, Webpack } from "../Vencord";
import { FluxDispatcher, Forms } from "../webpack/common";
import { Settings } from "@api/settings";
import { Link } from "@components/Link";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { filters, findByPropsLazy, mapMangledModuleLazy } from "@webpack";
import { FluxDispatcher, Forms } from "@webpack/common";
interface ActivityAssets {
large_image?: string
large_text?: string
small_image?: string
small_text?: string
large_image?: string;
large_text?: string;
small_image?: string;
small_text?: string;
}
interface Activity {
state: string
details?: string
state: string;
details?: string;
timestamps?: {
start?: Number
}
assets?: ActivityAssets
buttons?: Array<string>
name: string
application_id: string
start?: Number;
};
assets?: ActivityAssets;
buttons?: Array<string>;
name: string;
application_id: string;
metadata?: {
button_urls?: Array<string>
}
type: Number
flags: Number
button_urls?: Array<string>;
};
type: Number;
flags: Number;
}
interface TrackData {
name: string
album: string
artist: string
url: string
imageUrl?: string
name: string;
album: string;
artist: string;
url: string;
imageUrl?: string;
}
// only relevant enum values
@ -67,11 +67,11 @@ enum ActivityFlag {
const applicationId = "1043533871037284423";
const presenceStore = lazyWebpack(Webpack.filters.byProps("getLocalPresence"));
const assetManager = Webpack.mapMangledModuleLazy(
const presenceStore = findByPropsLazy("getLocalPresence");
const assetManager = mapMangledModuleLazy(
"getAssetImage: size must === [number, number] for Twitch",
{
getAsset: Webpack.filters.byCode("apply("),
getAsset: filters.byCode("apply("),
}
);
@ -196,9 +196,9 @@ export default definePlugin({
state: hideAlbumName ? trackData.artist : `${trackData.artist} - ${trackData.album}`,
assets,
buttons: [ "Open in Last.fm" ],
buttons: ["Open in Last.fm"],
metadata: {
button_urls: [ trackData.url ]
button_urls: [trackData.url]
},
type: this.settings.useListeningStatus ? ActivityType.LISTENING : ActivityType.PLAYING,

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
// These are Xor encrypted to prevent you from spoiling yourself when you read the source code.
// don't worry about it :P

View File

@ -16,13 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { addClickListener, removeClickListener } from "../api/MessageEvents";
import { migratePluginSettings } from "../api/settings";
import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin from "../utils/types";
import { filters } from "../webpack";
import { UserStore } from "../webpack/common";
import { addClickListener, removeClickListener } from "@api/MessageEvents";
import { migratePluginSettings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { findByPropsLazy, findLazy } from "@webpack";
import { UserStore } from "@webpack/common";
let isDeletePressed = false;
const keydown = (e: KeyboardEvent) => e.key === "Backspace" && (isDeletePressed = true);
@ -37,10 +36,10 @@ export default definePlugin({
dependencies: ["MessageEventsAPI"],
start() {
const MessageActions = lazyWebpack(filters.byProps("deleteMessage", "startEditMessage"));
const PermissionStore = lazyWebpack(filters.byProps("can", "initialize"));
const Permissions = lazyWebpack(m => typeof m.MANAGE_MESSAGES === "bigint");
const EditStore = lazyWebpack(filters.byProps("isEditing", "isEditingAny"));
const MessageActions = findByPropsLazy("deleteMessage", "startEditMessage");
const PermissionStore = findByPropsLazy("can", "initialize");
const Permissions = findLazy(m => typeof m.MANAGE_MESSAGES === "bigint");
const EditStore = findByPropsLazy("isEditing", "isEditingAny");
document.addEventListener("keydown", keydown);
document.addEventListener("keyup", keyup);

View File

@ -16,14 +16,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Settings } from "../../api/settings";
import ErrorBoundary from "../../components/ErrorBoundary";
import { Devs } from "../../utils/constants";
import Logger from "../../utils/Logger";
import { lazyWebpack } from "../../utils/misc";
import definePlugin, { OptionType } from "../../utils/types";
import { filters } from "../../webpack";
import { Parser, UserStore } from "../../webpack/common";
import { Settings } from "@api/settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import Logger from "@utils/Logger";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack";
import { Parser, UserStore } from "@webpack/common";
function addDeleteStyleClass() {
if (Settings.plugins.MessageLogger.deleteStyle === "text") {
@ -74,8 +73,8 @@ export default definePlugin({
`,
start() {
this.moment = lazyWebpack(filters.byProps("relativeTimeRounding", "relativeTimeThreshold"));
this.timestampModule = lazyWebpack(filters.byProps("messageLogger_TimestampComponent"));
this.moment = findByPropsLazy("relativeTimeRounding", "relativeTimeThreshold");
this.timestampModule = findByPropsLazy("messageLogger_TimestampComponent");
const style = this.style = document.createElement("style");
style.textContent = this.css;

View File

@ -16,11 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { DataStore } from "../api";
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, registerCommand, sendBotMessage, unregisterCommand } from "../api/Commands";
import { Settings } from "../api/settings";
import { Devs } from "../utils/constants";
import definePlugin, { OptionType } from "../utils/types";
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, registerCommand, sendBotMessage, unregisterCommand } from "@api/Commands";
import * as DataStore from "@api/DataStore";
import { Settings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
const EMOTE = "<:luna:1035316192220553236>";
const DATA_KEY = "MessageTags_TAGS";

View File

@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { ApplicationCommandInputType, findOption, OptionalMessageOption, RequiredMessageOption, sendBotMessage } from "../api/Commands";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { ApplicationCommandInputType, findOption, OptionalMessageOption, RequiredMessageOption, sendBotMessage } from "@api/Commands";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
function mock(input: string): string {

View File

@ -16,10 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { findOption, OptionalMessageOption } from "../api/Commands";
import { migratePluginSettings } from "../api/settings";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { findOption, OptionalMessageOption } from "@api/Commands";
import { migratePluginSettings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
migratePluginSettings("MoreKaomoji", "moarKaomojis");
export default definePlugin({

View File

@ -16,15 +16,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Settings } from "@api/settings";
import { makeRange } from "@components/PluginSettings/components/SettingSliderComponent";
import { Devs } from "@utils/constants";
import { sleep } from "@utils/misc";
import definePlugin, { OptionType } from "@utils/types";
import { FluxDispatcher, SelectedChannelStore, UserStore } from "@webpack/common";
import { Message, ReactionEmoji } from "discord-types/general";
import { makeRange } from "../components/PluginSettings/components/SettingSliderComponent";
import { Devs } from "../utils/constants";
import { sleep } from "../utils/misc";
import definePlugin, { OptionType } from "../utils/types";
import { Settings } from "../Vencord";
import { FluxDispatcher, SelectedChannelStore, UserStore } from "../webpack/common";
interface IMessageCreate {
type: "MESSAGE_CREATE";
optimistic: boolean;

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "MuteNewGuild",

View File

@ -16,12 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin, { OptionType } from "../utils/types";
import { Settings } from "../Vencord";
import { filters } from "../webpack";
const RelationshipStore = lazyWebpack(filters.byProps("getRelationships", "isBlocked"));
import { Settings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack";
const RelationshipStore = findByPropsLazy("getRelationships", "isBlocked");
export default definePlugin({
name: "NoBlockedMessages",

View File

@ -16,10 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { addPreSendListener, MessageObject, removePreSendListener } from "../api/MessageEvents";
import { Devs } from "../utils/constants";
import definePlugin, { OptionType } from "../utils/types";
import { Settings } from "../Vencord";
import { addPreSendListener, MessageObject, removePreSendListener } from "@api/MessageEvents";
import { Settings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
export default definePlugin({
name: "NoCanaryMessageLinks",

View File

@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { migratePluginSettings } from "../api/settings";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { migratePluginSettings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
migratePluginSettings("NoDevtoolsWarning", "STFU");

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "No F1",

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "No RPC",

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "NoReplyMention",

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "NoSystemBadge",

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "NoTrack",

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "oneko",

View File

@ -16,12 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { ApplicationCommandInputType, ApplicationCommandOptionType, Argument, CommandContext, findOption, sendBotMessage } from "../api/Commands";
import { Devs } from "../utils/constants";
import { getGifEncoder } from "../utils/dependencies";
import { lazyWebpack, makeLazy } from "../utils/misc";
import definePlugin from "../utils/types";
import { filters } from "../webpack";
import { ApplicationCommandInputType, ApplicationCommandOptionType, Argument, CommandContext, findOption, sendBotMessage } from "@api/Commands";
import { Devs } from "@utils/constants";
import { getGifEncoder } from "@utils/dependencies";
import { makeLazy } from "@utils/misc";
import definePlugin from "@utils/types";
import { findByCodeLazy, findByPropsLazy } from "@webpack";
const DRAFT_TYPE = 0;
const DEFAULT_DELAY = 20;
@ -35,9 +35,9 @@ const getFrames = makeLazy(() => Promise.all(
))
);
const fetchUser = lazyWebpack(filters.byCode(".USER("));
const promptToUpload = lazyWebpack(filters.byCode("UPLOAD_FILE_LIMIT_ERROR"));
const UploadStore = lazyWebpack(filters.byProps("getUploads"));
const fetchUser = findByCodeLazy(".USER(");
const promptToUpload = findByCodeLazy("UPLOAD_FILE_LIMIT_ERROR");
const UploadStore = findByPropsLazy("getUploads");
function loadImage(source: File | string) {
const isFile = source instanceof File;

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "PlainFolderIcon",

View File

@ -16,16 +16,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Settings } from "@api/settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { findByCodeLazy } from "@webpack";
import { PresenceStore, Tooltip } from "@webpack/common";
import { User } from "discord-types/general";
import { Settings } from "../api/settings";
import ErrorBoundary from "../components/ErrorBoundary";
import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin, { OptionType } from "../utils/types";
import { filters } from "../webpack";
import { PresenceStore, Tooltip } from "../webpack/common";
function Icon(path: string, viewBox = "0 0 24 24") {
return ({ color, tooltip }: { color: string; tooltip: string; }) => (
<Tooltip text={tooltip} >
@ -52,7 +50,7 @@ const Icons = {
};
type Platform = keyof typeof Icons;
const getStatusColor = lazyWebpack(filters.byCode("STATUS_YELLOW", "TWITCH", "STATUS_GREY"));
const getStatusColor = findByCodeLazy("STATUS_YELLOW", "TWITCH", "STATUS_GREY");
const PlatformIcon = ({ platform, status }: { platform: Platform, status: string; }) => {
const tooltip = platform[0].toUpperCase() + platform.slice(1);

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Link } from "../../../components/Link";
import { Forms, React } from "../../../webpack/common";
import { Link } from "@components/Link";
import { Forms, React } from "@webpack/common";
export default function PronounsAboutComponent() {
return (

View File

@ -16,16 +16,16 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Settings } from "@api/settings";
import { classes, useAwaiter } from "@utils/misc";
import { findByPropsLazy } from "@webpack";
import { UserStore } from "@webpack/common";
import { Message } from "discord-types/general";
import { classes, lazyWebpack, useAwaiter } from "../../../utils/misc";
import { Settings } from "../../../Vencord";
import { filters } from "../../../webpack";
import { UserStore } from "../../../webpack/common";
import { fetchPronouns, formatPronouns } from "../pronoundbUtils";
import { PronounMapping } from "../types";
const styles: Record<string, string> = lazyWebpack(filters.byProps("timestampInline"));
const styles: Record<string, string> = findByPropsLazy("timestampInline");
export default function PronounsChatComponentWrapper({ message }: { message: Message; }) {
// Don't bother fetching bot or system users

View File

@ -16,9 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { useAwaiter } from "../../../utils/misc";
import { Settings } from "../../../Vencord";
import { UserStore } from "../../../webpack/common";
import { Settings } from "@api/settings";
import { useAwaiter } from "@utils/misc";
import { UserStore } from "@webpack/common";
import { fetchPronouns, formatPronouns } from "../pronoundbUtils";
import { PronounMapping, UserProfilePronounsProps, UserProfileProps } from "../types";

View File

@ -16,8 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../../utils/constants";
import definePlugin, { OptionType } from "../../utils/types";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import PronounsAboutComponent from "./components/PronounsAboutComponent";
import PronounsChatComponent from "./components/PronounsChatComponent";
import PronounsProfileWrapper from "./components/PronounsProfileWrapper";

View File

@ -16,9 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { VENCORD_USER_AGENT } from "../../utils/constants";
import { debounce } from "../../utils/debounce";
import { Settings } from "../../Vencord";
import { Settings } from "@api/settings";
import { VENCORD_USER_AGENT } from "@utils/constants";
import { debounce } from "@utils/debounce";
import { PronounsFormat } from ".";
import { PronounCode, PronounMapping, PronounsResponse } from "./types";

View File

@ -16,11 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin from "../utils/types";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { findLazy } from "@webpack";
const ComponentDispatch = lazyWebpack(m => m.emitter?._events?.INSERT_TEXT);
const ComponentDispatch = findLazy(m => m.emitter?._events?.INSERT_TEXT);
export default definePlugin({
name: "QuickMention",

View File

@ -16,16 +16,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { migratePluginSettings } from "@api/settings";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { findByPropsLazy } from "@webpack";
import { ChannelStore, FluxDispatcher as Dispatcher, MessageStore, SelectedChannelStore, UserStore } from "@webpack/common";
import { Message } from "discord-types/general";
import { migratePluginSettings } from "../api/settings";
import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin from "../utils/types";
import { filters } from "../webpack";
import { ChannelStore, FluxDispatcher as Dispatcher, MessageStore, SelectedChannelStore, UserStore } from "../webpack/common";
const Kangaroo = lazyWebpack(filters.byProps("jumpToMessage"));
const Kangaroo = findByPropsLazy("jumpToMessage");
const isMac = navigator.platform.includes("Mac"); // bruh
let replyIdx = -1;

View File

@ -16,10 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { addServerListElement, removeServerListElement, ServerListRenderPosition } from "../api/ServerList";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { Button, FluxDispatcher, GuildChannelStore, GuildStore, React, ReadStateStore } from "../webpack/common";
import { addServerListElement, removeServerListElement, ServerListRenderPosition } from "@api/ServerList";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { Button, FluxDispatcher, GuildChannelStore, GuildStore, React, ReadStateStore } from "@webpack/common";
function onClick() {
const channels: Array<any> = [];

Some files were not shown because too many files have changed in this diff Show More