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,8 +1,8 @@
|
|
|
1
1
|
const require_pages__common = require("./_common.js");
|
|
2
2
|
//#region src/client/pages/package.ts
|
|
3
3
|
discovery.page.define("package", {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
view: "context",
|
|
5
|
+
data: `
|
|
6
6
|
// Tmp variables
|
|
7
7
|
$currentPkgName: #.id;
|
|
8
8
|
${require_pages__common.getPackage(`$pkg: modules.filter(=> path has "node_modules" and path has $currentPkgName)`)}[0];
|
|
@@ -24,164 +24,184 @@ discovery.page.define("package", {
|
|
|
24
24
|
currentPkgLatestVersion: $pkg.pkgInstances.metadata.latestVersion[0],
|
|
25
25
|
}
|
|
26
26
|
`,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
content: [
|
|
28
|
+
{
|
|
29
|
+
view: "block",
|
|
30
|
+
content: [
|
|
31
|
+
{
|
|
32
|
+
view: "h1",
|
|
33
|
+
className: "inline-block no-margin",
|
|
34
|
+
content: `badge: {
|
|
35
35
|
text: $.currentPkgWithUniqVer,
|
|
36
36
|
color: "#fffb5a",
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
}`,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
when: "$.currentPkgCopiesCount > 0",
|
|
41
|
+
view: "h2",
|
|
42
|
+
className: "inline-block no-margin",
|
|
43
|
+
content: [
|
|
44
|
+
`badge: {
|
|
44
45
|
text: '+' + $.currentPkgCopiesCount,
|
|
45
46
|
postfix: $.currentPkgCopiesCount = 1 ? 'copy' : 'copies',
|
|
46
47
|
color: "rgba(255, 0, 0, 0.35)"
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
}`,
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
when: "$.currentPkgDeprecated",
|
|
53
|
+
view: "h2",
|
|
54
|
+
className: "inline-block no-margin",
|
|
55
|
+
content: `badge: { text: 'deprecated', color: "rgba(255, 0, 0, 0.35)" }`,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
when: "$.currentPkgOutdated",
|
|
59
|
+
view: "h2",
|
|
60
|
+
className: "inline-block no-margin",
|
|
61
|
+
content: `badge: {
|
|
60
62
|
prefix: 'latest',
|
|
61
63
|
text: 'v' + $.currentPkgLatestVersion,
|
|
62
64
|
color: "rgba(255, 165, 0, 0.35)"
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
65
|
+
}`,
|
|
66
|
+
},
|
|
67
|
+
require_pages__common.getCopyToClipboardButton({
|
|
68
|
+
textToCopy: `$.currentPkg.pkgName`,
|
|
69
|
+
className: "m-l-0_5em",
|
|
70
|
+
}),
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
when: "$.currentPkgDeprecated",
|
|
75
|
+
view: "list",
|
|
76
|
+
data: "$.currentPkgDeprecated",
|
|
77
|
+
item: {
|
|
78
|
+
view: "alert-danger",
|
|
79
|
+
content: [
|
|
80
|
+
"html: '<b>Deprecated</b> '",
|
|
81
|
+
"text: 'v' + version + (#.data.currentPkgHasCopies ? ' (' + pkgName + ')' : '') + ': '",
|
|
82
|
+
"text: metadata.deprecated",
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
"html: '<br>'",
|
|
87
|
+
{
|
|
88
|
+
view: "block",
|
|
89
|
+
content: [
|
|
90
|
+
"text: 'Links: '",
|
|
91
|
+
{
|
|
92
|
+
view: "link",
|
|
93
|
+
external: true,
|
|
94
|
+
data: `{ href: "https://www.npmjs.com/package/" + currentPkgWithUniqVerNpm }`,
|
|
95
|
+
content: [
|
|
96
|
+
"text: 'npmjs.com'",
|
|
97
|
+
`html: '<span class="my-icon-inline my-icon-12">${require_pages__common.externalLinkHtml}</span>'`,
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
"text: ' '",
|
|
101
|
+
{
|
|
102
|
+
view: "link",
|
|
103
|
+
external: true,
|
|
104
|
+
data: `{ href: "https://bundlephobia.com/package/" + currentPkgWithUniqVer }`,
|
|
105
|
+
content: [
|
|
106
|
+
"text: 'bundlephobia.com'",
|
|
107
|
+
`html: '<span class="my-icon-inline my-icon-12">${require_pages__common.externalLinkHtml}</span>'`,
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
"text: ' '",
|
|
111
|
+
{
|
|
112
|
+
view: "link",
|
|
113
|
+
external: true,
|
|
114
|
+
data: `{ href: "https://packagephobia.com/result?p=" + currentPkgWithUniqVer }`,
|
|
115
|
+
content: [
|
|
116
|
+
"text: 'packagephobia.com'",
|
|
117
|
+
`html: '<span class="my-icon-inline my-icon-12">${require_pages__common.externalLinkHtml}</span>'`,
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
view: "link",
|
|
122
|
+
external: true,
|
|
123
|
+
data: `{ href: "https://bundlejs.com/?q=" + currentPkgWithUniqVer, q: currentPkgWithUniqVer }`,
|
|
124
|
+
content: [
|
|
125
|
+
{
|
|
126
|
+
view: "html",
|
|
127
|
+
data: `'<img class="bundlejs-badge-img" src="https://deno.bundlejs.com/?q=' + q + '&badge=detailed" />'`,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
when: "$.currentPkgInstancesWithMetadata",
|
|
135
|
+
view: "block",
|
|
136
|
+
content: [
|
|
137
|
+
"h3: 'Versions'",
|
|
138
|
+
{
|
|
139
|
+
view: "table",
|
|
140
|
+
data: "$.currentPkgInstancesWithMetadata",
|
|
141
|
+
cols: [
|
|
142
|
+
{
|
|
143
|
+
header: "Path",
|
|
144
|
+
content: "text: pkgName",
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
header: "Version",
|
|
148
|
+
content: "pill-badge:{ text: 'v' + version, color: '#0af' }",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
header: "Published",
|
|
152
|
+
data: "metadata.createdAt",
|
|
153
|
+
content: [
|
|
154
|
+
"text: formatDate()",
|
|
155
|
+
"text: ' '",
|
|
156
|
+
"pill-badge:{ text: timeAgo() }",
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
header: "Latest",
|
|
161
|
+
content: [
|
|
162
|
+
{
|
|
163
|
+
view: "link",
|
|
164
|
+
external: true,
|
|
165
|
+
data: `{
|
|
150
166
|
href: "https://www.npmjs.com/package/" + #.data.currentPkg.pkgName + "/v/" + metadata.latestVersion,
|
|
151
167
|
text: 'v' + metadata.latestVersion,
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
168
|
+
}`,
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
header: "Status",
|
|
174
|
+
content: {
|
|
175
|
+
view: "switch",
|
|
176
|
+
content: [
|
|
177
|
+
{
|
|
178
|
+
when: "metadata.deprecated",
|
|
179
|
+
content: `badge: { text: 'deprecated', color: "rgba(255, 0, 0, 0.35)" }`,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
when: "metadata.isLatest",
|
|
183
|
+
content: `badge: { text: 'latest', color: "rgba(120, 177, 9, 0.35)" }`,
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
content: `badge: { text: 'outdated', color: "rgba(255, 165, 0, 0.35)" }`,
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
"html: '<hr>'",
|
|
196
|
+
{
|
|
197
|
+
view: "block",
|
|
198
|
+
content: require_pages__common.getPackageList({
|
|
199
|
+
data: "$.currentPkg",
|
|
200
|
+
itemPkgName: "text: pkgName",
|
|
201
|
+
showCopiesBadge: false,
|
|
202
|
+
expanded: true,
|
|
203
|
+
}),
|
|
204
|
+
},
|
|
205
|
+
],
|
|
186
206
|
});
|
|
187
207
|
//#endregion
|
package/dist/client/prepare.js
CHANGED
|
@@ -1,52 +1,63 @@
|
|
|
1
1
|
//#region src/client/prepare.ts
|
|
2
2
|
function getDuplicateId(path) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
const uniqueNodeModulePath = path.split("node_modules/").pop();
|
|
4
|
+
const ids = [uniqueNodeModulePath];
|
|
5
|
+
if (
|
|
6
|
+
uniqueNodeModulePath.startsWith("lodash.") ||
|
|
7
|
+
uniqueNodeModulePath.startsWith("lodash-es/")
|
|
8
|
+
) {
|
|
9
|
+
const uniqueLodashPath = uniqueNodeModulePath
|
|
10
|
+
.replace("lodash-es/", "lodash/")
|
|
11
|
+
.replace("lodash.", "lodash/")
|
|
12
|
+
.replace("/index.js", ".js");
|
|
13
|
+
ids.push(uniqueLodashPath);
|
|
14
|
+
}
|
|
15
|
+
return ids;
|
|
10
16
|
}
|
|
11
17
|
function prepare(input) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
18
|
+
const data = input;
|
|
19
|
+
const moduleMap = /* @__PURE__ */ new Map();
|
|
20
|
+
const duplicatesMap = /* @__PURE__ */ new Map();
|
|
21
|
+
const allLodashModules = /* @__PURE__ */ new Set();
|
|
22
|
+
data.packages.forEach((pkg) => {
|
|
23
|
+
pkg.path = pkg.absolutePath.replace(`${data.rootFolder}/`, "");
|
|
24
|
+
});
|
|
25
|
+
data.modules.forEach((m) => {
|
|
26
|
+
m.absolutePath = m.path;
|
|
27
|
+
if (m.absolutePath === data.entryPoint) m.isEntry = true;
|
|
28
|
+
m.path = m.path.replace(`${data.rootFolder}/`, "");
|
|
29
|
+
m.dependencies.forEach((d) => {
|
|
30
|
+
d.path = d.absolutePath.replace(`${data.rootFolder}/`, "");
|
|
31
|
+
});
|
|
32
|
+
m._tmp_ids = getDuplicateId(m.path);
|
|
33
|
+
m.duplicates = [];
|
|
34
|
+
m._tmp_ids.forEach((id) => {
|
|
35
|
+
if (!duplicatesMap.has(id)) duplicatesMap.set(id, []);
|
|
36
|
+
duplicatesMap.get(id).push(m);
|
|
37
|
+
});
|
|
38
|
+
if (m.path.includes("node_modules/lodash")) allLodashModules.add(m);
|
|
39
|
+
m.dependents = [];
|
|
40
|
+
moduleMap.set(m.absolutePath, m);
|
|
41
|
+
if (m.path === "__prelude__")
|
|
42
|
+
m.source.code = m.source.code
|
|
43
|
+
.replaceAll(";", ";\n\n")
|
|
44
|
+
.replaceAll(",", ",\n ");
|
|
45
|
+
});
|
|
46
|
+
data.modules.forEach((m) => {
|
|
47
|
+
m._tmp_ids.forEach((id) => {
|
|
48
|
+
const duplicates = duplicatesMap.get(id);
|
|
49
|
+
if (duplicates.length > 1)
|
|
50
|
+
m.duplicates.push(...duplicates.filter((d) => d !== m));
|
|
51
|
+
});
|
|
52
|
+
if (m.path.endsWith("node_modules/lodash/index.js"))
|
|
53
|
+
m.duplicates.push(...allLodashModules);
|
|
54
|
+
delete m._tmp_ids;
|
|
55
|
+
m.dependencies.forEach((dependency) => {
|
|
56
|
+
const dependentModule = moduleMap.get(dependency.absolutePath);
|
|
57
|
+
if (dependentModule) dependentModule.dependents.push(m);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
return data;
|
|
50
61
|
}
|
|
51
62
|
//#endregion
|
|
52
63
|
module.exports = prepare;
|