@eventcatalog/core 2.56.2 → 2.56.4

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-59-orange.svg?style=flat-square)](#contributors-)
37
+ [![All Contributors](https://img.shields.io/badge/all_contributors-60-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)
@@ -263,6 +263,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
263
263
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/cc-stjm"><img src="https://avatars.githubusercontent.com/u/47748595?v=4?s=100" width="100px;" alt="cc-stjm"/><br /><sub><b>cc-stjm</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=cc-stjm" title="Code">💻</a></td>
264
264
  <td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/lucianlature/"><img src="https://avatars.githubusercontent.com/u/24992?v=4?s=100" width="100px;" alt="Lucian Lature"/><br /><sub><b>Lucian Lature</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/issues?q=author%3Alucianlature" title="Bug reports">🐛</a></td>
265
265
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/villAsh"><img src="https://avatars.githubusercontent.com/u/50195101?v=4?s=100" width="100px;" alt="Vilas Chauvhan"/><br /><sub><b>Vilas Chauvhan</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=villAsh" title="Code">💻</a></td>
266
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/mrerichoffman"><img src="https://avatars.githubusercontent.com/u/7565432?v=4?s=100" width="100px;" alt="Eric Hoffman"/><br /><sub><b>Eric Hoffman</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/issues?q=author%3Amrerichoffman" title="Bug reports">🐛</a></td>
266
267
  </tr>
267
268
  </tbody>
268
269
  </table>
@@ -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.56.2";
40
+ var version = "2.56.4";
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-XCIZLERJ.js";
4
- import "../chunk-KMF5GGQO.js";
3
+ } from "../chunk-KASHKMSG.js";
4
+ import "../chunk-HHPUSHCO.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.56.2";
109
+ var version = "2.56.4";
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-GVKISWRC.js";
4
- import "../chunk-XCIZLERJ.js";
5
- import "../chunk-KMF5GGQO.js";
3
+ } from "../chunk-QS3LKU6Y.js";
4
+ import "../chunk-KASHKMSG.js";
5
+ import "../chunk-HHPUSHCO.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.56.2";
2
+ var version = "2.56.4";
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-KMF5GGQO.js";
3
+ } from "./chunk-HHPUSHCO.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-XCIZLERJ.js";
3
+ } from "./chunk-KASHKMSG.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.56.2";
28
+ var version = "2.56.4";
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-KMF5GGQO.js";
3
+ } from "./chunk-HHPUSHCO.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.56.2";
160
+ var version = "2.56.4";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-GVKISWRC.js";
10
- import "./chunk-XCIZLERJ.js";
9
+ } from "./chunk-QS3LKU6Y.js";
10
+ import "./chunk-KASHKMSG.js";
11
11
  import {
12
12
  catalogToAstro,
13
13
  checkAndConvertMdToMdx
@@ -15,7 +15,7 @@ import {
15
15
  import "./chunk-55D645EH.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-KMF5GGQO.js";
18
+ } from "./chunk-HHPUSHCO.js";
19
19
  import {
20
20
  getProjectOutDir,
21
21
  isAuthEnabled,
@@ -2,7 +2,7 @@ import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
2
2
  import { Copy, FileText, MessageCircleQuestion, ChevronDownIcon, ExternalLink, PenSquareIcon } from 'lucide-react';
3
3
  import React, { useState, isValidElement } from 'react';
4
4
  import type { Schema } from '@utils/collections/schemas';
5
- import { buildUrl } from '@utils/url-builder';
5
+ import { buildUrl, toMarkdownUrl } from '@utils/url-builder';
6
6
 
7
7
  // Type allows either a component type (like Lucide icon) or a pre-rendered element (like <img>)
8
8
  type IconInput = React.ElementType | React.ReactElement;
@@ -74,7 +74,7 @@ export function CopyPageMenu({
74
74
 
75
75
  // get the url of the current page
76
76
  const url = window.location.href;
77
- const markdownUrl = url + '.mdx';
77
+ const markdownUrl = toMarkdownUrl(url);
78
78
 
79
79
  // Determine the default action based on what's available
80
80
  const getDefaultAction = () => {
@@ -290,7 +290,7 @@ export function CopyPageMenu({
290
290
  {availableActions.chat && (
291
291
  <DropdownMenu.Item
292
292
  className="cursor-pointer hover:bg-gray-100 focus:outline-none focus:bg-gray-100"
293
- onSelect={() => window.open(buildUrl(`/chat?query=${chatQuery}`))}
293
+ onSelect={() => window.open(buildUrl(`/chat`) + `?query=${chatQuery}`)}
294
294
  >
295
295
  <MenuItemContent
296
296
  icon={MessageCircleQuestion}
@@ -0,0 +1,56 @@
1
+ ---
2
+ import fs from 'fs';
3
+ import { getAbsoluteFilePathForAstroFile } from '@utils/files';
4
+ import Admonition from '@components/MDX/Admonition';
5
+
6
+ const { file: mermaidFile, filePath } = Astro.props;
7
+
8
+ // const escapeHtml = (str: string) => str.replace(/[&<>"']/g, (c) => escapeMap[c]);
9
+ let isValidMermaidFile = mermaidFile.endsWith('.mmd') || mermaidFile.endsWith('.mermaid');
10
+ let mermaidFileContent = '';
11
+
12
+ if (isValidMermaidFile) {
13
+ try {
14
+ const pathToSpec = getAbsoluteFilePathForAstroFile(filePath, mermaidFile);
15
+ mermaidFileContent = fs.readFileSync(pathToSpec, 'utf8');
16
+ } catch (error) {
17
+ console.error(`Error reading design file: ${error}`);
18
+ }
19
+ }
20
+ ---
21
+
22
+ {
23
+ !mermaidFileContent && (
24
+ <Admonition type="warning">
25
+ <div>
26
+ <span class="block font-bold">{`<MermaidFileLoader/>`} failed to load</span>
27
+ <span class="block">
28
+ Tried to load mermaid file: {mermaidFile}. Make sure you have this mermaid file defined in your project.
29
+ </span>
30
+ </div>
31
+ </Admonition>
32
+ )
33
+ }
34
+
35
+ {
36
+ !isValidMermaidFile && (
37
+ <Admonition type="warning">
38
+ <div>
39
+ <span class="block font-bold">{`<MermaidFileLoader/>`} failed to load</span>
40
+ <span class="block">
41
+ Tried to load mermaid file: {mermaidFile}. Make sure the file extension is either .mmd or .mermaid.
42
+ </span>
43
+ </div>
44
+ </Admonition>
45
+ )
46
+ }
47
+
48
+ {
49
+ mermaidFileContent && isValidMermaidFile && (
50
+ <div class="mermaid-block pb-4">
51
+ <div class="mermaid border border-gray-200 rounded-lg p-1" data-content={mermaidFileContent}>
52
+ <p>Loading graph...</p>
53
+ </div>
54
+ </div>
55
+ )
56
+ }
@@ -25,6 +25,7 @@ import Lucid from '@components/MDX/Lucid/Lucid.astro';
25
25
  import DrawIO from '@components/MDX/DrawIO/DrawIO.astro';
26
26
  import FigJam from '@components/MDX/FigJam/FigJam.astro';
27
27
  import Design from '@components/MDX/Design/Design.astro';
28
+ import MermaidFileLoader from '@components/MDX/MermaidFileLoader/MermaidFileLoader.astro';
28
29
  // Portals: required for server/client components
29
30
  import NodeGraphPortal from '@components/MDX/NodeGraph/NodeGraphPortal';
30
31
  import SchemaViewerPortal from '@components/MDX/SchemaViewer/SchemaViewerPortal';
@@ -62,6 +63,7 @@ const components = (props: any) => {
62
63
  Lucid: (mdxProp: any) => jsx(Lucid, { ...props, ...mdxProp }),
63
64
  DrawIO: (mdxProp: any) => jsx(DrawIO, { ...props, ...mdxProp }),
64
65
  FigJam: (mdxProp: any) => jsx(FigJam, { ...props, ...mdxProp }),
66
+ MermaidFileLoader: (mdxProp: any) => jsx(MermaidFileLoader, { ...props, ...mdxProp }),
65
67
  };
66
68
  };
67
69
 
@@ -48,3 +48,15 @@ export const buildEditUrlForResource = (editUrl: string, filePath: string) => {
48
48
  const cleanFilePath = filePath.replace(/^\.\.?\//g, '');
49
49
  return `${editUrl}/${cleanFilePath}`;
50
50
  };
51
+
52
+ // Takes a given url and returns the .mdx url
53
+ export const toMarkdownUrl = (url: string) => {
54
+ const trailingSlash = __EC_TRAILING_SLASH__;
55
+
56
+ if (trailingSlash) {
57
+ const urlWithoutTrailingSlash = url.replace(/\/$/, '');
58
+ return urlWithoutTrailingSlash + '.mdx/';
59
+ }
60
+
61
+ return url + '.mdx';
62
+ };
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.56.2",
9
+ "version": "2.56.4",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -58,7 +58,7 @@
58
58
  "@tanstack/react-table": "^8.17.3",
59
59
  "@xyflow/react": "^12.3.6",
60
60
  "ai": "^4.3.9",
61
- "astro": "^5.13.6",
61
+ "astro": "^5.13.8",
62
62
  "astro-compress": "^2.3.8",
63
63
  "astro-expressive-code": "^0.40.1",
64
64
  "astro-seo": "^0.8.4",