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,23 +1,28 @@
|
|
|
1
1
|
const require_pages__common = require("./_common.js");
|
|
2
2
|
//#region src/client/pages/module.ts
|
|
3
3
|
function getMetroWarn({ when, href, linkText, content }) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
return {
|
|
5
|
+
view: "alert-warning",
|
|
6
|
+
when,
|
|
7
|
+
className: "m-v-8",
|
|
8
|
+
content: [
|
|
9
|
+
...content,
|
|
10
|
+
linkText && href
|
|
11
|
+
? {
|
|
12
|
+
view: "link",
|
|
13
|
+
data: {
|
|
14
|
+
external: true,
|
|
15
|
+
href,
|
|
16
|
+
text: linkText,
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
: null,
|
|
20
|
+
].filter(Boolean),
|
|
21
|
+
};
|
|
17
22
|
}
|
|
18
23
|
discovery.page.define("module", {
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
view: "context",
|
|
25
|
+
data: `{
|
|
21
26
|
$currentModule: $.modules.[path = #.id].pick(0);
|
|
22
27
|
...$,
|
|
23
28
|
currentModule: $currentModule,
|
|
@@ -25,119 +30,148 @@ discovery.page.define("module", {
|
|
|
25
30
|
isInjectedByMetro: $currentModule.path = '__prelude__' or $currentModule.path has '@react-native/js-polyfills',
|
|
26
31
|
isWebpackRuntime: $currentModule.path has '__runtime__',
|
|
27
32
|
}`,
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
view: "h2",
|
|
36
|
+
content: [
|
|
37
|
+
'text: "Module: "',
|
|
38
|
+
"text: $.currentModule.path",
|
|
39
|
+
require_pages__common.getCopyToClipboardButton({
|
|
40
|
+
textToCopy: `$.currentModule.path`,
|
|
41
|
+
className: "m-l-0_5em",
|
|
42
|
+
}),
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
view: "tabs",
|
|
47
|
+
name: "tabs",
|
|
48
|
+
tabs: [
|
|
49
|
+
{
|
|
50
|
+
value: "mcontent",
|
|
51
|
+
text: "Module content",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
value: "networkGraph",
|
|
55
|
+
when: "not isInjectedByMetro and not isEntry and not isWebpackRuntime",
|
|
56
|
+
text: "Imported by modules",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
value: "mduplicates",
|
|
60
|
+
when: "not isInjectedByMetro and not isEntry and not isWebpackRuntime and currentModule.duplicates",
|
|
61
|
+
text: "Duplicates",
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
content: {
|
|
65
|
+
view: "switch",
|
|
66
|
+
content: [
|
|
67
|
+
{
|
|
68
|
+
when: '#.tabs="mcontent"',
|
|
69
|
+
content: [
|
|
70
|
+
getMetroWarn({
|
|
71
|
+
when: "$.currentModule.path = '__prelude__'",
|
|
72
|
+
content: [
|
|
73
|
+
"html: '<b>__prelude__</b>'",
|
|
74
|
+
"text: ' is a special runtime code that was generated by the Metro bundler, see: '",
|
|
75
|
+
],
|
|
76
|
+
href: "https://github.com/facebook/metro/blob/f595e9e1c9021ad372b489be8958cc298eb1e0d9/packages/metro/src/lib/getPreludeCode.js#L25-L33",
|
|
77
|
+
linkText: "getPreludeCode.js",
|
|
78
|
+
}),
|
|
79
|
+
getMetroWarn({
|
|
80
|
+
when: "$.currentModule.path = '__runtime__'",
|
|
81
|
+
content: [
|
|
82
|
+
"html: '<b>__runtime__</b>'",
|
|
83
|
+
"text: ' is a special runtime code that was generated by the Webpack/Rspack bundler'",
|
|
84
|
+
],
|
|
85
|
+
}),
|
|
86
|
+
getMetroWarn({
|
|
87
|
+
when: "$.currentModule.path has '@react-native/js-polyfills'",
|
|
88
|
+
content: [
|
|
89
|
+
"html: '<b>@react-native/js-polyfills/*</b>'",
|
|
90
|
+
"text: ' is a special package that was injected by the Metro bundler, see: '",
|
|
91
|
+
],
|
|
92
|
+
href: "https://github.com/facebook/react-native/blob/198c6fc81cda67a46fff457cc39eb2a297eddc01/packages/metro-config/src/index.flow.js#L61",
|
|
93
|
+
linkText: "rn/metro-config/index.js",
|
|
94
|
+
}),
|
|
95
|
+
getMetroWarn({
|
|
96
|
+
when: "$.currentModule.path has 'metro-runtime'",
|
|
97
|
+
content: [
|
|
98
|
+
"html: '<b>metro-runtime/*</b>'",
|
|
99
|
+
"text: ' is a special package that was injected by the Metro bundler, see: '",
|
|
100
|
+
],
|
|
101
|
+
href: "https://github.com/facebook/metro/blob/f595e9e1c9021ad372b489be8958cc298eb1e0d9/packages/metro-config/src/defaults/defaults.js#L61-L63",
|
|
102
|
+
linkText: "metro-config/index.js",
|
|
103
|
+
}),
|
|
104
|
+
{
|
|
105
|
+
view: "hstack",
|
|
106
|
+
className: "flex-no-wrap",
|
|
107
|
+
content: [
|
|
108
|
+
{
|
|
109
|
+
view: "block",
|
|
110
|
+
className: "width-50p",
|
|
111
|
+
content: [
|
|
112
|
+
"h5: 'Source'",
|
|
113
|
+
{
|
|
114
|
+
view: "source",
|
|
115
|
+
syntax: "ts",
|
|
116
|
+
source: "=$.currentModule.source.code",
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
view: "block",
|
|
122
|
+
className: "width-50p",
|
|
123
|
+
content: [
|
|
124
|
+
{
|
|
125
|
+
view: "h5",
|
|
126
|
+
content: 'text:"Output"',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
view: "context",
|
|
130
|
+
modifiers: [
|
|
131
|
+
{
|
|
132
|
+
view: "checkbox",
|
|
133
|
+
name: "prettify",
|
|
134
|
+
checked: true,
|
|
135
|
+
className: "prettify-checkbox",
|
|
136
|
+
content: 'text:"Prettify"',
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
content: [
|
|
140
|
+
{
|
|
141
|
+
view: "source-prettify",
|
|
142
|
+
syntax: "ts",
|
|
143
|
+
source:
|
|
144
|
+
"=(#.prettify ? $.currentModule.output.code.prettifyJS() : $.currentModule.output.code)",
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
when: '#.tabs="networkGraph"',
|
|
156
|
+
content: {
|
|
157
|
+
view: "context",
|
|
158
|
+
context: `{ ...#, maxParentDepth: $.currentModule.getBestNetworkGraphSize() }`,
|
|
159
|
+
modifiers: [
|
|
160
|
+
"html: '<br/>'",
|
|
161
|
+
"text:'Max parent depth: '",
|
|
162
|
+
{
|
|
163
|
+
view: "input",
|
|
164
|
+
name: "maxParentDepth",
|
|
165
|
+
className: "inline-block",
|
|
166
|
+
htmlType: "number",
|
|
167
|
+
htmlMin: 1,
|
|
168
|
+
htmlMax: 10,
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
content: [
|
|
172
|
+
{
|
|
173
|
+
view: "context",
|
|
174
|
+
data: `{
|
|
141
175
|
// Vars
|
|
142
176
|
$tmp: $.currentModule.getNetworkGraph({ maxParentDepth: #.maxParentDepth });
|
|
143
177
|
$limit: 150;
|
|
@@ -148,21 +182,26 @@ discovery.page.define("module", {
|
|
|
148
182
|
data: $tmp.data,
|
|
149
183
|
isGraphTooBig: $tmp.data.size() > $limit,
|
|
150
184
|
}`,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
185
|
+
content: [
|
|
186
|
+
{
|
|
187
|
+
when: "isGraphTooBig",
|
|
188
|
+
view: "block",
|
|
189
|
+
className: "m-v-8",
|
|
190
|
+
content: [
|
|
191
|
+
{
|
|
192
|
+
view: "alert-warning",
|
|
193
|
+
data: '"Amount of dependencies "+$.data.size()+" (limit: "+$.limit+") are too big to display as a graph :("',
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
view: "hstack",
|
|
199
|
+
className: "flex-no-wrap two-column",
|
|
200
|
+
content: [
|
|
201
|
+
{
|
|
202
|
+
when: "not isGraphTooBig",
|
|
203
|
+
view: "highcharts",
|
|
204
|
+
data: `{
|
|
166
205
|
options: {
|
|
167
206
|
chart: {
|
|
168
207
|
type: "networkgraph",
|
|
@@ -208,12 +247,15 @@ discovery.page.define("module", {
|
|
|
208
247
|
},
|
|
209
248
|
],
|
|
210
249
|
},
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
250
|
+
}`,
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
view: "block",
|
|
254
|
+
content: [
|
|
255
|
+
"h4: 'Modules that import this file: ' + $.currentModule.path",
|
|
256
|
+
{
|
|
257
|
+
view: "list",
|
|
258
|
+
data: `
|
|
217
259
|
$totalSize: modules.sum(=>output.sizeInBytes);
|
|
218
260
|
$toModule: => {
|
|
219
261
|
$deepIdx: $$ + 1;
|
|
@@ -225,24 +267,31 @@ discovery.page.define("module", {
|
|
|
225
267
|
};
|
|
226
268
|
$.currentModule.dependents.map(=> $.$toModule(0))
|
|
227
269
|
`,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
270
|
+
emptyText: "⚠️ No importing modules found",
|
|
271
|
+
item: {
|
|
272
|
+
view: "tree",
|
|
273
|
+
expanded: false,
|
|
274
|
+
itemConfig: {
|
|
275
|
+
content: require_pages__common.getTreeModule({
|
|
276
|
+
hasTextMatch: true,
|
|
277
|
+
}),
|
|
278
|
+
children: `$.children`,
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
],
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
when: '#.tabs="mduplicates"',
|
|
293
|
+
content: require_pages__common.getModulesTree({
|
|
294
|
+
data: `
|
|
246
295
|
$totalSize: modules.sum(=>output.sizeInBytes);
|
|
247
296
|
$toModule: => {
|
|
248
297
|
ext: $.path.getFileExtension(),
|
|
@@ -251,10 +300,12 @@ discovery.page.define("module", {
|
|
|
251
300
|
percent: ($.output.sizeInBytes / $totalSize).percent(3),
|
|
252
301
|
};
|
|
253
302
|
currentModule.duplicates.map(=> $.$toModule())
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
303
|
+
`,
|
|
304
|
+
}),
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
],
|
|
259
310
|
});
|
|
260
311
|
//#endregion
|