@eventcatalog/core 2.33.8 → 2.33.9
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-HPV7UK2I.js → chunk-LHX6OHFE.js} +1 -1
- package/dist/{chunk-DCU5UE7Y.js → chunk-LVSH6F2F.js} +1 -1
- package/dist/{chunk-SSJWAEJA.js → chunk-OKSJ75RQ.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 +6 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +48 -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-LVSH6F2F.js";
|
|
4
|
+
import "../chunk-LHX6OHFE.js";
|
|
5
|
+
import "../chunk-OKSJ75RQ.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-LVSH6F2F.js";
|
|
10
|
+
import "./chunk-LHX6OHFE.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-OKSJ75RQ.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,12 @@ const baseSchema = z.object({
|
|
|
115
115
|
.optional(),
|
|
116
116
|
})
|
|
117
117
|
.optional(),
|
|
118
|
+
deprecated: z
|
|
119
|
+
.object({
|
|
120
|
+
message: z.string().optional(),
|
|
121
|
+
date: z.date().optional(),
|
|
122
|
+
})
|
|
123
|
+
.optional(),
|
|
118
124
|
// Used by eventcatalog
|
|
119
125
|
versions: z.array(z.string()).optional(),
|
|
120
126
|
latestVersion: z.string().optional(),
|
|
@@ -1,11 +1,14 @@
|
|
|
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';
|
|
8
9
|
|
|
10
|
+
import Admonition from '@components/MDX/Admonition';
|
|
11
|
+
|
|
9
12
|
// SideBars
|
|
10
13
|
import ServiceSideBar from '@components/SideBars/ServiceSideBar.astro';
|
|
11
14
|
import MessageSideBar from '@components/SideBars/MessageSideBar.astro';
|
|
@@ -132,6 +135,14 @@ const pagefindAttributes =
|
|
|
132
135
|
'data-pagefind-meta': `title:${pageTitle}`,
|
|
133
136
|
}
|
|
134
137
|
: {};
|
|
138
|
+
|
|
139
|
+
const isMarkedAsDeprecated = props.data.deprecated;
|
|
140
|
+
const hasDeprecated = props.data.deprecated?.date && new Date(props.data.deprecated?.date) < new Date();
|
|
141
|
+
const formattedDate = props.data.deprecated?.date
|
|
142
|
+
? new Date(props.data.deprecated?.date).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })
|
|
143
|
+
: '';
|
|
144
|
+
let friendlyCollectionName = props.collection.slice(0, props.collection.length - 1);
|
|
145
|
+
friendlyCollectionName = friendlyCollectionName === 'querie' ? 'query' : friendlyCollectionName;
|
|
135
146
|
---
|
|
136
147
|
|
|
137
148
|
<VerticalSideBarLayout title={pageTitle} description={props.data.summary}>
|
|
@@ -140,10 +151,46 @@ const pagefindAttributes =
|
|
|
140
151
|
<div class="w-full lg:mr-2 pr-8 overflow-y-auto py-8">
|
|
141
152
|
<div class="border-b border-gray-200 flex justify-between items-start md:pb-2">
|
|
142
153
|
<div>
|
|
143
|
-
<h2
|
|
154
|
+
<h2
|
|
155
|
+
id="doc-page-header"
|
|
156
|
+
class={`text-2xl md:text-4xl font-bold text-black ${props.data.deprecated && hasDeprecated ? 'text-red-500' : ''}`}
|
|
157
|
+
>
|
|
144
158
|
{props.data.name}
|
|
145
159
|
<span class="">(v{props.data.version})</span>
|
|
146
160
|
</h2>
|
|
161
|
+
{
|
|
162
|
+
isMarkedAsDeprecated && hasDeprecated && (
|
|
163
|
+
<Admonition type="alert" title={`This ${friendlyCollectionName} was deprecated on ${formattedDate}`}>
|
|
164
|
+
<div>
|
|
165
|
+
{!props.data.deprecated?.message && (
|
|
166
|
+
<p>
|
|
167
|
+
The {friendlyCollectionName} has been deprecated ({props.data.deprecated?.date}).
|
|
168
|
+
</p>
|
|
169
|
+
)}
|
|
170
|
+
{props.data.deprecated?.message && (
|
|
171
|
+
<div class="prose prose-sm max-w-none" set:html={marked.parse(props.data.deprecated?.message)} />
|
|
172
|
+
)}
|
|
173
|
+
</div>
|
|
174
|
+
</Admonition>
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
{
|
|
178
|
+
isMarkedAsDeprecated && !hasDeprecated && (
|
|
179
|
+
<Admonition type="warning" title={`This ${friendlyCollectionName} will be deprecated on ${formattedDate}`}>
|
|
180
|
+
<div>
|
|
181
|
+
{!props.data.deprecated?.message && (
|
|
182
|
+
<p>
|
|
183
|
+
The {friendlyCollectionName} will be deprecated on {formattedDate}.
|
|
184
|
+
</p>
|
|
185
|
+
)}
|
|
186
|
+
{props.data.deprecated?.message && (
|
|
187
|
+
<div class="prose prose-sm max-w-none" set:html={marked.parse(props.data.deprecated?.message)} />
|
|
188
|
+
)}
|
|
189
|
+
</div>
|
|
190
|
+
</Admonition>
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
|
|
147
194
|
<h2 class="text-lg pt-2 text-gray-500 font-light">{props.data.summary}</h2>
|
|
148
195
|
{
|
|
149
196
|
badges && (
|