@eventcatalog/core 3.5.2 → 3.6.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/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-OKWCSRLE.js → chunk-2DSMO5BZ.js} +1 -1
- package/dist/{chunk-YTZSPYJN.js → chunk-O3LNFOFS.js} +1 -1
- package/dist/{chunk-YVX5C6L3.js → chunk-O7ZZX4CS.js} +1 -1
- package/dist/{chunk-WO3AKJVB.js → chunk-XTN3M6CM.js} +1 -1
- package/dist/{chunk-YOFNY2RC.js → chunk-YQ2LO4G6.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +5 -5
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/components/EnvironmentDropdown.tsx +1 -1
- package/eventcatalog/src/components/Search/SearchDataLoader.astro +23 -11
- package/eventcatalog/src/components/Search/SearchModal.tsx +17 -2
- package/eventcatalog/src/components/SideNav/NestedSideBar/SearchBar.tsx +12 -6
- package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +25 -14
- package/eventcatalog/src/components/Tables/Discover/DiscoverTable.tsx +816 -0
- package/eventcatalog/src/components/Tables/Discover/FilterComponents.tsx +161 -0
- package/eventcatalog/src/components/Tables/Discover/columns.tsx +565 -0
- package/eventcatalog/src/components/Tables/Discover/index.ts +4 -0
- package/eventcatalog/src/components/Tables/columns/ContainersTableColumns.tsx +1 -1
- package/eventcatalog/src/components/Tables/columns/DomainTableColumns.tsx +1 -1
- package/eventcatalog/src/components/Tables/columns/FlowTableColumns.tsx +1 -1
- package/eventcatalog/src/components/Tables/columns/MessageTableColumns.tsx +1 -1
- package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +54 -64
- package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +15 -30
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +1 -1
- package/eventcatalog/src/pages/api/sidebar-data.json.ts +22 -0
- package/eventcatalog/src/pages/discover/[type]/_index.data.ts +5 -1
- package/eventcatalog/src/pages/discover/[type]/index.astro +360 -41
- package/eventcatalog/src/stores/sidebar-store/builders/shared.ts +1 -1
- package/eventcatalog/src/stores/sidebar-store/state.ts +25 -22
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-O3LNFOFS.js";
|
|
4
|
+
import "../chunk-XTN3M6CM.js";
|
|
5
|
+
import "../chunk-YQ2LO4G6.js";
|
|
6
6
|
import "../chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -109,7 +109,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
109
109
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
110
110
|
|
|
111
111
|
// package.json
|
|
112
|
-
var version = "3.
|
|
112
|
+
var version = "3.6.0";
|
|
113
113
|
|
|
114
114
|
// src/constants.ts
|
|
115
115
|
var VERSION = version;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-O3LNFOFS.js";
|
|
10
|
+
import "./chunk-XTN3M6CM.js";
|
|
11
11
|
import {
|
|
12
12
|
runMigrations
|
|
13
13
|
} from "./chunk-BH3JMNAV.js";
|
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
} from "./chunk-5VBIXL6C.js";
|
|
22
22
|
import {
|
|
23
23
|
generate
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-O7ZZX4CS.js";
|
|
25
25
|
import {
|
|
26
26
|
logger
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-2DSMO5BZ.js";
|
|
28
28
|
import {
|
|
29
29
|
VERSION
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-YQ2LO4G6.js";
|
|
31
31
|
import "./chunk-UPONRQSN.js";
|
|
32
32
|
|
|
33
33
|
// src/eventcatalog.ts
|
package/dist/generate.cjs
CHANGED
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-O7ZZX4CS.js";
|
|
4
|
+
import "./chunk-2DSMO5BZ.js";
|
|
5
|
+
import "./chunk-YQ2LO4G6.js";
|
|
6
6
|
import "./chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -86,7 +86,7 @@ export const EnvironmentDropdown: React.FC<EnvironmentDropdownProps> = ({ enviro
|
|
|
86
86
|
</svg>
|
|
87
87
|
</button>
|
|
88
88
|
<div
|
|
89
|
-
className={`${isOpen ? '' : 'hidden'} absolute right-0 mt-2 w-64 bg-[rgb(var(--ec-dropdown-bg))] rounded-md shadow-lg py-1
|
|
89
|
+
className={`${isOpen ? '' : 'hidden'} absolute right-0 mt-2 w-64 bg-[rgb(var(--ec-dropdown-bg))] rounded-md shadow-lg py-1 border border-[rgb(var(--ec-dropdown-border))] overflow-hidden z-[100]`}
|
|
90
90
|
>
|
|
91
91
|
{environments.map((env) => {
|
|
92
92
|
const isCurrentEnv = currentEnvironment?.name === env.name;
|
|
@@ -5,21 +5,33 @@
|
|
|
5
5
|
* This component loads the sidebar/search data independently of the sidebar UI.
|
|
6
6
|
* It ensures the search functionality works on all pages, even when the nested
|
|
7
7
|
* sidebar is not rendered (e.g., /discover pages).
|
|
8
|
+
*
|
|
9
|
+
* The data is fetched from a static JSON file (/api/sidebar-data.json) instead of
|
|
10
|
+
* being embedded inline in every HTML page. This significantly reduces build size
|
|
11
|
+
* for large catalogs.
|
|
8
12
|
*/
|
|
9
|
-
import { getNestedSideBarData } from '@stores/sidebar-store/state';
|
|
10
|
-
|
|
11
|
-
const props = await getNestedSideBarData();
|
|
12
13
|
---
|
|
13
14
|
|
|
14
|
-
<script is:inline define:vars={{ props }}>
|
|
15
|
-
window.sidebarData = props;
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
15
|
<script>
|
|
19
|
-
import { setSidebarData } from '@stores/sidebar-store';
|
|
16
|
+
import { setSidebarData, sidebarStore } from '@stores/sidebar-store';
|
|
17
|
+
import { buildUrl } from '@utils/url-builder';
|
|
18
|
+
|
|
19
|
+
// Only fetch if we haven't already loaded the data
|
|
20
|
+
if (!sidebarStore.get()) {
|
|
21
|
+
const apiUrl = buildUrl('/api/sidebar-data.json', true);
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
fetch(apiUrl)
|
|
24
|
+
.then((response) => {
|
|
25
|
+
if (!response.ok) {
|
|
26
|
+
throw new Error(`Failed to fetch sidebar data: ${response.status}`);
|
|
27
|
+
}
|
|
28
|
+
return response.json();
|
|
29
|
+
})
|
|
30
|
+
.then((data) => {
|
|
31
|
+
setSidebarData(data);
|
|
32
|
+
})
|
|
33
|
+
.catch((error) => {
|
|
34
|
+
console.error('Error loading sidebar data:', error);
|
|
35
|
+
});
|
|
24
36
|
}
|
|
25
37
|
</script>
|
|
@@ -135,6 +135,9 @@ export default function SearchModal() {
|
|
|
135
135
|
// Extract all items from nodes
|
|
136
136
|
const allItems = Object.entries(data.nodes)
|
|
137
137
|
.map(([key, node]) => {
|
|
138
|
+
// Skip reference entries (string values that point to other keys)
|
|
139
|
+
if (typeof node === 'string') return null;
|
|
140
|
+
|
|
138
141
|
const url = getUrlForItem(node, key);
|
|
139
142
|
if (!url) return null;
|
|
140
143
|
|
|
@@ -232,6 +235,18 @@ export default function SearchModal() {
|
|
|
232
235
|
});
|
|
233
236
|
};
|
|
234
237
|
|
|
238
|
+
// Helper to resolve a node, following references if needed
|
|
239
|
+
const resolveNode = (key: string) => {
|
|
240
|
+
if (!data?.nodes) return null;
|
|
241
|
+
const node = data.nodes[key];
|
|
242
|
+
if (!node) return null;
|
|
243
|
+
// If it's a string reference, follow it
|
|
244
|
+
if (typeof node === 'string') {
|
|
245
|
+
return data.nodes[node] as NavNode | undefined;
|
|
246
|
+
}
|
|
247
|
+
return node;
|
|
248
|
+
};
|
|
249
|
+
|
|
235
250
|
const filteredItems = useMemo(() => {
|
|
236
251
|
if (query === '') {
|
|
237
252
|
// Show favorites when search is empty
|
|
@@ -239,8 +254,8 @@ export default function SearchModal() {
|
|
|
239
254
|
return favorites
|
|
240
255
|
.slice(0, 5)
|
|
241
256
|
.map((fav) => {
|
|
242
|
-
const node =
|
|
243
|
-
if (!node) return null;
|
|
257
|
+
const node = resolveNode(fav.nodeKey);
|
|
258
|
+
if (!node || typeof node === 'string') return null;
|
|
244
259
|
const url = getUrlForItem(node, fav.nodeKey);
|
|
245
260
|
if (!url) return null;
|
|
246
261
|
|
|
@@ -29,7 +29,7 @@ type SearchResult = {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
type Props = {
|
|
32
|
-
nodes: Record<string, NavNode>;
|
|
32
|
+
nodes: Record<string, NavNode | string>;
|
|
33
33
|
onSelectResult: (nodeKey: string, node: NavNode) => void;
|
|
34
34
|
onSearchChange?: (isSearching: boolean) => void;
|
|
35
35
|
};
|
|
@@ -41,14 +41,20 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
|
|
|
41
41
|
|
|
42
42
|
// Pre-process searchable nodes to avoid iterating object on every render
|
|
43
43
|
// Filter out unversioned keys (e.g., "domain:OrderService") to avoid duplicates with versioned keys (e.g., "domain:OrderService:1.0.0")
|
|
44
|
-
const searchableNodes = useMemo(() => {
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
const searchableNodes = useMemo((): Array<[string, NavNode]> => {
|
|
45
|
+
const result: Array<[string, NavNode]> = [];
|
|
46
|
+
for (const [key, node] of Object.entries(nodes)) {
|
|
47
|
+
// Skip string references (unversioned aliases that point to versioned keys)
|
|
48
|
+
if (typeof node === 'string') continue;
|
|
49
|
+
if (node.type === 'group') continue;
|
|
47
50
|
// Only include versioned keys (those with 3+ parts like "type:id:version")
|
|
48
51
|
// Unversioned keys (2 parts like "type:id") are aliases to latest version and would cause duplicates
|
|
49
52
|
const keyParts = key.split(':');
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
if (keyParts.length >= 3) {
|
|
54
|
+
result.push([key, node]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
52
58
|
}, [nodes]);
|
|
53
59
|
|
|
54
60
|
// Get available badges from nodes
|
|
@@ -50,10 +50,14 @@ export default function NestedSideBar() {
|
|
|
50
50
|
const nodeLookup = useMemo(() => {
|
|
51
51
|
const lookup = new Map<string, string>();
|
|
52
52
|
|
|
53
|
-
Object.
|
|
53
|
+
Object.entries(nodes).forEach(([key, value]) => {
|
|
54
|
+
// Skip keys that are references (string values pointing to other keys)
|
|
55
|
+
// These are unversioned aliases like "domain:E-Commerce" -> "domain:E-Commerce:1.0.0"
|
|
56
|
+
if (typeof value === 'string') return;
|
|
57
|
+
|
|
54
58
|
// Key formats:
|
|
55
59
|
// - "type:id:version" (e.g., "service:OrdersService:0.0.3")
|
|
56
|
-
// - "type:id" (e.g., "
|
|
60
|
+
// - "type:id" (e.g., "user:john", "team:backend") - non-versioned resources
|
|
57
61
|
// - "list:name" (e.g., "list:domains") - skip these
|
|
58
62
|
const parts = key.split(':');
|
|
59
63
|
|
|
@@ -124,11 +128,18 @@ export default function NestedSideBar() {
|
|
|
124
128
|
|
|
125
129
|
/**
|
|
126
130
|
* Resolve a child reference to a NavNode
|
|
131
|
+
* Handles both direct keys and string references (unversioned aliases pointing to versioned keys)
|
|
127
132
|
*/
|
|
128
133
|
const resolveRef = useCallback(
|
|
129
134
|
(ref: ChildRef): NavNode | null => {
|
|
130
135
|
if (typeof ref === 'string') {
|
|
131
|
-
|
|
136
|
+
const node = nodes[ref];
|
|
137
|
+
if (!node) return null;
|
|
138
|
+
// If node is a string, it's a reference to another key (e.g., unversioned alias)
|
|
139
|
+
if (typeof node === 'string') {
|
|
140
|
+
return (nodes[node] as NavNode) ?? null;
|
|
141
|
+
}
|
|
142
|
+
return node;
|
|
132
143
|
}
|
|
133
144
|
return ref;
|
|
134
145
|
},
|
|
@@ -151,7 +162,7 @@ export default function NestedSideBar() {
|
|
|
151
162
|
const stack: NavigationLevel[] = [{ key: null, entries: roots, title: 'Documentation' }];
|
|
152
163
|
|
|
153
164
|
for (const key of path) {
|
|
154
|
-
const node =
|
|
165
|
+
const node = resolveRef(key);
|
|
155
166
|
if (node && node.pages) {
|
|
156
167
|
stack.push({
|
|
157
168
|
key,
|
|
@@ -167,7 +178,7 @@ export default function NestedSideBar() {
|
|
|
167
178
|
|
|
168
179
|
return stack;
|
|
169
180
|
},
|
|
170
|
-
[roots,
|
|
181
|
+
[roots, resolveRef]
|
|
171
182
|
);
|
|
172
183
|
|
|
173
184
|
/**
|
|
@@ -250,7 +261,7 @@ export default function NestedSideBar() {
|
|
|
250
261
|
*/
|
|
251
262
|
const tryConnectStack = useCallback(
|
|
252
263
|
(targetKey: string, currentStack: NavigationLevel[]): NavigationLevel[] | null => {
|
|
253
|
-
const targetNode =
|
|
264
|
+
const targetNode = resolveRef(targetKey);
|
|
254
265
|
if (!targetNode) return null;
|
|
255
266
|
|
|
256
267
|
// 1. Check if we are already at this level (or above)
|
|
@@ -262,7 +273,7 @@ export default function NestedSideBar() {
|
|
|
262
273
|
|
|
263
274
|
// 2. Check if it's a child of the current last level
|
|
264
275
|
const lastLevel = currentStack[currentStack.length - 1];
|
|
265
|
-
const lastNode = lastLevel.key ?
|
|
276
|
+
const lastNode = lastLevel.key ? resolveRef(lastLevel.key) : null;
|
|
266
277
|
|
|
267
278
|
// If root level (key=null), we check against roots
|
|
268
279
|
const parentChildren = lastLevel.key === null ? roots : lastNode?.pages;
|
|
@@ -289,7 +300,7 @@ export default function NestedSideBar() {
|
|
|
289
300
|
|
|
290
301
|
return null;
|
|
291
302
|
},
|
|
292
|
-
[
|
|
303
|
+
[resolveRef, roots]
|
|
293
304
|
);
|
|
294
305
|
|
|
295
306
|
/**
|
|
@@ -308,7 +319,7 @@ export default function NestedSideBar() {
|
|
|
308
319
|
return connectedStack;
|
|
309
320
|
}
|
|
310
321
|
|
|
311
|
-
const foundNode =
|
|
322
|
+
const foundNode = resolveRef(foundNodeKey);
|
|
312
323
|
if (foundNode && foundNode.pages && foundNode.pages.length > 0) {
|
|
313
324
|
// Fallback: Flattened navigation
|
|
314
325
|
return [
|
|
@@ -333,7 +344,7 @@ export default function NestedSideBar() {
|
|
|
333
344
|
}
|
|
334
345
|
return false;
|
|
335
346
|
},
|
|
336
|
-
[findNodeKeyByUrl, tryConnectStack,
|
|
347
|
+
[findNodeKeyByUrl, tryConnectStack, resolveRef, roots]
|
|
337
348
|
);
|
|
338
349
|
|
|
339
350
|
/**
|
|
@@ -374,7 +385,7 @@ export default function NestedSideBar() {
|
|
|
374
385
|
|
|
375
386
|
// 2. If no valid stack from step 1, try just the target (flattened)
|
|
376
387
|
if (!finalStack && targetKey) {
|
|
377
|
-
const targetNode =
|
|
388
|
+
const targetNode = resolveRef(targetKey);
|
|
378
389
|
if (targetNode && targetNode.pages && targetNode.pages.length > 0) {
|
|
379
390
|
finalStack = [
|
|
380
391
|
{ key: null, entries: roots, title: 'Documentation' },
|
|
@@ -391,7 +402,7 @@ export default function NestedSideBar() {
|
|
|
391
402
|
}
|
|
392
403
|
|
|
393
404
|
setIsInitialized(true);
|
|
394
|
-
}, [data, roots,
|
|
405
|
+
}, [data, roots, isInitialized, buildStackFromPath, findNodeKeyByUrl, tryConnectStack, resolveRef]);
|
|
395
406
|
|
|
396
407
|
/**
|
|
397
408
|
* Save state whenever navigation changes
|
|
@@ -600,7 +611,7 @@ export default function NestedSideBar() {
|
|
|
600
611
|
*/
|
|
601
612
|
const navigateToFavorite = (favorite: FavoriteItem) => {
|
|
602
613
|
// If it has an href and no children, just navigate to the URL
|
|
603
|
-
const node =
|
|
614
|
+
const node = resolveRef(favorite.nodeKey);
|
|
604
615
|
if (favorite.href && (!node?.pages || node.pages.length === 0)) {
|
|
605
616
|
window.location.href = favorite.href;
|
|
606
617
|
return;
|
|
@@ -1048,7 +1059,7 @@ export default function NestedSideBar() {
|
|
|
1048
1059
|
</div>
|
|
1049
1060
|
<div className="flex flex-col gap-0.5 border-l ml-3.5 border-amber-200">
|
|
1050
1061
|
{favorites.map((fav, index) => {
|
|
1051
|
-
const node =
|
|
1062
|
+
const node = resolveRef(fav.nodeKey);
|
|
1052
1063
|
const isActive = fav.href && currentPath === fav.href;
|
|
1053
1064
|
|
|
1054
1065
|
return (
|