Compare commits

..

3 Commits

Author SHA1 Message Date
Admin fce96bd644 a 2024-12-20 10:23:13 -08:00
Admin b2998084e1 a 2024-12-20 10:05:39 -08:00
Admin ffb7047021 a 2024-12-20 09:43:40 -08:00
3 changed files with 67 additions and 42 deletions

View File

@ -13,7 +13,7 @@ Aerocord is a [Vesktop](https://github.com/Vencord/Vesktop) fork meant for Windo
- Aerocord has its own updater separate from vesktop, the updater is also consent-only meaning it wont update without permission - Aerocord has its own updater separate from vesktop, the updater is also consent-only meaning it wont update without permission
- Extension support - Extension support
### Plans for the future (v4.0.1): ### Plans for the future:
- Use CoolWPR electron, [this](https://git.randomserver.top/administrator/electron7) project in question - Use CoolWPR electron, [this](https://git.randomserver.top/administrator/electron7) project in question
- Improve the updater - Improve the updater

View File

@ -1,6 +1,6 @@
{ {
"name": "aerocord", "name": "aerocord",
"version": "4.0.0", "version": "4.0.1",
"private": true, "private": true,
"description": "aerocord", "description": "aerocord",
"keywords": [], "keywords": [],

View File

@ -6,14 +6,17 @@
* Copyright (c) 2023 Vendicated and Vencord contributors * Copyright (c) 2023 Vendicated and Vencord contributors
*/ */
import { BuildOptions, build } from "esbuild"; import { BuildContext, BuildOptions, context } from "esbuild";
import { copyFile } from "fs/promises";
import vencordDep from "./vencordDep.mjs";
const isDev = process.argv.includes("--dev"); const isDev = process.argv.includes("--dev");
const CommonOpts: BuildOptions = { const CommonOpts: BuildOptions = {
minify: true, minify: !isDev,
bundle: true, bundle: true,
sourcemap: "inline", sourcemap: "linked",
logLevel: "info" logLevel: "info"
}; };
@ -28,42 +31,64 @@ const NodeCommonOpts: BuildOptions = {
} }
}; };
async function buildUnpacked() { const contexts = [] as BuildContext[];
await Promise.all([ async function createContext(options: BuildOptions) {
build({ contexts.push(await context(options));
...NodeCommonOpts,
entryPoints: ["src/main/index.ts"],
outfile: "dist/js/main.js",
footer: { js: "//# sourceURL=VCDMain" }
}),
build({
...NodeCommonOpts,
entryPoints: ["src/preload/index.ts"],
outfile: "dist/js/preload.js",
footer: { js: "//# sourceURL=VCDPreload" }
}),
build({
...NodeCommonOpts,
entryPoints: ["src/updater/preload.ts"],
outfile: "dist/js/updaterPreload.js",
footer: { js: "//# sourceURL=VCDUpdaterPreload" }
}),
build({
...CommonOpts,
globalName: "Vesktop",
entryPoints: ["src/renderer/index.ts"],
outfile: "dist/js/renderer.js",
format: "iife",
inject: ["./scripts/build/injectReact.mjs"],
jsxFactory: "VencordCreateElement",
jsxFragment: "VencordFragment",
external: ["@vencord/types/*"],
footer: { js: "//# sourceURL=VCDRenderer" }
})
]);
} }
buildUnpacked().catch(err => { async function copyVenmic() {
console.error("Build failed:", err); if (process.platform !== "linux") return;
process.exit(1);
}); return Promise.all([
copyFile(
"./node_modules/@vencord/venmic/prebuilds/venmic-addon-linux-x64/node-napi-v7.node",
"./static/dist/venmic-x64.node"
),
copyFile(
"./node_modules/@vencord/venmic/prebuilds/venmic-addon-linux-arm64/node-napi-v7.node",
"./static/dist/venmic-arm64.node"
)
]).catch(() => console.warn("Failed to copy venmic. Building without venmic support"));
}
await Promise.all([
copyVenmic(),
createContext({
...NodeCommonOpts,
entryPoints: ["src/main/index.ts"],
outfile: "dist/js/main.js",
footer: { js: "//# sourceURL=VCDMain" }
}),
createContext({
...NodeCommonOpts,
entryPoints: ["src/preload/index.ts"],
outfile: "dist/js/preload.js",
footer: { js: "//# sourceURL=VCDPreload" }
}),
createContext({
...CommonOpts,
globalName: "Vesktop",
entryPoints: ["src/renderer/index.ts"],
outfile: "dist/js/renderer.js",
format: "iife",
inject: ["./scripts/build/injectReact.mjs"],
jsxFactory: "VencordCreateElement",
jsxFragment: "VencordFragment",
external: ["@vencord/types/*"],
plugins: [vencordDep],
footer: { js: "//# sourceURL=VCDRenderer" }
})
]);
const watch = process.argv.includes("--watch");
if (watch) {
await Promise.all(contexts.map(ctx => ctx.watch()));
} else {
await Promise.all(
contexts.map(async ctx => {
await ctx.rebuild();
await ctx.dispose();
})
);
}