Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/philhk/Vencord into better-…
Browse files Browse the repository at this point in the history
…plugins
  • Loading branch information
philhk committed Dec 25, 2023
2 parents 7b91e60 + 5dee2e8 commit de8fa2a
Show file tree
Hide file tree
Showing 121 changed files with 3,215 additions and 627 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/reportBrokenPlugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ jobs:

steps:
- uses: actions/checkout@v3
if: ${{ github.event_name == 'schedule' }}
with:
ref: dev

- uses: actions/checkout@v3
if: ${{ github.event_name == 'workflow_dispatch' }}

- uses: pnpm/action-setup@v2 # Install pnpm using packageManager key in package.json

Expand All @@ -29,7 +35,7 @@ jobs:
sudo apt-get install -y chromium-browser
- name: Build web
run: pnpm buildWeb --standalone
run: pnpm buildWeb --standalone --dev

- name: Create Report
timeout-minutes: 10
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: test
on:
push:
branches:
- main
pull_request:
branches:
- main
- dev
jobs:
test:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

The cutest Discord client mod

![image](https://github.com/Vendicated/Vencord/assets/45497981/706722b1-32de-4d99-bee9-93993b504334)
| ![image](https://github.com/Vendicated/Vencord/assets/45497981/706722b1-32de-4d99-bee9-93993b504334) |
|:--:|
| A screenshot of vencord showcasing the [vencord-theme](https://github.com/synqat/vencord-theme) |

## Features

Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vencord",
"private": "true",
"version": "1.6.3",
"version": "1.6.5",
"description": "The cutest Discord client mod",
"homepage": "https://github.com/Vendicated/Vencord#readme",
"bugs": {
Expand All @@ -17,7 +17,7 @@
"doc": "docs"
},
"scripts": {
"build": "node scripts/build/build.mjs",
"build": "node --require=./scripts/suppressExperimentalWarnings.js scripts/build/build.mjs",
"buildWeb": "node --require=./scripts/suppressExperimentalWarnings.js scripts/build/buildWeb.mjs",
"generatePluginJson": "tsx scripts/generatePluginList.ts",
"inject": "node scripts/runInstaller.mjs",
Expand All @@ -28,7 +28,7 @@
"testWeb": "pnpm lint && pnpm buildWeb && pnpm testTsc",
"testTsc": "tsc --noEmit",
"uninject": "node scripts/runInstaller.mjs",
"watch": "node scripts/build/build.mjs --watch"
"watch": "node --require=./scripts/suppressExperimentalWarnings.js scripts/build/build.mjs --watch"
},
"dependencies": {
"@sapphi-red/web-noise-suppressor": "0.3.3",
Expand Down Expand Up @@ -69,7 +69,8 @@
"type-fest": "^3.9.0",
"typed-emitter": "^2.1.0",
"typescript": "^5.0.4",
"zip-local": "^0.3.5"
"zip-local": "^0.3.5",
"zustand": "^3.7.2"
},
"packageManager": "[email protected]",
"pnpm": {
Expand Down
34 changes: 22 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions scripts/build/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import esbuild from "esbuild";
import { readdir } from "fs/promises";
import { join } from "path";

import { BUILD_TIMESTAMP, commonOpts, existsAsync, globPlugins, isStandalone, updaterDisabled, VERSION, watch } from "./common.mjs";
import { BUILD_TIMESTAMP, commonOpts, existsAsync, globPlugins, isDev, isStandalone, updaterDisabled, VERSION, watch } from "./common.mjs";

const defines = {
IS_STANDALONE: isStandalone,
IS_DEV: JSON.stringify(watch),
IS_DEV: JSON.stringify(isDev),
IS_UPDATER_DISABLED: updaterDisabled,
IS_WEB: false,
IS_EXTENSION: false,
Expand Down Expand Up @@ -76,7 +76,11 @@ const globNativesPlugin = {
if (!await existsAsync(dirPath)) continue;
const plugins = await readdir(dirPath);
for (const p of plugins) {
if (!await existsAsync(join(dirPath, p, "native.ts"))) continue;
const nativePath = join(dirPath, p, "native.ts");
const indexNativePath = join(dirPath, p, "native/index.ts");

if (!(await existsAsync(nativePath)) && !(await existsAsync(indexNativePath)))
continue;

const nameParts = p.split(".");
const namePartsWithoutTarget = nameParts.length === 1 ? nameParts : nameParts.slice(0, -1);
Expand Down
4 changes: 2 additions & 2 deletions scripts/build/buildWeb.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { appendFile, mkdir, readdir, readFile, rm, writeFile } from "fs/promises
import { join } from "path";
import Zip from "zip-local";

import { BUILD_TIMESTAMP, commonOpts, globPlugins, VERSION, watch } from "./common.mjs";
import { BUILD_TIMESTAMP, commonOpts, globPlugins, isDev, VERSION } from "./common.mjs";

/**
* @type {esbuild.BuildOptions}
Expand All @@ -43,7 +43,7 @@ const commonOptions = {
IS_WEB: "true",
IS_EXTENSION: "false",
IS_STANDALONE: "true",
IS_DEV: JSON.stringify(watch),
IS_DEV: JSON.stringify(isDev),
IS_DISCORD_DESKTOP: "false",
IS_VESKTOP: "false",
IS_UPDATER_DISABLED: "true",
Expand Down
1 change: 1 addition & 0 deletions scripts/build/common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const VERSION = PackageJSON.version;
// https://reproducible-builds.org/docs/source-date-epoch/
export const BUILD_TIMESTAMP = Number(process.env.SOURCE_DATE_EPOCH) || Date.now();
export const watch = process.argv.includes("--watch");
export const isDev = watch || process.argv.includes("--dev");
export const isStandalone = JSON.stringify(process.argv.includes("--standalone"));
export const updaterDisabled = JSON.stringify(process.argv.includes("--disable-updater"));
export const gitHash = process.env.VENCORD_HASH || execSync("git rev-parse --short HEAD", { encoding: "utf-8" }).trim();
Expand Down
Loading

0 comments on commit de8fa2a

Please sign in to comment.