@eventcatalog/core 4.8.4 → 4.10.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.
Files changed (72) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/{chunk-EGWBSVND.js → chunk-5XURY2JV.js} +1 -1
  6. package/dist/{chunk-FQEK3FUI.js → chunk-BDFTJVGN.js} +1 -1
  7. package/dist/{chunk-QB4W7ZUL.js → chunk-BQXEWQ5J.js} +1 -1
  8. package/dist/{chunk-Y57SL3H3.js → chunk-HFAQXAG3.js} +1 -1
  9. package/dist/{chunk-AATZMWL3.js → chunk-IC6XSXJO.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/eventcatalog.cjs +1 -1
  13. package/dist/eventcatalog.js +5 -5
  14. package/dist/generate.cjs +1 -1
  15. package/dist/generate.js +3 -3
  16. package/dist/utils/cli-logger.cjs +1 -1
  17. package/dist/utils/cli-logger.js +2 -2
  18. package/eventcatalog/src/components/Badge.astro +3 -1
  19. package/eventcatalog/src/components/FieldsExplorer/FieldNodeGraph.tsx +0 -5
  20. package/eventcatalog/src/components/MDX/Design/Design.astro +2 -0
  21. package/eventcatalog/src/components/MDX/EntityMap/EntityMap.astro +2 -0
  22. package/eventcatalog/src/components/MDX/Flow/Flow.astro +2 -0
  23. package/eventcatalog/src/components/MDX/NodeGraph/AstroNodeGraph.tsx +5 -7
  24. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +5 -0
  25. package/eventcatalog/src/components/MDX/SchemaViewer/schema-viewer-utils.spec.ts +3 -3
  26. package/eventcatalog/src/components/MDX/SchemaViewer/schema-viewer-utils.ts +2 -2
  27. package/eventcatalog/src/components/SchemaExplorer/useDarkMode.ts +13 -4
  28. package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +121 -88
  29. package/eventcatalog/src/components/SideNav/NestedSideBar/storage.ts +55 -7
  30. package/eventcatalog/src/components/SideNav/NestedSideBar/utils.spec.ts +59 -15
  31. package/eventcatalog/src/components/SideNav/NestedSideBar/utils.ts +53 -7
  32. package/eventcatalog/src/components/Tables/columns/TeamsTableColumns.tsx +1 -1
  33. package/eventcatalog/src/components/Tables/columns/UserTableColumns.tsx +2 -2
  34. package/eventcatalog/src/content.config.ts +71 -1
  35. package/eventcatalog/src/enterprise/api/schemas/[collection]/[id]/[version]/index.ts +3 -3
  36. package/eventcatalog/src/enterprise/collections/resource-docs-utils.ts +19 -0
  37. package/eventcatalog/src/enterprise/fields/pages/fields.astro +2 -0
  38. package/eventcatalog/src/enterprise/tools/catalog-tools.ts +1 -1
  39. package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/index.astro +1 -1
  40. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +16 -15
  41. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +21 -17
  42. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +1 -1
  43. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +4 -4
  44. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/index.astro +16 -8
  45. package/eventcatalog/src/pages/docs/[type]/[id]/language/[dictionaryId]/index.astro +48 -65
  46. package/eventcatalog/src/pages/docs/[type]/[id]/language/index.astro +45 -18
  47. package/eventcatalog/src/pages/docs/llm/schemas.txt.ts +3 -3
  48. package/eventcatalog/src/pages/docs/teams/[id]/index.astro +1 -1
  49. package/eventcatalog/src/pages/docs/users/[id]/index.astro +1 -1
  50. package/eventcatalog/src/pages/schemas/[type]/[id]/[version]/_index.data.ts +6 -4
  51. package/eventcatalog/src/pages/schemas/[type]/[id]/[version]/index.astro +6 -2
  52. package/eventcatalog/src/pages/schemas/explorer/_index.data.ts +2 -2
  53. package/eventcatalog/src/pages/triggers/[type]/[id]/[version]/index.astro +2 -0
  54. package/eventcatalog/src/pages/visualiser/designs/[id]/index.astro +2 -0
  55. package/eventcatalog/src/stores/sidebar-store/builders/adr.ts +96 -34
  56. package/eventcatalog/src/stores/sidebar-store/builders/agent.ts +167 -75
  57. package/eventcatalog/src/stores/sidebar-store/builders/container.ts +135 -59
  58. package/eventcatalog/src/stores/sidebar-store/builders/data-product.ts +144 -58
  59. package/eventcatalog/src/stores/sidebar-store/builders/domain.ts +306 -188
  60. package/eventcatalog/src/stores/sidebar-store/builders/entity.ts +108 -39
  61. package/eventcatalog/src/stores/sidebar-store/builders/flow.ts +147 -63
  62. package/eventcatalog/src/stores/sidebar-store/builders/message.ts +213 -122
  63. package/eventcatalog/src/stores/sidebar-store/builders/service.ts +223 -127
  64. package/eventcatalog/src/stores/sidebar-store/builders/shared.ts +3 -23
  65. package/eventcatalog/src/stores/sidebar-store/builders/system.ts +187 -97
  66. package/eventcatalog/src/stores/sidebar-store/custom-sidebar.ts +678 -0
  67. package/eventcatalog/src/stores/sidebar-store/state.ts +66 -36
  68. package/eventcatalog/src/stores/theme-store.ts +6 -3
  69. package/eventcatalog/src/styles/tailwind.css +82 -0
  70. package/eventcatalog/src/utils/collections/resource-docs.ts +1 -0
  71. package/eventcatalog/src/utils/collections/schema-loader.ts +10 -8
  72. package/package.json +3 -2
@@ -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 = "4.8.4";
39
+ var version = "4.10.0";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-QB4W7ZUL.js";
4
- import "../chunk-FQEK3FUI.js";
3
+ } from "../chunk-BQXEWQ5J.js";
4
+ import "../chunk-BDFTJVGN.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -140,7 +140,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
140
140
  var import_os = __toESM(require("os"), 1);
141
141
 
142
142
  // package.json
143
- var version = "4.8.4";
143
+ var version = "4.10.0";
144
144
 
145
145
  // src/constants.ts
146
146
  var VERSION = version;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-Y57SL3H3.js";
4
- import "../chunk-QB4W7ZUL.js";
3
+ } from "../chunk-HFAQXAG3.js";
4
+ import "../chunk-BQXEWQ5J.js";
5
5
  import "../chunk-K2XIENVT.js";
6
- import "../chunk-FQEK3FUI.js";
6
+ import "../chunk-BDFTJVGN.js";
7
7
  import "../chunk-6QENHZZP.js";
8
8
  export {
9
9
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-AATZMWL3.js";
3
+ } from "./chunk-IC6XSXJO.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "4.8.4";
2
+ var version = "4.10.0";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-FQEK3FUI.js";
3
+ } from "./chunk-BDFTJVGN.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import os from "os";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-QB4W7ZUL.js";
3
+ } from "./chunk-BQXEWQ5J.js";
4
4
  import {
5
5
  countResources,
6
6
  serializeCounts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-FQEK3FUI.js";
3
+ } from "./chunk-BDFTJVGN.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "4.8.4";
28
+ var version = "4.10.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-FQEK3FUI.js";
3
+ } from "./chunk-BDFTJVGN.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -144,7 +144,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
144
144
  var import_picocolors = __toESM(require("picocolors"), 1);
145
145
 
146
146
  // package.json
147
- var version = "4.8.4";
147
+ var version = "4.10.0";
148
148
 
149
149
  // src/constants.ts
150
150
  var VERSION = version;
@@ -4,8 +4,8 @@ import {
4
4
  import "./chunk-CA4U2JP7.js";
5
5
  import {
6
6
  log_build_default
7
- } from "./chunk-Y57SL3H3.js";
8
- import "./chunk-QB4W7ZUL.js";
7
+ } from "./chunk-HFAQXAG3.js";
8
+ import "./chunk-BQXEWQ5J.js";
9
9
  import "./chunk-K2XIENVT.js";
10
10
  import {
11
11
  FederationConflictError,
@@ -31,10 +31,10 @@ import {
31
31
  } from "./chunk-B7HCX5HM.js";
32
32
  import {
33
33
  generate
34
- } from "./chunk-EGWBSVND.js";
34
+ } from "./chunk-5XURY2JV.js";
35
35
  import {
36
36
  logger
37
- } from "./chunk-AATZMWL3.js";
37
+ } from "./chunk-IC6XSXJO.js";
38
38
  import {
39
39
  resolve_catalog_dependencies_default
40
40
  } from "./chunk-LHR4G2UO.js";
@@ -54,7 +54,7 @@ import {
54
54
  import "./chunk-W5JQON7Z.js";
55
55
  import {
56
56
  VERSION
57
- } from "./chunk-FQEK3FUI.js";
57
+ } from "./chunk-BDFTJVGN.js";
58
58
  import {
59
59
  linkCoreNodeModules,
60
60
  resolveInstalledCoreNodeModules
package/dist/generate.cjs CHANGED
@@ -108,7 +108,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
108
108
  var import_picocolors = __toESM(require("picocolors"), 1);
109
109
 
110
110
  // package.json
111
- var version = "4.8.4";
111
+ var version = "4.10.0";
112
112
 
113
113
  // src/constants.ts
114
114
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-EGWBSVND.js";
4
- import "./chunk-AATZMWL3.js";
5
- import "./chunk-FQEK3FUI.js";
3
+ } from "./chunk-5XURY2JV.js";
4
+ import "./chunk-IC6XSXJO.js";
5
+ import "./chunk-BDFTJVGN.js";
6
6
  import "./chunk-6QENHZZP.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 = "4.8.4";
39
+ var version = "4.10.0";
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-AATZMWL3.js";
4
- import "../chunk-FQEK3FUI.js";
3
+ } from "../chunk-IC6XSXJO.js";
4
+ import "../chunk-BDFTJVGN.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -23,6 +23,8 @@ type Props = {
23
23
 
24
24
  const { badge, className = '' } = Astro.props;
25
25
  const href = getBadgeHref(badge);
26
+ // Only links that leave the catalog get the external-link arrow.
27
+ const isExternalHref = !!href && (/^[a-z][a-z0-9+.-]*:/i.test(href) || href.startsWith('//'));
26
28
  const Icon = badge.icon || badge.iconComponent;
27
29
  const hasThemedIcon = badge.iconURLLight && badge.iconURLDark;
28
30
  const classes = `
@@ -59,7 +61,7 @@ const classes = `
59
61
  <img src={badge.iconURL} class="w-3 h-3 flex-shrink-0 opacity-80" alt="" onerror="this.style.display='none'" />
60
62
  )}
61
63
  <span>{badge.content}</span>
62
- <ArrowTopRightOnSquareIcon className="w-2.5 h-2.5 flex-shrink-0 opacity-70" aria-hidden="true" />
64
+ {isExternalHref && <ArrowTopRightOnSquareIcon className="w-2.5 h-2.5 flex-shrink-0 opacity-70" aria-hidden="true" />}
63
65
  </a>
64
66
  ) : (
65
67
  <span id={badge.id || undefined} class={classes} style={getBadgeStyle(badge)} title={badge.content}>
@@ -224,11 +224,6 @@ function FieldNodeGraphInner({
224
224
  const { fitView } = useReactFlow();
225
225
  const wrapperRef = useRef<HTMLDivElement>(null);
226
226
 
227
- // Load visualiser styles (animations, hover effects, theme variables)
228
- useEffect(() => {
229
- import('@eventcatalog/visualiser/styles-core.css');
230
- }, []);
231
-
232
227
  useEffect(() => {
233
228
  const timer = setTimeout(() => fitView({ padding: 0.2 }), 50);
234
229
  return () => clearTimeout(timer);
@@ -4,6 +4,8 @@ import fs from 'fs';
4
4
  import { getAbsoluteFilePathForAstroFile } from '@utils/files';
5
5
  import Admonition from '@components/MDX/Admonition';
6
6
  import AstroNodeGraph from '../NodeGraph/AstroNodeGraph';
7
+ // Visualiser styles ship in the page head so ClientRouter navigations keep them (see NodeGraph.astro).
8
+ import '@eventcatalog/visualiser/styles-core.css';
7
9
 
8
10
  import { isVisualiserEnabled, isEventCatalogChatEnabled, isDevMode } from '@utils/feature';
9
11
  import { loadSavedLayout, applyLayoutToNodes, buildResourceKey } from '@utils/node-graphs/layout-persistence';
@@ -3,6 +3,8 @@ import { getDomains } from '@utils/collections/domains';
3
3
  import { getNodesAndEdges } from '@utils/node-graphs/domain-entity-map.ts';
4
4
  import Admonition from '@components/MDX/Admonition';
5
5
  import AstroNodeGraph from '../NodeGraph/AstroNodeGraph';
6
+ // Visualiser styles ship in the page head so ClientRouter navigations keep them (see NodeGraph.astro).
7
+ import '@eventcatalog/visualiser/styles-core.css';
6
8
  import { getVersionFromCollection } from '@utils/collections/versions';
7
9
  import { getServices } from '@utils/collections/services';
8
10
  import { isEventCatalogChatEnabled, isDevMode } from '@utils/feature';
@@ -3,6 +3,8 @@ import { getFlows } from '@utils/collections/flows';
3
3
  import { getNodesAndEdges } from '@utils/node-graphs/flows-node-graph';
4
4
  import Admonition from '@components/MDX/Admonition';
5
5
  import AstroNodeGraph from '../NodeGraph/AstroNodeGraph';
6
+ // Visualiser styles ship in the page head so ClientRouter navigations keep them (see NodeGraph.astro).
7
+ import '@eventcatalog/visualiser/styles-core.css';
6
8
  import { getVersionFromCollection } from '@utils/collections/versions';
7
9
  import { isVisualiserEnabled, isEventCatalogChatEnabled, isDevMode } from '@utils/feature';
8
10
  import { loadSavedLayout, applyLayoutToNodes, buildResourceKey } from '@utils/node-graphs/layout-persistence';
@@ -6,9 +6,13 @@
6
6
  * - Navigation using Astro's navigate function
7
7
  * - Layout persistence via Astro API routes
8
8
  * - URL building with Astro's URL utilities
9
+ *
10
+ * Note: the visualiser stylesheet is deliberately NOT imported here. Every Astro file that
11
+ * renders this component imports `@eventcatalog/visualiser/styles-core.css` itself so the
12
+ * CSS ships in the page head and survives ClientRouter navigations (see NodeGraph.astro).
9
13
  */
10
14
 
11
- import { useCallback, lazy, Suspense, useEffect } from 'react';
15
+ import { useCallback, lazy, Suspense } from 'react';
12
16
  import type { Node, Edge } from '@xyflow/react';
13
17
  import { buildUrl } from '@utils/url-builder';
14
18
 
@@ -42,12 +46,6 @@ interface AstroNodeGraphProps {
42
46
  }
43
47
 
44
48
  const AstroNodeGraph = ({ isDevMode = false, resourceKey, ...otherProps }: AstroNodeGraphProps) => {
45
- useEffect(() => {
46
- // Load visualizer styles only when this component is mounted.
47
- // Use the core-scoped stylesheet so visualizer styles don't override EventCatalog utility classes globally.
48
- import('@eventcatalog/visualiser/styles-core.css');
49
- }, []);
50
-
51
49
  // Astro-specific navigation handler
52
50
  const handleNavigate = useCallback((url: string) => {
53
51
  // Use window.location for navigation since we can't import astro:transitions/client in a React component
@@ -1,5 +1,10 @@
1
1
  ---
2
2
  import AstroNodeGraph from './AstroNodeGraph';
3
+ // Imported here (server side) rather than from the React island: Astro then emits it as a
4
+ // <link> in the page head, which survives ClientRouter navigations. A dynamic import from the
5
+ // island injects a <style> that the view-transition head swap removes — and the cached module
6
+ // never re-injects it, leaving the graph unstyled until a full reload.
7
+ import '@eventcatalog/visualiser/styles-core.css';
3
8
  import { getNodesAndEdges as getNodesAndEdgesForAgent } from '@utils/node-graphs/agents-node-graph';
4
9
  import { getNodesAndEdges as getNodesAndEdgesForService } from '@utils/node-graphs/services-node-graph';
5
10
  import {
@@ -9,7 +9,7 @@ const currentMessageSchema = {
9
9
  content: '{"type":"object","title":"OrderPlaced"}',
10
10
  default: true,
11
11
  message: {
12
- collection: 'events',
12
+ collectionName: 'events',
13
13
  id: 'OrderPlaced',
14
14
  version: '1.0.0',
15
15
  },
@@ -42,7 +42,7 @@ describe('resolveSchemaViewer', () => {
42
42
  content: 'syntax = "proto3";\nmessage FraudCheckCompleted {\n string transaction_id = 1;\n}',
43
43
  default: true,
44
44
  message: {
45
- collection: 'events',
45
+ collectionName: 'events',
46
46
  id: 'FraudCheckCompleted',
47
47
  version: '1.0.0',
48
48
  },
@@ -75,7 +75,7 @@ describe('resolveSchemaViewer', () => {
75
75
  content: '{"this": "is not protobuf"}',
76
76
  default: true,
77
77
  message: {
78
- collection: 'events',
78
+ collectionName: 'events',
79
79
  id: 'FraudCheckCompleted',
80
80
  version: '1.0.0',
81
81
  },
@@ -29,7 +29,7 @@ type CollectionSchema = {
29
29
  branch?: string;
30
30
  };
31
31
  message?: {
32
- collection: string;
32
+ collectionName: string;
33
33
  id: string;
34
34
  version: string;
35
35
  };
@@ -79,7 +79,7 @@ const getCollectionSchemaForViewer = ({
79
79
  const resourceSchemas = collectionSchemas.filter((schema) => {
80
80
  const message = schema.data.message;
81
81
  if (!message) return false;
82
- return message.collection === collection && message.id === id && message.version === version;
82
+ return message.collectionName === collection && message.id === id && message.version === version;
83
83
  });
84
84
 
85
85
  return resourceSchemas.find((schema) => schema.data.default) || resourceSchemas[0];
@@ -1,7 +1,16 @@
1
- import { useStore } from '@nanostores/react';
2
- import { themeStore } from '@stores/theme-store';
1
+ import { useSyncExternalStore } from 'react';
2
+ import { DEFAULT_THEME, themeStore } from '@stores/theme-store';
3
+
4
+ const subscribe = (onChange: () => void) => themeStore.listen(onChange);
5
+ const getSnapshot = () => themeStore.get() === 'dark';
6
+
7
+ // On the client the store is initialised from localStorage before React hydrates, so it can
8
+ // already differ from the value the server rendered with. React 18 keeps the server's inline
9
+ // `style` attributes when they mismatch during hydration, which left dark-theme syntax colours
10
+ // (and text-shadow) on light-mode pages until the component remounted. Hydrate with the server
11
+ // value instead; React re-renders with the real client value straight after.
12
+ const getServerSnapshot = () => DEFAULT_THEME === 'dark';
3
13
 
4
14
  export function useDarkMode(): boolean {
5
- const theme = useStore(themeStore);
6
- return theme === 'dark';
15
+ return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
7
16
  }