@eventcatalog/core 2.28.2 → 2.29.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.
@@ -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.28.2";
40
+ var version = "2.29.0";
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-KZAS3BWD.js";
4
- import "../chunk-Y5MIG5AN.js";
3
+ } from "../chunk-7IL66XAM.js";
4
+ import "../chunk-GFX4RRFK.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.28.2";
109
+ var version = "2.29.0";
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-XKW6AAZE.js";
4
- import "../chunk-KZAS3BWD.js";
5
- import "../chunk-Y5MIG5AN.js";
3
+ } from "../chunk-3PFCKHXB.js";
4
+ import "../chunk-7IL66XAM.js";
5
+ import "../chunk-GFX4RRFK.js";
6
6
  import "../chunk-E7TXTI7G.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-KZAS3BWD.js";
3
+ } from "./chunk-7IL66XAM.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-Y5MIG5AN.js";
3
+ } from "./chunk-GFX4RRFK.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 = "2.28.2";
2
+ var version = "2.29.0";
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 = "2.28.2";
28
+ var version = "2.29.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-Y5MIG5AN.js";
3
+ } from "./chunk-GFX4RRFK.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -161,7 +161,7 @@ var import_axios = __toESM(require("axios"), 1);
161
161
  var import_os = __toESM(require("os"), 1);
162
162
 
163
163
  // package.json
164
- var version = "2.28.2";
164
+ var version = "2.29.0";
165
165
 
166
166
  // src/constants.ts
167
167
  var VERSION = version;
@@ -6,14 +6,14 @@ import {
6
6
  } from "./chunk-WUCY3QHK.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-XKW6AAZE.js";
10
- import "./chunk-KZAS3BWD.js";
9
+ } from "./chunk-3PFCKHXB.js";
10
+ import "./chunk-7IL66XAM.js";
11
11
  import {
12
12
  catalogToAstro
13
13
  } from "./chunk-R2NILSWL.js";
14
14
  import {
15
15
  VERSION
16
- } from "./chunk-Y5MIG5AN.js";
16
+ } from "./chunk-GFX4RRFK.js";
17
17
  import {
18
18
  isBackstagePluginEnabled
19
19
  } from "./chunk-XMDPVKIJ.js";
@@ -81,9 +81,38 @@ const ServiceItem = React.memo(
81
81
  window.location.href.includes(`serviceId=${item.id}`) ? 'bg-purple-100' : 'hover:bg-purple-100'
82
82
  }`}
83
83
  >
84
- <span className="truncate">Architecture</span>
84
+ <span className="truncate flex items-center gap-1">Architecture</span>
85
85
  </a>
86
-
86
+ {item.specifications && item.specifications.asyncapiPath && (
87
+ <a
88
+ href={buildUrl(`/docs/services/${item.id}/${item.version}/asyncapi`)}
89
+ className={`flex items-center px-2 py-1.5 text-xs text-gray-600 hover:bg-purple-100 rounded-md flex justify-between ${
90
+ window.location.href.includes(`docs/services/${item.id}/${item.version}/asyncapi`)
91
+ ? 'bg-purple-100'
92
+ : 'hover:bg-purple-100'
93
+ }`}
94
+ >
95
+ <span className="truncate flex items-center gap-1">AsyncAPI specification</span>
96
+ <span className="text-purple-600 ml-2 text-[10px] uppercase font-medium bg-gray-50 px-4 py-0.5 rounded">
97
+ <img src="/icons/asyncapi.svg" className="w-4 h-4" />
98
+ </span>
99
+ </a>
100
+ )}
101
+ {item.specifications && item.specifications.openapiPath && (
102
+ <a
103
+ href={buildUrl(`/docs/services/${item.id}/${item.version}/spec`)}
104
+ className={`items-center px-2 py-1.5 text-xs text-gray-600 hover:bg-purple-100 rounded-md flex justify-between ${
105
+ window.location.href.includes(`docs/services/${item.id}/${item.version}/spec`)
106
+ ? 'bg-purple-100'
107
+ : 'hover:bg-purple-100'
108
+ }`}
109
+ >
110
+ <span className="truncate flex items-center gap-1">OpenAPI specification</span>
111
+ <span className="text-green-600 ml-2 text-[10px] uppercase font-medium bg-gray-50 px-4 py-0.5 rounded">
112
+ <img src="/icons/openapi.svg" className="w-4 h-4" />
113
+ </span>
114
+ </a>
115
+ )}
87
116
  <CollapsibleGroup
88
117
  isCollapsed={collapsedGroups[`${item.href}-receives`]}
89
118
  onToggle={() => toggleGroupCollapse(`${item.href}-receives`)}
@@ -15,8 +15,13 @@ export interface ServiceItem {
15
15
  label: string;
16
16
  name: string;
17
17
  id: string;
18
+ version: string;
18
19
  sends: MessageItem[];
19
20
  receives: MessageItem[];
21
+ specifications?: {
22
+ asyncapiPath: string;
23
+ openapiPath: string;
24
+ };
20
25
  }
21
26
 
22
27
  interface DomainItem {
@@ -67,6 +67,7 @@ export async function getResourcesForNavigation({ currentPath }: { currentPath:
67
67
  services: item.collection === 'domains' ? item.data.services : null,
68
68
  sends: sendsWithHref,
69
69
  receives: receivesWithHref,
70
+ specifications: item.collection === 'services' ? item.data.specifications : null,
70
71
  };
71
72
 
72
73
  group.push(navigationItem);
@@ -9,7 +9,9 @@ import { BookOpenText, Workflow, TableProperties, House, BookUser, MessageSquare
9
9
  import Header from '../components/Header.astro';
10
10
  import SEO from '../components/Seo.astro';
11
11
  import SideNav from '../components/SideNav/SideNav.astro';
12
- // import '@fontsource/inter';
12
+ import '@fontsource/inter';
13
+ import '@fontsource/inter/400.css'; // Specify weight
14
+ import '@fontsource/inter/700.css'; // Specify weight
13
15
 
14
16
  import { getCommands } from '@utils/commands';
15
17
  import { getDomains } from '@utils/collections/domains';
@@ -251,7 +253,7 @@ const canPageBeEmbedded = process.env.ENABLE_EMBED === 'true';
251
253
  const currentPath = window.location.href;
252
254
 
253
255
  // Hide the sidebar if the current navigation item is not a sidebar item
254
- if (!currentNavigationItem.sidebar || currentPath.includes('asyncapi') || currentPath.includes('/spec')) {
256
+ if (!currentNavigationItem.sidebar) {
255
257
  sidebar.style.display = 'none';
256
258
  content.style.width = '100%';
257
259
  content.classList.add('ml-16');
@@ -0,0 +1,33 @@
1
+ import { useState } from 'react';
2
+ import { ApiReferenceReact } from '@scalar/api-reference-react';
3
+ import '@scalar/api-reference-react/style.css';
4
+ import './_styles.css';
5
+ const OpenAPISpec = ({ spec }: { spec: string }) => {
6
+ const [loaded, setLoaded] = useState(false);
7
+ return (
8
+ <div>
9
+ {!loaded && <div>Loading...</div>}
10
+ <ApiReferenceReact
11
+ configuration={{
12
+ spec: {
13
+ url: spec,
14
+ },
15
+ theme: 'fastify',
16
+ hideClientButton: true,
17
+ onLoaded: () => {
18
+ setLoaded(true);
19
+ },
20
+ forceDarkModeState: 'light',
21
+ darkMode: false,
22
+ defaultOpenAllTags: true,
23
+ hideDarkModeToggle: true,
24
+ searchHotKey: 'p',
25
+ showSidebar: true,
26
+ customCss: 'bg-red-500',
27
+ }}
28
+ />
29
+ </div>
30
+ );
31
+ };
32
+
33
+ export default OpenAPISpec;
@@ -1,3 +1,7 @@
1
- #nav-bar-search{
1
+ #nav-bar-search {
2
2
  margin: 0 10px;
3
- }
3
+ }
4
+
5
+ .scalar-card-header[data-v-838dc259] {
6
+ display: none !important;
7
+ }
@@ -2,6 +2,7 @@
2
2
  import type { CollectionEntry } from 'astro:content';
3
3
  import * as path from 'path';
4
4
  import fs from 'node:fs';
5
+ import OpenAPISpec from './OpenAPI.tsx';
5
6
 
6
7
  import type { CollectionTypes, PageTypes } from '@types';
7
8
  import { DocumentMinusIcon } from '@heroicons/react/24/outline';
@@ -52,86 +53,9 @@ const fileExists = fs.existsSync(pathOnDisk);
52
53
  </p>
53
54
  </div>
54
55
  ) : (
55
- <rapi-doc
56
- spec-url={buildUrl(pathToSpec, true)}
57
- render-style="read"
58
- show-header="false"
59
- allow-authentication="true"
60
- allow-try="true"
61
- default-schema-tab="schema"
62
- use-path-in-nav-bar="true"
63
- show-method-in-nav-bar="as-colored-block"
64
- theme="light"
65
- schema-style="table"
66
- class="relative top-0"
67
- style={{ height: '100%', width: '100%', zIndex: 100 }}
68
- regular-font="ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji"
69
- bg-color="#ffffff"
70
- primary-color="#6b21a8"
71
- nav-bg-color="#fff"
72
- nav-text-color=""
73
- nav-hover-bg-color="#fff"
74
- nav-hover-text-color="#6b21a8"
75
- nav-accent-color=""
76
- />
56
+ <div>
57
+ <OpenAPISpec client:only="react" spec={buildUrl(pathToSpec, true)} />
58
+ </div>
77
59
  )
78
60
  }
79
61
  </VerticalSideBarLayout>
80
-
81
- <script>
82
- // @ts-ignore
83
- await import('rapidoc');
84
- </script>
85
-
86
- <style>
87
- rapi-doc::part(section-servers) {
88
- /* <<< targets the server div */
89
- /* background: #6b5b95; */
90
- border: 2px solid #f1edff;
91
- color: black;
92
- margin: 0 24px 0 24px;
93
- border-radius: 5px;
94
- }
95
- rapi-doc::part(label-selected-server) {
96
- /* <<< targets selected server label */
97
- color: black;
98
- }
99
-
100
- rapi-doc::part(section-navbar-search) {
101
- margin: 0 10px;
102
- padding: 0;
103
- margin-bottom: 1em;
104
- }
105
- rapi-doc::part(section-navbar) {
106
- margin: 0;
107
- padding: 10px important;
108
- margin-bottom: 1em;
109
- background-image: linear-gradient(to bottom, rgb(255, 255, 255), rgb(243, 244, 246));
110
- border-right-width: 1px;
111
- border-right-color: rgb(229, 231, 235);
112
- }
113
- rapi-doc::part(section-overview) {
114
- margin: 0 2em 0 2em;
115
- padding: 1em 0 1em;
116
- }
117
- rapi-doc::part(section-auth) {
118
- margin: 2em 2em;
119
- padding: 0;
120
- }
121
- rapi-doc::part(section-tag) {
122
- margin: 2em 2em;
123
- padding: 0;
124
- }
125
- rapi-doc::part(section-tag-title) {
126
- margin: 0.5em 0 0;
127
- padding: 0;
128
- }
129
- rapi-doc::part(section-operations-in-tag) {
130
- margin: 1em 2em;
131
- padding: 0;
132
- }
133
- rapi-doc::part(section-navbar) {
134
- border-right: 1px solid #f1edff;
135
- padding: 1em 1em 0 0;
136
- }
137
- </style>
@@ -40,5 +40,5 @@ export const buildUrlWithParams = (baseUrl: string, params: Record<string, strin
40
40
  .map(([key, value]) => `${key}=${value}`)
41
41
  .join('&');
42
42
 
43
- return buildUrl(`${baseUrl}?${queryString}`);
43
+ return `${buildUrl(baseUrl)}?${queryString}`;
44
44
  };
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.28.2",
9
+ "version": "2.29.0",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -40,6 +40,7 @@
40
40
  "@parcel/watcher": "^2.4.1",
41
41
  "@radix-ui/react-context-menu": "^2.2.6",
42
42
  "@radix-ui/react-dialog": "^1.1.6",
43
+ "@scalar/api-reference-react": "^0.4.37",
43
44
  "@stoplight/json-schema-viewer": "^4.16.4",
44
45
  "@tailwindcss/typography": "^0.5.13",
45
46
  "@tanstack/react-table": "^8.17.3",
@@ -68,7 +69,6 @@
68
69
  "marked": "^15.0.6",
69
70
  "mermaid": "^11.4.1",
70
71
  "prismjs": "^1.29.0",
71
- "rapidoc": "^9.3.4",
72
72
  "react": "^18.3.1",
73
73
  "react-dom": "^18.3.1",
74
74
  "rehype-slug": "^6.0.0",