@module-federation/devtools 0.22.0 → 0.22.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.
Files changed (100) hide show
  1. package/dist/es/App.css +12 -0
  2. package/dist/es/App.js +330 -22
  3. package/dist/es/App.module.js +1 -1
  4. package/dist/es/App_module.css +291 -5
  5. package/dist/es/component/DependencyGraph/index.js +205 -0
  6. package/dist/es/component/DependencyGraph/index.module.js +5 -0
  7. package/dist/es/component/DependencyGraph/index_module.css +97 -0
  8. package/dist/es/component/{GraphItem → DependencyGraphItem}/index.js +15 -6
  9. package/dist/es/component/DependencyGraphItem/index.module.js +5 -0
  10. package/dist/es/component/DependencyGraphItem/index_module.css +95 -0
  11. package/dist/es/component/Form/index.js +191 -109
  12. package/dist/es/component/Form/index.module.js +1 -1
  13. package/dist/es/component/Form/index_module.css +179 -25
  14. package/dist/es/component/Layout/index.js +300 -49
  15. package/dist/es/component/Layout/index.module.js +1 -1
  16. package/dist/es/component/Layout/index_module.css +52 -32
  17. package/dist/es/component/ModuleInfo/index.js +289 -0
  18. package/dist/es/component/ModuleInfo/index.module.js +5 -0
  19. package/dist/es/component/ModuleInfo/index_module.css +183 -0
  20. package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +33 -0
  21. package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.module.js +5 -0
  22. package/dist/es/component/SharedDepsExplorer/FocusResultDisplay_module.css +45 -0
  23. package/dist/es/component/SharedDepsExplorer/index.js +506 -0
  24. package/dist/es/component/SharedDepsExplorer/index.module.js +5 -0
  25. package/dist/es/component/SharedDepsExplorer/index_module.css +457 -0
  26. package/dist/es/component/SharedDepsExplorer/share-utils.js +206 -0
  27. package/dist/es/template/constant.js +3 -19
  28. package/dist/es/utils/chrome/index.js +91 -38
  29. package/dist/es/utils/chrome/messages.js +6 -0
  30. package/dist/es/utils/chrome/override-remote.js +42 -0
  31. package/dist/es/utils/chrome/post-message-listener.js +2 -1
  32. package/dist/es/utils/chrome/post-message-start.js +10 -2
  33. package/dist/es/utils/chrome/storage.js +6 -1
  34. package/dist/es/utils/sdk/graph.js +25 -4
  35. package/dist/es/utils/sdk/index.js +9 -0
  36. package/dist/es/worker/index.js +168 -1
  37. package/dist/lib/App.css +12 -0
  38. package/dist/lib/App.js +321 -18
  39. package/dist/lib/App.module.js +1 -1
  40. package/dist/lib/App_module.css +291 -5
  41. package/dist/lib/component/DependencyGraph/index.js +227 -0
  42. package/dist/lib/component/{GraphItem → DependencyGraph}/index.module.js +1 -1
  43. package/dist/lib/component/DependencyGraph/index_module.css +97 -0
  44. package/dist/lib/component/{GraphItem → DependencyGraphItem}/index.js +18 -9
  45. package/dist/lib/component/{Graph → DependencyGraphItem}/index.module.js +1 -1
  46. package/dist/lib/component/DependencyGraphItem/index_module.css +95 -0
  47. package/dist/lib/component/Form/index.js +188 -107
  48. package/dist/lib/component/Form/index.module.js +1 -1
  49. package/dist/lib/component/Form/index_module.css +179 -25
  50. package/dist/lib/component/Layout/index.js +294 -47
  51. package/dist/lib/component/Layout/index.module.js +1 -1
  52. package/dist/lib/component/Layout/index_module.css +52 -32
  53. package/dist/lib/component/ModuleInfo/index.js +319 -0
  54. package/dist/lib/component/ModuleInfo/index.module.js +25 -0
  55. package/dist/lib/component/ModuleInfo/index_module.css +183 -0
  56. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +63 -0
  57. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.module.js +25 -0
  58. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay_module.css +45 -0
  59. package/dist/lib/component/SharedDepsExplorer/index.js +513 -0
  60. package/dist/lib/component/SharedDepsExplorer/index.module.js +25 -0
  61. package/dist/lib/component/SharedDepsExplorer/index_module.css +457 -0
  62. package/dist/lib/component/SharedDepsExplorer/share-utils.js +237 -0
  63. package/dist/lib/template/constant.js +4 -17
  64. package/dist/lib/utils/chrome/index.js +94 -38
  65. package/dist/lib/utils/chrome/messages.js +31 -0
  66. package/dist/lib/utils/chrome/override-remote.js +65 -0
  67. package/dist/lib/utils/chrome/post-message-listener.js +2 -1
  68. package/dist/lib/utils/chrome/post-message-start.js +10 -2
  69. package/dist/lib/utils/chrome/storage.js +5 -0
  70. package/dist/lib/utils/sdk/graph.js +25 -4
  71. package/dist/lib/utils/sdk/index.js +10 -0
  72. package/dist/lib/worker/index.js +156 -1
  73. package/dist/types/src/App.d.ts +2 -1
  74. package/dist/types/src/component/{Graph → DependencyGraph}/index.d.ts +0 -1
  75. package/dist/types/src/component/{GraphItem → DependencyGraphItem}/index.d.ts +0 -1
  76. package/dist/types/src/component/Form/index.d.ts +2 -0
  77. package/dist/types/src/component/Layout/index.d.ts +0 -1
  78. package/dist/types/src/component/ModuleInfo/index.d.ts +8 -0
  79. package/dist/types/src/component/SharedDepsExplorer/FocusResultDisplay.d.ts +15 -0
  80. package/dist/types/src/component/SharedDepsExplorer/index.d.ts +6 -0
  81. package/dist/types/src/component/SharedDepsExplorer/share-utils.d.ts +44 -0
  82. package/dist/types/src/init.d.ts +0 -1
  83. package/dist/types/src/template/constant.d.ts +2 -5
  84. package/dist/types/src/utils/chrome/index.d.ts +5 -3
  85. package/dist/types/src/utils/chrome/messages.d.ts +2 -0
  86. package/dist/types/src/utils/chrome/override-remote.d.ts +1 -0
  87. package/dist/types/src/utils/chrome/storage.d.ts +5 -4
  88. package/dist/types/src/utils/sdk/graph.d.ts +2 -1
  89. package/dist/types/src/utils/sdk/index.d.ts +1 -0
  90. package/dist/types/src/utils/types/common.d.ts +4 -0
  91. package/dist/types/src/worker/index.d.ts +1 -0
  92. package/package.json +11 -9
  93. package/dist/es/component/Graph/index.js +0 -127
  94. package/dist/es/component/Graph/index.module.js +0 -5
  95. package/dist/es/component/Graph/index_module.css +0 -12
  96. package/dist/es/component/GraphItem/index.module.js +0 -5
  97. package/dist/es/component/GraphItem/index_module.css +0 -61
  98. package/dist/lib/component/Graph/index.js +0 -149
  99. package/dist/lib/component/Graph/index_module.css +0 -12
  100. package/dist/lib/component/GraphItem/index_module.css +0 -61
@@ -0,0 +1,457 @@
1
+ .container_967de {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 16px;
5
+ padding: 16px 12px;
6
+ max-width: 1024px;
7
+ }
8
+
9
+ @media (min-width: 768px) {
10
+ .container_967de {
11
+ padding: 24px 16px;
12
+ }
13
+ }
14
+ .heroSection_967de {
15
+ display: flex;
16
+ flex-direction: column;
17
+ gap: 8px;
18
+ }
19
+
20
+ .heroSubtitle_967de {
21
+ font-size: 12px;
22
+ font-weight: 600;
23
+ text-transform: uppercase;
24
+ letter-spacing: 0.025em;
25
+ color: #71717a;
26
+ margin: 0;
27
+ }
28
+
29
+ .heroTitle_967de {
30
+ font-size: 30px;
31
+ line-height: 36px;
32
+ font-weight: 700;
33
+ letter-spacing: -0.025em;
34
+ color: #18181b;
35
+ margin: 0;
36
+ }
37
+
38
+ .statsGrid_967de {
39
+ display: grid;
40
+ grid-template-columns: repeat(1, minmax(0, 1fr));
41
+ gap: 16px;
42
+ }
43
+
44
+ @media (min-width: 640px) {
45
+ .statsGrid_967de {
46
+ grid-template-columns: repeat(2, minmax(0, 1fr));
47
+ }
48
+ }
49
+ @media (min-width: 1024px) {
50
+ .statsGrid_967de {
51
+ grid-template-columns: repeat(3, minmax(0, 1fr));
52
+ }
53
+ }
54
+ .card_967de {
55
+ border-radius: 12px;
56
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
57
+ border: 1px solid #e4e4e7;
58
+ background-color: white;
59
+ }
60
+
61
+ .cardWithPadding_967de {
62
+ border-radius: 12px;
63
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
64
+ border: 1px solid #e4e4e7;
65
+ background-color: white;
66
+ padding: 16px;
67
+ }
68
+
69
+ .cardHeader_967de {
70
+ display: flex;
71
+ flex-direction: row;
72
+ align-items: center;
73
+ justify-content: space-between;
74
+ padding-bottom: 8px;
75
+ }
76
+
77
+ .statSpace_967de {
78
+ display: flex;
79
+ flex-direction: column;
80
+ gap: 4px;
81
+ }
82
+
83
+ .statLabel_967de {
84
+ font-size: 14px;
85
+ color: #71717a;
86
+ }
87
+
88
+ .statValue_967de {
89
+ font-size: 24px;
90
+ font-weight: 600;
91
+ display: flex;
92
+ align-items: center;
93
+ gap: 8px;
94
+ color: #18181b;
95
+ }
96
+
97
+ .icon_967de {
98
+ height: 20px;
99
+ width: 20px;
100
+ color: #a1a1aa;
101
+ }
102
+
103
+ .iconSmall_967de {
104
+ height: 12px;
105
+ width: 12px;
106
+ }
107
+
108
+ .iconMedium_967de {
109
+ height: 14px;
110
+ width: 14px;
111
+ color: #71717a;
112
+ }
113
+
114
+ .statDescription_967de {
115
+ font-size: 12px;
116
+ color: #71717a;
117
+ margin: 0;
118
+ }
119
+
120
+ .statSubtext_967de {
121
+ font-size: 16px;
122
+ color: #a1a1aa;
123
+ font-weight: 400;
124
+ }
125
+
126
+ .cardFooter_967de {
127
+ display: flex;
128
+ align-items: center;
129
+ justify-content: space-between;
130
+ font-size: 12px;
131
+ color: #71717a;
132
+ white-space: nowrap;
133
+ }
134
+
135
+ .truncate_967de {
136
+ overflow: hidden;
137
+ text-overflow: ellipsis;
138
+ white-space: nowrap;
139
+ }
140
+
141
+ .mr2_967de {
142
+ margin-right: 8px;
143
+ }
144
+
145
+ .badgeGroup_967de {
146
+ display: inline-flex;
147
+ align-items: center;
148
+ gap: 4px;
149
+ flex-shrink: 0;
150
+ }
151
+
152
+ .statusTags_967de {
153
+ display: flex;
154
+ flex-direction: column;
155
+ gap: 4px;
156
+ font-size: 12px;
157
+ color: #71717a;
158
+ }
159
+
160
+ .tagRow_967de {
161
+ display: flex;
162
+ align-items: center;
163
+ gap: 8px;
164
+ }
165
+
166
+ .tagContent_967de {
167
+ display: flex;
168
+ align-items: center;
169
+ }
170
+
171
+ .tagValue_967de {
172
+ font-weight: 600;
173
+ color: #18181b;
174
+ margin-left: 4px;
175
+ }
176
+
177
+ .mr1_967de {
178
+ margin-right: 4px;
179
+ }
180
+
181
+ .rightPanels_967de {
182
+ display: flex;
183
+ flex-direction: column;
184
+ gap: 16px;
185
+ }
186
+
187
+ .panelStack_967de {
188
+ display: flex;
189
+ flex-direction: column;
190
+ gap: 16px;
191
+ }
192
+
193
+ .cardTitle_967de {
194
+ font-size: 16px;
195
+ display: flex;
196
+ align-items: center;
197
+ gap: 8px;
198
+ }
199
+
200
+ .controlsGrid_967de {
201
+ display: grid;
202
+ gap: 12px;
203
+ margin-bottom: 12px;
204
+ padding: 8px;
205
+ }
206
+
207
+ @media (min-width: 768px) {
208
+ .controlsGrid_967de {
209
+ grid-template-columns: repeat(2, minmax(0, 1fr));
210
+ }
211
+ }
212
+ .inputGroup_967de {
213
+ display: flex;
214
+ flex-direction: column;
215
+ gap: 4px;
216
+ }
217
+
218
+ .inputLabel_967de {
219
+ font-size: 12px;
220
+ color: #71717a;
221
+ }
222
+
223
+ .fullWidth_967de {
224
+ width: 100%;
225
+ }
226
+
227
+ .resultBox_967de {
228
+ border-radius: 6px;
229
+ border: 1px dashed #e4e4e7;
230
+ background-color: #f9fafb;
231
+ padding: 8px 12px;
232
+ font-size: 12px;
233
+ }
234
+
235
+ .filterGrid_967de {
236
+ display: grid;
237
+ gap: 12px;
238
+ margin-bottom: 12px;
239
+ }
240
+
241
+ @media (min-width: 768px) {
242
+ .filterGrid_967de {
243
+ grid-template-columns: repeat(2, minmax(0, 1fr));
244
+ }
245
+ }
246
+ @media (min-width: 1024px) {
247
+ .filterGrid_967de {
248
+ grid-template-columns: repeat(3, minmax(0, 1fr));
249
+ }
250
+ }
251
+ .padding2_967de {
252
+ padding: 8px;
253
+ }
254
+
255
+ .searchGrid_967de {
256
+ display: grid;
257
+ gap: 12px;
258
+ padding: 8px;
259
+ }
260
+
261
+ @media (min-width: 768px) {
262
+ .searchGrid_967de {
263
+ grid-template-columns: repeat(2, minmax(0, 1fr));
264
+ }
265
+ }
266
+ .searchInput_967de {
267
+ font-size: 12px;
268
+ }
269
+
270
+ .matchCount_967de {
271
+ display: flex;
272
+ align-items: flex-end;
273
+ justify-content: flex-end;
274
+ gap: 8px;
275
+ font-size: 12px;
276
+ color: #71717a;
277
+ }
278
+
279
+ .matchValue_967de {
280
+ font-weight: 600;
281
+ color: #18181b;
282
+ margin-left: 4px;
283
+ }
284
+
285
+ .loadingText_967de {
286
+ padding-top: 16px;
287
+ padding-bottom: 16px;
288
+ font-size: 12px;
289
+ color: #71717a;
290
+ }
291
+
292
+ .errorText_967de {
293
+ padding-top: 12px;
294
+ padding-bottom: 12px;
295
+ font-size: 12px;
296
+ color: #dc2626;
297
+ }
298
+
299
+ .noMatchText_967de {
300
+ padding-top: 12px;
301
+ padding-bottom: 12px;
302
+ font-size: 12px;
303
+ color: #71717a;
304
+ }
305
+
306
+ .treeContainer_967de {
307
+ max-height: 320px;
308
+ overflow-y: auto;
309
+ }
310
+
311
+ .collapseWrapper_967de {
312
+ display: flex;
313
+ flex-direction: column;
314
+ gap: 8px;
315
+ border: 0;
316
+ }
317
+
318
+ .providerHeader_967de {
319
+ display: flex;
320
+ flex-direction: column;
321
+ align-items: flex-start;
322
+ gap: 4px;
323
+ text-align: left;
324
+ }
325
+
326
+ .providerTitle_967de {
327
+ display: flex;
328
+ align-items: center;
329
+ gap: 8px;
330
+ font-size: 14px;
331
+ font-weight: 500;
332
+ }
333
+
334
+ .providerMeta_967de {
335
+ display: flex;
336
+ flex-wrap: wrap;
337
+ gap: 8px;
338
+ font-size: 10px;
339
+ color: #71717a;
340
+ }
341
+
342
+ .scopeList_967de {
343
+ display: flex;
344
+ flex-direction: column;
345
+ gap: 16px;
346
+ }
347
+
348
+ .scopeItem_967de {
349
+ display: flex;
350
+ flex-direction: column;
351
+ gap: 8px;
352
+ }
353
+
354
+ .scopeHeader_967de {
355
+ display: flex;
356
+ align-items: center;
357
+ gap: 8px;
358
+ font-size: 12px;
359
+ font-weight: 500;
360
+ color: #52525b;
361
+ }
362
+
363
+ .tableContainer_967de {
364
+ overflow: hidden;
365
+ border-radius: 6px;
366
+ border: 1px solid #e4e4e7;
367
+ background-color: rgba(249, 250, 251, 0.4);
368
+ }
369
+
370
+ .cellCol_967de {
371
+ display: flex;
372
+ flex-direction: column;
373
+ }
374
+
375
+ .packageName_967de {
376
+ word-break: break-all;
377
+ font-family: monospace;
378
+ font-size: 11px;
379
+ color: #27272a;
380
+ }
381
+
382
+ .version_967de {
383
+ margin-top: 4px;
384
+ font-size: 11px;
385
+ color: #71717a;
386
+ }
387
+
388
+ .cellColGap_967de {
389
+ display: flex;
390
+ flex-direction: column;
391
+ gap: 4px;
392
+ }
393
+
394
+ .scopeText_967de {
395
+ font-size: 11px;
396
+ color: #71717a;
397
+ }
398
+
399
+ .tagContainer_967de {
400
+ width: 64px;
401
+ display: flex;
402
+ align-items: center;
403
+ justify-content: center;
404
+ }
405
+
406
+ .configTags_967de {
407
+ margin-top: 4px;
408
+ display: flex;
409
+ flex-wrap: wrap;
410
+ gap: 4px;
411
+ font-size: 10px;
412
+ color: #71717a;
413
+ }
414
+
415
+ .scale90_967de {
416
+ transform: scale(0.9);
417
+ transform-origin: left;
418
+ }
419
+
420
+ .popoverContent_967de {
421
+ width: 288px;
422
+ }
423
+
424
+ .popoverTitle_967de {
425
+ margin-bottom: 4px;
426
+ font-size: 12px;
427
+ font-weight: 500;
428
+ }
429
+
430
+ .consumerList_967de {
431
+ display: flex;
432
+ flex-direction: column;
433
+ gap: 4px;
434
+ font-size: 11px;
435
+ color: #374151;
436
+ padding-left: 0;
437
+ list-style: none;
438
+ margin: 0;
439
+ }
440
+
441
+ .consumerItem_967de {
442
+ display: flex;
443
+ align-items: center;
444
+ gap: 4px;
445
+ }
446
+
447
+ .dot_967de {
448
+ height: 6px;
449
+ width: 6px;
450
+ border-radius: 50%;
451
+ background-color: #10b981;
452
+ }
453
+
454
+ .btnContent_967de {
455
+ display: flex;
456
+ align-items: center;
457
+ }
@@ -0,0 +1,237 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var share_utils_exports = {};
20
+ __export(share_utils_exports, {
21
+ computeLoadedStatus: () => computeLoadedStatus,
22
+ computeReuseStatus: () => computeReuseStatus,
23
+ computeShareStats: () => computeShareStats,
24
+ findPackageProvider: () => findPackageProvider,
25
+ getFilterOptions: () => getFilterOptions,
26
+ getReusedVersions: () => getReusedVersions,
27
+ groupByProviderScopePackage: () => groupByProviderScopePackage,
28
+ normalizeShareData: () => normalizeShareData
29
+ });
30
+ module.exports = __toCommonJS(share_utils_exports);
31
+ function isRecord(value) {
32
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
33
+ }
34
+ function computeLoadedStatus(entry) {
35
+ if (entry.loaded === true) {
36
+ return "loaded";
37
+ }
38
+ if (entry.loading) {
39
+ return "loading";
40
+ }
41
+ return "not-loaded";
42
+ }
43
+ function computeReuseStatus(entry) {
44
+ const useIn = Array.isArray(entry.useIn) ? entry.useIn : [];
45
+ const { from } = entry;
46
+ const reused = useIn.some((consumer) => consumer && consumer !== from);
47
+ return reused;
48
+ }
49
+ function normalizeEntry({
50
+ provider,
51
+ scope,
52
+ packageName,
53
+ versionKey,
54
+ entry
55
+ }) {
56
+ var _a;
57
+ if (!isRecord(entry)) {
58
+ return null;
59
+ }
60
+ const sharedEntry = entry;
61
+ const loadedStatus = computeLoadedStatus(sharedEntry);
62
+ const reuseStatus = computeReuseStatus(sharedEntry);
63
+ const useIn = Array.isArray(sharedEntry.useIn) ? sharedEntry.useIn : [];
64
+ return {
65
+ id: `${provider}::${scope}::${packageName}::${versionKey}`,
66
+ provider,
67
+ scope,
68
+ packageName,
69
+ version: sharedEntry.version || versionKey,
70
+ from: sharedEntry.from,
71
+ useIn,
72
+ shareConfig: (_a = sharedEntry.shareConfig) != null ? _a : {},
73
+ strategy: sharedEntry.strategy,
74
+ loaded: sharedEntry.loaded,
75
+ loading: sharedEntry.loading,
76
+ loadedStatus,
77
+ reuseStatus
78
+ };
79
+ }
80
+ function normalizeShareData(raw) {
81
+ if (!raw || !isRecord(raw)) {
82
+ return [];
83
+ }
84
+ const items = [];
85
+ Object.entries(raw).forEach(([topKey, topValue]) => {
86
+ if (!isRecord(topValue)) {
87
+ return;
88
+ }
89
+ if (topKey === "default") {
90
+ const provider2 = "default";
91
+ const scope = "default";
92
+ const packagesObj = topValue;
93
+ Object.entries(packagesObj).forEach(([pkgName, versions]) => {
94
+ if (pkgName === "version" || !isRecord(versions)) {
95
+ return;
96
+ }
97
+ Object.entries(versions).forEach(([versionKey, entry]) => {
98
+ const normalized = normalizeEntry({
99
+ provider: provider2,
100
+ scope,
101
+ packageName: pkgName,
102
+ versionKey,
103
+ entry
104
+ });
105
+ if (normalized) {
106
+ items.push(normalized);
107
+ }
108
+ });
109
+ });
110
+ return;
111
+ }
112
+ const provider = topKey;
113
+ const scopesObj = topValue;
114
+ Object.entries(scopesObj).forEach(([scopeName, scopeValue]) => {
115
+ if (scopeName === "version" || !isRecord(scopeValue)) {
116
+ return;
117
+ }
118
+ const packagesObj = scopeValue;
119
+ Object.entries(packagesObj).forEach(([pkgName, versions]) => {
120
+ if (pkgName === "version" || !isRecord(versions)) {
121
+ return;
122
+ }
123
+ Object.entries(versions).forEach(([versionKey, entry]) => {
124
+ const normalized = normalizeEntry({
125
+ provider,
126
+ scope: scopeName,
127
+ packageName: pkgName,
128
+ versionKey,
129
+ entry
130
+ });
131
+ if (normalized) {
132
+ items.push(normalized);
133
+ }
134
+ });
135
+ });
136
+ });
137
+ });
138
+ return items;
139
+ }
140
+ function computeShareStats(versions) {
141
+ const providerSet = /* @__PURE__ */ new Set();
142
+ const scopeSet = /* @__PURE__ */ new Set();
143
+ const packageSet = /* @__PURE__ */ new Set();
144
+ let loadedCount = 0;
145
+ let reusedCount = 0;
146
+ versions.forEach((v) => {
147
+ providerSet.add(v.provider);
148
+ scopeSet.add(v.scope);
149
+ packageSet.add(v.packageName);
150
+ if (v.loadedStatus === "loaded") {
151
+ loadedCount += 1;
152
+ }
153
+ if (v.reuseStatus) {
154
+ reusedCount += 1;
155
+ }
156
+ });
157
+ return {
158
+ totalProviders: providerSet.size,
159
+ totalScopes: scopeSet.size,
160
+ totalPackages: packageSet.size,
161
+ totalVersions: versions.length,
162
+ loadedCount,
163
+ reusedCount
164
+ };
165
+ }
166
+ function groupByProviderScopePackage(versions) {
167
+ const tree = {};
168
+ versions.forEach((v) => {
169
+ if (!tree[v.provider]) {
170
+ tree[v.provider] = {};
171
+ }
172
+ if (!tree[v.provider][v.scope]) {
173
+ tree[v.provider][v.scope] = {};
174
+ }
175
+ if (!tree[v.provider][v.scope][v.packageName]) {
176
+ tree[v.provider][v.scope][v.packageName] = [];
177
+ }
178
+ tree[v.provider][v.scope][v.packageName].push(v);
179
+ });
180
+ return tree;
181
+ }
182
+ function getFilterOptions(versions) {
183
+ const providerSet = /* @__PURE__ */ new Set();
184
+ const scopeSet = /* @__PURE__ */ new Set();
185
+ const packageSet = /* @__PURE__ */ new Set();
186
+ const versionSet = /* @__PURE__ */ new Set();
187
+ versions.forEach((v) => {
188
+ providerSet.add(v.provider);
189
+ scopeSet.add(v.scope);
190
+ packageSet.add(v.packageName);
191
+ versionSet.add(v.version);
192
+ });
193
+ return {
194
+ providers: Array.from(providerSet).sort(),
195
+ scopes: Array.from(scopeSet).sort(),
196
+ packages: Array.from(packageSet).sort(),
197
+ versions: Array.from(versionSet).sort()
198
+ };
199
+ }
200
+ function findPackageProvider(versions, packageName, version) {
201
+ var _a;
202
+ const candidates = versions.filter(
203
+ (v) => v.packageName === packageName && (!version || v.version === version)
204
+ );
205
+ if (!candidates.length) {
206
+ return null;
207
+ }
208
+ const providers = Array.from(new Set(candidates.map((v) => v.from))).sort();
209
+ const hasLoaded = candidates.some((v) => v.loadedStatus === "loaded");
210
+ const hasLoading = !hasLoaded && candidates.some((v) => v.loadedStatus === "loading");
211
+ let status = "not-loaded";
212
+ if (hasLoaded) {
213
+ status = "loaded";
214
+ } else if (hasLoading) {
215
+ status = "loading";
216
+ }
217
+ return {
218
+ packageName,
219
+ version: version || ((_a = candidates[0]) == null ? void 0 : _a.version),
220
+ providers,
221
+ status
222
+ };
223
+ }
224
+ function getReusedVersions(versions) {
225
+ return versions.filter((v) => v.reuseStatus === true);
226
+ }
227
+ // Annotate the CommonJS export names for ESM import in node:
228
+ 0 && (module.exports = {
229
+ computeLoadedStatus,
230
+ computeReuseStatus,
231
+ computeShareStats,
232
+ findPackageProvider,
233
+ getFilterOptions,
234
+ getReusedVersions,
235
+ groupByProviderScopePackage,
236
+ normalizeShareData
237
+ });