@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
package/README.md CHANGED
@@ -29,7 +29,7 @@
29
29
  <h4>Features: Documentation generator for Event Driven Architectures, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
30
30
 
31
31
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
32
- [![All Contributors](https://img.shields.io/badge/all_contributors-45-orange.svg?style=flat-square)](#contributors-)
32
+ [![All Contributors](https://img.shields.io/badge/all_contributors-46-orange.svg?style=flat-square)](#contributors-)
33
33
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
34
34
 
35
35
  [Read the Docs](https://eventcatalog.dev/) | [Edit the Docs](https://github.com/event-catalog/docs) | [View Demo](https://demo.eventcatalog.dev/docs)
@@ -247,6 +247,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
247
247
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/hpatoio"><img src="https://avatars.githubusercontent.com/u/249948?v=4?s=100" width="100px;" alt="Simone Fumagalli"/><br /><sub><b>Simone Fumagalli</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=hpatoio" title="Documentation">📖</a></td>
248
248
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/d-o-h"><img src="https://avatars.githubusercontent.com/u/23699653?v=4?s=100" width="100px;" alt="d-o-h"/><br /><sub><b>d-o-h</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=d-o-h" title="Code">💻</a></td>
249
249
  <td align="center" valign="top" width="14.28%"><a href="https://pallares.io"><img src="https://avatars.githubusercontent.com/u/1077520?v=4?s=100" width="100px;" alt="Cristian Pallarés"/><br /><sub><b>Cristian Pallarés</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=skyrpex" title="Code">💻</a></td>
250
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/SebasRendon12"><img src="https://avatars.githubusercontent.com/u/69688183?v=4?s=100" width="100px;" alt="Sebastian Rendon"/><br /><sub><b>Sebastian Rendon</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=SebasRendon12" title="Code">💻</a></td>
250
251
  </tr>
251
252
  </tbody>
252
253
  </table>
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../dist/eventcatalog.js';
@@ -0,0 +1,7 @@
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 -->
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/analytics/analytics.js
31
+ var analytics_exports = {};
32
+ __export(analytics_exports, {
33
+ raiseEvent: () => raiseEvent
34
+ });
35
+ module.exports = __toCommonJS(analytics_exports);
36
+ var import_axios = __toESM(require("axios"), 1);
37
+ var import_os = __toESM(require("os"), 1);
38
+
39
+ // package.json
40
+ var version = "2.16.0";
41
+
42
+ // src/constants.ts
43
+ var VERSION = version;
44
+
45
+ // src/analytics/analytics.js
46
+ async function raiseEvent(eventData) {
47
+ const url = "https://queue.simpleanalyticscdn.com/events";
48
+ const userAgent = `@eventcatalog/eventcatalog@${VERSION} (${import_os.default.platform()}; ${import_os.default.arch()}; Node/${process.version})`;
49
+ const headers = {
50
+ "Content-Type": "application/json"
51
+ };
52
+ const payload = {
53
+ type: "event",
54
+ hostname: "eventcatalog.dev",
55
+ event: "@eventcatalog/eventcatalog",
56
+ metadata: {
57
+ ...eventData,
58
+ t: `t;${(/* @__PURE__ */ new Date()).toISOString()}`,
59
+ ua: userAgent
60
+ },
61
+ ua: userAgent
62
+ };
63
+ try {
64
+ await import_axios.default.post(url, payload, { headers });
65
+ } catch (error) {
66
+ }
67
+ }
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ raiseEvent
71
+ });
@@ -0,0 +1,3 @@
1
+ declare function raiseEvent(eventData: any): Promise<void>;
2
+
3
+ export { raiseEvent };
@@ -0,0 +1,3 @@
1
+ declare function raiseEvent(eventData: any): Promise<void>;
2
+
3
+ export { raiseEvent };
@@ -0,0 +1,7 @@
1
+ import {
2
+ raiseEvent
3
+ } from "../chunk-BT6ILNB3.js";
4
+ import "../chunk-DMGFALQN.js";
5
+ export {
6
+ raiseEvent
7
+ };
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/analytics/log-build.js
31
+ var log_build_exports = {};
32
+ __export(log_build_exports, {
33
+ default: () => log_build_default
34
+ });
35
+ module.exports = __toCommonJS(log_build_exports);
36
+
37
+ // src/eventcatalog-config-file-utils.js
38
+ var import_promises = require("fs/promises");
39
+ var import_node_fs = require("fs");
40
+ var import_promises2 = require("fs/promises");
41
+ var import_node_path = __toESM(require("path"), 1);
42
+ var import_uuid = require("uuid");
43
+ var import_url = require("url");
44
+ var import_gray_matter = __toESM(require("gray-matter"), 1);
45
+ async function cleanup(projectDirectory) {
46
+ const filePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs");
47
+ if ((0, import_node_fs.existsSync)(filePath)) {
48
+ await (0, import_promises.rm)(filePath);
49
+ }
50
+ }
51
+ var getEventCatalogConfigFile = async (projectDirectory) => {
52
+ try {
53
+ let configFilePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.js");
54
+ const filePath = import_node_path.default.join(projectDirectory, "package.json");
55
+ const packageJson = JSON.parse(await (0, import_promises.readFile)(filePath, "utf-8"));
56
+ if (packageJson?.type !== "module") {
57
+ await (0, import_promises2.copyFile)(configFilePath, import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs"));
58
+ configFilePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs");
59
+ }
60
+ const configFileURL = (0, import_url.pathToFileURL)(configFilePath).href;
61
+ const config = await import(
62
+ /* @vite-ignore */
63
+ configFileURL
64
+ );
65
+ return config.default;
66
+ } finally {
67
+ await cleanup(projectDirectory);
68
+ }
69
+ };
70
+ var writeEventCatalogConfigFile = async (projectDirectory, newConfig) => {
71
+ try {
72
+ const configFilePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.js");
73
+ let content = await (0, import_promises.readFile)(configFilePath, "utf8");
74
+ const startIndex = content.indexOf("export default {");
75
+ if (startIndex === -1) {
76
+ return;
77
+ }
78
+ Object.entries(newConfig).forEach(([key, value]) => {
79
+ const valueString = JSON.stringify(value, null, 2).replace(/"/g, "'").replace(/\n/g, "\n ");
80
+ const keyRegex = new RegExp(`(${key}\\s*:)([^,}]+)`, "g");
81
+ if (content.match(keyRegex)) {
82
+ content = content.replace(keyRegex, `$1 ${valueString}`);
83
+ } else {
84
+ const insertPosition = content.indexOf("{", startIndex) + 1;
85
+ content = content.slice(0, insertPosition) + `
86
+ ${key}: ${valueString},` + content.slice(insertPosition);
87
+ }
88
+ });
89
+ await (0, import_promises.writeFile)(configFilePath, content);
90
+ } finally {
91
+ await cleanup(projectDirectory);
92
+ }
93
+ };
94
+ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
95
+ try {
96
+ const config = await getEventCatalogConfigFile(projectDirectory);
97
+ if (!config.cId) {
98
+ await writeEventCatalogConfigFile(projectDirectory, { cId: (0, import_uuid.v4)() });
99
+ }
100
+ } catch (error) {
101
+ }
102
+ };
103
+
104
+ // src/analytics/analytics.js
105
+ var import_axios = __toESM(require("axios"), 1);
106
+ var import_os = __toESM(require("os"), 1);
107
+
108
+ // package.json
109
+ var version = "2.16.0";
110
+
111
+ // src/constants.ts
112
+ var VERSION = version;
113
+
114
+ // src/analytics/analytics.js
115
+ async function raiseEvent(eventData) {
116
+ const url = "https://queue.simpleanalyticscdn.com/events";
117
+ const userAgent = `@eventcatalog/eventcatalog@${VERSION} (${import_os.default.platform()}; ${import_os.default.arch()}; Node/${process.version})`;
118
+ const headers = {
119
+ "Content-Type": "application/json"
120
+ };
121
+ const payload = {
122
+ type: "event",
123
+ hostname: "eventcatalog.dev",
124
+ event: "@eventcatalog/eventcatalog",
125
+ metadata: {
126
+ ...eventData,
127
+ t: `t;${(/* @__PURE__ */ new Date()).toISOString()}`,
128
+ ua: userAgent
129
+ },
130
+ ua: userAgent
131
+ };
132
+ try {
133
+ await import_axios.default.post(url, payload, { headers });
134
+ } catch (error) {
135
+ }
136
+ }
137
+
138
+ // src/analytics/log-build.js
139
+ var main = async (projectDir) => {
140
+ if (process.env.NODE_ENV === "CI") return;
141
+ try {
142
+ await verifyRequiredFieldsAreInCatalogConfigFile(projectDir);
143
+ const configFile = await getEventCatalogConfigFile(projectDir);
144
+ const { cId, organizationName, generators = [] } = configFile;
145
+ const generatorNames = generators.length > 0 ? generators.map((generator) => generator[0]) : ["none"];
146
+ await raiseEvent({
147
+ command: "build",
148
+ org: organizationName,
149
+ cId,
150
+ generators: generatorNames.toString()
151
+ });
152
+ } catch (error) {
153
+ }
154
+ };
155
+ var log_build_default = main;
@@ -0,0 +1,7 @@
1
+ /**
2
+ *
3
+ * @param {string} projectDir
4
+ */
5
+ declare function main(projectDir: string): Promise<void>;
6
+
7
+ export { main as default };
@@ -0,0 +1,7 @@
1
+ /**
2
+ *
3
+ * @param {string} projectDir
4
+ */
5
+ declare function main(projectDir: string): Promise<void>;
6
+
7
+ export { main as default };
@@ -0,0 +1,9 @@
1
+ import {
2
+ log_build_default
3
+ } from "../chunk-6VJTKPOS.js";
4
+ import "../chunk-BT6ILNB3.js";
5
+ import "../chunk-DMGFALQN.js";
6
+ import "../chunk-E7TXTI7G.js";
7
+ export {
8
+ log_build_default as default
9
+ };
@@ -0,0 +1,286 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/catalog-to-astro-content-directory.js
31
+ var catalog_to_astro_content_directory_exports = {};
32
+ __export(catalog_to_astro_content_directory_exports, {
33
+ catalogToAstro: () => catalogToAstro
34
+ });
35
+ module.exports = __toCommonJS(catalog_to_astro_content_directory_exports);
36
+
37
+ // node_modules/tsup/assets/cjs_shims.js
38
+ var getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
39
+ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
40
+
41
+ // src/catalog-to-astro-content-directory.js
42
+ var import_glob = require("glob");
43
+ var path3 = __toESM(require("path"), 1);
44
+ var import_fs = __toESM(require("fs"), 1);
45
+ var import_url2 = require("url");
46
+ var import_node_os = __toESM(require("os"), 1);
47
+
48
+ // src/eventcatalog-config-file-utils.js
49
+ var import_promises = require("fs/promises");
50
+ var import_node_fs = require("fs");
51
+ var import_promises2 = require("fs/promises");
52
+ var import_node_path = __toESM(require("path"), 1);
53
+ var import_uuid = require("uuid");
54
+ var import_url = require("url");
55
+ var import_gray_matter = __toESM(require("gray-matter"), 1);
56
+ async function cleanup(projectDirectory) {
57
+ const filePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs");
58
+ if ((0, import_node_fs.existsSync)(filePath)) {
59
+ await (0, import_promises.rm)(filePath);
60
+ }
61
+ }
62
+ var getEventCatalogConfigFile = async (projectDirectory) => {
63
+ try {
64
+ let configFilePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.js");
65
+ const filePath = import_node_path.default.join(projectDirectory, "package.json");
66
+ const packageJson = JSON.parse(await (0, import_promises.readFile)(filePath, "utf-8"));
67
+ if (packageJson?.type !== "module") {
68
+ await (0, import_promises2.copyFile)(configFilePath, import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs"));
69
+ configFilePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs");
70
+ }
71
+ const configFileURL = (0, import_url.pathToFileURL)(configFilePath).href;
72
+ const config = await import(
73
+ /* @vite-ignore */
74
+ configFileURL
75
+ );
76
+ return config.default;
77
+ } finally {
78
+ await cleanup(projectDirectory);
79
+ }
80
+ };
81
+ var writeEventCatalogConfigFile = async (projectDirectory, newConfig) => {
82
+ try {
83
+ const configFilePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.js");
84
+ let content = await (0, import_promises.readFile)(configFilePath, "utf8");
85
+ const startIndex = content.indexOf("export default {");
86
+ if (startIndex === -1) {
87
+ return;
88
+ }
89
+ Object.entries(newConfig).forEach(([key, value]) => {
90
+ const valueString = JSON.stringify(value, null, 2).replace(/"/g, "'").replace(/\n/g, "\n ");
91
+ const keyRegex = new RegExp(`(${key}\\s*:)([^,}]+)`, "g");
92
+ if (content.match(keyRegex)) {
93
+ content = content.replace(keyRegex, `$1 ${valueString}`);
94
+ } else {
95
+ const insertPosition = content.indexOf("{", startIndex) + 1;
96
+ content = content.slice(0, insertPosition) + `
97
+ ${key}: ${valueString},` + content.slice(insertPosition);
98
+ }
99
+ });
100
+ await (0, import_promises.writeFile)(configFilePath, content);
101
+ } finally {
102
+ await cleanup(projectDirectory);
103
+ }
104
+ };
105
+ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
106
+ try {
107
+ const config = await getEventCatalogConfigFile(projectDirectory);
108
+ if (!config.cId) {
109
+ await writeEventCatalogConfigFile(projectDirectory, { cId: (0, import_uuid.v4)() });
110
+ }
111
+ } catch (error) {
112
+ }
113
+ };
114
+ function addPropertyToFrontMatter(input, newProperty, newValue) {
115
+ const file = (0, import_gray_matter.default)(input);
116
+ return import_gray_matter.default.stringify(file.content, { ...file.data, [newProperty]: newValue });
117
+ }
118
+
119
+ // src/map-catalog-to-astro.js
120
+ var import_node_path2 = __toESM(require("path"), 1);
121
+ var COLLECTION_KEYS = [
122
+ "events",
123
+ "commands",
124
+ "services",
125
+ "users",
126
+ "teams",
127
+ "domains",
128
+ "flows",
129
+ "pages",
130
+ "changelogs",
131
+ "queries",
132
+ "channels",
133
+ "ubiquitousLanguages"
134
+ ];
135
+ function mapCatalogToAstro({ filePath, astroDir, projectDir }) {
136
+ const relativeFilePath = removeBasePath(filePath, projectDir);
137
+ if (!isCatalogRelated(relativeFilePath)) {
138
+ return [];
139
+ }
140
+ const baseTargetPaths = getBaseTargetPaths(relativeFilePath);
141
+ const relativeTargetPath = getRelativeTargetPath(relativeFilePath);
142
+ return baseTargetPaths.map(
143
+ (base) => import_node_path2.default.join(
144
+ astroDir,
145
+ base,
146
+ relativeTargetPath.replace("index.md", "index.mdx").replace("changelog.md", "changelog.mdx").replace("ubiquitous-language.md", "ubiquitous-language.mdx")
147
+ )
148
+ );
149
+ }
150
+ function removeBasePath(fullPath, basePath) {
151
+ const relativePath = import_node_path2.default.relative(basePath, fullPath);
152
+ return relativePath.startsWith("..") ? fullPath : relativePath;
153
+ }
154
+ function isCollectionKey(key) {
155
+ return COLLECTION_KEYS.includes(key);
156
+ }
157
+ function isCatalogRelated(filePath) {
158
+ const filePathArr = filePath.split(import_node_path2.default.sep).filter(Boolean);
159
+ if ([
160
+ "eventcatalog.config.js",
161
+ // config file at root
162
+ "eventcatalog.styles.css",
163
+ // custom styles file at root
164
+ "components",
165
+ // custom components
166
+ "public",
167
+ // public assets
168
+ ...COLLECTION_KEYS
169
+ ].includes(filePathArr[0])) {
170
+ return true;
171
+ }
172
+ return false;
173
+ }
174
+ function getBaseTargetPaths(filePath) {
175
+ const filePathArr = filePath.split(import_node_path2.default.sep).filter(Boolean);
176
+ if (isCollectionKey(filePathArr[0])) {
177
+ if (filePathArr[filePathArr.length - 1] == "changelog.md") {
178
+ return [import_node_path2.default.join("src", "content", "changelogs")];
179
+ }
180
+ if (filePathArr[filePathArr.length - 1] == "ubiquitous-language.md") {
181
+ return [import_node_path2.default.join("src", "content", "ubiquitousLanguages")];
182
+ }
183
+ if (filePathArr[filePathArr.length - 1].match(/\.md$/)) {
184
+ return [import_node_path2.default.join("src", "content")];
185
+ }
186
+ const hasExtension = (str) => /\.[a-zA-Z0-9]{2,}$/.test(str);
187
+ if (hasExtension(filePath)) {
188
+ return [import_node_path2.default.join("public", "generated"), import_node_path2.default.join("src", "catalog-files")];
189
+ }
190
+ return [import_node_path2.default.join("public", "generated"), import_node_path2.default.join("src", "catalog-files"), import_node_path2.default.join("src", "content")];
191
+ }
192
+ if (filePathArr[0] == "components") {
193
+ return [import_node_path2.default.join("src", "custom-defined-components")];
194
+ }
195
+ if (filePathArr[0] == "public") {
196
+ return [import_node_path2.default.join("public")];
197
+ }
198
+ return [import_node_path2.default.join("/")];
199
+ }
200
+ function getRelativeTargetPath(filePath) {
201
+ const filePathArr = filePath.split(import_node_path2.default.sep).filter(Boolean);
202
+ if (filePathArr[0] == "public" || filePathArr[0] == "components") {
203
+ filePathArr.shift();
204
+ }
205
+ const relativePath = [];
206
+ for (let i = filePathArr.length - 1; i >= 0; i--) {
207
+ relativePath.unshift(filePathArr[i]);
208
+ if (isCollectionKey(filePathArr[i])) break;
209
+ }
210
+ return import_node_path2.default.join(...relativePath);
211
+ }
212
+
213
+ // src/catalog-to-astro-content-directory.js
214
+ var __filename2 = (0, import_url2.fileURLToPath)(importMetaUrl);
215
+ var rootPkg = path3.resolve(path3.dirname(__filename2), "../");
216
+ var copyFiles = async (source, target) => {
217
+ const files = await (0, import_glob.glob)(path3.join(source, "**"), {
218
+ nodir: true,
219
+ windowsPathsNoEscape: import_node_os.default.platform() == "win32"
220
+ });
221
+ for (const file of files) {
222
+ mapCatalogToAstro({
223
+ filePath: file,
224
+ astroDir: target,
225
+ projectDir: source
226
+ }).map((astroPath) => {
227
+ import_fs.default.cpSync(file, astroPath);
228
+ return { oldPath: file, newPath: astroPath };
229
+ }).map(({ oldPath, newPath }) => {
230
+ if (!oldPath.endsWith(".md") && !oldPath.endsWith(".mdx")) return;
231
+ try {
232
+ const content = import_fs.default.readFileSync(newPath, "utf-8");
233
+ const frontmatter = addPropertyToFrontMatter(content, "pathToFile", oldPath);
234
+ import_fs.default.writeFileSync(newPath, frontmatter);
235
+ } catch (error) {
236
+ }
237
+ });
238
+ }
239
+ };
240
+ var ensureAstroCollectionNotEmpty = async (astroDir) => {
241
+ const COLLECTIONS = [
242
+ "events",
243
+ "commands",
244
+ "services",
245
+ "users",
246
+ "teams",
247
+ "domains",
248
+ "flows",
249
+ "pages",
250
+ "changelogs",
251
+ "queries",
252
+ "channels",
253
+ "ubiquitousLanguages"
254
+ ];
255
+ const emptyCollections = [];
256
+ for (const collection of COLLECTIONS) {
257
+ const markdownFiles = await (0, import_glob.glob)(path3.join(astroDir, "src/content/", collection, "**"), {
258
+ nodir: true,
259
+ windowsPathsNoEscape: import_node_os.default.platform() == "win32"
260
+ });
261
+ if (markdownFiles.length === 0) emptyCollections.push(collection);
262
+ }
263
+ const defaultCollectionFilesDir = path3.join(rootPkg, "default-files-for-collections");
264
+ for (const collection of emptyCollections) {
265
+ const defaultFile = path3.join(defaultCollectionFilesDir, `${collection}.md`);
266
+ const targetDir = path3.join(astroDir, "src/content/", collection);
267
+ if (!import_fs.default.existsSync(targetDir)) {
268
+ import_fs.default.mkdirSync(targetDir, { recursive: true });
269
+ }
270
+ import_fs.default.cpSync(defaultFile, path3.join(targetDir, `${collection}.md`));
271
+ }
272
+ };
273
+ var catalogToAstro = async (source, astroDir) => {
274
+ const astroContentDir = path3.join(astroDir, "src/content/");
275
+ const astroConfigFile = import_fs.default.readFileSync(path3.join(astroContentDir, "config.ts"));
276
+ import_fs.default.rmSync(astroContentDir, { recursive: true });
277
+ import_fs.default.mkdirSync(astroContentDir);
278
+ import_fs.default.writeFileSync(path3.join(astroContentDir, "config.ts"), astroConfigFile);
279
+ await verifyRequiredFieldsAreInCatalogConfigFile(source);
280
+ await copyFiles(source, astroDir);
281
+ await ensureAstroCollectionNotEmpty(astroDir);
282
+ };
283
+ // Annotate the CommonJS export names for ESM import in node:
284
+ 0 && (module.exports = {
285
+ catalogToAstro
286
+ });
@@ -0,0 +1,3 @@
1
+ declare function catalogToAstro(source: any, astroDir: any): Promise<void>;
2
+
3
+ export { catalogToAstro };
@@ -0,0 +1,3 @@
1
+ declare function catalogToAstro(source: any, astroDir: any): Promise<void>;
2
+
3
+ export { catalogToAstro };
@@ -0,0 +1,8 @@
1
+ import {
2
+ catalogToAstro
3
+ } from "./chunk-55YPRY5U.js";
4
+ import "./chunk-E7TXTI7G.js";
5
+ import "./chunk-5RNDOKYT.js";
6
+ export {
7
+ catalogToAstro
8
+ };