@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.
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "2.33.8";
40
+ var version = "2.33.10";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-HPV7UK2I.js";
4
- import "../chunk-SSJWAEJA.js";
3
+ } from "../chunk-N7V2JS3E.js";
4
+ import "../chunk-KWYNYLOK.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -106,7 +106,7 @@ var import_axios = __toESM(require("axios"), 1);
106
106
  var import_os = __toESM(require("os"), 1);
107
107
 
108
108
  // package.json
109
- var version = "2.33.8";
109
+ var version = "2.33.10";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-DCU5UE7Y.js";
4
- import "../chunk-HPV7UK2I.js";
5
- import "../chunk-SSJWAEJA.js";
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
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.33.8";
2
+ var version = "2.33.10";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-HPV7UK2I.js";
3
+ } from "./chunk-N7V2JS3E.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-SSJWAEJA.js";
3
+ } from "./chunk-KWYNYLOK.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.33.8";
28
+ var version = "2.33.10";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-SSJWAEJA.js";
3
+ } from "./chunk-KWYNYLOK.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
157
157
  var import_os = __toESM(require("os"), 1);
158
158
 
159
159
  // package.json
160
- var version = "2.33.8";
160
+ var version = "2.33.10";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-UKJ7F5WR.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-DCU5UE7Y.js";
10
- import "./chunk-HPV7UK2I.js";
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-SSJWAEJA.js";
17
+ } from "./chunk-KWYNYLOK.js";
18
18
  import {
19
19
  isBackstagePluginEnabled,
20
20
  isEventCatalogScaleEnabled,
@@ -1,33 +1,37 @@
1
- import { ExclamationTriangleIcon } from '@heroicons/react/20/solid';
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: JSX.Element;
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 { color, icon: Icon } = getConfigurationByType(type);
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}-400 my-4 ${className}`}>
26
- <div className="flex">
27
- <div className="ml-3 py-2 text-sm flex items-center">
28
- <Icon className={`block mr-2 h-7 w-7 text-${color}-400`} aria-hidden="true" />
29
- <div>{children}</div>
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 { ArrowsRightLeftIcon } from '@heroicons/react/20/solid';
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 flex justify-between items-start md:pb-2">
157
+ <div class="border-b border-gray-200 md:pb-2">
142
158
  <div>
143
- <h2 id="doc-page-header" class="text-2xl md:text-4xl font-bold text-black">
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
+ };
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/event-catalog/eventcatalog.git"
7
7
  },
8
8
  "type": "module",
9
- "version": "2.33.8",
9
+ "version": "2.33.10",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },