From ede507e80c4824981898bbaef7b7c5ad487cb2b7 Mon Sep 17 00:00:00 2001 From: V Date: Wed, 16 Aug 2023 01:55:56 +0200 Subject: [PATCH] chore: update for 'Vencord Desktop' -> 'Vesktop' rebrand --- scripts/build/build.mjs | 12 ++++++------ scripts/build/buildWeb.mjs | 2 +- src/globals.d.ts | 6 +++--- src/main/index.ts | 2 +- src/plugins/_core/settings.tsx | 9 +-------- src/plugins/supportHelper.tsx | 2 +- src/plugins/webContextMenus.web.ts | 6 +++--- src/preload.ts | 2 +- src/utils/native.ts | 4 ++-- 9 files changed, 19 insertions(+), 26 deletions(-) diff --git a/scripts/build/build.mjs b/scripts/build/build.mjs index 59056b10..e044378b 100755 --- a/scripts/build/build.mjs +++ b/scripts/build/build.mjs @@ -58,7 +58,7 @@ await Promise.all([ define: { ...defines, IS_DISCORD_DESKTOP: true, - IS_VENCORD_DESKTOP: false + IS_VESKTOP: false } }), esbuild.build({ @@ -78,7 +78,7 @@ await Promise.all([ ...defines, IS_WEB: false, IS_DISCORD_DESKTOP: true, - IS_VENCORD_DESKTOP: false + IS_VESKTOP: false } }), esbuild.build({ @@ -90,7 +90,7 @@ await Promise.all([ define: { ...defines, IS_DISCORD_DESKTOP: true, - IS_VENCORD_DESKTOP: false + IS_VESKTOP: false } }), @@ -104,7 +104,7 @@ await Promise.all([ define: { ...defines, IS_DISCORD_DESKTOP: false, - IS_VENCORD_DESKTOP: true + IS_VESKTOP: true } }), esbuild.build({ @@ -124,7 +124,7 @@ await Promise.all([ ...defines, IS_WEB: false, IS_DISCORD_DESKTOP: false, - IS_VENCORD_DESKTOP: true + IS_VESKTOP: true } }), esbuild.build({ @@ -136,7 +136,7 @@ await Promise.all([ define: { ...defines, IS_DISCORD_DESKTOP: false, - IS_VENCORD_DESKTOP: true + IS_VESKTOP: true } }), ]).catch(err => { diff --git a/scripts/build/buildWeb.mjs b/scripts/build/buildWeb.mjs index 5c1cc784..434d176a 100644 --- a/scripts/build/buildWeb.mjs +++ b/scripts/build/buildWeb.mjs @@ -45,7 +45,7 @@ const commonOptions = { IS_STANDALONE: "true", IS_DEV: JSON.stringify(watch), IS_DISCORD_DESKTOP: "false", - IS_VENCORD_DESKTOP: "false", + IS_VESKTOP: "false", VERSION: JSON.stringify(VERSION), BUILD_TIMESTAMP: Date.now(), } diff --git a/src/globals.d.ts b/src/globals.d.ts index a1f6efc8..720cd5ef 100644 --- a/src/globals.d.ts +++ b/src/globals.d.ts @@ -36,7 +36,7 @@ declare global { export var IS_DEV: boolean; export var IS_STANDALONE: boolean; export var IS_DISCORD_DESKTOP: boolean; - export var IS_VENCORD_DESKTOP: boolean; + export var IS_VESKTOP: boolean; export var VERSION: string; export var BUILD_TIMESTAMP: number; @@ -58,8 +58,8 @@ declare global { * If you really must use it, mark your plugin as Desktop App only by naming it Foo.desktop.ts(x) */ export var DiscordNative: any; - export var VencordDesktop: any; - export var VencordDesktopNative: any; + export var Vesktop: any; + export var VesktopNative: any; interface Window { webpackChunkdiscord_app: { diff --git a/src/main/index.ts b/src/main/index.ts index 2e1a10e4..d1b7c5d9 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -23,7 +23,7 @@ import { ensureSafePath, getSettings } from "./ipcMain"; import { IS_VANILLA, THEMES_DIR } from "./utils/constants"; import { installExt } from "./utils/extensions"; -if (IS_VENCORD_DESKTOP || !IS_VANILLA) { +if (IS_VESKTOP || !IS_VANILLA) { app.whenReady().then(() => { // Source Maps! Maybe there's a better way but since the renderer is executed // from a string I don't think any other form of sourcemaps would work diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx index ce970fdd..e5f710cb 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -127,13 +127,6 @@ export default definePlugin({ element: require("@components/VencordSettings/PatchHelperTab").default, className: "vc-patch-helper" }, - // TODO: make this use customSections - IS_VENCORD_DESKTOP && { - section: "VencordDesktop", - label: "Desktop Settings", - element: VencordDesktop.Components.Settings, - className: "vc-desktop-settings" - }, ...this.customSections.map(func => func(ID)), { section: ID.DIVIDER @@ -175,7 +168,7 @@ export default definePlugin({ get additionalInfo() { if (IS_DEV) return " (Dev)"; if (IS_WEB) return " (Web)"; - if (IS_VENCORD_DESKTOP) return ` (VencordDesktop v${VencordDesktopNative.app.getVersion()})`; + if (IS_VESKTOP) return ` (Vesktop v${VesktopNative.app.getVersion()})`; if (IS_STANDALONE) return " (Standalone)"; return ""; }, diff --git a/src/plugins/supportHelper.tsx b/src/plugins/supportHelper.tsx index a90c13c5..4691c0e0 100644 --- a/src/plugins/supportHelper.tsx +++ b/src/plugins/supportHelper.tsx @@ -53,7 +53,7 @@ export default definePlugin({ const client = (() => { if (IS_DISCORD_DESKTOP) return `Discord Desktop v${DiscordNative.app.getVersion()}`; - if (IS_VENCORD_DESKTOP) return `Vencord Desktop v${VencordDesktopNative.app.getVersion()}`; + if (IS_VESKTOP) return `Vesktop v${VesktopNative.app.getVersion()}`; if ("armcord" in window) return `ArmCord v${window.armcord.version}`; // @ts-expect-error diff --git a/src/plugins/webContextMenus.web.ts b/src/plugins/webContextMenus.web.ts index ca295408..4cdbcd98 100644 --- a/src/plugins/webContextMenus.web.ts +++ b/src/plugins/webContextMenus.web.ts @@ -39,8 +39,8 @@ const settings = definePluginSettings({ type: OptionType.BOOLEAN, description: "Add back the Discord context menus for images, links and the chat input bar", // Web slate menu has proper spellcheck suggestions and image context menu is also pretty good, - // so disable this by default. Vencord Desktop just doesn't, so enable by default - default: IS_VENCORD_DESKTOP, + // so disable this by default. Vesktop just doesn't, so enable by default + default: IS_VESKTOP, restartNeeded: true } }); @@ -50,7 +50,7 @@ export default definePlugin({ description: "Re-adds context menus missing in the web version of Discord: Links & Images (Copy/Open Link/Image), Text Area (Copy, Cut, Paste, SpellCheck)", authors: [Devs.Ven], enabledByDefault: true, - required: IS_VENCORD_DESKTOP, + required: IS_VESKTOP, settings, diff --git a/src/preload.ts b/src/preload.ts index 2beaf399..08243000 100644 --- a/src/preload.ts +++ b/src/preload.ts @@ -28,7 +28,7 @@ contextBridge.exposeInMainWorld("VencordNative", VencordNative); // Discord if (location.protocol !== "data:") { // #region cssInsert - const rendererCss = join(__dirname, IS_VENCORD_DESKTOP ? "vencordDesktopRenderer.css" : "renderer.css"); + const rendererCss = join(__dirname, IS_VESKTOP ? "vencordDesktopRenderer.css" : "renderer.css"); const style = document.createElement("style"); style.id = "vencord-css-core"; diff --git a/src/utils/native.ts b/src/utils/native.ts index 1d29d409..d84ed16f 100644 --- a/src/utils/native.ts +++ b/src/utils/native.ts @@ -20,12 +20,12 @@ export function relaunch() { if (IS_DISCORD_DESKTOP) window.DiscordNative.app.relaunch(); else - window.VencordDesktopNative.app.relaunch(); + window.VesktopNative.app.relaunch(); } export function showItemInFolder(path: string) { if (IS_DISCORD_DESKTOP) window.DiscordNative.fileManager.showItemInFolder(path); else - window.VencordDesktopNative.fileManager.showItemInFolder(path); + window.VesktopNative.fileManager.showItemInFolder(path); }