Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
thororen1234 2025-04-04 21:29:28 -04:00
commit aca48cb9e5
No known key found for this signature in database
29 changed files with 227 additions and 197 deletions

View file

@ -191,8 +191,8 @@ const buildConfigs = ([
globalName: "Vencord",
sourcemap,
plugins: [
globPlugins("equicordDesktop"),
...commonOpts.plugins
globPlugins("equibop"),
...commonRendererPlugins
],
define: {
...defines,

View file

@ -132,7 +132,7 @@ export const makeAllPackagesExternalPlugin = {
};
/**
* @type {(kind: "web" | "discordDesktop" | "vencordDesktop" | "equicordDesktop") => import("esbuild").Plugin}
* @type {(kind: "web" | "discordDesktop" | "vesktop" | "equibop") => import("esbuild").Plugin}
*/
export const globPlugins = kind => ({
name: "glob-plugins",
@ -171,8 +171,8 @@ export const globPlugins = kind => ({
(target === "web" && kind === "discordDesktop") ||
(target === "desktop" && kind === "web") ||
(target === "discordDesktop" && kind !== "discordDesktop") ||
(target === "vencordDesktop" && kind !== "vencordDesktop" && kind !== "equicordDesktop") ||
(target === "equicordDesktop" && kind !== "equicordDesktop" && kind !== "vencordDesktop");
(target === "vesktop" && kind !== "vesktop" && kind !== "equibop") ||
(target === "equibop" && kind !== "equibop" && kind !== "vesktop");
if (excluded) {
const name = await resolvePluginName(fullDir, file);
@ -358,10 +358,6 @@ export const commonOpts = {
jsxFragment: "VencordFragment"
};
const escapedBuiltinModules = builtinModules
.map(m => m.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"))
.join("|");
export const commonRendererPlugins = [
banImportPlugin(/^react$/, "Cannot import from react. React and hooks should be imported from @webpack/common"),
banImportPlugin(/^electron(\/.*)?$/, "Cannot import electron in browser code. You need to use a native.ts file"),

View file

@ -45,7 +45,7 @@ interface PluginData {
commands: Command[];
required: boolean;
enabledByDefault: boolean;
target: "discordDesktop" | "vencordDesktop" | "equicordDesktop" | "desktop" | "web" | "dev";
target: "discordDesktop" | "vesktop" | "equibop" | "desktop" | "web" | "dev";
filePath: string;
}
@ -215,7 +215,7 @@ async function parseFile(fileName: string) {
const target = getPluginTarget(fileName);
if (target) {
if (!["web", "discordDesktop", "vencordDesktop", "equicordDesktop", "desktop", "dev"].includes(target)) throw fail(`invalid target ${target}`);
if (!["web", "discordDesktop", "vesktop", "equibop", "desktop", "dev"].includes(target)) throw fail(`invalid target ${target}`);
data.target = target as any;
}