@eventcatalog/core 2.14.3 → 2.16.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 (232) hide show
  1. package/README.md +2 -1
  2. package/bin/eventcatalog.js +2 -0
  3. package/default-files-for-collections/ubiquitousLanguages.md +7 -0
  4. package/dist/analytics/analytics.cjs +71 -0
  5. package/dist/analytics/analytics.d.cts +3 -0
  6. package/dist/analytics/analytics.d.ts +3 -0
  7. package/dist/analytics/analytics.js +7 -0
  8. package/dist/analytics/log-build.cjs +155 -0
  9. package/dist/analytics/log-build.d.cts +7 -0
  10. package/dist/analytics/log-build.d.ts +7 -0
  11. package/dist/analytics/log-build.js +9 -0
  12. package/dist/catalog-to-astro-content-directory.cjs +286 -0
  13. package/dist/catalog-to-astro-content-directory.d.cts +3 -0
  14. package/dist/catalog-to-astro-content-directory.d.ts +3 -0
  15. package/dist/catalog-to-astro-content-directory.js +8 -0
  16. package/dist/chunk-55YPRY5U.js +87 -0
  17. package/dist/chunk-5RNDOKYT.js +97 -0
  18. package/dist/chunk-6VJTKPOS.js +30 -0
  19. package/dist/chunk-BT6ILNB3.js +33 -0
  20. package/dist/chunk-DMGFALQN.js +9 -0
  21. package/dist/chunk-E7TXTI7G.js +78 -0
  22. package/{scripts/watcher.js → dist/chunk-NTCYOR4N.js} +29 -52
  23. package/dist/chunk-YEQVKHST.js +56 -0
  24. package/dist/constants.cjs +35 -0
  25. package/dist/constants.d.cts +3 -0
  26. package/dist/constants.d.ts +3 -0
  27. package/dist/constants.js +6 -0
  28. package/dist/eventcatalog-config-file-utils.cjs +116 -0
  29. package/dist/eventcatalog-config-file-utils.d.cts +7 -0
  30. package/dist/eventcatalog-config-file-utils.d.ts +7 -0
  31. package/dist/eventcatalog-config-file-utils.js +14 -0
  32. package/{bin/dist → dist}/eventcatalog.cjs +35 -36
  33. package/{bin/dist → dist}/eventcatalog.config.cjs +1 -1
  34. package/dist/eventcatalog.config.js +0 -0
  35. package/dist/eventcatalog.d.cts +2 -0
  36. package/dist/eventcatalog.d.ts +2 -0
  37. package/dist/eventcatalog.js +116 -0
  38. package/dist/generate.cjs +121 -0
  39. package/dist/generate.d.cts +3 -0
  40. package/dist/generate.d.ts +3 -0
  41. package/dist/generate.js +7 -0
  42. package/dist/map-catalog-to-astro.cjs +131 -0
  43. package/dist/map-catalog-to-astro.d.cts +28 -0
  44. package/dist/map-catalog-to-astro.d.ts +28 -0
  45. package/dist/map-catalog-to-astro.js +6 -0
  46. package/dist/watcher.cjs +231 -0
  47. package/dist/watcher.d.cts +21 -0
  48. package/dist/watcher.d.ts +21 -0
  49. package/dist/watcher.js +8 -0
  50. package/{src → eventcatalog/src}/components/MDX/NodeGraph/Edges/AnimatedMessageEdge.tsx +1 -1
  51. package/{src → eventcatalog/src}/components/MDX/NodeGraph/NodeGraph.tsx +28 -38
  52. package/{src → eventcatalog/src}/components/MDX/SchemaViewer/SchemaViewer.astro +6 -1
  53. package/{src → eventcatalog/src}/components/SideBars/CatalogResourcesSideBar/index.tsx +19 -1
  54. package/{src → eventcatalog/src}/components/SideBars/DomainSideBar.astro +23 -0
  55. package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +196 -0
  56. package/{src → eventcatalog/src}/content/config.ts +18 -0
  57. package/eventcatalog/src/hooks/eventcatalog-visualizer.ts +89 -0
  58. package/eventcatalog/src/pages/docs/[type]/[id]/language.astro +301 -0
  59. package/{src → eventcatalog/src}/utils/collections/domains.ts +17 -2
  60. package/{src → eventcatalog/src}/utils/collections/icons.ts +3 -0
  61. package/{src → eventcatalog/src}/utils/node-graphs/message-node-graph.ts +2 -27
  62. package/{src → eventcatalog/src}/utils/node-graphs/utils/utils.ts +60 -3
  63. package/package.json +12 -3
  64. package/.all-contributorsrc +0 -436
  65. package/.changeset/config.json +0 -11
  66. package/.github/CODEOWNERS +0 -3
  67. package/.github/ISSUE_TEMPLATE/bug.yml +0 -84
  68. package/.github/ISSUE_TEMPLATE/config.yml +0 -5
  69. package/.github/ISSUE_TEMPLATE/feature.yml +0 -48
  70. package/.github/PULL_REQUEST_TEMPLATE.md +0 -14
  71. package/.github/funding.yml +0 -1
  72. package/.github/workflows/lint.yml +0 -22
  73. package/.github/workflows/release.yml +0 -34
  74. package/.github/workflows/test-bin.yml +0 -29
  75. package/.github/workflows/test-e2e.yml +0 -27
  76. package/.github/workflows/verify-build.yml +0 -28
  77. package/.prettierignore +0 -7
  78. package/.prettierrc +0 -18
  79. package/CHANGELOG.md +0 -1296
  80. package/bin/dist/eventcatalog.d.cts +0 -1
  81. package/bin/dist/eventcatalog.d.ts +0 -1
  82. package/bin/dist/eventcatalog.js +0 -531
  83. package/bin/eventcatalog.config.ts +0 -34
  84. package/images/example.png +0 -0
  85. package/images/sponsors/gravitee-logo-black.svg +0 -54
  86. package/images/sponsors/hookdeck.svg +0 -11
  87. package/images/sponsors/oso-logo-green.png +0 -0
  88. package/scripts/analytics/analytics.js +0 -31
  89. package/scripts/analytics/log-build.js +0 -26
  90. package/scripts/build-ci.js +0 -27
  91. package/scripts/catalog-to-astro-content-directory.js +0 -115
  92. package/scripts/ci/test.js +0 -24
  93. package/scripts/constants.ts +0 -3
  94. package/scripts/eventcatalog-config-file-utils.js +0 -89
  95. package/scripts/generate.js +0 -65
  96. package/scripts/map-catalog-to-astro.js +0 -174
  97. package/scripts/start-catalog-locally.js +0 -26
  98. package/src/components/Tables/columns/ServiceTableColumns.tsx +0 -164
  99. /package/{bin/dist → dist}/eventcatalog.config.d.cts +0 -0
  100. /package/{bin/dist → dist}/eventcatalog.config.d.ts +0 -0
  101. /package/{astro.config.mjs → eventcatalog/astro.config.mjs} +0 -0
  102. /package/{global.d.ts → eventcatalog/global.d.ts} +0 -0
  103. /package/{public → eventcatalog/public}/favicon.ico +0 -0
  104. /package/{public → eventcatalog/public}/icons/asyncapi.svg +0 -0
  105. /package/{public → eventcatalog/public}/icons/discord.svg +0 -0
  106. /package/{public → eventcatalog/public}/icons/github-purple.svg +0 -0
  107. /package/{public → eventcatalog/public}/icons/github.svg +0 -0
  108. /package/{public → eventcatalog/public}/icons/ms-teams.svg +0 -0
  109. /package/{public → eventcatalog/public}/icons/openapi.svg +0 -0
  110. /package/{public → eventcatalog/public}/icons/protocols/kafka.svg +0 -0
  111. /package/{public → eventcatalog/public}/icons/x-twitter.svg +0 -0
  112. /package/{public → eventcatalog/public}/icons/youtube.svg +0 -0
  113. /package/{public → eventcatalog/public}/logo.png +0 -0
  114. /package/{public → eventcatalog/public}/openapi.yml +0 -0
  115. /package/{public → eventcatalog/public}/opengraph.png +0 -0
  116. /package/{public → eventcatalog/public}/slack-icon.svg +0 -0
  117. /package/{src → eventcatalog/src}/components/DiscoverInsight.astro +0 -0
  118. /package/{src → eventcatalog/src}/components/DocsNavigation.astro +0 -0
  119. /package/{src → eventcatalog/src}/components/Header.astro +0 -0
  120. /package/{src → eventcatalog/src}/components/Lists/OwnersList.tsx +0 -0
  121. /package/{src → eventcatalog/src}/components/Lists/PillList.tsx +0 -0
  122. /package/{src → eventcatalog/src}/components/Lists/PillListFlat.styles.css +0 -0
  123. /package/{src → eventcatalog/src}/components/Lists/PillListFlat.tsx +0 -0
  124. /package/{src → eventcatalog/src}/components/Lists/ProtocolList.tsx +0 -0
  125. /package/{src → eventcatalog/src}/components/Lists/RepositoryList.astro +0 -0
  126. /package/{src → eventcatalog/src}/components/Lists/SpecificationsList.astro +0 -0
  127. /package/{src → eventcatalog/src}/components/Lists/VersionList.astro +0 -0
  128. /package/{src → eventcatalog/src}/components/MDX/Accordion/Accordion.astro +0 -0
  129. /package/{src → eventcatalog/src}/components/MDX/Accordion/Accordion.tsx +0 -0
  130. /package/{src → eventcatalog/src}/components/MDX/Accordion/AccordionGroup.astro +0 -0
  131. /package/{src → eventcatalog/src}/components/MDX/Admonition.tsx +0 -0
  132. /package/{src → eventcatalog/src}/components/MDX/AsyncAPI/AsyncAPI.astro +0 -0
  133. /package/{src → eventcatalog/src}/components/MDX/ChannelInformation/ChannelInformation.tsx +0 -0
  134. /package/{src → eventcatalog/src}/components/MDX/File.tsx +0 -0
  135. /package/{src → eventcatalog/src}/components/MDX/Flow/Flow.astro +0 -0
  136. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/DownloadButton.tsx +0 -0
  137. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/NodeGraph.astro +0 -0
  138. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/NodeGraphPortal.tsx +0 -0
  139. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/Channel.tsx +0 -0
  140. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/Command.tsx +0 -0
  141. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/Event.tsx +0 -0
  142. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/ExternalSystem.tsx +0 -0
  143. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/Query.tsx +0 -0
  144. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/Service.tsx +0 -0
  145. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/Step.tsx +0 -0
  146. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/User.tsx +0 -0
  147. /package/{src → eventcatalog/src}/components/MDX/OpenAPI/OpenAPI.astro +0 -0
  148. /package/{src → eventcatalog/src}/components/MDX/Schema.astro +0 -0
  149. /package/{src → eventcatalog/src}/components/MDX/SchemaViewer/SchemaViewer.tsx +0 -0
  150. /package/{src → eventcatalog/src}/components/MDX/SchemaViewer/SchemaViewerPortal.tsx +0 -0
  151. /package/{src → eventcatalog/src}/components/MDX/Steps/Step.astro +0 -0
  152. /package/{src → eventcatalog/src}/components/MDX/Steps/Steps.astro +0 -0
  153. /package/{src → eventcatalog/src}/components/MDX/Tiles/Tile.astro +0 -0
  154. /package/{src → eventcatalog/src}/components/MDX/Tiles/Tiles.astro +0 -0
  155. /package/{src → eventcatalog/src}/components/MDX/components.tsx +0 -0
  156. /package/{src → eventcatalog/src}/components/MDX/page-components.tsx +0 -0
  157. /package/{src → eventcatalog/src}/components/Search.astro +0 -0
  158. /package/{src → eventcatalog/src}/components/Seo.astro +0 -0
  159. /package/{src → eventcatalog/src}/components/SideBars/CatalogResourcesSideBar/styles.css +0 -0
  160. /package/{src → eventcatalog/src}/components/SideBars/ChannelSideBar.astro +0 -0
  161. /package/{src → eventcatalog/src}/components/SideBars/MessageSideBar.astro +0 -0
  162. /package/{src → eventcatalog/src}/components/SideBars/ServiceSideBar.astro +0 -0
  163. /package/{src → eventcatalog/src}/components/Tables/DebouncedInput.tsx +0 -0
  164. /package/{src → eventcatalog/src}/components/Tables/Table.tsx +0 -0
  165. /package/{src → eventcatalog/src}/components/Tables/columns/DomainTableColumns.tsx +0 -0
  166. /package/{src → eventcatalog/src}/components/Tables/columns/FlowTableColumns.tsx +0 -0
  167. /package/{src → eventcatalog/src}/components/Tables/columns/MessageTableColumns.tsx +0 -0
  168. /package/{src → eventcatalog/src}/components/Tables/columns/index.tsx +0 -0
  169. /package/{src → eventcatalog/src}/components/Tables/filters/custom-filters.ts +0 -0
  170. /package/{src → eventcatalog/src}/env.d.ts +0 -0
  171. /package/{src → eventcatalog/src}/icons/protocols/WebSocket.svg +0 -0
  172. /package/{src → eventcatalog/src}/icons/protocols/amqp.svg +0 -0
  173. /package/{src → eventcatalog/src}/icons/protocols/eventbridge.svg +0 -0
  174. /package/{src → eventcatalog/src}/icons/protocols/googlepubsub.svg +0 -0
  175. /package/{src → eventcatalog/src}/icons/protocols/http.svg +0 -0
  176. /package/{src → eventcatalog/src}/icons/protocols/index.ts +0 -0
  177. /package/{src → eventcatalog/src}/icons/protocols/jms.svg +0 -0
  178. /package/{src → eventcatalog/src}/icons/protocols/kafka.svg +0 -0
  179. /package/{src → eventcatalog/src}/icons/protocols/mercure.svg +0 -0
  180. /package/{src → eventcatalog/src}/icons/protocols/mqtt.svg +0 -0
  181. /package/{src → eventcatalog/src}/icons/protocols/nats.svg +0 -0
  182. /package/{src → eventcatalog/src}/icons/protocols/pulsar.svg +0 -0
  183. /package/{src → eventcatalog/src}/icons/protocols/redis.svg +0 -0
  184. /package/{src → eventcatalog/src}/icons/protocols/sns.svg +0 -0
  185. /package/{src → eventcatalog/src}/icons/protocols/solace.svg +0 -0
  186. /package/{src → eventcatalog/src}/icons/protocols/sqs.svg +0 -0
  187. /package/{src → eventcatalog/src}/icons/protocols/ws.svg +0 -0
  188. /package/{src → eventcatalog/src}/layouts/CustomDocsPageLayout.astro +0 -0
  189. /package/{src → eventcatalog/src}/layouts/DiscoverLayout.astro +0 -0
  190. /package/{src → eventcatalog/src}/layouts/Footer.astro +0 -0
  191. /package/{src → eventcatalog/src}/layouts/PlainPage.astro +0 -0
  192. /package/{src → eventcatalog/src}/layouts/VerticalSideBarLayout.astro +0 -0
  193. /package/{src → eventcatalog/src}/layouts/VisualiserLayout.astro +0 -0
  194. /package/{src → eventcatalog/src}/pages/discover/[type]/index.astro +0 -0
  195. /package/{src → eventcatalog/src}/pages/docs/[type]/[id]/[version]/asyncapi/index.astro +0 -0
  196. /package/{src → eventcatalog/src}/pages/docs/[type]/[id]/[version]/changelog/index.astro +0 -0
  197. /package/{src → eventcatalog/src}/pages/docs/[type]/[id]/[version]/index.astro +0 -0
  198. /package/{src → eventcatalog/src}/pages/docs/[type]/[id]/[version]/spec/_styles.css +0 -0
  199. /package/{src → eventcatalog/src}/pages/docs/[type]/[id]/[version]/spec/index.astro +0 -0
  200. /package/{src → eventcatalog/src}/pages/docs/[type]/[id]/index.astro +0 -0
  201. /package/{src → eventcatalog/src}/pages/docs/index.astro +0 -0
  202. /package/{src → eventcatalog/src}/pages/docs/teams/[id]/index.astro +0 -0
  203. /package/{src → eventcatalog/src}/pages/docs/users/[id]/index.astro +0 -0
  204. /package/{src → eventcatalog/src}/pages/index.astro +0 -0
  205. /package/{src → eventcatalog/src}/pages/visualiser/[type]/[id]/[version]/index.astro +0 -0
  206. /package/{src → eventcatalog/src}/pages/visualiser/[type]/[id]/index.astro +0 -0
  207. /package/{src → eventcatalog/src}/remark-plugins/mermaid.ts +0 -0
  208. /package/{src → eventcatalog/src}/types/index.ts +0 -0
  209. /package/{src → eventcatalog/src}/utils/channels.ts +0 -0
  210. /package/{src → eventcatalog/src}/utils/collections/changelogs.ts +0 -0
  211. /package/{src → eventcatalog/src}/utils/collections/file-diffs.ts +0 -0
  212. /package/{src → eventcatalog/src}/utils/collections/flows.ts +0 -0
  213. /package/{src → eventcatalog/src}/utils/collections/services.ts +0 -0
  214. /package/{src → eventcatalog/src}/utils/collections/util.ts +0 -0
  215. /package/{src → eventcatalog/src}/utils/collections/versions.ts +0 -0
  216. /package/{src → eventcatalog/src}/utils/colors.ts +0 -0
  217. /package/{src → eventcatalog/src}/utils/commands.ts +0 -0
  218. /package/{src → eventcatalog/src}/utils/eventcatalog-config/catalog.ts +0 -0
  219. /package/{src → eventcatalog/src}/utils/events.ts +0 -0
  220. /package/{src → eventcatalog/src}/utils/example-remark-plugin.mjs +0 -0
  221. /package/{src → eventcatalog/src}/utils/messages.ts +0 -0
  222. /package/{src → eventcatalog/src}/utils/node-graphs/domains-node-graph.ts +0 -0
  223. /package/{src → eventcatalog/src}/utils/node-graphs/flows-node-graph.ts +0 -0
  224. /package/{src → eventcatalog/src}/utils/node-graphs/services-node-graph.ts +0 -0
  225. /package/{src → eventcatalog/src}/utils/page-loaders/page-data-loader.ts +0 -0
  226. /package/{src → eventcatalog/src}/utils/pages.ts +0 -0
  227. /package/{src → eventcatalog/src}/utils/queries.ts +0 -0
  228. /package/{src → eventcatalog/src}/utils/teams.ts +0 -0
  229. /package/{src → eventcatalog/src}/utils/url-builder.ts +0 -0
  230. /package/{src → eventcatalog/src}/utils/users.ts +0 -0
  231. /package/{tailwind.config.mjs → eventcatalog/tailwind.config.mjs} +0 -0
  232. /package/{tsconfig.json → eventcatalog/tsconfig.json} +0 -0
@@ -6,7 +6,7 @@ import path from 'path';
6
6
  const PROJECT_DIR = process.env.PROJECT_DIR || process.cwd();
7
7
 
8
8
  export type Domain = CollectionEntry<'domains'>;
9
-
9
+ export type UbiquitousLanguage = CollectionEntry<'ubiquitousLanguages'>;
10
10
  interface Props {
11
11
  getAllVersions?: boolean;
12
12
  }
@@ -28,7 +28,9 @@ export const getDomains = async ({ getAllVersions = true }: Props = {}): Promise
28
28
  const servicesInDomain = domain.data.services || [];
29
29
 
30
30
  const services = servicesInDomain
31
- .map((_service) => getItemsFromCollectionByIdAndSemverOrLatest(servicesCollection, _service.id, _service.version))
31
+ .map((_service: { id: string; version: string | undefined }) =>
32
+ getItemsFromCollectionByIdAndSemverOrLatest(servicesCollection, _service.id, _service.version)
33
+ )
32
34
  .flat();
33
35
 
34
36
  return {
@@ -50,3 +52,16 @@ export const getDomains = async ({ getAllVersions = true }: Props = {}): Promise
50
52
  };
51
53
  });
52
54
  };
55
+
56
+ export const getUbiquitousLanguage = async (domain: Domain): Promise<UbiquitousLanguage[]> => {
57
+ const { collection, data, slug } = domain;
58
+
59
+ const allUbiquitousLanguages = await getCollection('ubiquitousLanguages');
60
+ console.log('allUbiquitousLanguages', allUbiquitousLanguages, collection, slug, data.name);
61
+
62
+ const ubiquitousLanguages = await getCollection('ubiquitousLanguages', (ubiquitousLanguage) => {
63
+ return ubiquitousLanguage.id.includes(`${collection}/${data.name}`);
64
+ });
65
+
66
+ return ubiquitousLanguages;
67
+ };
@@ -10,6 +10,7 @@ import {
10
10
  ArrowsRightLeftIcon,
11
11
  VariableIcon,
12
12
  } from '@heroicons/react/24/outline';
13
+ import { BookText } from 'lucide-react';
13
14
 
14
15
  export const getIconForCollection = (collection: string) => {
15
16
  switch (collection) {
@@ -33,6 +34,8 @@ export const getIconForCollection = (collection: string) => {
33
34
  return ArrowsRightLeftIcon;
34
35
  case 'channels-parameter':
35
36
  return VariableIcon;
37
+ case 'ubiquitousLanguages':
38
+ return BookText;
36
39
  default:
37
40
  return ServerIcon;
38
41
  }
@@ -9,6 +9,8 @@ import {
9
9
  generatedIdForEdge,
10
10
  generateIdForNode,
11
11
  getChannelNodesAndEdges,
12
+ getEdgeLabelForMessageAsSource,
13
+ getEdgeLabelForServiceAsTarget,
12
14
  } from './utils/utils';
13
15
  import { MarkerType } from 'reactflow';
14
16
  import { findMatchingNodes } from '@utils/collections/util';
@@ -26,33 +28,6 @@ interface Props {
26
28
  collection?: CollectionEntry<CollectionMessageTypes>[];
27
29
  }
28
30
 
29
- const getEdgeLabelForServiceAsTarget = (data: CollectionEntry<CollectionMessageTypes>) => {
30
- const type = data.collection;
31
- switch (type) {
32
- case 'commands':
33
- return 'invokes';
34
- case 'events':
35
- return 'publishes event';
36
- case 'queries':
37
- return 'requests';
38
- default:
39
- return 'sends to';
40
- }
41
- };
42
- const getEdgeLabelForMessageAsSource = (data: CollectionEntry<CollectionMessageTypes>) => {
43
- const type = data.collection;
44
- switch (type) {
45
- case 'commands':
46
- return 'accepts';
47
- case 'events':
48
- return 'subscribed by';
49
- case 'queries':
50
- return 'accepts';
51
- default:
52
- return 'sends to';
53
- }
54
- };
55
-
56
31
  const getNodesAndEdges = async ({ id, version, defaultFlow, mode = 'simple', collection = [] }: Props) => {
57
32
  const flow = defaultFlow || createDagreGraph({ ranksep: 300, nodesep: 50 });
58
33
  const nodes = [] as any,
@@ -2,7 +2,7 @@ import { getCollection, type CollectionEntry } from 'astro:content';
2
2
  import { MarkerType, Position, type Edge, type Node } from 'reactflow';
3
3
  import dagre from 'dagre';
4
4
  import { getItemsFromCollectionByIdAndSemverOrLatest } from '@utils/collections/util';
5
- import type { CollectionTypes } from '@types';
5
+ import type { CollectionMessageTypes, CollectionTypes } from '@types';
6
6
 
7
7
  export const generateIdForNode = (node: CollectionEntry<CollectionTypes>) => {
8
8
  return `${node.data.id}-${node.data.version}`;
@@ -14,6 +14,33 @@ export const generatedIdForEdge = (source: CollectionEntry<CollectionTypes>, tar
14
14
  return `${source.data.id}-${source.data.version}-${target.data.id}-${target.data.version}`;
15
15
  };
16
16
 
17
+ export const getEdgeLabelForServiceAsTarget = (data: CollectionEntry<CollectionMessageTypes>) => {
18
+ const type = data.collection;
19
+ switch (type) {
20
+ case 'commands':
21
+ return 'invokes';
22
+ case 'events':
23
+ return 'publishes event';
24
+ case 'queries':
25
+ return 'requests';
26
+ default:
27
+ return 'sends to';
28
+ }
29
+ };
30
+ export const getEdgeLabelForMessageAsSource = (data: CollectionEntry<CollectionMessageTypes>) => {
31
+ const type = data.collection;
32
+ switch (type) {
33
+ case 'commands':
34
+ return 'accepts';
35
+ case 'events':
36
+ return 'subscribed by';
37
+ case 'queries':
38
+ return 'accepts';
39
+ default:
40
+ return 'sends to';
41
+ }
42
+ };
43
+
17
44
  export const calculatedNodes = (flow: dagre.graphlib.Graph, nodes: Node[]) => {
18
45
  return nodes.map((node: any) => {
19
46
  const { x, y } = flow.node(node.id);
@@ -107,7 +134,7 @@ export const getChannelNodesAndEdges = ({
107
134
  target: channelId,
108
135
  label: '',
109
136
  // label: sourceToChannelLabel,
110
- data: { message: edgeMessage },
137
+ data: { message: edgeMessage, source: edgeMessage, channel, target },
111
138
  })
112
139
  );
113
140
 
@@ -119,10 +146,40 @@ export const getChannelNodesAndEdges = ({
119
146
  source: channelId,
120
147
  target: generateIdForNode(target),
121
148
  label: channelToTargetLabel,
122
- data: { message: edgeMessage },
149
+ data: { message: edgeMessage, source, channel, target },
123
150
  })
124
151
  );
125
152
  });
126
153
 
127
154
  return { nodes, edges };
128
155
  };
156
+
157
+ type DagreGraph = any;
158
+
159
+ export const getNodesAndEdgesFromDagre = ({
160
+ nodes,
161
+ edges,
162
+ defaultFlow,
163
+ }: {
164
+ nodes: Node[];
165
+ edges: Edge[];
166
+ defaultFlow?: DagreGraph;
167
+ }) => {
168
+ const flow = defaultFlow || createDagreGraph({ ranksep: 300, nodesep: 50 });
169
+
170
+ nodes.forEach((node: any) => {
171
+ flow.setNode(node.id, { width: 150, height: 100 });
172
+ });
173
+
174
+ edges.forEach((edge: any) => {
175
+ flow.setEdge(edge.source, edge.target);
176
+ });
177
+
178
+ // Render the diagram in memory getting hte X and Y
179
+ dagre.layout(flow);
180
+
181
+ return {
182
+ nodes: calculatedNodes(flow, nodes),
183
+ edges,
184
+ };
185
+ };
package/package.json CHANGED
@@ -6,18 +6,25 @@
6
6
  "url": "https://github.com/event-catalog/eventcatalog.git"
7
7
  },
8
8
  "type": "module",
9
- "version": "2.14.3",
9
+ "version": "2.16.0",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
13
  "bin": {
14
- "eventcatalog": "bin/dist/eventcatalog.cjs"
14
+ "eventcatalog": "bin/eventcatalog.js"
15
15
  },
16
+ "files": [
17
+ "eventcatalog/",
18
+ "!eventcatalog/**/__tests__/",
19
+ "bin/",
20
+ "dist/",
21
+ "default-files-for-collections/"
22
+ ],
16
23
  "scripts": {
17
24
  "dev": "astro dev",
18
25
  "build:bin": "tsup",
19
26
  "prepublishOnly": "npm run build:bin",
20
- "test": "vitest --config vitest.config.ts",
27
+ "test": "vitest",
21
28
  "test:ci": "node scripts/ci/test.js",
22
29
  "test:e2e": "playwright test",
23
30
  "start": "astro dev",
@@ -61,6 +68,7 @@
61
68
  "glob": "^10.4.1",
62
69
  "gray-matter": "^4.0.3",
63
70
  "html-to-image": "^1.11.11",
71
+ "js-yaml": "^4.1.0",
64
72
  "lodash.debounce": "^4.0.8",
65
73
  "lodash.merge": "4.6.2",
66
74
  "lucide-react": "^0.453.0",
@@ -84,6 +92,7 @@
84
92
  "@playwright/test": "^1.48.1",
85
93
  "@types/dagre": "^0.7.52",
86
94
  "@types/diff": "^5.2.2",
95
+ "@types/js-yaml": "^4.0.9",
87
96
  "@types/lodash.debounce": "^4.0.9",
88
97
  "@types/lodash.merge": "4.6.9",
89
98
  "@types/node": "^20.14.2",
@@ -1,436 +0,0 @@
1
- {
2
- "projectName": "eventcatalog",
3
- "projectOwner": "event-catalog",
4
- "repoType": "github",
5
- "repoHost": "https://github.com",
6
- "files": [
7
- "README.md"
8
- ],
9
- "imageSize": 100,
10
- "commit": true,
11
- "commitConvention": "none",
12
- "contributors": [
13
- {
14
- "login": "boyney123",
15
- "name": "David Boyne",
16
- "avatar_url": "https://avatars.githubusercontent.com/u/3268013?v=4",
17
- "profile": "https://boyney.io/",
18
- "contributions": [
19
- "code",
20
- "content",
21
- "design",
22
- "example",
23
- "ideas",
24
- "doc"
25
- ]
26
- },
27
- {
28
- "login": "otbe",
29
- "name": "Benjamin Otto",
30
- "avatar_url": "https://avatars.githubusercontent.com/u/3391052?v=4",
31
- "profile": "https://otbe.io",
32
- "contributions": [
33
- "code",
34
- "ideas",
35
- "doc",
36
- "bug"
37
- ]
38
- },
39
- {
40
- "login": "pongz79",
41
- "name": "Tiago Oliveira",
42
- "avatar_url": "https://avatars.githubusercontent.com/u/250872?v=4",
43
- "profile": "https://github.com/pongz79",
44
- "contributions": [
45
- "doc",
46
- "bug"
47
- ]
48
- },
49
- {
50
- "login": "jaymcguinness",
51
- "name": "Jay McGuinness",
52
- "avatar_url": "https://avatars.githubusercontent.com/u/11387911?v=4",
53
- "profile": "https://www.bigjump.com/",
54
- "contributions": [
55
- "doc"
56
- ]
57
- },
58
- {
59
- "login": "davidkpiano",
60
- "name": "David Khourshid",
61
- "avatar_url": "https://avatars.githubusercontent.com/u/1093738?v=4",
62
- "profile": "https://github.com/davidkpiano",
63
- "contributions": [
64
- "doc"
65
- ]
66
- },
67
- {
68
- "login": "thim81",
69
- "name": "thim81",
70
- "avatar_url": "https://avatars.githubusercontent.com/u/952446?v=4",
71
- "profile": "https://github.com/thim81",
72
- "contributions": [
73
- "ideas",
74
- "bug",
75
- "code"
76
- ]
77
- },
78
- {
79
- "login": "Muthuveerappanv",
80
- "name": "Muthu",
81
- "avatar_url": "https://avatars.githubusercontent.com/u/33663725?v=4",
82
- "profile": "https://github.com/Muthuveerappanv",
83
- "contributions": [
84
- "bug"
85
- ]
86
- },
87
- {
88
- "login": "tavelli",
89
- "name": "Dan Tavelli",
90
- "avatar_url": "https://avatars.githubusercontent.com/u/484951?v=4",
91
- "profile": "https://github.com/tavelli",
92
- "contributions": [
93
- "doc"
94
- ]
95
- },
96
- {
97
- "login": "steppi91",
98
- "name": "steppi91",
99
- "avatar_url": "https://avatars.githubusercontent.com/u/25939641?v=4",
100
- "profile": "https://github.com/steppi91",
101
- "contributions": [
102
- "doc"
103
- ]
104
- },
105
- {
106
- "login": "donaldpipowitch",
107
- "name": "Donald Pipowitch",
108
- "avatar_url": "https://avatars.githubusercontent.com/u/1152805?v=4",
109
- "profile": "https://twitter.com/PipoPeperoni",
110
- "contributions": [
111
- "bug",
112
- "code"
113
- ]
114
- },
115
- {
116
- "login": "kzhen",
117
- "name": "Ken",
118
- "avatar_url": "https://avatars.githubusercontent.com/u/2233210?v=4",
119
- "profile": "http://unravelled.dev",
120
- "contributions": [
121
- "doc"
122
- ]
123
- },
124
- {
125
- "login": "rtoro",
126
- "name": "Rodolfo Toro",
127
- "avatar_url": "https://avatars.githubusercontent.com/u/5186897?v=4",
128
- "profile": "http://rtoro.cl",
129
- "contributions": [
130
- "code"
131
- ]
132
- },
133
- {
134
- "login": "drub0y",
135
- "name": "Drew Marsh",
136
- "avatar_url": "https://avatars.githubusercontent.com/u/284152?v=4",
137
- "profile": "http://blog.hackedbrain.com",
138
- "contributions": [
139
- "code"
140
- ]
141
- },
142
- {
143
- "login": "dpwdec",
144
- "name": "Dec Kolakowski",
145
- "avatar_url": "https://avatars.githubusercontent.com/u/51292634?v=4",
146
- "profile": "https://github.com/dpwdec",
147
- "contributions": [
148
- "code",
149
- "doc"
150
- ]
151
- },
152
- {
153
- "login": "dytyniuk",
154
- "name": "Yevhenii Dytyniuk",
155
- "avatar_url": "https://avatars.githubusercontent.com/u/1890615?v=4",
156
- "profile": "https://github.com/dytyniuk",
157
- "contributions": [
158
- "code"
159
- ]
160
- },
161
- {
162
- "login": "lcsbltm",
163
- "name": "lcsbltm",
164
- "avatar_url": "https://avatars.githubusercontent.com/u/25868958?v=4",
165
- "profile": "https://github.com/lcsbltm",
166
- "contributions": [
167
- "code"
168
- ]
169
- },
170
- {
171
- "login": "martzcodes",
172
- "name": "Matt Martz",
173
- "avatar_url": "https://avatars.githubusercontent.com/u/978362?v=4",
174
- "profile": "https://matt.martz.codes",
175
- "contributions": [
176
- "code"
177
- ]
178
- },
179
- {
180
- "login": "michelgrootjans",
181
- "name": "Michel Grootjans",
182
- "avatar_url": "https://avatars.githubusercontent.com/u/345770?v=4",
183
- "profile": "https://github.com/michelgrootjans",
184
- "contributions": [
185
- "code"
186
- ]
187
- },
188
- {
189
- "login": "arturoabruzzini",
190
- "name": "Arturo Abruzzini",
191
- "avatar_url": "https://avatars.githubusercontent.com/u/17528406?v=4",
192
- "profile": "https://github.com/arturoabruzzini",
193
- "contributions": [
194
- "code"
195
- ]
196
- },
197
- {
198
- "login": "adlecluse",
199
- "name": "Ad L'Ecluse",
200
- "avatar_url": "https://avatars.githubusercontent.com/u/13390934?v=4",
201
- "profile": "https://github.com/adlecluse",
202
- "contributions": [
203
- "code"
204
- ]
205
- },
206
- {
207
- "login": "rafaelrenanpacheco",
208
- "name": "Rafael Renan Pacheco",
209
- "avatar_url": "https://avatars.githubusercontent.com/u/12160864?v=4",
210
- "profile": "https://github.com/rafaelrenanpacheco",
211
- "contributions": [
212
- "code",
213
- "doc"
214
- ]
215
- },
216
- {
217
- "login": "ldiego73",
218
- "name": "Luis Diego",
219
- "avatar_url": "https://avatars.githubusercontent.com/u/394222?v=4",
220
- "profile": "https://ldiego73.github.io/",
221
- "contributions": [
222
- "code"
223
- ]
224
- },
225
- {
226
- "login": "DanielRuf",
227
- "name": "Daniel Ruf",
228
- "avatar_url": "https://avatars.githubusercontent.com/u/827205?v=4",
229
- "profile": "https://www.linkedin.com/in/danielruf/",
230
- "contributions": [
231
- "doc"
232
- ]
233
- },
234
- {
235
- "login": "frenkan",
236
- "name": "Fredrik Johansson",
237
- "avatar_url": "https://avatars.githubusercontent.com/u/859840?v=4",
238
- "profile": "https://github.com/frenkan",
239
- "contributions": [
240
- "code"
241
- ]
242
- },
243
- {
244
- "name": "Naresh Kumar Reddy Gaddam",
245
- "avatar_url": "https://avatars.githubusercontent.com/u/2576375?v=4",
246
- "profile": "https://gaddam1987.github.io/",
247
- "login": "gaddam1987",
248
- "contributions": [
249
- "code"
250
- ]
251
- },
252
- {
253
- "login": "dremonkey",
254
- "name": "Andre Deutmeyer",
255
- "avatar_url": "https://avatars.githubusercontent.com/u/480159?v=4",
256
- "profile": "https://github.com/dremonkey",
257
- "contributions": [
258
- "code"
259
- ]
260
- },
261
- {
262
- "login": "pebbz",
263
- "name": "Pebbz",
264
- "avatar_url": "https://avatars.githubusercontent.com/u/1685464?v=4",
265
- "profile": "https://github.com/pebbz",
266
- "contributions": [
267
- "code"
268
- ]
269
- },
270
- {
271
- "login": "aholbreich",
272
- "name": "Alexander Holbreich",
273
- "avatar_url": "https://avatars.githubusercontent.com/u/16252784?v=4",
274
- "profile": "https://alexander.holbreich.org/",
275
- "contributions": [
276
- "doc"
277
- ]
278
- },
279
- {
280
- "login": "jslim",
281
- "name": "José Delgado",
282
- "avatar_url": "https://avatars.githubusercontent.com/u/30370263?v=4",
283
- "profile": "https://www.josedelgadoing.com/",
284
- "contributions": [
285
- "code"
286
- ]
287
- },
288
- {
289
- "login": "jlee-spt",
290
- "name": "jlee-spt",
291
- "avatar_url": "https://avatars.githubusercontent.com/u/135801616?v=4",
292
- "profile": "https://github.com/jlee-spt",
293
- "contributions": [
294
- "code"
295
- ]
296
- },
297
- {
298
- "login": "kimrejstrom",
299
- "name": "Kim Rejström",
300
- "avatar_url": "https://avatars.githubusercontent.com/u/26428365?v=4",
301
- "profile": "https://github.com/kimrejstrom",
302
- "contributions": [
303
- "code"
304
- ]
305
- },
306
- {
307
- "login": "cgabard",
308
- "name": "Christophe Gabard",
309
- "avatar_url": "https://avatars.githubusercontent.com/u/6103932?v=4",
310
- "profile": "https://github.com/cgabard",
311
- "contributions": [
312
- "code"
313
- ]
314
- },
315
- {
316
- "login": "WaYdotNET",
317
- "name": "Carlo Bertini",
318
- "avatar_url": "https://avatars.githubusercontent.com/u/197466?v=4",
319
- "profile": "http://www.waydotnet.com",
320
- "contributions": [
321
- "code"
322
- ]
323
- },
324
- {
325
- "login": "dreglad",
326
- "name": "David Regla",
327
- "avatar_url": "https://avatars.githubusercontent.com/u/50302?v=4",
328
- "profile": "https://github.com/dreglad",
329
- "contributions": [
330
- "code"
331
- ]
332
- },
333
- {
334
- "login": "marciovmartins",
335
- "name": "Marcio Vinicius",
336
- "avatar_url": "https://avatars.githubusercontent.com/u/6377735?v=4",
337
- "profile": "https://blogdomarcioweb.wordpress.com/",
338
- "contributions": [
339
- "code"
340
- ]
341
- },
342
- {
343
- "login": "danielcastill0",
344
- "name": "Daniel Andres Castillo Ardila",
345
- "avatar_url": "https://avatars.githubusercontent.com/u/40574235?v=4",
346
- "profile": "https://github.com/danielcastill0",
347
- "contributions": [
348
- "code"
349
- ]
350
- },
351
- {
352
- "login": "debae",
353
- "name": "Baerten Dennis",
354
- "avatar_url": "https://avatars.githubusercontent.com/u/2007116?v=4",
355
- "profile": "http://www.ennovative-solutions.be",
356
- "contributions": [
357
- "code"
358
- ]
359
- },
360
- {
361
- "login": "ryancormack",
362
- "name": "Ryan Cormack",
363
- "avatar_url": "https://avatars.githubusercontent.com/u/1962883?v=4",
364
- "profile": "https://github.com/ryancormack",
365
- "contributions": [
366
- "code"
367
- ]
368
- },
369
- {
370
- "login": "nathanbirrell",
371
- "name": "Nathan Birrell",
372
- "avatar_url": "https://avatars.githubusercontent.com/u/4300215?v=4",
373
- "profile": "https://natee.biz",
374
- "contributions": [
375
- "code"
376
- ]
377
- },
378
- {
379
- "login": "jacktomlinson",
380
- "name": "Jack Tomlinson",
381
- "avatar_url": "https://avatars.githubusercontent.com/u/15871032?v=4",
382
- "profile": "https://www.jacktomlinson.co.uk/",
383
- "contributions": [
384
- "code"
385
- ]
386
- },
387
- {
388
- "login": "carlosallexandre",
389
- "name": "Carlos Rodrigues",
390
- "avatar_url": "https://avatars.githubusercontent.com/u/20143946?v=4",
391
- "profile": "https://github.com/carlosallexandre",
392
- "contributions": [
393
- "code"
394
- ]
395
- },
396
- {
397
- "login": "XaaXaaX",
398
- "name": "omid eidivandi",
399
- "avatar_url": "https://avatars.githubusercontent.com/u/13409925?v=4",
400
- "profile": "https://github.com/XaaXaaX",
401
- "contributions": [
402
- "code"
403
- ]
404
- },
405
- {
406
- "login": "hpatoio",
407
- "name": "Simone Fumagalli",
408
- "avatar_url": "https://avatars.githubusercontent.com/u/249948?v=4",
409
- "profile": "https://github.com/hpatoio",
410
- "contributions": [
411
- "doc"
412
- ]
413
- },
414
- {
415
- "login": "d-o-h",
416
- "name": "d-o-h",
417
- "avatar_url": "https://avatars.githubusercontent.com/u/23699653?v=4",
418
- "profile": "https://github.com/d-o-h",
419
- "contributions": [
420
- "code"
421
- ]
422
- },
423
- {
424
- "login": "skyrpex",
425
- "name": "Cristian Pallarés",
426
- "avatar_url": "https://avatars.githubusercontent.com/u/1077520?v=4",
427
- "profile": "https://pallares.io",
428
- "contributions": [
429
- "code"
430
- ]
431
- }
432
- ],
433
- "contributorsPerLine": 7,
434
- "skipCi": true,
435
- "commitType": "docs"
436
- }
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://unpkg.com/@changesets/config@3.0.1/schema.json",
3
- "changelog": "@changesets/cli/changelog",
4
- "commit": false,
5
- "fixed": [],
6
- "linked": [],
7
- "access": "restricted",
8
- "baseBranch": "main",
9
- "updateInternalDependencies": "patch",
10
- "ignore": []
11
- }
@@ -1,3 +0,0 @@
1
- # https://help.github.com/articles/about-codeowners/
2
-
3
- * @boyney123