@eventcatalog/core 5.0.0-beta.29 → 5.0.0-beta.30

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.
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(analytics_exports);
36
36
  var import_os = __toESM(require("os"), 1);
37
37
 
38
38
  // package.json
39
- var version = "5.0.0-beta.29";
39
+ var version = "5.0.0-beta.30";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-B4OOUG5I.js";
3
+ } from "../chunk-T3OROMAU.js";
4
4
  import "../chunk-CPW6G62V.js";
5
- import "../chunk-ZK7Q7XDV.js";
5
+ import "../chunk-NA7OTBWW.js";
6
6
  export {
7
7
  raiseEvent
8
8
  };
@@ -169,7 +169,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
169
169
  var import_os = __toESM(require("os"), 1);
170
170
 
171
171
  // package.json
172
- var version = "5.0.0-beta.29";
172
+ var version = "5.0.0-beta.30";
173
173
 
174
174
  // src/constants.ts
175
175
  var VERSION = version;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-4IREUUHE.js";
3
+ } from "../chunk-55QETQZ3.js";
4
4
  import "../chunk-AD7CL772.js";
5
5
  import "../chunk-ZAZHAVKB.js";
6
6
  import "../chunk-CA6WCQ2T.js";
7
- import "../chunk-B4OOUG5I.js";
7
+ import "../chunk-T3OROMAU.js";
8
8
  import "../chunk-CPW6G62V.js";
9
- import "../chunk-ZK7Q7XDV.js";
9
+ import "../chunk-NA7OTBWW.js";
10
10
  import "../chunk-4G7FSRPN.js";
11
11
  export {
12
12
  log_build_default as default
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-CA6WCQ2T.js";
14
14
  import {
15
15
  raiseEvent
16
- } from "./chunk-B4OOUG5I.js";
16
+ } from "./chunk-T3OROMAU.js";
17
17
  import {
18
18
  TELEMETRY_REQUEST_TIMEOUT_MS,
19
19
  isTelemetryDisabled
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-34VU2X7H.js";
3
+ } from "./chunk-GQI5UYXZ.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-ZK7Q7XDV.js";
3
+ } from "./chunk-NA7OTBWW.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "5.0.0-beta.29";
2
+ var version = "5.0.0-beta.30";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-CPW6G62V.js";
5
5
  import {
6
6
  VERSION
7
- } from "./chunk-ZK7Q7XDV.js";
7
+ } from "./chunk-NA7OTBWW.js";
8
8
 
9
9
  // src/analytics/analytics.js
10
10
  import os from "os";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "5.0.0-beta.29";
28
+ var version = "5.0.0-beta.30";
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-ZK7Q7XDV.js";
3
+ } from "./chunk-NA7OTBWW.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -174,7 +174,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
174
174
  var import_picocolors = __toESM(require("picocolors"), 1);
175
175
 
176
176
  // package.json
177
- var version = "5.0.0-beta.29";
177
+ var version = "5.0.0-beta.30";
178
178
 
179
179
  // src/constants.ts
180
180
  var VERSION = version;
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-S5GWAUG5.js";
8
8
  import {
9
9
  log_build_default
10
- } from "./chunk-4IREUUHE.js";
10
+ } from "./chunk-55QETQZ3.js";
11
11
  import {
12
12
  getLicenseStatus,
13
13
  printLicenseStatus
@@ -37,10 +37,10 @@ import {
37
37
  } from "./chunk-NKNOXQ62.js";
38
38
  import {
39
39
  generate
40
- } from "./chunk-3RDV4HXA.js";
40
+ } from "./chunk-FLAZ2JVN.js";
41
41
  import {
42
42
  logger
43
- } from "./chunk-34VU2X7H.js";
43
+ } from "./chunk-GQI5UYXZ.js";
44
44
  import {
45
45
  resolve_catalog_dependencies_default
46
46
  } from "./chunk-PD7KTSYN.js";
@@ -54,7 +54,7 @@ import {
54
54
  import {
55
55
  watch
56
56
  } from "./chunk-U63GDPPY.js";
57
- import "./chunk-B4OOUG5I.js";
57
+ import "./chunk-T3OROMAU.js";
58
58
  import "./chunk-CPW6G62V.js";
59
59
  import {
60
60
  getAstroConfigPath
@@ -71,7 +71,7 @@ import {
71
71
  } from "./chunk-LFQJXLHG.js";
72
72
  import {
73
73
  VERSION
74
- } from "./chunk-ZK7Q7XDV.js";
74
+ } from "./chunk-NA7OTBWW.js";
75
75
  import {
76
76
  getEventCatalogConfigFile,
77
77
  verifyRequiredFieldsAreInCatalogConfigFile
package/dist/generate.cjs CHANGED
@@ -105,7 +105,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
105
105
  var import_picocolors = __toESM(require("picocolors"), 1);
106
106
 
107
107
  // package.json
108
- var version = "5.0.0-beta.29";
108
+ var version = "5.0.0-beta.30";
109
109
 
110
110
  // src/constants.ts
111
111
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-3RDV4HXA.js";
4
- import "./chunk-34VU2X7H.js";
5
- import "./chunk-ZK7Q7XDV.js";
3
+ } from "./chunk-FLAZ2JVN.js";
4
+ import "./chunk-GQI5UYXZ.js";
5
+ import "./chunk-NA7OTBWW.js";
6
6
  import "./chunk-4G7FSRPN.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "5.0.0-beta.29";
39
+ var version = "5.0.0-beta.30";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-34VU2X7H.js";
4
- import "../chunk-ZK7Q7XDV.js";
3
+ } from "../chunk-GQI5UYXZ.js";
4
+ import "../chunk-NA7OTBWW.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -0,0 +1,342 @@
1
+ ---
2
+ import config from '@config';
3
+ import { buildUrl } from '@utils/url-builder';
4
+ import { getColorForCollection } from '@utils/collection-colors';
5
+ import { isArchitectureGraphEnabled, isEventCatalogChatEnabled } from '@utils/feature';
6
+ import CatalogForceGraph from '@components/CatalogGraph/CatalogForceGraph';
7
+ import { getCatalogForceGraph, toCatalogForceGraphWire } from '@utils/node-graphs/catalog-force-graph';
8
+ import { getDashboard, type DashboardCollection } from '@utils/homepage-dashboard';
9
+ import { Boxes, Clock, FileJson, Mail, Network, Search, Server, Sparkles, Users, Waypoints } from 'lucide-react';
10
+
11
+ interface Props {
12
+ /** The heading, the catalog's title by default */
13
+ title?: string;
14
+ /** Under the heading, the catalog's tagline by default */
15
+ description?: string;
16
+ }
17
+
18
+ const {
19
+ title = config?.title || config?.organizationName || 'EventCatalog',
20
+ description = config?.tagline || 'Explore and understand your event-driven architecture.',
21
+ } = Astro.props;
22
+
23
+ const dashboard = await getDashboard();
24
+ const { counts, recentlyUpdated } = dashboard;
25
+ const chatEnabled = isEventCatalogChatEnabled();
26
+ // The architecture graph leads the dashboard; it's opt-in while in beta, and without it the dashboard shows what changed recently
27
+ const graph = isArchitectureGraphEnabled() ? toCatalogForceGraphWire(await getCatalogForceGraph()) : undefined;
28
+
29
+ const TYPE_LABELS: Record<DashboardCollection, string> = {
30
+ domains: 'Domain',
31
+ services: 'Service',
32
+ events: 'Event',
33
+ commands: 'Command',
34
+ queries: 'Query',
35
+ flows: 'Flow',
36
+ };
37
+ // The colour each kind of resource has across the catalog, from the theme's badge colours
38
+ const badgeStyle = (collection: string) => {
39
+ const color = getColorForCollection(collection);
40
+ return `color: rgb(var(--ec-badge-color-${color}-text)); background: rgb(var(--ec-badge-color-${color}-background));`;
41
+ };
42
+
43
+ const stats = [
44
+ { label: 'Domains', value: counts.domains, href: buildUrl('/discover/domains'), icon: Boxes },
45
+ { label: 'Services', value: counts.services, href: buildUrl('/discover/services'), icon: Server },
46
+ { label: 'Messages', value: counts.messages, href: buildUrl('/discover/events'), icon: Mail },
47
+ { label: 'Flows', value: counts.flows, href: buildUrl('/discover/flows'), icon: Waypoints },
48
+ { label: 'Schemas', value: counts.schemas, href: buildUrl('/schemas/explorer'), icon: FileJson },
49
+ { label: 'Teams', value: counts.teams, href: buildUrl('/directory/teams'), icon: Users },
50
+ ];
51
+
52
+ const formatDate = (timestamp: number) =>
53
+ new Date(timestamp).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' });
54
+ ---
55
+
56
+ <div class="ec-dashboard">
57
+ <!-- Header -->
58
+ <header class="flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between">
59
+ <div class="min-w-0">
60
+ <h1 class="text-[26px] font-semibold leading-tight tracking-tight text-[rgb(var(--ec-page-text))] md:text-[30px]">
61
+ {title}
62
+ </h1>
63
+ <p class="mt-1.5 max-w-2xl text-[14px] leading-relaxed text-[rgb(var(--ec-page-text-muted))]">
64
+ {description}
65
+ </p>
66
+ </div>
67
+ <div class="flex w-full items-center gap-2 lg:w-auto">
68
+ <button type="button" data-dashboard-search class="ec-dashboard-search group">
69
+ <Search className="h-4 w-4 text-[rgb(var(--ec-page-text-muted))]" />
70
+ <span class="flex-1 text-left">Search the catalog</span>
71
+ <kbd class="ec-dashboard-kbd">⌘K</kbd>
72
+ </button>
73
+ {
74
+ chatEnabled && (
75
+ <button type="button" data-dashboard-ask class="ec-dashboard-button">
76
+ <Sparkles className="h-4 w-4" />
77
+ Ask
78
+ </button>
79
+ )
80
+ }
81
+ </div>
82
+ </header>
83
+
84
+ <!-- Counts -->
85
+ <section class="ec-dashboard-stats mt-8" aria-label="Catalog at a glance">
86
+ {
87
+ stats.map((stat) => (
88
+ <a href={stat.href} class="ec-dashboard-card ec-dashboard-stat group">
89
+ <div class="flex items-center justify-between">
90
+ <span class="text-[12px] font-medium text-[rgb(var(--ec-page-text-muted))]">{stat.label}</span>
91
+ <stat.icon className="h-4 w-4 text-[rgb(var(--ec-page-text-muted))] transition-colors group-hover:text-[rgb(var(--ec-page-text))]" />
92
+ </div>
93
+ <span class="mt-2 block text-[28px] font-semibold leading-none tracking-tight tabular-nums text-[rgb(var(--ec-page-text))]">
94
+ {stat.value}
95
+ </span>
96
+ </a>
97
+ ))
98
+ }
99
+ </section>
100
+
101
+ <!-- The architecture graph, or what changed recently without it -->
102
+ <div class="mt-6">
103
+ {
104
+ graph ? (
105
+ <section class="ec-dashboard-card overflow-hidden">
106
+ <div class="ec-dashboard-card-header">
107
+ <h2 class="ec-dashboard-title">
108
+ <Network className="h-4 w-4" /> Architecture
109
+ </h2>
110
+ </div>
111
+ <div class="relative h-[34rem] border-t border-[rgb(var(--ec-page-border))]">
112
+ <CatalogForceGraph
113
+ client:only="react"
114
+ nodes={graph.nodes}
115
+ links={graph.links}
116
+ linkLabels={graph.linkLabels}
117
+ initialLens="domains"
118
+ showSearch
119
+ showLegend
120
+ showLensPicker
121
+ syncUrl={false}
122
+ zoomOnScroll={false}
123
+ openInGraphUrl={buildUrl('/visualiser/graph')}
124
+ openInGraphLabel="Open full screen"
125
+ />
126
+ </div>
127
+ </section>
128
+ ) : (
129
+ <section class="ec-dashboard-card">
130
+ <div class="ec-dashboard-card-header">
131
+ <h2 class="ec-dashboard-title">
132
+ <Clock className="h-4 w-4" /> Recently updated
133
+ </h2>
134
+ </div>
135
+ {recentlyUpdated.length === 0 ? (
136
+ <p class="px-5 pb-5 text-[13px] text-[rgb(var(--ec-page-text-muted))]">Nothing to show yet.</p>
137
+ ) : (
138
+ <ul class="divide-y divide-[rgb(var(--ec-page-border))]">
139
+ {recentlyUpdated.map((resource) => (
140
+ <li>
141
+ <a href={resource.href} class="ec-dashboard-row">
142
+ <span class="ec-dashboard-type" style={badgeStyle(resource.collection)}>
143
+ {TYPE_LABELS[resource.collection]}
144
+ </span>
145
+ <span class="min-w-0 flex-1">
146
+ <span class="block truncate text-[13.5px] font-medium text-[rgb(var(--ec-page-text))]">
147
+ {resource.name}
148
+ <span class="ml-1.5 font-mono text-[11.5px] font-normal text-[rgb(var(--ec-page-text-muted))]">
149
+ v{resource.version}
150
+ </span>
151
+ </span>
152
+ {resource.summary && (
153
+ <span class="block truncate text-[12.5px] text-[rgb(var(--ec-page-text-muted))]">{resource.summary}</span>
154
+ )}
155
+ </span>
156
+ {resource.owners[0] && (
157
+ <span class="hidden shrink-0 text-[12px] text-[rgb(var(--ec-page-text-muted))] md:block">
158
+ {resource.owners[0].name}
159
+ </span>
160
+ )}
161
+ <time
162
+ class="w-24 shrink-0 text-right text-[12px] tabular-nums text-[rgb(var(--ec-page-text-muted))]"
163
+ datetime={new Date(resource.updatedAt!).toISOString()}
164
+ data-relative-time
165
+ >
166
+ {formatDate(resource.updatedAt!)}
167
+ </time>
168
+ </a>
169
+ </li>
170
+ ))}
171
+ </ul>
172
+ )}
173
+ </section>
174
+ )
175
+ }
176
+ </div>
177
+ </div>
178
+
179
+ <script>
180
+ // The search bar and Ask button open the catalog's search and assistant
181
+ const bind = () => {
182
+ document.querySelector('[data-dashboard-search]')?.addEventListener('click', () => {
183
+ (window as any).searchModalState?.open();
184
+ });
185
+ document.querySelector('[data-dashboard-ask]')?.addEventListener('click', () => {
186
+ window.dispatchEvent(new CustomEvent('eventcatalog:open-chat'));
187
+ });
188
+
189
+ // "3 days ago", counted in the browser so a prerendered page stays current
190
+ const format = new Intl.RelativeTimeFormat(undefined, { numeric: 'auto' });
191
+ const units: [Intl.RelativeTimeFormatUnit, number][] = [
192
+ ['year', 365 * 24 * 3600],
193
+ ['month', 30 * 24 * 3600],
194
+ ['week', 7 * 24 * 3600],
195
+ ['day', 24 * 3600],
196
+ ['hour', 3600],
197
+ ['minute', 60],
198
+ ];
199
+ document.querySelectorAll<HTMLTimeElement>('time[data-relative-time]').forEach((time) => {
200
+ const seconds = (new Date(time.dateTime).getTime() - Date.now()) / 1000;
201
+ const [unit, size] = units.find(([, size]) => Math.abs(seconds) >= size) ?? ['minute', 60];
202
+ time.textContent = format.format(Math.round(seconds / size), unit);
203
+ time.title = new Date(time.dateTime).toLocaleString();
204
+ });
205
+ };
206
+ bind();
207
+ document.addEventListener('astro:page-load', bind);
208
+ </script>
209
+
210
+ <style is:global>
211
+ .ec-dashboard {
212
+ max-width: 96rem;
213
+ padding-bottom: 2.5rem;
214
+ }
215
+ .ec-dashboard-card {
216
+ border: 1px solid rgb(var(--ec-page-border));
217
+ border-radius: 0.875rem;
218
+ background: rgb(var(--ec-card-bg, var(--ec-page-bg)));
219
+ }
220
+ .ec-dashboard-card-header {
221
+ display: flex;
222
+ align-items: center;
223
+ justify-content: space-between;
224
+ gap: 0.75rem;
225
+ padding: 1rem 1.25rem 0.75rem;
226
+ }
227
+ .ec-dashboard-title {
228
+ display: inline-flex;
229
+ align-items: center;
230
+ gap: 0.5rem;
231
+ font-size: 13.5px;
232
+ font-weight: 600;
233
+ color: rgb(var(--ec-page-text));
234
+ }
235
+ .ec-dashboard-title svg {
236
+ color: rgb(var(--ec-page-text-muted));
237
+ }
238
+ .ec-dashboard-link {
239
+ display: inline-flex;
240
+ align-items: center;
241
+ gap: 0.25rem;
242
+ font-size: 12px;
243
+ font-weight: 500;
244
+ color: rgb(var(--ec-page-text-muted));
245
+ }
246
+ .ec-dashboard-link:hover {
247
+ color: rgb(var(--ec-page-text));
248
+ }
249
+ .ec-dashboard-search {
250
+ display: flex;
251
+ flex: 1;
252
+ align-items: center;
253
+ gap: 0.625rem;
254
+ min-width: 0;
255
+ height: 2.5rem;
256
+ padding: 0 0.75rem;
257
+ border: 1px solid rgb(var(--ec-page-border));
258
+ border-radius: 0.625rem;
259
+ background: rgb(var(--ec-card-bg, var(--ec-page-bg)));
260
+ font-size: 13px;
261
+ color: rgb(var(--ec-page-text-muted));
262
+ transition: border-color 150ms;
263
+ }
264
+ @media (min-width: 1024px) {
265
+ .ec-dashboard-search {
266
+ width: 22rem;
267
+ flex: none;
268
+ }
269
+ }
270
+ .ec-dashboard-search:hover {
271
+ border-color: rgb(var(--ec-page-text) / 0.35);
272
+ }
273
+ .ec-dashboard-kbd {
274
+ border: 1px solid rgb(var(--ec-page-border));
275
+ border-radius: 0.375rem;
276
+ padding: 0.05rem 0.375rem;
277
+ font-family: inherit;
278
+ font-size: 11px;
279
+ }
280
+ .ec-dashboard-button {
281
+ display: inline-flex;
282
+ align-items: center;
283
+ gap: 0.375rem;
284
+ height: 2.5rem;
285
+ padding: 0 0.875rem;
286
+ border-radius: 0.625rem;
287
+ background: rgb(var(--ec-page-text));
288
+ font-size: 13px;
289
+ font-weight: 500;
290
+ color: rgb(var(--ec-page-bg));
291
+ transition: opacity 150ms;
292
+ }
293
+ .ec-dashboard-button:hover {
294
+ opacity: 0.85;
295
+ }
296
+ .ec-dashboard-stats {
297
+ display: grid;
298
+ grid-template-columns: repeat(2, minmax(0, 1fr));
299
+ gap: 0.75rem;
300
+ }
301
+ @media (min-width: 768px) {
302
+ .ec-dashboard-stats {
303
+ grid-template-columns: repeat(3, minmax(0, 1fr));
304
+ }
305
+ }
306
+ @media (min-width: 1280px) {
307
+ .ec-dashboard-stats {
308
+ grid-template-columns: repeat(6, minmax(0, 1fr));
309
+ }
310
+ }
311
+ .ec-dashboard-stat {
312
+ display: block;
313
+ padding: 1rem 1.1rem;
314
+ transition: border-color 150ms;
315
+ }
316
+ .ec-dashboard-stat:hover {
317
+ border-color: rgb(var(--ec-page-text) / 0.35);
318
+ }
319
+ .ec-dashboard-row {
320
+ display: flex;
321
+ align-items: center;
322
+ gap: 0.875rem;
323
+ padding: 0.7rem 1.25rem;
324
+ transition: background 150ms;
325
+ }
326
+ .ec-dashboard-row:hover {
327
+ background: rgb(var(--ec-page-text) / 0.03);
328
+ }
329
+ .ec-dashboard-type {
330
+ flex-shrink: 0;
331
+ width: 4.75rem;
332
+ border-radius: 0.375rem;
333
+ padding: 0.15rem 0;
334
+ text-align: center;
335
+ font-size: 11px;
336
+ font-weight: 600;
337
+ }
338
+ @media (min-width: 640px) {
339
+ }
340
+ @media (min-width: 1280px) {
341
+ }
342
+ </style>