@eventcatalog/core 0.0.6 → 0.0.10

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 (155) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/build-manifest.json +110 -0
  3. package/.next/cache/.tsbuildinfo +1 -0
  4. package/.next/cache/config.json +7 -0
  5. package/.next/cache/eslint/.cache_1bay4w0 +1 -0
  6. package/.next/cache/next-server.js.nft.json +1 -0
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/index.pack +0 -0
  9. package/.next/cache/webpack/server-production/0.pack +0 -0
  10. package/.next/cache/webpack/server-production/index.pack +0 -0
  11. package/.next/export-marker.json +1 -0
  12. package/.next/images-manifest.json +1 -0
  13. package/.next/next-server.js.nft.json +1 -0
  14. package/.next/prerender-manifest.json +1 -0
  15. package/.next/react-loadable-manifest.json +1717 -0
  16. package/.next/required-server-files.json +1 -0
  17. package/.next/routes-manifest.json +1 -0
  18. package/.next/server/chunks/237.js +116 -0
  19. package/.next/server/chunks/428.js +84 -0
  20. package/.next/server/chunks/47.js +51 -0
  21. package/.next/server/chunks/526.js +131 -0
  22. package/.next/server/chunks/565.js +121 -0
  23. package/.next/server/chunks/596.js +98 -0
  24. package/.next/server/chunks/730.js +324 -0
  25. package/.next/server/chunks/8.js +122 -0
  26. package/.next/server/chunks/938.js +109 -0
  27. package/.next/server/chunks/944.js +649 -0
  28. package/.next/server/chunks/959.js +286 -0
  29. package/.next/server/chunks/97.js +1837 -0
  30. package/.next/server/chunks/font-manifest.json +1 -0
  31. package/.next/server/font-manifest.json +1 -0
  32. package/.next/server/middleware-manifest.json +6 -0
  33. package/.next/server/pages/404.html +1 -0
  34. package/.next/server/pages/500.html +1 -0
  35. package/.next/server/pages/_app.js +370 -0
  36. package/.next/server/pages/_app.js.nft.json +1 -0
  37. package/.next/server/pages/_document.js +1004 -0
  38. package/.next/server/pages/_document.js.nft.json +1 -0
  39. package/.next/server/pages/_error.js +123 -0
  40. package/.next/server/pages/_error.js.nft.json +1 -0
  41. package/.next/server/pages/api/event/[name]/download.js +64 -0
  42. package/.next/server/pages/api/event/[name]/download.js.nft.json +1 -0
  43. package/.next/server/pages/events/AddedItemToCart.html +73 -0
  44. package/.next/server/pages/events/AddedItemToCart.json +1 -0
  45. package/.next/server/pages/events/OrderComplete.html +48 -0
  46. package/.next/server/pages/events/OrderComplete.json +1 -0
  47. package/.next/server/pages/events/OrderConfirmed.html +48 -0
  48. package/.next/server/pages/events/OrderConfirmed.json +1 -0
  49. package/.next/server/pages/events/OrderRequested.html +48 -0
  50. package/.next/server/pages/events/OrderRequested.json +1 -0
  51. package/.next/server/pages/events/PaymentProcessed.html +52 -0
  52. package/.next/server/pages/events/PaymentProcessed.json +1 -0
  53. package/.next/server/pages/events/RemovedItemFromCart.html +55 -0
  54. package/.next/server/pages/events/RemovedItemFromCart.json +1 -0
  55. package/.next/server/pages/events/ShipmentDelivered.html +53 -0
  56. package/.next/server/pages/events/ShipmentDelivered.json +1 -0
  57. package/.next/server/pages/events/ShipmentDispatched.html +52 -0
  58. package/.next/server/pages/events/ShipmentDispatched.json +1 -0
  59. package/.next/server/pages/events/ShipmentPrepared.html +52 -0
  60. package/.next/server/pages/events/ShipmentPrepared.json +1 -0
  61. package/.next/server/pages/events/[name]/logs.js +414 -0
  62. package/.next/server/pages/events/[name]/logs.js.nft.json +1 -0
  63. package/.next/server/pages/events/[name]/v/[version].js +274 -0
  64. package/.next/server/pages/events/[name]/v/[version].js.nft.json +1 -0
  65. package/.next/server/pages/events/[name].js +235 -0
  66. package/.next/server/pages/events/[name].js.nft.json +1 -0
  67. package/.next/server/pages/events.js +519 -0
  68. package/.next/server/pages/events.js.nft.json +1 -0
  69. package/.next/server/pages/index.html +1 -0
  70. package/.next/server/pages/index.js.nft.json +1 -0
  71. package/.next/server/pages/overview.js +240 -0
  72. package/.next/server/pages/overview.js.nft.json +1 -0
  73. package/.next/server/pages/services/Basket Service.html +11 -0
  74. package/.next/server/pages/services/Basket Service.json +1 -0
  75. package/.next/server/pages/services/Data Lake.html +12 -0
  76. package/.next/server/pages/services/Data Lake.json +1 -0
  77. package/.next/server/pages/services/Payment Service.html +10 -0
  78. package/.next/server/pages/services/Payment Service.json +1 -0
  79. package/.next/server/pages/services/Shipping Service.html +14 -0
  80. package/.next/server/pages/services/Shipping Service.json +1 -0
  81. package/.next/server/pages/services/[name].js +675 -0
  82. package/.next/server/pages/services/[name].js.nft.json +1 -0
  83. package/.next/server/pages/services.js +396 -0
  84. package/.next/server/pages/services.js.nft.json +1 -0
  85. package/.next/server/pages/users/[id].js +327 -0
  86. package/.next/server/pages/users/[id].js.nft.json +1 -0
  87. package/.next/server/pages-manifest.json +16 -0
  88. package/.next/server/webpack-api-runtime.js +160 -0
  89. package/.next/server/webpack-runtime.js +264 -0
  90. package/.next/static/chunks/020d8314.aea2d24215754e7b.js +1 -0
  91. package/.next/static/chunks/176cb4e4-8a0f6f010ef8accb.js +1 -0
  92. package/.next/static/chunks/236-0acd5083c102a9cb.js +1 -0
  93. package/.next/static/chunks/274-11c4d093341d7201.js +1 -0
  94. package/.next/static/chunks/336-5d9007a96aa8f2c7.js +1 -0
  95. package/.next/static/chunks/364-3cb3c8cf1d3c95de.js +1 -0
  96. package/.next/static/chunks/519-7f22292093abd7c3.js +1 -0
  97. package/.next/static/chunks/638.d570519ae49c92c8.js +1 -0
  98. package/.next/static/chunks/873-9d69271e4b2dd496.js +1 -0
  99. package/.next/static/chunks/962-d5070461f6d4a478.js +1 -0
  100. package/.next/static/chunks/framework-576ec6a1c1386453.js +1 -0
  101. package/.next/static/chunks/main-0289ecbd51cd4cb4.js +1 -0
  102. package/.next/static/chunks/pages/_app-c9d3172cc09cf069.js +1 -0
  103. package/.next/static/chunks/pages/_error-5a714c45c50a8db4.js +1 -0
  104. package/.next/static/chunks/pages/events/[name]/logs-d159d7b82f44847f.js +1 -0
  105. package/.next/static/chunks/pages/events/[name]/v/[version]-dc146dc9bfa7362d.js +1 -0
  106. package/.next/static/chunks/pages/events/[name]-fb77119f66a5793e.js +1 -0
  107. package/.next/static/chunks/pages/events-bcad8442f21d6b67.js +1 -0
  108. package/.next/static/chunks/pages/index-3eeab7e4014a02ea.js +1 -0
  109. package/.next/static/chunks/pages/overview-5ac749891cbe1922.js +1 -0
  110. package/.next/static/chunks/pages/services/[name]-69692188d11304b7.js +1 -0
  111. package/.next/static/chunks/pages/services-bcc61898062e1bf4.js +1 -0
  112. package/.next/static/chunks/pages/users/[id]-2da54ccb6319b207.js +1 -0
  113. package/.next/static/chunks/polyfills-5cd94c89d3acac5f.js +1 -0
  114. package/.next/static/chunks/webpack-afe52d4a9fcc5a75.js +1 -0
  115. package/.next/static/css/5eeed9cb243ce668.css +1 -0
  116. package/.next/static/css/b44e1178a88a93b4.css +3 -0
  117. package/.next/static/yc3MsaLWgBvovlJpHpfqc/_buildManifest.js +1 -0
  118. package/.next/static/yc3MsaLWgBvovlJpHpfqc/_middlewareManifest.js +1 -0
  119. package/.next/static/yc3MsaLWgBvovlJpHpfqc/_ssgManifest.js +1 -0
  120. package/.next/trace +37 -0
  121. package/CHANGELOG.md +30 -0
  122. package/bin/eventcatalog.js +4 -15
  123. package/components/ContentView.tsx +22 -29
  124. package/components/Grids/EventGrid.tsx +3 -13
  125. package/components/Grids/ServiceGrid.tsx +3 -11
  126. package/components/Header.tsx +1 -3
  127. package/components/Mdx/Examples.tsx +2 -9
  128. package/components/NotFound/index.tsx +2 -6
  129. package/components/Sidebars/EventSidebar.tsx +19 -14
  130. package/components/Sidebars/ServiceSidebar.tsx +26 -25
  131. package/eventcatalog.config.js +40 -0
  132. package/hooks/EventCatalog.tsx +1 -1
  133. package/lib/__tests__/assets/services/Basket Service/index.md +19 -0
  134. package/lib/__tests__/events.spec.ts +16 -27
  135. package/lib/__tests__/file-reader.spec.ts +3 -9
  136. package/lib/__tests__/services.spec.ts +27 -6
  137. package/lib/events.ts +5 -10
  138. package/lib/file-reader.ts +1 -3
  139. package/lib/graphs.ts +2 -4
  140. package/lib/services.ts +5 -11
  141. package/package.json +2 -2
  142. package/pages/_app.tsx +3 -12
  143. package/pages/events/[name]/logs.tsx +7 -18
  144. package/pages/events/[name].tsx +4 -13
  145. package/pages/events.tsx +5 -16
  146. package/pages/index.tsx +2 -9
  147. package/pages/overview.tsx +1 -4
  148. package/pages/services/[name].tsx +2 -2
  149. package/pages/services.tsx +2 -6
  150. package/pages/users/[id].tsx +4 -13
  151. package/scripts/__tests__/assets/eventcatalog.config.js +1 -2
  152. package/scripts/__tests__/generate.spec.ts +1 -4
  153. package/scripts/generate.js +1 -1
  154. package/tailwind.config.js +1 -5
  155. package/tsconfig.json +1 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @eventcatalog/core
2
2
 
3
+ ## 0.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [`df372c6`](https://github.com/boyney123/eventcatalog/commit/df372c675e76a4a5980740222ccf8268c0c71540) [#91](https://github.com/boyney123/eventcatalog/pull/91) Thanks [@boyney123](https://github.com/boyney123)! - feat: fix-generator
8
+
9
+ ## 0.0.9
10
+
11
+ ### Patch Changes
12
+
13
+ - [`b7202dc`](https://github.com/boyney123/eventcatalog/commit/b7202dcd7548d1d0f406ce9d979182cd4c09232a) [#82](https://github.com/boyney123/eventcatalog/pull/82) Thanks [@boyney123](https://github.com/boyney123)! - fix: event log page now displays correct name
14
+
15
+ ## 0.0.8
16
+
17
+ ### Patch Changes
18
+
19
+ - [`534bec1`](https://github.com/boyney123/eventcatalog/commit/534bec11f57bcabe7f79f40338ae02bef134efc2) [#78](https://github.com/boyney123/eventcatalog/pull/78) Thanks [@thim81](https://github.com/thim81)! - feat: externalLinks for services
20
+
21
+ * [`b557ff8`](https://github.com/boyney123/eventcatalog/commit/b557ff8f7186b939cbe1e23f2c0e1e9a7254c907) [#79](https://github.com/boyney123/eventcatalog/pull/79) Thanks [@boyney123](https://github.com/boyney123)! - fix: adding keys on maps in react
22
+
23
+ - [`407d9e0`](https://github.com/boyney123/eventcatalog/commit/407d9e0d7f8d5eab4747ce0af6d5079204b53d21) [#75](https://github.com/boyney123/eventcatalog/pull/75) Thanks [@thim81](https://github.com/thim81)! - feat: optional editUrl config
24
+
25
+ * [`9eb7463`](https://github.com/boyney123/eventcatalog/commit/9eb7463b32baa09a6dd693e7f0eede63e33cd39c) [#71](https://github.com/boyney123/eventcatalog/pull/71) Thanks [@thim81](https://github.com/thim81)! - feat: link to external event documentation added
26
+
27
+ ## 0.0.7
28
+
29
+ ### Patch Changes
30
+
31
+ - [`ee17db8`](https://github.com/boyney123/eventcatalog/commit/ee17db8958ac6368f7d833f0d3ebec2604722e42) [#56](https://github.com/boyney123/eventcatalog/pull/56) Thanks [@boyney123](https://github.com/boyney123)! - feat: changelog.md files now belong inside the versioned folders
32
+
3
33
  ## 0.0.6
4
34
 
5
35
  ### Patch Changes
@@ -22,16 +22,11 @@ const copyCoreApplicationCodeIntoUsersProjectDir = () => {
22
22
  // remove any files we don't care about
23
23
  exclusions.map((path) => {
24
24
  try {
25
- fs.lstatSync(path).isDirectory()
26
- ? fs.rmSync(path, { recursive: true, force: true })
27
- : fs.unlinkSync(path);
25
+ fs.lstatSync(path).isDirectory() ? fs.rmSync(path, { recursive: true, force: true }) : fs.unlinkSync(path);
28
26
  } catch (error) {}
29
27
  });
30
28
 
31
- fs.copyFileSync(
32
- path.join(projectDIR, 'eventcatalog.config.js'),
33
- path.join(eventCatalogLibDir, 'eventcatalog.config.js')
34
- );
29
+ fs.copyFileSync(path.join(projectDIR, 'eventcatalog.config.js'), path.join(eventCatalogLibDir, 'eventcatalog.config.js'));
35
30
  };
36
31
 
37
32
  cli
@@ -77,10 +72,7 @@ cli
77
72
  // copy any public assets over (from users to the lib itself)
78
73
  fs.copySync(path.join(projectDIR, 'public'), path.join(eventCatalogLibDir, 'public'));
79
74
 
80
- fs.copyFileSync(
81
- path.join(projectDIR, 'eventcatalog.config.js'),
82
- path.join(eventCatalogLibDir, 'eventcatalog.config.js')
83
- );
75
+ fs.copyFileSync(path.join(projectDIR, 'eventcatalog.config.js'), path.join(eventCatalogLibDir, 'eventcatalog.config.js'));
84
76
 
85
77
  execSync(`cross-env PROJECT_DIR=${projectDIR} npm run dev`, {
86
78
  cwd: eventCatalogLibDir,
@@ -98,10 +90,7 @@ cli
98
90
  copyCoreApplicationCodeIntoUsersProjectDir();
99
91
  }
100
92
 
101
- fs.copyFileSync(
102
- path.join(projectDIR, 'eventcatalog.config.js'),
103
- path.join(eventCatalogLibDir, 'eventcatalog.config.js')
104
- );
93
+ fs.copyFileSync(path.join(projectDIR, 'eventcatalog.config.js'), path.join(eventCatalogLibDir, 'eventcatalog.config.js'));
105
94
 
106
95
  execSync(`cross-env PROJECT_DIR=${projectDIR} npm run generate`, {
107
96
  cwd: eventCatalogLibDir,
@@ -39,9 +39,7 @@ export default function ContentView({
39
39
  <div className="max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 xl:max-w-7xl xl:grid xl:grid-cols-4">
40
40
  <div className="xl:col-span-3 xl:pr-8 xl:border-r xl:border-gray-200 flex-col justify-between flex">
41
41
  <div>
42
- {BreadCrumbs && (
43
- <div className="mb-5 border-b border-gray-100 pb-4">{BreadCrumbs}</div>
44
- )}
42
+ {BreadCrumbs && <div className="mb-5 border-b border-gray-100 pb-4">{BreadCrumbs}</div>}
45
43
  <div>
46
44
  <div>
47
45
  <div className="xl:border-b pb-4 flex justify-between ">
@@ -70,36 +68,32 @@ export default function ContentView({
70
68
  <>
71
69
  You are currently viewing an old version of this event ({version}).
72
70
  <Link href={latestVersionUrl}>
73
- <a className="block text-sm pl-7 mt-2 text-blue-500 underline">
74
- Read latest version &rarr;
75
- </a>
71
+ <a className="block text-sm pl-7 mt-2 text-blue-500 underline">Read latest version &rarr;</a>
76
72
  </Link>
77
73
  </>
78
74
  </Admonition>
79
75
  )}
80
76
  </div>
81
77
  <div className="mt-4 flex space-x-3 md:mt-0">
82
- <a
83
- href={editUrl}
84
- target="_blank"
85
- type="button"
86
- className="hidden md:inline-flex h-10 justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-900"
87
- rel="noreferrer"
88
- >
89
- <PencilIcon
90
- className="-ml-1 mr-2 h-5 w-5 text-gray-400"
91
- aria-hidden="true"
92
- />
93
- <span>Edit</span>
94
- </a>
78
+ {editUrl && (
79
+ <a
80
+ href={editUrl}
81
+ target="_blank"
82
+ type="button"
83
+ className="hidden md:inline-flex h-10 justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-900"
84
+ rel="noreferrer"
85
+ >
86
+ <PencilIcon className="-ml-1 mr-2 h-5 w-5 text-gray-400" aria-hidden="true" />
87
+ <span>Edit</span>
88
+ </a>
89
+ )}
95
90
  </div>
96
91
  </div>
97
92
  <div className="py-3 xl:pt-6 xl:pb-0">
98
93
  {isDraft && (
99
94
  <Admonition className="mt-0 pt-0" type="warning">
100
95
  <>
101
- This event is currently in <span className="underline">draft</span>{' '}
102
- mode.
96
+ This event is currently in <span className="underline">draft</span> mode.
103
97
  </>
104
98
  </Admonition>
105
99
  )}
@@ -109,14 +103,13 @@ export default function ContentView({
109
103
  </div>
110
104
  </div>
111
105
  </div>
112
- <div className="flex justify-between mt-10">
113
- <a href={editUrl} target="_blank" className="flex text-gray-400" rel="noreferrer">
114
- <PencilIcon
115
- className="top-1 mr-2 relative h-4 w-4 text-gray-400"
116
- aria-hidden="true"
117
- />
118
- <span>Edit this page</span>
119
- </a>
106
+ <div className={`flex mt-10 ${editUrl ? 'justify-between' : 'justify-end'}`}>
107
+ {editUrl && (
108
+ <a href={editUrl} target="_blank" className="flex text-gray-400" rel="noreferrer">
109
+ <PencilIcon className="top-1 mr-2 relative h-4 w-4 text-gray-400" aria-hidden="true" />
110
+ <span>Edit this page</span>
111
+ </a>
112
+ )}
120
113
  <span className="italic text-xs mt-2">Last updated on {lastModifiedDate}</span>
121
114
  </div>
122
115
  </div>
@@ -52,26 +52,16 @@ function EventGrid({ events = [], showMermaidDiagrams = false }: EventGridProps)
52
52
  </div>
53
53
  {showMermaidDiagrams && (
54
54
  <div className="h-full items-center flex">
55
- <Mermaid
56
- source="event"
57
- data={event}
58
- rootNodeColor={getBackgroundColor(event.name)}
59
- />
55
+ <Mermaid source="event" data={event} rootNodeColor={getBackgroundColor(event.name)} />
60
56
  </div>
61
57
  )}
62
58
  <div className="flex space-x-4 text-xs pt-2 relative bottom-0 left-0">
63
59
  <div className=" font-medium text-gray-500">
64
- <CubeIcon
65
- className="h-4 w-4 text-green-400 inline-block mr-2"
66
- aria-hidden="true"
67
- />
60
+ <CubeIcon className="h-4 w-4 text-green-400 inline-block mr-2" aria-hidden="true" />
68
61
  Producers ({event.producers.length})
69
62
  </div>
70
63
  <div className=" font-medium text-gray-500">
71
- <CubeIcon
72
- className="h-4 w-4 text-indigo-400 inline-block mr-2"
73
- aria-hidden="true"
74
- />
64
+ <CubeIcon className="h-4 w-4 text-indigo-400 inline-block mr-2" aria-hidden="true" />
75
65
  Subscribers ({event.consumers.length})
76
66
  </div>
77
67
  </div>
@@ -36,23 +36,15 @@ function ServiceGrid({ services = [] }: ServiceGridProps) {
36
36
  Draft
37
37
  </span>
38
38
  )}
39
- <div className="text-gray-500 text-xs font-normal mt-2 line-clamp-3">
40
- {service.summary}
41
- </div>
39
+ <div className="text-gray-500 text-xs font-normal mt-2 line-clamp-3">{service.summary}</div>
42
40
  </div>
43
41
  <div className="flex space-x-4 text-xs pt-2 relative bottom-0 left-0">
44
42
  <div className=" font-medium text-gray-500">
45
- <CubeIcon
46
- className="h-4 w-4 text-green-400 inline-block mr-2"
47
- aria-hidden="true"
48
- />
43
+ <CubeIcon className="h-4 w-4 text-green-400 inline-block mr-2" aria-hidden="true" />
49
44
  Subscribe Events ({service.subscribes.length})
50
45
  </div>
51
46
  <div className=" font-medium text-gray-500">
52
- <CubeIcon
53
- className="h-4 w-4 text-indigo-400 inline-block mr-2"
54
- aria-hidden="true"
55
- />
47
+ <CubeIcon className="h-4 w-4 text-indigo-400 inline-block mr-2" aria-hidden="true" />
56
48
  Publish Events ({service.publishes.length})
57
49
  </div>
58
50
  </div>
@@ -38,9 +38,7 @@ export default function Example() {
38
38
  <Link key={item.name} href={item.href}>
39
39
  <a
40
40
  className={classNames(
41
- current
42
- ? 'bg-gray-900 text-white'
43
- : 'text-gray-300 hover:bg-gray-700 hover:text-white',
41
+ current ? 'bg-gray-900 text-white' : 'text-gray-300 hover:bg-gray-700 hover:text-white',
44
42
  'px-3 py-2 rounded-md text-sm font-medium'
45
43
  )}
46
44
  aria-current={current ? 'page' : undefined}
@@ -12,12 +12,7 @@ interface ExampleProps {
12
12
  showLineNumbers?: boolean;
13
13
  }
14
14
 
15
- function Examples({
16
- title = 'Examples',
17
- description,
18
- examples = [],
19
- showLineNumbers,
20
- }: ExampleProps) {
15
+ function Examples({ title = 'Examples', description, examples = [], showLineNumbers }: ExampleProps) {
21
16
  const tabs = examples.map((example, index) => ({
22
17
  name: example.name || `Example ${index + 1}`,
23
18
  content: example.snippet,
@@ -64,9 +59,7 @@ function Examples({
64
59
  <SyntaxHighlighter language={selectedTab.langugage} showLineNumbers={showLineNumbers}>
65
60
  {selectedTab.content}
66
61
  </SyntaxHighlighter>
67
- {selectedTab.langugage && (
68
- <span className="-mb-2 block text-xs text-right font-bold">{selectedTab.name}</span>
69
- )}
62
+ {selectedTab.langugage && <span className="-mb-2 block text-xs text-right font-bold">{selectedTab.name}</span>}
70
63
  </div>
71
64
  </div>
72
65
  </div>
@@ -18,15 +18,11 @@ export default function Example(props: NotFoundProps) {
18
18
  <p className="text-sm font-semibold text-gray-700 text-opacity-50 uppercase tracking-wide blur-xl">
19
19
  Failed to find {type}
20
20
  </p>
21
- <h1 className="mt-2 text-4xl font-extrabold text-gray-900 tracking-tight sm:text-5xl">
22
- Missing Documentation
23
- </h1>
21
+ <h1 className="mt-2 text-4xl font-extrabold text-gray-900 tracking-tight sm:text-5xl">Missing Documentation</h1>
24
22
  <p className="mt-2 text-lg font-medium text-gray-700 text-opacity-50">
25
23
  Documentation for {type} <span className="underline">{name}</span> is missing!
26
24
  </p>
27
- <p className="mt-4 text-xs text-gray-400">
28
- Help the eco-system and add the documentation for others ❤️{' '}
29
- </p>
25
+ <p className="mt-4 text-xs text-gray-400">Help the eco-system and add the documentation for others ❤️ </p>
30
26
  <div className="mt-12">
31
27
  <a
32
28
  href={urlToAddPage}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import Link from 'next/link';
3
- import { CubeIcon, DownloadIcon } from '@heroicons/react/outline';
3
+ import { CubeIcon, DownloadIcon, ExternalLinkIcon } from '@heroicons/react/outline';
4
4
  import type { Event } from '@eventcatalog/types';
5
5
  import fileDownload from 'js-file-download';
6
6
  import { useUser } from '@/hooks/EventCatalog';
@@ -13,7 +13,7 @@ interface EventSideBarProps {
13
13
  function EventSideBar({ event, loadedVersion }: EventSideBarProps) {
14
14
  const { getUserById } = useUser();
15
15
 
16
- const { name: eventName, owners, producers, consumers, historicVersions } = event;
16
+ const { name: eventName, owners, producers, consumers, historicVersions, externalLinks } = event;
17
17
 
18
18
  const handleDownload = async () => {
19
19
  try {
@@ -43,10 +43,7 @@ function EventSideBar({ event, loadedVersion }: EventSideBarProps) {
43
43
  <Link href={`/services/${producer}`}>
44
44
  <a className="relative inline-flex items-center rounded-full border border-gray-300 px-3 py-0.5">
45
45
  <div className="absolute flex-shrink-0 flex items-center justify-center">
46
- <span
47
- className="h-1.5 w-1.5 rounded-full bg-green-500 animate animate-pulse"
48
- aria-hidden="true"
49
- />
46
+ <span className="h-1.5 w-1.5 rounded-full bg-green-500 animate animate-pulse" aria-hidden="true" />
50
47
  </div>
51
48
  <div className="ml-3.5 text-sm font-medium text-gray-900">{producer}</div>
52
49
  </a>
@@ -66,15 +63,9 @@ function EventSideBar({ event, loadedVersion }: EventSideBarProps) {
66
63
  {consumers.map((consumer) => (
67
64
  <li className="inline" key={consumer}>
68
65
  <Link href={`/services/${consumer}`}>
69
- <a
70
- href="#"
71
- className="relative inline-flex items-center rounded-full border border-gray-300 px-3 py-0.5"
72
- >
66
+ <a href="#" className="relative inline-flex items-center rounded-full border border-gray-300 px-3 py-0.5">
73
67
  <div className="absolute flex-shrink-0 flex items-center justify-center">
74
- <span
75
- className="h-1.5 w-1.5 rounded-full bg-indigo-500 animate animate-pulse"
76
- aria-hidden="true"
77
- />
68
+ <span className="h-1.5 w-1.5 rounded-full bg-indigo-500 animate animate-pulse" aria-hidden="true" />
78
69
  </div>
79
70
  <div className="ml-3.5 text-sm font-medium text-gray-900">{consumer}</div>
80
71
  </a>
@@ -194,6 +185,20 @@ function EventSideBar({ event, loadedVersion }: EventSideBarProps) {
194
185
  </a>
195
186
  </Link>
196
187
  )}
188
+ {externalLinks.length > 0 &&
189
+ externalLinks.map((tag) => (
190
+ <a
191
+ href={tag.url}
192
+ target="_blank"
193
+ type="button"
194
+ className="hidden w-full md:inline-flex h-10 justify-center px-4 py-2 border border-teal-300 shadow-sm text-sm font-medium rounded-md text-teal-800 hover:bg-teal-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-teal-200"
195
+ rel="noreferrer"
196
+ key={tag.url}
197
+ >
198
+ <ExternalLinkIcon className="-ml-1 mr-2 h-5 w-5 text-teal-200" aria-hidden="true" />
199
+ <span>{`${tag.label}`}</span>
200
+ </a>
201
+ ))}
197
202
  </div>
198
203
  </aside>
199
204
  );
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import Link from 'next/link';
3
3
  import type { Service } from '@eventcatalog/types';
4
4
 
5
- import { CubeIcon, TagIcon } from '@heroicons/react/outline';
5
+ import { CubeIcon, TagIcon, ExternalLinkIcon } from '@heroicons/react/outline';
6
6
  import { useUser } from '@/hooks/EventCatalog';
7
7
  import getBackgroundColor from '@/utils/random-bg';
8
8
 
@@ -15,7 +15,7 @@ interface ServiceSideBarProps {
15
15
  function ServiceSidebar({ service }: ServiceSideBarProps) {
16
16
  const { getUserById } = useUser();
17
17
 
18
- const { owners, subscribes, publishes, repository, tags = [] } = service;
18
+ const { owners, subscribes, publishes, repository, tags = [], externalLinks } = service;
19
19
  const { language, url: repositoryUrl } = repository;
20
20
 
21
21
  let languages = [];
@@ -44,15 +44,9 @@ function ServiceSidebar({ service }: ServiceSideBarProps) {
44
44
  {publishes.map((event) => (
45
45
  <li className="inline" key={event.name}>
46
46
  <Link href={`/events/${event.name}`}>
47
- <a
48
- href="#"
49
- className="relative inline-flex items-center rounded-full border border-gray-300 px-3 py-0.5"
50
- >
47
+ <a href="#" className="relative inline-flex items-center rounded-full border border-gray-300 px-3 py-0.5">
51
48
  <div className="absolute flex-shrink-0 flex items-center justify-center">
52
- <span
53
- className="h-1.5 w-1.5 rounded-full bg-indigo-500 animate animate-pulse"
54
- aria-hidden="true"
55
- />
49
+ <span className="h-1.5 w-1.5 rounded-full bg-indigo-500 animate animate-pulse" aria-hidden="true" />
56
50
  </div>
57
51
  <div className="ml-3.5 text-sm font-medium text-gray-900">{event.name}</div>
58
52
  </a>
@@ -74,10 +68,7 @@ function ServiceSidebar({ service }: ServiceSideBarProps) {
74
68
  <Link href={`/events/${event.name}`}>
75
69
  <a className="relative inline-flex items-center rounded-full border border-gray-300 px-3 py-0.5">
76
70
  <div className="absolute flex-shrink-0 flex items-center justify-center">
77
- <span
78
- className="h-1.5 w-1.5 rounded-full bg-green-500 animate animate-pulse"
79
- aria-hidden="true"
80
- />
71
+ <span className="h-1.5 w-1.5 rounded-full bg-green-500 animate animate-pulse" aria-hidden="true" />
81
72
  </div>
82
73
  <div className="ml-3.5 text-sm font-medium text-gray-900">{event.name}</div>
83
74
  </a>
@@ -139,11 +130,7 @@ function ServiceSidebar({ service }: ServiceSideBarProps) {
139
130
  {languages.map((value) => (
140
131
  <div className="relative flex items-center mt-2" key={value}>
141
132
  <div className="absolute flex-shrink-0 flex items-center justify-center">
142
- <span
143
- className="h-2 w-2 rounded-full"
144
- aria-hidden="true"
145
- style={{ background: getBackgroundColor(value) }}
146
- />
133
+ <span className="h-2 w-2 rounded-full" aria-hidden="true" style={{ background: getBackgroundColor(value) }} />
147
134
  </div>
148
135
  <div className="ml-3.5 text-sm font-medium text-gray-900">{value}</div>
149
136
  </div>
@@ -151,6 +138,25 @@ function ServiceSidebar({ service }: ServiceSideBarProps) {
151
138
  </div>
152
139
  </div>
153
140
  )}
141
+ {externalLinks.length > 0 && (
142
+ <div className="border-t border-gray-200 py-6 space-y-8">
143
+ <div className="space-y-3">
144
+ {externalLinks.map((tag) => (
145
+ <a
146
+ href={tag.url}
147
+ target="_blank"
148
+ type="button"
149
+ className="hidden w-full md:inline-flex h-10 justify-center px-4 py-2 border border-teal-300 shadow-sm text-sm font-medium rounded-md text-teal-800 hover:bg-teal-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-teal-200"
150
+ rel="noreferrer"
151
+ key={tag.url}
152
+ >
153
+ <ExternalLinkIcon className="-ml-1 mr-2 h-5 w-5 text-teal-200" aria-hidden="true" />
154
+ <span>{`${tag.label}`}</span>
155
+ </a>
156
+ ))}
157
+ </div>
158
+ </div>
159
+ )}
154
160
  {tags.length > 0 && (
155
161
  <div className="border-t border-gray-200 py-6 space-y-8">
156
162
  <div>
@@ -164,12 +170,7 @@ function ServiceSidebar({ service }: ServiceSideBarProps) {
164
170
 
165
171
  if (url) {
166
172
  return (
167
- <a
168
- href={url}
169
- className="inline-block underline"
170
- target="_blank"
171
- rel="noreferrer"
172
- >
173
+ <a href={url} className="inline-block underline" target="_blank" rel="noreferrer">
173
174
  <span
174
175
  className={`underline inline-block mr-2 items-center px-2.5 py-0.5 rounded-full text-xs font-medium -top-0.5 relative bg-${color}-100 text-${color}-800`}
175
176
  >
@@ -0,0 +1,40 @@
1
+ module.exports = {
2
+ title: 'EventCatalog',
3
+ tagline: 'Discover, Explore and Document your Event Driven Architectures',
4
+ organizationName: 'Your Company',
5
+ editUrl: 'https://github.com/boyney123/eventcatalog-demo/edit/master',
6
+ logo: {
7
+ alt: 'EventCatalog Logo',
8
+ src: 'logo.svg',
9
+ },
10
+ footerLinks: [
11
+ { label: 'Events', href: '/events' },
12
+ { label: 'Services', href: '/services' },
13
+ { label: '3D Node Graph', href: '/overview' },
14
+ { label: 'GitHub', href: 'https://github.com/boyney123/eventcatalog-demo/edit/master' }
15
+ ],
16
+ generators: [
17
+ [
18
+ '@eventcatalog/plugin-doc-generator-asyncapi',
19
+ {
20
+ file: './asyncapi.yml',
21
+ },
22
+ ]
23
+ ],
24
+ users: [
25
+ {
26
+ id: 'dboyne',
27
+ name: 'David Boyne',
28
+ avatarUrl: 'https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png',
29
+ role: 'Developer',
30
+ summary: 'Currently building tools for Event Architectures.'
31
+ },
32
+ {
33
+ id: 'mSmith',
34
+ name: 'Matthew Smith',
35
+ avatarUrl: 'https://randomuser.me/api/portraits/lego/3.jpg',
36
+ role: 'Developer',
37
+ summary: 'About Fugiat ipsum ipsum deserunt culpa aute sint do nostrud anim incididunt cillum culpa consequat.'
38
+ },
39
+ ],
40
+ }
@@ -26,10 +26,10 @@ export const useUser = () => {
26
26
 
27
27
  export const useUrl = () => {
28
28
  const config = useConfig();
29
-
30
29
  const getEditUrl = (url: string) => path.join(config.editUrl, url);
31
30
 
32
31
  return {
33
32
  getEditUrl,
33
+ hasEditUrl: !!config.editUrl,
34
34
  };
35
35
  };
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: Basket Service
3
+ summary: |
4
+ CRUD based API to handle Basket interactions for users of the shopping website.
5
+ owners:
6
+ - mSmith
7
+ repository:
8
+ language: JavaScript
9
+ url: https://github.com/boyney123/pretend-basket-service
10
+ externalLinks:
11
+ - label: AsyncAPI Specification
12
+ url: https://studio.asyncapi.com/#schema-lightMeasuredPayload
13
+ ---
14
+
15
+ Simple API that handles interactions between users and their baskets. Use this service to add, remove and query the status of a users basket.
16
+
17
+ This service will also generate Async events for downstream services.
18
+
19
+ <Mermaid />
@@ -27,12 +27,12 @@ describe('events lib', () => {
27
27
  expect(event).toEqual({
28
28
  name: 'AddedItemToCart',
29
29
  version: '0.0.1',
30
- summary:
31
- 'Holds information about the cusomer and product when they add an item to the cart.\n',
30
+ summary: 'Holds information about the cusomer and product when they add an item to the cart.\n',
32
31
  producers: ['Shopping API', 'Application API'],
33
32
  consumers: ['Customer Portal'],
34
33
  owners: ['dboyne', 'mSmith'],
35
34
  historicVersions: [],
35
+ externalLinks: [],
36
36
  schema: null,
37
37
  examples: [],
38
38
  });
@@ -68,23 +68,11 @@ describe('events lib', () => {
68
68
  const example2 = event.examples[1];
69
69
 
70
70
  const example1File = fs.readFileSync(
71
- path.join(
72
- process.env.PROJECT_DIR,
73
- 'events',
74
- 'EventWithSchemaAndExamples',
75
- 'examples',
76
- 'Basic.cs'
77
- ),
71
+ path.join(process.env.PROJECT_DIR, 'events', 'EventWithSchemaAndExamples', 'examples', 'Basic.cs'),
78
72
  { encoding: 'utf-8' }
79
73
  );
80
74
  const example2File = fs.readFileSync(
81
- path.join(
82
- process.env.PROJECT_DIR,
83
- 'events',
84
- 'EventWithSchemaAndExamples',
85
- 'examples',
86
- 'Basic.js'
87
- ),
75
+ path.join(process.env.PROJECT_DIR, 'events', 'EventWithSchemaAndExamples', 'examples', 'Basic.js'),
88
76
  { encoding: 'utf-8' }
89
77
  );
90
78
 
@@ -118,11 +106,11 @@ describe('events lib', () => {
118
106
  {
119
107
  name: 'AddedItemToCart',
120
108
  version: '0.0.1',
121
- summary:
122
- 'Holds information about the cusomer and product when they add an item to the cart.\n',
109
+ summary: 'Holds information about the cusomer and product when they add an item to the cart.\n',
123
110
  producers: ['Shopping API', 'Application API'],
124
111
  consumers: ['Customer Portal'],
125
112
  historicVersions: [],
113
+ externalLinks: [],
126
114
  owners: ['dboyne', 'mSmith'],
127
115
  },
128
116
  {
@@ -131,6 +119,7 @@ describe('events lib', () => {
131
119
  summary: 'Tells us when an email has been sent\n',
132
120
  producers: ['Email Platform'],
133
121
  historicVersions: [],
122
+ externalLinks: [],
134
123
  consumers: [],
135
124
  owners: ['dboyne', 'mSmith'],
136
125
  },
@@ -139,6 +128,7 @@ describe('events lib', () => {
139
128
  version: '0.0.1',
140
129
  summary: 'Example event with schema and examples\n',
141
130
  historicVersions: [],
131
+ externalLinks: [],
142
132
  producers: [],
143
133
  consumers: [],
144
134
  owners: [],
@@ -149,6 +139,7 @@ describe('events lib', () => {
149
139
  summary: 'Tells us when an email has been sent\n',
150
140
  historicVersions: ['0.0.1'],
151
141
  producers: [],
142
+ externalLinks: [],
152
143
  consumers: [],
153
144
  owners: [],
154
145
  },
@@ -206,12 +197,12 @@ describe('events lib', () => {
206
197
  {
207
198
  name: 'AddedItemToCart',
208
199
  version: '0.0.1',
209
- summary:
210
- 'Holds information about the cusomer and product when they add an item to the cart.\n',
200
+ summary: 'Holds information about the cusomer and product when they add an item to the cart.\n',
211
201
  producers: ['Shopping API', 'Application API'],
212
202
  consumers: ['Customer Portal'],
213
- historicVersions: [],
214
203
  owners: ['dboyne', 'mSmith'],
204
+ historicVersions: [],
205
+ externalLinks: [],
215
206
  },
216
207
  {
217
208
  name: 'EmailSent',
@@ -220,6 +211,7 @@ describe('events lib', () => {
220
211
  producers: ['Email Platform'],
221
212
  consumers: [],
222
213
  historicVersions: [],
214
+ externalLinks: [],
223
215
  owners: ['dboyne', 'mSmith'],
224
216
  },
225
217
  ]);
@@ -232,8 +224,7 @@ describe('events lib', () => {
232
224
  {
233
225
  name: 'AddedItemToCart',
234
226
  version: '0.0.1',
235
- summary:
236
- 'Holds information about the cusomer and product when they add an item to the cart.\n',
227
+ summary: 'Holds information about the cusomer and product when they add an item to the cart.\n',
237
228
  producers: ['Shopping API', 'My Service'],
238
229
  consumers: ['Customer Portal'],
239
230
  historicVersions: [],
@@ -254,8 +245,7 @@ describe('events lib', () => {
254
245
  {
255
246
  name: 'AddedItemToCart',
256
247
  version: '0.0.1',
257
- summary:
258
- 'Holds information about the cusomer and product when they add an item to the cart.\n',
248
+ summary: 'Holds information about the cusomer and product when they add an item to the cart.\n',
259
249
  producers: ['Shopping API', 'My Service'],
260
250
  consumers: ['Customer Portal'],
261
251
  historicVersions: [],
@@ -271,8 +261,7 @@ describe('events lib', () => {
271
261
  {
272
262
  name: 'AddedItemToCart',
273
263
  version: '0.0.1',
274
- summary:
275
- 'Holds information about the cusomer and product when they add an item to the cart.\n',
264
+ summary: 'Holds information about the cusomer and product when they add an item to the cart.\n',
276
265
  producers: ['Shopping API', 'Service'],
277
266
  consumers: ['Customer Portal'],
278
267
  historicVersions: [],