From a5442d87d505fdc15c923a74324b0f4e9abec765 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Wed, 13 Dec 2023 21:41:09 -0300 Subject: [PATCH] Fix reporter and AlwaysAnimate patch --- scripts/generateReport.ts | 8 ++++++-- src/plugins/alwaysAnimate/index.ts | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/generateReport.ts b/scripts/generateReport.ts index 54db96e..a91e818 100644 --- a/scripts/generateReport.ts +++ b/scripts/generateReport.ts @@ -211,9 +211,12 @@ page.on("console", async e => { switch (tag) { case "WebpackInterceptor:": + const patchFailMatch = message.match(/Patch by (.+?) (had no effect|errored|found no module) \(Module id is (.+?)\): (.+)/)!; + if (!patchFailMatch) break; + process.exitCode = 1; - const [, plugin, type, id, regex] = message.match(/Patch by (.+?) (had no effect|errored|found no module) \(Module id is (.+?)\): (.+)/)!; + const [, plugin, type, id, regex] = patchFailMatch; report.badPatches.push({ plugin, type, @@ -253,7 +256,7 @@ page.on("console", async e => { ).then(a => a.join(" ").trim()); - if (text.length && !text.startsWith("Failed to load resource: the server responded with a status of") && !text.includes("found no module Filter:")) { + if (text.length && !text.startsWith("Failed to load resource: the server responded with a status of") && !text.includes("Webpack")) { console.error("[Unexpected Error]", text); report.otherErrors.push(text); } @@ -293,6 +296,7 @@ function runTime(token: string) { p.patches?.forEach(patch => { patch.plugin = p.name; delete patch.predicate; + delete patch.group; if (!Array.isArray(patch.replacement)) patch.replacement = [patch.replacement]; diff --git a/src/plugins/alwaysAnimate/index.ts b/src/plugins/alwaysAnimate/index.ts index eae5a5d..dbec3b4 100644 --- a/src/plugins/alwaysAnimate/index.ts +++ b/src/plugins/alwaysAnimate/index.ts @@ -48,9 +48,10 @@ export default definePlugin({ } }, { + // Guild Banner find: ".animatedBannerHoverLayer,onMouseEnter:", replacement: { - match: /(?<=guildBanner:\i,animate:)\i/, + match: /(?<=guildBanner:\i,animate:)\i(?=}\))/, replace: "!0" } }