From e7be2b7661a60464a77f42b499c0d90758b2ff9b Mon Sep 17 00:00:00 2001 From: Idrees Hassan Date: Sun, 16 Nov 2025 10:38:11 -0500 Subject: [PATCH] Clean up output --- build.js | 16 +++++++++------- dist/extension.zip | Bin 149002 -> 149002 bytes dist/vencord/{birb.export.js => birb.js} | 0 dist/{ => web}/birb.js | 0 4 files changed, 9 insertions(+), 7 deletions(-) rename dist/vencord/{birb.export.js => birb.js} (100%) rename dist/{ => web}/birb.js (100%) diff --git a/build.js b/build.js index 331430f..d9742ce 100644 --- a/build.js +++ b/build.js @@ -12,6 +12,7 @@ const IMAGES_DIR = "./images"; const FONTS_DIR = "./fonts"; const DIST_DIR = "./dist"; +const WEB_DIR = DIST_DIR + "/web"; const USERSCRIPT_DIR = DIST_DIR + "/userscript"; const EXTENSION_DIR = DIST_DIR + "/extension"; const OBSIDIAN_DIR = DIST_DIR + "/obsidian"; @@ -31,8 +32,7 @@ const USERSCRIPT_HEADER = SRC_DIR + "/platforms/userscript/header.txt"; const OBSIDIAN_WRAPPER = SRC_DIR + "/platforms/obsidian/wrapper.js"; const VENCORD_WRAPPER = SRC_DIR + "/platforms/vencord/wrapper.js"; -const BUNDLED_OUTPUT = DIST_DIR + "/birb.bundled.js"; -const BIRB_OUTPUT = DIST_DIR + "/birb.js"; +const TEMP_BUNDLED_OUTPUT = DIST_DIR + "/birb.bundled.js"; const MONOCRAFT_URL = "https://cdn.jsdelivr.net/gh/idreesinc/Monocraft@99b32ab40612ff2533a69d8f14bd8b3d9e604456/dist/Monocraft.otf"; @@ -95,16 +95,16 @@ async function generateCode(entryPoint, embedFont = false) { }); await bundle.write({ - file: BUNDLED_OUTPUT, + file: TEMP_BUNDLED_OUTPUT, format: 'iife', }); await bundle.close(); - let birbJs = readFileSync(BUNDLED_OUTPUT, 'utf8'); + let birbJs = readFileSync(TEMP_BUNDLED_OUTPUT, 'utf8'); // Delete bundled file - unlinkSync(BUNDLED_OUTPUT); + unlinkSync(TEMP_BUNDLED_OUTPUT); // Replace version placeholder birbJs = birbJs.replaceAll(VERSION_KEY, version); @@ -132,11 +132,13 @@ async function generateCode(entryPoint, embedFont = false) { async function buildWeb() { const birbJs = await generateCode(WEB_ENTRY); - writeFileSync(BIRB_OUTPUT, birbJs); + mkdirSync(WEB_DIR, { recursive: true }); + writeFileSync(WEB_DIR + '/birb.js', birbJs); } async function buildUserscript() { const birbJs = await generateCode(USERSCRIPT_ENTRY); + // Get userscript header const userScriptHeader = readFileSync(USERSCRIPT_HEADER, 'utf8').replaceAll(VERSION_KEY, version); @@ -212,7 +214,7 @@ async function buildVencord() { vencordPlugin = vencordPlugin.replace(CONTEXT_KEY, "local"); // Create exported birb function - writeFileSync(VENCORD_DIR + '/birb.export.js', vencordPlugin); + writeFileSync(VENCORD_DIR + '/birb.js', vencordPlugin); } console.log("Starting build..."); diff --git a/dist/extension.zip b/dist/extension.zip index 11750926b8986857311403319b4dd6492be70831..5106474d8fcd805bb6423e1f5cde07fab9820ace 100644 GIT binary patch delta 629 zcmX|;KWI}?6vjEn9QeW~+8VyJx5?zF%S<;~(wCLEST7**Q z;BXNKMGP1aEBNOO9paGoK_?wbQ3xo+p%lSEB(${p-Fx%i^n2fT{@m~0x3t`|wA}Od zWt{5oYVlJQsz3fz9isY!c2(L{I#;B+s(9R|23HBTj<3pT9C^rS!q&@yFx)YG96ImNI0GL*_DG$dL2$HI49KK1SjNChl=_by+`$a z#pvBFx~E6YW;owMq5geG`E-juhK|5F8>J}yq^Ds;K{zt7L#@bZPS4SqGHG zem)!oA6{f%zts9Tj{$q*d>-z|B_1V6{D&*RE01pihaTSm${8*L&$66U%?w|__kM=2 z1Cv<;RCL2|9t{cKG+gyf<%z|vg?HJQD;7U2up_BTIg@5FXBxIGuurd@xA>AbwV?@v U`xb#kf5DhD1-^xWjRH^n2S|z23;+NC delta 629 zcmX|;Pe{{Y7{_^@wl%465FV5^Ap;TS4kkj({b_SLkl18(3Bq=nhagDw=%pHg2p&4T zM28|0I*1DXc@7@tVK(TL2N8pTf*oQ69z;g5)%Shh{dW5NzTfB1`+eWv;!?-rQpd(; zH)S?g+&y{9yxlAGQRdZILCy-)pQen;NBE}dT_@O*T&JrZaB`bIVMcv#P*AOv$Sb#Z zY1-9t1kRQg2IM<|d zP8Fv|b}#6q7P$1V%+~1%q6vf>FQNktiPyz-bO^+Y*2#nN@j3_EF={?ex5d*g)&Zs1 z&COo$^*xU3m)Z~WFz_eLcj1Ocd59qKAI5<%5q<fe#(G3GhH2C7CVIpoS?<{H-k^9D6wm7xG4!_DKOqycCG#puApI*CQaga2%zA=M& Ti;6{e%9zhm{1^jYQ#|$`>axA` diff --git a/dist/vencord/birb.export.js b/dist/vencord/birb.js similarity index 100% rename from dist/vencord/birb.export.js rename to dist/vencord/birb.js diff --git a/dist/birb.js b/dist/web/birb.js similarity index 100% rename from dist/birb.js rename to dist/web/birb.js