@eventcatalog/core 2.33.9 → 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-OKSJ75RQ.js → chunk-KWYNYLOK.js} +1 -1
- package/dist/{chunk-LVSH6F2F.js → chunk-L2RGENDX.js} +1 -1
- package/dist/{chunk-LHX6OHFE.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/content.config.ts +7 -4
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +27 -21
- 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,
|
|
@@ -116,10 +116,13 @@ const baseSchema = z.object({
|
|
|
116
116
|
})
|
|
117
117
|
.optional(),
|
|
118
118
|
deprecated: z
|
|
119
|
-
.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
.union([
|
|
120
|
+
z.object({
|
|
121
|
+
message: z.string().optional(),
|
|
122
|
+
date: z.date().optional(),
|
|
123
|
+
}),
|
|
124
|
+
z.boolean().optional(),
|
|
125
|
+
])
|
|
123
126
|
.optional(),
|
|
124
127
|
// Used by eventcatalog
|
|
125
128
|
versions: z.array(z.string()).optional(),
|
|
@@ -6,7 +6,6 @@ import { marked } from 'marked';
|
|
|
6
6
|
import components from '@components/MDX/components';
|
|
7
7
|
import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
|
|
8
8
|
import SchemaViewer from '@components/MDX/SchemaViewer/SchemaViewerRoot.astro';
|
|
9
|
-
|
|
10
9
|
import Admonition from '@components/MDX/Admonition';
|
|
11
10
|
|
|
12
11
|
// SideBars
|
|
@@ -17,16 +16,20 @@ import ChannelSideBar from '@components/SideBars/ChannelSideBar.astro';
|
|
|
17
16
|
import FlowSideBar from '@components/SideBars/FlowSideBar.astro';
|
|
18
17
|
|
|
19
18
|
import { QueueListIcon, RectangleGroupIcon, ServerIcon, BoltIcon, ChatBubbleLeftIcon } from '@heroicons/react/24/outline';
|
|
19
|
+
import { ArrowsRightLeftIcon } from '@heroicons/react/20/solid';
|
|
20
|
+
|
|
20
21
|
import type { PageTypes } from '@types';
|
|
22
|
+
import type { CollectionTypes } from '@types';
|
|
21
23
|
|
|
22
|
-
import { buildUrl } from '@utils/url-builder';
|
|
23
|
-
import { pageDataLoader } from '@utils/page-loaders/page-data-loader';
|
|
24
24
|
import { ClientRouter } from 'astro:transitions';
|
|
25
25
|
import { render } from 'astro:content';
|
|
26
|
-
import {
|
|
26
|
+
import type { CollectionEntry } from 'astro:content';
|
|
27
27
|
|
|
28
|
-
import config from '@config';
|
|
29
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';
|
|
30
33
|
|
|
31
34
|
export async function getStaticPaths() {
|
|
32
35
|
const itemTypes: PageTypes[] = ['events', 'commands', 'queries', 'services', 'domains', 'flows', 'channels'];
|
|
@@ -136,11 +139,13 @@ const pagefindAttributes =
|
|
|
136
139
|
}
|
|
137
140
|
: {};
|
|
138
141
|
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
:
|
|
142
|
+
const {
|
|
143
|
+
hasDeprecated,
|
|
144
|
+
message: deprecatedMessage,
|
|
145
|
+
isMarkedAsDeprecated,
|
|
146
|
+
deprecatedDate: formattedDate,
|
|
147
|
+
} = getDeprecatedDetails(props as unknown as CollectionEntry<CollectionTypes>);
|
|
148
|
+
|
|
144
149
|
let friendlyCollectionName = props.collection.slice(0, props.collection.length - 1);
|
|
145
150
|
friendlyCollectionName = friendlyCollectionName === 'querie' ? 'query' : friendlyCollectionName;
|
|
146
151
|
---
|
|
@@ -149,7 +154,7 @@ friendlyCollectionName = friendlyCollectionName === 'querie' ? 'query' : friendl
|
|
|
149
154
|
<main class="flex sm:px-8 docs-layout h-full" {...pagefindAttributes}>
|
|
150
155
|
<div class="flex docs-layout w-full">
|
|
151
156
|
<div class="w-full lg:mr-2 pr-8 overflow-y-auto py-8">
|
|
152
|
-
<div class="border-b border-gray-200
|
|
157
|
+
<div class="border-b border-gray-200 md:pb-2">
|
|
153
158
|
<div>
|
|
154
159
|
<h2
|
|
155
160
|
id="doc-page-header"
|
|
@@ -160,16 +165,19 @@ friendlyCollectionName = friendlyCollectionName === 'querie' ? 'query' : friendl
|
|
|
160
165
|
</h2>
|
|
161
166
|
{
|
|
162
167
|
isMarkedAsDeprecated && hasDeprecated && (
|
|
163
|
-
<Admonition
|
|
168
|
+
<Admonition
|
|
169
|
+
className="w-full"
|
|
170
|
+
type="alert"
|
|
171
|
+
title={formattedDate ? `This ${friendlyCollectionName} was deprecated on ${formattedDate}` : `Deprecated`}
|
|
172
|
+
>
|
|
164
173
|
<div>
|
|
165
|
-
{!
|
|
174
|
+
{!deprecatedMessage && (
|
|
166
175
|
<p>
|
|
167
|
-
The {friendlyCollectionName} has been
|
|
176
|
+
The {friendlyCollectionName} has been marked as deprecated
|
|
177
|
+
{formattedDate && ` on ${formattedDate}`}.
|
|
168
178
|
</p>
|
|
169
179
|
)}
|
|
170
|
-
{
|
|
171
|
-
<div class="prose prose-sm max-w-none" set:html={marked.parse(props.data.deprecated?.message)} />
|
|
172
|
-
)}
|
|
180
|
+
{deprecatedMessage && <div class="prose prose-sm max-w-none" set:html={marked.parse(deprecatedMessage)} />}
|
|
173
181
|
</div>
|
|
174
182
|
</Admonition>
|
|
175
183
|
)
|
|
@@ -178,14 +186,12 @@ friendlyCollectionName = friendlyCollectionName === 'querie' ? 'query' : friendl
|
|
|
178
186
|
isMarkedAsDeprecated && !hasDeprecated && (
|
|
179
187
|
<Admonition type="warning" title={`This ${friendlyCollectionName} will be deprecated on ${formattedDate}`}>
|
|
180
188
|
<div>
|
|
181
|
-
{!
|
|
189
|
+
{!deprecatedMessage && (
|
|
182
190
|
<p>
|
|
183
191
|
The {friendlyCollectionName} will be deprecated on {formattedDate}.
|
|
184
192
|
</p>
|
|
185
193
|
)}
|
|
186
|
-
{
|
|
187
|
-
<div class="prose prose-sm max-w-none" set:html={marked.parse(props.data.deprecated?.message)} />
|
|
188
|
-
)}
|
|
194
|
+
{deprecatedMessage && <div class="prose prose-sm max-w-none" set:html={marked.parse(deprecatedMessage)} />}
|
|
189
195
|
</div>
|
|
190
196
|
</Admonition>
|
|
191
197
|
)
|
|
@@ -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
|
+
};
|