@eventcatalog/core 2.39.1 → 2.40.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-NM2UM3ZE.js → chunk-4HQYTFYJ.js} +1 -1
- package/dist/{chunk-UXUHWEGF.js → chunk-VFV2YSLH.js} +1 -1
- package/dist/{chunk-L4LXL56Q.js → chunk-WJK67MSP.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 +3 -3
- package/eventcatalog/src/components/SideNav/ListViewSideBar/utils.ts +6 -0
- package/eventcatalog/src/content.config.ts +11 -0
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +7 -2
- package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/index.astro +13 -11
- package/eventcatalog/src/pages/visualiser/[type]/[id]/index.astro +4 -1
- 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-WJK67MSP.js";
|
|
4
|
+
import "../chunk-4HQYTFYJ.js";
|
|
5
|
+
import "../chunk-VFV2YSLH.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.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
package/dist/eventcatalog.js
CHANGED
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
} from "./chunk-DCLTVJDP.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-WJK67MSP.js";
|
|
10
|
+
import "./chunk-4HQYTFYJ.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro,
|
|
13
13
|
checkAndConvertMdToMdx
|
|
14
14
|
} from "./chunk-SLEMYHTU.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-VFV2YSLH.js";
|
|
18
18
|
import {
|
|
19
19
|
isBackstagePluginEnabled,
|
|
20
20
|
isEventCatalogScaleEnabled,
|
|
@@ -57,6 +57,11 @@ export async function getResourcesForNavigation({ currentPath }: { currentPath:
|
|
|
57
57
|
href: buildUrl(`/${route}/${entity.collection}/${entity.data.id}/${entity.data.version}`),
|
|
58
58
|
}));
|
|
59
59
|
|
|
60
|
+
// don't render items if we are in the visualiser and the item has visualiser set to false
|
|
61
|
+
if (currentPath.includes('visualiser') && item.data.visualiser === false) {
|
|
62
|
+
return acc;
|
|
63
|
+
}
|
|
64
|
+
|
|
60
65
|
const navigationItem = {
|
|
61
66
|
label: item.data.name,
|
|
62
67
|
version: item.data.version,
|
|
@@ -78,6 +83,7 @@ export async function getResourcesForNavigation({ currentPath }: { currentPath:
|
|
|
78
83
|
entities: entitiesWithHref,
|
|
79
84
|
specifications: isCollectionService ? getSpecificationsForService(item) : null,
|
|
80
85
|
sidebar: item.data?.sidebar,
|
|
86
|
+
renderInVisualiser: item.data?.visualiser ?? true,
|
|
81
87
|
};
|
|
82
88
|
|
|
83
89
|
group.push(navigationItem);
|
|
@@ -135,6 +135,7 @@ const baseSchema = z.object({
|
|
|
135
135
|
z.boolean().optional(),
|
|
136
136
|
])
|
|
137
137
|
.optional(),
|
|
138
|
+
visualiser: z.boolean().optional(),
|
|
138
139
|
// Used by eventcatalog
|
|
139
140
|
versions: z.array(z.string()).optional(),
|
|
140
141
|
latestVersion: z.string().optional(),
|
|
@@ -292,6 +293,12 @@ const services = defineCollection({
|
|
|
292
293
|
pattern: [
|
|
293
294
|
'domains/*/services/*/index.(md|mdx)',
|
|
294
295
|
'domains/*/services/*/versioned/*/index.(md|mdx)',
|
|
296
|
+
|
|
297
|
+
// Capture subdomain folders
|
|
298
|
+
'domains/*/subdomains/*/services/*/index.(md|mdx)',
|
|
299
|
+
'domains/*/subdomains/*/services/*/versioned/*/index.(md|mdx)',
|
|
300
|
+
|
|
301
|
+
// Capture services in the root
|
|
295
302
|
'services/*/index.(md|mdx)', // ✅ Capture only services markdown files
|
|
296
303
|
'services/*/versioned/*/index.(md|mdx)', // ✅ Capture versioned files inside services
|
|
297
304
|
],
|
|
@@ -332,6 +339,10 @@ const domains = defineCollection({
|
|
|
332
339
|
// ✅ Strictly include only index.md at the expected levels
|
|
333
340
|
'domains/*/index.(md|mdx)',
|
|
334
341
|
'domains/*/versioned/*/index.(md|mdx)',
|
|
342
|
+
|
|
343
|
+
// Capture subdomain folders
|
|
344
|
+
'domains/*/subdomains/*/index.(md|mdx)',
|
|
345
|
+
'domains/*/subdomains/*/versioned/*/index.(md|mdx)',
|
|
335
346
|
],
|
|
336
347
|
base: projectDirBase,
|
|
337
348
|
generateId: ({ data, ...rest }) => {
|
|
@@ -70,8 +70,13 @@ const getDefaultUrl = (route: string, defaultValue: string) => {
|
|
|
70
70
|
|
|
71
71
|
for (const { data, key } of collections) {
|
|
72
72
|
if (data.length > 0 && isCollectionVisibleInCatalog(key)) {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
// find the first item that has visualiser set to true
|
|
74
|
+
const item = data.find((item) => item.data.visualiser !== false);
|
|
75
|
+
if (item) {
|
|
76
|
+
return buildUrl(`/${route}/${key}/${item.data.id}/${item.data.latestVersion}`);
|
|
77
|
+
} else {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
75
80
|
}
|
|
76
81
|
}
|
|
77
82
|
|
|
@@ -19,17 +19,19 @@ export async function getStaticPaths() {
|
|
|
19
19
|
const allItems = await Promise.all(itemTypes.map((type) => loaders[type]()));
|
|
20
20
|
|
|
21
21
|
return allItems.flatMap((items, index) =>
|
|
22
|
-
items
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
items
|
|
23
|
+
.filter((item) => item.data.visualiser !== false)
|
|
24
|
+
.map((item) => ({
|
|
25
|
+
params: {
|
|
26
|
+
type: itemTypes[index],
|
|
27
|
+
id: item.data.id,
|
|
28
|
+
version: item.data.version,
|
|
29
|
+
},
|
|
30
|
+
props: {
|
|
31
|
+
type: itemTypes[index],
|
|
32
|
+
...item,
|
|
33
|
+
},
|
|
34
|
+
}))
|
|
33
35
|
);
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -11,6 +11,9 @@ import type { CollectionTypes } from '@types';
|
|
|
11
11
|
export async function getStaticPaths() {
|
|
12
12
|
const [events, commands, services, domains] = await Promise.all([getEvents(), getCommands(), getServices(), getDomains()]);
|
|
13
13
|
|
|
14
|
+
const resources = [...domains, ...events, ...services, ...commands];
|
|
15
|
+
const resourcesWithVisualiserEnabled = resources.filter((resource) => resource.data.visualiser !== false);
|
|
16
|
+
|
|
14
17
|
const buildPages = (collection: CollectionEntry<CollectionTypes>[]) => {
|
|
15
18
|
return collection.map((item) => ({
|
|
16
19
|
params: {
|
|
@@ -24,7 +27,7 @@ export async function getStaticPaths() {
|
|
|
24
27
|
}));
|
|
25
28
|
};
|
|
26
29
|
|
|
27
|
-
return [...buildPages(
|
|
30
|
+
return [...buildPages(resourcesWithVisualiserEnabled)];
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
const props = Astro.props;
|