use oxc instead of prettier & eslint

This commit is contained in:
Vendicated committed 2026-10-30 19:57:06 +01:00
1 parent b5c812211f
commit a7a0e5d5c3
64 files changed
+756 -2558

No files matched your search

+9 -9
View File
@@ -1,11 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: 💬 Discord Community
url: https://discord.gg/D9uwnFnqmd
about: For plugin requests, support questions, and general help - join our Discord server
- name: 🔌 Plugin Requests
url: https://discord.gg/D9uwnFnqmd
about: Want a new plugin? Request it in our Discord community, not here
- name: ❓ Support & Questions
url: https://discord.gg/D9uwnFnqmd
about: Need help? Ask in our Discord server for faster responses
- name: 💬 Discord Community
url: https://discord.gg/D9uwnFnqmd
about: For plugin requests, support questions, and general help - join our Discord server
- name: 🔌 Plugin Requests
url: https://discord.gg/D9uwnFnqmd
about: Want a new plugin? Request it in our Discord community, not here
- name: ❓ Support & Questions
url: https://discord.gg/D9uwnFnqmd
about: Need help? Ask in our Discord server for faster responses
+7 -7
View File
@@ -7,9 +7,9 @@ body:
- type: markdown
attributes:
value: |
This form is not for any of the following:
- Plugin requests — Go to our [Discord server](https://discord.gg/D9uwnFnqmd) for that
- Feature requests for plugins — Go to our [Discord server](https://discord.gg/D9uwnFnqmd) for that
This form is not for any of the following:
- Plugin requests — Go to our [Discord server](https://discord.gg/D9uwnFnqmd) for that
- Feature requests for plugins — Go to our [Discord server](https://discord.gg/D9uwnFnqmd) for that
- type: textarea
id: feature-description
@@ -39,7 +39,7 @@ body:
attributes:
label: Request Agreement
options:
- label: I've searched existing issues and this hasn't been suggested before
- label: This is a **core modification feature**, not a plugin request (those go in Discord)
- label: This feature would benefit most users, not just a specific use case
- label: I am willing to work on this myself
- label: I've searched existing issues and this hasn't been suggested before
- label: This is a **core modification feature**, not a plugin request (those go in Discord)
- label: This feature would benefit most users, not just a specific use case
- label: I am willing to work on this myself
+2
View File
@@ -8,5 +8,7 @@ Also do not use AI in communication, it makes me ill
## Screenshots (if applicable)
## Checklist before submitting
<!-- Hint: [x] this is how to check boxes -->
- [ ] This pull request was written by me, and not an AI agent
+43 -43
View File
@@ -1,43 +1,43 @@
name: Upload release metainfo
on:
workflow_dispatch:
permissions:
contents: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Get latest tag
id: latest_tag
run: |
tag=$(git tag --sort=-creatordate | head -n1)
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- name: Setup Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- name: Install dependencies
run: pnpm i
- name: Update metainfo
run: pnpm generateMeta
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload metainfo to release
run: |
gh release upload "${{ steps.latest_tag.outputs.tag }}" dist/dev.vencord.Vesktop.metainfo.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Upload release metainfo
on:
workflow_dispatch:
permissions:
contents: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Get latest tag
id: latest_tag
run: |
tag=$(git tag --sort=-creatordate | head -n1)
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- name: Setup Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- name: Install dependencies
run: pnpm i
- name: Update metainfo
run: pnpm generateMeta
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload metainfo to release
run: |
gh release upload "${{ steps.latest_tag.outputs.tag }}" dist/dev.vencord.Vesktop.metainfo.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
cd repo
version="${{ github.event.release.tag_name }}"
echo "${version#v}" > scripts/_latestVesktopVersion.txt
git add scripts/_latestVesktopVersion.txt
git commit -m "Update Vesktop version to ${{ github.event.release.tag_name }}"
git push https://$USERNAME:[email protected]/$GH_REPO.git
+20 -20
View File
@@ -1,25 +1,25 @@
name: Submit to Winget Community Repo
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
type: string
description: The release tag to submit
required: true
release:
types: [published]
workflow_dispatch:
inputs:
tag:
type: string
description: The release tag to submit
required: true
jobs:
winget:
name: Publish winget package
runs-on: windows-latest
steps:
- name: Submit package to Winget Community Repo
uses: vedantmgoyal2009/winget-releaser@0db4f0a478166abd0fa438c631849f0b8dcfb99f
with:
identifier: Vencord.Vesktop
token: ${{ secrets.WINGET_PAT }}
installers-regex: '\.exe$'
release-tag: ${{ inputs.tag || github.event.release.tag_name }}
fork-user: shiggybot
winget:
name: Publish winget package
runs-on: windows-latest
steps:
- name: Submit package to Winget Community Repo
uses: vedantmgoyal2009/winget-releaser@0db4f0a478166abd0fa438c631849f0b8dcfb99f
with:
identifier: Vencord.Vesktop
token: ${{ secrets.WINGET_PAT }}
installers-regex: '\.exe$'
release-tag: ${{ inputs.tag || github.event.release.tag_name }}
fork-user: shiggybot
+13
View File
@@ -0,0 +1,13 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"tabWidth": 4,
"semi": true,
"printWidth": 120,
"trailingComma": "none",
"bracketSpacing": true,
"arrowParens": "avoid",
"useTabs": false,
"endOfLine": "lf",
"sortImports": true,
"sortPackageJson": false
}
+70
View File
@@ -0,0 +1,70 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react"],
"jsPlugins": [{ "name": "simple-header-js", "specifier": "eslint-plugin-simple-header" }],
"settings": {
"react": {
"version": "19"
}
},
"ignorePatterns": ["dist"],
"overrides": [
{
"files": ["src/**/*.{tsx,ts,mts,mjs,js,jsx}"],
"rules": {
"react/react-in-jsx-scope": "off",
"react/display-name": "off",
"react/no-unescaped-entities": "off",
"react/immutability": "off",
"simple-header-js/header": [
"error",
{
"files": ["scripts/header.txt"],
"templates": { "author": [".*", "Vendicated and Vesktop contributors"] }
}
],
"yoda": "error",
"eqeqeq": ["error", "always", { "null": "ignore" }],
"prefer-destructuring": [
"error",
{
"VariableDeclarator": { "array": false, "object": true },
"AssignmentExpression": { "array": false, "object": false }
}
],
"operator-assignment": ["error", "always"],
"no-useless-computed-key": "error",
"no-unneeded-ternary": ["error", { "defaultAssignment": false }],
"no-invalid-regexp": "error",
"no-constant-condition": ["error", { "checkLoops": false }],
"no-duplicate-imports": "error",
"typescript/dot-notation": [
"error",
{
"allowPrivateClassPropertyAccess": true,
"allowProtectedClassPropertyAccess": true
}
],
"no-useless-escape": ["error", { "allowRegexCharacters": ["i"] }],
"no-fallthrough": "error",
"for-direction": "error",
"no-async-promise-executor": "error",
"no-cond-assign": "error",
"no-dupe-else-if": "error",
"no-duplicate-case": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-prototype-builtins": "error",
"no-regex-spaces": "error",
"no-shadow-restricted-names": "error",
"no-unexpected-multiline": "error",
"no-unsafe-optional-chaining": "error",
"no-useless-backreference": "error",
"use-isnan": "error",
"prefer-const": ["error", { "destructuring": "all" }],
"prefer-spread": "error"
}
}
]
}
-8
View File
@@ -1,8 +0,0 @@
tabWidth: 4
semi: true
printWidth: 120
trailingComma: none
bracketSpacing: true
arrowParens: avoid
useTabs: false
endOfLine: lf
+1 -1
View File
@@ -1,3 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
"recommendations": ["oxc.oxc-vscode"]
}
+25 -25
View File
@@ -1,25 +1,25 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"cSpell.words": ["Vesktop"]
}
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.oxc": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[json]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"cSpell.words": ["Vesktop"]
}
+5 -1
View File
@@ -3,12 +3,14 @@
Vesktop is a custom Discord desktop app
**Main features**:
- Vencord preinstalled
- Much more lightweight and faster than the official Discord app
- Linux Screenshare with sound & wayland
- Much better privacy, since Discord has no access to your system
**Not yet supported**:
- Global Keybinds
- see the [Roadmap](https://github.com/Vencord/Vesktop/issues/324)
@@ -22,6 +24,7 @@ Visit https://vesktop.dev/install
## Building from Source
You need to have the following dependencies installed:
- [Git](https://git-scm.com/downloads)
- [Node.js](https://nodejs.org/en/download)
- pnpm: `npm install --global pnpm`
@@ -53,8 +56,9 @@ pnpm package:dir
This is a small C++ helper library Vesktop uses on Linux to emit D-Bus events. By default, prebuilt binaries for x64 and arm64 are used.
If you want to build it from source:
1. Install build dependencies:
- Debian/Ubuntu: `apt install build-essential python3 curl pkg-config libglib2.0-dev`
- Fedora: `dnf install @c-development @development-tools python3 curl pkgconf-pkg-config glib2-devel`
2. Run `pnpm buildLibVesktop`
3. From now on, building Vesktop will use your own build
3. From now on, building Vesktop will use your own build
-132
View File
@@ -1,132 +0,0 @@
/*
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
//@ts-check
import { defineConfig } from "eslint/config";
import stylistic from "@stylistic/eslint-plugin";
import pathAlias from "eslint-plugin-path-alias";
import react from "eslint-plugin-react";
import simpleHeader from "eslint-plugin-simple-header";
import importSort from "eslint-plugin-simple-import-sort";
import unusedImports from "eslint-plugin-unused-imports";
import tseslint from "typescript-eslint";
import prettier from "eslint-plugin-prettier";
export default defineConfig(
{ ignores: ["dist"] },
{
files: ["src/**/*.{tsx,ts,mts,mjs,js,jsx}"],
settings: {
react: {
version: "19"
}
},
...react.configs.flat.recommended,
rules: {
...react.configs.flat.recommended.rules,
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"react/display-name": "off",
"react/no-unescaped-entities": "off"
}
},
{
files: ["src/**/*.{tsx,ts,mts,mjs,js,jsx}"],
plugins: {
simpleHeader,
stylistic,
importSort,
unusedImports,
// @ts-expect-error Missing types
pathAlias,
prettier,
"@typescript-eslint": tseslint.plugin
},
settings: {
"import/resolver": {
alias: {
map: []
}
}
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname
}
},
rules: {
"simpleHeader/header": [
"error",
{
files: ["scripts/header.txt"],
templates: { author: [".*", "Vendicated and Vesktop contributors"] }
}
],
// ESLint Rules
yoda: "error",
eqeqeq: ["error", "always", { null: "ignore" }],
"prefer-destructuring": [
"error",
{
VariableDeclarator: { array: false, object: true },
AssignmentExpression: { array: false, object: false }
}
],
"operator-assignment": ["error", "always"],
"no-useless-computed-key": "error",
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
"no-invalid-regexp": "error",
"no-constant-condition": ["error", { checkLoops: false }],
"no-duplicate-imports": "error",
"@typescript-eslint/dot-notation": [
"error",
{
allowPrivateClassPropertyAccess: true,
allowProtectedClassPropertyAccess: true
}
],
"no-useless-escape": [
"error",
{
allowRegexCharacters: ["i"]
}
],
"no-fallthrough": "error",
"for-direction": "error",
"no-async-promise-executor": "error",
"no-cond-assign": "error",
"no-dupe-else-if": "error",
"no-duplicate-case": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-prototype-builtins": "error",
"no-regex-spaces": "error",
"no-shadow-restricted-names": "error",
"no-unexpected-multiline": "error",
"no-unsafe-optional-chaining": "error",
"no-useless-backreference": "error",
"use-isnan": "error",
"prefer-const": ["error", { destructuring: "all" }],
"prefer-spread": "error",
// Styling Rules
"stylistic/spaced-comment": ["error", "always", { markers: ["!"] }],
"stylistic/no-extra-semi": "error",
// Plugin Rules
"importSort/imports": "error",
"importSort/exports": "error",
"unusedImports/no-unused-imports": "error",
// "pathAlias/no-relative": "error",
"prettier/prettier": "error"
}
}
);
+5 -11
View File
@@ -14,8 +14,10 @@
"buildLibVesktop": "pnpm -C packages/libvesktop install && pnpm -C packages/libvesktop run build",
"package": "pnpm build && electron-builder",
"package:dir": "pnpm build && electron-builder --dir",
"lint": "eslint",
"lint": "oxlint src",
"lint:fix": "pnpm lint --fix",
"format": "oxfmt",
"format:check": "oxfmt --check",
"start": "pnpm build && electron .",
"start:dev": "pnpm build:dev && electron .",
"start:watch": "pnpm build:dev && tsx scripts/startWatch.mts",
@@ -33,7 +35,6 @@
},
"devDependencies": {
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
"@stylistic/eslint-plugin": "^5.10.0",
"@types/node": "^26.6.5",
"@types/react": "19.2.9",
"@vencord/types": "^1.15.14",
@@ -41,21 +42,14 @@
"electron": "45.1.0",
"electron-builder": "^26.18.0",
"esbuild": "^0.28.2",
"eslint": "^10.13.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-path-alias": "^2.1.0",
"eslint-plugin-prettier": "^5.5.7",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-simple-header": "^1.2.2",
"eslint-plugin-simple-import-sort": "^14.0.0",
"eslint-plugin-unused-imports": "^4.4.1",
"libvesktop": "link:packages/libvesktop",
"prettier": "^3.9.10",
"oxfmt": "^0.74.0",
"oxlint": "^1.89.0",
"source-map-support": "^0.5.21",
"tsx": "^4.23.15",
"type-fest": "^5.10.0",
"typescript": "^6.0.3",
"typescript-eslint": "^8.72.0",
"xml-formatter": "^3.6.7"
},
"packageManager": "[email protected]",
+450 -2220
View File
File diff suppressed because it is too large. Load diff
+8 -8
View File
@@ -1,16 +1,16 @@
patchedDependencies:
electron-updater: patches/electron-updater.patch
electron-updater: patches/electron-updater.patch
nodeLinker: hoisted
allowBuilds:
"@vencord/venmic": true
electron: true
electron-winstaller: false
esbuild: true
"@vencord/venmic": true
electron: true
electron-winstaller: false
esbuild: true
pmOnFail: warn
verifyDepsBeforeRun: warn
recursiveInstall: false
packages:
- packages/*
- packages/*
minimumReleaseAgeExclude:
- electron
- '@vencord/*'
- electron
- "@vencord/*"
+3 -2
View File
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { BuildContext, BuildOptions, context } from "esbuild";
import { copyFile } from "fs/promises";
import vencordDep from "./vencordDep.mjs";
import { BuildContext, BuildOptions, context } from "esbuild";
import { includeDirPlugin } from "./includeDirPlugin.mts";
import vencordDep from "./vencordDep.mjs";
const isDev = process.argv.includes("--dev");
+2 -1
View File
@@ -1,6 +1,7 @@
import { Plugin } from "esbuild";
import { readdir } from "fs/promises";
import { Plugin } from "esbuild";
const makeImportAllCode = (files: string[]) =>
files.map(f => `require("./${f.replace(/\.[cm]?[tj]sx?$/, "")}")`).join("\n");
+1
View File
@@ -8,6 +8,7 @@
import fs from "fs/promises";
import path from "path";
import AppImageTarget from "app-builder-lib/out/targets/appimage/AppImageTarget.js";
let isApplied = false;
-1
View File
@@ -5,7 +5,6 @@
*/
import "./utils/dotenv";
import { spawnNodeModuleBin } from "./utils/spawn.mjs";
spawnNodeModuleBin("electron", [process.cwd(), ...(process.env.ELECTRON_LAUNCH_FLAGS?.split(" ") ?? [])]);
-1
View File
@@ -5,6 +5,5 @@
*/
import "./start";
import { spawnNodeModuleBin } from "./utils/spawn.mjs";
spawnNodeModuleBin("tsx", ["scripts/build/build.mts", "--", "--watch", "--dev"]);
+1
View File
@@ -6,6 +6,7 @@
import { promises as fs } from "node:fs";
import { mkdir } from "node:fs/promises";
import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
import xmlFormat from "xml-formatter";
+2 -1
View File
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { app, NativeImage, nativeImage } from "electron";
import { join } from "path";
import { app, NativeImage, nativeImage } from "electron";
import { BADGE_DIR } from "shared/paths";
import { AppEvents } from "./events";
+3 -2
View File
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { SESSION_DATA_DIR } from "main/constants";
import { join, resolve } from "path";
import { IpcCommands } from "shared/IpcEvents";
import { MessageChannel, Worker } from "worker_threads";
import { SESSION_DATA_DIR } from "main/constants";
import { IpcCommands } from "shared/IpcEvents";
import { sendRendererCommand } from "../ipcCommands";
import { Settings } from "../settings";
import { ArRpcEvent, ArRpcHostEvent } from "./types";
+2 -1
View File
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import Server from "arrpc";
import { randomUUID } from "crypto";
import { MessagePort, workerData } from "worker_threads";
import Server from "arrpc";
import { ArRpcEvent, ArRpcHostEvent } from "./types";
let server: any;
+2 -1
View File
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { app } from "electron";
import { existsSync, mkdirSync, rmSync, writeFileSync } from "fs";
import { join } from "path";
import { app } from "electron";
import { stripIndent } from "shared/utils/text";
import { IS_FLATPAK } from "./constants";
+3 -2
View File
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { app } from "electron";
import { basename } from "path";
import { stripIndent } from "shared/utils/text";
import { parseArgs, ParseArgsOptionDescriptor } from "util";
import { app } from "electron";
import { stripIndent } from "shared/utils/text";
type Option = ParseArgsOptionDescriptor & {
description: string;
hidden?: boolean;
+2 -1
View File
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { app } from "electron";
import { existsSync, mkdirSync } from "fs";
import { dirname, join } from "path";
import { app } from "electron";
import { CommandLine } from "./cli";
const vesktopDir = dirname(process.execPath);
+1
View File
@@ -5,6 +5,7 @@
*/
import { join } from "path";
import { STATIC_DIR } from "shared/paths";
let libVesktop: typeof import("libvesktop") | null = null;
+3 -2
View File
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { app } from "electron";
import { BrowserWindow } from "electron/main";
import { copyFileSync, mkdirSync, readdirSync } from "fs";
import { join } from "path";
import { app } from "electron";
import { BrowserWindow } from "electron/main";
import { SplashProps } from "shared/browserWinProperties";
import { autoStart } from "./autoStart";
+5 -4
View File
@@ -7,6 +7,11 @@
if (process.platform === "linux") import("./venmic");
import { execFile } from "child_process";
import { readFileSync, watch } from "fs";
import { readFile, stat } from "fs/promises";
import { release } from "os";
import { join } from "path";
import {
app,
BrowserWindow,
@@ -18,10 +23,6 @@ import {
session,
shell
} from "electron";
import { readFileSync, watch } from "fs";
import { readFile, stat } from "fs/promises";
import { release } from "os";
import { join } from "path";
import { IpcEvents } from "../shared/IpcEvents";
import { setBadgeCount } from "./appBadge";
+1
View File
@@ -5,6 +5,7 @@
*/
import { randomUUID } from "crypto";
import { ipcMain } from "electron";
import { IpcEvents } from "shared/IpcEvents";
-1
View File
@@ -9,7 +9,6 @@ import "./updater";
import "./ipc";
import "./userAssets";
import "./vesktopProtocol";
import { app, BrowserWindow, nativeTheme } from "electron";
import { DATA_DIR } from "./constants";
+2 -1
View File
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { join } from "path";
import {
app,
BrowserWindow,
@@ -15,7 +17,6 @@ import {
screen,
session
} from "electron";
import { join } from "path";
import { IpcCommands, IpcEvents } from "shared/IpcEvents";
import { isTruthy } from "shared/utils/guards";
import { once } from "shared/utils/once";
+2 -1
View File
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { desktopCapturer, session, Streams } from "electron";
import { release } from "os";
import { desktopCapturer, session, Streams } from "electron";
import type { StreamPick } from "renderer/components/ScreenSharePicker";
import { IpcCommands, IpcEvents } from "shared/IpcEvents";
+2 -1
View File
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { type Settings as TVencordSettings } from "@vencord/types/Vencord";
import { mkdirSync, readFileSync, writeFileSync } from "fs";
import { dirname, join } from "path";
import { type Settings as TVencordSettings } from "@vencord/types/Vencord";
import { DefaultVesktopSettings } from "shared/defaultSettings";
import type { Settings as TSettings, State as TState } from "shared/settings";
import { SettingsStore } from "shared/utils/SettingsStore";
+2 -1
View File
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { BrowserWindow } from "electron";
import { join } from "path";
import { BrowserWindow } from "electron";
import { SplashProps } from "shared/browserWinProperties";
import { Settings } from "./settings";
+2 -1
View File
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { join } from "path";
import { app, BrowserWindow, ipcMain } from "electron";
import { autoUpdater, UpdateInfo } from "electron-updater";
import { join } from "path";
import { IpcEvents, UpdaterIpcEvents } from "shared/IpcEvents";
import { Millis } from "shared/utils/millis";
+4 -3
View File
@@ -4,12 +4,13 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { app, dialog, net } from "electron";
import { copyFile, mkdir, rm } from "fs/promises";
import { join } from "path";
import { pathToFileURL } from "url";
import { app, dialog, net } from "electron";
import { IpcEvents } from "shared/IpcEvents";
import { STATIC_DIR } from "shared/paths";
import { pathToFileURL } from "url";
import { DATA_DIR } from "./constants";
import { AppEvents } from "./events";
@@ -41,7 +42,7 @@ export async function resolveAssetPath(asset: UserAssetType) {
return join(STATIC_DIR, DEFAULT_ASSETS[asset]);
}
export async function handleVesktopAssetsProtocol(path: string, req: Request) {
export async function handleVesktopAssetsProtocol(path: string) {
const asset = path.slice(1);
// @ts-expect-error dumb types
+2 -1
View File
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { app, BrowserWindow, dialog } from "electron";
import { rm } from "fs/promises";
import { app, BrowserWindow, dialog } from "electron";
import { DATA_DIR, MessageBoxChoice } from "main/constants";
export async function clearData(win: BrowserWindow) {
+1 -1
View File
@@ -14,7 +14,7 @@ export function validateSender(frame: WebFrameMain | null, event: string) {
try {
var { hostname, protocol } = new URL(frame.url);
} catch (e) {
} catch {
throw new Error(`ipc[${event}]: Invalid URL ${frame.url}`);
}
@@ -5,6 +5,7 @@
*/
import { execFile } from "child_process";
import { app } from "electron";
export async function setAsDefaultProtocolClient(protocol: string) {
+2 -1
View File
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { BrowserWindow, dialog } from "electron";
import { writeFile } from "fs/promises";
import { join } from "path";
import { BrowserWindow, dialog } from "electron";
import { MessageBoxChoice } from "../constants";
import { State } from "../settings";
+2 -1
View File
@@ -6,9 +6,10 @@
import { mkdirSync } from "fs";
import { access, constants as FsConstants, writeFile } from "fs/promises";
import { VENCORD_FILES_DIR } from "main/vencordFilesDir";
import { join } from "path";
import { VENCORD_FILES_DIR } from "main/vencordFilesDir";
import { USER_AGENT } from "../constants";
import { downloadFile, fetchie } from "./http";
+2 -1
View File
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { join } from "path";
import type { LinkData, Node, PatchBay as PatchBayType } from "@vencord/venmic";
import { app, ipcMain } from "electron";
import { join } from "path";
import { IpcEvents } from "shared/IpcEvents";
import { STATIC_DIR } from "shared/paths";
+2 -2
View File
@@ -15,9 +15,9 @@ app.whenReady().then(() => {
switch (url.hostname) {
case "assets":
return handleVesktopAssetsProtocol(url.pathname, req);
return handleVesktopAssetsProtocol(url.pathname);
case "static":
return handleVesktopStaticProtocol(url.pathname, req);
return handleVesktopStaticProtocol(url.pathname);
default:
return new Response(null, { status: 404 });
}
+3 -2
View File
@@ -4,15 +4,16 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { BrowserWindow, net } from "electron";
import { join } from "path";
import { pathToFileURL } from "url";
import { BrowserWindow, net } from "electron";
import { isPathInDirectory } from "./utils/isPathInDirectory";
const STATIC_DIR = join(__dirname, "..", "..", "static");
export async function handleVesktopStaticProtocol(path: string, req: Request) {
export async function handleVesktopStaticProtocol(path: string) {
const fullPath = join(STATIC_DIR, path);
if (!isPathInDirectory(fullPath, STATIC_DIR)) {
return new Response(null, { status: 404 });
+1 -1
View File
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { contextBridge, ipcRenderer } from "electron/renderer";
import type { UpdateInfo } from "electron-updater";
import { contextBridge, ipcRenderer } from "electron/renderer";
import { UpdaterIpcEvents } from "shared/IpcEvents";
import { invoke } from "./typedIpc";
@@ -5,7 +5,6 @@
*/
import "./screenSharePicker.css";
import { classNameFactory } from "@vencord/types/api/Styles";
import {
Button,
@@ -16,7 +16,6 @@
flex-grow: 1;
}
/* Screen Grid */
.vcd-screen-picker-screen-grid {
display: grid;
@@ -73,7 +72,6 @@
margin-bottom: 1em;
}
/* Option Radios */
.vcd-screen-picker-option-radios {
@@ -144,7 +142,7 @@
display: flex;
gap: 1em;
>section {
> section {
flex: 1;
}
}
}
@@ -34,7 +34,7 @@ function openDeveloperOptionsModal(settings: Settings) {
));
}
const VencordLocationPicker: SettingsComponent = ({ settings }) => {
const VencordLocationPicker: SettingsComponent = () => {
const forceUpdate = useForceUpdater();
const usingCustomVencordDir = VesktopNative.fileManager.isUsingCustomVencordDir();
@@ -5,7 +5,6 @@
*/
import "./settings.css";
import { classNameFactory } from "@vencord/types/api/Styles";
import { Divider, ErrorBoundary, Text } from "@vencord/types/components";
import { ComponentType } from "react";
@@ -28,4 +28,4 @@
height: 7.5em;
width: 7.5em;
object-fit: contain;
}
}
@@ -5,7 +5,6 @@
*/
import "./UserAssets.css";
import { Button, FormSwitch, Text } from "@vencord/types/components";
import { Margins, wordsFromCamel, wordsToTitle } from "@vencord/types/utils";
import { Modal, openModal, showToast, useState } from "@vencord/types/webpack/common";
@@ -34,7 +33,7 @@ function openAssetsModal() {
function Asset({ asset }: { asset: UserAssetType }) {
// cache busting
const [version, setVersion] = useState(Date.now());
const [version, setVersion] = useState(() => Date.now());
const settings = useSettings();
const isSplash = asset === "splash";
@@ -38,4 +38,4 @@
margin-bottom: 1em;
display: grid;
gap: 0.5em;
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ if (isLinux) {
const devices = await navigator.mediaDevices.enumerateDevices();
const audioDevice = devices.find(({ label }) => label === "vencord-screen-share");
return audioDevice?.deviceId;
} catch (error) {
} catch {
return null;
}
}
+1 -1
View File
@@ -55,7 +55,7 @@ const currentState: TState = (() => {
})();
export const State = new SettingsStore<TState>(currentState);
State.addGlobalChangeListener((o, p) => localStorage.setItem(stateKey, JSON.stringify(o)));
State.addGlobalChangeListener(o => localStorage.setItem(stateKey, JSON.stringify(o)));
export function useVesktopState() {
const [, update] = useReducer(x => x + 1, 0);
+4 -3
View File
@@ -79,8 +79,9 @@
</li>
<li>
And many
<a href="https://github.com/Vencord/Vesktop/blob/main/pnpm-lock.yaml" target="_blank">more open source
libraries</a>
<a href="https://github.com/Vencord/Vesktop/blob/main/pnpm-lock.yaml" target="_blank"
>more open source libraries</a
>
</li>
</ul>
</section>
@@ -106,4 +107,4 @@
}
walk(document.body);
</script>
</script>
+4 -3
View File
@@ -16,8 +16,9 @@ body {
}
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
"Open Sans", "Helvetica Neue", sans-serif;
font-family:
system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
"Helvetica Neue", sans-serif;
background: var(--bg);
color: var(--fg);
}
@@ -29,4 +30,4 @@ a {
a:hover {
color: var(--link-hover);
}
}
+5 -3
View File
@@ -133,8 +133,10 @@
<label>
<div>
<h2>Rich Presence</h2>
<span>Enable Rich presence (game activity) via
<a href="https://github.com/OpenAsar/arrpc" target="_blank">arRPC</a></span>
<span
>Enable Rich presence (game activity) via
<a href="https://github.com/OpenAsar/arrpc" target="_blank">arRPC</a></span
>
</div>
<input type="checkbox" name="richPresence" checked />
</label>
@@ -170,4 +172,4 @@
console.info("form:" + JSON.stringify(data));
e.preventDefault();
};
</script>
</script>
+4 -4
View File
@@ -36,7 +36,7 @@
word-break: break-word;
padding: 0 16px;
position: absolute;
font-size: 14px
font-size: 14px;
}
p {
@@ -61,9 +61,9 @@
<script>
document.addEventListener("DOMContentLoaded", () => {
const messageElement = document.querySelector('.message');
const messageElement = document.querySelector(".message");
VesktopSplashNative.onUpdateMessage(message => {
messageElement.textContent = message;
})
});
});
</script>
</script>
+9 -5
View File
@@ -3,11 +3,14 @@
<head>
<title>Vesktop Updater</title>
<meta http-equiv="Content-Security-Policy" content="
<meta
http-equiv="Content-Security-Policy"
content="
default-src 'none';
script-src vesktop:;
style-src vesktop:;
">
"
/>
<link rel="stylesheet" href="../common.css" type="text/css" />
<link rel="stylesheet" href="./style.css" type="text/css" />
@@ -43,8 +46,9 @@
automatically install and Vesktop will restart.
</p>
<p id="linux-note" class="hidden">You will likely be prompted to enter your password. Do so to finish the
update.</p>
<p id="linux-note" class="hidden">
You will likely be prompted to enter your password. Do so to finish the update.
</p>
<progress id="download-progress" value="0" max="100"></progress>
@@ -61,4 +65,4 @@
</dialog>
</body>
<script type="module" src="./script.js"></script>
<script type="module" src="./script.js"></script>
+1 -2
View File
@@ -27,7 +27,6 @@ body {
}
}
#versions {
display: inline-grid;
grid-template-columns: auto 1fr;
@@ -144,4 +143,4 @@ progress {
to {
transform: rotate(360deg);
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@
"skipLibCheck": true,
"paths": {
"*": ["./src/*"],
"*": ["./src/*"]
},
"types": ["node", "@vencord/types"]