@rsdoctor/graph 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -5
- package/dist/index.js +3 -3
- package/package.json +4 -5
package/dist/index.cjs
CHANGED
|
@@ -1061,9 +1061,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1061
1061
|
};
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
|
-
let
|
|
1065
|
-
var external_lodash_unionby_default = __webpack_require__.n(external_lodash_unionby_namespaceObject);
|
|
1066
|
-
let readPackageJson = (file, readFile)=>{
|
|
1064
|
+
let compat_namespaceObject = require("es-toolkit/compat"), readPackageJson = (file, readFile)=>{
|
|
1067
1065
|
let result, current = file;
|
|
1068
1066
|
for(; '/' !== current && !result && (0, external_path_namespaceObject.dirname)(current) !== current;)current = (0, external_path_namespaceObject.dirname)(current), readFile && (result = readFile((0, external_path_namespaceObject.join)(current, 'package.json'))), readFile ? result?.name || (result = void 0) : result = common_namespaceObject.Package.getPackageMetaFromModulePath(file);
|
|
1069
1067
|
if (result) return !readFile || result.name && result.version ? {
|
|
@@ -1217,7 +1215,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1217
1215
|
return this._dependencies.filter((item)=>!item.package);
|
|
1218
1216
|
}
|
|
1219
1217
|
getDuplicatePackages() {
|
|
1220
|
-
return
|
|
1218
|
+
return (0, compat_namespaceObject.unionBy)(Array.from(this._pkgNameMap.values()).map((pkgs)=>(0, compat_namespaceObject.unionBy)(pkgs, 'version')).filter((pkgs)=>pkgs.length > 1), (pkgs)=>pkgs[0].name);
|
|
1221
1219
|
}
|
|
1222
1220
|
toData() {
|
|
1223
1221
|
return {
|
|
@@ -1523,7 +1521,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1523
1521
|
function getAllModules(compilation) {
|
|
1524
1522
|
let modules = [];
|
|
1525
1523
|
for (let mod of compilation.modules)modules.push(...mod.modules ?? []), modules.push(mod);
|
|
1526
|
-
return
|
|
1524
|
+
return (0, compat_namespaceObject.unionBy)(modules.filter((mod)=>!getWebpackModuleId(mod).startsWith('webpack/runtime')), (mod)=>getWebpackModuleId(mod));
|
|
1527
1525
|
}
|
|
1528
1526
|
})(), exports.Asset = __webpack_exports__.Asset, exports.Chunk = __webpack_exports__.Chunk, exports.ChunkGraph = __webpack_exports__.ChunkGraph, exports.Chunks = __webpack_exports__.Chunks, exports.Dependency = __webpack_exports__.Dependency, exports.EntryPoint = __webpack_exports__.EntryPoint, exports.ExportInfo = __webpack_exports__.ExportInfo, exports.Module = __webpack_exports__.Module, exports.ModuleGraph = __webpack_exports__.ModuleGraph, exports.ModuleGraphModule = __webpack_exports__.ModuleGraphModule, exports.ModuleGraphTrans = __webpack_exports__.ModuleGraphTrans, exports.Package = __webpack_exports__.Package, exports.PackageDependency = __webpack_exports__.PackageDependency, exports.PackageGraph = __webpack_exports__.PackageGraph, exports.SideEffect = __webpack_exports__.SideEffect, exports.Statement = __webpack_exports__.Statement, exports.TransUtils = __webpack_exports__.TransUtils, exports.Variable = __webpack_exports__.Variable, exports.Webpack = __webpack_exports__.Webpack, exports.readPackageJson = __webpack_exports__.readPackageJson, __webpack_exports__)-1 === [
|
|
1529
1527
|
"Asset",
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { SDK } from "@rsdoctor/types";
|
|
|
2
2
|
import { gzipSync as external_node_zlib_gzipSync } from "node:zlib";
|
|
3
3
|
import path_0, { dirname, join, relative, resolve } from "path";
|
|
4
4
|
import { File, Lodash, Package } from "@rsdoctor/utils/common";
|
|
5
|
-
import
|
|
5
|
+
import { unionBy } from "es-toolkit/compat";
|
|
6
6
|
import { logger, time, timeEnd } from "@rsdoctor/utils/logger";
|
|
7
7
|
import path_browserify from "path-browserify";
|
|
8
8
|
var __webpack_require__ = {};
|
|
@@ -1156,7 +1156,7 @@ class PackageGraph {
|
|
|
1156
1156
|
return this._dependencies.filter((item)=>!item.package);
|
|
1157
1157
|
}
|
|
1158
1158
|
getDuplicatePackages() {
|
|
1159
|
-
return
|
|
1159
|
+
return unionBy(Array.from(this._pkgNameMap.values()).map((pkgs)=>unionBy(pkgs, 'version')).filter((pkgs)=>pkgs.length > 1), (pkgs)=>pkgs[0].name);
|
|
1160
1160
|
}
|
|
1161
1161
|
toData() {
|
|
1162
1162
|
return {
|
|
@@ -1458,6 +1458,6 @@ function getLastExportInfo(info, webpackGraph) {
|
|
|
1458
1458
|
function getAllModules(compilation) {
|
|
1459
1459
|
let modules = [];
|
|
1460
1460
|
for (let mod of compilation.modules)modules.push(...mod.modules ?? []), modules.push(mod);
|
|
1461
|
-
return
|
|
1461
|
+
return unionBy(modules.filter((mod)=>!getWebpackModuleId(mod).startsWith('webpack/runtime')), (mod)=>getWebpackModuleId(mod));
|
|
1462
1462
|
}
|
|
1463
1463
|
export { Asset, Chunk, ChunkGraph, chunks_namespaceObject as Chunks, Dependency, EntryPoint, ExportInfo, Module, ModuleGraph, ModuleGraphModule, transform_module_graph_namespaceObject as ModuleGraphTrans, package_Package as Package, PackageDependency, PackageGraph, SideEffect, Statement, trans_utils_namespaceObject as TransUtils, Variable, webpack_compatible_namespaceObject as Webpack, readPackageJson };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/graph",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -22,16 +22,15 @@
|
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"
|
|
25
|
+
"es-toolkit": "^1.40.0",
|
|
26
26
|
"path-browserify": "1.0.1",
|
|
27
27
|
"source-map": "^0.7.6",
|
|
28
|
-
"@rsdoctor/types": "1.3.
|
|
29
|
-
"@rsdoctor/utils": "1.3.
|
|
28
|
+
"@rsdoctor/types": "1.3.4",
|
|
29
|
+
"@rsdoctor/utils": "1.3.4"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/body-parser": "1.19.6",
|
|
33
33
|
"@types/estree": "1.0.5",
|
|
34
|
-
"@types/lodash.unionby": "^4.8.9",
|
|
35
34
|
"@types/path-browserify": "1.0.3",
|
|
36
35
|
"@types/node": "^22.8.1",
|
|
37
36
|
"fs-extra": "^11.1.1",
|