@eventcatalog/core 5.0.0 → 5.0.2
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-NIVST4WY.js → chunk-A7AVNA6M.js} +1 -1
- package/dist/{chunk-NEAVAFSJ.js → chunk-AI5SK4WP.js} +1 -1
- package/dist/{chunk-JZN4RSMF.js → chunk-D73WCJQD.js} +1 -1
- package/dist/{chunk-RE7UTPWH.js → chunk-MSRXEI5A.js} +1 -1
- package/dist/{chunk-YQGRMDRB.js → chunk-QS6PIAHG.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/NewVersionBanner.astro +31 -0
- package/eventcatalog/src/features/mcp/apps/generated/canvas.html +1 -1
- package/eventcatalog/src/features/mcp/apps/generated/viewer.html +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +10 -13
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +10 -13
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +13 -18
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +16 -19
- package/eventcatalog/src/utils/collections/resource-type-badge.ts +9 -0
- package/eventcatalog/src/utils/collections/util.ts +10 -0
- package/eventcatalog/src/utils/version-banner.ts +10 -0
- package/package.json +5 -5
package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { render } from 'astro:content';
|
|
3
3
|
|
|
4
4
|
import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
|
|
5
|
-
import
|
|
5
|
+
import NewVersionBanner from '@components/NewVersionBanner.astro';
|
|
6
6
|
import components from '@components/MDX/components';
|
|
7
7
|
import CopyAsMarkdown from '@components/CopyAsMarkdown';
|
|
8
8
|
import Badge from '@components/Badge.astro';
|
|
@@ -11,7 +11,7 @@ import { AlignLeftIcon, HistoryIcon } from 'lucide-react';
|
|
|
11
11
|
import { isEventCatalogChatVisible, isMarkdownDownloadEnabled } from '@utils/feature';
|
|
12
12
|
import { getResourceDocTypeLabel } from '@utils/collections/resource-docs';
|
|
13
13
|
import { getIcon } from '@utils/badges';
|
|
14
|
-
import {
|
|
14
|
+
import { getResourceNoun } from '@utils/collections/util';
|
|
15
15
|
|
|
16
16
|
import { Page } from './_index.data';
|
|
17
17
|
|
|
@@ -31,9 +31,7 @@ const badges = (props.data.badges || []).map((badge: any) => ({
|
|
|
31
31
|
}));
|
|
32
32
|
|
|
33
33
|
const docsBasePath = `/docs/${props.data.resourceCollection}/${props.data.resourceId}/${props.data.resourceVersion}/${encodeURIComponent(props.data.type)}/${encodeURIComponent(props.data.id)}`;
|
|
34
|
-
const singularResourceName =
|
|
35
|
-
collectionToResourceMap[props.data.resourceCollection as keyof typeof collectionToResourceMap] ??
|
|
36
|
-
props.data.resourceCollection.slice(0, props.data.resourceCollection.length - 1);
|
|
34
|
+
const singularResourceName = getResourceNoun(props.data.resourceCollection);
|
|
37
35
|
const chatEnabled = isEventCatalogChatVisible();
|
|
38
36
|
const chatQuery = `Tell me about the ${props.data.type} doc "${title}" for ${props.data.resourceId} (version ${props.data.version})`;
|
|
39
37
|
|
|
@@ -89,14 +87,13 @@ const pagefindAttributes =
|
|
|
89
87
|
<div data-pagefind-ignore>
|
|
90
88
|
{
|
|
91
89
|
props.data.version !== props.data.latestVersion && (
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
</Admonition>
|
|
90
|
+
<NewVersionBanner
|
|
91
|
+
subject={`${singularResourceName} doc`}
|
|
92
|
+
name={title}
|
|
93
|
+
latestOf="doc"
|
|
94
|
+
latestVersion={props.data.latestVersion}
|
|
95
|
+
href={buildUrl(`${docsBasePath}/${props.data.latestVersion}`)}
|
|
96
|
+
/>
|
|
100
97
|
)
|
|
101
98
|
}
|
|
102
99
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { render } from 'astro:content';
|
|
3
3
|
|
|
4
4
|
import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
|
|
5
|
-
import
|
|
5
|
+
import NewVersionBanner from '@components/NewVersionBanner.astro';
|
|
6
6
|
import components from '@components/MDX/components';
|
|
7
7
|
import CopyAsMarkdown from '@components/CopyAsMarkdown';
|
|
8
8
|
import Badge from '@components/Badge.astro';
|
|
@@ -10,7 +10,7 @@ import { buildUrl } from '@utils/url-builder';
|
|
|
10
10
|
import { AlignLeftIcon, HistoryIcon } from 'lucide-react';
|
|
11
11
|
import { isEventCatalogChatVisible, isMarkdownDownloadEnabled } from '@utils/feature';
|
|
12
12
|
import { getIcon } from '@utils/badges';
|
|
13
|
-
import {
|
|
13
|
+
import { getResourceNoun } from '@utils/collections/util';
|
|
14
14
|
import { getResourceDocTypeLabel } from '@utils/collections/resource-docs';
|
|
15
15
|
|
|
16
16
|
import { Page } from './_index.data';
|
|
@@ -31,9 +31,7 @@ const badges = (props.data.badges || []).map((badge: any) => ({
|
|
|
31
31
|
}));
|
|
32
32
|
|
|
33
33
|
const docsBasePath = `/docs/${props.data.resourceCollection}/${props.data.resourceId}/${props.data.resourceVersion}/${encodeURIComponent(props.data.type)}/${encodeURIComponent(props.data.id)}`;
|
|
34
|
-
const singularResourceName =
|
|
35
|
-
collectionToResourceMap[props.data.resourceCollection as keyof typeof collectionToResourceMap] ??
|
|
36
|
-
props.data.resourceCollection.slice(0, props.data.resourceCollection.length - 1);
|
|
34
|
+
const singularResourceName = getResourceNoun(props.data.resourceCollection);
|
|
37
35
|
const typeLabel = getResourceDocTypeLabel(props.data.type);
|
|
38
36
|
const chatEnabled = isEventCatalogChatVisible();
|
|
39
37
|
const chatQuery = `Tell me about the ${props.data.type} doc "${title}" for ${props.data.resourceId} (version ${props.data.version})`;
|
|
@@ -88,14 +86,13 @@ const pagefindAttributes =
|
|
|
88
86
|
<div data-pagefind-ignore>
|
|
89
87
|
{
|
|
90
88
|
props.data.version !== props.data.latestVersion && (
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
</Admonition>
|
|
89
|
+
<NewVersionBanner
|
|
90
|
+
subject={`${singularResourceName} doc`}
|
|
91
|
+
name={title}
|
|
92
|
+
latestOf="doc"
|
|
93
|
+
latestVersion={props.data.latestVersion}
|
|
94
|
+
href={buildUrl(`${docsBasePath}/${props.data.latestVersion}`)}
|
|
95
|
+
/>
|
|
99
96
|
)
|
|
100
97
|
}
|
|
101
98
|
</div>
|
|
@@ -8,9 +8,10 @@ import { Page } from './_[filename].data';
|
|
|
8
8
|
import { getAbsoluteFilePathForAstroFile } from '@utils/files';
|
|
9
9
|
import { buildUrl, buildEditUrlForResource } from '@utils/url-builder';
|
|
10
10
|
import Admonition from '@components/MDX/Admonition';
|
|
11
|
+
import NewVersionBanner from '@components/NewVersionBanner.astro';
|
|
11
12
|
import Badge from '@components/Badge.astro';
|
|
12
|
-
|
|
13
|
-
import {
|
|
13
|
+
import { getResourceTypeBadge } from '@utils/collections/resource-type-badge';
|
|
14
|
+
import { getResourceNoun } from '@utils/collections/util';
|
|
14
15
|
|
|
15
16
|
export const prerender = Page.prerender;
|
|
16
17
|
export const getStaticPaths = Page.getStaticPaths;
|
|
@@ -38,9 +39,8 @@ if (isRemote) {
|
|
|
38
39
|
// Create comprehensive page title
|
|
39
40
|
const pageTitle = `${collection} | ${data.name} | GraphQL Schema`.replace(/^\w/, (c) => c.toUpperCase());
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
42
|
+
// The schema belongs to a service, event, command, query or domain
|
|
43
|
+
const getResourceBadge = () => [getResourceTypeBadge(collection)];
|
|
44
44
|
|
|
45
45
|
const getGraphQLBadge = () => {
|
|
46
46
|
return [
|
|
@@ -53,7 +53,7 @@ const getGraphQLBadge = () => {
|
|
|
53
53
|
];
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
const badges = [...
|
|
56
|
+
const badges = [...getResourceBadge(), ...getGraphQLBadge()];
|
|
57
57
|
|
|
58
58
|
// Index only the latest version
|
|
59
59
|
const pagefindAttributes =
|
|
@@ -96,18 +96,13 @@ const pagefindAttributes =
|
|
|
96
96
|
<div data-pagefind-ignore>
|
|
97
97
|
{
|
|
98
98
|
data.version !== data.latestVersion && (
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
The latest version of this GraphQL schema is
|
|
107
|
-
<span>v{data.latestVersion}</span> →
|
|
108
|
-
</a>
|
|
109
|
-
</p>
|
|
110
|
-
</Admonition>
|
|
99
|
+
<NewVersionBanner
|
|
100
|
+
subject={getResourceNoun(collection)}
|
|
101
|
+
name={data.name}
|
|
102
|
+
latestOf="GraphQL schema"
|
|
103
|
+
latestVersion={data.latestVersion}
|
|
104
|
+
href={buildUrl(`/docs/${collection}/${data.id}/${data.latestVersion}/graphql/${filename}`)}
|
|
105
|
+
/>
|
|
111
106
|
)
|
|
112
107
|
}
|
|
113
108
|
</div>
|
|
@@ -13,6 +13,7 @@ import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
|
|
|
13
13
|
import ArchitectureGraph from '@components/MDX/ArchitectureGraph/ArchitectureGraph.astro';
|
|
14
14
|
import SchemaViewer from '@components/MDX/SchemaViewer/SchemaViewerRoot.astro';
|
|
15
15
|
import Admonition from '@components/MDX/Admonition';
|
|
16
|
+
import NewVersionBanner from '@components/NewVersionBanner.astro';
|
|
16
17
|
import VersionList from '@components/Lists/VersionList.astro';
|
|
17
18
|
import CopyAsMarkdown from '@components/CopyAsMarkdown';
|
|
18
19
|
import FavoriteButton from '@components/FavoriteButton';
|
|
@@ -46,7 +47,12 @@ import {
|
|
|
46
47
|
} from 'lucide-react';
|
|
47
48
|
|
|
48
49
|
import { getSpecificationsForService } from '@utils/collections/services';
|
|
49
|
-
import {
|
|
50
|
+
import {
|
|
51
|
+
resourceToCollectionMap,
|
|
52
|
+
collectionToResourceMap,
|
|
53
|
+
getDeprecatedDetails,
|
|
54
|
+
getResourceNoun,
|
|
55
|
+
} from '@utils/collections/util';
|
|
50
56
|
import {
|
|
51
57
|
createAdrStatusBadge,
|
|
52
58
|
formatAdrDate,
|
|
@@ -305,16 +311,13 @@ const {
|
|
|
305
311
|
deprecatedDate: formattedDate,
|
|
306
312
|
} = getDeprecatedDetails(props as unknown as CollectionEntry<CollectionTypes>);
|
|
307
313
|
|
|
308
|
-
|
|
309
|
-
friendlyCollectionName = friendlyCollectionName === 'querie' ? 'query' : friendlyCollectionName;
|
|
310
|
-
friendlyCollectionName = friendlyCollectionName === 'entitie' ? 'entity' : friendlyCollectionName;
|
|
311
|
-
friendlyCollectionName = friendlyCollectionName === 'adr' ? 'architecture decision' : friendlyCollectionName;
|
|
314
|
+
const friendlyCollectionName = getResourceNoun(props.collection);
|
|
312
315
|
|
|
313
316
|
const schemasForResource = getSchemasFromResource(props);
|
|
314
317
|
|
|
315
318
|
const generatePromptForResource = (props: any) => {
|
|
316
319
|
return `
|
|
317
|
-
Please tell me more about the ${
|
|
320
|
+
Please tell me more about the ${friendlyCollectionName} - ${props.data.name} v${props.data.version} in this catalog.
|
|
318
321
|
`;
|
|
319
322
|
};
|
|
320
323
|
|
|
@@ -596,19 +599,13 @@ if (!isAdrPage && !hasCurrentFlowEmbed && !hasCurrentPageNodeGraph) {
|
|
|
596
599
|
<div data-pagefind-ignore>
|
|
597
600
|
{
|
|
598
601
|
props.data.version !== props.data.latestVersion && (
|
|
599
|
-
<
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
>
|
|
607
|
-
The latest version of this {props.collection.slice(0, props.collection.length - 1)} is
|
|
608
|
-
<span>v{props.data.latestVersion}</span> →
|
|
609
|
-
</a>
|
|
610
|
-
</p>
|
|
611
|
-
</Admonition>
|
|
602
|
+
<NewVersionBanner
|
|
603
|
+
subject={friendlyCollectionName}
|
|
604
|
+
name={props.data.name}
|
|
605
|
+
latestOf={friendlyCollectionName}
|
|
606
|
+
latestVersion={props.data.latestVersion}
|
|
607
|
+
href={buildUrl(`/docs/${props.collection}/${props.data.id}/${props.data.latestVersion}`)}
|
|
608
|
+
/>
|
|
612
609
|
)
|
|
613
610
|
}
|
|
614
611
|
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getIconForCollection } from '@utils/collections/icons';
|
|
2
|
+
import { getResourceTypeLabel } from '@utils/collections/util';
|
|
3
|
+
|
|
4
|
+
/** A badge naming a resource's type, with its icon (e.g. on a GraphQL schema page, the resource it belongs to) */
|
|
5
|
+
export const getResourceTypeBadge = (collection: string) => ({
|
|
6
|
+
textColor: 'gray',
|
|
7
|
+
content: getResourceTypeLabel(collection),
|
|
8
|
+
icon: getIconForCollection(collection),
|
|
9
|
+
});
|
|
@@ -227,6 +227,16 @@ export const getResourceTypeLabel = (collection: string): string => {
|
|
|
227
227
|
.join(' ');
|
|
228
228
|
};
|
|
229
229
|
|
|
230
|
+
/**
|
|
231
|
+
* What a resource in a collection is called in a sentence, e.g. "a previous version of the query".
|
|
232
|
+
* e.g. 'queries' → 'query', 'data-products' → 'data product', 'adrs' → 'architecture decision'
|
|
233
|
+
*/
|
|
234
|
+
export const getResourceNoun = (collection: string): string => {
|
|
235
|
+
if (collection === 'adrs') return 'architecture decision';
|
|
236
|
+
const raw = (collectionToResourceMap as Record<string, string>)[collection] || collection;
|
|
237
|
+
return raw.replace(/-/g, ' ');
|
|
238
|
+
};
|
|
239
|
+
|
|
230
240
|
/**
|
|
231
241
|
* Returns the correct pointer field name for a collection and direction.
|
|
232
242
|
* Data-products use 'outputs'/'inputs' instead of 'sends'/'receives'.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sentences on the "New version found" banner (components/NewVersionBanner.astro), shown on a previous version of a
|
|
3
|
+
* page. Each ends with the space before what follows it (the name, then the version), so the markup can't lose it.
|
|
4
|
+
*/
|
|
5
|
+
export const getVersionBannerText = ({ subject, latestOf }: { subject: string; latestOf: string }) => ({
|
|
6
|
+
/** Followed by the name of what this page is a version of, e.g. "...of the query " Get Orders */
|
|
7
|
+
previous: `You are looking at a previous version of the ${subject} `,
|
|
8
|
+
/** Followed by the latest version, e.g. "...of this query is " v2.0.0 */
|
|
9
|
+
latest: `The latest version of this ${latestOf} is `,
|
|
10
|
+
});
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "BUSL-1.1",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "5.0.
|
|
10
|
+
"version": "5.0.2",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@mcp-b/webmcp-polyfill": "5.1.0",
|
|
67
67
|
"@mermaid-js/layout-elk": "^0.2.0",
|
|
68
68
|
"@modelcontextprotocol/ext-apps": "^1.7.5",
|
|
69
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
69
|
+
"@modelcontextprotocol/sdk": "^1.32.0",
|
|
70
70
|
"@nanostores/react": "^1.0.0",
|
|
71
71
|
"@parcel/watcher": "^2.4.1",
|
|
72
72
|
"@radix-ui/react-context-menu": "^2.2.6",
|
|
@@ -140,9 +140,9 @@
|
|
|
140
140
|
"y-protocols": "^1.0.7",
|
|
141
141
|
"yjs": "^13.6.33",
|
|
142
142
|
"zod": "^4.6.6",
|
|
143
|
-
"@eventcatalog/linter": "1.2.
|
|
144
|
-
"@eventcatalog/
|
|
145
|
-
"@eventcatalog/
|
|
143
|
+
"@eventcatalog/linter": "1.2.1",
|
|
144
|
+
"@eventcatalog/visualiser": "^5.0.0",
|
|
145
|
+
"@eventcatalog/sdk": "2.30.0"
|
|
146
146
|
},
|
|
147
147
|
"devDependencies": {
|
|
148
148
|
"@astrojs/check": "^0.9.10",
|