@eventcatalog/core 2.65.0 → 2.65.2

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 (33) hide show
  1. package/README.md +0 -25
  2. package/dist/analytics/analytics.cjs +1 -1
  3. package/dist/analytics/analytics.js +2 -2
  4. package/dist/analytics/log-build.cjs +1 -1
  5. package/dist/analytics/log-build.js +3 -3
  6. package/dist/{chunk-BMDTX5IN.js → chunk-C3BS3CBN.js} +1 -1
  7. package/dist/{chunk-NK6OYMRD.js → chunk-N4TTC4BN.js} +1 -1
  8. package/dist/{chunk-IJRFYF4B.js → chunk-NPWU34KV.js} +1 -1
  9. package/dist/constants.cjs +1 -1
  10. package/dist/constants.js +1 -1
  11. package/dist/eventcatalog.cjs +20 -1
  12. package/dist/eventcatalog.config.d.cts +1 -0
  13. package/dist/eventcatalog.config.d.ts +1 -0
  14. package/dist/eventcatalog.js +22 -3
  15. package/eventcatalog/src/components/Grids/MessageGrid.tsx +18 -13
  16. package/eventcatalog/src/components/Grids/ServiceGrid.tsx +13 -7
  17. package/eventcatalog/src/components/MDX/Design/Design.astro +4 -1
  18. package/eventcatalog/src/components/MDX/Flow/Flow.astro +2 -1
  19. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +3 -3
  20. package/eventcatalog/src/components/SideBars/ContainerSideBar.astro +12 -9
  21. package/eventcatalog/src/components/SideBars/DomainSideBar.astro +12 -8
  22. package/eventcatalog/src/components/SideBars/FlowSideBar.astro +12 -8
  23. package/eventcatalog/src/components/SideBars/MessageSideBar.astro +12 -9
  24. package/eventcatalog/src/components/SideBars/ServiceSideBar.astro +12 -8
  25. package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +10 -4
  26. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +4 -1
  27. package/eventcatalog/src/pages/architecture/architecture.astro +10 -1
  28. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +9 -5
  29. package/eventcatalog/src/pages/index.astro +14 -5
  30. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/_index.data.ts +4 -3
  31. package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/entity-map/_index.data.ts +4 -3
  32. package/eventcatalog/src/utils/feature.ts +2 -0
  33. package/package.json +1 -1
package/README.md CHANGED
@@ -117,31 +117,6 @@ Here is an example of a Retail system using domains, services and messages.
117
117
 
118
118
  You can see the markdown files that generated the website in the GitHub repo under [examples](/examples).
119
119
 
120
- # Sponsors
121
-
122
- Thank you to our project sponsors.
123
-
124
- ## Gold sponsors
125
-
126
- <!-- <div align="center">
127
- <img alt="hookdeck" src="./images/sponsors/hookdeck.svg" />
128
- <p style="margin: 0; padding: 0;">Serverless infrastructure for event-driven architecture. </p>
129
- <a href="https://hookdeck.com/?ref=eventcatalog-sponsor" target="_blank" >Learn more</a>
130
- </div> -->
131
-
132
- <div align="center">
133
- <picture>
134
- <source srcset="./images/sponsors/gravitee-logo-white.webp" media="(prefers-color-scheme: dark)" />
135
- <img alt="hookdeck" src="./images/sponsors/gravitee-logo-black.svg" width="50%" />
136
- </picture>
137
- <p style="margin: 0; padding: 0;">Manage, secure, and govern every API in your organization</p>
138
- <a href="https://gravitee.io?utm_source=eventcatalog&utm_medium=web&utm_campaign=sponsorship" target="_blank">Learn more</a>
139
- </div>
140
-
141
- <hr />
142
-
143
- _Sponsors help make EventCatalog sustainable, want to help the project? Get in touch! Or [visit our sponsor page](https://www.eventcatalog.dev/support)._
144
-
145
120
  # Enterprise support
146
121
 
147
122
  Interested in collaborating with us? Our offerings include dedicated support, priority assistance, feature development, custom integrations, and more.
@@ -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.65.0";
40
+ var version = "2.65.2";
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-NK6OYMRD.js";
4
- import "../chunk-BMDTX5IN.js";
3
+ } from "../chunk-N4TTC4BN.js";
4
+ import "../chunk-C3BS3CBN.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.65.0";
109
+ var version = "2.65.2";
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-IJRFYF4B.js";
4
- import "../chunk-NK6OYMRD.js";
5
- import "../chunk-BMDTX5IN.js";
3
+ } from "../chunk-NPWU34KV.js";
4
+ import "../chunk-N4TTC4BN.js";
5
+ import "../chunk-C3BS3CBN.js";
6
6
  import "../chunk-UPONRQSN.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.65.0";
2
+ var version = "2.65.2";
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-BMDTX5IN.js";
3
+ } from "./chunk-C3BS3CBN.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-NK6OYMRD.js";
3
+ } from "./chunk-N4TTC4BN.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.65.0";
28
+ var version = "2.65.2";
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-BMDTX5IN.js";
3
+ } from "./chunk-C3BS3CBN.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
157
157
  var import_os = __toESM(require("os"), 1);
158
158
 
159
159
  // package.json
160
- var version = "2.65.0";
160
+ var version = "2.65.2";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -709,6 +709,25 @@ var clearCore = () => {
709
709
  var checkForUpdate = () => {
710
710
  const installedVersion = getInstalledEventCatalogVersion();
711
711
  if (!installedVersion) return;
712
+ const majorVersion = parseInt(installedVersion.replace(/[^0-9.]/g, "").split(".")[0], 10);
713
+ if (majorVersion < 3) {
714
+ const v3Message = `\u{1F680} EventCatalog V3 is now available in beta!
715
+
716
+ You are currently on version ${installedVersion}.
717
+ V3 brings exciting new features and improvements.
718
+
719
+ Upgrade now: npm i @eventcatalog/core@beta`;
720
+ console.log(
721
+ (0, import_boxen.default)(v3Message, {
722
+ padding: 1,
723
+ margin: 1,
724
+ align: "center",
725
+ borderColor: "magenta",
726
+ borderStyle: "round"
727
+ })
728
+ );
729
+ return;
730
+ }
712
731
  const pkg = { name: "@eventcatalog/core", version: installedVersion };
713
732
  const notifier = (0, import_update_notifier.default)({ pkg, updateCheckInterval: 0 });
714
733
  if (notifier.update) {
@@ -106,6 +106,7 @@ interface Config {
106
106
  enabled: boolean;
107
107
  };
108
108
  visualiser?: {
109
+ enabled?: boolean;
109
110
  channels?: {
110
111
  renderMode?: 'flat' | 'single';
111
112
  };
@@ -106,6 +106,7 @@ interface Config {
106
106
  enabled: boolean;
107
107
  };
108
108
  visualiser?: {
109
+ enabled?: boolean;
109
110
  channels?: {
110
111
  renderMode?: 'flat' | 'single';
111
112
  };
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-IJRFYF4B.js";
10
- import "./chunk-NK6OYMRD.js";
9
+ } from "./chunk-NPWU34KV.js";
10
+ import "./chunk-N4TTC4BN.js";
11
11
  import {
12
12
  runMigrations
13
13
  } from "./chunk-BH3JMNAV.js";
@@ -19,7 +19,7 @@ import {
19
19
  import "./chunk-55D645EH.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-BMDTX5IN.js";
22
+ } from "./chunk-C3BS3CBN.js";
23
23
  import {
24
24
  getProjectOutDir,
25
25
  isAuthEnabled,
@@ -115,6 +115,25 @@ var clearCore = () => {
115
115
  var checkForUpdate = () => {
116
116
  const installedVersion = getInstalledEventCatalogVersion();
117
117
  if (!installedVersion) return;
118
+ const majorVersion = parseInt(installedVersion.replace(/[^0-9.]/g, "").split(".")[0], 10);
119
+ if (majorVersion < 3) {
120
+ const v3Message = `\u{1F680} EventCatalog V3 is now available in beta!
121
+
122
+ You are currently on version ${installedVersion}.
123
+ V3 brings exciting new features and improvements.
124
+
125
+ Upgrade now: npm i @eventcatalog/core@beta`;
126
+ console.log(
127
+ boxen(v3Message, {
128
+ padding: 1,
129
+ margin: 1,
130
+ align: "center",
131
+ borderColor: "magenta",
132
+ borderStyle: "round"
133
+ })
134
+ );
135
+ return;
136
+ }
118
137
  const pkg = { name: "@eventcatalog/core", version: installedVersion };
119
138
  const notifier = updateNotifier({ pkg, updateCheckInterval: 0 });
120
139
  if (notifier.update) {
@@ -11,6 +11,7 @@ interface MessageGridProps {
11
11
  messages: CollectionEntry<CollectionMessageTypes>[];
12
12
  containers?: CollectionEntry<'containers'>[];
13
13
  embeded: boolean;
14
+ isVisualiserEnabled: boolean;
14
15
  }
15
16
 
16
17
  interface GroupedMessages {
@@ -19,7 +20,7 @@ interface GroupedMessages {
19
20
  receives?: CollectionEntry<CollectionMessageTypes>[];
20
21
  }
21
22
 
22
- export default function MessageGrid({ messages, embeded, containers }: MessageGridProps) {
23
+ export default function MessageGrid({ messages, embeded, containers, isVisualiserEnabled }: MessageGridProps) {
23
24
  const [searchQuery, setSearchQuery] = useState('');
24
25
  const [urlParams, setUrlParams] = useState<{
25
26
  serviceId?: string;
@@ -344,12 +345,14 @@ export default function MessageGrid({ messages, embeded, containers }: MessageGr
344
345
  </a>
345
346
  </div>
346
347
  <div className="flex gap-2">
347
- <a
348
- href={buildUrl(`/visualiser/domains/${urlParams.domainId}`)}
349
- className="inline-flex items-center px-3 py-2 text-sm font-medium bg-white border border-gray-300 rounded-md transition-colors duration-200"
350
- >
351
- View in visualizer
352
- </a>
348
+ {isVisualiserEnabled && (
349
+ <a
350
+ href={buildUrl(`/visualiser/domains/${urlParams.domainId}`)}
351
+ className="inline-flex items-center px-3 py-2 text-sm font-medium bg-white border border-gray-300 rounded-md transition-colors duration-200"
352
+ >
353
+ View in visualizer
354
+ </a>
355
+ )}
353
356
  <a
354
357
  href={buildUrl(`/docs/domains/${urlParams.domainId}`)}
355
358
  className="inline-flex items-center px-3 py-2 text-sm font-medium text-black border border-gray-300 bg-white rounded-md transition-colors duration-200"
@@ -372,12 +375,14 @@ export default function MessageGrid({ messages, embeded, containers }: MessageGr
372
375
  <ServerIcon className="h-6 w-6 text-pink-500" />
373
376
  <h2 className="text-2xl font-semibold text-gray-900">{urlParams.serviceName}</h2>
374
377
  <div className="flex gap-2 ml-auto">
375
- <a
376
- href={buildUrl(`/visualiser/services/${urlParams.serviceId}`)}
377
- className="inline-flex items-center px-3 py-2 text-sm font-medium bg-white border border-gray-300 rounded-md transition-colors duration-200 hover:bg-gray-50"
378
- >
379
- View in visualizer
380
- </a>
378
+ {isVisualiserEnabled && (
379
+ <a
380
+ href={buildUrl(`/visualiser/services/${urlParams.serviceId}`)}
381
+ className="inline-flex items-center px-3 py-2 text-sm font-medium bg-white border border-gray-300 rounded-md transition-colors duration-200 hover:bg-gray-50"
382
+ >
383
+ View in visualizer
384
+ </a>
385
+ )}
381
386
  <a
382
387
  href={buildUrl(`/docs/services/${urlParams.serviceId}`)}
383
388
  className="inline-flex items-center px-3 py-2 text-sm font-medium text-black border border-gray-300 bg-white rounded-md transition-colors duration-200 hover:bg-gray-50"
@@ -183,12 +183,14 @@ const DomainSection = memo(
183
183
  urlParams,
184
184
  selectedTypes,
185
185
  isMultiColumn,
186
+ isVisualiserEnabled,
186
187
  }: {
187
188
  domain: any;
188
189
  services: any[];
189
190
  urlParams: any;
190
191
  selectedTypes: string[];
191
192
  isMultiColumn: boolean;
193
+ isVisualiserEnabled: boolean;
192
194
  }) => {
193
195
  const subdomains = domain.data.domains || [];
194
196
  const allSubDomainServices = subdomains.map((subdomain: any) => subdomain.data.services || []).flat();
@@ -227,12 +229,14 @@ const DomainSection = memo(
227
229
  <h3 className="text-xl font-semibold text-gray-900">{subdomain.data.name} (Subdomain)</h3>
228
230
  </div>
229
231
  <div className="flex gap-2">
230
- <a
231
- href={buildUrl(`/visualiser/domains/${subdomain.data.id}`)}
232
- className="inline-flex items-center px-3 py-2 text-sm font-medium bg-white border border-gray-300 rounded-md transition-colors duration-200"
233
- >
234
- View in visualizer
235
- </a>
232
+ {isVisualiserEnabled && (
233
+ <a
234
+ href={buildUrl(`/visualiser/domains/${subdomain.data.id}`)}
235
+ className="inline-flex items-center px-3 py-2 text-sm font-medium bg-white border border-gray-300 rounded-md transition-colors duration-200"
236
+ >
237
+ View in visualizer
238
+ </a>
239
+ )}
236
240
  <a
237
241
  href={buildUrl(`/docs/domains/${subdomain.data.id}`)}
238
242
  className="inline-flex items-center px-3 py-2 text-sm font-medium text-black border border-gray-300 bg-white rounded-md transition-colors duration-200"
@@ -292,10 +296,11 @@ interface ServiceGridProps {
292
296
  services: CollectionEntry<'services'>[];
293
297
  domains: ExtendedDomain[];
294
298
  embeded: boolean;
299
+ isVisualiserEnabled: boolean;
295
300
  }
296
301
 
297
302
  // Main ServiceGrid component
298
- export default function ServiceGrid({ services, domains, embeded }: ServiceGridProps) {
303
+ export default function ServiceGrid({ services, domains, embeded, isVisualiserEnabled }: ServiceGridProps) {
299
304
  const [searchQuery, setSearchQuery] = useState('');
300
305
  const [currentPage, setCurrentPage] = useState(1);
301
306
  const [selectedTypes, setSelectedTypes] = useState<CollectionMessageTypes[]>([]);
@@ -493,6 +498,7 @@ export default function ServiceGrid({ services, domains, embeded }: ServiceGridP
493
498
  urlParams={urlParams}
494
499
  selectedTypes={selectedTypes}
495
500
  isMultiColumn={isMultiColumn}
501
+ isVisualiserEnabled={isVisualiserEnabled}
496
502
  />
497
503
  ))
498
504
  ) : (
@@ -5,6 +5,8 @@ import { getAbsoluteFilePathForAstroFile } from '@utils/files';
5
5
  import Admonition from '@components/MDX/Admonition';
6
6
  import NodeGraph from '../NodeGraph/NodeGraph';
7
7
 
8
+ import { isVisualiserEnabled } from '@utils/feature';
9
+
8
10
  let design: any;
9
11
  let id = 'design';
10
12
  let maxHeight = 30;
@@ -49,7 +51,8 @@ try {
49
51
  title={title ?? design.name}
50
52
  nodes={design.nodes || []}
51
53
  edges={design.edges || []}
52
- hrefLabel={'View in visualizer'}
54
+ hrefLabel={isVisualiserEnabled() ? 'View in visualizer' : undefined}
55
+ href={isVisualiserEnabled() ? `/visualiser/designs/${design.id}` : undefined}
53
56
  linkTo={'visualiser'}
54
57
  designId={design.id || id}
55
58
  client:only="react"
@@ -4,6 +4,7 @@ import { getNodesAndEdges } from '@utils/node-graphs/flows-node-graph';
4
4
  import Admonition from '@components/MDX/Admonition';
5
5
  import NodeGraph from '../NodeGraph/NodeGraph';
6
6
  import { getVersionFromCollection } from '@utils/collections/versions';
7
+ import { isVisualiserEnabled } from '@utils/feature';
7
8
 
8
9
  const { id, version = 'latest', maxHeight, includeKey = true, mode = 'simple', walkthrough = true, search = true } = Astro.props;
9
10
 
@@ -49,7 +50,7 @@ const { nodes, edges } = await getNodesAndEdges({
49
50
  nodes={nodes}
50
51
  edges={edges}
51
52
  hrefLabel={'View in visualizer'}
52
- href={`/visualiser/flows/${id}/${version}`}
53
+ href={isVisualiserEnabled() ? `/visualiser/flows/${id}/${version}` : undefined}
53
54
  linkTo={'visualiser'}
54
55
  includeKey={includeKey}
55
56
  footerLabel=`Flow diagram - ${flow.data.name} - v(${flow.data.version})`
@@ -26,7 +26,7 @@ interface Props {
26
26
  version: string;
27
27
  mode: 'full' | 'simple';
28
28
  linkTo?: 'docs' | 'visualiser';
29
- href: {
29
+ href?: {
30
30
  label: string;
31
31
  url: string;
32
32
  };
@@ -142,8 +142,8 @@ if (collection === 'services-containers') {
142
142
  nodes={nodes}
143
143
  edges={edges}
144
144
  title={title}
145
- hrefLabel={href.label}
146
- href={href.url}
145
+ hrefLabel={href?.label}
146
+ href={href?.url}
147
147
  linkTo={linkTo}
148
148
  client:only="react"
149
149
  linksToVisualiser={linksToVisualiser}
@@ -8,7 +8,7 @@ import { ScrollText, Workflow, RssIcon } from 'lucide-react';
8
8
  import RepositoryList from '@components/Lists/RepositoryList.astro';
9
9
  import { getOwner } from '@utils/collections/owners';
10
10
  import CustomSideBarSectionList from '@components/Lists/CustomSideBarSectionList.astro';
11
- import { isChangelogEnabled } from '@utils/feature';
11
+ import { isChangelogEnabled, isVisualiserEnabled } from '@utils/feature';
12
12
  import config from '@config';
13
13
 
14
14
  interface Props {
@@ -156,14 +156,17 @@ const isRSSEnabled = config.rss?.enabled;
156
156
  }
157
157
 
158
158
  <div class="space-y-2">
159
- <a
160
- href={buildUrl(`/visualiser/${container.collection}/${container.data.id}/${container.data.version}`)}
161
- class="flex items-center justify-center space-x-2 text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
162
- >
163
- <Workflow strokeWidth={2} size={16} />
164
- <span class="block">View in visualiser</span>
165
- </a>
166
-
159
+ {
160
+ isVisualiserEnabled() && (
161
+ <a
162
+ href={buildUrl(`/visualiser/${container.collection}/${container.data.id}/${container.data.version}`)}
163
+ class="flex items-center justify-center space-x-2 text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
164
+ >
165
+ <Workflow strokeWidth={2} size={16} />
166
+ <span class="block">View in visualiser</span>
167
+ </a>
168
+ )
169
+ }
167
170
  {
168
171
  isChangelogEnabled() && shouldRenderSideBarSection('changelog') && (
169
172
  <a
@@ -9,7 +9,7 @@ import { getOwner } from '@utils/collections/owners';
9
9
  import { buildUrl } from '@utils/url-builder';
10
10
  import type { CollectionEntry } from 'astro:content';
11
11
  import { ScrollText, Workflow } from 'lucide-react';
12
- import { isChangelogEnabled } from '@utils/feature';
12
+ import { isChangelogEnabled, isVisualiserEnabled } from '@utils/feature';
13
13
 
14
14
  interface Props {
15
15
  domain: CollectionEntry<'domains'>;
@@ -250,13 +250,17 @@ const shouldRenderSideBarSection = (section: string) => {
250
250
  }
251
251
 
252
252
  <div class="space-y-2">
253
- <a
254
- href={buildUrl(`/visualiser/${domain.collection}/${domain.data.id}/${domain.data.version}`)}
255
- class="flex items-center justify-center space-x-2 text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
256
- >
257
- <Workflow strokeWidth={2} size={16} />
258
- <span class="block">View in visualiser</span>
259
- </a>
253
+ {
254
+ isVisualiserEnabled() && (
255
+ <a
256
+ href={buildUrl(`/visualiser/${domain.collection}/${domain.data.id}/${domain.data.version}`)}
257
+ class="flex items-center justify-center space-x-2 text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
258
+ >
259
+ <Workflow strokeWidth={2} size={16} />
260
+ <span class="block">View in visualiser</span>
261
+ </a>
262
+ )
263
+ }
260
264
  {
261
265
  isChangelogEnabled() && shouldRenderSideBarSection('changelog') && (
262
266
  <a
@@ -7,7 +7,7 @@ import { getOwner } from '@utils/collections/owners';
7
7
  import type { CollectionEntry } from 'astro:content';
8
8
  import { ScrollText, Workflow, RssIcon } from 'lucide-react';
9
9
  import config from '@config';
10
- import { isChangelogEnabled } from '@utils/feature';
10
+ import { isChangelogEnabled, isVisualiserEnabled } from '@utils/feature';
11
11
  import CustomSideBarSectionList from '@components/Lists/CustomSideBarSectionList.astro';
12
12
  interface Props {
13
13
  flow: CollectionEntry<'flows'>;
@@ -105,13 +105,17 @@ const shouldRenderSideBarSection = (section: string) => {
105
105
  }
106
106
 
107
107
  <div class="space-y-2">
108
- <a
109
- href={buildUrl(`/visualiser/${flow.collection}/${flow.data.id}/${flow.data.version}`)}
110
- class="flex items-center justify-center space-x-2 text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
111
- >
112
- <Workflow strokeWidth={2} size={16} />
113
- <span class="block">View in visualiser</span>
114
- </a>
108
+ {
109
+ isVisualiserEnabled() && (
110
+ <a
111
+ href={buildUrl(`/visualiser/${flow.collection}/${flow.data.id}/${flow.data.version}`)}
112
+ class="flex items-center justify-center space-x-2 text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
113
+ >
114
+ <Workflow strokeWidth={2} size={16} />
115
+ <span class="block">View in visualiser</span>
116
+ </a>
117
+ )
118
+ }
115
119
  {
116
120
  isChangelogEnabled() && shouldRenderSideBarSection('changelog') && (
117
121
  <a
@@ -12,7 +12,7 @@ import { getOwner } from '@utils/collections/owners';
12
12
  import CustomSideBarSectionList from '@components/Lists/CustomSideBarSectionList.astro';
13
13
  import config from '@config';
14
14
  import { getSchemaFormatFromURL } from '@utils/collections/schemas';
15
- import { isChangelogEnabled } from '@utils/feature';
15
+ import { isChangelogEnabled, isVisualiserEnabled } from '@utils/feature';
16
16
  interface Props {
17
17
  message: CollectionEntry<CollectionMessageTypes>;
18
18
  }
@@ -224,14 +224,17 @@ const shouldRenderSideBarSection = (section: string) => {
224
224
  </a>
225
225
  )
226
226
  }
227
- <a
228
- href={buildUrl(`/visualiser/${message.collection}/${message.data.id}/${message.data.version}`)}
229
- class="flex items-center justify-center space-x-2 text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
230
- >
231
- <Workflow strokeWidth={2} size={16} />
232
- <span class="block">View in visualiser</span>
233
- </a>
234
-
227
+ {
228
+ isVisualiserEnabled() && (
229
+ <a
230
+ href={buildUrl(`/visualiser/${message.collection}/${message.data.id}/${message.data.version}`)}
231
+ class="flex items-center justify-center space-x-2 text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
232
+ >
233
+ <Workflow strokeWidth={2} size={16} />
234
+ <span class="block">View in visualiser</span>
235
+ </a>
236
+ )
237
+ }
235
238
  {
236
239
  isChangelogEnabled() && shouldRenderSideBarSection('changelog') && (
237
240
  <a
@@ -12,7 +12,7 @@ import { ScrollText, Workflow, FileDownIcon, Code, Link, RssIcon } from 'lucide-
12
12
  import { join } from 'node:path';
13
13
  import config from '@config';
14
14
  import { getDomainsForService } from '@utils/collections/domains';
15
- import { isChangelogEnabled } from '@utils/feature';
15
+ import { isChangelogEnabled, isVisualiserEnabled } from '@utils/feature';
16
16
  interface Props {
17
17
  service: CollectionEntry<'services'>;
18
18
  }
@@ -271,13 +271,17 @@ const shouldRenderSideBarSection = (section: string) => {
271
271
  </a>
272
272
  )
273
273
  }
274
- <a
275
- href={buildUrl(`/visualiser/${service.collection}/${service.data.id}/${service.data.version}`)}
276
- class="flex items-center justify-center space-x-2 text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
277
- >
278
- <Workflow strokeWidth={2} size={16} />
279
- <span class="block">View in visualiser</span>
280
- </a>
274
+ {
275
+ isVisualiserEnabled() && (
276
+ <a
277
+ href={buildUrl(`/visualiser/${service.collection}/${service.data.id}/${service.data.version}`)}
278
+ class="flex items-center justify-center space-x-2 text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
279
+ >
280
+ <Workflow strokeWidth={2} size={16} />
281
+ <span class="block">View in visualiser</span>
282
+ </a>
283
+ )
284
+ }
281
285
  {
282
286
  isChangelogEnabled() && shouldRenderSideBarSection('changelog') && (
283
287
  <a
@@ -16,6 +16,8 @@ import { getAdjacentPages } from '@enterprise/custom-documentation/utils/custom-
16
16
  import CustomDocsNav from '@enterprise/custom-documentation/components/CustomDocsNav/CustomDocsNav.astro';
17
17
  import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
18
18
 
19
+ import { isVisualiserEnabled } from '@utils/feature';
20
+
19
21
  const props = Astro.props;
20
22
  const doc = props.data;
21
23
  const { Content, headings } = await render(props as any);
@@ -132,10 +134,14 @@ const badges = doc?.badges || [];
132
134
  title={nodeGraph.title}
133
135
  mode="simple"
134
136
  linksToVisualiser={true}
135
- href={{
136
- label: 'Open in Visualiser',
137
- url: buildUrl(`/visualiser/${collection}/${nodeGraph.id}/${nodeGraph.version}`),
138
- }}
137
+ href={
138
+ isVisualiserEnabled()
139
+ ? {
140
+ label: 'Open in Visualiser',
141
+ url: buildUrl(`/visualiser/${collection}/${nodeGraph.id}/${nodeGraph.version}`),
142
+ }
143
+ : undefined
144
+ }
139
145
  />
140
146
  );
141
147
  })
@@ -47,7 +47,7 @@ const domains = await getDomains({ getAllVersions: false });
47
47
  const flows = await getFlows({ getAllVersions: false });
48
48
  const customDocs = await getCollection('customPages');
49
49
 
50
- import { isEventCatalogUpgradeEnabled } from '@utils/feature';
50
+ import { isEventCatalogUpgradeEnabled, isVisualiserEnabled } from '@utils/feature';
51
51
 
52
52
  // Try and load any custom styles if they exist
53
53
  try {
@@ -88,6 +88,7 @@ const getDefaultUrl = (route: string, defaultValue: string) => {
88
88
  };
89
89
 
90
90
  const userSideBarConfiguration = config.sidebar || [];
91
+
91
92
  const navigationItems = [
92
93
  {
93
94
  id: '/',
@@ -96,6 +97,7 @@ const navigationItems = [
96
97
  href: buildUrl('/'),
97
98
  current: currentPath === '/',
98
99
  sidebar: false,
100
+ hidden: !!config.landingPage,
99
101
  },
100
102
  {
101
103
  id: '/docs',
@@ -113,6 +115,7 @@ const navigationItems = [
113
115
  href: getDefaultUrl('visualiser', '/visualiser'),
114
116
  current: currentPath.includes('/visualiser'),
115
117
  sidebar: true,
118
+ hidden: !isVisualiserEnabled(),
116
119
  },
117
120
 
118
121
  {
@@ -13,6 +13,8 @@ import { removeContentFromCollection } from '@utils/collections/util';
13
13
  import type { CollectionEntry } from 'astro:content';
14
14
  import type { CollectionMessageTypes } from '@types';
15
15
 
16
+ import { isVisualiserEnabled } from '@utils/feature';
17
+
16
18
  import { ClientRouter, fade } from 'astro:transitions';
17
19
  // Define valid types and their corresponding data fetchers
18
20
  const VALID_TYPES = ['domains', 'services', 'messages'] as const;
@@ -81,7 +83,13 @@ if (type === 'services') {
81
83
  {type === 'domains' && <DomainGrid domains={domains} embeded={embeded} client:load />}
82
84
  {
83
85
  type === 'services' && (
84
- <ServiceGrid domains={domains} services={items as unknown as Service[]} embeded={embeded} client:load />
86
+ <ServiceGrid
87
+ domains={domains}
88
+ services={items as unknown as Service[]}
89
+ embeded={embeded}
90
+ isVisualiserEnabled={isVisualiserEnabled()}
91
+ client:load
92
+ />
85
93
  )
86
94
  }
87
95
  {
@@ -90,6 +98,7 @@ if (type === 'services') {
90
98
  messages={items as CollectionEntry<CollectionMessageTypes>[]}
91
99
  embeded={embeded}
92
100
  containers={containers}
101
+ isVisualiserEnabled={isVisualiserEnabled()}
93
102
  client:load
94
103
  />
95
104
  )
@@ -43,7 +43,7 @@ import { getIcon } from '@utils/badges';
43
43
  import { getDeprecatedDetails } from '@utils/collections/util';
44
44
  import { buildUrl, buildEditUrlForResource } from '@utils/url-builder';
45
45
  import { getSchemasFromResource } from '@utils/collections/schemas';
46
- import { isEventCatalogChatEnabled, isMarkdownDownloadEnabled } from '@utils/feature';
46
+ import { isEventCatalogChatEnabled, isMarkdownDownloadEnabled, isVisualiserEnabled } from '@utils/feature';
47
47
 
48
48
  import { getMDXComponentsByName } from '@utils/markdown';
49
49
 
@@ -446,10 +446,14 @@ nodeGraphs.push({
446
446
  linksToVisualiser={true}
447
447
  showSearch={nodeGraph.search ?? true}
448
448
  showLegend={nodeGraph.legend ?? true}
449
- href={{
450
- label: 'Open in Visualiser',
451
- url: buildUrl(`/visualiser/${collection}/${nodeGraph.id}/${nodeGraph.version}`),
452
- }}
449
+ href={
450
+ isVisualiserEnabled()
451
+ ? {
452
+ label: 'Open in Visualiser',
453
+ url: buildUrl(`/visualiser/${collection}/${nodeGraph.id}/${nodeGraph.version}`),
454
+ }
455
+ : undefined
456
+ }
453
457
  />
454
458
  );
455
459
  })
@@ -7,8 +7,9 @@ import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
7
7
  import { getMDXComponentsByName } from '@utils/markdown';
8
8
  import { resourceToCollectionMap } from '@utils/collections/util';
9
9
  import { buildUrl } from '@utils/url-builder';
10
- import { isCustomLandingPageEnabled } from '@utils/feature';
10
+ import { isCustomLandingPageEnabled, isVisualiserEnabled } from '@utils/feature';
11
11
  import DefaultAstroLandingPage from './_index.astro';
12
+ import config from '@config';
12
13
 
13
14
  let nodeGraphs: any[] = [];
14
15
  let CustomContent = null;
@@ -28,6 +29,10 @@ if (existsSync(pathToUserDefinedLandingPage) && isCustomLandingPageEnabled()) {
28
29
  const rawContent = readFileSync(pathToUserDefinedLandingPage, 'utf-8');
29
30
  nodeGraphs = getMDXComponentsByName(rawContent, 'NodeGraph') || [];
30
31
  }
32
+
33
+ if (config.landingPage) {
34
+ return Astro.redirect(buildUrl(config.landingPage));
35
+ }
31
36
  ---
32
37
 
33
38
  {
@@ -53,10 +58,14 @@ if (existsSync(pathToUserDefinedLandingPage) && isCustomLandingPageEnabled()) {
53
58
  title={nodeGraph.title}
54
59
  mode="simple"
55
60
  linksToVisualiser={true}
56
- href={{
57
- label: 'Open in Visualiser',
58
- url: buildUrl(`/visualiser/${collection}/${nodeGraph.id}/${nodeGraph.version}`),
59
- }}
61
+ href={
62
+ isVisualiserEnabled()
63
+ ? {
64
+ label: 'Open in Visualiser',
65
+ url: buildUrl(`/visualiser/${collection}/${nodeGraph.id}/${nodeGraph.version}`),
66
+ }
67
+ : undefined
68
+ }
60
69
  />
61
70
  );
62
71
  })}
@@ -3,12 +3,13 @@ import { HybridPage } from '@utils/page-loaders/hybrid-page';
3
3
  import { isAuthEnabled } from '@utils/feature';
4
4
  import type { PageTypes } from '@types';
5
5
  import { pageDataLoader } from '@utils/page-loaders/page-data-loader';
6
+ import { isVisualiserEnabled } from '@utils/feature';
6
7
 
7
8
  type PageTypesWithFlows = PageTypes | 'flows';
8
9
 
9
10
  export class Page extends HybridPage {
10
11
  static async getStaticPaths(): Promise<Array<{ params: any; props: any }>> {
11
- if (isAuthEnabled()) {
12
+ if (isAuthEnabled() || !isVisualiserEnabled()) {
12
13
  return [];
13
14
  }
14
15
 
@@ -42,7 +43,7 @@ export class Page extends HybridPage {
42
43
  protected static async fetchData(params: any) {
43
44
  const { type, id, version } = params;
44
45
 
45
- if (!type || !id || !version) {
46
+ if (!type || !id || !version || !isVisualiserEnabled()) {
46
47
  return null;
47
48
  }
48
49
 
@@ -77,7 +78,7 @@ export class Page extends HybridPage {
77
78
  }
78
79
 
79
80
  static get clientAuthScript(): string {
80
- if (!isAuthEnabled()) {
81
+ if (!isAuthEnabled() || !isVisualiserEnabled()) {
81
82
  return '';
82
83
  }
83
84
 
@@ -1,10 +1,11 @@
1
1
  import { HybridPage } from '@utils/page-loaders/hybrid-page';
2
2
  import { isAuthEnabled } from '@utils/feature';
3
3
  import { domainHasEntities, getDomains, type Domain } from '@utils/collections/domains';
4
+ import { isVisualiserEnabled } from '@utils/feature';
4
5
 
5
6
  export class Page extends HybridPage {
6
7
  static async getStaticPaths(): Promise<Array<{ params: any; props: any }>> {
7
- if (isAuthEnabled()) {
8
+ if (isAuthEnabled() || !isVisualiserEnabled()) {
8
9
  return [];
9
10
  }
10
11
 
@@ -29,7 +30,7 @@ export class Page extends HybridPage {
29
30
  protected static async fetchData(params: any) {
30
31
  const { id, version } = params;
31
32
 
32
- if (!id || !version) {
33
+ if (!id || !version || !isVisualiserEnabled()) {
33
34
  return null;
34
35
  }
35
36
 
@@ -54,7 +55,7 @@ export class Page extends HybridPage {
54
55
  }
55
56
 
56
57
  static get clientAuthScript(): string {
57
- if (!isAuthEnabled()) {
58
+ if (!isAuthEnabled() || !isVisualiserEnabled()) {
58
59
  return '';
59
60
  }
60
61
 
@@ -55,3 +55,5 @@ export const isAuthEnabled = () => {
55
55
  };
56
56
 
57
57
  export const isSSR = () => config?.output === 'server';
58
+
59
+ export const isVisualiserEnabled = () => config?.visualiser?.enabled ?? true;
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": "2.65.0",
9
+ "version": "2.65.2",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },