@eventcatalog/core 3.3.0 → 3.3.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.
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-UPSN5H7S.js → chunk-AJ7F2ASU.js} +1 -1
- package/dist/{chunk-NGKYYZZP.js → chunk-B5CNGEHG.js} +1 -1
- package/dist/{chunk-I4CMEOEN.js → chunk-DXXGEMLA.js} +1 -1
- package/dist/{chunk-QZF5ZYJB.js → chunk-IFELNUKH.js} +1 -1
- package/dist/{chunk-OAUYXPXT.js → chunk-LZMHPUTE.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +4 -3
- package/dist/eventcatalog.js +8 -7
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/content.config.ts +8 -6
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +24 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/[filename].astro +22 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/_OpenAPI.tsx +28 -4
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-AJ7F2ASU.js";
|
|
4
|
+
import "../chunk-LZMHPUTE.js";
|
|
5
|
+
import "../chunk-B5CNGEHG.js";
|
|
6
6
|
import "../chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -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.3.
|
|
112
|
+
var version = "3.3.1";
|
|
113
113
|
|
|
114
114
|
// src/constants.ts
|
|
115
115
|
var VERSION = version;
|
|
@@ -843,10 +843,11 @@ var startServerCatalog = ({
|
|
|
843
843
|
isEventCatalogStarter = false,
|
|
844
844
|
isEventCatalogScale = false
|
|
845
845
|
}) => {
|
|
846
|
+
const serverEntryPath = import_node_path8.default.join(dir, "dist", "server", "entry.mjs");
|
|
846
847
|
(0, import_node_child_process.execSync)(
|
|
847
|
-
`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} node
|
|
848
|
+
`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} node "${serverEntryPath}"`,
|
|
848
849
|
{
|
|
849
|
-
cwd:
|
|
850
|
+
cwd: core,
|
|
850
851
|
stdio: "inherit"
|
|
851
852
|
}
|
|
852
853
|
);
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-AJ7F2ASU.js";
|
|
10
|
+
import "./chunk-LZMHPUTE.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-
|
|
24
|
+
} from "./chunk-IFELNUKH.js";
|
|
25
25
|
import {
|
|
26
26
|
logger
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-DXXGEMLA.js";
|
|
28
28
|
import {
|
|
29
29
|
VERSION
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-B5CNGEHG.js";
|
|
31
31
|
import "./chunk-UPONRQSN.js";
|
|
32
32
|
|
|
33
33
|
// src/eventcatalog.ts
|
|
@@ -235,10 +235,11 @@ var startServerCatalog = ({
|
|
|
235
235
|
isEventCatalogStarter = false,
|
|
236
236
|
isEventCatalogScale = false
|
|
237
237
|
}) => {
|
|
238
|
+
const serverEntryPath = path.join(dir, "dist", "server", "entry.mjs");
|
|
238
239
|
execSync(
|
|
239
|
-
`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} node
|
|
240
|
+
`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} node "${serverEntryPath}"`,
|
|
240
241
|
{
|
|
241
|
-
cwd:
|
|
242
|
+
cwd: core,
|
|
242
243
|
stdio: "inherit"
|
|
243
244
|
}
|
|
244
245
|
);
|
package/dist/generate.cjs
CHANGED
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-IFELNUKH.js";
|
|
4
|
+
import "./chunk-DXXGEMLA.js";
|
|
5
|
+
import "./chunk-B5CNGEHG.js";
|
|
6
6
|
import "./chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -698,12 +698,14 @@ const diagrams = defineCollection({
|
|
|
698
698
|
base: projectDirBase,
|
|
699
699
|
generateId: ({ data }) => `${data.id}-${data.version}`,
|
|
700
700
|
}),
|
|
701
|
-
schema: z
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
701
|
+
schema: z
|
|
702
|
+
.object({
|
|
703
|
+
id: z.string(),
|
|
704
|
+
name: z.string(),
|
|
705
|
+
version: z.string(),
|
|
706
|
+
summary: z.string().optional(),
|
|
707
|
+
})
|
|
708
|
+
.merge(baseSchema),
|
|
707
709
|
});
|
|
708
710
|
|
|
709
711
|
export const collections = {
|
|
@@ -9,6 +9,8 @@ import '@asyncapi/react-component/styles/default.min.css';
|
|
|
9
9
|
import js from '@asyncapi/react-component/browser/standalone/without-parser.js?url';
|
|
10
10
|
import { AsyncApiComponentWP, type ConfigInterface } from '@asyncapi/react-component';
|
|
11
11
|
import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
|
|
12
|
+
import CopyAsMarkdown from '@components/CopyAsMarkdown';
|
|
13
|
+
import { isEventCatalogChatEnabled } from '@utils/feature';
|
|
12
14
|
import Config from '@utils/eventcatalog-config/catalog';
|
|
13
15
|
import { Page } from './_[filename].data';
|
|
14
16
|
import { getAbsoluteFilePathForAstroFile } from '@utils/files';
|
|
@@ -46,6 +48,10 @@ const renderedComponent = renderToString(component);
|
|
|
46
48
|
// Capitalize the first letter of a string
|
|
47
49
|
const pageTitle = `${collection} | ${data.name} | AsyncApi Spec`.replace(/^\w/, (c) => c.toUpperCase());
|
|
48
50
|
|
|
51
|
+
// Chat configuration
|
|
52
|
+
const chatEnabled = isEventCatalogChatEnabled();
|
|
53
|
+
const chatQuery = `Tell me about the AsyncAPI specification for "${data.name}" (version ${data.version})`;
|
|
54
|
+
|
|
49
55
|
// Index only the latest version
|
|
50
56
|
const pagefindAttributes =
|
|
51
57
|
data.version === data.latestVersion
|
|
@@ -57,13 +63,30 @@ const pagefindAttributes =
|
|
|
57
63
|
---
|
|
58
64
|
|
|
59
65
|
<VerticalSideBarLayout title={pageTitle}>
|
|
60
|
-
<div {...pagefindAttributes}>
|
|
66
|
+
<div {...pagefindAttributes} class="relative">
|
|
61
67
|
{
|
|
62
68
|
// Currently, Pagefind does not index metadata (such as the title),
|
|
63
69
|
// so we need to ensure it is included as text on the page.
|
|
64
70
|
// https://github.com/CloudCannon/pagefind/issues/437
|
|
65
71
|
}
|
|
66
72
|
<h2 class="hidden">{pageTitle}</h2>
|
|
73
|
+
{
|
|
74
|
+
chatEnabled && (
|
|
75
|
+
<div class="absolute top-3 right-4 z-10">
|
|
76
|
+
<CopyAsMarkdown
|
|
77
|
+
client:only="react"
|
|
78
|
+
schemas={[]}
|
|
79
|
+
chatQuery={chatQuery}
|
|
80
|
+
chatEnabled={chatEnabled}
|
|
81
|
+
editUrl=""
|
|
82
|
+
markdownDownloadEnabled={false}
|
|
83
|
+
rssFeedEnabled={false}
|
|
84
|
+
preferChatAsDefault={true}
|
|
85
|
+
chatButtonText="Ask about this specification"
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
67
90
|
<div id="asyncapi" class="md:pr-14" set:html={renderedComponent} />
|
|
68
91
|
</div>
|
|
69
92
|
</VerticalSideBarLayout>
|
|
@@ -4,6 +4,8 @@ import OpenAPISpec from './_OpenAPI.tsx';
|
|
|
4
4
|
|
|
5
5
|
import { DocumentMinusIcon } from '@heroicons/react/24/outline';
|
|
6
6
|
import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
|
|
7
|
+
import CopyAsMarkdown from '@components/CopyAsMarkdown';
|
|
8
|
+
import { isEventCatalogChatEnabled } from '@utils/feature';
|
|
7
9
|
import './_styles.css';
|
|
8
10
|
import { Page } from './_[filename].data.ts';
|
|
9
11
|
import { getAbsoluteFilePathForAstroFile } from '@utils/files';
|
|
@@ -27,6 +29,10 @@ let content = '';
|
|
|
27
29
|
// Capitalize the first letter of a string
|
|
28
30
|
const pageTitle = `${collection} | ${data.name} | OpenAPI Spec`.replace(/^\w/, (c) => c.toUpperCase());
|
|
29
31
|
|
|
32
|
+
// Chat configuration
|
|
33
|
+
const chatEnabled = isEventCatalogChatEnabled();
|
|
34
|
+
const chatQuery = `Tell me about the OpenAPI specification for "${data.name}" (version ${data.version})`;
|
|
35
|
+
|
|
30
36
|
// Index only the latest version
|
|
31
37
|
const pagefindAttributes =
|
|
32
38
|
data.version === data.latestVersion
|
|
@@ -57,13 +63,28 @@ if (isRemote) {
|
|
|
57
63
|
</p>
|
|
58
64
|
</div>
|
|
59
65
|
) : (
|
|
60
|
-
<div {...pagefindAttributes}>
|
|
66
|
+
<div {...pagefindAttributes} class="relative">
|
|
61
67
|
{
|
|
62
68
|
// Currently, Pagefind does not index metadata (such as the title),
|
|
63
69
|
// so we need to ensure it is included as text on the page.
|
|
64
70
|
// https://github.com/CloudCannon/pagefind/issues/437
|
|
65
71
|
}
|
|
66
72
|
<h2 class="hidden">{pageTitle}</h2>
|
|
73
|
+
{chatEnabled && (
|
|
74
|
+
<div class="absolute top-3 right-14 z-10">
|
|
75
|
+
<CopyAsMarkdown
|
|
76
|
+
client:only="react"
|
|
77
|
+
schemas={[]}
|
|
78
|
+
chatQuery={chatQuery}
|
|
79
|
+
chatEnabled={chatEnabled}
|
|
80
|
+
editUrl=""
|
|
81
|
+
markdownDownloadEnabled={false}
|
|
82
|
+
rssFeedEnabled={false}
|
|
83
|
+
preferChatAsDefault={true}
|
|
84
|
+
chatButtonText="Ask about this specification"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
67
88
|
<OpenAPISpec client:only="react" spec={content} />
|
|
68
89
|
</div>
|
|
69
90
|
)
|
|
@@ -1,13 +1,38 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
2
|
import { ApiReferenceReact } from '@scalar/api-reference-react';
|
|
3
3
|
import '@scalar/api-reference-react/style.css';
|
|
4
4
|
import './_styles.css';
|
|
5
|
+
|
|
5
6
|
const OpenAPISpec = ({ spec }: { spec: string }) => {
|
|
6
7
|
const [loaded, setLoaded] = useState(false);
|
|
8
|
+
const [isDarkMode, setIsDarkMode] = useState(() => {
|
|
9
|
+
return document.documentElement.getAttribute('data-theme') === 'dark';
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
// Watch for theme changes
|
|
14
|
+
const observer = new MutationObserver((mutations) => {
|
|
15
|
+
mutations.forEach((mutation) => {
|
|
16
|
+
if (mutation.attributeName === 'data-theme') {
|
|
17
|
+
const theme = document.documentElement.getAttribute('data-theme');
|
|
18
|
+
setIsDarkMode(theme === 'dark');
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
observer.observe(document.documentElement, {
|
|
24
|
+
attributes: true,
|
|
25
|
+
attributeFilter: ['data-theme'],
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return () => observer.disconnect();
|
|
29
|
+
}, []);
|
|
30
|
+
|
|
7
31
|
return (
|
|
8
32
|
<div>
|
|
9
33
|
{!loaded && <div>Loading...</div>}
|
|
10
34
|
<ApiReferenceReact
|
|
35
|
+
key={isDarkMode ? 'dark' : 'light'}
|
|
11
36
|
configuration={{
|
|
12
37
|
spec: {
|
|
13
38
|
content: spec,
|
|
@@ -17,13 +42,12 @@ const OpenAPISpec = ({ spec }: { spec: string }) => {
|
|
|
17
42
|
onLoaded: () => {
|
|
18
43
|
setLoaded(true);
|
|
19
44
|
},
|
|
20
|
-
forceDarkModeState: 'light',
|
|
21
|
-
darkMode:
|
|
45
|
+
forceDarkModeState: isDarkMode ? 'dark' : 'light',
|
|
46
|
+
darkMode: isDarkMode,
|
|
22
47
|
defaultOpenAllTags: true,
|
|
23
48
|
hideDarkModeToggle: true,
|
|
24
49
|
searchHotKey: 'p',
|
|
25
50
|
showSidebar: true,
|
|
26
|
-
customCss: 'bg-red-500',
|
|
27
51
|
}}
|
|
28
52
|
/>
|
|
29
53
|
</div>
|
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.3.
|
|
9
|
+
"version": "3.3.1",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@tanstack/react-table": "^8.17.3",
|
|
55
55
|
"@xyflow/react": "^12.3.6",
|
|
56
56
|
"ai": "^6.0.17",
|
|
57
|
-
"astro": "^5.16.
|
|
57
|
+
"astro": "^5.16.8",
|
|
58
58
|
"astro-compress": "^2.3.8",
|
|
59
59
|
"astro-expressive-code": "^0.41.3",
|
|
60
60
|
"astro-seo": "^0.8.4",
|