@fusion.dev/helix-docs 0.177.2 → 0.178.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/content/graphs.mdx +24 -5
- package/content/metrics.mdx +218 -218
- package/dist/catalog.d.ts +6 -0
- package/dist/catalog.js +21 -0
- package/dist/sources.generated.js +242 -223
- package/package.json +9 -9
package/dist/catalog.js
CHANGED
|
@@ -72,9 +72,28 @@ const examplesOf = (slug, declared, sources) => {
|
|
|
72
72
|
};
|
|
73
73
|
}));
|
|
74
74
|
};
|
|
75
|
+
const entriesOf = (manifest) => {
|
|
76
|
+
const entries = new Map();
|
|
77
|
+
for (const module of manifest.modules ?? []) {
|
|
78
|
+
const entry = /^src\/(.+)\/index\.ts$/.exec(module.path ?? '')?.[1];
|
|
79
|
+
if (!entry) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
for (const exported of module.exports ?? []) {
|
|
83
|
+
const from = exported.declaration?.module?.replace(/\.[jt]s$/, '');
|
|
84
|
+
const held = from === undefined ? undefined : entries.get(from);
|
|
85
|
+
if (from !== undefined && (held === undefined || entry.length < held.length)) {
|
|
86
|
+
entries.set(from, entry);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return entries;
|
|
91
|
+
};
|
|
75
92
|
export const catalog = (manifests, examples = []) => {
|
|
76
93
|
const byFamily = new Map();
|
|
94
|
+
const entryOf = new Map();
|
|
77
95
|
for (const manifest of manifests) {
|
|
96
|
+
const entries = entriesOf(manifest);
|
|
78
97
|
for (const module of manifest.modules ?? []) {
|
|
79
98
|
for (const declaration of module.declarations ?? []) {
|
|
80
99
|
if (!declaration.tagName) {
|
|
@@ -85,6 +104,7 @@ export const catalog = (manifests, examples = []) => {
|
|
|
85
104
|
continue;
|
|
86
105
|
}
|
|
87
106
|
byFamily.set(family, [...(byFamily.get(family) ?? []), declaration]);
|
|
107
|
+
entryOf.set(declaration, entries.get((module.path ?? '').replace(/\.[jt]s$/, '')) ?? family);
|
|
88
108
|
}
|
|
89
109
|
}
|
|
90
110
|
}
|
|
@@ -105,6 +125,7 @@ export const catalog = (manifests, examples = []) => {
|
|
|
105
125
|
cssProperties: members(entry.cssProperties),
|
|
106
126
|
cssStates: members(entry.cssStates),
|
|
107
127
|
description: entry.description ?? '',
|
|
128
|
+
entry: entryOf.get(entry) ?? slug,
|
|
108
129
|
events: (entry.events ?? []).map((event) => ({
|
|
109
130
|
description: event.description ?? '',
|
|
110
131
|
name: event.name ?? '',
|