@eventcatalog/core 3.12.0 → 3.12.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.
@@ -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 = "3.12.0";
40
+ var version = "3.12.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-K44BXVHU.js";
4
- import "../chunk-G7GG3HEB.js";
3
+ } from "../chunk-4NN3BGRO.js";
4
+ import "../chunk-MUWJMMFW.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 = "3.12.0";
109
+ var version = "3.12.2";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-VUBZ6A7B.js";
4
- import "../chunk-K44BXVHU.js";
3
+ } from "../chunk-LW2EM24W.js";
4
+ import "../chunk-4NN3BGRO.js";
5
5
  import "../chunk-4UVFXLPI.js";
6
- import "../chunk-G7GG3HEB.js";
6
+ import "../chunk-MUWJMMFW.js";
7
7
  import "../chunk-UPONRQSN.js";
8
8
  export {
9
9
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-WVKLG26T.js";
3
+ } from "./chunk-UYX5B6UR.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-G7GG3HEB.js";
3
+ } from "./chunk-MUWJMMFW.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-K44BXVHU.js";
3
+ } from "./chunk-4NN3BGRO.js";
4
4
  import {
5
5
  countResources,
6
6
  serializeCounts
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "3.12.0";
2
+ var version = "3.12.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-G7GG3HEB.js";
3
+ } from "./chunk-MUWJMMFW.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "3.12.0";
28
+ var version = "3.12.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-G7GG3HEB.js";
3
+ } from "./chunk-MUWJMMFW.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -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.12.0";
112
+ var version = "3.12.2";
113
113
 
114
114
  // src/constants.ts
115
115
  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-VUBZ6A7B.js";
10
- import "./chunk-K44BXVHU.js";
9
+ } from "./chunk-LW2EM24W.js";
10
+ import "./chunk-4NN3BGRO.js";
11
11
  import "./chunk-4UVFXLPI.js";
12
12
  import {
13
13
  runMigrations
@@ -22,13 +22,13 @@ import {
22
22
  } from "./chunk-5VBIXL6C.js";
23
23
  import {
24
24
  generate
25
- } from "./chunk-LXOS3MXQ.js";
25
+ } from "./chunk-3SKYVR2D.js";
26
26
  import {
27
27
  logger
28
- } from "./chunk-WVKLG26T.js";
28
+ } from "./chunk-UYX5B6UR.js";
29
29
  import {
30
30
  VERSION
31
- } from "./chunk-G7GG3HEB.js";
31
+ } from "./chunk-MUWJMMFW.js";
32
32
  import "./chunk-UPONRQSN.js";
33
33
 
34
34
  // src/eventcatalog.ts
package/dist/generate.cjs CHANGED
@@ -73,7 +73,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
73
73
  var import_picocolors = __toESM(require("picocolors"), 1);
74
74
 
75
75
  // package.json
76
- var version = "3.12.0";
76
+ var version = "3.12.2";
77
77
 
78
78
  // src/constants.ts
79
79
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-LXOS3MXQ.js";
4
- import "./chunk-WVKLG26T.js";
5
- import "./chunk-G7GG3HEB.js";
3
+ } from "./chunk-3SKYVR2D.js";
4
+ import "./chunk-UYX5B6UR.js";
5
+ import "./chunk-MUWJMMFW.js";
6
6
  import "./chunk-UPONRQSN.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "3.12.0";
39
+ var version = "3.12.2";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-WVKLG26T.js";
4
- import "../chunk-G7GG3HEB.js";
3
+ } from "../chunk-UYX5B6UR.js";
4
+ import "../chunk-MUWJMMFW.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -24,6 +24,11 @@ const NestedItem: React.FC<NestedItemProps> = ({
24
24
  const itemId = `${parentId}-${itemIndex}`;
25
25
 
26
26
  if (hasNestedItems && item.items) {
27
+ // Check if folder has an index file (slug) making it clickable
28
+ const folderHasLink = !!item.slug;
29
+ const folderPath = folderHasLink ? buildUrl(`/docs/custom/${item.slug}`) : undefined;
30
+ const isFolderActive = folderPath && (currentPath === folderPath || currentPath.endsWith(`/${item.slug}`));
31
+
27
32
  return (
28
33
  <div className="py-1">
29
34
  <div className="flex items-center">
@@ -49,26 +54,53 @@ const NestedItem: React.FC<NestedItemProps> = ({
49
54
  </svg>
50
55
  </div>
51
56
  </button>
52
- <button
53
- className="flex items-center px-2 py-1 text-xs font-medium text-[rgb(var(--ec-page-text-muted))] rounded-md hover:bg-[rgb(var(--ec-content-hover))] min-w-0 flex-1"
54
- onClick={(e) => {
55
- e.stopPropagation();
56
- toggleGroupCollapse(`nested-${itemId}`);
57
- }}
58
- >
59
- <span className="truncate">{item.label}</span>
60
- {item.badge && item?.badge?.text && (
61
- <span
62
- className={
63
- item.badge.color
64
- ? `text-${item.badge.color}-600 dark:text-${item.badge.color}-400 ml-2 text-[10px] font-medium bg-${item.badge.color}-50 dark:bg-${item.badge.color}-500/20 px-2 py-0.5 rounded uppercase`
65
- : `text-[rgb(var(--ec-accent))] ml-2 text-[10px] font-medium bg-[rgb(var(--ec-accent-subtle))] px-2 py-0.5 rounded uppercase`
66
- }
67
- >
68
- {item.badge.text}
69
- </span>
70
- )}
71
- </button>
57
+ {folderHasLink ? (
58
+ // Folder has an index file - render as clickable link
59
+ <a
60
+ href={folderPath}
61
+ className={`flex items-center px-2 py-1 text-xs font-medium rounded-md min-w-0 flex-1 ${
62
+ isFolderActive
63
+ ? 'bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-page-text))] font-semibold'
64
+ : 'text-[rgb(var(--ec-page-text-muted))] hover:bg-[rgb(var(--ec-content-hover))]'
65
+ }`}
66
+ data-active={isFolderActive}
67
+ >
68
+ <span className="truncate">{item.label}</span>
69
+ {item.badge && item?.badge?.text && (
70
+ <span
71
+ className={
72
+ item.badge.color
73
+ ? `text-${item.badge.color}-600 dark:text-${item.badge.color}-400 ml-2 text-[10px] font-medium bg-${item.badge.color}-50 dark:bg-${item.badge.color}-500/20 px-2 py-0.5 rounded uppercase`
74
+ : `text-[rgb(var(--ec-accent))] ml-2 text-[10px] font-medium bg-[rgb(var(--ec-accent-subtle))] px-2 py-0.5 rounded uppercase`
75
+ }
76
+ >
77
+ {item.badge.text}
78
+ </span>
79
+ )}
80
+ </a>
81
+ ) : (
82
+ // Folder without index file - render as toggle button
83
+ <button
84
+ className="flex items-center px-2 py-1 text-xs font-medium text-[rgb(var(--ec-page-text-muted))] rounded-md hover:bg-[rgb(var(--ec-content-hover))] min-w-0 flex-1"
85
+ onClick={(e) => {
86
+ e.stopPropagation();
87
+ toggleGroupCollapse(`nested-${itemId}`);
88
+ }}
89
+ >
90
+ <span className="truncate">{item.label}</span>
91
+ {item.badge && item?.badge?.text && (
92
+ <span
93
+ className={
94
+ item.badge.color
95
+ ? `text-${item.badge.color}-600 dark:text-${item.badge.color}-400 ml-2 text-[10px] font-medium bg-${item.badge.color}-50 dark:bg-${item.badge.color}-500/20 px-2 py-0.5 rounded uppercase`
96
+ : `text-[rgb(var(--ec-accent))] ml-2 text-[10px] font-medium bg-[rgb(var(--ec-accent-subtle))] px-2 py-0.5 rounded uppercase`
97
+ }
98
+ >
99
+ {item.badge.text}
100
+ </span>
101
+ )}
102
+ </button>
103
+ )}
72
104
  </div>
73
105
 
74
106
  <div
@@ -47,6 +47,8 @@ const DOCS_DIR = 'docs';
47
47
 
48
48
  /**
49
49
  * Processes auto-generated directory and returns navigation items
50
+ * If an index.mdx or index.md file exists in the directory, it will be used as the
51
+ * folder's link target (making the folder clickable) and excluded from the items list.
50
52
  */
51
53
  const processAutoGeneratedDirectory = async (
52
54
  directory: string,
@@ -58,8 +60,33 @@ const processAutoGeneratedDirectory = async (
58
60
  const items = fs.readdirSync(path.join(process.env.PROJECT_DIR || '', DOCS_DIR, directory));
59
61
 
60
62
  const allItems: SidebarItem[] = [];
63
+ let folderSlug: string | undefined;
64
+
65
+ // Check for index file first (index.mdx or index.md)
66
+ const indexFile = items.find((item: string) => item === 'index.mdx' || item === 'index.md');
67
+
68
+ if (indexFile) {
69
+ const indexPath = path.join(process.env.PROJECT_DIR || '', DOCS_DIR, directory, indexFile);
70
+ const content = fs.readFileSync(indexPath, 'utf8');
71
+ const { data } = matter(content);
72
+
73
+ // Normalize path separators for cross-platform compatibility
74
+ // Note: Astro's glob loader strips '/index' from the ID, so docs/foo/index.mdx becomes docs/foo
75
+ const astroId = data.slug || path.join(DOCS_DIR, directory).replace(/\\/g, '/');
76
+ const entry = await getEntry('customPages', astroId.toLowerCase());
77
+
78
+ if (entry) {
79
+ // Use the index file's slug as the folder's link target
80
+ folderSlug = entry.data.slug || entry.id.replace(DOCS_DIR, '');
81
+ }
82
+ }
61
83
 
62
84
  for (const item of items) {
85
+ // Skip index files - they're used for the folder link, not as child items
86
+ if (item === 'index.mdx' || item === 'index.md') {
87
+ continue;
88
+ }
89
+
63
90
  const fullPath = path.join(process.env.PROJECT_DIR || '', DOCS_DIR, directory, item);
64
91
  const isDirectory = fs.statSync(fullPath).isDirectory();
65
92
 
@@ -71,8 +98,8 @@ const processAutoGeneratedDirectory = async (
71
98
  undefined, // No badge for subdirectories
72
99
  collapsed // Inherit collapsed state
73
100
  );
74
- // Only add the directory if it contains valid items (mdx/md files)
75
- if (subdirResult.items && subdirResult.items.length > 0) {
101
+ // Only add the directory if it contains valid items (mdx/md files) or has a slug (index file)
102
+ if ((subdirResult.items && subdirResult.items.length > 0) || subdirResult.slug) {
76
103
  allItems.push(subdirResult);
77
104
  }
78
105
  } else {
@@ -81,7 +108,8 @@ const processAutoGeneratedDirectory = async (
81
108
  const { data } = matter(content);
82
109
 
83
110
  // Normalize path separators to forward slashes for cross-platform compatibility (Windows uses backslashes)
84
- const astroId = data.slug || path.join(DOCS_DIR, directory, item).replace('.mdx', '').replace(/\\/g, '/');
111
+ const astroId =
112
+ data.slug || path.join(DOCS_DIR, directory, item).replace('.mdx', '').replace('.md', '').replace(/\\/g, '/');
85
113
  const entry = await getEntry('customPages', astroId.toLowerCase());
86
114
 
87
115
  if (entry) {
@@ -97,6 +125,7 @@ const processAutoGeneratedDirectory = async (
97
125
  label,
98
126
  badge,
99
127
  collapsed,
128
+ ...(folderSlug && { slug: folderSlug }),
100
129
  items: allItems,
101
130
  };
102
131
  };
@@ -283,7 +283,8 @@ function createMcpServer() {
283
283
  if (!toolConfig || typeof toolConfig !== 'object') continue;
284
284
 
285
285
  // Extract tool properties (Vercel AI SDK format)
286
- const { description, parameters, execute } = toolConfig;
286
+ // The AI SDK tool() helper uses "inputSchema" for Zod schemas
287
+ const { description, parameters, inputSchema, execute } = toolConfig;
287
288
 
288
289
  if (!description || !execute) {
289
290
  console.warn(`[MCP] Skipping invalid extended tool: ${toolName}`);
@@ -294,7 +295,7 @@ function createMcpServer() {
294
295
  toolName,
295
296
  {
296
297
  description: description || `Custom tool: ${toolName}`,
297
- inputSchema: parameters || z.object({}),
298
+ inputSchema: inputSchema || parameters || z.object({}),
298
299
  },
299
300
  async (params: any) => {
300
301
  try {
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.12.0",
9
+ "version": "3.12.2",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -90,7 +90,7 @@
90
90
  "react": "^18.3.1",
91
91
  "react-dom": "^18.3.1",
92
92
  "react-markdown": "^10.1.0",
93
- "react-syntax-highlighter": "^16.1.0",
93
+ "react-syntax-highlighter": "^15.6.6",
94
94
  "rehype-autolink-headings": "^7.1.0",
95
95
  "rehype-expressive-code": "^0.41.3",
96
96
  "rehype-raw": "^7.0.0",