@eventcatalog/core 4.10.2 → 4.10.3

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 = "4.10.2";
39
+ var version = "4.10.3";
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-E5JJSOMA.js";
4
- import "../chunk-C73V4K3S.js";
3
+ } from "../chunk-EMG2UMRO.js";
4
+ import "../chunk-IXQNMM6D.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.10.2";
143
+ var version = "4.10.3";
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-SB2TMVVX.js";
4
- import "../chunk-E5JJSOMA.js";
3
+ } from "../chunk-CHJFPDIO.js";
4
+ import "../chunk-EMG2UMRO.js";
5
5
  import "../chunk-K2XIENVT.js";
6
- import "../chunk-C73V4K3S.js";
6
+ import "../chunk-IXQNMM6D.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
  raiseEvent
3
- } from "./chunk-E5JJSOMA.js";
3
+ } from "./chunk-EMG2UMRO.js";
4
4
  import {
5
5
  countResources,
6
6
  serializeCounts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-NOD5BM45.js";
3
+ } from "./chunk-J5IBDCGW.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-C73V4K3S.js";
3
+ } from "./chunk-IXQNMM6D.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import os from "os";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "4.10.2";
2
+ var version = "4.10.3";
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-C73V4K3S.js";
3
+ } from "./chunk-IXQNMM6D.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.10.2";
28
+ var version = "4.10.3";
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-C73V4K3S.js";
3
+ } from "./chunk-IXQNMM6D.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.10.2";
147
+ var version = "4.10.3";
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-SB2TMVVX.js";
8
- import "./chunk-E5JJSOMA.js";
7
+ } from "./chunk-CHJFPDIO.js";
8
+ import "./chunk-EMG2UMRO.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-MGK66RUH.js";
34
+ } from "./chunk-EHN2WS7S.js";
35
35
  import {
36
36
  logger
37
- } from "./chunk-NOD5BM45.js";
37
+ } from "./chunk-J5IBDCGW.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-C73V4K3S.js";
57
+ } from "./chunk-IXQNMM6D.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.10.2";
111
+ var version = "4.10.3";
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-MGK66RUH.js";
4
- import "./chunk-NOD5BM45.js";
5
- import "./chunk-C73V4K3S.js";
3
+ } from "./chunk-EHN2WS7S.js";
4
+ import "./chunk-J5IBDCGW.js";
5
+ import "./chunk-IXQNMM6D.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.10.2";
39
+ var version = "4.10.3";
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-NOD5BM45.js";
4
- import "../chunk-C73V4K3S.js";
3
+ } from "../chunk-J5IBDCGW.js";
4
+ import "../chunk-IXQNMM6D.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -15,9 +15,9 @@ interface Props {
15
15
  showLegend?: boolean;
16
16
  /** Off by default — embedded graphs pin a lens rather than offer the picker */
17
17
  showLensPicker?: boolean;
18
- // Override the DOM portal the graph mounts into. Defaults to
19
- // `${id}-architecture-graph-portal` (or `catalog-architecture-graph-portal`).
20
- portalId?: string;
18
+ // Position of this embed among the page's <ArchitectureGraph/> tags pairs
19
+ // the island with its placeholder div by document order.
20
+ occurrenceIndex?: number;
21
21
  href?: {
22
22
  label: string;
23
23
  url: string;
@@ -32,7 +32,7 @@ const {
32
32
  showSearch = true,
33
33
  showLegend = true,
34
34
  showLensPicker = false,
35
- portalId,
35
+ occurrenceIndex = 0,
36
36
  href,
37
37
  } = Astro.props;
38
38
 
@@ -47,7 +47,7 @@ const focusKey =
47
47
 
48
48
  <AstroArchitectureGraph
49
49
  client:only="react"
50
- portalId={portalId ?? `${id ?? 'catalog'}-architecture-graph-portal`}
50
+ occurrenceIndex={occurrenceIndex}
51
51
  nodes={wire.nodes}
52
52
  links={wire.links}
53
53
  linkLabels={wire.linkLabels}
@@ -1,17 +1,18 @@
1
- // The portal id pairs each scanner-rendered island with its MDX placeholder.
2
- // The occurrence index keeps multiple no-id embeds on one page from colliding
3
- // (the first occurrence keeps the unsuffixed id).
4
- export const architectureGraphPortalId = (id: string | undefined, occurrenceIndex: number) =>
5
- `${id ?? 'catalog'}-architecture-graph-portal${occurrenceIndex > 0 ? `-${occurrenceIndex}` : ''}`;
1
+ // Placeholders are matched to their islands positionally (nth placeholder in
2
+ // document order nth <ArchitectureGraph/> tag in the host page's body scan).
3
+ // The pairing must not rely on a render-time counter in the element id — Astro
4
+ // can invoke MDX component functions more than once per tag (renderer probing),
5
+ // which drifts such a counter out of sync with the body scan.
6
+ export const ARCHITECTURE_GRAPH_PORTAL_SELECTOR = '[data-architecture-graph-portal]';
6
7
 
7
8
  // Empty placeholder rendered by the MDX component map. The real graph is
8
9
  // rendered by ArchitectureGraph.astro (which builds the data server-side) and
9
- // portals itself into this div by id — same pattern as NodeGraphPortal.
10
+ // portals itself into this div — same pattern as NodeGraphPortal.
10
11
  const ArchitectureGraphPortal = (props: any) => {
11
12
  return (
12
13
  <div
13
14
  className="not-prose h-[30em] my-6 mb-12 w-full relative border! border-[rgb(var(--ec-page-border))]! rounded-md overflow-hidden"
14
- id={architectureGraphPortalId(props.id, props.occurrenceIndex ?? 0)}
15
+ data-architecture-graph-portal={props.id ?? 'catalog'}
15
16
  style={{
16
17
  maxHeight: props.maxHeight ? `${props.maxHeight}em` : `30em`,
17
18
  }}
@@ -1,11 +1,13 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { createPortal } from 'react-dom';
3
3
  import CatalogForceGraph from '@components/CatalogGraph/CatalogForceGraph';
4
+ import { ARCHITECTURE_GRAPH_PORTAL_SELECTOR } from '@components/MDX/ArchitectureGraph/ArchitectureGraphPortal';
4
5
  import type { CatalogGraphWireLink, CatalogGraphWireNode } from '@utils/node-graphs/catalog-force-graph';
5
6
 
6
7
  interface Props {
7
- /** DOM id of the placeholder div ArchitectureGraphPortal rendered into the MDX content */
8
- portalId: string;
8
+ /** Position of this island among the page's <ArchitectureGraph/> embeds it
9
+ * mounts into the placeholder div at the same position in document order */
10
+ occurrenceIndex?: number;
9
11
  nodes: CatalogGraphWireNode[];
10
12
  links: CatalogGraphWireLink[];
11
13
  linkLabels: string[];
@@ -24,12 +26,13 @@ interface Props {
24
26
  // The island mounts outside the MDX content, finds the placeholder div the MDX
25
27
  // component map emitted, and portals the graph into it — same pattern as the
26
28
  // visualiser's NodeGraph.
27
- const AstroArchitectureGraph = ({ portalId, href, hrefLabel, ...graphProps }: Props) => {
29
+ const AstroArchitectureGraph = ({ occurrenceIndex = 0, href, hrefLabel, ...graphProps }: Props) => {
28
30
  const [container, setContainer] = useState<HTMLElement | null>(null);
29
31
 
30
32
  useEffect(() => {
31
- setContainer(document.getElementById(portalId));
32
- }, [portalId]);
33
+ const portals = document.querySelectorAll<HTMLElement>(ARCHITECTURE_GRAPH_PORTAL_SELECTOR);
34
+ setContainer(portals[occurrenceIndex] ?? null);
35
+ }, [occurrenceIndex]);
33
36
 
34
37
  if (!container) return null;
35
38
 
@@ -51,10 +51,6 @@ const getEntityMapCollection = (props: any, mdxProp: any) => {
51
51
  };
52
52
 
53
53
  const components = (props: any) => {
54
- // Occurrence counter so multiple <ArchitectureGraph/> tags on one page each get
55
- // their own portal — MDX renders in document order, matching the body scan order
56
- // the host pages use to render the islands.
57
- let architectureGraphOccurrence = 0;
58
54
  return {
59
55
  Attachments: (mdxProp: any) => jsx(Attachments, { ...props, ...mdxProp }),
60
56
  CustomProperties: (mdxProp: any) => jsx(CustomProperties, { ...props, ...mdxProp }),
@@ -74,14 +70,7 @@ const components = (props: any) => {
74
70
  ADRTable: (mdxProp: any) => jsx(ADRTable, { ...props, ...mdxProp }),
75
71
  EntityPropertiesTable: (mdxProp: any) => jsx(EntityPropertiesTable, { ...props, ...mdxProp }),
76
72
  NodeGraph: (mdxProp: any) => jsx(NodeGraphPortal, { ...props.data, ...mdxProp, props, mdxProp }),
77
- ArchitectureGraph: (mdxProp: any) =>
78
- jsx(ArchitectureGraphPortal, {
79
- ...props.data,
80
- ...mdxProp,
81
- occurrenceIndex: architectureGraphOccurrence++,
82
- props,
83
- mdxProp,
84
- }),
73
+ ArchitectureGraph: (mdxProp: any) => jsx(ArchitectureGraphPortal, { ...props.data, ...mdxProp, props, mdxProp }),
85
74
  ComponentDiagram: (mdxProp: any) => jsx(NodeGraphPortal, { ...props.data, ...mdxProp, props, mdxProp }),
86
75
  ContextDiagram: (mdxProp: any) => jsx(ContextDiagramPortal, { ...props.data, ...mdxProp, props, mdxProp }),
87
76
  SystemContextMap: (mdxProp: any) => jsx(SystemContextMapPortal, { ...mdxProp }),
@@ -15,7 +15,6 @@ import { getAdjacentPages, getNavigationItems } from '@enterprise/custom-documen
15
15
  import CustomDocsNav from '@enterprise/custom-documentation/components/CustomDocsNav/CustomDocsNav.astro';
16
16
  import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
17
17
  import ArchitectureGraph from '@components/MDX/ArchitectureGraph/ArchitectureGraph.astro';
18
- import { architectureGraphPortalId } from '@components/MDX/ArchitectureGraph/ArchitectureGraphPortal';
19
18
  import CopyAsMarkdown from '@components/CopyAsMarkdown';
20
19
 
21
20
  import {
@@ -202,7 +201,7 @@ const editUrl =
202
201
  showSearch={graph.search}
203
202
  showLegend={graph.legend}
204
203
  showLensPicker={graph.lensPicker}
205
- portalId={architectureGraphPortalId(graph.id ?? (doc as any).id, occurrenceIndex)}
204
+ occurrenceIndex={occurrenceIndex}
206
205
  href={
207
206
  isArchitectureGraphEnabled()
208
207
  ? {
@@ -11,7 +11,6 @@ import Footer from '@layouts/Footer.astro';
11
11
  import components from '@components/MDX/components';
12
12
  import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
13
13
  import ArchitectureGraph from '@components/MDX/ArchitectureGraph/ArchitectureGraph.astro';
14
- import { architectureGraphPortalId } from '@components/MDX/ArchitectureGraph/ArchitectureGraphPortal';
15
14
  import SchemaViewer from '@components/MDX/SchemaViewer/SchemaViewerRoot.astro';
16
15
  import Admonition from '@components/MDX/Admonition';
17
16
  import VersionList from '@components/Lists/VersionList.astro';
@@ -681,7 +680,7 @@ if (!isAdrPage && !hasCurrentFlowEmbed && !hasCurrentPageNodeGraph) {
681
680
  showSearch={graph.search}
682
681
  showLegend={graph.legend}
683
682
  showLensPicker={graph.lensPicker}
684
- portalId={architectureGraphPortalId(graph.id, occurrenceIndex)}
683
+ occurrenceIndex={occurrenceIndex}
685
684
  href={
686
685
  isArchitectureGraphEnabled()
687
686
  ? {
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
3
3
  import { getMDXComponentsByName, parseMdxBooleanProp } from '@utils/markdown';
4
- import { architectureGraphPortalId } from '@components/MDX/ArchitectureGraph/ArchitectureGraphPortal';
5
4
  import { resourceToCollectionMap } from '@utils/collections/util';
6
5
  import { buildUrl } from '@utils/url-builder';
7
6
  import { isCustomLandingPageEnabled, isVisualiserEnabled, isArchitectureGraphEnabled } from '@utils/feature';
@@ -125,7 +124,7 @@ if (config.landingPage) {
125
124
  showSearch={parseMdxBooleanProp(graph.search, true)}
126
125
  showLegend={parseMdxBooleanProp(graph.legend, true)}
127
126
  showLensPicker={parseMdxBooleanProp(graph.lensPicker, false)}
128
- portalId={architectureGraphPortalId(graph.id, occurrenceIndex)}
127
+ occurrenceIndex={occurrenceIndex}
129
128
  href={
130
129
  isArchitectureGraphEnabled()
131
130
  ? {
@@ -1,26 +1,21 @@
1
1
  import { HybridPage } from '@utils/page-loaders/hybrid-page';
2
2
  import { isAuthEnabled, isVisualiserEnabled } from '@utils/feature';
3
3
  import { getDomains } from '@utils/collections/domains';
4
- import { getSystems } from '@utils/collections/systems';
5
4
 
6
5
  /**
7
6
  * A domain gets a System Diagram when it has systems and at least one of those
8
7
  * systems takes part in a context graph — i.e. it declares relationships or actors. A
9
8
  * domain whose systems have neither has nothing to show, so we don't generate a page.
9
+ * `getDomains` hydrates `data.systems` into full system entries, so read each
10
+ * system's data directly — this must stay in sync with the sidebar's
11
+ * `hasSystemContext` guard so we never link to a page that wasn't generated.
10
12
  */
11
- const domainHasSystemContext = (
12
- domain: Awaited<ReturnType<typeof getDomains>>[number],
13
- systemMap: Map<string, { data: { relationships?: unknown[]; actors?: unknown[] } }>
14
- ) => {
15
- const systemRefs = (domain.data.systems || []) as { id: string }[];
16
- if (systemRefs.length === 0) return false;
13
+ const domainHasSystemContext = (domain: Awaited<ReturnType<typeof getDomains>>[number]) => {
14
+ const systems = (domain.data.systems || []) as any[];
17
15
 
18
- return systemRefs.some((ref) => {
19
- const system = systemMap.get(ref.id);
20
- if (!system) return false;
21
- const relationships = (system.data.relationships || []) as unknown[];
22
- const actors = (system.data.actors || []) as unknown[];
23
- return relationships.length > 0 || actors.length > 0;
16
+ return systems.some((system) => {
17
+ const data = system?.data ?? system;
18
+ return ((data?.relationships as unknown[]) || []).length > 0 || ((data?.actors as unknown[]) || []).length > 0;
24
19
  });
25
20
  };
26
21
 
@@ -30,11 +25,10 @@ export class Page extends HybridPage {
30
25
  return [];
31
26
  }
32
27
 
33
- const [domains, systems] = await Promise.all([getDomains({ getAllVersions: false }), getSystems()]);
34
- const systemMap = new Map(systems.map((system) => [system.data.id, system]));
28
+ const domains = await getDomains({ getAllVersions: false });
35
29
 
36
30
  return domains
37
- .filter((domain) => domainHasSystemContext(domain, systemMap))
31
+ .filter((domain) => domainHasSystemContext(domain))
38
32
  .map((domain) => ({
39
33
  params: {
40
34
  id: domain.data.id,
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "SEE LICENSE IN LICENSE",
9
9
  "type": "module",
10
- "version": "4.10.2",
10
+ "version": "4.10.3",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },