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(
|
||||
|
||||
Reference in New Issue
Block a user