@eventcatalog/core 2.29.1 → 2.29.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.
package/README.md CHANGED
@@ -34,7 +34,7 @@
34
34
  <h4>Features: Documentation for Event Driven Architectures, Integration with any broker, Generator from your OpenAPI and AsyncAPI documents, Docs and Code, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
35
35
 
36
36
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
37
- [![All Contributors](https://img.shields.io/badge/all_contributors-49-orange.svg?style=flat-square)](#contributors-)
37
+ [![All Contributors](https://img.shields.io/badge/all_contributors-50-orange.svg?style=flat-square)](#contributors-)
38
38
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
39
39
 
40
40
  [Read the Docs](https://www.eventcatalog.dev/docs/development/getting-started/introduction) | [View Demo](https://demo.eventcatalog.dev)
@@ -259,6 +259,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
259
259
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/Vertygo"><img src="https://avatars.githubusercontent.com/u/1658326?v=4?s=100" width="100px;" alt="Ivan Milosavljevic"/><br /><sub><b>Ivan Milosavljevic</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=Vertygo" title="Documentation">📖</a></td>
260
260
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/Mezzle"><img src="https://avatars.githubusercontent.com/u/570639?v=4?s=100" width="100px;" alt="Martin Meredith"/><br /><sub><b>Martin Meredith</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=Mezzle" title="Code">💻</a></td>
261
261
  </tr>
262
+ <tr>
263
+ <td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/ruudwelling/"><img src="https://avatars.githubusercontent.com/u/4014179?v=4?s=100" width="100px;" alt="Ruud Welling"/><br /><sub><b>Ruud Welling</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=WellingR" title="Code">💻</a></td>
264
+ </tr>
262
265
  </tbody>
263
266
  </table>
264
267
 
@@ -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.29.1";
40
+ var version = "2.29.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-UMSVZL34.js";
4
- import "../chunk-OXENAILQ.js";
3
+ } from "../chunk-7SZ6PH5O.js";
4
+ import "../chunk-77IO2UDS.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.29.1";
109
+ var version = "2.29.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-YKQAIHRX.js";
4
- import "../chunk-UMSVZL34.js";
5
- import "../chunk-OXENAILQ.js";
3
+ } from "../chunk-MHSM6HM5.js";
4
+ import "../chunk-7SZ6PH5O.js";
5
+ import "../chunk-77IO2UDS.js";
6
6
  import "../chunk-E7TXTI7G.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.29.1";
2
+ var version = "2.29.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-OXENAILQ.js";
3
+ } from "./chunk-77IO2UDS.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-UMSVZL34.js";
3
+ } from "./chunk-7SZ6PH5O.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.29.1";
28
+ var version = "2.29.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-OXENAILQ.js";
3
+ } from "./chunk-77IO2UDS.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.29.1";
164
+ var version = "2.29.2";
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-YKQAIHRX.js";
10
- import "./chunk-UMSVZL34.js";
9
+ } from "./chunk-MHSM6HM5.js";
10
+ import "./chunk-7SZ6PH5O.js";
11
11
  import {
12
12
  catalogToAstro
13
13
  } from "./chunk-R2NILSWL.js";
14
14
  import {
15
15
  VERSION
16
- } from "./chunk-OXENAILQ.js";
16
+ } from "./chunk-77IO2UDS.js";
17
17
  import {
18
18
  isBackstagePluginEnabled
19
19
  } from "./chunk-XMDPVKIJ.js";
@@ -2,12 +2,12 @@ import Sidebar from './ChatSidebar';
2
2
  import { ChatProvider } from './hooks/ChatProvider';
3
3
  import ChatWindow from './ChatWindow';
4
4
 
5
- const Chat = () => {
5
+ const Chat = ({ chatConfig }: { chatConfig: any }) => {
6
6
  return (
7
7
  <ChatProvider>
8
8
  <div className="flex overflow-hidden w-full">
9
9
  <Sidebar />
10
- <ChatWindow />
10
+ <ChatWindow {...chatConfig} />
11
11
  </div>
12
12
  </ChatProvider>
13
13
  );
@@ -2,7 +2,6 @@ import { useEffect, useState, useRef, useCallback, useMemo } from 'react';
2
2
  import { BookOpen, Send } from 'lucide-react';
3
3
  import { CreateWebWorkerMLCEngine, type InitProgressReport } from '@mlc-ai/web-llm';
4
4
  import { useChat, type Message } from './hooks/ChatProvider';
5
- import config from '@config';
6
5
  import React from 'react';
7
6
 
8
7
  // Update Message type to include resources
@@ -102,7 +101,17 @@ const ChatMessage = React.memo(({ message }: { message: Message }) => (
102
101
 
103
102
  ChatMessage.displayName = 'ChatMessage';
104
103
 
105
- const ChatWindow = () => {
104
+ interface ChatWindowProps {
105
+ model?: string;
106
+ max_tokens?: number;
107
+ similarityResults?: number;
108
+ }
109
+
110
+ const ChatWindow = ({
111
+ model = 'Hermes-3-Llama-3.2-3B-q4f16_1-MLC',
112
+ max_tokens = 4096,
113
+ similarityResults = 50,
114
+ }: ChatWindowProps) => {
106
115
  const [loading, setLoading] = useState(true);
107
116
  const [loadingProgress, setLoadingProgress] = useState(0);
108
117
  const [engine, setEngine] = useState<any>(null);
@@ -114,10 +123,7 @@ const ChatWindow = () => {
114
123
  const completionRef = useRef<any>(null);
115
124
  const outputRef = useRef<HTMLDivElement>(null);
116
125
 
117
- // LLM configuration from eventcatalog.config.js file
118
- const model = config.chat?.model || 'Hermes-3-Llama-3.2-3B-q4f16_1-MLC';
119
- const max_tokens = config.chat?.max_tokens || 4096;
120
- const similarityResults = config.chat?.similarityResults || 50;
126
+ console.log('model', model);
121
127
 
122
128
  const { currentSession, storeMessagesToSession, updateSession, isStreaming, setIsStreaming } = useChat();
123
129
 
@@ -8,6 +8,7 @@ import fs from 'node:fs';
8
8
  import { Code } from 'astro-expressive-code/components';
9
9
 
10
10
  const isEnabled = config.chat?.enabled || false;
11
+ const chatConfig = config.chat || {};
11
12
 
12
13
  const PROJECT_DIR = path.resolve(process.env.PROJECT_DIR || process.cwd());
13
14
  const GENERATED_AI_DIR = path.resolve(PROJECT_DIR, 'public/ai');
@@ -46,7 +47,7 @@ const generatorConfig = `
46
47
  </div>
47
48
  </div>
48
49
  <div id="chatContainer" class="w-full">
49
- <Chat client:only="react" />
50
+ <Chat client:only="react" chatConfig={chatConfig} />
50
51
  </div>
51
52
  </>
52
53
  ) : (
@@ -2,7 +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
+ import OpenAPISpec from './_OpenAPI.tsx';
6
6
 
7
7
  import type { CollectionTypes, PageTypes } from '@types';
8
8
  import { DocumentMinusIcon } from '@heroicons/react/24/outline';
@@ -44,7 +44,7 @@ const props = Astro.props;
44
44
  const pageTitle = `${props.collection} | ${props.data.name}`.replace(/^\w/, (c) => c.toUpperCase());
45
45
 
46
46
  const { pathname } = Astro.url;
47
- const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion);
47
+ const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion, false, true);
48
48
  ---
49
49
 
50
50
  <!doctype html>
@@ -32,8 +32,7 @@ const pageTitle = `${props.collection} | ${props.data.name}`.replace(/^\w/, (c)
32
32
 
33
33
  const { pathname } = Astro.url;
34
34
 
35
- // redirect with any search params too
36
- const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion);
35
+ const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion, false, true);
37
36
  ---
38
37
 
39
38
  <!doctype html>
@@ -48,6 +47,7 @@ const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion);
48
47
 
49
48
  <script define:vars={{ redirectUrl }}>
50
49
  document.addEventListener('DOMContentLoaded', () => {
50
+ // redirect with any search params too
51
51
  const searchParams = window.location.search;
52
52
  const fullRedirectUrl = redirectUrl + searchParams;
53
53
  window.location.href = fullRedirectUrl;
@@ -3,14 +3,14 @@ const cleanUrl = (url: string) => {
3
3
  };
4
4
 
5
5
  // Custom URL builder as Astro does not support this stuff out the box
6
- export const buildUrl = (url: string, ignoreTrailingSlash = false) => {
6
+ export const buildUrl = (url: string, ignoreTrailingSlash = false, urlAlreadyIncludesBaseUrl = false) => {
7
7
  // Should a trailingSlash be added to urls?
8
8
  const trailingSlash = __EC_TRAILING_SLASH__;
9
9
 
10
10
  let newUrl = url;
11
11
 
12
12
  // If the base URL is not the root, we need to append it
13
- if (import.meta.env.BASE_URL !== '/') {
13
+ if (import.meta.env.BASE_URL !== '/' && !urlAlreadyIncludesBaseUrl) {
14
14
  newUrl = `${import.meta.env.BASE_URL}${url}`;
15
15
  }
16
16
 
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.29.1",
9
+ "version": "2.29.2",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },