diff --git a/scripts/utils.ts b/scripts/utils.ts index 1c5e3af22..5f492eba5 100644 --- a/scripts/utils.ts +++ b/scripts/utils.ts @@ -23,6 +23,7 @@ import { normalize as posixNormalize, sep as posixSep } from "path/posix"; import { BigIntLiteral, createSourceFile, Identifier, isArrayLiteralExpression, isCallExpression, isExportAssignment, isIdentifier, isObjectLiteralExpression, isPropertyAccessExpression, isPropertyAssignment, isSatisfiesExpression, isStringLiteral, isVariableStatement, NamedDeclaration, NodeArray, ObjectLiteralExpression, PropertyAssignment, ScriptTarget, StringLiteral, SyntaxKind } from "typescript"; import { getPluginTarget } from "./utils.mjs"; +import { PluginTarget, PluginTargets } from "@utils/pluginTargets"; export interface Dev { name: string; @@ -46,7 +47,7 @@ export interface PluginData { commands: Command[]; required: boolean; enabledByDefault: boolean; - target: "discordDesktop" | "vesktop" | "equibop" | "desktop" | "web" | "browser" | "dev"; + target?: PluginTarget; filePath: string; dirName: string; isModified: boolean; @@ -235,7 +236,7 @@ export async function parseFile(fileName: string) { const target = getPluginTarget(fileName); if (target) { - if (!["web", "browser", "discordDesktop", "vesktop", "equibop", "desktop", "dev"].includes(target)) throw fail(`invalid target ${target}`); + if (!PluginTargets.includes(target as PluginTarget)) throw fail(`invalid target ${target}`); data.target = target as any; } diff --git a/src/plugins/_api/memberListDecorators/index.tsx b/src/plugins/_api/memberListDecorators/index.tsx index 65e2b24c3..5d5921021 100644 --- a/src/plugins/_api/memberListDecorators/index.tsx +++ b/src/plugins/_api/memberListDecorators/index.tsx @@ -45,19 +45,5 @@ export default definePlugin({ replace: "decorators:[Vencord.Api.MemberListDecorators.__getDecorators(arguments[0],'dm'),$1]" } }, - // fix discords styling for now - { - find: '"AvatarWithText"', - replacement: [ - { - match: /(?<=className:.{0,10}),\{.{0,10}\}\)(?=,children:)/, - replace: ')+" vc-member-list-decorators-display-names"' - }, - { - match: /(?<=className:\i\.\i)(?=,children:\i\}\))/, - replace: '+" vc-member-list-decorators-display-names"' - } - ] - } ] }); diff --git a/src/utils/pluginTargets.ts b/src/utils/pluginTargets.ts index 863aa901c..5c0df2f7b 100644 --- a/src/utils/pluginTargets.ts +++ b/src/utils/pluginTargets.ts @@ -4,5 +4,5 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -export const PluginTargets = ["web", "browser", "discordDesktop", "vesktop", "desktop", "dev"] as const; +export const PluginTargets = ["web", "browser", "discordDesktop", "vesktop", "equibop", "desktop", "dev"] as const; export type PluginTarget = typeof PluginTargets[number];