@eventcatalog/core 2.14.3 → 2.15.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 (229) hide show
  1. package/README.md +2 -1
  2. package/bin/eventcatalog.js +2 -0
  3. package/dist/analytics/analytics.cjs +71 -0
  4. package/dist/analytics/analytics.d.cts +3 -0
  5. package/dist/analytics/analytics.d.ts +3 -0
  6. package/dist/analytics/analytics.js +7 -0
  7. package/dist/analytics/log-build.cjs +155 -0
  8. package/dist/analytics/log-build.d.cts +7 -0
  9. package/dist/analytics/log-build.d.ts +7 -0
  10. package/dist/analytics/log-build.js +9 -0
  11. package/dist/catalog-to-astro-content-directory.cjs +277 -0
  12. package/dist/catalog-to-astro-content-directory.d.cts +3 -0
  13. package/dist/catalog-to-astro-content-directory.d.ts +3 -0
  14. package/dist/catalog-to-astro-content-directory.js +8 -0
  15. package/dist/chunk-65VQIGAP.js +33 -0
  16. package/{scripts/watcher.js → dist/chunk-7HYM3M5I.js} +29 -52
  17. package/dist/chunk-E7TXTI7G.js +78 -0
  18. package/dist/chunk-KI4KAUWW.js +30 -0
  19. package/dist/chunk-O6BGVVOW.js +86 -0
  20. package/dist/chunk-PK2EQVPD.js +89 -0
  21. package/dist/chunk-TGOUSS6C.js +9 -0
  22. package/dist/chunk-YEQVKHST.js +56 -0
  23. package/dist/constants.cjs +35 -0
  24. package/dist/constants.d.cts +3 -0
  25. package/dist/constants.d.ts +3 -0
  26. package/dist/constants.js +6 -0
  27. package/dist/eventcatalog-config-file-utils.cjs +116 -0
  28. package/dist/eventcatalog-config-file-utils.d.cts +7 -0
  29. package/dist/eventcatalog-config-file-utils.d.ts +7 -0
  30. package/dist/eventcatalog-config-file-utils.js +14 -0
  31. package/{bin/dist → dist}/eventcatalog.cjs +23 -33
  32. package/{bin/dist → dist}/eventcatalog.config.cjs +1 -1
  33. package/dist/eventcatalog.config.js +0 -0
  34. package/dist/eventcatalog.d.cts +2 -0
  35. package/dist/eventcatalog.d.ts +2 -0
  36. package/dist/eventcatalog.js +116 -0
  37. package/dist/generate.cjs +121 -0
  38. package/dist/generate.d.cts +3 -0
  39. package/dist/generate.d.ts +3 -0
  40. package/dist/generate.js +7 -0
  41. package/dist/map-catalog-to-astro.cjs +123 -0
  42. package/dist/map-catalog-to-astro.d.cts +28 -0
  43. package/dist/map-catalog-to-astro.d.ts +28 -0
  44. package/dist/map-catalog-to-astro.js +6 -0
  45. package/dist/watcher.cjs +223 -0
  46. package/dist/watcher.d.cts +21 -0
  47. package/dist/watcher.d.ts +21 -0
  48. package/dist/watcher.js +8 -0
  49. package/{src → eventcatalog/src}/components/MDX/NodeGraph/NodeGraph.tsx +27 -38
  50. package/eventcatalog/src/hooks/eventcatalog-visualizer.ts +89 -0
  51. package/{src → eventcatalog/src}/utils/node-graphs/message-node-graph.ts +2 -27
  52. package/{src → eventcatalog/src}/utils/node-graphs/utils/utils.ts +60 -3
  53. package/package.json +10 -3
  54. package/.all-contributorsrc +0 -436
  55. package/.changeset/config.json +0 -11
  56. package/.github/CODEOWNERS +0 -3
  57. package/.github/ISSUE_TEMPLATE/bug.yml +0 -84
  58. package/.github/ISSUE_TEMPLATE/config.yml +0 -5
  59. package/.github/ISSUE_TEMPLATE/feature.yml +0 -48
  60. package/.github/PULL_REQUEST_TEMPLATE.md +0 -14
  61. package/.github/funding.yml +0 -1
  62. package/.github/workflows/lint.yml +0 -22
  63. package/.github/workflows/release.yml +0 -34
  64. package/.github/workflows/test-bin.yml +0 -29
  65. package/.github/workflows/test-e2e.yml +0 -27
  66. package/.github/workflows/verify-build.yml +0 -28
  67. package/.prettierignore +0 -7
  68. package/.prettierrc +0 -18
  69. package/CHANGELOG.md +0 -1296
  70. package/bin/dist/eventcatalog.d.cts +0 -1
  71. package/bin/dist/eventcatalog.d.ts +0 -1
  72. package/bin/dist/eventcatalog.js +0 -531
  73. package/bin/eventcatalog.config.ts +0 -34
  74. package/images/example.png +0 -0
  75. package/images/sponsors/gravitee-logo-black.svg +0 -54
  76. package/images/sponsors/hookdeck.svg +0 -11
  77. package/images/sponsors/oso-logo-green.png +0 -0
  78. package/scripts/analytics/analytics.js +0 -31
  79. package/scripts/analytics/log-build.js +0 -26
  80. package/scripts/build-ci.js +0 -27
  81. package/scripts/catalog-to-astro-content-directory.js +0 -115
  82. package/scripts/ci/test.js +0 -24
  83. package/scripts/constants.ts +0 -3
  84. package/scripts/eventcatalog-config-file-utils.js +0 -89
  85. package/scripts/generate.js +0 -65
  86. package/scripts/map-catalog-to-astro.js +0 -174
  87. package/scripts/start-catalog-locally.js +0 -26
  88. /package/{bin/dist → dist}/eventcatalog.config.d.cts +0 -0
  89. /package/{bin/dist → dist}/eventcatalog.config.d.ts +0 -0
  90. /package/{astro.config.mjs → eventcatalog/astro.config.mjs} +0 -0
  91. /package/{global.d.ts → eventcatalog/global.d.ts} +0 -0
  92. /package/{public → eventcatalog/public}/favicon.ico +0 -0
  93. /package/{public → eventcatalog/public}/icons/asyncapi.svg +0 -0
  94. /package/{public → eventcatalog/public}/icons/discord.svg +0 -0
  95. /package/{public → eventcatalog/public}/icons/github-purple.svg +0 -0
  96. /package/{public → eventcatalog/public}/icons/github.svg +0 -0
  97. /package/{public → eventcatalog/public}/icons/ms-teams.svg +0 -0
  98. /package/{public → eventcatalog/public}/icons/openapi.svg +0 -0
  99. /package/{public → eventcatalog/public}/icons/protocols/kafka.svg +0 -0
  100. /package/{public → eventcatalog/public}/icons/x-twitter.svg +0 -0
  101. /package/{public → eventcatalog/public}/icons/youtube.svg +0 -0
  102. /package/{public → eventcatalog/public}/logo.png +0 -0
  103. /package/{public → eventcatalog/public}/openapi.yml +0 -0
  104. /package/{public → eventcatalog/public}/opengraph.png +0 -0
  105. /package/{public → eventcatalog/public}/slack-icon.svg +0 -0
  106. /package/{src → eventcatalog/src}/components/DiscoverInsight.astro +0 -0
  107. /package/{src → eventcatalog/src}/components/DocsNavigation.astro +0 -0
  108. /package/{src → eventcatalog/src}/components/Header.astro +0 -0
  109. /package/{src → eventcatalog/src}/components/Lists/OwnersList.tsx +0 -0
  110. /package/{src → eventcatalog/src}/components/Lists/PillList.tsx +0 -0
  111. /package/{src → eventcatalog/src}/components/Lists/PillListFlat.styles.css +0 -0
  112. /package/{src → eventcatalog/src}/components/Lists/PillListFlat.tsx +0 -0
  113. /package/{src → eventcatalog/src}/components/Lists/ProtocolList.tsx +0 -0
  114. /package/{src → eventcatalog/src}/components/Lists/RepositoryList.astro +0 -0
  115. /package/{src → eventcatalog/src}/components/Lists/SpecificationsList.astro +0 -0
  116. /package/{src → eventcatalog/src}/components/Lists/VersionList.astro +0 -0
  117. /package/{src → eventcatalog/src}/components/MDX/Accordion/Accordion.astro +0 -0
  118. /package/{src → eventcatalog/src}/components/MDX/Accordion/Accordion.tsx +0 -0
  119. /package/{src → eventcatalog/src}/components/MDX/Accordion/AccordionGroup.astro +0 -0
  120. /package/{src → eventcatalog/src}/components/MDX/Admonition.tsx +0 -0
  121. /package/{src → eventcatalog/src}/components/MDX/AsyncAPI/AsyncAPI.astro +0 -0
  122. /package/{src → eventcatalog/src}/components/MDX/ChannelInformation/ChannelInformation.tsx +0 -0
  123. /package/{src → eventcatalog/src}/components/MDX/File.tsx +0 -0
  124. /package/{src → eventcatalog/src}/components/MDX/Flow/Flow.astro +0 -0
  125. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/DownloadButton.tsx +0 -0
  126. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Edges/AnimatedMessageEdge.tsx +0 -0
  127. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/NodeGraph.astro +0 -0
  128. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/NodeGraphPortal.tsx +0 -0
  129. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/Channel.tsx +0 -0
  130. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/Command.tsx +0 -0
  131. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/Event.tsx +0 -0
  132. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/ExternalSystem.tsx +0 -0
  133. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/Query.tsx +0 -0
  134. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/Service.tsx +0 -0
  135. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/Step.tsx +0 -0
  136. /package/{src → eventcatalog/src}/components/MDX/NodeGraph/Nodes/User.tsx +0 -0
  137. /package/{src → eventcatalog/src}/components/MDX/OpenAPI/OpenAPI.astro +0 -0
  138. /package/{src → eventcatalog/src}/components/MDX/Schema.astro +0 -0
  139. /package/{src → eventcatalog/src}/components/MDX/SchemaViewer/SchemaViewer.astro +0 -0
  140. /package/{src → eventcatalog/src}/components/MDX/SchemaViewer/SchemaViewer.tsx +0 -0
  141. /package/{src → eventcatalog/src}/components/MDX/SchemaViewer/SchemaViewerPortal.tsx +0 -0
  142. /package/{src → eventcatalog/src}/components/MDX/Steps/Step.astro +0 -0
  143. /package/{src → eventcatalog/src}/components/MDX/Steps/Steps.astro +0 -0
  144. /package/{src → eventcatalog/src}/components/MDX/Tiles/Tile.astro +0 -0
  145. /package/{src → eventcatalog/src}/components/MDX/Tiles/Tiles.astro +0 -0
  146. /package/{src → eventcatalog/src}/components/MDX/components.tsx +0 -0
  147. /package/{src → eventcatalog/src}/components/MDX/page-components.tsx +0 -0
  148. /package/{src → eventcatalog/src}/components/Search.astro +0 -0
  149. /package/{src → eventcatalog/src}/components/Seo.astro +0 -0
  150. /package/{src → eventcatalog/src}/components/SideBars/CatalogResourcesSideBar/index.tsx +0 -0
  151. /package/{src → eventcatalog/src}/components/SideBars/CatalogResourcesSideBar/styles.css +0 -0
  152. /package/{src → eventcatalog/src}/components/SideBars/ChannelSideBar.astro +0 -0
  153. /package/{src → eventcatalog/src}/components/SideBars/DomainSideBar.astro +0 -0
  154. /package/{src → eventcatalog/src}/components/SideBars/MessageSideBar.astro +0 -0
  155. /package/{src → eventcatalog/src}/components/SideBars/ServiceSideBar.astro +0 -0
  156. /package/{src → eventcatalog/src}/components/Tables/DebouncedInput.tsx +0 -0
  157. /package/{src → eventcatalog/src}/components/Tables/Table.tsx +0 -0
  158. /package/{src → eventcatalog/src}/components/Tables/columns/DomainTableColumns.tsx +0 -0
  159. /package/{src → eventcatalog/src}/components/Tables/columns/FlowTableColumns.tsx +0 -0
  160. /package/{src → eventcatalog/src}/components/Tables/columns/MessageTableColumns.tsx +0 -0
  161. /package/{src → eventcatalog/src}/components/Tables/columns/ServiceTableColumns.tsx +0 -0
  162. /package/{src → eventcatalog/src}/components/Tables/columns/index.tsx +0 -0
  163. /package/{src → eventcatalog/src}/components/Tables/filters/custom-filters.ts +0 -0
  164. /package/{src → eventcatalog/src}/content/config.ts +0 -0
  165. /package/{src → eventcatalog/src}/env.d.ts +0 -0
  166. /package/{src → eventcatalog/src}/icons/protocols/WebSocket.svg +0 -0
  167. /package/{src → eventcatalog/src}/icons/protocols/amqp.svg +0 -0
  168. /package/{src → eventcatalog/src}/icons/protocols/eventbridge.svg +0 -0
  169. /package/{src → eventcatalog/src}/icons/protocols/googlepubsub.svg +0 -0
  170. /package/{src → eventcatalog/src}/icons/protocols/http.svg +0 -0
  171. /package/{src → eventcatalog/src}/icons/protocols/index.ts +0 -0
  172. /package/{src → eventcatalog/src}/icons/protocols/jms.svg +0 -0
  173. /package/{src → eventcatalog/src}/icons/protocols/kafka.svg +0 -0
  174. /package/{src → eventcatalog/src}/icons/protocols/mercure.svg +0 -0
  175. /package/{src → eventcatalog/src}/icons/protocols/mqtt.svg +0 -0
  176. /package/{src → eventcatalog/src}/icons/protocols/nats.svg +0 -0
  177. /package/{src → eventcatalog/src}/icons/protocols/pulsar.svg +0 -0
  178. /package/{src → eventcatalog/src}/icons/protocols/redis.svg +0 -0
  179. /package/{src → eventcatalog/src}/icons/protocols/sns.svg +0 -0
  180. /package/{src → eventcatalog/src}/icons/protocols/solace.svg +0 -0
  181. /package/{src → eventcatalog/src}/icons/protocols/sqs.svg +0 -0
  182. /package/{src → eventcatalog/src}/icons/protocols/ws.svg +0 -0
  183. /package/{src → eventcatalog/src}/layouts/CustomDocsPageLayout.astro +0 -0
  184. /package/{src → eventcatalog/src}/layouts/DiscoverLayout.astro +0 -0
  185. /package/{src → eventcatalog/src}/layouts/Footer.astro +0 -0
  186. /package/{src → eventcatalog/src}/layouts/PlainPage.astro +0 -0
  187. /package/{src → eventcatalog/src}/layouts/VerticalSideBarLayout.astro +0 -0
  188. /package/{src → eventcatalog/src}/layouts/VisualiserLayout.astro +0 -0
  189. /package/{src → eventcatalog/src}/pages/discover/[type]/index.astro +0 -0
  190. /package/{src → eventcatalog/src}/pages/docs/[type]/[id]/[version]/asyncapi/index.astro +0 -0
  191. /package/{src → eventcatalog/src}/pages/docs/[type]/[id]/[version]/changelog/index.astro +0 -0
  192. /package/{src → eventcatalog/src}/pages/docs/[type]/[id]/[version]/index.astro +0 -0
  193. /package/{src → eventcatalog/src}/pages/docs/[type]/[id]/[version]/spec/_styles.css +0 -0
  194. /package/{src → eventcatalog/src}/pages/docs/[type]/[id]/[version]/spec/index.astro +0 -0
  195. /package/{src → eventcatalog/src}/pages/docs/[type]/[id]/index.astro +0 -0
  196. /package/{src → eventcatalog/src}/pages/docs/index.astro +0 -0
  197. /package/{src → eventcatalog/src}/pages/docs/teams/[id]/index.astro +0 -0
  198. /package/{src → eventcatalog/src}/pages/docs/users/[id]/index.astro +0 -0
  199. /package/{src → eventcatalog/src}/pages/index.astro +0 -0
  200. /package/{src → eventcatalog/src}/pages/visualiser/[type]/[id]/[version]/index.astro +0 -0
  201. /package/{src → eventcatalog/src}/pages/visualiser/[type]/[id]/index.astro +0 -0
  202. /package/{src → eventcatalog/src}/remark-plugins/mermaid.ts +0 -0
  203. /package/{src → eventcatalog/src}/types/index.ts +0 -0
  204. /package/{src → eventcatalog/src}/utils/channels.ts +0 -0
  205. /package/{src → eventcatalog/src}/utils/collections/changelogs.ts +0 -0
  206. /package/{src → eventcatalog/src}/utils/collections/domains.ts +0 -0
  207. /package/{src → eventcatalog/src}/utils/collections/file-diffs.ts +0 -0
  208. /package/{src → eventcatalog/src}/utils/collections/flows.ts +0 -0
  209. /package/{src → eventcatalog/src}/utils/collections/icons.ts +0 -0
  210. /package/{src → eventcatalog/src}/utils/collections/services.ts +0 -0
  211. /package/{src → eventcatalog/src}/utils/collections/util.ts +0 -0
  212. /package/{src → eventcatalog/src}/utils/collections/versions.ts +0 -0
  213. /package/{src → eventcatalog/src}/utils/colors.ts +0 -0
  214. /package/{src → eventcatalog/src}/utils/commands.ts +0 -0
  215. /package/{src → eventcatalog/src}/utils/eventcatalog-config/catalog.ts +0 -0
  216. /package/{src → eventcatalog/src}/utils/events.ts +0 -0
  217. /package/{src → eventcatalog/src}/utils/example-remark-plugin.mjs +0 -0
  218. /package/{src → eventcatalog/src}/utils/messages.ts +0 -0
  219. /package/{src → eventcatalog/src}/utils/node-graphs/domains-node-graph.ts +0 -0
  220. /package/{src → eventcatalog/src}/utils/node-graphs/flows-node-graph.ts +0 -0
  221. /package/{src → eventcatalog/src}/utils/node-graphs/services-node-graph.ts +0 -0
  222. /package/{src → eventcatalog/src}/utils/page-loaders/page-data-loader.ts +0 -0
  223. /package/{src → eventcatalog/src}/utils/pages.ts +0 -0
  224. /package/{src → eventcatalog/src}/utils/queries.ts +0 -0
  225. /package/{src → eventcatalog/src}/utils/teams.ts +0 -0
  226. /package/{src → eventcatalog/src}/utils/url-builder.ts +0 -0
  227. /package/{src → eventcatalog/src}/utils/users.ts +0 -0
  228. /package/{tailwind.config.mjs → eventcatalog/tailwind.config.mjs} +0 -0
  229. /package/{tsconfig.json → eventcatalog/tsconfig.json} +0 -0
@@ -0,0 +1,14 @@
1
+ import {
2
+ addPropertyToFrontMatter,
3
+ cleanup,
4
+ getEventCatalogConfigFile,
5
+ verifyRequiredFieldsAreInCatalogConfigFile,
6
+ writeEventCatalogConfigFile
7
+ } from "./chunk-E7TXTI7G.js";
8
+ export {
9
+ addPropertyToFrontMatter,
10
+ cleanup,
11
+ getEventCatalogConfigFile,
12
+ verifyRequiredFieldsAreInCatalogConfigFile,
13
+ writeEventCatalogConfigFile
14
+ };
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  "use strict";
3
2
  var __create = Object.create;
4
3
  var __defProp = Object.defineProperty;
@@ -27,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
26
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
28
27
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
29
28
 
30
- // bin/eventcatalog.ts
29
+ // src/eventcatalog.ts
31
30
  var import_commander = require("commander");
32
31
  var import_node_child_process = require("child_process");
33
32
  var import_node_path4 = require("path");
@@ -36,10 +35,10 @@ var import_node_path5 = __toESM(require("path"), 1);
36
35
  var import_node_url = require("url");
37
36
  var import_concurrently = __toESM(require("concurrently"), 1);
38
37
 
39
- // scripts/generate.js
38
+ // src/generate.js
40
39
  var import_node_path2 = __toESM(require("path"), 1);
41
40
 
42
- // scripts/eventcatalog-config-file-utils.js
41
+ // src/eventcatalog-config-file-utils.js
43
42
  var import_promises = require("fs/promises");
44
43
  var import_node_fs = require("fs");
45
44
  var import_promises2 = require("fs/promises");
@@ -110,7 +109,7 @@ function addPropertyToFrontMatter(input, newProperty, newValue) {
110
109
  return import_gray_matter.default.stringify(file.content, { ...file.data, [newProperty]: newValue });
111
110
  }
112
111
 
113
- // scripts/generate.js
112
+ // src/generate.js
114
113
  function getDefaultExport(importedModule) {
115
114
  if (importedModule === null || typeof importedModule !== "object") {
116
115
  throw new Error("Invalid module");
@@ -157,17 +156,17 @@ var generate = async (PROJECT_DIRECTORY) => {
157
156
  }
158
157
  };
159
158
 
160
- // scripts/analytics/analytics.js
159
+ // src/analytics/analytics.js
161
160
  var import_axios = __toESM(require("axios"), 1);
162
161
  var import_os = __toESM(require("os"), 1);
163
162
 
164
163
  // package.json
165
- var version = "2.14.3";
164
+ var version = "2.15.0";
166
165
 
167
- // scripts/constants.ts
166
+ // src/constants.ts
168
167
  var VERSION = version;
169
168
 
170
- // scripts/analytics/analytics.js
169
+ // src/analytics/analytics.js
171
170
  async function raiseEvent(eventData) {
172
171
  const url = "https://queue.simpleanalyticscdn.com/events";
173
172
  const userAgent = `@eventcatalog/eventcatalog@${VERSION} (${import_os.default.platform()}; ${import_os.default.arch()}; Node/${process.version})`;
@@ -191,7 +190,7 @@ async function raiseEvent(eventData) {
191
190
  }
192
191
  }
193
192
 
194
- // scripts/analytics/log-build.js
193
+ // src/analytics/log-build.js
195
194
  var main = async (projectDir) => {
196
195
  if (process.env.NODE_ENV === "CI") return;
197
196
  try {
@@ -210,11 +209,11 @@ var main = async (projectDir) => {
210
209
  };
211
210
  var log_build_default = main;
212
211
 
213
- // scripts/watcher.js
212
+ // src/watcher.js
214
213
  var import_watcher = __toESM(require("@parcel/watcher"), 1);
215
214
  var import_node_fs2 = __toESM(require("fs"), 1);
216
215
 
217
- // scripts/map-catalog-to-astro.js
216
+ // src/map-catalog-to-astro.js
218
217
  var import_node_path3 = __toESM(require("path"), 1);
219
218
  var COLLECTION_KEYS = [
220
219
  "events",
@@ -300,7 +299,7 @@ function getRelativeTargetPath(filePath) {
300
299
  return import_node_path3.default.join(...relativePath);
301
300
  }
302
301
 
303
- // scripts/watcher.js
302
+ // src/watcher.js
304
303
  var import_rimraf = require("rimraf");
305
304
  async function watch(projectDirectory, catalogDirectory, callback = void 0) {
306
305
  const subscription = await import_watcher.default.subscribe(
@@ -382,25 +381,14 @@ function retryEPERM(fn) {
382
381
  };
383
382
  }
384
383
 
385
- // scripts/catalog-to-astro-content-directory.js
384
+ // src/catalog-to-astro-content-directory.js
386
385
  var import_glob = require("glob");
387
386
  var path4 = __toESM(require("path"), 1);
388
387
  var import_fs = __toESM(require("fs"), 1);
389
388
  var import_url2 = require("url");
390
389
  var import_node_os = __toESM(require("os"), 1);
391
390
  var __filename2 = (0, import_url2.fileURLToPath)(importMetaUrl);
392
- var rootPkg = path4.resolve(
393
- path4.dirname(__filename2),
394
- /**
395
- * TODO: fix me =0
396
- *
397
- * The following is a workaround until organize the structure to have the correct path
398
- * for any value of NODE_ENV
399
- *
400
- * @author carlosallexandre
401
- */
402
- process.env.NODE_ENV === "test" ? "../" : "../../"
403
- );
391
+ var rootPkg = path4.resolve(path4.dirname(__filename2), "../");
404
392
  var copyFiles = async (source, target) => {
405
393
  const files = await (0, import_glob.glob)(path4.join(source, "**"), {
406
394
  nodir: true,
@@ -468,12 +456,12 @@ var catalogToAstro = async (source, astroDir) => {
468
456
  await ensureAstroCollectionNotEmpty(astroDir);
469
457
  };
470
458
 
471
- // bin/eventcatalog.ts
459
+ // src/eventcatalog.ts
472
460
  var currentDir = import_node_path5.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl));
473
461
  var program = new import_commander.Command().version(VERSION);
474
462
  var dir = import_node_path5.default.resolve(process.env.PROJECT_DIR || process.cwd());
475
463
  var core = import_node_path5.default.resolve(process.env.CATALOG_DIR || (0, import_node_path4.join)(dir, ".eventcatalog-core"));
476
- var eventCatalogDir = import_node_path5.default.resolve((0, import_node_path4.join)(currentDir, "../../"));
464
+ var eventCatalogDir = import_node_path5.default.resolve((0, import_node_path4.join)(currentDir, "../eventcatalog/"));
477
465
  program.name("eventcatalog").description("Documentation tool for event-driven architectures");
478
466
  var ensureDir = (dir2) => {
479
467
  if (!import_fs2.default.existsSync(dir2)) {
@@ -512,7 +500,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
512
500
  const { result } = (0, import_concurrently.default)([
513
501
  {
514
502
  name: "astro",
515
- command: "npm run dev",
503
+ command: "npx astro dev",
516
504
  cwd: core,
517
505
  env: {
518
506
  PROJECT_DIR: dir,
@@ -532,14 +520,13 @@ program.command("build").description("Run build of EventCatalog").action(async (
532
520
  copyCore();
533
521
  await log_build_default(dir);
534
522
  await catalogToAstro(dir, core);
535
- (0, import_node_child_process.execSync)(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npm run build`, {
523
+ (0, import_node_child_process.execSync)(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro build`, {
536
524
  cwd: core,
537
525
  stdio: "inherit"
538
526
  });
539
527
  });
540
528
  var previewCatalog = () => {
541
- copyCore();
542
- (0, import_node_child_process.execSync)(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npm run preview -- --root ${dir} --port 3000`, {
529
+ (0, import_node_child_process.execSync)(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro preview --root ${dir} --port 3000`, {
543
530
  cwd: core,
544
531
  stdio: "inherit"
545
532
  });
@@ -555,4 +542,7 @@ program.command("start").description("Serves the contents of your eventcatalog b
555
542
  program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
556
543
  await generate(dir);
557
544
  });
558
- program.parseAsync();
545
+ program.parseAsync().then(() => process.exit(0)).catch((err) => {
546
+ console.error(err);
547
+ process.exit(1);
548
+ });
@@ -13,6 +13,6 @@ var __copyProps = (to, from, except, desc) => {
13
13
  };
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
 
16
- // bin/eventcatalog.config.ts
16
+ // src/eventcatalog.config.ts
17
17
  var eventcatalog_config_exports = {};
18
18
  module.exports = __toCommonJS(eventcatalog_config_exports);
File without changes
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,116 @@
1
+ import {
2
+ log_build_default
3
+ } from "./chunk-KI4KAUWW.js";
4
+ import "./chunk-65VQIGAP.js";
5
+ import {
6
+ catalogToAstro
7
+ } from "./chunk-O6BGVVOW.js";
8
+ import {
9
+ VERSION
10
+ } from "./chunk-TGOUSS6C.js";
11
+ import {
12
+ generate
13
+ } from "./chunk-YEQVKHST.js";
14
+ import {
15
+ watch
16
+ } from "./chunk-7HYM3M5I.js";
17
+ import "./chunk-E7TXTI7G.js";
18
+ import "./chunk-PK2EQVPD.js";
19
+
20
+ // src/eventcatalog.ts
21
+ import { Command } from "commander";
22
+ import { execSync } from "node:child_process";
23
+ import { join } from "node:path";
24
+ import fs from "fs";
25
+ import path from "node:path";
26
+ import { fileURLToPath } from "node:url";
27
+ import concurrently from "concurrently";
28
+ var currentDir = path.dirname(fileURLToPath(import.meta.url));
29
+ var program = new Command().version(VERSION);
30
+ var dir = path.resolve(process.env.PROJECT_DIR || process.cwd());
31
+ var core = path.resolve(process.env.CATALOG_DIR || join(dir, ".eventcatalog-core"));
32
+ var eventCatalogDir = path.resolve(join(currentDir, "../eventcatalog/"));
33
+ program.name("eventcatalog").description("Documentation tool for event-driven architectures");
34
+ var ensureDir = (dir2) => {
35
+ if (!fs.existsSync(dir2)) {
36
+ fs.mkdirSync(dir2);
37
+ }
38
+ };
39
+ var copyCore = () => {
40
+ ensureDir(core);
41
+ if (eventCatalogDir === core) {
42
+ return;
43
+ }
44
+ fs.cpSync(eventCatalogDir, core, {
45
+ recursive: true,
46
+ filter: (src) => {
47
+ return true;
48
+ }
49
+ });
50
+ };
51
+ var clearCore = () => {
52
+ if (fs.existsSync(core)) fs.rmSync(core, { recursive: true });
53
+ };
54
+ program.command("dev").description("Run development server of EventCatalog").option("-d, --debug", "Output EventCatalog application information into your terminal").option("--force-recreate", "Recreate the eventcatalog-core directory", false).action(async (options) => {
55
+ console.log("Setting up EventCatalog....");
56
+ if (options.debug) {
57
+ console.log("Debug mode enabled");
58
+ console.log("PROJECT_DIR", dir);
59
+ console.log("CATALOG_DIR", core);
60
+ }
61
+ if (options.forceRecreate) clearCore();
62
+ copyCore();
63
+ console.log("EventCatalog is starting at http://localhost:3000/docs");
64
+ await catalogToAstro(dir, core);
65
+ let watchUnsub;
66
+ try {
67
+ watchUnsub = await watch(dir, core);
68
+ const { result } = concurrently([
69
+ {
70
+ name: "astro",
71
+ command: "npx astro dev",
72
+ cwd: core,
73
+ env: {
74
+ PROJECT_DIR: dir,
75
+ CATALOG_DIR: core
76
+ }
77
+ }
78
+ ]);
79
+ await result;
80
+ } catch (err) {
81
+ console.error(err);
82
+ } finally {
83
+ await watchUnsub?.();
84
+ }
85
+ });
86
+ program.command("build").description("Run build of EventCatalog").action(async (options) => {
87
+ console.log("Building EventCatalog...");
88
+ copyCore();
89
+ await log_build_default(dir);
90
+ await catalogToAstro(dir, core);
91
+ execSync(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro build`, {
92
+ cwd: core,
93
+ stdio: "inherit"
94
+ });
95
+ });
96
+ var previewCatalog = () => {
97
+ execSync(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro preview --root ${dir} --port 3000`, {
98
+ cwd: core,
99
+ stdio: "inherit"
100
+ });
101
+ };
102
+ program.command("preview").description("Serves the contents of your eventcatalog build directory").action((options) => {
103
+ console.log("Starting preview of your build...");
104
+ previewCatalog();
105
+ });
106
+ program.command("start").description("Serves the contents of your eventcatalog build directory").action((options) => {
107
+ console.log("Starting preview of your build...");
108
+ previewCatalog();
109
+ });
110
+ program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
111
+ await generate(dir);
112
+ });
113
+ program.parseAsync().then(() => process.exit(0)).catch((err) => {
114
+ console.error(err);
115
+ process.exit(1);
116
+ });
@@ -0,0 +1,121 @@
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/generate.js
31
+ var generate_exports = {};
32
+ __export(generate_exports, {
33
+ generate: () => generate
34
+ });
35
+ module.exports = __toCommonJS(generate_exports);
36
+ var import_node_path2 = __toESM(require("path"), 1);
37
+
38
+ // src/eventcatalog-config-file-utils.js
39
+ var import_promises = require("fs/promises");
40
+ var import_node_fs = require("fs");
41
+ var import_promises2 = require("fs/promises");
42
+ var import_node_path = __toESM(require("path"), 1);
43
+ var import_uuid = require("uuid");
44
+ var import_url = require("url");
45
+ var import_gray_matter = __toESM(require("gray-matter"), 1);
46
+ async function cleanup(projectDirectory) {
47
+ const filePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs");
48
+ if ((0, import_node_fs.existsSync)(filePath)) {
49
+ await (0, import_promises.rm)(filePath);
50
+ }
51
+ }
52
+ var getEventCatalogConfigFile = async (projectDirectory) => {
53
+ try {
54
+ let configFilePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.js");
55
+ const filePath = import_node_path.default.join(projectDirectory, "package.json");
56
+ const packageJson = JSON.parse(await (0, import_promises.readFile)(filePath, "utf-8"));
57
+ if (packageJson?.type !== "module") {
58
+ await (0, import_promises2.copyFile)(configFilePath, import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs"));
59
+ configFilePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs");
60
+ }
61
+ const configFileURL = (0, import_url.pathToFileURL)(configFilePath).href;
62
+ const config = await import(
63
+ /* @vite-ignore */
64
+ configFileURL
65
+ );
66
+ return config.default;
67
+ } finally {
68
+ await cleanup(projectDirectory);
69
+ }
70
+ };
71
+
72
+ // src/generate.js
73
+ function getDefaultExport(importedModule) {
74
+ if (importedModule === null || typeof importedModule !== "object") {
75
+ throw new Error("Invalid module");
76
+ }
77
+ if (typeof importedModule.default === "object" && importedModule.default !== null) {
78
+ return importedModule.default.default || importedModule.default;
79
+ }
80
+ if (typeof importedModule.default !== "undefined") {
81
+ return importedModule.default;
82
+ }
83
+ return importedModule;
84
+ }
85
+ var generate = async (PROJECT_DIRECTORY) => {
86
+ try {
87
+ const config = await getEventCatalogConfigFile(PROJECT_DIRECTORY);
88
+ const { generators = [] } = config;
89
+ if (!generators.length) {
90
+ console.log("No configured generators found, skipping generation");
91
+ return;
92
+ }
93
+ for (const generator of generators) {
94
+ let plugin = generator[0];
95
+ const pluginConfig = generator[1];
96
+ if (plugin.startsWith("./")) {
97
+ plugin = import_node_path2.default.join(PROJECT_DIRECTORY, plugin);
98
+ }
99
+ if (plugin.includes("<rootDir>")) {
100
+ plugin = plugin.replace("<rootDir>", PROJECT_DIRECTORY);
101
+ }
102
+ try {
103
+ const importedGenerator = await import(plugin);
104
+ const generator2 = getDefaultExport(importedGenerator);
105
+ await generator2({ eventCatalogConfig: {} }, pluginConfig);
106
+ } catch (error) {
107
+ console.error("Error loading plugin:", error);
108
+ await cleanup(PROJECT_DIRECTORY);
109
+ return;
110
+ }
111
+ }
112
+ await cleanup(PROJECT_DIRECTORY);
113
+ } catch (error) {
114
+ console.error(error);
115
+ await cleanup(PROJECT_DIRECTORY);
116
+ }
117
+ };
118
+ // Annotate the CommonJS export names for ESM import in node:
119
+ 0 && (module.exports = {
120
+ generate
121
+ });
@@ -0,0 +1,3 @@
1
+ declare function generate(PROJECT_DIRECTORY: any): Promise<void>;
2
+
3
+ export { generate };
@@ -0,0 +1,3 @@
1
+ declare function generate(PROJECT_DIRECTORY: any): Promise<void>;
2
+
3
+ export { generate };
@@ -0,0 +1,7 @@
1
+ import {
2
+ generate
3
+ } from "./chunk-YEQVKHST.js";
4
+ import "./chunk-E7TXTI7G.js";
5
+ export {
6
+ generate
7
+ };
@@ -0,0 +1,123 @@
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/map-catalog-to-astro.js
31
+ var map_catalog_to_astro_exports = {};
32
+ __export(map_catalog_to_astro_exports, {
33
+ mapCatalogToAstro: () => mapCatalogToAstro
34
+ });
35
+ module.exports = __toCommonJS(map_catalog_to_astro_exports);
36
+ var import_node_path = __toESM(require("path"), 1);
37
+ var COLLECTION_KEYS = [
38
+ "events",
39
+ "commands",
40
+ "services",
41
+ "users",
42
+ "teams",
43
+ "domains",
44
+ "flows",
45
+ "pages",
46
+ "changelogs",
47
+ "queries",
48
+ "channels"
49
+ ];
50
+ function mapCatalogToAstro({ filePath, astroDir, projectDir }) {
51
+ const relativeFilePath = removeBasePath(filePath, projectDir);
52
+ if (!isCatalogRelated(relativeFilePath)) {
53
+ return [];
54
+ }
55
+ const baseTargetPaths = getBaseTargetPaths(relativeFilePath);
56
+ const relativeTargetPath = getRelativeTargetPath(relativeFilePath);
57
+ return baseTargetPaths.map(
58
+ (base) => import_node_path.default.join(astroDir, base, relativeTargetPath.replace("index.md", "index.mdx").replace("changelog.md", "changelog.mdx"))
59
+ );
60
+ }
61
+ function removeBasePath(fullPath, basePath) {
62
+ const relativePath = import_node_path.default.relative(basePath, fullPath);
63
+ return relativePath.startsWith("..") ? fullPath : relativePath;
64
+ }
65
+ function isCollectionKey(key) {
66
+ return COLLECTION_KEYS.includes(key);
67
+ }
68
+ function isCatalogRelated(filePath) {
69
+ const filePathArr = filePath.split(import_node_path.default.sep).filter(Boolean);
70
+ if ([
71
+ "eventcatalog.config.js",
72
+ // config file at root
73
+ "eventcatalog.styles.css",
74
+ // custom styles file at root
75
+ "components",
76
+ // custom components
77
+ "public",
78
+ // public assets
79
+ ...COLLECTION_KEYS
80
+ ].includes(filePathArr[0])) {
81
+ return true;
82
+ }
83
+ return false;
84
+ }
85
+ function getBaseTargetPaths(filePath) {
86
+ const filePathArr = filePath.split(import_node_path.default.sep).filter(Boolean);
87
+ if (isCollectionKey(filePathArr[0])) {
88
+ if (filePathArr[filePathArr.length - 1] == "changelog.md") {
89
+ return [import_node_path.default.join("src", "content", "changelogs")];
90
+ }
91
+ if (filePathArr[filePathArr.length - 1].match(/\.md$/)) {
92
+ return [import_node_path.default.join("src", "content")];
93
+ }
94
+ const hasExtension = (str) => /\.[a-zA-Z0-9]{2,}$/.test(str);
95
+ if (hasExtension(filePath)) {
96
+ return [import_node_path.default.join("public", "generated"), import_node_path.default.join("src", "catalog-files")];
97
+ }
98
+ return [import_node_path.default.join("public", "generated"), import_node_path.default.join("src", "catalog-files"), import_node_path.default.join("src", "content")];
99
+ }
100
+ if (filePathArr[0] == "components") {
101
+ return [import_node_path.default.join("src", "custom-defined-components")];
102
+ }
103
+ if (filePathArr[0] == "public") {
104
+ return [import_node_path.default.join("public")];
105
+ }
106
+ return [import_node_path.default.join("/")];
107
+ }
108
+ function getRelativeTargetPath(filePath) {
109
+ const filePathArr = filePath.split(import_node_path.default.sep).filter(Boolean);
110
+ if (filePathArr[0] == "public" || filePathArr[0] == "components") {
111
+ filePathArr.shift();
112
+ }
113
+ const relativePath = [];
114
+ for (let i = filePathArr.length - 1; i >= 0; i--) {
115
+ relativePath.unshift(filePathArr[i]);
116
+ if (isCollectionKey(filePathArr[i])) break;
117
+ }
118
+ return import_node_path.default.join(...relativePath);
119
+ }
120
+ // Annotate the CommonJS export names for ESM import in node:
121
+ 0 && (module.exports = {
122
+ mapCatalogToAstro
123
+ });
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @typedef {Object} MapCatalogToAstroParams
3
+ * @prop {string} filePath The catalog file path
4
+ * @prop {string} astroDir The astro directory
5
+ * @prop {string} projectDir The user's project directory
6
+ */
7
+ /**
8
+ *
9
+ * @param {MapCatalogToAstroParams} params
10
+ * @returns {string[]} The astro file paths
11
+ */
12
+ declare function mapCatalogToAstro({ filePath, astroDir, projectDir }: MapCatalogToAstroParams): string[];
13
+ type MapCatalogToAstroParams = {
14
+ /**
15
+ * The catalog file path
16
+ */
17
+ filePath: string;
18
+ /**
19
+ * The astro directory
20
+ */
21
+ astroDir: string;
22
+ /**
23
+ * The user's project directory
24
+ */
25
+ projectDir: string;
26
+ };
27
+
28
+ export { type MapCatalogToAstroParams, mapCatalogToAstro };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @typedef {Object} MapCatalogToAstroParams
3
+ * @prop {string} filePath The catalog file path
4
+ * @prop {string} astroDir The astro directory
5
+ * @prop {string} projectDir The user's project directory
6
+ */
7
+ /**
8
+ *
9
+ * @param {MapCatalogToAstroParams} params
10
+ * @returns {string[]} The astro file paths
11
+ */
12
+ declare function mapCatalogToAstro({ filePath, astroDir, projectDir }: MapCatalogToAstroParams): string[];
13
+ type MapCatalogToAstroParams = {
14
+ /**
15
+ * The catalog file path
16
+ */
17
+ filePath: string;
18
+ /**
19
+ * The astro directory
20
+ */
21
+ astroDir: string;
22
+ /**
23
+ * The user's project directory
24
+ */
25
+ projectDir: string;
26
+ };
27
+
28
+ export { type MapCatalogToAstroParams, mapCatalogToAstro };
@@ -0,0 +1,6 @@
1
+ import {
2
+ mapCatalogToAstro
3
+ } from "./chunk-PK2EQVPD.js";
4
+ export {
5
+ mapCatalogToAstro
6
+ };