@eventcatalog/core 3.4.2 → 3.5.1

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 = "3.4.2";
40
+ var version = "3.5.1";
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-363MMCIA.js";
4
- import "../chunk-JKOCGMX6.js";
3
+ } from "../chunk-S4WEKWZQ.js";
4
+ import "../chunk-THGO7LXH.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 = "3.4.2";
109
+ var version = "3.5.1";
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-6TCIKRLP.js";
4
- import "../chunk-363MMCIA.js";
5
- import "../chunk-JKOCGMX6.js";
3
+ } from "../chunk-HKP23E7A.js";
4
+ import "../chunk-S4WEKWZQ.js";
5
+ import "../chunk-THGO7LXH.js";
6
6
  import "../chunk-UPONRQSN.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-E4RUDCKA.js";
3
+ } from "./chunk-3XCGL7TC.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-JKOCGMX6.js";
3
+ } from "./chunk-THGO7LXH.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-363MMCIA.js";
3
+ } from "./chunk-S4WEKWZQ.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-JKOCGMX6.js";
3
+ } from "./chunk-THGO7LXH.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "3.4.2";
2
+ var version = "3.5.1";
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 = "3.4.2";
28
+ var version = "3.5.1";
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-JKOCGMX6.js";
3
+ } from "./chunk-THGO7LXH.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -109,7 +109,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
109
109
  var import_picocolors = __toESM(require("picocolors"), 1);
110
110
 
111
111
  // package.json
112
- var version = "3.4.2";
112
+ var version = "3.5.1";
113
113
 
114
114
  // src/constants.ts
115
115
  var VERSION = version;
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-6TCIKRLP.js";
10
- import "./chunk-363MMCIA.js";
9
+ } from "./chunk-HKP23E7A.js";
10
+ import "./chunk-S4WEKWZQ.js";
11
11
  import {
12
12
  runMigrations
13
13
  } from "./chunk-BH3JMNAV.js";
@@ -21,13 +21,13 @@ import {
21
21
  } from "./chunk-5VBIXL6C.js";
22
22
  import {
23
23
  generate
24
- } from "./chunk-JMIRAK3A.js";
24
+ } from "./chunk-2SOGDOBS.js";
25
25
  import {
26
26
  logger
27
- } from "./chunk-E4RUDCKA.js";
27
+ } from "./chunk-3XCGL7TC.js";
28
28
  import {
29
29
  VERSION
30
- } from "./chunk-JKOCGMX6.js";
30
+ } from "./chunk-THGO7LXH.js";
31
31
  import "./chunk-UPONRQSN.js";
32
32
 
33
33
  // src/eventcatalog.ts
package/dist/generate.cjs CHANGED
@@ -73,7 +73,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
73
73
  var import_picocolors = __toESM(require("picocolors"), 1);
74
74
 
75
75
  // package.json
76
- var version = "3.4.2";
76
+ var version = "3.5.1";
77
77
 
78
78
  // src/constants.ts
79
79
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-JMIRAK3A.js";
4
- import "./chunk-E4RUDCKA.js";
5
- import "./chunk-JKOCGMX6.js";
3
+ } from "./chunk-2SOGDOBS.js";
4
+ import "./chunk-3XCGL7TC.js";
5
+ import "./chunk-THGO7LXH.js";
6
6
  import "./chunk-UPONRQSN.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 = "3.4.2";
39
+ var version = "3.5.1";
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-E4RUDCKA.js";
4
- import "../chunk-JKOCGMX6.js";
3
+ } from "../chunk-3XCGL7TC.js";
4
+ import "../chunk-THGO7LXH.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -33,7 +33,7 @@ export default function MessageContextMenu(data: Data) {
33
33
  {schemaPath && (
34
34
  <ContextMenu.Item asChild>
35
35
  <a
36
- href={buildUrl(`/generated/${messageType}/${id}/schema.json`)}
36
+ href={buildUrl(`/generated/${messageType}/${id}/${schemaPath}`)}
37
37
  download={`${name}(${version})-${schemaPath}`}
38
38
  className="text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-orange-100 rounded-sm flex items-center"
39
39
  target="_blank"
@@ -26,6 +26,7 @@ import { StarIcon as StarIconSolid, CircleStackIcon } from '@heroicons/react/24/
26
26
  import { useStore } from '@nanostores/react';
27
27
  import { sidebarStore } from '../../stores/sidebar-store';
28
28
  import { favoritesStore, toggleFavorite as toggleFavoriteAction } from '../../stores/favorites-store';
29
+ import { buildUrl } from '@utils/url-builder';
29
30
 
30
31
  const typeIcons: any = {
31
32
  Domain: RectangleGroupIcon,
@@ -94,7 +95,7 @@ const getUrlForItem = (node: any, key: string) => {
94
95
  pluralType = 'queries';
95
96
  }
96
97
 
97
- return `/docs/${pluralType}/${id}/${version}`;
98
+ return buildUrl(`/docs/${pluralType}/${id}/${version}`);
98
99
  };
99
100
 
100
101
  export default function SearchModal() {
@@ -18,23 +18,10 @@ import {
18
18
  ArrowLeftRight,
19
19
  } from 'lucide-react';
20
20
  import type { NavNode } from '@stores/sidebar-store/state';
21
+ import { getBadgeClasses } from './utils';
21
22
 
22
23
  const cn = (...classes: (string | false | undefined)[]) => classes.filter(Boolean).join(' ');
23
24
 
24
- const getBadgeClasses = (badge: string): string => {
25
- const badgeColors: Record<string, string> = {
26
- domain: 'bg-blue-100 text-blue-700',
27
- service: 'bg-green-100 text-green-700',
28
- event: 'bg-amber-100 text-amber-700',
29
- command: 'bg-pink-100 text-pink-700',
30
- query: 'bg-green-100 text-green-700',
31
- message: 'bg-indigo-100 text-indigo-700',
32
- design: 'bg-teal-100 text-teal-700',
33
- channel: 'bg-indigo-100 text-indigo-700',
34
- };
35
- return badgeColors[badge.toLowerCase()] || 'bg-gray-100 text-gray-600';
36
- };
37
-
38
25
  type SearchResult = {
39
26
  nodeKey: string;
40
27
  node: NavNode;
@@ -53,8 +40,15 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
53
40
  const [showFilterDropdown, setShowFilterDropdown] = useState(false);
54
41
 
55
42
  // Pre-process searchable nodes to avoid iterating object on every render
43
+ // Filter out unversioned keys (e.g., "domain:OrderService") to avoid duplicates with versioned keys (e.g., "domain:OrderService:1.0.0")
56
44
  const searchableNodes = useMemo(() => {
57
- return Object.entries(nodes).filter(([_, node]) => node.type !== 'group');
45
+ return Object.entries(nodes).filter(([key, node]) => {
46
+ if (node.type === 'group') return false;
47
+ // Only include versioned keys (those with 3+ parts like "type:id:version")
48
+ // Unversioned keys (2 parts like "type:id") are aliases to latest version and would cause duplicates
49
+ const keyParts = key.split(':');
50
+ return keyParts.length >= 3;
51
+ });
58
52
  }, [nodes]);
59
53
 
60
54
  // Get available badges from nodes
@@ -118,6 +112,7 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
118
112
  Container: 'container',
119
113
  Flow: 'flow',
120
114
  Design: 'design',
115
+ Channel: 'channel',
121
116
  };
122
117
 
123
118
  // Use the memoized array instead of Object.entries(nodes)
@@ -160,6 +155,23 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
160
155
  const results = searchResults();
161
156
  const showSearchResults = searchQuery.trim().length > 0;
162
157
 
158
+ // Group results by type (badge), sorted alphabetically
159
+ const groupedResults = useMemo(() => {
160
+ const groups: Record<string, SearchResult[]> = {};
161
+
162
+ for (const result of results) {
163
+ const badge = result.node.badge || 'Other';
164
+ if (!groups[badge]) {
165
+ groups[badge] = [];
166
+ }
167
+ groups[badge].push(result);
168
+ }
169
+
170
+ return Object.entries(groups)
171
+ .sort(([a], [b]) => a.localeCompare(b))
172
+ .map(([type, typeResults]) => ({ type, results: typeResults }));
173
+ }, [results]);
174
+
163
175
  return (
164
176
  <>
165
177
  {/* Search Input */}
@@ -267,38 +279,45 @@ export default function SearchBar({ nodes, onSelectResult, onSearchChange }: Pro
267
279
  <div className="text-[10px] font-medium text-[rgb(var(--ec-content-text-muted))] uppercase tracking-wide mb-2">
268
280
  {results.length > 0 ? `${results.length} result${results.length > 1 ? 's' : ''}` : 'No results'}
269
281
  </div>
270
- {results.length > 0 && (
271
- <div className="flex flex-col gap-0.5">
272
- {results.map(({ nodeKey, node, matchType }) => (
273
- <button
274
- key={nodeKey}
275
- onClick={() => handleSelectResult(nodeKey, node)}
276
- className="group flex items-center justify-between w-full px-3 py-2 rounded-lg cursor-pointer text-left transition-colors hover:bg-[rgb(var(--ec-content-hover))]"
277
- >
278
- <div className="flex flex-col min-w-0 flex-1">
279
- <span className="text-sm text-[rgb(var(--ec-content-text))] truncate">{node.title}</span>
280
- {matchType === 'id' && (
281
- <span className="text-xs text-[rgb(var(--ec-content-text-muted))] truncate">
282
- ID: {nodeKey.split(':')[2]}
283
- </span>
284
- )}
282
+ {groupedResults.length > 0 && (
283
+ <div className="flex flex-col gap-3">
284
+ {groupedResults.map(({ type, results: typeResults }) => (
285
+ <div key={type}>
286
+ <div className="flex items-center gap-2 mb-1">
287
+ <span
288
+ className={cn(
289
+ 'px-1.5 py-0.5 text-[8px] font-semibold uppercase tracking-wide rounded',
290
+ getBadgeClasses(type)
291
+ )}
292
+ >
293
+ {type}
294
+ </span>
295
+ <span className="text-[10px] text-[rgb(var(--ec-content-text-muted))]">({typeResults.length})</span>
285
296
  </div>
286
- <div className="flex items-center gap-2 flex-shrink-0">
287
- {node.badge && (
288
- <span
289
- className={cn(
290
- 'px-1.5 py-0.5 text-[8px] font-semibold uppercase tracking-wide rounded',
291
- getBadgeClasses(node.badge)
292
- )}
297
+ <div className="flex flex-col gap-0.5">
298
+ {typeResults.map(({ nodeKey, node, matchType }) => (
299
+ <button
300
+ key={nodeKey}
301
+ onClick={() => handleSelectResult(nodeKey, node)}
302
+ className="group flex items-center justify-between w-full px-3 py-2 rounded-lg cursor-pointer text-left transition-colors hover:bg-[rgb(var(--ec-content-hover))]"
293
303
  >
294
- {node.badge}
295
- </span>
296
- )}
297
- {node.pages && node.pages.length > 0 && (
298
- <ChevronRight className="w-4 h-4 text-[rgb(var(--ec-icon-color))] group-hover:text-[rgb(var(--ec-accent))]" />
299
- )}
304
+ <div className="flex flex-col min-w-0 flex-1">
305
+ <span className="text-sm text-[rgb(var(--ec-content-text))] truncate">{node.title}</span>
306
+ {matchType === 'id' && (
307
+ <span className="text-xs text-[rgb(var(--ec-content-text-muted))] truncate">
308
+ ID: {nodeKey.split(':')[2]}
309
+ </span>
310
+ )}
311
+ </div>
312
+ <div className="flex items-center gap-2 flex-shrink-0">
313
+ {node.pages && node.pages.length > 0 && (
314
+ <ChevronRight className="w-4 h-4 text-[rgb(var(--ec-icon-color))] group-hover:text-[rgb(var(--ec-accent))]" />
315
+ )}
316
+ </div>
317
+ </button>
318
+ ))}
300
319
  </div>
301
- </button>
320
+ </div>
302
321
  ))}
303
322
  </div>
304
323
  )}
@@ -9,27 +9,10 @@ import { saveState, loadState, saveCollapsedSections, loadCollapsedSections } fr
9
9
  import { useStore } from '@nanostores/react';
10
10
  import { sidebarStore } from '@stores/sidebar-store';
11
11
  import { favoritesStore, toggleFavorite as toggleFavoriteAction, type FavoriteItem } from '@stores/favorites-store';
12
+ import { getBadgeClasses } from './utils';
12
13
 
13
14
  const cn = (...classes: (string | false | undefined)[]) => classes.filter(Boolean).join(' ');
14
15
 
15
- // ============================================
16
- // Badge color mapping (uses CSS variables from theme.css)
17
- // ============================================
18
-
19
- const getBadgeClasses = (badge: string): string => {
20
- const badgeColors: Record<string, string> = {
21
- domain: 'bg-[rgb(var(--ec-badge-domain-bg))] text-[rgb(var(--ec-badge-domain-text))]',
22
- service: 'bg-[rgb(var(--ec-badge-service-bg))] text-[rgb(var(--ec-badge-service-text))]',
23
- event: 'bg-[rgb(var(--ec-badge-event-bg))] text-[rgb(var(--ec-badge-event-text))]',
24
- command: 'bg-[rgb(var(--ec-badge-command-bg))] text-[rgb(var(--ec-badge-command-text))]',
25
- query: 'bg-[rgb(var(--ec-badge-query-bg))] text-[rgb(var(--ec-badge-query-text))]',
26
- message: 'bg-[rgb(var(--ec-badge-message-bg))] text-[rgb(var(--ec-badge-message-text))]',
27
- design: 'bg-[rgb(var(--ec-badge-design-bg))] text-[rgb(var(--ec-badge-design-text))]',
28
- channel: 'bg-[rgb(var(--ec-badge-channel-bg))] text-[rgb(var(--ec-badge-channel-text))]',
29
- };
30
- return badgeColors[badge.toLowerCase()] || 'bg-[rgb(var(--ec-badge-default-bg))] text-[rgb(var(--ec-badge-default-text))]';
31
- };
32
-
33
16
  // ============================================
34
17
  // Component
35
18
  // ============================================
@@ -0,0 +1,19 @@
1
+ // Shared utilities for NestedSideBar components
2
+
3
+ /**
4
+ * Returns Tailwind classes for badge styling based on badge type.
5
+ * Uses CSS variables from theme.css for proper theming support.
6
+ */
7
+ export const getBadgeClasses = (badge: string): string => {
8
+ const badgeColors: Record<string, string> = {
9
+ domain: 'bg-[rgb(var(--ec-badge-domain-bg))] text-[rgb(var(--ec-badge-domain-text))]',
10
+ service: 'bg-[rgb(var(--ec-badge-service-bg))] text-[rgb(var(--ec-badge-service-text))]',
11
+ event: 'bg-[rgb(var(--ec-badge-event-bg))] text-[rgb(var(--ec-badge-event-text))]',
12
+ command: 'bg-[rgb(var(--ec-badge-command-bg))] text-[rgb(var(--ec-badge-command-text))]',
13
+ query: 'bg-[rgb(var(--ec-badge-query-bg))] text-[rgb(var(--ec-badge-query-text))]',
14
+ message: 'bg-[rgb(var(--ec-badge-message-bg))] text-[rgb(var(--ec-badge-message-text))]',
15
+ design: 'bg-[rgb(var(--ec-badge-design-bg))] text-[rgb(var(--ec-badge-design-text))]',
16
+ channel: 'bg-[rgb(var(--ec-badge-channel-bg))] text-[rgb(var(--ec-badge-channel-text))]',
17
+ };
18
+ return badgeColors[badge.toLowerCase()] || 'bg-[rgb(var(--ec-badge-default-bg))] text-[rgb(var(--ec-badge-default-text))]';
19
+ };
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": "3.4.2",
9
+ "version": "3.5.1",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },