@eventcatalog/core 2.26.1 → 2.27.0

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.26.1";
40
+ var version = "2.27.0";
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-M7ERKXSB.js";
4
- import "../chunk-TOTPAQ4C.js";
3
+ } from "../chunk-2VGR4HMJ.js";
4
+ import "../chunk-LMNJPHFP.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.26.1";
109
+ var version = "2.27.0";
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-JCGLXXSE.js";
4
- import "../chunk-M7ERKXSB.js";
5
- import "../chunk-TOTPAQ4C.js";
3
+ } from "../chunk-CTL6CH3C.js";
4
+ import "../chunk-2VGR4HMJ.js";
5
+ import "../chunk-LMNJPHFP.js";
6
6
  import "../chunk-E7TXTI7G.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-TOTPAQ4C.js";
3
+ } from "./chunk-LMNJPHFP.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-M7ERKXSB.js";
3
+ } from "./chunk-2VGR4HMJ.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.26.1";
2
+ var version = "2.27.0";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.26.1";
28
+ var version = "2.27.0";
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-TOTPAQ4C.js";
3
+ } from "./chunk-LMNJPHFP.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -161,7 +161,7 @@ var import_axios = __toESM(require("axios"), 1);
161
161
  var import_os = __toESM(require("os"), 1);
162
162
 
163
163
  // package.json
164
- var version = "2.26.1";
164
+ var version = "2.27.0";
165
165
 
166
166
  // src/constants.ts
167
167
  var VERSION = version;
@@ -6,14 +6,14 @@ import {
6
6
  } from "./chunk-WUCY3QHK.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-JCGLXXSE.js";
10
- import "./chunk-M7ERKXSB.js";
9
+ } from "./chunk-CTL6CH3C.js";
10
+ import "./chunk-2VGR4HMJ.js";
11
11
  import {
12
12
  catalogToAstro
13
13
  } from "./chunk-R2NILSWL.js";
14
14
  import {
15
15
  VERSION
16
- } from "./chunk-TOTPAQ4C.js";
16
+ } from "./chunk-LMNJPHFP.js";
17
17
  import {
18
18
  isBackstagePluginEnabled
19
19
  } from "./chunk-XMDPVKIJ.js";
@@ -22,9 +22,6 @@ export default defineConfig({
22
22
  base,
23
23
  server: { port: config.port || 3000 },
24
24
 
25
-
26
-
27
-
28
25
  outDir: config.outDir ? join(projectDirectory, config.outDir) : join(projectDirectory, 'dist'),
29
26
 
30
27
  // https://docs.astro.build/en/reference/configuration-reference/#site
@@ -0,0 +1,233 @@
1
+ import { useState, useMemo } from 'react';
2
+ import { ServerIcon, EnvelopeIcon, RectangleGroupIcon } from '@heroicons/react/24/outline';
3
+ import { buildUrlWithParams } from '@utils/url-builder';
4
+ import type { CollectionEntry } from 'astro:content';
5
+ import { type CollectionMessageTypes } from '@types';
6
+ import { getCollectionStyles } from './utils';
7
+ import { SearchBar } from './components';
8
+
9
+ export interface ExtendedDomain extends CollectionEntry<'domains'> {
10
+ sends: CollectionEntry<CollectionMessageTypes>[];
11
+ receives: CollectionEntry<CollectionMessageTypes>[];
12
+ services: CollectionEntry<'services'>[];
13
+ }
14
+
15
+ interface DomainGridProps {
16
+ domains: ExtendedDomain[];
17
+ }
18
+
19
+ export default function DomainGrid({ domains }: DomainGridProps) {
20
+ const [searchQuery, setSearchQuery] = useState('');
21
+
22
+ const filteredDomains = useMemo(() => {
23
+ let result = [...domains];
24
+
25
+ // Filter by search query
26
+ if (searchQuery) {
27
+ const query = searchQuery.toLowerCase();
28
+ result = result.filter(
29
+ (domain) =>
30
+ domain.data.name?.toLowerCase().includes(query) ||
31
+ domain.data.summary?.toLowerCase().includes(query) ||
32
+ domain.data.services?.some((service: any) => service.data.name.toLowerCase().includes(query)) ||
33
+ domain.sends?.some((message: any) => message.data.name.toLowerCase().includes(query)) ||
34
+ domain.receives?.some((message: any) => message.data.name.toLowerCase().includes(query))
35
+ );
36
+ }
37
+
38
+ // Sort by name by default
39
+ result.sort((a, b) => (a.data.name || a.data.id).localeCompare(b.data.name || b.data.id));
40
+
41
+ return result;
42
+ }, [domains, searchQuery]);
43
+
44
+ return (
45
+ <div>
46
+ {/* Breadcrumb */}
47
+ <nav className="mb-4 flex items-center space-x-2 text-sm text-gray-500">
48
+ <div className="flex items-center gap-2">
49
+ <RectangleGroupIcon className="h-4 w-4" />
50
+ <span className="text-gray-900">Domains</span>
51
+ </div>
52
+ </nav>
53
+
54
+ <div className="relative border-b border-gray-200 mb-4 pb-4">
55
+ <div className="md:flex md:items-start md:justify-between">
56
+ <div className="min-w-0 flex-1 max-w-lg">
57
+ <h1 className="text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:truncate">
58
+ Domains ({filteredDomains.length})
59
+ </h1>
60
+ <p className="mt-2 text-sm text-gray-500">Browse and manage domains in your event-driven architecture</p>
61
+ </div>
62
+
63
+ <div className="mt-6 md:mt-0 md:ml-4 flex-shrink-0">
64
+ <SearchBar
65
+ searchQuery={searchQuery}
66
+ onSearchChange={setSearchQuery}
67
+ placeholder="Search domains..."
68
+ totalResults={filteredDomains.length}
69
+ totalItems={domains.length}
70
+ />
71
+ </div>
72
+ </div>
73
+ </div>
74
+
75
+ <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-2 gap-6">
76
+ {filteredDomains.map((domain) => (
77
+ <a
78
+ key={domain.data.id}
79
+ href={buildUrlWithParams('/architecture/services', {
80
+ serviceIds: domain.data.services?.map((s: any) => s.data.id).join(','),
81
+ domainId: domain.data.id,
82
+ domainName: domain.data.name,
83
+ })}
84
+ className="group hover:bg-orange-100 border-2 border-orange-400/50 bg-yellow-50 rounded-lg shadow-sm hover:shadow-lg transition-all duration-200 overflow-hidden"
85
+ >
86
+ <div className="p-6">
87
+ <div className="flex items-center justify-between mb-3">
88
+ <div className="flex items-center gap-2">
89
+ <RectangleGroupIcon className="h-5 w-5 text-orange-500" />
90
+ <h3 className="text-lg font-semibold text-gray-900 truncate group-hover:underline transition-colors duration-200">
91
+ {domain.data.name || domain.data.id}
92
+ </h3>
93
+ </div>
94
+ <span className="ml-2 shrink-0 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-orange-50 text-orange-700">
95
+ v{domain.data.version}
96
+ </span>
97
+ </div>
98
+
99
+ <p className="text-gray-600 text-sm line-clamp-2 min-h-[2.5rem]">
100
+ {domain.data.summary || <span className="italic">No summary available</span>}
101
+ </p>
102
+
103
+ <div className="flex gap-4 mb-4">
104
+ <div className="flex items-center gap-2 bg-white rounded-lg px-3 py-2 border border-pink-200">
105
+ <ServerIcon className="h-4 w-4 text-pink-500" />
106
+ <div className="flex">
107
+ <p className="text-sm font-medium text-gray-900">{domain.data.services?.length || 0} Services</p>
108
+ </div>
109
+ </div>
110
+ <div className="flex items-center gap-2 bg-white rounded-lg px-3 py-2 border border-gray-200 ">
111
+ <EnvelopeIcon className="h-4 w-4 text-blue-500" />
112
+ <div>
113
+ <p className="text-sm font-medium text-gray-900">
114
+ {(domain.sends?.length || 0) + (domain.receives?.length || 0)} Messages
115
+ </p>
116
+ </div>
117
+ </div>
118
+ </div>
119
+
120
+ <div className="space-y-6">
121
+ {/* Services and their messages */}
122
+ {domain.data.services?.slice(0, 2).map((service: any) => (
123
+ <div
124
+ key={service.data.id}
125
+ className="block space-y-2 bg-white border-2 border-dashed border-pink-400 p-4 rounded-lg transition-colors duration-200"
126
+ >
127
+ <div className="flex items-center justify-between">
128
+ <div className="flex items-center gap-2">
129
+ <ServerIcon className="h-4 w-4 text-pink-500" />
130
+ <h4 className="text-sm font-medium text-gray-900">{service.data.name || service.data.id}</h4>
131
+ </div>
132
+ <span className="text-xs text-gray-500">v{service.data.version}</span>
133
+ </div>
134
+
135
+ <div className="flex items-center gap-4">
136
+ <div className="flex-1 h-full flex flex-col bg-blue-50 border border-blue-300 rounded-lg p-3">
137
+ <div className="space-y-1.5 flex-1">
138
+ {service.data.receives?.slice(0, 3).map((message: any) => {
139
+ const { Icon, color } = getCollectionStyles(message.collection);
140
+ return (
141
+ <div
142
+ key={`${message.id}-${message.version}`}
143
+ className="group flex border border-gray-200 items-center gap-1 rounded-md text-[11px] font-medium bg-white"
144
+ >
145
+ <div className="bg-white border-r border-gray-200 px-2 py-1.5 rounded-l-md">
146
+ <Icon className={`h-3 w-3 text-${color}-500`} />
147
+ </div>
148
+ <span className="px-1 py-1">{message.id}</span>
149
+ </div>
150
+ );
151
+ })}
152
+ {service.data.receives && service.data.receives.length > 3 && (
153
+ <div className="text-center py-1">
154
+ <p className="text-gray-500 text-[10px]">+ {service.data.receives.length - 3} more</p>
155
+ </div>
156
+ )}
157
+ {!service.data.receives?.length && (
158
+ <div className="text-center py-6">
159
+ <p className="text-gray-500 text-xs">No messages received</p>
160
+ </div>
161
+ )}
162
+ </div>
163
+ </div>
164
+
165
+ <div className="flex items-center gap-2">
166
+ <div className="w-4 h-[2px] bg-blue-200"></div>
167
+ <div className="bg-white border-2 border-gray-300 rounded-lg p-2 shadow-sm">
168
+ <div className="flex flex-col items-center gap-2">
169
+ <ServerIcon className="h-6 w-6 text-pink-500" />
170
+ <div className="text-center">
171
+ <p className="text-xs font-medium text-gray-900">{service.data.name || service.data.id}</p>
172
+ <p className="text-[10px] text-gray-500">v{service.data.version}</p>
173
+ </div>
174
+ </div>
175
+ </div>
176
+ <div className="w-4 h-[2px] bg-emerald-200"></div>
177
+ </div>
178
+
179
+ <div className="flex-1 h-full flex flex-col bg-green-100 border border-green-300 rounded-lg p-3">
180
+ <div className="space-y-1.5 flex-1">
181
+ {service.data.sends?.slice(0, 3).map((message: any) => {
182
+ const { Icon, color } = getCollectionStyles(message.collection);
183
+ return (
184
+ <div
185
+ key={`${message.id}-${message.version}`}
186
+ className="group flex border border-gray-200 items-center gap-1 rounded-md text-[11px] font-medium bg-white"
187
+ >
188
+ <div className="bg-white border-r border-gray-200 px-2 py-1.5 rounded-l-md">
189
+ <Icon className={`h-3 w-3 text-${color}-500`} />
190
+ </div>
191
+ <span className="px-1 py-1">{message.id}</span>
192
+ </div>
193
+ );
194
+ })}
195
+ {service.data.sends && service.data.sends.length > 3 && (
196
+ <div className="text-center py-1">
197
+ <p className="text-gray-500 text-xs">+ {service.data.sends.length - 3} more</p>
198
+ </div>
199
+ )}
200
+ {!service.data.sends?.length && (
201
+ <div className="text-center py-6">
202
+ <p className="text-gray-500 text-xs">No messages sent</p>
203
+ </div>
204
+ )}
205
+ </div>
206
+ </div>
207
+ </div>
208
+ </div>
209
+ ))}
210
+ {domain.data.services && domain.data.services.length > 2 && (
211
+ <div className="block space-y-2 bg-white border-2 border-dashed border-pink-400 p-4 rounded-lg transition-colors duration-200">
212
+ <div className="flex items-center justify-between">
213
+ <div className="flex items-center gap-2">
214
+ <ServerIcon className="h-4 w-4 text-pink-500/70" />
215
+ <h4 className="text-sm font-medium text-gray-600">+{domain.data.services.length - 2} more services</h4>
216
+ </div>
217
+ </div>
218
+ </div>
219
+ )}
220
+ </div>
221
+ </div>
222
+ </a>
223
+ ))}
224
+ </div>
225
+
226
+ {filteredDomains.length === 0 && (
227
+ <div className="text-center py-12">
228
+ <p className="text-gray-500 text-lg">No domains found matching your criteria</p>
229
+ </div>
230
+ )}
231
+ </div>
232
+ );
233
+ }