@eventcatalog/core 3.0.0-beta.9 → 3.1.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.
Files changed (197) hide show
  1. package/README.md +41 -98
  2. package/dist/__mocks__/astro-content.cjs +32 -0
  3. package/dist/__mocks__/astro-content.d.cts +13 -0
  4. package/dist/__mocks__/astro-content.d.ts +13 -0
  5. package/dist/__mocks__/astro-content.js +7 -0
  6. package/dist/analytics/analytics.cjs +1 -1
  7. package/dist/analytics/analytics.js +2 -2
  8. package/dist/analytics/log-build.cjs +1 -1
  9. package/dist/analytics/log-build.js +3 -3
  10. package/dist/catalog-to-astro-content-directory.cjs +2 -19
  11. package/dist/catalog-to-astro-content-directory.d.cts +1 -2
  12. package/dist/catalog-to-astro-content-directory.d.ts +1 -2
  13. package/dist/catalog-to-astro-content-directory.js +3 -5
  14. package/dist/{chunk-RAJ7TGWN.js → chunk-2WGZFERB.js} +1 -1
  15. package/dist/{chunk-R2BJ7MJG.js → chunk-6Z6ARMQS.js} +1 -17
  16. package/dist/{chunk-TC3R47V6.js → chunk-ESUL7UE6.js} +1 -1
  17. package/dist/{chunk-2VPX4WIJ.js → chunk-I3CW5KQI.js} +1 -1
  18. package/dist/{chunk-TT4LZO2Q.js → chunk-KBO4IL2D.js} +1 -1
  19. package/dist/{chunk-A4MGWK5T.js → chunk-URR33SNK.js} +1 -1
  20. package/dist/constants.cjs +1 -1
  21. package/dist/constants.js +1 -1
  22. package/dist/eventcatalog.cjs +20 -64
  23. package/dist/eventcatalog.config.d.cts +11 -0
  24. package/dist/eventcatalog.config.d.ts +11 -0
  25. package/dist/eventcatalog.js +26 -52
  26. package/dist/generate.cjs +1 -1
  27. package/dist/generate.js +3 -3
  28. package/dist/utils/cli-logger.cjs +1 -1
  29. package/dist/utils/cli-logger.js +2 -2
  30. package/eventcatalog/astro.config.mjs +4 -1
  31. package/eventcatalog/integrations/eventcatalog-features.ts +69 -0
  32. package/eventcatalog/public/icons/asyncapi-black.svg +2 -0
  33. package/eventcatalog/public/icons/graphql-black.svg +1 -0
  34. package/eventcatalog/public/icons/openapi-black.svg +1 -0
  35. package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +1010 -0
  36. package/eventcatalog/src/components/ChatPanel/ChatPanelButton.tsx +24 -0
  37. package/eventcatalog/src/components/Checkbox.astro +7 -4
  38. package/eventcatalog/src/components/CopyAsMarkdown.tsx +15 -15
  39. package/eventcatalog/src/components/EnvironmentDropdown.tsx +15 -7
  40. package/eventcatalog/src/components/FavoriteButton.tsx +1 -1
  41. package/eventcatalog/src/components/Grids/DomainGrid.tsx +322 -173
  42. package/eventcatalog/src/components/Grids/MessageGrid.tsx +317 -178
  43. package/eventcatalog/src/components/Grids/specification-utils.ts +106 -0
  44. package/eventcatalog/src/components/Header.astro +40 -15
  45. package/eventcatalog/src/components/Lists/OwnersList.tsx +17 -10
  46. package/eventcatalog/src/components/Lists/PillListFlat.styles.css +12 -0
  47. package/eventcatalog/src/components/Lists/PillListFlat.tsx +15 -15
  48. package/eventcatalog/src/components/Lists/VersionList.astro +15 -5
  49. package/eventcatalog/src/components/MDX/Accordion/Accordion.tsx +3 -3
  50. package/eventcatalog/src/components/MDX/Admonition.tsx +49 -9
  51. package/eventcatalog/src/components/MDX/Attachments.astro +15 -11
  52. package/eventcatalog/src/components/MDX/ChannelInformation/ChannelInformation.tsx +29 -15
  53. package/eventcatalog/src/components/MDX/EntityPropertiesTable/EntityPropertiesTable.astro +20 -13
  54. package/eventcatalog/src/components/MDX/Link/Link.astro +1 -1
  55. package/eventcatalog/src/components/MDX/MessageTable/MessageTable.client.tsx +50 -29
  56. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.tsx +28 -15
  57. package/eventcatalog/src/components/MDX/NodeGraph/StepWalkthrough.tsx +4 -4
  58. package/eventcatalog/src/components/MDX/NodeGraph/StudioModal.tsx +4 -4
  59. package/eventcatalog/src/components/MDX/NodeGraph/VisualiserSearch.tsx +2 -2
  60. package/eventcatalog/src/components/MDX/ResourceGroupTable/ResourceGroupTable.client.tsx +54 -33
  61. package/eventcatalog/src/components/MDX/ResourceLink/ResourceLink.astro +1 -1
  62. package/eventcatalog/src/components/MDX/Steps/Step.astro +2 -2
  63. package/eventcatalog/src/components/MDX/Steps/Steps.astro +3 -3
  64. package/eventcatalog/src/components/MDX/Tabs/Tabs.astro +13 -9
  65. package/eventcatalog/src/components/MDX/Tiles/Tile.astro +25 -13
  66. package/eventcatalog/src/components/MDX/Tiles/Tiles.astro +1 -1
  67. package/eventcatalog/src/components/SchemaExplorer/ApiAccessSection.tsx +95 -90
  68. package/eventcatalog/src/components/SchemaExplorer/ApiContentViewer.tsx +144 -0
  69. package/eventcatalog/src/components/SchemaExplorer/AvroSchemaViewer.tsx +29 -25
  70. package/eventcatalog/src/components/SchemaExplorer/DiffViewer.tsx +3 -3
  71. package/eventcatalog/src/components/SchemaExplorer/JSONSchemaViewer.tsx +61 -42
  72. package/eventcatalog/src/components/SchemaExplorer/OwnersSection.tsx +13 -9
  73. package/eventcatalog/src/components/SchemaExplorer/Pagination.tsx +36 -8
  74. package/eventcatalog/src/components/SchemaExplorer/ProducersConsumersSection.tsx +17 -13
  75. package/eventcatalog/src/components/SchemaExplorer/SchemaContentViewer.tsx +37 -10
  76. package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsHeader.tsx +152 -109
  77. package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +6 -15
  78. package/eventcatalog/src/components/SchemaExplorer/SchemaExplorer.tsx +257 -61
  79. package/eventcatalog/src/components/SchemaExplorer/SchemaFilters.tsx +64 -126
  80. package/eventcatalog/src/components/SchemaExplorer/SchemaListItem.tsx +53 -43
  81. package/eventcatalog/src/components/SchemaExplorer/SchemaViewerModal.tsx +8 -8
  82. package/eventcatalog/src/components/Search/Search.astro +5 -5
  83. package/eventcatalog/src/components/Search/SearchDataLoader.astro +25 -0
  84. package/eventcatalog/src/components/Search/SearchModal.tsx +65 -36
  85. package/eventcatalog/src/components/SideNav/NestedSideBar/SearchBar.tsx +37 -24
  86. package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +117 -56
  87. package/eventcatalog/src/components/SideNav/SideNav.astro +0 -15
  88. package/eventcatalog/src/components/Tables/Table.tsx +97 -77
  89. package/eventcatalog/src/components/Tables/columns/ContainersTableColumns.tsx +114 -74
  90. package/eventcatalog/src/components/Tables/columns/DomainTableColumns.tsx +77 -55
  91. package/eventcatalog/src/components/Tables/columns/FlowTableColumns.tsx +36 -36
  92. package/eventcatalog/src/components/Tables/columns/MessageTableColumns.tsx +116 -77
  93. package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +111 -94
  94. package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +31 -26
  95. package/eventcatalog/src/components/Tables/columns/TeamsTableColumns.tsx +123 -215
  96. package/eventcatalog/src/components/Tables/columns/UserTableColumns.tsx +156 -243
  97. package/eventcatalog/src/components/ThemeToggle.tsx +18 -0
  98. package/eventcatalog/src/content.config.ts +1 -13
  99. package/eventcatalog/src/enterprise/ai/chat-api.ts +360 -0
  100. package/eventcatalog/src/enterprise/auth/[...auth].ts +3 -0
  101. package/eventcatalog/src/enterprise/auth/login.astro +420 -0
  102. package/eventcatalog/src/enterprise/collections/index.ts +0 -1
  103. package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/components/NestedItem.tsx +15 -7
  104. package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/components/NoResultsFound.tsx +2 -2
  105. package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/index.tsx +19 -15
  106. package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +50 -17
  107. package/eventcatalog/src/layouts/DirectoryLayout.astro +11 -6
  108. package/eventcatalog/src/layouts/DiscoverLayout.astro +13 -8
  109. package/eventcatalog/src/layouts/Footer.astro +14 -11
  110. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +187 -123
  111. package/eventcatalog/src/pages/_index.astro +213 -573
  112. package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/_index.data.ts +8 -2
  113. package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/index.astro +9 -5
  114. package/eventcatalog/src/pages/directory/[type]/index.astro +6 -0
  115. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +19 -3
  116. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +7 -7
  117. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +5 -5
  118. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +81 -64
  119. package/eventcatalog/src/pages/docs/[type]/[id]/language/[dictionaryId]/index.astro +23 -24
  120. package/eventcatalog/src/pages/docs/[type]/[id]/language/index.astro +214 -125
  121. package/eventcatalog/src/pages/docs/custom/index.astro +2 -2
  122. package/eventcatalog/src/pages/docs/teams/[id]/index.astro +98 -70
  123. package/eventcatalog/src/pages/docs/teams/[id].mdx.ts +36 -0
  124. package/eventcatalog/src/pages/docs/users/[id]/index.astro +60 -45
  125. package/eventcatalog/src/pages/docs/users/[id].mdx.ts +36 -0
  126. package/eventcatalog/src/pages/schemas/explorer/_index.data.ts +178 -0
  127. package/eventcatalog/src/pages/schemas/explorer/index.astro +7 -157
  128. package/eventcatalog/src/pages/studio.astro +155 -75
  129. package/eventcatalog/src/remark-plugins/directives.ts +36 -15
  130. package/eventcatalog/src/remark-plugins/mermaid.ts +2 -2
  131. package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/container.ts +10 -1
  132. package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/domain.ts +17 -7
  133. package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/message.ts +10 -1
  134. package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/service.ts +11 -4
  135. package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/shared.ts +14 -0
  136. package/eventcatalog/src/stores/{sidebar-store.ts → sidebar-store/index.ts} +1 -1
  137. package/eventcatalog/src/stores/theme-store.ts +93 -0
  138. package/eventcatalog/src/styles/theme.css +255 -0
  139. package/eventcatalog/src/styles/themes/forest.css +230 -0
  140. package/eventcatalog/src/styles/themes/ocean.css +235 -0
  141. package/eventcatalog/src/styles/themes/sapphire.css +230 -0
  142. package/eventcatalog/src/styles/themes/sunset.css +230 -0
  143. package/eventcatalog/src/utils/collections/channels.ts +0 -2
  144. package/eventcatalog/src/utils/collections/commands.ts +0 -2
  145. package/eventcatalog/src/utils/collections/containers.ts +0 -2
  146. package/eventcatalog/src/utils/collections/domains.ts +0 -2
  147. package/eventcatalog/src/utils/collections/entities.ts +0 -2
  148. package/eventcatalog/src/utils/collections/events.ts +0 -2
  149. package/eventcatalog/src/utils/collections/flows.ts +0 -2
  150. package/eventcatalog/src/utils/collections/queries.ts +0 -2
  151. package/eventcatalog/src/utils/collections/schemas.ts +45 -7
  152. package/eventcatalog/src/utils/collections/services.ts +0 -2
  153. package/eventcatalog/src/utils/feature.ts +13 -5
  154. package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +1 -1
  155. package/eventcatalog/src/utils/resource-files.ts +86 -0
  156. package/eventcatalog/tailwind.config.mjs +6 -3
  157. package/package.json +12 -15
  158. package/default-files-for-collections/changelogs.md +0 -5
  159. package/default-files-for-collections/channels.md +0 -8
  160. package/default-files-for-collections/commands.md +0 -8
  161. package/default-files-for-collections/domains.md +0 -8
  162. package/default-files-for-collections/events.md +0 -8
  163. package/default-files-for-collections/flows.md +0 -11
  164. package/default-files-for-collections/queries.md +0 -8
  165. package/default-files-for-collections/services.md +0 -8
  166. package/default-files-for-collections/ubiquitousLanguages.md +0 -7
  167. package/eventcatalog/src/enterprise/collections/chat-prompts.ts +0 -32
  168. package/eventcatalog/src/enterprise/eventcatalog-chat/components/Chat.tsx +0 -60
  169. package/eventcatalog/src/enterprise/eventcatalog-chat/components/ChatMessage.tsx +0 -414
  170. package/eventcatalog/src/enterprise/eventcatalog-chat/components/ChatSidebar.tsx +0 -169
  171. package/eventcatalog/src/enterprise/eventcatalog-chat/components/InputModal.tsx +0 -244
  172. package/eventcatalog/src/enterprise/eventcatalog-chat/components/MentionInput.tsx +0 -211
  173. package/eventcatalog/src/enterprise/eventcatalog-chat/components/WelcomePromptArea.tsx +0 -176
  174. package/eventcatalog/src/enterprise/eventcatalog-chat/components/default-prompts.ts +0 -93
  175. package/eventcatalog/src/enterprise/eventcatalog-chat/components/hooks/ChatProvider.tsx +0 -143
  176. package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.server.tsx +0 -387
  177. package/eventcatalog/src/enterprise/eventcatalog-chat/pages/api/chat.ts +0 -59
  178. package/eventcatalog/src/enterprise/eventcatalog-chat/pages/chat/index.astro +0 -104
  179. package/eventcatalog/src/enterprise/eventcatalog-chat/providers/ai-provider.ts +0 -140
  180. package/eventcatalog/src/enterprise/eventcatalog-chat/providers/anthropic.ts +0 -28
  181. package/eventcatalog/src/enterprise/eventcatalog-chat/providers/google.ts +0 -41
  182. package/eventcatalog/src/enterprise/eventcatalog-chat/providers/index.ts +0 -26
  183. package/eventcatalog/src/enterprise/eventcatalog-chat/providers/openai.ts +0 -61
  184. package/eventcatalog/src/enterprise/eventcatalog-chat/utils/chat-prompts.ts +0 -50
  185. package/eventcatalog/src/pages/auth/login.astro +0 -280
  186. package/eventcatalog/src/pages/chat/feature.astro +0 -179
  187. package/eventcatalog/src/pages/chat/index.astro +0 -10
  188. package/eventcatalog/src/pages/docs/_default-docs.mdx +0 -25
  189. package/eventcatalog/src/pages/docs/index.astro +0 -33
  190. package/eventcatalog/src/pages/nav-index.json.ts +0 -30
  191. /package/eventcatalog/src/{pages → enterprise}/auth/error.astro +0 -0
  192. /package/eventcatalog/src/{middleware-auth.ts → enterprise/auth/middleware/middleware-auth.ts} +0 -0
  193. /package/eventcatalog/src/{middleware.ts → enterprise/auth/middleware/middleware.ts} +0 -0
  194. /package/eventcatalog/src/{pages/unauthorized/index.astro → enterprise/auth/unauthorized.astro} +0 -0
  195. /package/eventcatalog/src/{pages → enterprise}/plans/index.astro +0 -0
  196. /package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/flow.ts +0 -0
  197. /package/eventcatalog/src/{components/SideNav/NestedSideBar/sidebar-builder.ts → stores/sidebar-store/state.ts} +0 -0
@@ -11,9 +11,9 @@
11
11
  * 3. Follow the official activation instructions
12
12
  */
13
13
 
14
- import config from '@config';
15
14
  import fs from 'fs';
16
15
  import { join } from 'path';
16
+ import config from '../../eventcatalog.config.js';
17
17
 
18
18
  // These functions check for valid, legally obtained access to premium features
19
19
  export const isEventCatalogStarterEnabled = () => process.env.EVENTCATALOG_STARTER === 'true';
@@ -39,23 +39,31 @@ export const showCustomBranding = () => {
39
39
  export const isChangelogEnabled = () => config?.changelog?.enabled ?? false;
40
40
 
41
41
  export const isCustomDocsEnabled = () => isEventCatalogStarterEnabled() || isEventCatalogScaleEnabled();
42
+
42
43
  export const isEventCatalogChatEnabled = () => {
43
44
  const isFeatureEnabledFromPlan = isEventCatalogStarterEnabled() || isEventCatalogScaleEnabled();
44
- return isFeatureEnabledFromPlan && config?.chat?.enabled && isSSR();
45
+ const directory = process.env.PROJECT_DIR || process.cwd();
46
+ const hasChatConfigurationFile = fs.existsSync(join(directory, 'eventcatalog.chat.js'));
47
+ return isFeatureEnabledFromPlan && hasChatConfigurationFile && isSSR();
45
48
  };
46
49
 
47
50
  export const isEventCatalogUpgradeEnabled = () => !isEventCatalogStarterEnabled() && !isEventCatalogScaleEnabled();
48
51
  export const isCustomLandingPageEnabled = () => isEventCatalogStarterEnabled() || isEventCatalogScaleEnabled();
49
52
 
50
53
  export const isMarkdownDownloadEnabled = () => config?.llmsTxt?.enabled ?? false;
51
- export const isLLMSTxtEnabled = () => (config?.llmsTxt?.enabled || isEventCatalogChatEnabled()) ?? false;
54
+ export const isLLMSTxtEnabled = () => (config?.llmsTxt?.enabled || isEventCatalogChatEnabled()) ?? true;
52
55
 
53
56
  export const isAuthEnabled = () => {
57
+ const isAuthEnabledInCatalog = config?.auth?.enabled ?? false;
54
58
  const directory = process.env.PROJECT_DIR || process.cwd();
55
- const hasAuthConfig = fs.existsSync(join(directory, 'eventcatalog.auth.js'));
56
- return (hasAuthConfig && isSSR() && isEventCatalogScaleEnabled()) || false;
59
+ const hasAuthConfigurationFile = fs.existsSync(join(directory, 'eventcatalog.auth.js'));
60
+ return (isAuthEnabledInCatalog && hasAuthConfigurationFile && isSSR() && isEventCatalogScaleEnabled()) || false;
57
61
  };
58
62
 
59
63
  export const isSSR = () => config?.output === 'server';
60
64
  export const isRSSEnabled = () => config?.rss?.enabled ?? false;
61
65
  export const isVisualiserEnabled = () => config?.visualiser?.enabled ?? true;
66
+
67
+ export const isCustomStylesEnabled = () => {
68
+ return isEventCatalogStarterEnabled() || isEventCatalogScaleEnabled();
69
+ };
@@ -292,7 +292,7 @@ export const getNodesAndEdges = async ({
292
292
  const uniqueEdges = edges.reduce((acc: any[], edge: any) => {
293
293
  const existingEdge = acc.find((e: any) => e.id === edge.id);
294
294
  if (existingEdge) {
295
- existingEdge.label = `${existingEdge.label} & ${edge.label}`;
295
+ // existingEdge.label = `${existingEdge.label} & ${edge.label}`;
296
296
  // Add the custom colors to the existing edge which can be an array of strings
297
297
  const value = Array.isArray(edge.data.customColor) ? edge.data.customColor : [edge.data.customColor];
298
298
  const existingValue = Array.isArray(existingEdge.data.customColor)
@@ -0,0 +1,86 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { isSSR } from '@utils/feature';
4
+
5
+ /**
6
+ * Get the absolute base path for a resource item.
7
+ *
8
+ * In SSR mode, filePath is relative to the Astro core directory (e.g., "../examples/default/domains/...").
9
+ * We need to resolve it using PROJECT_DIR to get the correct absolute path.
10
+ *
11
+ * In static mode, filePath is resolved correctly by Astro's build context.
12
+ *
13
+ * @param item - The resource item with a filePath property
14
+ * @returns The absolute path to the directory containing the resource
15
+ */
16
+ export function getResourceBasePath(item: { filePath?: string }): string {
17
+ if (!item.filePath) {
18
+ return '';
19
+ }
20
+
21
+ const filePath = item.filePath;
22
+
23
+ // In SSR mode, we need to resolve the relative path using PROJECT_DIR
24
+ if (isSSR()) {
25
+ const PROJECT_DIR = process.env.PROJECT_DIR || '';
26
+
27
+ if (PROJECT_DIR) {
28
+ // Get the project folder name from PROJECT_DIR (e.g., "default" from ".../examples/default")
29
+ const projectFolderName = path.basename(PROJECT_DIR);
30
+
31
+ // Find the project folder in the relative path and extract everything after it
32
+ // Pattern: ../examples/default/domains/... -> domains/...
33
+ const regex = new RegExp(`.*?${projectFolderName}/(.+)$`);
34
+ const match = filePath.match(regex);
35
+
36
+ if (match && match[1]) {
37
+ // Join PROJECT_DIR with the relative path within the project
38
+ return path.join(PROJECT_DIR, path.dirname(match[1]));
39
+ }
40
+ }
41
+ }
42
+
43
+ // Static mode: resolve directly using Astro's build context
44
+ return path.dirname(path.resolve(filePath));
45
+ }
46
+
47
+ /**
48
+ * Get the absolute path to a file within a resource directory.
49
+ *
50
+ * @param item - The resource item with a filePath property
51
+ * @param relativePath - The relative path to the file (e.g., "schema.json")
52
+ * @returns The absolute path to the file
53
+ */
54
+ export function getResourceFilePath(item: { filePath?: string }, relativePath: string): string {
55
+ const basePath = getResourceBasePath(item);
56
+ return path.join(basePath, relativePath);
57
+ }
58
+
59
+ /**
60
+ * Check if a file exists within a resource directory.
61
+ *
62
+ * @param item - The resource item with a filePath property
63
+ * @param relativePath - The relative path to the file (e.g., "schema.json")
64
+ * @returns True if the file exists, false otherwise
65
+ */
66
+ export function resourceFileExists(item: { filePath?: string }, relativePath: string): boolean {
67
+ const filePath = getResourceFilePath(item, relativePath);
68
+ return fs.existsSync(filePath);
69
+ }
70
+
71
+ /**
72
+ * Read a file from a resource directory.
73
+ *
74
+ * @param item - The resource item with a filePath property
75
+ * @param relativePath - The relative path to the file (e.g., "schema.json")
76
+ * @returns The file content as a string, or null if the file doesn't exist
77
+ */
78
+ export function readResourceFile(item: { filePath?: string }, relativePath: string): string | null {
79
+ const filePath = getResourceFilePath(item, relativePath);
80
+
81
+ if (!fs.existsSync(filePath)) {
82
+ return null;
83
+ }
84
+
85
+ return fs.readFileSync(filePath, 'utf-8');
86
+ }
@@ -6,6 +6,7 @@ const theme = config.theme || {};
6
6
 
7
7
  /** @type {import('tailwindcss').Config} */
8
8
  export default {
9
+ darkMode: ['selector', '[data-theme="dark"]'],
9
10
  content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
10
11
  theme: {
11
12
  extend: {
@@ -51,11 +52,13 @@ export default {
51
52
  },
52
53
  },
53
54
  safelist: [
54
- { pattern: /border-.*-(200|400|500)/ },
55
- { pattern: /bg-.*-(100|200|400|500)/ },
55
+ { pattern: /border-.*-(200|400|500)/, variants: ['dark', 'hover', 'dark:hover'] },
56
+ { pattern: /bg-.*-(100|200|400|500)/, variants: ['dark'] },
57
+ { pattern: /bg-.*-500\/(10|20)/, variants: ['dark'] },
56
58
  { pattern: /from-.*-(100|200|300|400|500|600|700)/ },
57
59
  { pattern: /to-.*-(100|200|300|400|500|600|700)/ },
58
- { pattern: /text-.*-(400|500|800)/ },
60
+ { pattern: /text-.*-(300|400|500|800)/, variants: ['dark', 'group-hover', 'dark:group-hover'] },
61
+ { pattern: /ring-.*-500\/30/, variants: ['dark'] },
59
62
  'border-blue-200',
60
63
  'border-green-300',
61
64
  'bg-blue-600',
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.0.0-beta.9",
9
+ "version": "3.1.0",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -17,16 +17,12 @@
17
17
  "eventcatalog/",
18
18
  "!eventcatalog/**/__tests__/",
19
19
  "bin/",
20
- "dist/",
21
- "default-files-for-collections/"
20
+ "dist/"
22
21
  ],
23
22
  "dependencies": {
24
- "@ai-sdk/anthropic": "^2.0.23",
25
- "@ai-sdk/google": "^2.0.17",
26
- "@ai-sdk/openai": "^2.0.42",
27
23
  "@ai-sdk/react": "^2.0.60",
28
- "@astrojs/markdown-remark": "^6.3.9",
29
- "@astrojs/mdx": "^4.3.12",
24
+ "@astrojs/markdown-remark": "^6.3.10",
25
+ "@astrojs/mdx": "^4.3.13",
30
26
  "@astrojs/node": "^9.5.1",
31
27
  "@astrojs/react": "^4.4.2",
32
28
  "@astrojs/rss": "^4.0.14",
@@ -38,7 +34,7 @@
38
34
  "@eventcatalog/generator-ai": "^1.1.0",
39
35
  "@eventcatalog/license": "^0.0.7",
40
36
  "@eventcatalog/linter": "^0.0.2",
41
- "@eventcatalog/sdk": "^2.9.2",
37
+ "@eventcatalog/sdk": "^2.9.9",
42
38
  "@eventcatalog/visualizer": "^0.0.6",
43
39
  "@fontsource/inter": "^5.2.5",
44
40
  "@headlessui/react": "^2.0.3",
@@ -50,6 +46,7 @@
50
46
  "@radix-ui/react-context-menu": "^2.2.6",
51
47
  "@radix-ui/react-dialog": "^1.1.6",
52
48
  "@radix-ui/react-dropdown-menu": "^2.1.12",
49
+ "@radix-ui/react-popover": "^1.1.15",
53
50
  "@radix-ui/react-tooltip": "^1.1.8",
54
51
  "@scalar/api-reference-react": "^0.4.37",
55
52
  "@tailwindcss/typography": "^0.5.13",
@@ -57,7 +54,7 @@
57
54
  "@tanstack/react-table": "^8.17.3",
58
55
  "@xyflow/react": "^12.3.6",
59
56
  "ai": "^5.0.60",
60
- "astro": "^5.16.4",
57
+ "astro": "^5.16.6",
61
58
  "astro-compress": "^2.3.8",
62
59
  "astro-expressive-code": "^0.41.3",
63
60
  "astro-seo": "^0.8.4",
@@ -76,16 +73,15 @@
76
73
  "glob": "^10.5.0",
77
74
  "gray-matter": "^4.0.3",
78
75
  "html-to-image": "^1.11.11",
79
- "js-yaml": "^4.1.0",
76
+ "js-yaml": "^4.1.1",
80
77
  "jsonpath": "^1.1.1",
81
78
  "jsonwebtoken": "^9.0.2",
82
79
  "lodash.debounce": "^4.0.8",
83
80
  "lodash.merge": "4.6.2",
84
81
  "lucide-react": "^0.453.0",
85
82
  "marked": "^15.0.6",
86
- "mermaid": "^11.4.1",
83
+ "mermaid": "^11.12.1",
87
84
  "nanostores": "^1.1.0",
88
- "pagefind": "^1.3.0",
89
85
  "pako": "^2.1.0",
90
86
  "picocolors": "^1.1.1",
91
87
  "react": "^18.3.1",
@@ -94,13 +90,14 @@
94
90
  "react-syntax-highlighter": "^16.1.0",
95
91
  "rehype-autolink-headings": "^7.1.0",
96
92
  "rehype-expressive-code": "^0.41.3",
93
+ "rehype-raw": "^7.0.0",
97
94
  "rehype-slug": "^6.0.0",
98
95
  "remark-comment": "^1.0.0",
99
96
  "remark-directive": "^3.0.0",
100
97
  "remark-gfm": "^3.0.1",
101
98
  "rimraf": "^5.0.7",
102
99
  "semver": "7.6.3",
103
- "shelljs": "^0.8.5",
100
+ "shelljs": "^0.9.0",
104
101
  "tailwindcss": "^3.4.3",
105
102
  "tw-animate-css": "^1.4.0",
106
103
  "typescript": "^5.4.5",
@@ -147,7 +144,7 @@
147
144
  "preview": "astro preview",
148
145
  "astro": "astro",
149
146
  "start:catalog": "node scripts/start-catalog-locally.js",
150
- "pagefind": "node scripts/pagefind.js",
147
+ "start:catalog:server": "node scripts/start-server-locally.js",
151
148
  "preview:catalog": "node scripts/preview-catalog-locally.js",
152
149
  "generate:catalog": "node scripts/generate-catalog-locally.js",
153
150
  "verify-build:catalog": "rimraf dist && pnpm run build:cd",
@@ -1,5 +0,0 @@
1
- ---
2
- id: empty
3
- ---
4
-
5
- <!-- Do not delete this file, required for EC, you an ignore this file -->
@@ -1,8 +0,0 @@
1
- ---
2
- id: empty
3
- name: empty
4
- version: 0.0.1
5
- hidden: true
6
- ---
7
-
8
- <!-- Do not delete this file, required for EC, you an ignore this file -->
@@ -1,8 +0,0 @@
1
- ---
2
- id: empty
3
- name: empty
4
- version: 0.0.1
5
- hidden: true
6
- ---
7
-
8
- <!-- Do not delete this file, required for EC, you an ignore this file -->
@@ -1,8 +0,0 @@
1
- ---
2
- id: empty
3
- name: empty
4
- version: 0.0.1
5
- hidden: true
6
- ---
7
-
8
- <!-- Do not delete this file, required for EC, you an ignore this file -->
@@ -1,8 +0,0 @@
1
- ---
2
- id: empty
3
- name: empty
4
- version: 0.0.1
5
- hidden: true
6
- ---
7
-
8
- <!-- Do not delete this file, required for EC, you an ignore this file -->
@@ -1,11 +0,0 @@
1
- ---
2
- id: empty
3
- steps:
4
- - id: "empty"
5
- title: "empty"
6
- name: empty
7
- version: 0.0.1
8
- hidden: true
9
- ---
10
-
11
- <!-- Do not delete this file, required for EC, you an ignore this file -->
@@ -1,8 +0,0 @@
1
- ---
2
- id: empty
3
- name: empty
4
- version: 0.0.1
5
- hidden: true
6
- ---
7
-
8
- <!-- Do not delete this file, required for EC, you an ignore this file -->
@@ -1,8 +0,0 @@
1
- ---
2
- id: empty
3
- name: empty
4
- version: 0.0.1
5
- hidden: true
6
- ---
7
-
8
- <!-- Do not delete this file, required for EC, you an ignore this file -->
@@ -1,7 +0,0 @@
1
- ---
2
- id: ubiquitous-language
3
- name: Ubiquitous Language
4
- summary: A shared language used by all team members to communicate about the system.
5
- description: A shared language used by all team members to communicate about the system.
6
- ---
7
- <!-- Do not delete this file, required for EC, you an ignore this file -->
@@ -1,32 +0,0 @@
1
- import { z } from 'astro:content';
2
-
3
- export const chatPromptsSchema = z.object({
4
- title: z.string(),
5
- type: z.enum(['text', 'code']).default('text'),
6
- inputs: z
7
- .array(
8
- z.object({
9
- id: z.string(),
10
- label: z.string(),
11
- type: z
12
- .enum([
13
- 'text',
14
- 'resource-list-events',
15
- 'resource-list-services',
16
- 'resource-list-commands',
17
- 'resource-list-queries',
18
- 'code',
19
- 'text-area',
20
- 'select',
21
- ])
22
- .default('text'),
23
- options: z.array(z.string()).optional(),
24
- })
25
- )
26
- .optional(),
27
- category: z.object({
28
- id: z.string(),
29
- label: z.string(),
30
- icon: z.string().optional(),
31
- }),
32
- });
@@ -1,60 +0,0 @@
1
- import Sidebar from './ChatSidebar';
2
- import { ChatProvider } from './hooks/ChatProvider';
3
- import ChatWindowServer from './windows/ChatWindow.server';
4
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
5
- import type { ChatPromptCategoryGroup } from '@enterprise/eventcatalog-chat/utils/chat-prompts';
6
- interface Resource {
7
- id: string;
8
- type: string;
9
- name: string;
10
- }
11
-
12
- /**
13
- * Chat component has two modes:
14
- * - Server: ChatWindow.server.tsx (uses server-side code, bring your own API key)
15
- *
16
- * The mode is determined by the config.output property in the eventcatalog.config.js file.
17
- */
18
-
19
- const Chat = ({
20
- chatConfig,
21
- resources,
22
- chatPrompts,
23
- output,
24
- }: {
25
- chatConfig: any;
26
- resources: Resource[];
27
- chatPrompts: ChatPromptCategoryGroup[];
28
- output: 'static' | 'server';
29
- }) => {
30
- const queryClient = new QueryClient();
31
-
32
- if (output !== 'server') {
33
- return (
34
- // Message to turn on server side
35
- <div className="flex justify-center items-center h-full bg-gray-100 p-4 rounded-lg text-center">
36
- <div className="space-y-4">
37
- <h1 className="text-3xl font-semibold text-gray-800">Chat is only supported on server side</h1>
38
- <p className="text-sm text-gray-500">
39
- Please switch to server side by setting the <code className="font-mono bg-gray-100 p-0.5 rounded">output</code>{' '}
40
- property to <code className="font-mono bg-gray-100 p-0.5 rounded">server</code> in your{' '}
41
- <code className="font-mono bg-gray-100 p-0.5 rounded">eventcatalog.config.js</code> file.
42
- </p>
43
- </div>
44
- </div>
45
- );
46
- }
47
-
48
- return (
49
- <ChatProvider>
50
- <div className="flex overflow-hidden w-full">
51
- <Sidebar />
52
- <QueryClientProvider client={queryClient}>
53
- <ChatWindowServer {...chatConfig} resources={resources} chatPrompts={chatPrompts} />
54
- </QueryClientProvider>
55
- </div>
56
- </ChatProvider>
57
- );
58
- };
59
-
60
- export default Chat;