From ea8c134159588d0fb697e905db3eedb7b392977b Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sat, 13 Jul 2024 00:06:01 -0400 Subject: [PATCH] Some porting --- .gitignore | 1 + browser/VencordNativeStub.ts | 6 +- browser/userscript.meta.js | 10 ++-- scripts/build/common.mjs | 6 +- scripts/generateReport.ts | 4 +- scripts/runInstaller.mjs | 20 +++---- src/Vencord.ts | 2 +- src/api/Notices.ts | 2 +- src/components/PluginSettings/PluginModal.tsx | 6 +- src/components/PluginSettings/index.tsx | 4 +- src/components/VencordSettings/CloudTab.tsx | 2 +- .../VencordSettings/NotificationSettings.tsx | 4 +- src/components/VencordSettings/VencordTab.tsx | 6 +- src/equicordplugins/customAppIcons/index.tsx | 13 ++--- .../discordColorways/style.css | 8 +-- .../equicordCSS/css/main.min.css | 56 +++++++++---------- src/equicordplugins/keyboardSounds/index.ts | 25 +++++++-- src/main/index.ts | 4 +- src/main/patchWin32Updater.ts | 4 +- src/main/patcher.ts | 6 +- src/plugins/_api/notices.ts | 2 +- src/plugins/_core/settings.tsx | 14 ++--- src/plugins/moyai/index.ts | 4 +- src/utils/Logger.ts | 2 +- 24 files changed, 111 insertions(+), 100 deletions(-) diff --git a/.gitignore b/.gitignore index 135673a6..d6faa642 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ node_modules *.exe vencord_installer +equicord_installer .idea .DS_Store diff --git a/browser/VencordNativeStub.ts b/browser/VencordNativeStub.ts index d2d43523..71a9dd08 100644 --- a/browser/VencordNativeStub.ts +++ b/browser/VencordNativeStub.ts @@ -37,7 +37,7 @@ const NOOP_ASYNC = async () => { }; const setCssDebounced = debounce((css: string) => VencordNative.quickCss.set(css)); -const themeStore = DataStore.createStore("VencordThemes", "VencordThemeData"); +const themeStore = DataStore.createStore("EquicordThemes", "VencordThemeData"); // probably should make this less cursed at some point window.VencordNative = { @@ -98,13 +98,13 @@ window.VencordNative = { settings: { get: () => { try { - return JSON.parse(localStorage.getItem("VencordSettings") || "{}"); + return JSON.parse(localStorage.getItem("EquicordSettings") || "{}"); } catch (e) { console.error("Failed to parse settings from localStorage: ", e); return {}; } }, - set: async (s: Settings) => localStorage.setItem("VencordSettings", JSON.stringify(s)), + set: async (s: Settings) => localStorage.setItem("EquicordSettings", JSON.stringify(s)), getSettingsDir: async () => "LocalStorage" }, diff --git a/browser/userscript.meta.js b/browser/userscript.meta.js index 5b2a39be..7a8f22bd 100644 --- a/browser/userscript.meta.js +++ b/browser/userscript.meta.js @@ -1,10 +1,10 @@ // ==UserScript== -// @name Vencord +// @name Equicord // @description A Discord client mod - Web version // @version %version% -// @author Vendicated (https://github.com/Vendicated) -// @namespace https://github.com/Vendicated/Vencord -// @supportURL https://github.com/Vendicated/Vencord +// @author Equicord (https://github.com/Equicord) +// @namespace https://github.com/Equicord/Equicord +// @supportURL https://github.com/Equicord/Equicord // @license GPL-3.0 // @match *://*.discord.com/* // @grant GM_xmlhttpRequest @@ -21,4 +21,4 @@ // to overwrite stuff on the window on sites that use CSP. Use Tampermonkey or use a chromium based browser // https://github.com/violentmonkey/violentmonkey/issues/997 -// this is a compiled and minified version of Vencord. For the source code, visit the GitHub repo +// this is a compiled and minified version of Equicord. For the source code, visit the GitHub repo diff --git a/scripts/build/common.mjs b/scripts/build/common.mjs index 989b82ad..7c4cd6e3 100644 --- a/scripts/build/common.mjs +++ b/scripts/build/common.mjs @@ -42,11 +42,11 @@ export const IS_REPORTER = process.argv.includes("--reporter"); export const IS_STANDALONE = process.argv.includes("--standalone"); export const IS_UPDATER_DISABLED = process.argv.includes("--disable-updater"); -export const gitHash = process.env.VENCORD_HASH || execSync("git rev-parse --short HEAD", { encoding: "utf-8" }).trim(); +export const gitHash = process.env.EQUICORD_HASH || execSync("git rev-parse --short HEAD", { encoding: "utf-8" }).trim(); export const banner = { js: ` -// Vencord ${gitHash} +// Equicord ${gitHash} // Standalone: ${IS_STANDALONE} // Platform: ${IS_STANDALONE === false ? process.platform : "Universal"} // Updater Disabled: ${IS_UPDATER_DISABLED} @@ -191,7 +191,7 @@ export const gitRemotePlugin = { namespace: "git-remote", path: args.path })); build.onLoad({ filter, namespace: "git-remote" }, async () => { - let remote = process.env.VENCORD_REMOTE; + let remote = process.env.EQUICORD_REMOTE; if (!remote) { const res = await promisify(exec)("git remote get-url origin", { encoding: "utf-8" }); remote = res.stdout.trim() diff --git a/scripts/generateReport.ts b/scripts/generateReport.ts index aecf6a49..2639d29d 100644 --- a/scripts/generateReport.ts +++ b/scripts/generateReport.ts @@ -199,11 +199,11 @@ page.on("console", async e => { const firstArg = await rawArgs[0]?.jsonValue(); - const isVencord = firstArg === "[Vencord]"; + const isEquicord = firstArg === "[Equicord]"; const isDebug = firstArg === "[PUP_DEBUG]"; outer: - if (isVencord) { + if (isEquicord) { try { var args = await Promise.all(e.args().map(a => a.jsonValue())); } catch { diff --git a/scripts/runInstaller.mjs b/scripts/runInstaller.mjs index 3ba98565..ab4ac78b 100644 --- a/scripts/runInstaller.mjs +++ b/scripts/runInstaller.mjs @@ -25,8 +25,8 @@ import { Readable } from "stream"; import { finished } from "stream/promises"; import { fileURLToPath } from "url"; -const BASE_URL = "https://github.com/Vencord/Installer/releases/latest/download/"; -const INSTALLER_PATH_DARWIN = "VencordInstaller.app/Contents/MacOS/VencordInstaller"; +const BASE_URL = "https://github.com/Equicord/Installer/releases/latest/download/"; +const INSTALLER_PATH_DARWIN = "EquicordInstaller.app/Contents/MacOS/EquicordInstaller"; const BASE_DIR = join(dirname(fileURLToPath(import.meta.url)), ".."); const FILE_DIR = join(BASE_DIR, "dist", "Installer"); @@ -35,11 +35,11 @@ const ETAG_FILE = join(FILE_DIR, "etag.txt"); function getFilename() { switch (process.platform) { case "win32": - return "VencordInstallerCli.exe"; + return "EquicordInstallerCli.exe"; case "darwin": - return "VencordInstaller.MacOS.zip"; + return "EquicordInstaller.MacOS.zip"; case "linux": - return "VencordInstaller-linux"; + return "EquicordInstaller-linux"; default: throw new Error("Unsupported platform: " + process.platform); } @@ -53,7 +53,7 @@ async function ensureBinary() { const downloadName = join(FILE_DIR, filename); const outputFile = process.platform === "darwin" - ? join(FILE_DIR, "VencordInstaller") + ? join(FILE_DIR, "EquicordInstaller") : downloadName; const etag = existsSync(outputFile) && existsSync(ETAG_FILE) @@ -62,7 +62,7 @@ async function ensureBinary() { const res = await fetch(BASE_URL + filename, { headers: { - "User-Agent": "Vencord (https://github.com/Vendicated/Vencord)", + "User-Agent": "Equicord (https://github.com/Equicord/Equicord)", "If-None-Match": etag } }); @@ -96,7 +96,7 @@ async function ensureBinary() { execSync(cmd); } catch { } }; - logAndRun(`sudo spctl --add '${outputFile}' --label "Vencord Installer"`); + logAndRun(`sudo spctl --add '${outputFile}' --label "Equicord Installer"`); logAndRun(`sudo xattr -d com.apple.quarantine '${outputFile}'`); } else { // WHY DOES NODE FETCH RETURN A WEB STREAM OH MY GOD @@ -123,8 +123,8 @@ try { stdio: "inherit", env: { ...process.env, - VENCORD_USER_DATA_DIR: BASE_DIR, - VENCORD_DEV_INSTALL: "1" + EQUICORD_USER_DATA_DIR: BASE_DIR, + EQUICORD_DEV_INSTALL: "1" } }); } catch { diff --git a/src/Vencord.ts b/src/Vencord.ts index 1fc33cb6..1acbe004 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -58,7 +58,7 @@ async function syncSettings() { body: "We've noticed you have cloud integrations enabled in another client! Due to limitations, you will " + "need to re-authenticate to continue using them. Click here to go to the settings page to do so!", color: "var(--yellow-360)", - onClick: () => SettingsRouter.open("VencordCloud") + onClick: () => SettingsRouter.open("EquicordCloud") }); return; } diff --git a/src/api/Notices.ts b/src/api/Notices.ts index 6d20087a..cd5d5876 100644 --- a/src/api/Notices.ts +++ b/src/api/Notices.ts @@ -32,7 +32,7 @@ export function nextNotice() { currentNotice = noticesQueue.shift(); if (currentNotice) { - NoticesModule.show(...currentNotice, "VencordNotice"); + NoticesModule.show(...currentNotice, "EquicordNotice"); } } diff --git a/src/components/PluginSettings/PluginModal.tsx b/src/components/PluginSettings/PluginModal.tsx index 8b14283b..515fa3ec 100644 --- a/src/components/PluginSettings/PluginModal.tsx +++ b/src/components/PluginSettings/PluginModal.tsx @@ -46,7 +46,7 @@ import { SettingTextComponent } from "./components"; import { openContributorModal } from "./ContributorModal"; -import { GithubButton, WebsiteButton } from "./LinkIconButton"; +import { GithubButton } from "./LinkIconButton"; const cl = classNameFactory("vc-plugin-modal-"); @@ -226,10 +226,6 @@ export default function PluginModal({ plugin, onRestartNeeded, onClose, transiti {plugin.description} {!pluginMeta.userPlugin && (
- settings.plugins[d].enabled)); requiredPlugins.push( diff --git a/src/components/VencordSettings/CloudTab.tsx b/src/components/VencordSettings/CloudTab.tsx index e0ff46f0..bf84c242 100644 --- a/src/components/VencordSettings/CloudTab.tsx +++ b/src/components/VencordSettings/CloudTab.tsx @@ -123,7 +123,7 @@ function CloudTab() { - Vencord comes with a cloud integration that adds goodies like settings sync across devices. + Equicord comes with the Vencord cloud integration that adds goodies like settings sync across devices. It respects your privacy, and the source code is AGPL 3.0 licensed so you can host it yourself. diff --git a/src/components/VencordSettings/NotificationSettings.tsx b/src/components/VencordSettings/NotificationSettings.tsx index c0fb393b..5b35dd4c 100644 --- a/src/components/VencordSettings/NotificationSettings.tsx +++ b/src/components/VencordSettings/NotificationSettings.tsx @@ -27,7 +27,7 @@ export function NotificationSettings() { Some plugins may show you notifications. These come in two styles:
    -
  • Vencord Notifications: These are in-app notifications
  • +
  • Equicord Notifications: These are in-app notifications
  • Desktop Notifications: Native Desktop notifications (like when you get a ping)
@@ -36,7 +36,7 @@ export function NotificationSettings() { options={[ { label: "Only use Desktop notifications when Discord is not focused", value: "not-focused", default: true }, { label: "Always use Desktop notifications", value: "always" }, - { label: "Always use Vencord notifications", value: "never" }, + { label: "Always use Equicord notifications", value: "never" }, ] satisfies Array<{ value: typeof settings["useNative"]; } & Record>} closeOnSelect={true} select={v => settings.useNative = v} diff --git a/src/components/VencordSettings/VencordTab.tsx b/src/components/VencordSettings/VencordTab.tsx index 25ac9ab3..46b7f852 100644 --- a/src/components/VencordSettings/VencordTab.tsx +++ b/src/components/VencordSettings/VencordTab.tsx @@ -43,7 +43,7 @@ type KeysOfType = { }[keyof Object]; -function VencordSettings() { +function EquicordSettings() { const [settingsDir, , settingsDirPending] = useAwaiter(VencordNative.settings.getSettingsDir, { fallbackValue: "Loading..." }); @@ -225,7 +225,7 @@ function VencordSettings() { serialize={identity} /> } - +