react-native-bundle-discovery-ui 2.7.0-rc.0 → 2.7.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 +7 -0
- package/dist/bin.js +221 -152
- package/dist/client/_virtual/_rolldown/runtime.js +26 -12
- package/dist/client/pages/_common.js +238 -209
- package/dist/client/pages/default.js +146 -129
- package/dist/client/pages/module.js +223 -172
- package/dist/client/pages/package.js +171 -151
- package/dist/client/prepare.js +56 -45
- package/dist/client/queryHelpers.js +302 -260
- package/dist/client/setup.js +2 -2
- package/dist/client/views/_theme.js +9 -7
- package/dist/client/views/foamtree.js +94 -79
- package/dist/client/views/highcharts.js +23 -13
- package/dist/client/views/prettify.js +17 -7
- package/dist/discoveryrc.js +18 -13
- package/dist/rolldown-runtime-VH7oDXx4.js +30 -16
- package/dist/rsdoctor.js +86 -59
- package/dist/src-BSLX-He2.js +25 -19
- package/package.json +4 -4
|
@@ -1,88 +1,103 @@
|
|
|
1
1
|
let vendors_foamtree_js = require("../../../vendors/foamtree.js");
|
|
2
2
|
//#region src/client/views/foamtree.ts
|
|
3
3
|
function injectTooltip(root) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const t = root.querySelector(".tooltip");
|
|
5
|
+
if (t) return t;
|
|
6
|
+
const tooltip = document.createElement("div");
|
|
7
|
+
tooltip.className = "tooltip";
|
|
8
|
+
tooltip.id = "foamtree-tooltip";
|
|
9
|
+
root.appendChild(tooltip);
|
|
10
|
+
return tooltip;
|
|
11
11
|
}
|
|
12
12
|
function prependDuplicateTo(label) {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
if (label.includes(" ~ "))
|
|
14
|
+
return `<b class='i-duplicate'>Duplicate</b> ${label.split(" ~ ")[1]}`;
|
|
15
|
+
return label;
|
|
15
16
|
}
|
|
16
17
|
discovery.view.define("foamtree", (el, _config, rawData, context) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
18
|
+
if (Array.isArray(rawData?.options?.series))
|
|
19
|
+
rawData.options.series.forEach((e) => {
|
|
20
|
+
if (e.data?.[0]?.value !== void 0)
|
|
21
|
+
e.data = e.data.map((d) => d.value ?? null);
|
|
22
|
+
});
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
try {
|
|
25
|
+
window.__el = el;
|
|
26
|
+
const root = el.closest(".discovery-root");
|
|
27
|
+
const tooltip = injectTooltip(root);
|
|
28
|
+
window.addEventListener("resize", () => ft.resize(), { passive: true });
|
|
29
|
+
root.addEventListener(
|
|
30
|
+
"mousemove",
|
|
31
|
+
(event) => {
|
|
32
|
+
if (tooltip.style.display === "none") return;
|
|
33
|
+
tooltip.style.left = `${event.pageX + 10}px`;
|
|
34
|
+
tooltip.style.top = `${event.pageY + 10}px`;
|
|
35
|
+
},
|
|
36
|
+
{ passive: true },
|
|
37
|
+
);
|
|
38
|
+
el.addEventListener("mouseover", () => {
|
|
39
|
+
tooltip.style.display = "block";
|
|
40
|
+
});
|
|
41
|
+
el.addEventListener("mouseout", () => {
|
|
42
|
+
tooltip.style.display = "none";
|
|
43
|
+
});
|
|
44
|
+
const ft = new vendors_foamtree_js.FoamTree({
|
|
45
|
+
element: el,
|
|
46
|
+
layout: "squarified",
|
|
47
|
+
stacking: "flattened",
|
|
48
|
+
pixelRatio: window.devicePixelRatio || 1,
|
|
49
|
+
maxGroups: Infinity,
|
|
50
|
+
maxGroupLevelsDrawn: Infinity,
|
|
51
|
+
maxGroupLabelLevelsDrawn: Infinity,
|
|
52
|
+
maxGroupLevelsAttached: Infinity,
|
|
53
|
+
wireframeLabelDrawing: "always",
|
|
54
|
+
groupMinDiameter: 0,
|
|
55
|
+
groupLabelVerticalPadding: 0.2,
|
|
56
|
+
rolloutDuration: 0,
|
|
57
|
+
pullbackDuration: 0,
|
|
58
|
+
fadeDuration: 0,
|
|
59
|
+
groupExposureZoomMargin: 0.2,
|
|
60
|
+
zoomMouseWheelDuration: 300,
|
|
61
|
+
openCloseDuration: 200,
|
|
62
|
+
onGroupClick(event) {
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
ft.zoom(event.group);
|
|
65
|
+
},
|
|
66
|
+
onGroupDoubleClick: (e) => e.preventDefault(),
|
|
67
|
+
onGroupHover(event) {
|
|
68
|
+
if (event.group && event.group === rawData.options.dataObject)
|
|
69
|
+
return event.preventDefault();
|
|
70
|
+
const { group } = event;
|
|
71
|
+
if (group?.type) {
|
|
72
|
+
const htmlContent = [
|
|
73
|
+
`<b class="tooltip-name">${group.type}</b>: ${prependDuplicateTo(group.label)}`,
|
|
74
|
+
`<b>Size</b>: ${group.size}`,
|
|
75
|
+
group.type === "folder" ? null : `<b>Path</b>: ${group.fullPath}`,
|
|
76
|
+
group.type === "folder" ? `<b>Files</b>: ${group.files}` : null,
|
|
77
|
+
]
|
|
78
|
+
.filter((e) => !!e)
|
|
79
|
+
.join("<br/>");
|
|
80
|
+
tooltip.style.display = "block";
|
|
81
|
+
tooltip.innerHTML = htmlContent;
|
|
82
|
+
} else {
|
|
83
|
+
tooltip.style.display = "none";
|
|
84
|
+
tooltip.innerHTML = "";
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
...rawData.options,
|
|
88
|
+
});
|
|
89
|
+
} catch (e) {
|
|
90
|
+
console.error(e, rawData);
|
|
91
|
+
discovery.view.render(
|
|
92
|
+
el,
|
|
93
|
+
{
|
|
94
|
+
view: "alert-danger",
|
|
95
|
+
data: '"Error rendering chart, please check the console for more information."',
|
|
96
|
+
},
|
|
97
|
+
rawData,
|
|
98
|
+
context,
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
}, 0);
|
|
87
102
|
});
|
|
88
103
|
//#endregion
|
|
@@ -6,18 +6,28 @@ require("../../../vendors/highcharts-networkgraph.js");
|
|
|
6
6
|
require("../../../vendors/highcharts-exporting.js");
|
|
7
7
|
//#region src/client/views/highcharts.ts
|
|
8
8
|
discovery.view.define("highcharts", (el, _config, rawData, context) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
require_views__theme.doTheming(el);
|
|
10
|
+
if (Array.isArray(rawData?.options?.series))
|
|
11
|
+
rawData.options.series.forEach((e) => {
|
|
12
|
+
if (e.data?.[0]?.value !== void 0)
|
|
13
|
+
e.data = e.data.map((d) => d.value ?? null);
|
|
14
|
+
});
|
|
15
|
+
try {
|
|
16
|
+
vendors_highcharts_js.default.chart(
|
|
17
|
+
el,
|
|
18
|
+
vendors_highcharts_js.default.merge({}, rawData.options),
|
|
19
|
+
);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
console.error(e, rawData);
|
|
22
|
+
discovery.view.render(
|
|
23
|
+
el,
|
|
24
|
+
{
|
|
25
|
+
view: "alert-danger",
|
|
26
|
+
data: '"Error rendering chart, please check the console for more information."',
|
|
27
|
+
},
|
|
28
|
+
rawData,
|
|
29
|
+
context,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
22
32
|
});
|
|
23
33
|
//#endregion
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
//#region src/client/views/prettify.ts
|
|
2
|
-
discovery.view.define(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
discovery.view.define(
|
|
3
|
+
"source-prettify",
|
|
4
|
+
async function renderPrettify(el, config, data, context) {
|
|
5
|
+
await this.render(
|
|
6
|
+
el,
|
|
7
|
+
this.composeConfig([
|
|
8
|
+
{
|
|
9
|
+
...config,
|
|
10
|
+
source: await config.source,
|
|
11
|
+
view: "source",
|
|
12
|
+
},
|
|
13
|
+
]),
|
|
14
|
+
data,
|
|
15
|
+
context,
|
|
16
|
+
);
|
|
17
|
+
},
|
|
18
|
+
);
|
|
9
19
|
//#endregion
|
package/dist/discoveryrc.js
CHANGED
|
@@ -3,19 +3,24 @@ let node_path = require("node:path");
|
|
|
3
3
|
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
4
4
|
//#region src/discoveryrc.ts
|
|
5
5
|
const config = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
name: "react-native-bundle-discovery",
|
|
7
|
+
data: () =>
|
|
8
|
+
require(
|
|
9
|
+
node_path.default.resolve(__dirname, "../../../tmp/metro-stats.json"),
|
|
10
|
+
),
|
|
11
|
+
setup: node_path.default.resolve(__dirname, "client/setup.js"),
|
|
12
|
+
view: {
|
|
13
|
+
assets: [
|
|
14
|
+
node_path.default.resolve(__dirname, "../assets/global.css"),
|
|
15
|
+
node_path.default.resolve(__dirname, "client/pages/default.js"),
|
|
16
|
+
node_path.default.resolve(__dirname, "client/pages/module.js"),
|
|
17
|
+
node_path.default.resolve(__dirname, "client/pages/package.js"),
|
|
18
|
+
node_path.default.resolve(__dirname, "../assets/highcharts.css"),
|
|
19
|
+
node_path.default.resolve(__dirname, "client/views/prettify.js"),
|
|
20
|
+
node_path.default.resolve(__dirname, "client/views/highcharts.js"),
|
|
21
|
+
node_path.default.resolve(__dirname, "client/views/foamtree.js"),
|
|
22
|
+
],
|
|
23
|
+
},
|
|
19
24
|
};
|
|
20
25
|
//#endregion
|
|
21
26
|
module.exports = config;
|
|
@@ -6,23 +6,37 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
if ((from && typeof from === "object") || typeof from === "function")
|
|
10
|
+
for (
|
|
11
|
+
var keys = __getOwnPropNames(from), i = 0, n = keys.length, key;
|
|
12
|
+
i < n;
|
|
13
|
+
i++
|
|
14
|
+
) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, {
|
|
18
|
+
get: ((k) => from[k]).bind(null, key),
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
17
23
|
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (
|
|
25
|
+
(target = mod != null ? __create(__getProtoOf(mod)) : {}),
|
|
26
|
+
__copyProps(
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default")
|
|
28
|
+
? __defProp(target, "default", {
|
|
29
|
+
value: mod,
|
|
30
|
+
enumerable: true,
|
|
31
|
+
})
|
|
32
|
+
: target,
|
|
33
|
+
mod,
|
|
34
|
+
)
|
|
35
|
+
);
|
|
22
36
|
//#endregion
|
|
23
37
|
Object.defineProperty(exports, "__toESM", {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return __toESM;
|
|
41
|
+
},
|
|
28
42
|
});
|
package/dist/rsdoctor.js
CHANGED
|
@@ -3,73 +3,100 @@ require("./src-BSLX-He2.js");
|
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
//#region ../shared/src/rsdoctor.ts
|
|
5
5
|
const possibleEntryFiles = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
"index.js",
|
|
7
|
+
"index.jsx",
|
|
8
|
+
"index.ts",
|
|
9
|
+
"index.tsx",
|
|
10
|
+
"index.mjs",
|
|
11
|
+
"index.cjs",
|
|
12
12
|
];
|
|
13
13
|
const doStructureCheck = (rsdoctorData) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
+
);
|
|
18
30
|
};
|
|
19
31
|
const getDependenciesMap = (rsdoctorData) => {
|
|
20
|
-
|
|
32
|
+
return new Map(
|
|
33
|
+
rsdoctorData.data.moduleGraph.dependencies.map((dep) => [dep.id, dep]),
|
|
34
|
+
);
|
|
21
35
|
};
|
|
22
36
|
const getEntryFile = (rsdoctorData) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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`;
|
|
31
54
|
};
|
|
32
55
|
const transformRSDoctorData = (rsdoctorData) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
+
};
|
|
73
100
|
};
|
|
74
101
|
//#endregion
|
|
75
102
|
exports.transformRSDoctorData = transformRSDoctorData;
|
package/dist/src-BSLX-He2.js
CHANGED
|
@@ -3,28 +3,34 @@ let chalk = require("chalk");
|
|
|
3
3
|
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
4
4
|
//#region ../shared/src/isRsdoctorReport.ts
|
|
5
5
|
const isRsdoctorReport = (reportJson, reportPath, noLogs) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
try {
|
|
7
|
+
if (
|
|
8
|
+
Array.isArray(reportJson?.data?.moduleGraph?.modules) ||
|
|
9
|
+
Array.isArray(reportJson?.data?.packageGraph?.packages)
|
|
10
|
+
) {
|
|
11
|
+
!noLogs &&
|
|
12
|
+
console.info(
|
|
13
|
+
`Detected ${chalk.default.red("rsdoctor")} format in the input file: ${chalk.default.green(reportPath)}`,
|
|
14
|
+
);
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
} catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
15
21
|
};
|
|
16
22
|
const isRsdoctorReportPath = (reportPath) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
try {
|
|
24
|
+
const reportJson = require(reportPath);
|
|
25
|
+
return isRsdoctorReport(reportJson, reportPath);
|
|
26
|
+
} catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
23
29
|
};
|
|
24
30
|
//#endregion
|
|
25
31
|
Object.defineProperty(exports, "isRsdoctorReportPath", {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return isRsdoctorReportPath;
|
|
35
|
+
},
|
|
30
36
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-bundle-discovery-ui",
|
|
3
|
-
"version": "2.7.0
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Browser UI for React Native bundle reports",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"vendors"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "run -T tsdown",
|
|
21
|
+
"build": "run -T tsdown && run -T prettier --write --log-level warn --ignore-path= \"dist/**/*.js\"",
|
|
22
22
|
"typecheck": "run -T tsc -p tsconfig.json && run -T tsc -p src/client/tsconfig.json",
|
|
23
23
|
"dev": "run -T tsdown && NODE_ENV=development discovery --config dist/discoveryrc.js",
|
|
24
24
|
"prepack": "cp ../../README.md README.md"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"prettier": "^3.9.6"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@react-native-bundle-discovery/shared": "
|
|
34
|
+
"@react-native-bundle-discovery/shared": "0.0.0",
|
|
35
35
|
"@types/minimist": "^1.2.5"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -45,4 +45,4 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
}
|