@statoscope/webpack-model
Advanced tools
Comparing version 5.12.1 to 5.13.0
@@ -6,2 +6,3 @@ import { Options } from '@statoscope/helpers/dist/jora'; | ||
export * as module from './module'; | ||
export { StatsExtensionWebpackAdapter } from './stats-extension-webpack-adapter'; | ||
export { joraHelpers, normalize }; | ||
@@ -8,0 +9,0 @@ export declare type Prepared = { |
@@ -53,3 +53,4 @@ import type { Size } from '@statoscope/stats-extension-compressed/dist/generator'; | ||
resolveCompilation(id: string): NormalizedCompilation | null; | ||
resolveExtension(id: string, hash: string): NormalizedExtension<unknown, unknown> | null; | ||
resolveExtension(id: string, fileName: string): NormalizedExtension<unknown, unknown> | null; | ||
resolveExtensionByCompilation(id: string, hash: string): NormalizedExtension<unknown, unknown> | null; | ||
getModuleSize(module: NormalizedModule, hash?: string | undefined, compressed?: boolean | undefined): Size; | ||
@@ -67,8 +68,8 @@ getAssetSize(asset: NormalizedAsset, hash?: string | undefined, compressed?: boolean | undefined): Size; | ||
modulesToFoamTree(modules: NormalizedModule[], hash?: string | undefined, compressed?: boolean | undefined): FoamTreeNode; | ||
validation_getItems(hash?: string | undefined, relatedType?: "module" | "entry" | "package" | "package-instance" | "resource" | "compilation" | "chunk" | null | undefined, relatedId?: string | number | undefined): Item[]; | ||
validation_getItems(hash?: string | undefined, relatedType?: "module" | "package" | "package-instance" | "resource" | "entry" | "compilation" | "chunk" | null | undefined, relatedId?: string | number | undefined): Item[]; | ||
validation_getItem(id?: number | undefined, hash?: string | undefined): Item | null; | ||
validation_resolveRelatedItem(item?: RelationItem | undefined, hash?: string | undefined): ResolvedRelatedItem; | ||
validation_resolveRule(name?: string | undefined, hash?: string | undefined): RuleDescriptor | null; | ||
customReports_getItems(file: string, hash?: string | null | undefined, relatedType?: "module" | "entry" | "package" | "package-instance" | "resource" | "compilation" | "chunk" | null | undefined, relatedId?: string | number | undefined): Report<unknown, unknown>[]; | ||
customReports_getItems(file: string, hash?: string | null | undefined, relatedType?: "module" | "package" | "package-instance" | "resource" | "entry" | "compilation" | "chunk" | null | undefined, relatedId?: string | number | undefined): Report<unknown, unknown>[]; | ||
customReports_getItem(id: string, file: string): Report<unknown, unknown> | null; | ||
}; |
@@ -14,4 +14,8 @@ "use strict"; | ||
const resolveFile = (0, entity_resolver_1.default)(compilations.map((c) => c.file), (item) => item.name); | ||
const resolveExtension = (hash, id) => { | ||
var _a, _b, _c; | ||
const resolveExtension = (fileName, id) => { | ||
var _a, _b; | ||
return (_b = (_a = normalizeResult.fileResolvers.get(fileName)) === null || _a === void 0 ? void 0 : _a.resolveExtension(id)) !== null && _b !== void 0 ? _b : null; | ||
}; | ||
const resolveExtensionByCompilation = (hash, id) => { | ||
var _a; | ||
const fileName = (_a = resolveCompilation(hash)) === null || _a === void 0 ? void 0 : _a.file.name; | ||
@@ -21,3 +25,3 @@ if (!fileName) { | ||
} | ||
return (_c = (_b = normalizeResult.fileResolvers.get(fileName)) === null || _b === void 0 ? void 0 : _b.resolveExtension(id)) !== null && _c !== void 0 ? _c : null; | ||
return resolveExtension(fileName, id); | ||
}; | ||
@@ -42,3 +46,3 @@ return { | ||
} | ||
const ext = resolveExtension(hash, '@statoscope/stats-extension-compressed'); | ||
const ext = resolveExtensionByCompilation(hash, '@statoscope/stats-extension-compressed'); | ||
const resolverSize = ext === null || ext === void 0 ? void 0 : ext.api; | ||
@@ -86,5 +90,8 @@ return files | ||
}, | ||
resolveExtension(id, hash) { | ||
return resolveExtension(hash, id); | ||
resolveExtension(id, fileName) { | ||
return resolveExtension(fileName, id); | ||
}, | ||
resolveExtensionByCompilation(id, hash) { | ||
return resolveExtensionByCompilation(hash, id); | ||
}, | ||
getModuleSize(module, hash, compressed) { | ||
@@ -98,3 +105,3 @@ var _a; | ||
} | ||
const ext = resolveExtension(hash, '@statoscope/stats-extension-compressed'); | ||
const ext = resolveExtensionByCompilation(hash, '@statoscope/stats-extension-compressed'); | ||
const resolverSize = ext === null || ext === void 0 ? void 0 : ext.api; | ||
@@ -113,3 +120,3 @@ return ((_a = resolverSize === null || resolverSize === void 0 ? void 0 : resolverSize(hash, module.identifier)) !== null && _a !== void 0 ? _a : { | ||
} | ||
const ext = resolveExtension(hash, '@statoscope/stats-extension-compressed'); | ||
const ext = resolveExtensionByCompilation(hash, '@statoscope/stats-extension-compressed'); | ||
const resolverSize = ext === null || ext === void 0 ? void 0 : ext.api; | ||
@@ -125,3 +132,3 @@ return ((_a = resolverSize === null || resolverSize === void 0 ? void 0 : resolverSize(hash, asset.name)) !== null && _a !== void 0 ? _a : { | ||
} | ||
const ext = resolveExtension(hash, '@statoscope/stats-extension-package-info'); | ||
const ext = resolveExtensionByCompilation(hash, '@statoscope/stats-extension-package-info'); | ||
const api = ext === null || ext === void 0 ? void 0 : ext.api; | ||
@@ -211,3 +218,3 @@ return (_a = api === null || api === void 0 ? void 0 : api.getInstance(hash, packageName, instancePath)) !== null && _a !== void 0 ? _a : null; | ||
} | ||
const ext = resolveExtension(hash, '@statoscope/stats-extension-stats-validation-result'); | ||
const ext = resolveExtensionByCompilation(hash, '@statoscope/stats-extension-stats-validation-result'); | ||
const api = ext === null || ext === void 0 ? void 0 : ext.api; | ||
@@ -227,3 +234,3 @@ return [ | ||
} | ||
const ext = resolveExtension(hash, '@statoscope/stats-extension-stats-validation-result'); | ||
const ext = resolveExtensionByCompilation(hash, '@statoscope/stats-extension-stats-validation-result'); | ||
const api = ext === null || ext === void 0 ? void 0 : ext.api; | ||
@@ -287,3 +294,3 @@ return (_a = api === null || api === void 0 ? void 0 : api.getItemById(id)) !== null && _a !== void 0 ? _a : null; | ||
} | ||
const ext = resolveExtension(hash, '@statoscope/stats-extension-stats-validation-result'); | ||
const ext = resolveExtensionByCompilation(hash, '@statoscope/stats-extension-stats-validation-result'); | ||
const api = ext === null || ext === void 0 ? void 0 : ext.api; | ||
@@ -290,0 +297,0 @@ return (_a = api === null || api === void 0 ? void 0 : api.getRule(name)) !== null && _a !== void 0 ? _a : null; |
@@ -97,3 +97,3 @@ import { StatsDescriptor } from '@statoscope/stats'; | ||
data: Extension<TPayload>; | ||
api: TAPI; | ||
api: TAPI | null; | ||
}; | ||
@@ -100,0 +100,0 @@ export declare type HandledStats = { |
@@ -67,4 +67,6 @@ "use strict"; | ||
if (!item) { | ||
console.warn(`Unknown extension ${ext.descriptor.name}:`, ext); | ||
return null; | ||
return { | ||
data: ext, | ||
api: null, | ||
}; | ||
} | ||
@@ -75,3 +77,3 @@ return { | ||
}; | ||
}).filter(Boolean)) !== null && _c !== void 0 ? _c : []; | ||
})) !== null && _c !== void 0 ? _c : []; | ||
const resolveExtension = (0, entity_resolver_1.default)(extensions, (ext) => ext.data.descriptor.name); | ||
@@ -78,0 +80,0 @@ const resolvers = { |
{ | ||
"name": "@statoscope/webpack-model", | ||
"version": "5.12.1", | ||
"version": "5.13.0", | ||
"description": "This package contains helpers to process webpack stats", | ||
@@ -29,2 +29,4 @@ "main": "./dist/index.js", | ||
"@statoscope/types": "5.12.1", | ||
"@types/md5": "^2.3.0", | ||
"@types/webpack": "^5.0.0", | ||
"ajv": "^8.6.3", | ||
@@ -34,6 +36,5 @@ "md5": "^2.3.0" | ||
"devDependencies": { | ||
"@types/md5": "^2.3.0", | ||
"flatted": "^3.1.1" | ||
}, | ||
"gitHead": "a8da51f4717066e9d9973a175797267b25e1cc33" | ||
"gitHead": "01e3953dc17249874436217248cde6a3ed53be80" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73915
1
23
1786
12
+ Added@types/md5@^2.3.0
+ Added@types/webpack@^5.0.0
+ Added@jridgewell/gen-mapping@0.3.8(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/source-map@0.3.6(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Added@types/eslint@9.6.1(transitive)
+ Added@types/eslint-scope@3.7.7(transitive)
+ Added@types/estree@1.0.6(transitive)
+ Added@types/json-schema@7.0.15(transitive)
+ Added@types/md5@2.3.5(transitive)
+ Added@types/node@22.10.5(transitive)
+ Added@types/webpack@5.28.5(transitive)
+ Added@webassemblyjs/ast@1.14.1(transitive)
+ Added@webassemblyjs/floating-point-hex-parser@1.13.2(transitive)
+ Added@webassemblyjs/helper-api-error@1.13.2(transitive)
+ Added@webassemblyjs/helper-buffer@1.14.1(transitive)
+ Added@webassemblyjs/helper-numbers@1.13.2(transitive)
+ Added@webassemblyjs/helper-wasm-bytecode@1.13.2(transitive)
+ Added@webassemblyjs/helper-wasm-section@1.14.1(transitive)
+ Added@webassemblyjs/ieee754@1.13.2(transitive)
+ Added@webassemblyjs/leb128@1.13.2(transitive)
+ Added@webassemblyjs/utf8@1.13.2(transitive)
+ Added@webassemblyjs/wasm-edit@1.14.1(transitive)
+ Added@webassemblyjs/wasm-gen@1.14.1(transitive)
+ Added@webassemblyjs/wasm-opt@1.14.1(transitive)
+ Added@webassemblyjs/wasm-parser@1.14.1(transitive)
+ Added@webassemblyjs/wast-printer@1.14.1(transitive)
+ Added@xtuc/ieee754@1.2.0(transitive)
+ Added@xtuc/long@4.2.2(transitive)
+ Addedacorn@8.14.0(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedajv-formats@2.1.1(transitive)
+ Addedajv-keywords@3.5.25.1.0(transitive)
+ Addedbrowserslist@4.24.4(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcaniuse-lite@1.0.30001692(transitive)
+ Addedchrome-trace-event@1.0.4(transitive)
+ Addedcommander@2.20.3(transitive)
+ Addedelectron-to-chromium@1.5.80(transitive)
+ Addedenhanced-resolve@5.18.0(transitive)
+ Addedes-module-lexer@1.6.0(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedeslint-scope@5.1.1(transitive)
+ Addedesrecurse@4.3.0(transitive)
+ Addedestraverse@4.3.05.3.0(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedglob-to-regexp@0.4.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedjest-worker@27.5.1(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedloader-runner@4.3.0(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedneo-async@2.6.2(transitive)
+ Addednode-releases@2.0.19(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedrandombytes@2.1.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedschema-utils@3.3.04.3.0(transitive)
+ Addedserialize-javascript@6.0.2(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsource-map-support@0.5.21(transitive)
+ Addedsupports-color@8.1.1(transitive)
+ Addedtapable@2.2.1(transitive)
+ Addedterser@5.37.0(transitive)
+ Addedterser-webpack-plugin@5.3.11(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedupdate-browserslist-db@1.1.2(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedwatchpack@2.4.2(transitive)
+ Addedwebpack@5.97.1(transitive)
+ Addedwebpack-sources@3.2.3(transitive)