Fix building on Node 22

This commit is contained in:
1024x2 2024-04-26 14:21:38 +01:00
parent d23bd89aca
commit 7f89899799
Signed by: 1024x2
GPG Key ID: DEF24F6555C1934C
7 changed files with 36 additions and 6 deletions

View File

@ -1,7 +1,7 @@
From e25f5674bfbfe3d6a28f8536b857c0d1b9db6a9d Mon Sep 17 00:00:00 2001
From: 1024x2 <2pow11@gmail.com>
Date: Wed, 24 Apr 2024 23:30:05 +0100
Subject: [PATCH 1/6] Remove donator badges
Subject: [PATCH 1/7] Remove donator badges
It makes a request to an API hosted by the Vencord developer, without
any option to turn it off. This raises privacy concerns.

View File

@ -1,7 +1,7 @@
From 1488ae2e8e1b16bfe19f93d840e9c4af2827f48d Mon Sep 17 00:00:00 2001
From: 1024x2 <2pow11@gmail.com>
Date: Sat, 9 Mar 2024 07:57:26 +0000
Subject: [PATCH 2/6] Small rebrand
Subject: [PATCH 2/7] Small rebrand
There's a litevex in here! It's got my gun!!! AHHHHHHHH
---

View File

@ -1,7 +1,7 @@
From 54fb224b90ddb97807dc91072769ccebacf9e426 Mon Sep 17 00:00:00 2001
From: 1024x2 <2pow11@gmail.com>
Date: Thu, 26 Oct 2023 00:48:25 +0100
Subject: [PATCH 3/6] Experiments: Re-add staging banner
Subject: [PATCH 3/7] Experiments: Re-add staging banner
(it's funny)
---

View File

@ -1,7 +1,7 @@
From 7aa6223d4b8a9a9c2e5329e5196a6a0cd23e1097 Mon Sep 17 00:00:00 2001
From: 1024x2 <2pow11@gmail.com>
Date: Sat, 9 Mar 2024 08:00:55 +0000
Subject: [PATCH 4/6] Updater: don't prompt for updates when on a local branch
Subject: [PATCH 4/7] Updater: don't prompt for updates when on a local branch
---
src/main/updater/git.ts | 7 +------

View File

@ -1,7 +1,7 @@
From ca457c1263004f0c9347e2e830a088f93b95e824 Mon Sep 17 00:00:00 2001
From: 1024x2 <2pow11@gmail.com>
Date: Wed, 27 Dec 2023 15:05:44 +0000
Subject: [PATCH 5/6] Enable CSP bypass on stock discord desktop client
Subject: [PATCH 5/7] Enable CSP bypass on stock discord desktop client
---
src/main/index.ts | 3 ++-

View File

@ -1,7 +1,7 @@
From 111bf8d5fad4f9226122583239b38eb718b57b04 Mon Sep 17 00:00:00 2001
From: 1024x2 <2pow11@gmail.com>
Date: Sun, 21 Apr 2024 21:22:25 +0100
Subject: [PATCH 6/6] Updater: Disable auto-update by default
Subject: [PATCH 6/7] Updater: Disable auto-update by default
---
src/api/Settings.ts | 2 +-

View File

@ -0,0 +1,30 @@
From 88417678f3b38b3f2af056f2a34f9c6eb99d591f Mon Sep 17 00:00:00 2001
From: 1024x2 <2pow11@gmail.com>
Date: Fri, 26 Apr 2024 13:56:19 +0100
Subject: [PATCH 7/7] Build: Don't use import assertions
Node.js 22 removed the "assert" syntax because we obviously can't keep
things working for more than 5 minutes.
We can just call readFileSync instead, which works on all currently
supported Node.js versions.
---
scripts/build/common.mjs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/build/common.mjs b/scripts/build/common.mjs
index 5c34ad0..ff9b854 100644
--- a/scripts/build/common.mjs
+++ b/scripts/build/common.mjs
@@ -25,8 +25,7 @@ import { access, readdir, readFile } from "fs/promises";
import { join, relative } from "path";
import { promisify } from "util";
-// wtf is this assert syntax
-import PackageJSON from "../../package.json" assert { type: "json" };
+const PackageJSON = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf-8"));
import { getPluginTarget } from "../utils.mjs";
export const VERSION = PackageJSON.version;
--
2.44.0