react-native-bundle-discovery-ui 2.8.0 → 2.9.1
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 +34 -0
- package/README.md +12 -255
- package/assets/global.css +1606 -105
- package/dist/bin.js +63 -20
- package/dist/client/fonts.js +45 -0
- package/dist/client/issues.js +5 -0
- package/dist/client/pages/_common.js +279 -98
- package/dist/client/pages/_module.js +347 -0
- package/dist/client/pages/default.js +144 -63
- 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 +487 -91
- package/dist/client/sizeHeat.js +7 -0
- 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 +81 -0
- package/dist/client/views/moduleOverview.js +122 -0
- package/dist/client/views/packageOverview.js +116 -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 +27 -7
- package/dist/rsdoctor.js +19 -99
- package/dist/src-DV3VzcQY.js +1548 -0
- package/package.json +9 -5
- 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,23 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_src = require("./src-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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]),
|
|
2
|
+
const require_src = require("./src-DV3VzcQY.js");
|
|
3
|
+
//#region src/rsdoctor.ts
|
|
4
|
+
/** Loads a report for the generated discovery.js config and adds recommendations */
|
|
5
|
+
function loadReport({ path, rsdoctor, esbuild, compare }) {
|
|
6
|
+
const data = require(path);
|
|
7
|
+
const report = require_src.withRecommendations(
|
|
8
|
+
rsdoctor
|
|
9
|
+
? require_src.transformRSDoctorData(data)
|
|
10
|
+
: esbuild
|
|
11
|
+
? require_src.transformEsbuildMetafile(data, path)
|
|
12
|
+
: data,
|
|
34
13
|
);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
};
|
|
14
|
+
return compare
|
|
15
|
+
? require_src.withComparison(report, require(compare), compare)
|
|
16
|
+
: report;
|
|
17
|
+
}
|
|
101
18
|
//#endregion
|
|
19
|
+
exports.loadReport = loadReport;
|
|
102
20
|
exports.transformEsbuildMetafile = require_src.transformEsbuildMetafile;
|
|
103
|
-
exports.transformRSDoctorData = transformRSDoctorData;
|
|
21
|
+
exports.transformRSDoctorData = require_src.transformRSDoctorData;
|
|
22
|
+
exports.withComparison = require_src.withComparison;
|
|
23
|
+
exports.withRecommendations = require_src.withRecommendations;
|