From 8ea9a08c70eb9d6ef3ab907020f92150439591b8 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Mon, 6 Oct 2025 23:44:13 +0200 Subject: [PATCH 1/2] update & publish types packages --- packages/discord-types/.npmignore | 1 + packages/discord-types/package.json | 5 +++- packages/vencord-types/package.json | 13 ++++++--- pnpm-lock.yaml | 41 +++++++++++++++++------------ src/globals.d.ts | 6 +---- src/modules.d.ts | 7 ----- src/nativeModules.d.ts | 12 +++++++++ 7 files changed, 51 insertions(+), 34 deletions(-) create mode 100644 packages/discord-types/.npmignore create mode 100644 src/nativeModules.d.ts diff --git a/packages/discord-types/.npmignore b/packages/discord-types/.npmignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/packages/discord-types/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/packages/discord-types/package.json b/packages/discord-types/package.json index 7b8726fd2..8c95d6749 100644 --- a/packages/discord-types/package.json +++ b/packages/discord-types/package.json @@ -1,6 +1,7 @@ { "name": "@vencord/discord-types", "author": "Vencord Contributors", + "private": false, "description": "Typescript definitions for the webpack modules of the Discord Web app", "version": "1.0.0", "license": "LGPL-3.0-or-later", @@ -12,8 +13,10 @@ "directory": "packages/discord-types" }, "dependencies": { - "@types/react": "^19.0.10", "moment": "^2.22.2", "type-fest": "^4.41.0" + }, + "peerDependencies": { + "@types/react": "^19.0.10" } } diff --git a/packages/vencord-types/package.json b/packages/vencord-types/package.json index 645869190..ae12354cd 100644 --- a/packages/vencord-types/package.json +++ b/packages/vencord-types/package.json @@ -1,7 +1,7 @@ { "name": "@vencord/types", "private": false, - "version": "1.11.5", + "version": "1.13.2", "description": "", "types": "index.d.ts", "scripts": { @@ -19,9 +19,14 @@ "dependencies": { "@types/lodash": "4.17.15", "@types/node": "^22.13.4", - "@types/react": "18.3.1", - "@types/react-dom": "18.3.1", - "standalone-electron-types": "^34.2.0", + "@vencord/discord-types": "^1.0.0", + "highlight.js": "11.11.1", + "moment": "^2.22.2", + "ts-pattern": "^5.6.0", "type-fest": "^4.35.0" + }, + "peerDependencies": { + "@types/react": "18.3.1", + "@types/react-dom": "18.3.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cde57a1f5..2ba2d3175 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -163,13 +163,22 @@ importers: version: 22.13.13 '@types/react': specifier: 18.3.1 - version: 18.3.1 + version: 19.0.12 '@types/react-dom': specifier: 18.3.1 version: 18.3.1 - standalone-electron-types: - specifier: ^34.2.0 - version: 34.2.0 + '@vencord/discord-types': + specifier: ^1.0.0 + version: 1.0.0(@types/react@19.0.12) + highlight.js: + specifier: 11.11.1 + version: 11.11.1 + moment: + specifier: ^2.22.2 + version: 2.30.1 + ts-pattern: + specifier: ^5.6.0 + version: 5.6.2 type-fest: specifier: ^4.35.0 version: 4.38.0 @@ -520,9 +529,6 @@ packages: '@types/node@22.13.13': resolution: {integrity: sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==} - '@types/prop-types@15.7.14': - resolution: {integrity: sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==} - '@types/react-dom@18.3.1': resolution: {integrity: sha512-qW1Mfv8taImTthu4KoXgDfLuk4bydU6Q/TkADnDWWHwi4NX4BR+LWfTp2sVmTqRrsHvyDDTelgelxJ+SsejKKQ==} @@ -531,9 +537,6 @@ packages: peerDependencies: '@types/react': ^19.0.0 - '@types/react@18.3.1': - resolution: {integrity: sha512-V0kuGBX3+prX+DQ/7r2qsv1NsdfnCLnTgnRJ1pYnxykBhGMz+qj+box5lq7XsO5mtZsBqpjwwTu/7wszPfMBcw==} - '@types/react@19.0.12': resolution: {integrity: sha512-V6Ar115dBDrjbtXSrS+/Oruobc+qVbbUxDFC1RSbRqLt5SYvxxyIDrSC85RWml54g+jfNeEMZhEj7wW07ONQhA==} @@ -596,6 +599,11 @@ packages: '@vap/shiki@0.10.5': resolution: {integrity: sha512-5BHVGvQT8qonbLSASon5aQFQ18OZU4FxSl9tLSj6oJ0sap3KdMbYcfGq25M9zFZR1g1dJN7fgjmZXBIS5omIdw==} + '@vencord/discord-types@1.0.0': + resolution: {integrity: sha512-idtijKdbjiqo8k+4mo5Aq9zrQYwr2u11VmiRasaf+8+cGC5bYsMTIZl7zKLF3VdYx2a0ICjxgZtcfa1U3mv1Yg==} + peerDependencies: + '@types/react': ^19.0.10 + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -2761,8 +2769,6 @@ snapshots: dependencies: undici-types: 6.20.0 - '@types/prop-types@15.7.14': {} - '@types/react-dom@18.3.1': dependencies: '@types/react': 19.0.12 @@ -2771,11 +2777,6 @@ snapshots: dependencies: '@types/react': 19.0.12 - '@types/react@18.3.1': - dependencies: - '@types/prop-types': 15.7.14 - csstype: 3.1.3 - '@types/react@19.0.12': dependencies: csstype: 3.1.3 @@ -2876,6 +2877,12 @@ snapshots: vscode-oniguruma: 1.7.0 vscode-textmate: 5.2.0 + '@vencord/discord-types@1.0.0(@types/react@19.0.12)': + dependencies: + '@types/react': 19.0.12 + moment: 2.30.1 + type-fest: 4.41.0 + acorn-jsx@5.3.2(acorn@8.14.1): dependencies: acorn: 8.14.1 diff --git a/src/globals.d.ts b/src/globals.d.ts index 8dd2bd8de..d36379b26 100644 --- a/src/globals.d.ts +++ b/src/globals.d.ts @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import { LoDashStatic } from "lodash"; - declare global { /** * This exists only at build time, so references to it in patches should insert it @@ -65,9 +63,7 @@ declare global { export var Vesktop: any; export var VesktopNative: any; - interface Window extends Record { - _: LoDashStatic; - } + interface Window extends Record { } } export { }; diff --git a/src/modules.d.ts b/src/modules.d.ts index 082b169de..f76d56c29 100644 --- a/src/modules.d.ts +++ b/src/modules.d.ts @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -/// - declare module "~plugins" { const plugins: Record; export default plugins; @@ -28,11 +26,6 @@ declare module "~plugins" { export const ExcludedPlugins: Record; } -declare module "~pluginNatives" { - const pluginNatives: Record unknown>>; - export default pluginNatives; -} - declare module "~git-hash" { const hash: string; export default hash; diff --git a/src/nativeModules.d.ts b/src/nativeModules.d.ts new file mode 100644 index 000000000..40da784ed --- /dev/null +++ b/src/nativeModules.d.ts @@ -0,0 +1,12 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2025 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +/// + +declare module "~pluginNatives" { + const pluginNatives: Record unknown>>; + export default pluginNatives; +} From 54813f2dc32c42a60cf26868d72410036f8f6ea4 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Tue, 7 Oct 2025 03:17:37 +0200 Subject: [PATCH 2/2] WebContextMenus: fix crashing when clicking images Co-Authored-By: rini --- src/plugins/webContextMenus.web/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/webContextMenus.web/index.ts b/src/plugins/webContextMenus.web/index.ts index be85e33cd..b9c6a1875 100644 --- a/src/plugins/webContextMenus.web/index.ts +++ b/src/plugins/webContextMenus.web/index.ts @@ -128,8 +128,8 @@ export default definePlugin({ replace: "false" }, { - match: /canCopyImage\(.+?(?=return"function"==typeof \i\.clipboard\.copyImage)/, - replace: "$&return true;" + match: /(?<=canCopyImage\(.+?)typeof \i\.clipboard\.copyImage/, + replace: '"function"' } ] },