react-native-bundle-discovery-ui 2.8.0 → 2.9.0
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/CHANGELOG.md +26 -0
- package/README.md +12 -255
- package/assets/global.css +769 -53
- package/dist/bin.js +61 -20
- package/dist/client/issues.js +5 -0
- package/dist/client/pages/_common.js +258 -86
- package/dist/client/pages/_module.js +347 -0
- package/dist/client/pages/default.js +145 -62
- package/dist/client/pages/module.js +2 -309
- package/dist/client/pages/moduleDiff.js +76 -0
- package/dist/client/pages/package.js +172 -154
- package/dist/client/prepare.js +15 -0
- package/dist/client/queryHelpers.js +445 -81
- package/dist/client/views/{_theme.js → _colorScheme.js} +2 -9
- package/dist/client/views/_html.js +52 -0
- package/dist/client/views/codeDiff.js +66 -0
- package/dist/client/views/compare.js +237 -0
- package/dist/client/views/importGraph.js +255 -0
- package/dist/client/views/insights.js +80 -0
- package/dist/client/views/moduleOverview.js +134 -0
- package/dist/client/views/packageOverview.js +114 -0
- package/dist/client/views/persistedFilterInput.js +27 -0
- package/dist/client/views/reportBar.js +89 -0
- package/dist/client/views/treemap.js +598 -0
- package/dist/discoveryrc.js +26 -7
- package/dist/rsdoctor.js +4 -101
- package/dist/src-Bp8pPQrQ.js +1545 -0
- package/package.json +5 -3
- package/assets/highcharts.css +0 -1
- package/dist/client/_virtual/_rolldown/runtime.js +0 -37
- package/dist/client/views/foamtree.js +0 -103
- package/dist/client/views/highcharts.js +0 -33
- package/dist/src-DPAqywOJ.js +0 -201
- package/vendors/foamtree.js +0 -9008
- package/vendors/high-contrast-dark.js +0 -1
- package/vendors/highcharts-exporting.js +0 -13
- package/vendors/highcharts-networkgraph.js +0 -1
- package/vendors/highcharts.js +0 -10
package/dist/rsdoctor.js
CHANGED
|
@@ -1,103 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_src = require("./src-
|
|
3
|
-
let node_path = require("node:path");
|
|
4
|
-
//#region ../shared/src/rsdoctor.ts
|
|
5
|
-
const possibleEntryFiles = [
|
|
6
|
-
"index.js",
|
|
7
|
-
"index.jsx",
|
|
8
|
-
"index.ts",
|
|
9
|
-
"index.tsx",
|
|
10
|
-
"index.mjs",
|
|
11
|
-
"index.cjs",
|
|
12
|
-
];
|
|
13
|
-
const doStructureCheck = (rsdoctorData) => {
|
|
14
|
-
if (!(
|
|
15
|
-
Array.isArray(rsdoctorData?.data?.configs) &&
|
|
16
|
-
rsdoctorData.data.configs.length === 1
|
|
17
|
-
))
|
|
18
|
-
throw new Error(
|
|
19
|
-
`Unexpected number of "data.configs[]" in rsdoctor-data.json. Work only with single config. Found: ${rsdoctorData?.data?.configs?.length}`,
|
|
20
|
-
);
|
|
21
|
-
if (!Array.isArray(rsdoctorData?.data?.packageGraph?.packages))
|
|
22
|
-
throw new Error(
|
|
23
|
-
`Unexpected "data.packageGraph.packages[]" in rsdoctor-data.json. Expected array. Found: ${typeof rsdoctorData?.data?.packageGraph?.packages}`,
|
|
24
|
-
);
|
|
25
|
-
const firstConfig = rsdoctorData.data.configs[0];
|
|
26
|
-
if (!(firstConfig.name === "rspack" || firstConfig.name === "webpack"))
|
|
27
|
-
throw new Error(
|
|
28
|
-
`Unsupported bundler: ${firstConfig.name}@${firstConfig.version}. Only 'rspack' and 'webpack' are supported.`,
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
const getDependenciesMap = (rsdoctorData) => {
|
|
32
|
-
return new Map(
|
|
33
|
-
rsdoctorData.data.moduleGraph.dependencies.map((dep) => [dep.id, dep]),
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
const getEntryFile = (rsdoctorData) => {
|
|
37
|
-
const firstConfig = rsdoctorData.data.configs[0];
|
|
38
|
-
const main = firstConfig.config.entry?.main;
|
|
39
|
-
const entryFile =
|
|
40
|
-
typeof main === "string"
|
|
41
|
-
? main
|
|
42
|
-
: typeof main?.import === "string"
|
|
43
|
-
? main.import
|
|
44
|
-
: main?.import[0];
|
|
45
|
-
if (entryFile) return (0, node_path.resolve)(firstConfig.root, entryFile);
|
|
46
|
-
const pathsToCheck = possibleEntryFiles.map((f) =>
|
|
47
|
-
(0, node_path.resolve)(firstConfig.root, f),
|
|
48
|
-
);
|
|
49
|
-
const indexFile = rsdoctorData.data.moduleGraph.modules.find((mdl) =>
|
|
50
|
-
pathsToCheck.some((entry) => mdl.path === entry),
|
|
51
|
-
);
|
|
52
|
-
if (indexFile && indexFile.imported?.length === 0) return indexFile.path;
|
|
53
|
-
return `${firstConfig.root}/index.js`;
|
|
54
|
-
};
|
|
55
|
-
const transformRSDoctorData = (rsdoctorData) => {
|
|
56
|
-
doStructureCheck(rsdoctorData);
|
|
57
|
-
const tmpDependenciesMap = getDependenciesMap(rsdoctorData);
|
|
58
|
-
const firstConfig = rsdoctorData.data.configs[0];
|
|
59
|
-
return {
|
|
60
|
-
date: Date.now(),
|
|
61
|
-
entryPoint: getEntryFile(rsdoctorData),
|
|
62
|
-
rootFolder: firstConfig.root,
|
|
63
|
-
transformOptions: {
|
|
64
|
-
dev: firstConfig.config.mode !== "production",
|
|
65
|
-
minify: firstConfig.config.optimization?.minimize ?? false,
|
|
66
|
-
platform: firstConfig.config.name ?? "ios",
|
|
67
|
-
},
|
|
68
|
-
packages: rsdoctorData.data.packageGraph.packages.map((pkg) => ({
|
|
69
|
-
name: pkg.name,
|
|
70
|
-
absolutePath: pkg.root,
|
|
71
|
-
version: pkg.version,
|
|
72
|
-
source: { sizeInBytes: pkg.size?.sourceSize ?? 1 },
|
|
73
|
-
output: { sizeInBytes: pkg.size?.parsedSize ?? 1 },
|
|
74
|
-
})),
|
|
75
|
-
modules: rsdoctorData.data.moduleGraph.modules.map((mdl) => ({
|
|
76
|
-
path: mdl.path,
|
|
77
|
-
source: {
|
|
78
|
-
code: "",
|
|
79
|
-
lineCount: 0,
|
|
80
|
-
sizeInBytes: mdl.size?.sourceSize ?? 0,
|
|
81
|
-
},
|
|
82
|
-
output: {
|
|
83
|
-
code: "",
|
|
84
|
-
lineCount: 0,
|
|
85
|
-
sizeInBytes: mdl.size?.parsedSize ?? 0,
|
|
86
|
-
},
|
|
87
|
-
dependencies: mdl.dependencies
|
|
88
|
-
.map((depNumId) => {
|
|
89
|
-
const dep = tmpDependenciesMap.get(depNumId);
|
|
90
|
-
return dep
|
|
91
|
-
? {
|
|
92
|
-
absolutePath: dep.resolvedRequest,
|
|
93
|
-
name: dep.request,
|
|
94
|
-
}
|
|
95
|
-
: null;
|
|
96
|
-
})
|
|
97
|
-
.filter((e) => e !== null),
|
|
98
|
-
})),
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
//#endregion
|
|
2
|
+
const require_src = require("./src-Bp8pPQrQ.js");
|
|
102
3
|
exports.transformEsbuildMetafile = require_src.transformEsbuildMetafile;
|
|
103
|
-
exports.transformRSDoctorData = transformRSDoctorData;
|
|
4
|
+
exports.transformRSDoctorData = require_src.transformRSDoctorData;
|
|
5
|
+
exports.withComparison = require_src.withComparison;
|
|
6
|
+
exports.withRecommendations = require_src.withRecommendations;
|