fix imports causing a crash and add missing if statment

This commit is contained in:
sadan 2024-08-20 20:58:47 -04:00
parent 982b52d6e9
commit 4f92052d49
No known key found for this signature in database
5 changed files with 73 additions and 51 deletions

48
src/debug/reporterData.ts Normal file
View file

@ -0,0 +1,48 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
/**
* this file is needed to avoid an import of plugins in ./runReporter.ts
*/
import { Patch } from "@utils/types";
import { TypeWebpackSearchHistory } from "@webpack";
interface EvaledPatch extends Patch {
id: number | string;
}
interface ReporterData {
failedPatches: {
foundNoModule: Patch[];
hadNoEffect: EvaledPatch[];
undoingPatchGroup: EvaledPatch[];
erroredPatch: EvaledPatch[];
};
failedWebpack: Record<TypeWebpackSearchHistory, string[][]>;
}
export const reporterData: ReporterData = {
failedPatches: {
foundNoModule: [],
hadNoEffect: [],
undoingPatchGroup: [],
erroredPatch: []
},
failedWebpack: {
find: [],
findByProps: [],
findByCode: [],
findStore: [],
findComponent: [],
findComponentByCode: [],
findExportedComponent: [],
waitFor: [],
waitForComponent: [],
waitForStore: [],
proxyLazyWebpack: [],
LazyComponentWebpack: [],
extractAndLoadChunks: [],
mapMangledModule: []
}
};

View file

@ -5,49 +5,13 @@
*/
import { Logger } from "@utils/Logger";
import { Patch } from "@utils/types";
import * as Webpack from "@webpack";
import { patches } from "plugins";
import { loadLazyChunks } from "./loadLazyChunks";
import { reporterData } from "./reporterData";
const ReporterLogger = new Logger("Reporter");
interface EvaledPatch extends Patch {
id: number | string;
}
interface ReporterData {
failedPatches: {
foundNoModule: Patch[];
hadNoEffect: EvaledPatch[];
undoingPatchGroup: EvaledPatch[];
erroredPatch: EvaledPatch[];
};
failedWebpack: Record<Webpack.TypeWebpackSearchHistory, string[][]>;
}
export const reporterData: ReporterData = {
failedPatches: {
foundNoModule: [],
hadNoEffect: [],
undoingPatchGroup: [],
erroredPatch: []
},
failedWebpack: {
find: [],
findByProps: [],
findByCode: [],
findStore: [],
findComponent: [],
findComponentByCode: [],
findExportedComponent: [],
waitFor: [],
waitForComponent: [],
waitForStore: [],
proxyLazyWebpack: [],
LazyComponentWebpack: [],
extractAndLoadChunks: [],
mapMangledModule: []
}
};
async function runReporter() {
try {
ReporterLogger.log("Starting test...");