Skip to content

Commit

Permalink
Fix reporter and AlwaysAnimate patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckyz committed Dec 14, 2023
1 parent a8b0ce6 commit a5442d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions scripts/generateReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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];
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/alwaysAnimate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down

0 comments on commit a5442d8

Please sign in to comment.