1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
Description: tsc workaround
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2024-08-28
--- a/webpack-cli/packages/webpack-cli/src/index.ts
+++ b/webpack-cli/packages/webpack-cli/src/index.ts
@@ -1,4 +1,5 @@
import { type IWebpackCLI } from "./types";
+// @ts-ignore
export type * from "./types";
// eslint-disable-next-line @typescript-eslint/no-var-requires
--- a/webpack-cli/packages/webpack-cli/src/webpack-cli.ts
+++ b/webpack-cli/packages/webpack-cli/src/webpack-cli.ts
@@ -1082,6 +1082,7 @@
// A list of cli flags generated by core can be found here https://github.com/webpack/webpack/blob/main/test/__snapshots__/Cli.basictest.js.snap
const options = builtInFlags.concat(
Object.entries(this.webpack.cli.getArguments()).map<WebpackCLIBuiltInOption>(
+// @ts-ignore
([name, meta]) => {
return {
...meta,
@@ -1342,6 +1343,7 @@
const levenshtein = require("fastest-levenshtein");
+// @ts-ignore
for (const option of (command as WebpackCLICommand).options) {
if (!option.hidden && levenshtein.distance(name, option.long?.slice(2)) < 3) {
this.logger.error(`Did you mean '--${option.name()}'?`);
@@ -1441,12 +1443,14 @@
.join(" ");
return `${command.name()}|${command.aliases().join("|")}${args ? ` ${args}` : ""}${
+// @ts-ignore
command.options.length > 0 ? " [options]" : ""
}`;
},
visibleOptions: function visibleOptions(
command: WebpackCLICommand,
): WebpackCLICommandOption[] {
+// @ts-ignore
return command.options.filter((option: WebpackCLICommandOption) => {
if (option.hidden) {
return false;
@@ -1535,6 +1539,7 @@
}
// Global options
+// @ts-ignore
const globalOptionList = program.options.map((option: WebpackCLICommandOption) =>
formatItem(helper.optionTerm(option), helper.optionDescription(option)),
);
@@ -1621,7 +1626,9 @@
process.exit(2);
}
+// @ts-ignore
const option = (command as WebpackCLICommand).options.find(
+// @ts-ignore
(option) => option.short === optionName || option.long === optionName,
);
@@ -2224,6 +2231,7 @@
);
if (Object.keys(values).length > 0) {
+// @ts-ignore
const problems: Problem[] | null = this.webpack.cli.processArguments(args, item, values);
if (problems) {
@@ -2405,7 +2413,7 @@
this.logger.error(error.message);
process.exit(2);
}
-
+// @ts-ignore
callback(error, stats);
}
: callback,
@@ -2499,6 +2507,7 @@
});
}
} else {
+// @ts-ignore
const printedStats = stats.toString(statsOptions);
// Avoid extra empty line when `stats: 'none'`
if (printedStats) {
|