Skip to content

Commit

Permalink
Merge branch 'main' into utility-classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Penguin-Spy committed Jan 12, 2025
2 parents 013efb4 + ec9d414 commit bc46562
Show file tree
Hide file tree
Showing 200 changed files with 16,162 additions and 12,779 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,22 @@ jobs:

steps:
- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- uses: pnpm/action-setup@v2
with:
version: latest
- uses: pnpm/action-setup@v4

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,22 @@ jobs:

steps:
- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- uses: pnpm/action-setup@v2
with:
version: latest
- uses: pnpm/action-setup@v4

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,22 @@ jobs:

steps:
- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- uses: pnpm/action-setup@v2
with:
version: latest
- uses: pnpm/action-setup@v4

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ jobs:

steps:
- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- uses: pnpm/action-setup@v2
with:
version: latest
- uses: pnpm/action-setup@v4

- name: Install Node.js dependencies
run: pnpm install
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,22 @@ jobs:

steps:
- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- uses: pnpm/action-setup@v2
with:
version: latest
- uses: pnpm/action-setup@v4

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ config.json
/*.asar
/bin.mjs
/*.d.ts
/i18n/*.map
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.12.1
v20.15.0
40 changes: 23 additions & 17 deletions bin/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
rmSync,
writeFileSync,
} from "fs";
import { cwd } from "process";
import esbuild from "esbuild";
import path from "path";
import updateNotifier from "update-notifier";
Expand All @@ -23,7 +22,7 @@ import WebSocket from "ws";
import { release } from "./release.mjs";
import { logBuildPlugin } from "../src/util.mjs";
import { sassPlugin } from "esbuild-sass-plugin";
import { fileURLToPath } from "url";
import { fileURLToPath, pathToFileURL } from "url";
import { AddonType, getAddonFolder, isMonoRepo, selectAddon } from "./mono.mjs";

interface BaseArgs {
Expand All @@ -40,17 +39,20 @@ export const directory = process.cwd();

const dirname = path.dirname(fileURLToPath(import.meta.url));
const packageJson = JSON.parse(readFileSync(path.resolve(dirname, "package.json"), "utf-8"));
let extraESBuildConfig = new Promise<(current: esbuild.BuildOptions) => esbuild.BuildOptions>(
(resolve) => resolve((v) => v),
);

if (existsSync("./esbuild.extra.mjs")) {
extraESBuildConfig = new Promise((resolve) => {
import(path.join(cwd(), "esbuild.extra.mjs")).then((v) => {
resolve(v.default);
});
});
}
const extraESBuildPath = path.join(directory, "esbuild.extra.mjs");
const extraESBuildConfig = new Promise<(config: esbuild.BuildOptions) => esbuild.BuildOptions>(
(resolve) => {
if (existsSync(extraESBuildPath))
resolve(
import(pathToFileURL(extraESBuildPath).href).then((m) => m.default) as Promise<
(config: esbuild.BuildOptions) => esbuild.BuildOptions
>,
);

resolve((config: esbuild.BuildOptions) => config);
},
);

const updateMessage = `Update available ${chalk.dim("{currentVersion}")}${chalk.reset(
" → ",
Expand Down Expand Up @@ -270,7 +272,7 @@ async function handleContexts(
if (watch) {
await context.watch();
} else {
await context.rebuild().catch(() => {});
await context.rebuild().catch(() => process.exit(1));
context.dispose();
}
}),
Expand All @@ -296,7 +298,7 @@ const CONFIG_PATH = (() => {
return path.join(process.env.HOME || "", ".config", REPLUGGED_FOLDER_NAME);
}
})();
const CHROME_VERSION = "91";
const CHROME_VERSION = "124";

function buildAddons(buildFn: (args: Args) => Promise<void>, args: Args, type: AddonType): void {
const addons = getAddonFolder(type);
Expand Down Expand Up @@ -362,7 +364,9 @@ async function buildPlugin({ watch, noInstall, production, noReload, addon }: Ar
const install: esbuild.Plugin = {
name: "install",
setup: (build) => {
build.onEnd(async () => {
build.onEnd(async (result) => {
if (result.errors.length > 0) return;

if (!noInstall) {
const dest = path.join(CONFIG_PATH, "plugins", manifest.id);
if (existsSync(dest)) rmSync(dest, { recursive: true, force: true });
Expand Down Expand Up @@ -450,7 +454,9 @@ async function buildTheme({ watch, noInstall, production, noReload, addon }: Arg
const install: esbuild.Plugin = {
name: "install",
setup: (build) => {
build.onEnd(async () => {
build.onEnd(async (result) => {
if (result.errors.length > 0) return;

if (!noInstall) {
const dest = path.join(CONFIG_PATH, "themes", manifest.id);
if (existsSync(dest)) rmSync(dest, { recursive: true, force: true });
Expand Down Expand Up @@ -509,7 +515,7 @@ async function buildTheme({ watch, noInstall, production, noReload, addon }: Arg
),
);

manifest.plaintextPatches = "splash.css";
manifest.splash = "splash.css";
}

if (!existsSync(distPath)) mkdirSync(distPath, { recursive: true });
Expand Down
31 changes: 16 additions & 15 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,70 +4,71 @@
"dictionaryDefinitions": [],
"dictionaries": [],
"words": [
"alertdialog",
"APPDATA",
"asar",
"Automod",
"automod",
"autosize",
"backoff",
"blurple",
"channeltextarea",
"Chunkdiscord",
"codemirror",
"cooldown",
"coremod",
"coremods",
"crosspost",
"customitem",
"dataurl",
"dependants",
"devmode",
"discordapp",
"doas",
"dont",
"esbuild",
"flatpak",
"flatpaks",
"fontawesome",
"Fonticons",
"Frecency",
"getent",
"gifv",
"globstar",
"gpgsign",
"groupstart",
"HighlightJS",
"installdir",
"jsona",
"Jsonifiable",
"konami",
"leaderboard",
"lezer",
"LOCALAPPDATA",
"logname",
"marshift",
"metafile",
"Millis",
"nonmatching",
"notif",
"notrack",
"olavwolfiken",
"outfile",
"popout",
"postpublish",
"Promisable",
"quickcss",
"ratelimited",
"RATELIMITED",
"rauenzi",
"RDNN",
"Recents",
"recents",
"reinject",
"replug",
"replugged",
"resizeable",
"Scroller",
"shopt",
"scroller",
"signingkey",
"Skema",
"skus",
"uninject",
"uninjector",
"uninjectors",
"Vendicated",
"Webauthn",
"webauthn",
"weblate",
"XLARGE"
"Withs",
"YofukashiNo"
],
"ignoreWords": [],
"import": [],
Expand Down
Loading

0 comments on commit bc46562

Please sign in to comment.