@eventcatalog/core 2.33.8 → 2.33.10
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-SSJWAEJA.js → chunk-KWYNYLOK.js} +1 -1
- package/dist/{chunk-DCU5UE7Y.js → chunk-L2RGENDX.js} +1 -1
- package/dist/{chunk-HPV7UK2I.js → chunk-N7V2JS3E.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/MDX/Admonition.tsx +17 -13
- package/eventcatalog/src/content.config.ts +9 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +59 -6
- package/eventcatalog/src/utils/collections/util.ts +27 -0
- 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-L2RGENDX.js";
|
|
4
|
+
import "../chunk-N7V2JS3E.js";
|
|
5
|
+
import "../chunk-KWYNYLOK.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-UKJ7F5WR.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-L2RGENDX.js";
|
|
10
|
+
import "./chunk-N7V2JS3E.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro,
|
|
13
13
|
checkAndConvertMdToMdx
|
|
14
14
|
} from "./chunk-7SI5EVOX.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KWYNYLOK.js";
|
|
18
18
|
import {
|
|
19
19
|
isBackstagePluginEnabled,
|
|
20
20
|
isEventCatalogScaleEnabled,
|
|
@@ -1,33 +1,37 @@
|
|
|
1
|
-
import { ExclamationTriangleIcon } from '@heroicons/react/
|
|
2
|
-
import { InformationCircleIcon } from '@heroicons/react/24/solid';
|
|
1
|
+
import { InformationCircleIcon, ExclamationTriangleIcon } from '@heroicons/react/24/outline';
|
|
3
2
|
|
|
4
3
|
const getConfigurationByType = (type: string) => {
|
|
5
4
|
switch (type) {
|
|
5
|
+
case 'danger':
|
|
6
|
+
return { color: 'red', icon: ExclamationTriangleIcon, title: 'Danger' };
|
|
6
7
|
case 'alert':
|
|
7
|
-
return { color: 'red', icon: ExclamationTriangleIcon };
|
|
8
|
+
return { color: 'red', icon: ExclamationTriangleIcon, title: 'Alert' };
|
|
8
9
|
case 'warning':
|
|
9
|
-
return { color: 'yellow', icon: ExclamationTriangleIcon };
|
|
10
|
+
return { color: 'yellow', icon: ExclamationTriangleIcon, title: 'Warning' };
|
|
10
11
|
default:
|
|
11
|
-
return { color: 'indigo', icon: InformationCircleIcon };
|
|
12
|
+
return { color: 'indigo', icon: InformationCircleIcon, title: 'Info' };
|
|
12
13
|
}
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
interface AdmonitionProps {
|
|
16
|
-
children:
|
|
17
|
+
children: React.ReactNode;
|
|
17
18
|
type?: string;
|
|
18
19
|
className?: string;
|
|
20
|
+
title?: string;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
export default function Admonition({ children, type = 'info', className = '' }: AdmonitionProps) {
|
|
22
|
-
const
|
|
23
|
+
export default function Admonition({ children, type = 'info', className = '', title }: AdmonitionProps) {
|
|
24
|
+
const config = getConfigurationByType(type);
|
|
25
|
+
const Icon = config.icon;
|
|
23
26
|
|
|
24
27
|
return (
|
|
25
|
-
<div className={`bg-${color}-50 border-l-4 border-${color}-
|
|
26
|
-
<div className="flex">
|
|
27
|
-
<div className="
|
|
28
|
-
<Icon className={`
|
|
29
|
-
<
|
|
28
|
+
<div className={`bg-${config.color}-50 border-l-4 border-${config.color}-500 p-4 my-4 ${className} rounded-md`}>
|
|
29
|
+
<div className="flex flex-col">
|
|
30
|
+
<div className="flex items-center">
|
|
31
|
+
<Icon className={`h-6 w-6 text-${config.color}-500 stroke-2`} aria-hidden="true" />
|
|
32
|
+
<h3 className={`ml-2 text-${config.color}-600 font-bold text-md`}>{title || config.title}</h3>
|
|
30
33
|
</div>
|
|
34
|
+
<div className={`mt-2 text-${config.color}-700 text-md`}>{children}</div>
|
|
31
35
|
</div>
|
|
32
36
|
</div>
|
|
33
37
|
);
|
|
@@ -115,6 +115,15 @@ const baseSchema = z.object({
|
|
|
115
115
|
.optional(),
|
|
116
116
|
})
|
|
117
117
|
.optional(),
|
|
118
|
+
deprecated: z
|
|
119
|
+
.union([
|
|
120
|
+
z.object({
|
|
121
|
+
message: z.string().optional(),
|
|
122
|
+
date: z.date().optional(),
|
|
123
|
+
}),
|
|
124
|
+
z.boolean().optional(),
|
|
125
|
+
])
|
|
126
|
+
.optional(),
|
|
118
127
|
// Used by eventcatalog
|
|
119
128
|
versions: z.array(z.string()).optional(),
|
|
120
129
|
latestVersion: z.string().optional(),
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
|
|
3
3
|
import Footer from '@layouts/Footer.astro';
|
|
4
|
+
import { marked } from 'marked';
|
|
4
5
|
|
|
5
6
|
import components from '@components/MDX/components';
|
|
6
7
|
import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
|
|
7
8
|
import SchemaViewer from '@components/MDX/SchemaViewer/SchemaViewerRoot.astro';
|
|
9
|
+
import Admonition from '@components/MDX/Admonition';
|
|
8
10
|
|
|
9
11
|
// SideBars
|
|
10
12
|
import ServiceSideBar from '@components/SideBars/ServiceSideBar.astro';
|
|
@@ -14,16 +16,20 @@ import ChannelSideBar from '@components/SideBars/ChannelSideBar.astro';
|
|
|
14
16
|
import FlowSideBar from '@components/SideBars/FlowSideBar.astro';
|
|
15
17
|
|
|
16
18
|
import { QueueListIcon, RectangleGroupIcon, ServerIcon, BoltIcon, ChatBubbleLeftIcon } from '@heroicons/react/24/outline';
|
|
19
|
+
import { ArrowsRightLeftIcon } from '@heroicons/react/20/solid';
|
|
20
|
+
|
|
17
21
|
import type { PageTypes } from '@types';
|
|
22
|
+
import type { CollectionTypes } from '@types';
|
|
18
23
|
|
|
19
|
-
import { buildUrl } from '@utils/url-builder';
|
|
20
|
-
import { pageDataLoader } from '@utils/page-loaders/page-data-loader';
|
|
21
24
|
import { ClientRouter } from 'astro:transitions';
|
|
22
25
|
import { render } from 'astro:content';
|
|
23
|
-
import {
|
|
26
|
+
import type { CollectionEntry } from 'astro:content';
|
|
24
27
|
|
|
25
|
-
import config from '@config';
|
|
26
28
|
import { getIcon } from '@utils/badges';
|
|
29
|
+
import { getDeprecatedDetails } from '@utils/collections/util';
|
|
30
|
+
import { pageDataLoader } from '@utils/page-loaders/page-data-loader';
|
|
31
|
+
import { buildUrl } from '@utils/url-builder';
|
|
32
|
+
import config from '@config';
|
|
27
33
|
|
|
28
34
|
export async function getStaticPaths() {
|
|
29
35
|
const itemTypes: PageTypes[] = ['events', 'commands', 'queries', 'services', 'domains', 'flows', 'channels'];
|
|
@@ -132,18 +138,65 @@ const pagefindAttributes =
|
|
|
132
138
|
'data-pagefind-meta': `title:${pageTitle}`,
|
|
133
139
|
}
|
|
134
140
|
: {};
|
|
141
|
+
|
|
142
|
+
const {
|
|
143
|
+
hasDeprecated,
|
|
144
|
+
message: deprecatedMessage,
|
|
145
|
+
isMarkedAsDeprecated,
|
|
146
|
+
deprecatedDate: formattedDate,
|
|
147
|
+
} = getDeprecatedDetails(props as unknown as CollectionEntry<CollectionTypes>);
|
|
148
|
+
|
|
149
|
+
let friendlyCollectionName = props.collection.slice(0, props.collection.length - 1);
|
|
150
|
+
friendlyCollectionName = friendlyCollectionName === 'querie' ? 'query' : friendlyCollectionName;
|
|
135
151
|
---
|
|
136
152
|
|
|
137
153
|
<VerticalSideBarLayout title={pageTitle} description={props.data.summary}>
|
|
138
154
|
<main class="flex sm:px-8 docs-layout h-full" {...pagefindAttributes}>
|
|
139
155
|
<div class="flex docs-layout w-full">
|
|
140
156
|
<div class="w-full lg:mr-2 pr-8 overflow-y-auto py-8">
|
|
141
|
-
<div class="border-b border-gray-200
|
|
157
|
+
<div class="border-b border-gray-200 md:pb-2">
|
|
142
158
|
<div>
|
|
143
|
-
<h2
|
|
159
|
+
<h2
|
|
160
|
+
id="doc-page-header"
|
|
161
|
+
class={`text-2xl md:text-4xl font-bold text-black ${props.data.deprecated && hasDeprecated ? 'text-red-500' : ''}`}
|
|
162
|
+
>
|
|
144
163
|
{props.data.name}
|
|
145
164
|
<span class="">(v{props.data.version})</span>
|
|
146
165
|
</h2>
|
|
166
|
+
{
|
|
167
|
+
isMarkedAsDeprecated && hasDeprecated && (
|
|
168
|
+
<Admonition
|
|
169
|
+
className="w-full"
|
|
170
|
+
type="alert"
|
|
171
|
+
title={formattedDate ? `This ${friendlyCollectionName} was deprecated on ${formattedDate}` : `Deprecated`}
|
|
172
|
+
>
|
|
173
|
+
<div>
|
|
174
|
+
{!deprecatedMessage && (
|
|
175
|
+
<p>
|
|
176
|
+
The {friendlyCollectionName} has been marked as deprecated
|
|
177
|
+
{formattedDate && ` on ${formattedDate}`}.
|
|
178
|
+
</p>
|
|
179
|
+
)}
|
|
180
|
+
{deprecatedMessage && <div class="prose prose-sm max-w-none" set:html={marked.parse(deprecatedMessage)} />}
|
|
181
|
+
</div>
|
|
182
|
+
</Admonition>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
{
|
|
186
|
+
isMarkedAsDeprecated && !hasDeprecated && (
|
|
187
|
+
<Admonition type="warning" title={`This ${friendlyCollectionName} will be deprecated on ${formattedDate}`}>
|
|
188
|
+
<div>
|
|
189
|
+
{!deprecatedMessage && (
|
|
190
|
+
<p>
|
|
191
|
+
The {friendlyCollectionName} will be deprecated on {formattedDate}.
|
|
192
|
+
</p>
|
|
193
|
+
)}
|
|
194
|
+
{deprecatedMessage && <div class="prose prose-sm max-w-none" set:html={marked.parse(deprecatedMessage)} />}
|
|
195
|
+
</div>
|
|
196
|
+
</Admonition>
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
|
|
147
200
|
<h2 class="text-lg pt-2 text-gray-500 font-light">{props.data.summary}</h2>
|
|
148
201
|
{
|
|
149
202
|
badges && (
|
|
@@ -109,3 +109,30 @@ export const resourceToCollectionMap = {
|
|
|
109
109
|
user: 'users',
|
|
110
110
|
team: 'teams',
|
|
111
111
|
} as const;
|
|
112
|
+
|
|
113
|
+
export const getDeprecatedDetails = (item: CollectionEntry<CollectionTypes>) => {
|
|
114
|
+
let options = {
|
|
115
|
+
isMarkedAsDeprecated: false,
|
|
116
|
+
hasDeprecated: false,
|
|
117
|
+
message: '',
|
|
118
|
+
deprecatedDate: '',
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
if (!item.data?.deprecated) return options;
|
|
122
|
+
|
|
123
|
+
if (typeof item.data.deprecated === 'boolean') {
|
|
124
|
+
options.hasDeprecated = item.data.deprecated;
|
|
125
|
+
options.isMarkedAsDeprecated = item.data.deprecated;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (typeof item.data.deprecated === 'object') {
|
|
129
|
+
options.isMarkedAsDeprecated = true;
|
|
130
|
+
options.hasDeprecated = item.data.deprecated.date ? new Date(item.data.deprecated.date) < new Date() : false;
|
|
131
|
+
options.message = item.data.deprecated.message ?? '';
|
|
132
|
+
options.deprecatedDate = item.data.deprecated.date
|
|
133
|
+
? new Date(item.data.deprecated.date).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })
|
|
134
|
+
: '';
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return options;
|
|
138
|
+
};
|