Enhance refactor commands with controller-aware Route() updates and fix code quality violations
Add semantic token highlighting for 'that' variable and comment file references in VS Code extension Add Phone_Text_Input and Currency_Input components with formatting utilities Implement client widgets, form standardization, and soft delete functionality Add modal scroll lock and update documentation Implement comprehensive modal system with form integration and validation Fix modal component instantiation using jQuery plugin API Implement modal system with responsive sizing, queuing, and validation support Implement form submission with validation, error handling, and loading states Implement country/state selectors with dynamic data loading and Bootstrap styling Revert Rsx::Route() highlighting in Blade/PHP files Target specific PHP scopes for Rsx::Route() highlighting in Blade Expand injection selector for Rsx::Route() highlighting Add custom syntax highlighting for Rsx::Route() and Rsx.Route() calls Update jqhtml packages to v2.2.165 Add bundle path validation for common mistakes (development mode only) Create Ajax_Select_Input widget and Rsx_Reference_Data controller Create Country_Select_Input widget with default country support Initialize Tom Select on Select_Input widgets Add Tom Select bundle for enhanced select dropdowns Implement ISO 3166 geographic data system for country/region selection Implement widget-based form system with disabled state support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
274
node_modules/webpack/lib/stats/DefaultStatsFactoryPlugin.js
generated
vendored
Executable file → Normal file
274
node_modules/webpack/lib/stats/DefaultStatsFactoryPlugin.js
generated
vendored
Executable file → Normal file
@@ -25,6 +25,9 @@ const {
|
||||
const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
|
||||
/** @typedef {import("webpack-sources").Source} Source */
|
||||
/** @typedef {import("../../declarations/WebpackOptions").StatsValue} StatsValue */
|
||||
/** @typedef {import("./StatsFactory")} StatsFactory */
|
||||
/** @typedef {import("./StatsFactory").StatsFactoryContext} StatsFactoryContext */
|
||||
/** @typedef {import("../Chunk")} Chunk */
|
||||
/** @typedef {import("../Chunk").ChunkId} ChunkId */
|
||||
/** @typedef {import("../Chunk").ChunkName} ChunkName */
|
||||
@@ -41,15 +44,12 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
/** @typedef {import("../Dependency")} Dependency */
|
||||
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
|
||||
/** @typedef {import("../Module")} Module */
|
||||
/** @typedef {import("../Module").NameForCondition} NameForCondition */
|
||||
/** @typedef {import("../Module").BuildInfo} BuildInfo */
|
||||
/** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */
|
||||
/** @typedef {import("../ModuleProfile")} ModuleProfile */
|
||||
/** @typedef {import("../RequestShortener")} RequestShortener */
|
||||
/** @typedef {import("../TemplatedPathPlugin").TemplatePath} TemplatePath */
|
||||
/** @typedef {import("../WebpackError")} WebpackError */
|
||||
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
|
||||
/** @typedef {import("./StatsFactory")} StatsFactory */
|
||||
/** @typedef {import("./StatsFactory").StatsFactoryContext} StatsFactoryContext */
|
||||
/** @typedef {import("../ExportsInfo").ExportInfoName} ExportInfoName */
|
||||
|
||||
/**
|
||||
* @template T
|
||||
@@ -57,8 +57,8 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template T, R
|
||||
* @typedef {import("../util/smartGrouping").GroupConfig<T, R>} GroupConfig
|
||||
* @template I, G
|
||||
* @typedef {import("../util/smartGrouping").GroupConfig<I, G>} GroupConfig
|
||||
*/
|
||||
|
||||
/** @typedef {KnownStatsCompilation & Record<string, EXPECTED_ANY>} StatsCompilation */
|
||||
@@ -111,9 +111,7 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
*/
|
||||
|
||||
/** @typedef {KnownStatsAsset & Record<string, EXPECTED_ANY>} StatsAsset */
|
||||
/** @typedef {ChunkId} KnownStatsAssetChunk */
|
||||
/** @typedef {ChunkName} KnownStatsAssetChunkName */
|
||||
/** @typedef {string} KnownStatsAssetChunkIdHint */
|
||||
/** @typedef {string[]} ChunkIdHints */
|
||||
/**
|
||||
* @typedef {object} KnownStatsAsset
|
||||
* @property {string} type
|
||||
@@ -124,12 +122,12 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
* @property {boolean} comparedForEmit
|
||||
* @property {boolean} cached
|
||||
* @property {StatsAsset[]=} related
|
||||
* @property {KnownStatsAssetChunk[]=} chunks
|
||||
* @property {KnownStatsAssetChunkName[]=} chunkNames
|
||||
* @property {KnownStatsAssetChunkIdHint[]=} chunkIdHints
|
||||
* @property {KnownStatsAssetChunk[]=} auxiliaryChunks
|
||||
* @property {KnownStatsAssetChunkName[]=} auxiliaryChunkNames
|
||||
* @property {KnownStatsAssetChunkIdHint[]=} auxiliaryChunkIdHints
|
||||
* @property {ChunkId[]=} chunks
|
||||
* @property {ChunkName[]=} chunkNames
|
||||
* @property {ChunkIdHints=} chunkIdHints
|
||||
* @property {ChunkId[]=} auxiliaryChunks
|
||||
* @property {ChunkName[]=} auxiliaryChunkNames
|
||||
* @property {ChunkIdHints=} auxiliaryChunkIdHints
|
||||
* @property {number=} filteredRelated
|
||||
* @property {boolean=} isOverSizeLimit
|
||||
*/
|
||||
@@ -137,16 +135,16 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
/** @typedef {KnownStatsChunkGroup & Record<string, EXPECTED_ANY>} StatsChunkGroup */
|
||||
/**
|
||||
* @typedef {object} KnownStatsChunkGroup
|
||||
* @property {(string | null)=} name
|
||||
* @property {(string | number)[]=} chunks
|
||||
* @property {ChunkName=} name
|
||||
* @property {ChunkId[]=} chunks
|
||||
* @property {({ name: string, size?: number })[]=} assets
|
||||
* @property {number=} filteredAssets
|
||||
* @property {number=} assetsSize
|
||||
* @property {({ name: string, size?: number })[]=} auxiliaryAssets
|
||||
* @property {number=} filteredAuxiliaryAssets
|
||||
* @property {number=} auxiliaryAssetsSize
|
||||
* @property {{ [x: string]: StatsChunkGroup[] }=} children
|
||||
* @property {{ [x: string]: string[] }=} childAssets
|
||||
* @property {Record<string, StatsChunkGroup[]>=} children
|
||||
* @property {Record<string, string[]>=} childAssets
|
||||
* @property {boolean=} isOverSizeLimit
|
||||
*/
|
||||
|
||||
@@ -159,13 +157,13 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
* @property {(string | null)=} layer
|
||||
* @property {string=} identifier
|
||||
* @property {string=} name
|
||||
* @property {(string | null)=} nameForCondition
|
||||
* @property {NameForCondition | null=} nameForCondition
|
||||
* @property {number=} index
|
||||
* @property {number=} preOrderIndex
|
||||
* @property {number=} index2
|
||||
* @property {number=} postOrderIndex
|
||||
* @property {number=} size
|
||||
* @property {{ [x: string]: number }=} sizes
|
||||
* @property {Record<string, number>=} sizes
|
||||
* @property {boolean=} cacheable
|
||||
* @property {boolean=} built
|
||||
* @property {boolean=} codeGenerated
|
||||
@@ -173,10 +171,10 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
* @property {boolean=} cached
|
||||
* @property {boolean=} optional
|
||||
* @property {boolean=} orphan
|
||||
* @property {string | number=} id
|
||||
* @property {string | number | null=} issuerId
|
||||
* @property {(string | number)[]=} chunks
|
||||
* @property {(string | number)[]=} assets
|
||||
* @property {ModuleId=} id
|
||||
* @property {ModuleId | null=} issuerId
|
||||
* @property {ChunkId[]=} chunks
|
||||
* @property {string[]=} assets
|
||||
* @property {boolean=} dependent
|
||||
* @property {(string | null)=} issuer
|
||||
* @property {(string | null)=} issuerName
|
||||
@@ -186,8 +184,8 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
* @property {number=} warnings
|
||||
* @property {StatsProfile=} profile
|
||||
* @property {StatsModuleReason[]=} reasons
|
||||
* @property {(boolean | null | string[])=} usedExports
|
||||
* @property {(string[] | null)=} providedExports
|
||||
* @property {boolean | null | ExportInfoName[]=} usedExports
|
||||
* @property {ExportInfoName[] | null=} providedExports
|
||||
* @property {string[]=} optimizationBailout
|
||||
* @property {(number | null)=} depth
|
||||
* @property {StatsModule[]=} modules
|
||||
@@ -215,7 +213,7 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
* @typedef {object} KnownStatsModuleIssuer
|
||||
* @property {string} identifier
|
||||
* @property {string} name
|
||||
* @property {(string|number)=} id
|
||||
* @property {ModuleId=} id
|
||||
* @property {StatsProfile} profile
|
||||
*/
|
||||
|
||||
@@ -232,8 +230,8 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
* @property {string | null} explanation
|
||||
* @property {string | null} userRequest
|
||||
* @property {(string | null)=} loc
|
||||
* @property {(string | number | null)=} moduleId
|
||||
* @property {(string | number | null)=} resolvedModuleId
|
||||
* @property {ModuleId | null=} moduleId
|
||||
* @property {ModuleId | null=} resolvedModuleId
|
||||
*/
|
||||
|
||||
/** @typedef {KnownStatsChunk & Record<string, EXPECTED_ANY>} StatsChunk */
|
||||
@@ -253,10 +251,10 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
* @property {string[]} auxiliaryFiles
|
||||
* @property {string} hash
|
||||
* @property {Record<string, ChunkId[]>} childrenByOrder
|
||||
* @property {(string|number)=} id
|
||||
* @property {(string|number)[]=} siblings
|
||||
* @property {(string|number)[]=} parents
|
||||
* @property {(string|number)[]=} children
|
||||
* @property {ChunkId=} id
|
||||
* @property {ChunkId[]=} siblings
|
||||
* @property {ChunkId[]=} parents
|
||||
* @property {ChunkId[]=} children
|
||||
* @property {StatsModule[]=} modules
|
||||
* @property {number=} filteredModules
|
||||
* @property {StatsChunkOrigin[]=} origins
|
||||
@@ -270,7 +268,7 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
* @property {string} moduleName
|
||||
* @property {string} loc
|
||||
* @property {string} request
|
||||
* @property {(string | number)=} moduleId
|
||||
* @property {ModuleId=} moduleId
|
||||
*/
|
||||
|
||||
/** @typedef {KnownStatsModuleTraceItem & Record<string, EXPECTED_ANY>} StatsModuleTraceItem */
|
||||
@@ -281,8 +279,8 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
* @property {string=} moduleIdentifier
|
||||
* @property {string=} moduleName
|
||||
* @property {StatsModuleTraceDependency[]=} dependencies
|
||||
* @property {(string|number)=} originId
|
||||
* @property {(string|number)=} moduleId
|
||||
* @property {ModuleId=} originId
|
||||
* @property {ModuleId=} moduleId
|
||||
*/
|
||||
|
||||
/** @typedef {KnownStatsModuleTraceDependency & Record<string, EXPECTED_ANY>} StatsModuleTraceDependency */
|
||||
@@ -303,7 +301,7 @@ const { makePathsRelative, parseResource } = require("../util/identifier");
|
||||
* @property {string=} moduleName
|
||||
* @property {string=} loc
|
||||
* @property {ChunkId=} chunkId
|
||||
* @property {string|number=} moduleId
|
||||
* @property {ModuleId=} moduleId
|
||||
* @property {StatsModuleTraceItem[]=} moduleTrace
|
||||
* @property {string=} details
|
||||
* @property {string=} stack
|
||||
@@ -555,6 +553,7 @@ const SIMPLE_EXTRACTORS = {
|
||||
);
|
||||
}
|
||||
if (!context.cachedGetErrors) {
|
||||
/** @type {WeakMap<Compilation, Error[]>} */
|
||||
const map = new WeakMap();
|
||||
context.cachedGetErrors = (compilation) =>
|
||||
map.get(compilation) ||
|
||||
@@ -564,6 +563,7 @@ const SIMPLE_EXTRACTORS = {
|
||||
);
|
||||
}
|
||||
if (!context.cachedGetWarnings) {
|
||||
/** @type {WeakMap<Compilation, Error[]>} */
|
||||
const map = new WeakMap();
|
||||
context.cachedGetWarnings = (compilation) =>
|
||||
map.get(compilation) ||
|
||||
@@ -722,7 +722,7 @@ const SIMPLE_EXTRACTORS = {
|
||||
}
|
||||
},
|
||||
hash: (object, compilation) => {
|
||||
object.hash = /** @type {string} */ (compilation.hash);
|
||||
object.hash = compilation.hash;
|
||||
},
|
||||
version: (object) => {
|
||||
object.version = require("../../package.json").version;
|
||||
@@ -740,14 +740,11 @@ const SIMPLE_EXTRACTORS = {
|
||||
},
|
||||
publicPath: (object, compilation) => {
|
||||
object.publicPath = compilation.getPath(
|
||||
/** @type {TemplatePath} */
|
||||
(compilation.outputOptions.publicPath)
|
||||
compilation.outputOptions.publicPath
|
||||
);
|
||||
},
|
||||
outputPath: (object, compilation) => {
|
||||
object.outputPath = /** @type {string} */ (
|
||||
compilation.outputOptions.path
|
||||
);
|
||||
object.outputPath = compilation.outputOptions.path;
|
||||
},
|
||||
assets: (object, compilation, context, options, factory) => {
|
||||
const { type } = context;
|
||||
@@ -808,7 +805,10 @@ const SIMPLE_EXTRACTORS = {
|
||||
}
|
||||
|
||||
object.assetsByChunkName = {};
|
||||
for (const [file, chunks] of compilationFileToChunks) {
|
||||
for (const [file, chunks] of [
|
||||
...compilationFileToChunks,
|
||||
...compilationAuxiliaryFileToChunks
|
||||
]) {
|
||||
for (const chunk of chunks) {
|
||||
const name = chunk.name;
|
||||
if (!name) continue;
|
||||
@@ -913,7 +913,10 @@ const SIMPLE_EXTRACTORS = {
|
||||
let filtered = 0;
|
||||
if (options.errorDetails === "auto" && rawErrors.length >= 3) {
|
||||
filtered = rawErrors
|
||||
.map((e) => typeof e !== "string" && e.details)
|
||||
.map(
|
||||
(e) =>
|
||||
typeof e !== "string" && /** @type {WebpackError} */ (e).details
|
||||
)
|
||||
.filter(Boolean).length;
|
||||
}
|
||||
if (
|
||||
@@ -947,7 +950,10 @@ const SIMPLE_EXTRACTORS = {
|
||||
let filtered = 0;
|
||||
if (options.errorDetails === "auto") {
|
||||
filtered = cachedGetWarnings(compilation)
|
||||
.map((e) => typeof e !== "string" && e.details)
|
||||
.map(
|
||||
(e) =>
|
||||
typeof e !== "string" && /** @type {WebpackError} */ (e).details
|
||||
)
|
||||
.filter(Boolean).length;
|
||||
}
|
||||
if (
|
||||
@@ -1526,11 +1532,12 @@ const SIMPLE_EXTRACTORS = {
|
||||
object.id = /** @type {ChunkId} */ (chunk.id);
|
||||
},
|
||||
chunkRelations: (object, chunk, _context) => {
|
||||
/** @type {Set<string|number>} */
|
||||
/** @typedef {Set<ChunkId>} ChunkRelations */
|
||||
/** @type {ChunkRelations} */
|
||||
const parents = new Set();
|
||||
/** @type {Set<string|number>} */
|
||||
/** @type {ChunkRelations} */
|
||||
const children = new Set();
|
||||
/** @type {Set<string|number>} */
|
||||
/** @type {ChunkRelations} */
|
||||
const siblings = new Set();
|
||||
|
||||
for (const chunkGroup of chunk.groupsIterable) {
|
||||
@@ -1696,7 +1703,17 @@ const MODULES_SORTER = {
|
||||
}
|
||||
};
|
||||
|
||||
/** @type {Record<string, Record<string, (comparators: Comparator<TODO>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>>} */
|
||||
/**
|
||||
* @type {{
|
||||
* "compilation.chunks": Record<string, (comparators: Comparator<Chunk>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>,
|
||||
* "compilation.modules": Record<string, (comparators: Comparator<Module>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>,
|
||||
* "chunk.rootModules": Record<string, (comparators: Comparator<Module>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>,
|
||||
* "chunk.modules": Record<string, (comparators: Comparator<Module>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>,
|
||||
* "module.modules": Record<string, (comparators: Comparator<Module>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>,
|
||||
* "module.reasons": Record<string, (comparators: Comparator<ModuleGraphConnection>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>,
|
||||
* "chunk.origins": Record<string, (comparators: Comparator<OriginRecord>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>,
|
||||
* }}
|
||||
*/
|
||||
const SORTERS = {
|
||||
"compilation.chunks": {
|
||||
_: (comparators) => {
|
||||
@@ -2015,8 +2032,7 @@ const errorsSpaceLimit = (errors, max) => {
|
||||
|
||||
/**
|
||||
* @template {{ size: number }} T
|
||||
* @template {{ size: number }} R
|
||||
* @param {(R | T)[]} children children
|
||||
* @param {T[]} children children
|
||||
* @param {T[]} assets assets
|
||||
* @returns {{ size: number }} asset size
|
||||
*/
|
||||
@@ -2028,11 +2044,13 @@ const assetGroup = (children, assets) => {
|
||||
return { size };
|
||||
};
|
||||
|
||||
/** @typedef {{ size: number, sizes: Record<string, number> }} ModuleGroupBySizeResult */
|
||||
|
||||
/**
|
||||
* @template {{ size: number, sizes: Record<string, number> }} T
|
||||
* @template {ModuleGroupBySizeResult} T
|
||||
* @param {Children<T>[]} children children
|
||||
* @param {KnownStatsModule[]} modules modules
|
||||
* @returns {{ size: number, sizes: Record<string, number>}} size and sizes
|
||||
* @returns {ModuleGroupBySizeResult} size and sizes
|
||||
*/
|
||||
const moduleGroup = (children, modules) => {
|
||||
let size = 0;
|
||||
@@ -2069,7 +2087,21 @@ const reasonGroup = (children, reasons) => {
|
||||
const GROUP_EXTENSION_REGEXP = /(\.[^.]+?)(?:\?|(?: \+ \d+ modules?)?$)/;
|
||||
const GROUP_PATH_REGEXP = /(.+)[/\\][^/\\]+?(?:\?|(?: \+ \d+ modules?)?$)/;
|
||||
|
||||
/** @typedef {Record<string, (groupConfigs: GroupConfig<KnownStatsAsset, TODO>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>} AssetsGroupers */
|
||||
/** @typedef {{ type: string }} BaseGroup */
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {BaseGroup & { children: T[], size: number }} BaseGroupWithChildren
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
* _: (groupConfigs: GroupConfig<KnownStatsAsset, BaseGroup & { filteredChildren: number, size: number } | BaseGroupWithChildren<KnownStatsAsset>>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void,
|
||||
* groupAssetsByInfo: (groupConfigs: GroupConfig<KnownStatsAsset, BaseGroupWithChildren<KnownStatsAsset>>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void,
|
||||
* groupAssetsByChunk: (groupConfigs: GroupConfig<KnownStatsAsset, BaseGroupWithChildren<KnownStatsAsset>>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void,
|
||||
* excludeAssets: (groupConfigs: GroupConfig<KnownStatsAsset, BaseGroup & { filteredChildren: number, size: number }>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void,
|
||||
* }} AssetsGroupers
|
||||
*/
|
||||
|
||||
/** @type {AssetsGroupers} */
|
||||
const ASSETS_GROUPERS = {
|
||||
@@ -2214,9 +2246,16 @@ const ASSETS_GROUPERS = {
|
||||
}
|
||||
};
|
||||
|
||||
/** @typedef {Record<string, (groupConfigs: GroupConfig<KnownStatsModule, TODO>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>} ModulesGroupers */
|
||||
/**
|
||||
* @typedef {{
|
||||
* _: (groupConfigs: GroupConfig<KnownStatsModule, BaseGroup & { filteredChildren?: number, children?: KnownStatsModule[], size: number, sizes: Record<string, number> }>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void,
|
||||
* excludeModules: (groupConfigs: GroupConfig<KnownStatsModule, BaseGroup & { filteredChildren: number, size: number, sizes: Record<string, number> }>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void,
|
||||
* }} ModulesGroupers
|
||||
*/
|
||||
|
||||
/** @type {(type: ExcludeModulesType) => ModulesGroupers} */
|
||||
/**
|
||||
* @type {(type: ExcludeModulesType) => ModulesGroupers}
|
||||
*/
|
||||
const MODULES_GROUPERS = (type) => ({
|
||||
_: (groupConfigs, context, options) => {
|
||||
/**
|
||||
@@ -2235,7 +2274,11 @@ const MODULES_GROUPERS = (type) => ({
|
||||
type,
|
||||
[name]: Boolean(key),
|
||||
...(exclude ? { filteredChildren: modules.length } : { children }),
|
||||
...moduleGroup(children, modules)
|
||||
...moduleGroup(
|
||||
/** @type {(KnownStatsModule & ModuleGroupBySizeResult)[]} */
|
||||
(children),
|
||||
modules
|
||||
)
|
||||
})
|
||||
});
|
||||
};
|
||||
@@ -2292,7 +2335,11 @@ const MODULES_GROUPERS = (type) => ({
|
||||
type: `${key} modules`,
|
||||
moduleType: key,
|
||||
...(exclude ? { filteredChildren: modules.length } : { children }),
|
||||
...moduleGroup(children, modules)
|
||||
...moduleGroup(
|
||||
/** @type {(KnownStatsModule & ModuleGroupBySizeResult)[]} */
|
||||
(children),
|
||||
modules
|
||||
)
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -2304,7 +2351,11 @@ const MODULES_GROUPERS = (type) => ({
|
||||
type: "modules by layer",
|
||||
layer: key,
|
||||
children,
|
||||
...moduleGroup(children, modules)
|
||||
...moduleGroup(
|
||||
/** @type {(KnownStatsModule & ModuleGroupBySizeResult)[]} */
|
||||
(children),
|
||||
modules
|
||||
)
|
||||
})
|
||||
});
|
||||
}
|
||||
@@ -2351,7 +2402,11 @@ const MODULES_GROUPERS = (type) => ({
|
||||
: "modules by extension",
|
||||
name: isDataUrl ? key.slice(/* 'data:'.length */ 5) : key,
|
||||
children,
|
||||
...moduleGroup(children, modules)
|
||||
...moduleGroup(
|
||||
/** @type {(KnownStatsModule & ModuleGroupBySizeResult)[]} */
|
||||
(children),
|
||||
modules
|
||||
)
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -2373,13 +2428,21 @@ const MODULES_GROUPERS = (type) => ({
|
||||
createGroup: (key, children, modules) => ({
|
||||
type: "hidden modules",
|
||||
filteredChildren: children.length,
|
||||
...moduleGroup(children, modules)
|
||||
...moduleGroup(
|
||||
/** @type {(KnownStatsModule & ModuleGroupBySizeResult)[]} */
|
||||
(children),
|
||||
modules
|
||||
)
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/** @typedef {Record<string, (groupConfigs: GroupConfig<KnownStatsModuleReason, TODO>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>} ModuleReasonsGroupers */
|
||||
/**
|
||||
* @typedef {{
|
||||
* groupReasonsByOrigin: (groupConfigs: GroupConfig<KnownStatsModuleReason, BaseGroup & { module: string, children: KnownStatsModuleReason[], active: boolean }>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void
|
||||
* }} ModuleReasonsGroupers
|
||||
*/
|
||||
|
||||
/** @type {ModuleReasonsGroupers} */
|
||||
const MODULE_REASONS_GROUPERS = {
|
||||
@@ -2396,7 +2459,17 @@ const MODULE_REASONS_GROUPERS = {
|
||||
}
|
||||
};
|
||||
|
||||
/** @type {Record<string, AssetsGroupers | ModulesGroupers | ModuleReasonsGroupers>} */
|
||||
/**
|
||||
* @type {{
|
||||
* "compilation.assets": AssetsGroupers,
|
||||
* "asset.related": AssetsGroupers,
|
||||
* "compilation.modules": ModulesGroupers,
|
||||
* "chunk.modules": ModulesGroupers,
|
||||
* "chunk.rootModules": ModulesGroupers,
|
||||
* "module.modules": ModulesGroupers,
|
||||
* "module.reasons": ModuleReasonsGroupers,
|
||||
* }}
|
||||
*/
|
||||
const RESULT_GROUPERS = {
|
||||
"compilation.assets": ASSETS_GROUPERS,
|
||||
"asset.related": ASSETS_GROUPERS,
|
||||
@@ -2462,7 +2535,14 @@ const sortByField = (field) => {
|
||||
return sortFn;
|
||||
};
|
||||
|
||||
/** @type {Record<string, (comparators: Comparator<Asset>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>} */
|
||||
/**
|
||||
* @typedef {{
|
||||
* assetsSort: (comparators: Comparator<Asset>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void,
|
||||
* _: (comparators: Comparator<Asset>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void
|
||||
* }} AssetSorters
|
||||
*/
|
||||
|
||||
/** @type {AssetSorters} */
|
||||
const ASSET_SORTERS = {
|
||||
assetsSort: (comparators, context, { assetsSort }) => {
|
||||
comparators.push(sortByField(assetsSort));
|
||||
@@ -2472,7 +2552,16 @@ const ASSET_SORTERS = {
|
||||
}
|
||||
};
|
||||
|
||||
/** @type {Record<string, Record<string, (comparators: Comparator<TODO>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void>>} */
|
||||
/**
|
||||
* @type {{
|
||||
* "compilation.chunks": { chunksSort: (comparators: Comparator<Chunk>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void },
|
||||
* "compilation.modules": { modulesSort: (comparators: Comparator<Module>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void },
|
||||
* "chunk.modules": { chunkModulesSort: (comparators: Comparator<Module>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void },
|
||||
* "module.modules": { nestedModulesSort: (comparators: Comparator<Module>[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void },
|
||||
* "compilation.assets": AssetSorters,
|
||||
* "asset.related": AssetSorters,
|
||||
* }}
|
||||
*/
|
||||
const RESULT_SORTERS = {
|
||||
"compilation.chunks": {
|
||||
chunksSort: (comparators, context, { chunksSort }) => {
|
||||
@@ -2500,9 +2589,14 @@ const RESULT_SORTERS = {
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @param {Record<string, Record<string, T>>} config the config see above
|
||||
* @typedef {T extends Record<string, Record<string, infer F>> ? F : never} ExtractFunction
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {Record<string, Record<string, EXPECTED_ANY>>} T
|
||||
* @param {T} config the config see above
|
||||
* @param {NormalizedStatsOptions} options stats options
|
||||
* @param {(hookFor: string, fn: T) => void} fn handler function called for every active line in config
|
||||
* @param {(hookFor: keyof T, fn: ExtractFunction<T>) => void} fn handler function called for every active line in config
|
||||
* @returns {void}
|
||||
*/
|
||||
const iterateConfig = (config, options, fn) => {
|
||||
@@ -2596,18 +2690,13 @@ class DefaultStatsFactoryPlugin {
|
||||
* @param {NormalizedStatsOptions} options stats options
|
||||
*/
|
||||
(stats, options) => {
|
||||
iterateConfig(
|
||||
/** @type {TODO} */
|
||||
(SIMPLE_EXTRACTORS),
|
||||
options,
|
||||
(hookFor, fn) => {
|
||||
stats.hooks.extract
|
||||
.for(hookFor)
|
||||
.tap(PLUGIN_NAME, (obj, data, ctx) =>
|
||||
fn(obj, data, ctx, options, stats)
|
||||
);
|
||||
}
|
||||
);
|
||||
iterateConfig(SIMPLE_EXTRACTORS, options, (hookFor, fn) => {
|
||||
stats.hooks.extract
|
||||
.for(hookFor)
|
||||
.tap(PLUGIN_NAME, (obj, data, ctx) =>
|
||||
fn(obj, data, ctx, options, stats)
|
||||
);
|
||||
});
|
||||
iterateConfig(FILTER, options, (hookFor, fn) => {
|
||||
stats.hooks.filter
|
||||
.for(hookFor)
|
||||
@@ -2636,18 +2725,13 @@ class DefaultStatsFactoryPlugin {
|
||||
fn(comparators, ctx, options)
|
||||
);
|
||||
});
|
||||
iterateConfig(
|
||||
/** @type {TODO} */
|
||||
(RESULT_GROUPERS),
|
||||
options,
|
||||
(hookFor, fn) => {
|
||||
stats.hooks.groupResults
|
||||
.for(hookFor)
|
||||
.tap(PLUGIN_NAME, (groupConfigs, ctx) =>
|
||||
fn(groupConfigs, ctx, options)
|
||||
);
|
||||
}
|
||||
);
|
||||
iterateConfig(RESULT_GROUPERS, options, (hookFor, fn) => {
|
||||
stats.hooks.groupResults
|
||||
.for(hookFor)
|
||||
.tap(PLUGIN_NAME, (groupConfigs, ctx) =>
|
||||
fn(groupConfigs, ctx, options)
|
||||
);
|
||||
});
|
||||
for (const key of Object.keys(ITEM_NAMES)) {
|
||||
const itemName = ITEM_NAMES[key];
|
||||
stats.hooks.getItemName.for(key).tap(PLUGIN_NAME, () => itemName);
|
||||
@@ -2669,7 +2753,7 @@ class DefaultStatsFactoryPlugin {
|
||||
*/
|
||||
(comp, { _index: idx }) => {
|
||||
const children =
|
||||
/** @type {TODO} */
|
||||
/** @type {StatsValue[]} */
|
||||
(options.children);
|
||||
if (idx < children.length) {
|
||||
return compilation.createStatsFactory(
|
||||
|
||||
24
node_modules/webpack/lib/stats/DefaultStatsPresetPlugin.js
generated
vendored
Executable file → Normal file
24
node_modules/webpack/lib/stats/DefaultStatsPresetPlugin.js
generated
vendored
Executable file → Normal file
@@ -284,10 +284,15 @@ const DEFAULTS = {
|
||||
colors: () => false
|
||||
};
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {(value: T, ...args: EXPECTED_ANY[]) => boolean} NormalizeFunction
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {string} T
|
||||
* @param {string | ({ test: (value: T) => boolean }) | ((value: T, ...args: EXPECTED_ANY[]) => boolean) | boolean} item item to normalize
|
||||
* @returns {(value: T, ...args: EXPECTED_ANY[]) => boolean} normalize fn
|
||||
* @param {string | ({ test: (value: T) => boolean }) | NormalizeFunction<T> | boolean} item item to normalize
|
||||
* @returns {NormalizeFunction<T>} normalize fn
|
||||
*/
|
||||
const normalizeFilter = (item) => {
|
||||
if (typeof item === "string") {
|
||||
@@ -303,12 +308,19 @@ const normalizeFilter = (item) => {
|
||||
return () => item;
|
||||
}
|
||||
|
||||
return /** @type {(value: T, ...args: EXPECTED_ANY[]) => boolean} */ (item);
|
||||
return /** @type {NormalizeFunction<T>} */ (item);
|
||||
};
|
||||
|
||||
/** @typedef {keyof (KnownNormalizedStatsOptions | StatsOptions)} NormalizerKeys */
|
||||
/** @typedef {{ [Key in NormalizerKeys]?: (value: StatsOptions[Key]) => KnownNormalizedStatsOptions[Key] }} Normalizers */
|
||||
|
||||
/**
|
||||
* @callback WarningFilterFn
|
||||
* @param {StatsError} warning warning
|
||||
* @param {string} warningString warning string
|
||||
* @returns {boolean} result
|
||||
*/
|
||||
|
||||
/** @type {Normalizers} */
|
||||
const NORMALIZER = {
|
||||
excludeModules: (value) => {
|
||||
@@ -329,12 +341,6 @@ const NORMALIZER = {
|
||||
if (!Array.isArray(value)) {
|
||||
value = value ? [value] : [];
|
||||
}
|
||||
/**
|
||||
* @callback WarningFilterFn
|
||||
* @param {StatsError} warning warning
|
||||
* @param {string} warningString warning string
|
||||
* @returns {boolean} result
|
||||
*/
|
||||
return value.map(
|
||||
/**
|
||||
* @param {StatsOptions["warningsFilter"]} filter a warning filter
|
||||
|
||||
190
node_modules/webpack/lib/stats/DefaultStatsPrinterPlugin.js
generated
vendored
Executable file → Normal file
190
node_modules/webpack/lib/stats/DefaultStatsPrinterPlugin.js
generated
vendored
Executable file → Normal file
@@ -10,9 +10,6 @@
|
||||
/** @typedef {import("./DefaultStatsFactoryPlugin").ChunkId} ChunkId */
|
||||
/** @typedef {import("./DefaultStatsFactoryPlugin").ChunkName} ChunkName */
|
||||
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsAsset} KnownStatsAsset */
|
||||
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsAssetChunk} KnownStatsAssetChunk */
|
||||
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsAssetChunkIdHint} KnownStatsAssetChunkIdHint */
|
||||
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsAssetChunkName} KnownStatsAssetChunkName */
|
||||
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsChunk} KnownStatsChunk */
|
||||
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsChunkGroup} KnownStatsChunkGroup */
|
||||
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsChunkOrigin} KnownStatsChunkOrigin */
|
||||
@@ -128,7 +125,7 @@ const isValidId = (id) => {
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @param {Array<T> | undefined} list of items
|
||||
* @param {T[] | undefined} list of items
|
||||
* @param {number} count number of items to show
|
||||
* @returns {string} string representation of list
|
||||
*/
|
||||
@@ -161,21 +158,14 @@ const moreCount = (list, count) =>
|
||||
* @template {object} O
|
||||
* @template {keyof O} K
|
||||
* @template {string} B
|
||||
* @typedef {K extends string ? Exclude<O[K], undefined> extends EXPECTED_ANY[] ? never : `${B}.${K}` : never} PropertyName
|
||||
* @typedef {K extends string ? `${B}.${K}` : never} PropertyName
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {object} O
|
||||
* @template {keyof O} K
|
||||
* @template {string} B
|
||||
* @typedef {K extends string ? NonNullable<O[K]> extends EXPECTED_ANY[] ? `${B}.${K}[]` : never : never} ArrayPropertyName
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {object} O
|
||||
* @template {keyof O} K
|
||||
* @template {string} B
|
||||
* @typedef {K extends string ? Exclude<O[K], undefined> extends EXPECTED_ANY[] ? `${B}.${K}` : never : never} MultiplePropertyName
|
||||
* @typedef {K extends string ? `${B}.${K}[]` : never} ArrayPropertyName
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -190,9 +180,7 @@ const moreCount = (list, count) =>
|
||||
* @template {string} B
|
||||
* @template {string} [R=B]
|
||||
* @typedef {{ [K in keyof O as PropertyName<O, K, B>]?: SimplePrinter<O[K], R> } &
|
||||
* { [K in keyof O as ArrayPropertyName<O, K, B>]?: Exclude<O[K], undefined> extends (infer I)[] ? SimplePrinter<I, R> : never } &
|
||||
* { [K in keyof O as MultiplePropertyName<O, K, B>]?: SimplePrinter<O[K], R> }
|
||||
* } Printers
|
||||
* { [K in keyof O as ArrayPropertyName<O, K, B>]?: Exclude<O[K], undefined> extends (infer I)[] ? SimplePrinter<I, R> : never }} Printers
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -421,9 +409,9 @@ const COMPILATION_SIMPLE_PRINTERS = {
|
||||
* Printers<KnownStatsAsset["info"], "asset.info"> &
|
||||
* Exclamation<KnownStatsAsset, "asset.separator", "asset"> &
|
||||
* { ["asset.filteredChildren"]?: SimplePrinter<number, "asset"> } &
|
||||
* { assetChunk?: SimplePrinter<KnownStatsAssetChunk, "asset"> } &
|
||||
* { assetChunkName?: SimplePrinter<KnownStatsAssetChunkName, "asset"> } &
|
||||
* { assetChunkIdHint?: SimplePrinter<KnownStatsAssetChunkIdHint, "asset"> }} AssetSimplePrinters
|
||||
* { assetChunk?: SimplePrinter<ChunkId, "asset"> } &
|
||||
* { assetChunkName?: SimplePrinter<ChunkName, "asset"> } &
|
||||
* { assetChunkIdHint?: SimplePrinter<string, "asset"> }} AssetSimplePrinters
|
||||
*/
|
||||
|
||||
/** @type {AssetSimplePrinters} */
|
||||
@@ -473,7 +461,6 @@ const ASSET_SIMPLE_PRINTERS = {
|
||||
: undefined,
|
||||
|
||||
assetChunk: (id, { formatChunkId }) => formatChunkId(id),
|
||||
|
||||
assetChunkName: (name) => name || undefined,
|
||||
assetChunkIdHint: (name) => name || undefined
|
||||
};
|
||||
@@ -1463,7 +1450,12 @@ const AVAILABLE_COLORS = {
|
||||
* @typedef {T extends [infer Head, ...infer Tail] ? Tail : undefined} Tail
|
||||
*/
|
||||
|
||||
/** @typedef {Required<{ [Key in keyof KnownStatsPrinterFormatters]: (value: Parameters<NonNullable<KnownStatsPrinterFormatters[Key]>>[0], options: Required<KnownStatsPrinterColorFunctions> & StatsPrinterContextWithExtra, ...args: Tail<Parameters<NonNullable<KnownStatsPrinterFormatters[Key]>>>) => string }>} AvailableFormats */
|
||||
/**
|
||||
* @template {(...args: EXPECTED_ANY[]) => EXPECTED_ANY} T
|
||||
* @typedef {T extends (firstArg: EXPECTED_ANY, ...rest: infer R) => EXPECTED_ANY ? R : never} TailParameters
|
||||
*/
|
||||
|
||||
/** @typedef {{ [Key in keyof KnownStatsPrinterFormatters]: (value: Parameters<NonNullable<KnownStatsPrinterFormatters[Key]>>[0], options: Required<KnownStatsPrinterColorFunctions> & StatsPrinterContextWithExtra, ...args: TailParameters<NonNullable<KnownStatsPrinterFormatters[Key]>>) => string }} AvailableFormats */
|
||||
|
||||
/** @type {AvailableFormats} */
|
||||
const AVAILABLE_FORMATS = {
|
||||
@@ -1639,16 +1631,14 @@ class DefaultStatsPrinterPlugin {
|
||||
context[color] = (str) => str;
|
||||
}
|
||||
}
|
||||
for (const _format of Object.keys(AVAILABLE_FORMATS)) {
|
||||
const format =
|
||||
/** @type {keyof KnownStatsPrinterFormatters} */
|
||||
(_format);
|
||||
|
||||
for (const format of /** @type {(keyof KnownStatsPrinterFormatters)[]} */ (
|
||||
Object.keys(AVAILABLE_FORMATS)
|
||||
)) {
|
||||
context[format] =
|
||||
/** @type {(content: Parameters<NonNullable<KnownStatsPrinterFormatters[keyof KnownStatsPrinterFormatters]>>[0], ...args: Tail<Parameters<NonNullable<KnownStatsPrinterFormatters[keyof KnownStatsPrinterFormatters]>>>) => string} */
|
||||
(content, ...args) =>
|
||||
/** @type {TODO} */
|
||||
(AVAILABLE_FORMATS)[format](
|
||||
/** @type {EXPECTED_ANY} */
|
||||
(AVAILABLE_FORMATS[format])(
|
||||
content,
|
||||
/** @type {StatsPrinterContext & Required<KnownStatsPrinterColorFunctions>} */
|
||||
(context),
|
||||
@@ -1658,15 +1648,12 @@ class DefaultStatsPrinterPlugin {
|
||||
context.timeReference = compilation.time;
|
||||
});
|
||||
|
||||
for (const key of Object.keys(COMPILATION_SIMPLE_PRINTERS)) {
|
||||
for (const key of /** @type {(keyof CompilationSimplePrinters)[]} */ (
|
||||
Object.keys(COMPILATION_SIMPLE_PRINTERS)
|
||||
)) {
|
||||
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
||||
/** @type {TODO} */
|
||||
(
|
||||
COMPILATION_SIMPLE_PRINTERS[
|
||||
/** @type {keyof CompilationSimplePrinters} */
|
||||
(key)
|
||||
]
|
||||
)(
|
||||
/** @type {EXPECTED_ANY} */
|
||||
(COMPILATION_SIMPLE_PRINTERS)[key](
|
||||
obj,
|
||||
/** @type {DefineStatsPrinterContext<"compilation">} */
|
||||
(ctx),
|
||||
@@ -1675,15 +1662,12 @@ class DefaultStatsPrinterPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(ASSET_SIMPLE_PRINTERS)) {
|
||||
for (const key of /** @type {(keyof AssetSimplePrinters)[]} */ (
|
||||
Object.keys(ASSET_SIMPLE_PRINTERS)
|
||||
)) {
|
||||
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
||||
/** @type {NonNullable<AssetSimplePrinters[keyof AssetSimplePrinters]>} */
|
||||
(
|
||||
ASSET_SIMPLE_PRINTERS[
|
||||
/** @type {keyof AssetSimplePrinters} */
|
||||
(key)
|
||||
]
|
||||
)(
|
||||
(ASSET_SIMPLE_PRINTERS[key])(
|
||||
obj,
|
||||
/** @type {DefineStatsPrinterContext<"asset" | "asset.info">} */
|
||||
(ctx),
|
||||
@@ -1692,15 +1676,12 @@ class DefaultStatsPrinterPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(MODULE_SIMPLE_PRINTERS)) {
|
||||
for (const key of /** @type {(keyof ModuleSimplePrinters)[]} */ (
|
||||
Object.keys(MODULE_SIMPLE_PRINTERS)
|
||||
)) {
|
||||
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
||||
/** @type {TODO} */
|
||||
(
|
||||
MODULE_SIMPLE_PRINTERS[
|
||||
/** @type {keyof ModuleSimplePrinters} */
|
||||
(key)
|
||||
]
|
||||
)(
|
||||
/** @type {EXPECTED_ANY} */
|
||||
(MODULE_SIMPLE_PRINTERS)[key](
|
||||
obj,
|
||||
/** @type {DefineStatsPrinterContext<"module">} */
|
||||
(ctx),
|
||||
@@ -1709,15 +1690,12 @@ class DefaultStatsPrinterPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(MODULE_ISSUER_PRINTERS)) {
|
||||
for (const key of /** @type {(keyof ModuleIssuerPrinters)[]} */ (
|
||||
Object.keys(MODULE_ISSUER_PRINTERS)
|
||||
)) {
|
||||
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
||||
/** @type {NonNullable<ModuleIssuerPrinters[keyof ModuleIssuerPrinters]>} */
|
||||
(
|
||||
MODULE_ISSUER_PRINTERS[
|
||||
/** @type {keyof ModuleIssuerPrinters} */
|
||||
(key)
|
||||
]
|
||||
)(
|
||||
(MODULE_ISSUER_PRINTERS[key])(
|
||||
obj,
|
||||
/** @type {DefineStatsPrinterContext<"moduleIssuer">} */
|
||||
(ctx),
|
||||
@@ -1726,15 +1704,12 @@ class DefaultStatsPrinterPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(MODULE_REASON_PRINTERS)) {
|
||||
for (const key of /** @type {(keyof ModuleReasonsPrinters)[]} */ (
|
||||
Object.keys(MODULE_REASON_PRINTERS)
|
||||
)) {
|
||||
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
||||
/** @type {TODO} */
|
||||
(
|
||||
MODULE_REASON_PRINTERS[
|
||||
/** @type {keyof ModuleReasonsPrinters} */
|
||||
(key)
|
||||
]
|
||||
)(
|
||||
/** @type {EXPECTED_ANY} */
|
||||
(MODULE_REASON_PRINTERS)[key](
|
||||
obj,
|
||||
/** @type {DefineStatsPrinterContext<"moduleReason">} */
|
||||
(ctx),
|
||||
@@ -1743,15 +1718,12 @@ class DefaultStatsPrinterPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(MODULE_PROFILE_PRINTERS)) {
|
||||
for (const key of /** @type {(keyof ModuleProfilePrinters)[]} */ (
|
||||
Object.keys(MODULE_PROFILE_PRINTERS)
|
||||
)) {
|
||||
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
||||
/** @type {NonNullable<ModuleProfilePrinters[keyof ModuleProfilePrinters]>} */
|
||||
(
|
||||
MODULE_PROFILE_PRINTERS[
|
||||
/** @type {keyof ModuleProfilePrinters} */
|
||||
(key)
|
||||
]
|
||||
)(
|
||||
(MODULE_PROFILE_PRINTERS[key])(
|
||||
obj,
|
||||
/** @type {DefineStatsPrinterContext<"profile">} */
|
||||
(ctx),
|
||||
@@ -1760,15 +1732,12 @@ class DefaultStatsPrinterPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(CHUNK_GROUP_PRINTERS)) {
|
||||
for (const key of /** @type {(keyof ChunkGroupPrinters)[]} */ (
|
||||
Object.keys(CHUNK_GROUP_PRINTERS)
|
||||
)) {
|
||||
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
||||
/** @type {TODO} */
|
||||
(
|
||||
CHUNK_GROUP_PRINTERS[
|
||||
/** @type {keyof ChunkGroupPrinters} */
|
||||
(key)
|
||||
]
|
||||
)(
|
||||
/** @type {EXPECTED_ANY} */
|
||||
(CHUNK_GROUP_PRINTERS)[key](
|
||||
obj,
|
||||
/** @type {DefineStatsPrinterContext<"chunkGroupKind" | "chunkGroup">} */
|
||||
(ctx),
|
||||
@@ -1777,10 +1746,12 @@ class DefaultStatsPrinterPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(CHUNK_PRINTERS)) {
|
||||
for (const key of /** @type {(keyof ChunkPrinters)[]} */ (
|
||||
Object.keys(CHUNK_PRINTERS)
|
||||
)) {
|
||||
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
||||
/** @type {TODO} */
|
||||
(CHUNK_PRINTERS[/** @type {keyof ChunkPrinters} */ (key)])(
|
||||
/** @type {EXPECTED_ANY} */
|
||||
(CHUNK_PRINTERS)[key](
|
||||
obj,
|
||||
/** @type {DefineStatsPrinterContext<"chunk">} */
|
||||
(ctx),
|
||||
@@ -1789,10 +1760,12 @@ class DefaultStatsPrinterPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(ERROR_PRINTERS)) {
|
||||
for (const key of /** @type {(keyof ErrorPrinters)[]} */ (
|
||||
Object.keys(ERROR_PRINTERS)
|
||||
)) {
|
||||
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
||||
/** @type {TODO} */
|
||||
(ERROR_PRINTERS[/** @type {keyof ErrorPrinters} */ (key)])(
|
||||
/** @type {EXPECTED_ANY} */
|
||||
(ERROR_PRINTERS)[key](
|
||||
obj,
|
||||
/** @type {DefineStatsPrinterContext<"error">} */
|
||||
(ctx),
|
||||
@@ -1801,15 +1774,12 @@ class DefaultStatsPrinterPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(LOG_ENTRY_PRINTERS)) {
|
||||
for (const key of /** @type {(keyof LogEntryPrinters)[]} */ (
|
||||
Object.keys(LOG_ENTRY_PRINTERS)
|
||||
)) {
|
||||
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
||||
/** @type {TODO} */
|
||||
(
|
||||
LOG_ENTRY_PRINTERS[
|
||||
/** @type {keyof LogEntryPrinters} */
|
||||
(key)
|
||||
]
|
||||
)(
|
||||
/** @type {EXPECTED_ANY} */
|
||||
(LOG_ENTRY_PRINTERS)[key](
|
||||
obj,
|
||||
/** @type {DefineStatsPrinterContext<"logging">} */
|
||||
(ctx),
|
||||
@@ -1818,15 +1788,12 @@ class DefaultStatsPrinterPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(MODULE_TRACE_DEPENDENCY_PRINTERS)) {
|
||||
for (const key of /** @type {(keyof ModuleTraceDependencyPrinters)[]} */ (
|
||||
Object.keys(MODULE_TRACE_DEPENDENCY_PRINTERS)
|
||||
)) {
|
||||
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
||||
/** @type {NonNullable<ModuleTraceDependencyPrinters[keyof ModuleTraceDependencyPrinters]>} */
|
||||
(
|
||||
MODULE_TRACE_DEPENDENCY_PRINTERS[
|
||||
/** @type {keyof ModuleTraceDependencyPrinters} */
|
||||
(key)
|
||||
]
|
||||
)(
|
||||
(MODULE_TRACE_DEPENDENCY_PRINTERS[key])(
|
||||
obj,
|
||||
/** @type {DefineStatsPrinterContext<"moduleTraceDependency">} */
|
||||
(ctx),
|
||||
@@ -1835,15 +1802,12 @@ class DefaultStatsPrinterPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(MODULE_TRACE_ITEM_PRINTERS)) {
|
||||
for (const key of /** @type {(keyof ModuleTraceItemPrinters)[]} */ (
|
||||
Object.keys(MODULE_TRACE_ITEM_PRINTERS)
|
||||
)) {
|
||||
stats.hooks.print.for(key).tap(PLUGIN_NAME, (obj, ctx) =>
|
||||
/** @type {NonNullable<ModuleTraceItemPrinters[keyof ModuleTraceItemPrinters]>} */
|
||||
(
|
||||
MODULE_TRACE_ITEM_PRINTERS[
|
||||
/** @type {keyof ModuleTraceItemPrinters} */
|
||||
(key)
|
||||
]
|
||||
)(
|
||||
(MODULE_TRACE_ITEM_PRINTERS[key])(
|
||||
obj,
|
||||
/** @type {DefineStatsPrinterContext<"moduleTraceItem">} */
|
||||
(ctx),
|
||||
@@ -1877,10 +1841,10 @@ class DefaultStatsPrinterPlugin {
|
||||
}
|
||||
|
||||
for (const key of Object.keys(SIMPLE_ELEMENT_JOINERS)) {
|
||||
const joiner = SIMPLE_ELEMENT_JOINERS[key];
|
||||
stats.hooks.printElements
|
||||
.for(key)
|
||||
.tap(PLUGIN_NAME, /** @type {TODO} */ (joiner));
|
||||
const joiner =
|
||||
/** @type {(items: Item[], context: StatsPrinterContext) => string} */
|
||||
(SIMPLE_ELEMENT_JOINERS[key]);
|
||||
stats.hooks.printElements.for(key).tap(PLUGIN_NAME, joiner);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(RESULT_MODIFIER)) {
|
||||
|
||||
25
node_modules/webpack/lib/stats/StatsFactory.js
generated
vendored
Executable file → Normal file
25
node_modules/webpack/lib/stats/StatsFactory.js
generated
vendored
Executable file → Normal file
@@ -21,7 +21,10 @@ const smartGrouping = require("../util/smartGrouping");
|
||||
/** @typedef {import("../WebpackError")} WebpackError */
|
||||
/** @typedef {import("../util/comparators").Comparator<EXPECTED_ANY>} Comparator */
|
||||
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
|
||||
/** @typedef {import("../util/smartGrouping").GroupConfig<EXPECTED_ANY, EXPECTED_OBJECT>} GroupConfig */
|
||||
/**
|
||||
* @template T, R
|
||||
* @typedef {import("../util/smartGrouping").GroupConfig<T, R>} GroupConfig
|
||||
*/
|
||||
/** @typedef {import("./DefaultStatsFactoryPlugin").ChunkGroupInfoWithName} ChunkGroupInfoWithName */
|
||||
/** @typedef {import("./DefaultStatsFactoryPlugin").ModuleIssuerPath} ModuleIssuerPath */
|
||||
/** @typedef {import("./DefaultStatsFactoryPlugin").ModuleTrace} ModuleTrace */
|
||||
@@ -41,14 +44,14 @@ const smartGrouping = require("../util/smartGrouping");
|
||||
/**
|
||||
* @typedef {object} KnownStatsFactoryContext
|
||||
* @property {string} type
|
||||
* @property {(path: string) => string} makePathsRelative
|
||||
* @property {Compilation} compilation
|
||||
* @property {(path: string) => string} makePathsRelative
|
||||
* @property {Set<Module>} rootModules
|
||||
* @property {Map<string, Chunk[]>} compilationFileToChunks
|
||||
* @property {Map<string, Chunk[]>} compilationAuxiliaryFileToChunks
|
||||
* @property {RuntimeSpec} runtime
|
||||
* @property {(compilation: Compilation) => WebpackError[]} cachedGetErrors
|
||||
* @property {(compilation: Compilation) => WebpackError[]} cachedGetWarnings
|
||||
* @property {(compilation: Compilation) => Error[]} cachedGetErrors
|
||||
* @property {(compilation: Compilation) => Error[]} cachedGetWarnings
|
||||
*/
|
||||
|
||||
/** @typedef {KnownStatsFactoryContext & Record<string, EXPECTED_ANY>} StatsFactoryContext */
|
||||
@@ -67,10 +70,10 @@ const smartGrouping = require("../util/smartGrouping");
|
||||
* @typedef {T extends ChunkGroupInfoWithName[] ? Record<string, StatsObject<ChunkGroupInfoWithName, F>> : T extends (infer V)[] ? StatsObject<V, F>[] : StatsObject<T, F>} CreatedObject
|
||||
*/
|
||||
|
||||
/** @typedef {TODO} FactoryData */
|
||||
/** @typedef {TODO} FactoryDataItem */
|
||||
/** @typedef {TODO} Result */
|
||||
/** @typedef {Record<string, TODO>} ObjectForExtract */
|
||||
/** @typedef {EXPECTED_ANY} ObjectForExtract */
|
||||
/** @typedef {EXPECTED_ANY} FactoryData */
|
||||
/** @typedef {EXPECTED_ANY} FactoryDataItem */
|
||||
/** @typedef {EXPECTED_ANY} Result */
|
||||
|
||||
/**
|
||||
* @typedef {object} StatsFactoryHooks
|
||||
@@ -78,7 +81,7 @@ const smartGrouping = require("../util/smartGrouping");
|
||||
* @property {HookMap<SyncBailHook<[FactoryDataItem, StatsFactoryContext, number, number], boolean | void>>} filter
|
||||
* @property {HookMap<SyncBailHook<[Comparator[], StatsFactoryContext], void>>} sort
|
||||
* @property {HookMap<SyncBailHook<[FactoryDataItem, StatsFactoryContext, number, number], boolean | void>>} filterSorted
|
||||
* @property {HookMap<SyncBailHook<[GroupConfig[], StatsFactoryContext], void>>} groupResults
|
||||
* @property {HookMap<SyncBailHook<[GroupConfig<EXPECTED_ANY, EXPECTED_ANY>[], StatsFactoryContext], void>>} groupResults
|
||||
* @property {HookMap<SyncBailHook<[Comparator[], StatsFactoryContext], void>>} sortResults
|
||||
* @property {HookMap<SyncBailHook<[FactoryDataItem, StatsFactoryContext, number, number], boolean | void>>} filterResults
|
||||
* @property {HookMap<SyncBailHook<[FactoryDataItem[], StatsFactoryContext], Result | void>>} merge
|
||||
@@ -198,7 +201,7 @@ class StatsFactory {
|
||||
* @param {T} hookMap hook map
|
||||
* @param {Caches<H>} cache cache
|
||||
* @param {string} type type
|
||||
* @param {Array<FactoryData>} items items
|
||||
* @param {FactoryData[]} items items
|
||||
* @param {(hook: H, item: R, idx: number, i: number) => R | undefined} fn fn
|
||||
* @param {boolean} forceClone force clone
|
||||
* @returns {R[]} result for each level
|
||||
@@ -341,7 +344,7 @@ class StatsFactory {
|
||||
}
|
||||
|
||||
// group result items
|
||||
/** @type {GroupConfig[]} */
|
||||
/** @type {GroupConfig<EXPECTED_ANY, EXPECTED_ANY>[]} */
|
||||
const groupConfigs = [];
|
||||
this._forEachLevel(
|
||||
this.hooks.groupResults,
|
||||
|
||||
0
node_modules/webpack/lib/stats/StatsPrinter.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/stats/StatsPrinter.js
generated
vendored
Executable file → Normal file
Reference in New Issue
Block a user