@eventcatalog/core 0.0.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 (62) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/README.md +11 -0
  3. package/bin/eventcatalog.js +125 -0
  4. package/components/BreadCrumbs.tsx +50 -0
  5. package/components/ContentView.tsx +127 -0
  6. package/components/Footer.tsx +38 -0
  7. package/components/Grids/EventGrid.tsx +89 -0
  8. package/components/Grids/ServiceGrid.tsx +70 -0
  9. package/components/Header.tsx +59 -0
  10. package/components/Mdx/Admonition.tsx +33 -0
  11. package/components/Mdx/Examples.tsx +77 -0
  12. package/components/Mermaid/index.tsx +47 -0
  13. package/components/NotFound/index.tsx +44 -0
  14. package/components/Sidebars/EventSidebar.tsx +202 -0
  15. package/components/Sidebars/ServiceSidebar.tsx +198 -0
  16. package/components/SyntaxHighlighter.tsx +34 -0
  17. package/hooks/EventCatalog.tsx +35 -0
  18. package/lib/__tests__/assets/events/AddedItemToCart/index.md +19 -0
  19. package/lib/__tests__/assets/events/EmailSent/index.md +15 -0
  20. package/lib/__tests__/assets/events/EventWithSchemaAndExamples/examples/Basic.cs +31 -0
  21. package/lib/__tests__/assets/events/EventWithSchemaAndExamples/examples/Basic.js +1 -0
  22. package/lib/__tests__/assets/events/EventWithSchemaAndExamples/index.md +8 -0
  23. package/lib/__tests__/assets/events/EventWithSchemaAndExamples/schema.json +4 -0
  24. package/lib/__tests__/assets/events/EventWithVersions/index.md +10 -0
  25. package/lib/__tests__/assets/events/EventWithVersions/versioned/0.0.1/index.md +10 -0
  26. package/lib/__tests__/assets/services/Email Platform/index.md +17 -0
  27. package/lib/__tests__/events.spec.ts +294 -0
  28. package/lib/__tests__/file-reader.spec.ts +57 -0
  29. package/lib/__tests__/graphs.spec.ts +62 -0
  30. package/lib/__tests__/services.spec.ts +144 -0
  31. package/lib/events.ts +221 -0
  32. package/lib/file-reader.ts +52 -0
  33. package/lib/graphs.ts +33 -0
  34. package/lib/services.ts +72 -0
  35. package/next-env.d.ts +5 -0
  36. package/next.config.js +3 -0
  37. package/package.json +52 -0
  38. package/pages/_app.tsx +49 -0
  39. package/pages/api/event/[name]/download.js +25 -0
  40. package/pages/events/[name]/logs.tsx +170 -0
  41. package/pages/events/[name]/v/[version].tsx +19 -0
  42. package/pages/events/[name].tsx +139 -0
  43. package/pages/events.tsx +227 -0
  44. package/pages/index.tsx +47 -0
  45. package/pages/overview.tsx +80 -0
  46. package/pages/services/[name].tsx +102 -0
  47. package/pages/services.tsx +123 -0
  48. package/pages/users/[id].tsx +83 -0
  49. package/postcss.config.js +6 -0
  50. package/public/favicon.ico +0 -0
  51. package/public/logo-random.svg +114 -0
  52. package/public/logo.svg +44 -0
  53. package/public/opengraph.png +0 -0
  54. package/scripts/__tests__/assets/eventcatalog.config.js +33 -0
  55. package/scripts/__tests__/generate.spec.ts +39 -0
  56. package/scripts/generate.js +28 -0
  57. package/styles/Home.module.css +116 -0
  58. package/styles/globals.css +48 -0
  59. package/tailwind.config.js +16 -0
  60. package/tsconfig.json +38 -0
  61. package/types/index.ts +7 -0
  62. package/utils/random-bg.ts +13 -0
@@ -0,0 +1,123 @@
1
+ import { Fragment } from 'react';
2
+ import Head from 'next/head';
3
+ import { Service } from '@eventcatalog/types';
4
+
5
+ import Link from 'next/link';
6
+
7
+ import { Menu, Transition } from '@headlessui/react';
8
+ import { ChevronDownIcon } from '@heroicons/react/solid';
9
+ import ServiceGrid from '@/components/Grids/ServiceGrid';
10
+ import { getAllServices } from '@/lib/services';
11
+
12
+ function classNames(...classes) {
13
+ return classes.filter(Boolean).join(' ');
14
+ }
15
+
16
+ const sortOptions = [
17
+ { name: 'Name', href: '#', current: true },
18
+ { name: 'Version', href: '#', current: false },
19
+ { name: 'Domains', href: '#', current: false },
20
+ ];
21
+
22
+ export interface PageProps {
23
+ services: [Service];
24
+ }
25
+
26
+ export default function Page({ services }: PageProps) {
27
+ return (
28
+ <>
29
+ <Head>
30
+ <title>EventCatalog - All Services</title>
31
+ </Head>
32
+ <main className="max-w-7xl mx-auto md:min-h-screen px-4 md:px-0">
33
+ <div className="relative z-10 flex items-baseline justify-between pt-8 pb-6 border-b border-gray-200">
34
+ <h1 className="text-2xl font-extrabold tracking-tight text-gray-900">
35
+ Services ({services.length})
36
+ </h1>
37
+
38
+ <div className="flex items-center">
39
+ <Menu as="div" className="relative hidden text-left">
40
+ <div>
41
+ <Menu.Button className="group inline-flex justify-center text-sm font-medium text-gray-700 hover:text-gray-900">
42
+ Sort
43
+ <ChevronDownIcon
44
+ className="flex-shrink-0 -mr-1 ml-1 h-5 w-5 text-gray-400 group-hover:text-gray-500"
45
+ aria-hidden="true"
46
+ />
47
+ </Menu.Button>
48
+ </div>
49
+
50
+ <Transition
51
+ as={Fragment}
52
+ enter="transition ease-out duration-100"
53
+ enterFrom="transform opacity-0 scale-95"
54
+ enterTo="transform opacity-100 scale-100"
55
+ leave="transition ease-in duration-75"
56
+ leaveFrom="transform opacity-100 scale-100"
57
+ leaveTo="transform opacity-0 scale-95"
58
+ >
59
+ <Menu.Items className="origin-top-right absolute right-0 mt-2 w-40 rounded-md shadow-2xl bg-white ring-1 ring-black ring-opacity-5 focus:outline-none">
60
+ <div className="py-1">
61
+ {sortOptions.map((option) => (
62
+ <Menu.Item key={option.name}>
63
+ {({ active }) => (
64
+ <a
65
+ href={option.href}
66
+ className={classNames(
67
+ option.current ? 'font-medium text-gray-900' : 'text-gray-500',
68
+ active ? 'bg-gray-100' : '',
69
+ 'block px-4 py-2 text-sm'
70
+ )}
71
+ >
72
+ {option.name}
73
+ </a>
74
+ )}
75
+ </Menu.Item>
76
+ ))}
77
+ </div>
78
+ </Menu.Items>
79
+ </Transition>
80
+ </Menu>
81
+ </div>
82
+ </div>
83
+
84
+ <section className="pt-6 pb-24">
85
+ <div className="grid grid-cols-4 gap-x-8 gap-y-10">
86
+ {/* Filters */}
87
+ <form className="hidden lg:block">
88
+ <span className="text-sm font-bold text-gray-900 mb-4 block">Services</span>
89
+ <ul className=" text-sm font-medium text-gray-900 space-y-4 pb-6 border-b border-gray-200 items-stretch">
90
+ {services.map((service) => (
91
+ <li key={service.name}>
92
+ <Link href={`/services/${service.name}`}>
93
+ <a>{service.name}</a>
94
+ </Link>
95
+ </li>
96
+ ))}
97
+ </ul>
98
+ </form>
99
+
100
+ <div className="col-span-4 lg:col-span-3">
101
+ <div>
102
+ <h2 className="text-gray-500 text-xs font-medium uppercase tracking-wide">
103
+ Services
104
+ </h2>
105
+ <ServiceGrid services={services} />
106
+ </div>
107
+ </div>
108
+ </div>
109
+ </section>
110
+ </main>
111
+ </>
112
+ );
113
+ }
114
+
115
+ export async function getServerSideProps() {
116
+ const services = getAllServices();
117
+
118
+ return {
119
+ props: {
120
+ services,
121
+ },
122
+ };
123
+ }
@@ -0,0 +1,83 @@
1
+ import { Event, Service } from '@eventcatalog/types';
2
+ import EventGrid from '@/components/Grids/EventGrid';
3
+ import ServiceGrid from '@/components/Grids/ServiceGrid';
4
+ import { getAllEventsByOwnerId } from '@/lib/events';
5
+ import { getAllServicesByOwnerId } from '@/lib/services';
6
+
7
+ import { useUser } from '@/hooks/EventCatalog';
8
+
9
+ interface UserPageProps {
10
+ events: Event[];
11
+ services: Service[];
12
+ userId: string;
13
+ }
14
+
15
+ export default function UserPage({ events, services, userId }: UserPageProps) {
16
+ const { getUserById } = useUser();
17
+
18
+ const user = getUserById(userId);
19
+
20
+ return (
21
+ <div className="flex relative min-h-screen">
22
+ <div className="flex-1 ">
23
+ <div className="py-8 xl:py-10">
24
+ <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">
25
+ <div className="xl:col-span-3 xl:pr-8 xl:border-r xl:border-gray-200 min-h-screen">
26
+ <div className="xl:border-b pb-4 flex justify-between ">
27
+ <div className="space-y-2">
28
+ <h1 className="text-3xl font-bold text-gray-900 relative">{user.name}</h1>
29
+ </div>
30
+ </div>
31
+ <div className=" border-b border-gray-100 pb-6">
32
+ <h1 className="text-lg font-bold text-gray-800 relative mt-4">
33
+ Owner of Events ({events.length})
34
+ </h1>
35
+ <EventGrid events={events} />
36
+ </div>
37
+ <div>
38
+ <h1 className="text-lg font-bold text-gray-800 relative mt-4">
39
+ Owner of Services ({services.length})
40
+ </h1>
41
+ <ServiceGrid services={services} />
42
+ </div>
43
+ </div>
44
+ <div className="px-8">
45
+ <div className="flex items-center space-x-5 mt-4 ">
46
+ <div className="flex-shrink-0">
47
+ <div className="relative">
48
+ <img className="h-16 w-16 rounded-full" src={user.avatarUrl} alt="" />
49
+ <span
50
+ className="absolute inset-0 shadow-inner rounded-full"
51
+ aria-hidden="true"
52
+ />
53
+ </div>
54
+ </div>
55
+ <div>
56
+ <h1 className="text-xl font-bold text-gray-900">{user.name}</h1>
57
+ <p className="text-sm font-medium text-gray-500">{user.role}</p>
58
+ </div>
59
+ </div>
60
+ <div className="mt-6 flow-root border-t border-gray-200 py-6 text-sm">
61
+ {user.summary}
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ );
69
+ }
70
+
71
+ export const getServerSideProps = async (req) => {
72
+ const { id: userId } = req.query;
73
+ const userEvents = await getAllEventsByOwnerId(userId);
74
+ const services = await getAllServicesByOwnerId(userId);
75
+
76
+ return {
77
+ props: {
78
+ events: userEvents,
79
+ services,
80
+ userId,
81
+ },
82
+ };
83
+ };
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ };
Binary file
@@ -0,0 +1,114 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 511 511" style="enable-background:new 0 0 511 511;" xml:space="preserve">
5
+ <g>
6
+ <path d="M487.5,128.106H479v-24.5c0-2.905-1.678-5.549-4.307-6.786C405.088,64.066,325.408,63.6,255.5,95.371
7
+ C185.592,63.6,105.912,64.067,36.307,96.82C33.678,98.057,32,100.701,32,103.606v24.5h-8.5c-12.958,0-23.5,10.542-23.5,23.5v264
8
+ c0,12.958,10.542,23.5,23.5,23.5h464c12.958,0,23.5-10.542,23.5-23.5v-264C511,138.648,500.458,128.106,487.5,128.106z
9
+ M263,239.583c0-0.009,0-0.019,0-0.028V108.416c64.137-28.707,136.861-28.707,201,0v27.161c0,0.01-0.001,0.02-0.001,0.029
10
+ s0.001,0.02,0.001,0.029v244.438c-32.237-13.461-66.371-20.193-100.5-20.193c-34.129,0-68.264,6.732-100.5,20.193V239.583z
11
+ M215,96.391c11.187,3.204,22.217,7.198,33,12.025v117.177l-12.34-8.227c-2.52-1.68-5.801-1.68-8.32,0L215,225.593V96.391z
12
+ M47,135.626c0-0.007,0.001-0.013,0.001-0.02S47,135.594,47,135.587v-27.171c48.563-21.736,102.046-26.999,153-15.82v32.856
13
+ c-26.767-5.505-54.078-6.777-81.328-3.75c-4.117,0.457-7.083,4.165-6.626,8.282c0.458,4.116,4.162,7.085,8.282,6.626
14
+ c26.708-2.967,53.479-1.562,79.671,4.165v48.686c-15.912-3.265-32.14-5.067-48.377-5.323c-4.145-0.078-7.552,3.239-7.618,7.38
15
+ c-0.065,4.142,3.239,7.552,7.38,7.618c16.331,0.258,32.654,2.164,48.614,5.647v16.66c-43.389-8.909-88.39-6.644-130.748,6.665
16
+ c-3.952,1.241-6.148,5.451-4.907,9.403c1.007,3.204,3.964,5.254,7.153,5.254c0.745,0,1.502-0.112,2.25-0.347
17
+ c40.908-12.852,84.428-14.773,126.252-5.638v2.825c0,2.766,1.522,5.308,3.961,6.612c2.438,1.306,5.398,1.162,7.699-0.372
18
+ l19.84-13.227l16.5,11v136.454c-32.237-13.461-66.371-20.193-100.5-20.193c-34.129,0-68.264,6.732-100.5,20.193V135.626z
19
+ M224,424.106H23.5c-4.687,0-8.5-3.813-8.5-8.5v-264c0-4.687,3.813-8.5,8.5-8.5H32v248.5v8c0,4.142,3.358,7.5,7.5,7.5H224V424.106z
20
+ M57.29,392.106c58.099-22.934,122.32-22.935,180.42,0H57.29z M272,424.106h-33v-17h33V424.106z M453.71,392.106H273.29
21
+ C331.389,369.172,395.61,369.172,453.71,392.106z M496,415.606c0,4.687-3.813,8.5-8.5,8.5H287v-17h184.5c4.142,0,7.5-3.358,7.5-7.5
22
+ v-8v-248.5h8.5c4.687,0,8.5,3.813,8.5,8.5V415.606z"/>
23
+ <path d="M309.96,317.749c-8.302,1.74-16.615,3.911-24.708,6.454c-3.952,1.242-6.148,5.452-4.907,9.403
24
+ c1.007,3.204,3.964,5.254,7.153,5.254c0.745,0,1.502-0.112,2.25-0.347c7.628-2.396,15.464-4.443,23.288-6.083
25
+ c4.054-0.85,6.652-4.825,5.802-8.879C317.989,319.497,314.011,316.9,309.96,317.749z"/>
26
+ <path d="M439.502,338.859c3.189,0,6.147-2.051,7.153-5.254c1.241-3.952-0.956-8.162-4.907-9.403
27
+ c-32.073-10.076-65.329-13.842-98.844-11.188c-4.129,0.326-7.211,3.938-6.885,8.068s3.935,7.213,8.068,6.885
28
+ c31.59-2.499,62.935,1.048,93.165,10.546C438,338.748,438.757,338.859,439.502,338.859z"/>
29
+ <path d="M287.498,306.767c0.745,0,1.502-0.112,2.25-0.347c48.249-15.159,99.256-15.159,147.504,0
30
+ c3.952,1.24,8.162-0.956,9.403-4.907c1.241-3.952-0.956-8.162-4.907-9.403c-51.191-16.083-105.306-16.083-156.496,0
31
+ c-3.952,1.241-6.149,5.451-4.907,9.403C281.352,304.716,284.309,306.767,287.498,306.767z"/>
32
+ <path d="M287.498,274.859c0.745,0,1.502-0.112,2.25-0.347c27.681-8.697,56.409-12.412,85.399-11.037
33
+ c4.147,0.192,7.651-2.999,7.847-7.137c0.196-4.138-2.999-7.65-7.137-7.847c-30.753-1.456-61.236,2.483-90.605,11.71
34
+ c-3.952,1.242-6.149,5.452-4.907,9.403C281.352,272.81,284.309,274.859,287.498,274.859z"/>
35
+ <path d="M441.748,260.202c-10.76-3.38-21.846-6.086-32.952-8.043c-4.08-0.719-7.968,2.006-8.688,6.085
36
+ c-0.719,4.079,2.005,7.969,6.085,8.688c10.467,1.844,20.917,4.395,31.058,7.581c0.749,0.235,1.505,0.347,2.25,0.347
37
+ c3.189,0,6.147-2.051,7.153-5.254C447.896,265.653,445.7,261.443,441.748,260.202z"/>
38
+ <path d="M287.498,242.767c0.745,0,1.502-0.112,2.25-0.347c48.249-15.159,99.256-15.159,147.504,0
39
+ c3.952,1.24,8.162-0.956,9.403-4.907c1.241-3.952-0.956-8.162-4.907-9.403c-51.191-16.083-105.306-16.083-156.496,0
40
+ c-3.952,1.241-6.149,5.451-4.907,9.403C281.352,240.716,284.309,242.767,287.498,242.767z"/>
41
+ <path d="M334.678,185.702c-16.732,1.858-33.362,5.36-49.426,10.407c-3.952,1.241-6.148,5.451-4.907,9.403
42
+ c1.007,3.204,3.964,5.254,7.153,5.254c0.745,0,1.502-0.112,2.25-0.347c15.141-4.757,30.815-8.057,46.585-9.809
43
+ c4.117-0.457,7.083-4.165,6.626-8.282S338.79,185.244,334.678,185.702z"/>
44
+ <path d="M367.386,199.137c23.725,0.375,47.231,4.17,69.866,11.283c0.748,0.234,1.505,0.347,2.25,0.347
45
+ c3.189,0,6.146-2.051,7.153-5.254c1.241-3.952-0.956-8.162-4.907-9.403c-24.015-7.545-48.955-11.572-74.125-11.97
46
+ c-4.125-0.078-7.552,3.239-7.618,7.38S363.244,199.072,367.386,199.137z"/>
47
+ <path d="M390.671,168.704c4.116,0.46,7.825-2.509,8.282-6.626c0.458-4.117-2.509-7.825-6.626-8.282
48
+ c-36.252-4.027-72.278-0.526-107.075,10.406c-3.952,1.242-6.148,5.452-4.907,9.403c1.007,3.204,3.964,5.254,7.153,5.254
49
+ c0.745,0,1.502-0.112,2.25-0.347C322.545,168.208,356.5,164.909,390.671,168.704z"/>
50
+ <path d="M441.748,164.202c-5.418-1.702-10.96-3.246-16.472-4.588c-4.03-0.98-8.082,1.488-9.062,5.512
51
+ c-0.98,4.024,1.488,8.082,5.512,9.062c5.196,1.265,10.419,2.72,15.526,4.324c0.748,0.235,1.505,0.347,2.25,0.347
52
+ c3.189,0,6.147-2.051,7.153-5.254C447.896,169.653,445.7,165.443,441.748,164.202z"/>
53
+ <path d="M287.498,146.767c0.745,0,1.502-0.112,2.25-0.347c5.103-1.604,10.325-3.058,15.521-4.324
54
+ c4.024-0.98,6.492-5.037,5.512-9.062s-5.038-6.492-9.062-5.512c-5.513,1.342-11.053,2.886-16.468,4.587
55
+ c-3.951,1.242-6.148,5.452-4.907,9.403C281.352,144.716,284.309,146.767,287.498,146.767z"/>
56
+ <path d="M336.329,136.611c34.172-3.796,68.126-0.496,100.923,9.809c0.748,0.234,1.505,0.347,2.25,0.347
57
+ c3.189,0,6.146-2.051,7.153-5.254c1.241-3.952-0.956-8.162-4.907-9.403c-34.797-10.933-70.824-14.435-107.076-10.406
58
+ c-4.117,0.457-7.083,4.165-6.626,8.282C328.504,134.102,332.21,137.07,336.329,136.611z"/>
59
+ <path d="M93.96,317.749c-8.302,1.74-16.615,3.911-24.708,6.454c-3.952,1.242-6.148,5.452-4.907,9.403
60
+ c1.007,3.204,3.964,5.254,7.153,5.254c0.745,0,1.502-0.112,2.25-0.347c7.628-2.396,15.464-4.443,23.288-6.083
61
+ c4.054-0.85,6.652-4.825,5.802-8.879S98.011,316.9,93.96,317.749z"/>
62
+ <path d="M223.502,338.859c3.189,0,6.147-2.051,7.153-5.254c1.241-3.952-0.956-8.162-4.907-9.403
63
+ c-32.073-10.076-65.331-13.842-98.844-11.188c-4.129,0.326-7.211,3.938-6.885,8.068s3.934,7.213,8.068,6.885
64
+ c31.591-2.499,62.935,1.048,93.165,10.546C222,338.748,222.757,338.859,223.502,338.859z"/>
65
+ <path d="M71.498,306.767c0.745,0,1.502-0.112,2.25-0.347c48.249-15.159,99.256-15.159,147.504,0
66
+ c3.952,1.24,8.162-0.956,9.403-4.907c1.241-3.952-0.956-8.162-4.907-9.403c-51.191-16.083-105.307-16.083-156.496,0
67
+ c-3.952,1.241-6.149,5.451-4.907,9.403C65.352,304.716,68.309,306.767,71.498,306.767z"/>
68
+ <path d="M71.498,274.859c0.745,0,1.502-0.112,2.25-0.347c27.681-8.697,56.411-12.412,85.399-11.037
69
+ c4.158,0.192,7.65-2.999,7.847-7.137c0.196-4.138-2.999-7.65-7.137-7.847c-30.756-1.456-61.236,2.483-90.605,11.71
70
+ c-3.952,1.242-6.149,5.452-4.907,9.403C65.352,272.81,68.309,274.859,71.498,274.859z"/>
71
+ <path d="M190.194,266.932c10.467,1.844,20.917,4.395,31.058,7.581c0.749,0.235,1.505,0.347,2.25,0.347
72
+ c3.189,0,6.147-2.051,7.153-5.254c1.241-3.952-0.956-8.162-4.907-9.403c-10.76-3.38-21.846-6.086-32.952-8.043
73
+ c-4.079-0.719-7.969,2.006-8.688,6.085C183.39,262.323,186.114,266.213,190.194,266.932z"/>
74
+ <path d="M118.678,185.702c-16.732,1.858-33.362,5.36-49.426,10.407c-3.952,1.241-6.148,5.451-4.907,9.403
75
+ c1.007,3.204,3.964,5.254,7.153,5.254c0.745,0,1.502-0.112,2.25-0.347c15.141-4.757,30.815-8.057,46.585-9.809
76
+ c4.117-0.457,7.083-4.165,6.626-8.282C126.503,188.212,122.788,185.244,118.678,185.702z"/>
77
+ <path d="M64.345,173.605c1.007,3.204,3.964,5.254,7.153,5.254c0.745,0,1.502-0.112,2.25-0.347
78
+ c32.797-10.305,66.752-13.604,100.923-9.809c4.116,0.46,7.825-2.509,8.282-6.626c0.458-4.117-2.509-7.825-6.626-8.282
79
+ c-36.253-4.027-72.278-0.526-107.075,10.406C65.3,165.444,63.104,169.654,64.345,173.605z"/>
80
+ <path d="M71.498,146.767c0.745,0,1.502-0.112,2.25-0.347c5.103-1.604,10.325-3.058,15.521-4.324
81
+ c4.024-0.98,6.492-5.037,5.512-9.062s-5.038-6.492-9.062-5.512c-5.513,1.342-11.053,2.886-16.468,4.587
82
+ c-3.951,1.242-6.148,5.452-4.907,9.403C65.352,144.716,68.309,146.767,71.498,146.767z"/>
83
+ </g>
84
+ <g>
85
+ </g>
86
+ <g>
87
+ </g>
88
+ <g>
89
+ </g>
90
+ <g>
91
+ </g>
92
+ <g>
93
+ </g>
94
+ <g>
95
+ </g>
96
+ <g>
97
+ </g>
98
+ <g>
99
+ </g>
100
+ <g>
101
+ </g>
102
+ <g>
103
+ </g>
104
+ <g>
105
+ </g>
106
+ <g>
107
+ </g>
108
+ <g>
109
+ </g>
110
+ <g>
111
+ </g>
112
+ <g>
113
+ </g>
114
+ </svg>
@@ -0,0 +1,44 @@
1
+ <svg width="547" height="398" xmlns="http://www.w3.org/2000/svg">
2
+
3
+ <g>
4
+ <title>Layer 1</title>
5
+ <g>
6
+ <path fill="#ffffff" d="m508,69.60635l-8.5,0l0,-24.5c0,-2.905 -1.678,-5.549 -4.307,-6.786c-69.605,-32.754 -149.285,-33.22 -219.193,-1.449c-69.908,-31.771 -149.588,-31.304 -219.193,1.449c-2.629,1.237 -4.307,3.881 -4.307,6.786l0,24.5l-8.5,0c-12.958,0 -23.5,10.542 -23.5,23.5l0,264c0,12.958 10.542,23.5 23.5,23.5l464,0c12.958,0 23.5,-10.542 23.5,-23.5l0,-264c0,-12.958 -10.542,-23.5 -23.5,-23.5zm-224.5,111.477c0,-0.009 0,-0.019 0,-0.028l0,-131.139c64.137,-28.707 136.861,-28.707 201,0l0,27.161c0,0.01 -0.001,0.02 -0.001,0.029s0.001,0.02 0.001,0.029l0,244.438c-32.237,-13.461 -66.371,-20.193 -100.5,-20.193c-34.129,0 -68.264,6.732 -100.5,20.193l0,-140.49zm-48,-143.192c11.187,3.204 22.217,7.198 33,12.025l0,117.177l-12.34,-8.227c-2.52,-1.68 -5.801,-1.68 -8.32,0l-12.34,8.227l0,-129.202zm-168,39.235c0,-0.007 0.001,-0.013 0.001,-0.02s-0.001,-0.012 -0.001,-0.019l0,-27.171c48.563,-21.736 102.046,-26.999 153,-15.82l0,32.856c-26.767,-5.505 -54.078,-6.777 -81.328,-3.75c-4.117,0.457 -7.083,4.165 -6.626,8.282c0.458,4.116 4.162,7.085 8.282,6.626c26.708,-2.967 53.479,-1.562 79.671,4.165l0,48.686c-15.912,-3.265 -32.14,-5.067 -48.377,-5.323c-4.145,-0.078 -7.552,3.239 -7.618,7.38c-0.065,4.142 3.239,7.552 7.38,7.618c16.331,0.258 32.654,2.164 48.614,5.647l0,16.66c-43.389,-8.909 -88.39,-6.644 -130.748,6.665c-3.952,1.241 -6.148,5.451 -4.907,9.403c1.007,3.204 3.964,5.254 7.153,5.254c0.745,0 1.502,-0.112 2.25,-0.347c40.908,-12.852 84.428,-14.773 126.252,-5.638l0,2.825c0,2.766 1.522,5.308 3.961,6.612c2.438,1.306 5.398,1.162 7.699,-0.372l19.84,-13.227l16.5,11l0,136.454c-32.237,-13.461 -66.371,-20.193 -100.5,-20.193c-34.129,0 -68.264,6.732 -100.5,20.193l0,-244.446l0.002,0zm177,288.48l-200.5,0c-4.687,0 -8.5,-3.813 -8.5,-8.5l0,-264c0,-4.687 3.813,-8.5 8.5,-8.5l8.5,0l0,248.5l0,8c0,4.142 3.358,7.5 7.5,7.5l184.5,0l0,17zm-166.71,-32c58.099,-22.934 122.32,-22.935 180.42,0l-180.42,0zm214.71,32l-33,0l0,-17l33,0l0,17zm181.71,-32l-180.42,0c58.099,-22.934 122.32,-22.934 180.42,0zm42.29,23.5c0,4.687 -3.813,8.5 -8.5,8.5l-200.5,0l0,-17l184.5,0c4.142,0 7.5,-3.358 7.5,-7.5l0,-8l0,-248.5l8.5,0c4.687,0 8.5,3.813 8.5,8.5l0,264z"/>
7
+ <path fill="#ffffff" d="m330.46,259.24935c-8.302,1.74 -16.615,3.911 -24.708,6.454c-3.952,1.242 -6.148,5.452 -4.907,9.403c1.007,3.204 3.964,5.254 7.153,5.254c0.745,0 1.502,-0.112 2.25,-0.347c7.628,-2.396 15.464,-4.443 23.288,-6.083c4.054,-0.85 6.652,-4.825 5.802,-8.879c-0.849,-4.054 -4.827,-6.651 -8.878,-5.802z"/>
8
+ <path fill="#ffffff" d="m460.002,280.35935c3.189,0 6.147,-2.051 7.153,-5.254c1.241,-3.952 -0.956,-8.162 -4.907,-9.403c-32.073,-10.076 -65.329,-13.842 -98.844,-11.188c-4.129,0.326 -7.211,3.938 -6.885,8.068s3.935,7.213 8.068,6.885c31.59,-2.499 62.935,1.048 93.165,10.546c0.748,0.235 1.505,0.346 2.25,0.346z"/>
9
+ <path fill="#ffffff" d="m307.998,248.26735c0.745,0 1.502,-0.112 2.25,-0.347c48.249,-15.159 99.256,-15.159 147.504,0c3.952,1.24 8.162,-0.956 9.403,-4.907c1.241,-3.952 -0.956,-8.162 -4.907,-9.403c-51.191,-16.083 -105.306,-16.083 -156.496,0c-3.952,1.241 -6.149,5.451 -4.907,9.403c1.007,3.203 3.964,5.254 7.153,5.254z"/>
10
+ <path fill="#ffffff" d="m307.998,216.35935c0.745,0 1.502,-0.112 2.25,-0.347c27.681,-8.697 56.409,-12.412 85.399,-11.037c4.147,0.192 7.651,-2.999 7.847,-7.137c0.196,-4.138 -2.999,-7.65 -7.137,-7.847c-30.753,-1.456 -61.236,2.483 -90.605,11.71c-3.952,1.242 -6.149,5.452 -4.907,9.403c1.007,3.206 3.964,5.255 7.153,5.255z"/>
11
+ <path fill="#ffffff" d="m462.248,201.70235c-10.76,-3.38 -21.846,-6.086 -32.952,-8.043c-4.08,-0.719 -7.968,2.006 -8.688,6.085c-0.719,4.079 2.005,7.969 6.085,8.688c10.467,1.844 20.917,4.395 31.058,7.581c0.749,0.235 1.505,0.347 2.25,0.347c3.189,0 6.147,-2.051 7.153,-5.254c1.242,-3.953 -0.954,-8.163 -4.906,-9.404z"/>
12
+ <path fill="#ffffff" d="m307.998,184.26735c0.745,0 1.502,-0.112 2.25,-0.347c48.249,-15.159 99.256,-15.159 147.504,0c3.952,1.24 8.162,-0.956 9.403,-4.907c1.241,-3.952 -0.956,-8.162 -4.907,-9.403c-51.191,-16.083 -105.306,-16.083 -156.496,0c-3.952,1.241 -6.149,5.451 -4.907,9.403c1.007,3.203 3.964,5.254 7.153,5.254z"/>
13
+ <path fill="#ffffff" d="m355.178,127.20235c-16.732,1.858 -33.362,5.36 -49.426,10.407c-3.952,1.241 -6.148,5.451 -4.907,9.403c1.007,3.204 3.964,5.254 7.153,5.254c0.745,0 1.502,-0.112 2.25,-0.347c15.141,-4.757 30.815,-8.057 46.585,-9.809c4.117,-0.457 7.083,-4.165 6.626,-8.282s-4.169,-7.084 -8.281,-6.626z"/>
14
+ <path fill="#ffffff" d="m387.886,140.63735c23.725,0.375 47.231,4.17 69.866,11.283c0.748,0.234 1.505,0.347 2.25,0.347c3.189,0 6.146,-2.051 7.153,-5.254c1.241,-3.952 -0.956,-8.162 -4.907,-9.403c-24.015,-7.545 -48.955,-11.572 -74.125,-11.97c-4.125,-0.078 -7.552,3.239 -7.618,7.38s3.239,7.552 7.381,7.617z"/>
15
+ <path fill="#ffffff" d="m411.171,110.20435c4.116,0.46 7.825,-2.509 8.282,-6.626c0.458,-4.117 -2.509,-7.825 -6.626,-8.282c-36.252,-4.027 -72.278,-0.526 -107.075,10.406c-3.952,1.242 -6.148,5.452 -4.907,9.403c1.007,3.204 3.964,5.254 7.153,5.254c0.745,0 1.502,-0.112 2.25,-0.347c32.797,-10.304 66.752,-13.603 100.923,-9.808z"/>
16
+ <path fill="#ffffff" d="m462.248,105.70235c-5.418,-1.702 -10.96,-3.246 -16.472,-4.588c-4.03,-0.98 -8.082,1.488 -9.062,5.512c-0.98,4.024 1.488,8.082 5.512,9.062c5.196,1.265 10.419,2.72 15.526,4.324c0.748,0.235 1.505,0.347 2.25,0.347c3.189,0 6.147,-2.051 7.153,-5.254c1.241,-3.952 -0.955,-8.162 -4.907,-9.403z"/>
17
+ <path fill="#ffffff" d="m307.998,88.26735c0.745,0 1.502,-0.112 2.25,-0.347c5.103,-1.604 10.325,-3.058 15.521,-4.324c4.024,-0.98 6.492,-5.037 5.512,-9.062s-5.038,-6.492 -9.062,-5.512c-5.513,1.342 -11.053,2.886 -16.468,4.587c-3.951,1.242 -6.148,5.452 -4.907,9.403c1.008,3.204 3.965,5.255 7.154,5.255z"/>
18
+ <path fill="#ffffff" d="m356.829,78.11135c34.172,-3.796 68.126,-0.496 100.923,9.809c0.748,0.234 1.505,0.347 2.25,0.347c3.189,0 6.146,-2.051 7.153,-5.254c1.241,-3.952 -0.956,-8.162 -4.907,-9.403c-34.797,-10.933 -70.824,-14.435 -107.076,-10.406c-4.117,0.457 -7.083,4.165 -6.626,8.282c0.458,4.116 4.164,7.084 8.283,6.625z"/>
19
+ <path fill="#ffffff" d="m114.46,259.24935c-8.302,1.74 -16.615,3.911 -24.708,6.454c-3.952,1.242 -6.148,5.452 -4.907,9.403c1.007,3.204 3.964,5.254 7.153,5.254c0.745,0 1.502,-0.112 2.25,-0.347c7.628,-2.396 15.464,-4.443 23.288,-6.083c4.054,-0.85 6.652,-4.825 5.802,-8.879s-4.827,-6.651 -8.878,-5.802z"/>
20
+ <path fill="#ffffff" d="m244.002,280.35935c3.189,0 6.147,-2.051 7.153,-5.254c1.241,-3.952 -0.956,-8.162 -4.907,-9.403c-32.073,-10.076 -65.331,-13.842 -98.844,-11.188c-4.129,0.326 -7.211,3.938 -6.885,8.068s3.934,7.213 8.068,6.885c31.591,-2.499 62.935,1.048 93.165,10.546c0.748,0.235 1.505,0.346 2.25,0.346z"/>
21
+ <path fill="#ffffff" d="m91.998,248.26735c0.745,0 1.502,-0.112 2.25,-0.347c48.249,-15.159 99.256,-15.159 147.504,0c3.952,1.24 8.162,-0.956 9.403,-4.907c1.241,-3.952 -0.956,-8.162 -4.907,-9.403c-51.191,-16.083 -105.307,-16.083 -156.496,0c-3.952,1.241 -6.149,5.451 -4.907,9.403c1.007,3.203 3.964,5.254 7.153,5.254z"/>
22
+ <path fill="#ffffff" d="m91.998,216.35935c0.745,0 1.502,-0.112 2.25,-0.347c27.681,-8.697 56.411,-12.412 85.399,-11.037c4.158,0.192 7.65,-2.999 7.847,-7.137c0.196,-4.138 -2.999,-7.65 -7.137,-7.847c-30.756,-1.456 -61.236,2.483 -90.605,11.71c-3.952,1.242 -6.149,5.452 -4.907,9.403c1.007,3.206 3.964,5.255 7.153,5.255z"/>
23
+ <path fill="#ffffff" d="m210.694,208.43235c10.467,1.844 20.917,4.395 31.058,7.581c0.749,0.235 1.505,0.347 2.25,0.347c3.189,0 6.147,-2.051 7.153,-5.254c1.241,-3.952 -0.956,-8.162 -4.907,-9.403c-10.76,-3.38 -21.846,-6.086 -32.952,-8.043c-4.079,-0.719 -7.969,2.006 -8.688,6.085c-0.718,4.078 2.006,7.968 6.086,8.687z"/>
24
+ <path fill="#ffffff" d="m139.178,127.20235c-16.732,1.858 -33.362,5.36 -49.426,10.407c-3.952,1.241 -6.148,5.451 -4.907,9.403c1.007,3.204 3.964,5.254 7.153,5.254c0.745,0 1.502,-0.112 2.25,-0.347c15.141,-4.757 30.815,-8.057 46.585,-9.809c4.117,-0.457 7.083,-4.165 6.626,-8.282c-0.456,-4.116 -4.171,-7.084 -8.281,-6.626z"/>
25
+ <path fill="#ffffff" d="m84.845,115.10535c1.007,3.204 3.964,5.254 7.153,5.254c0.745,0 1.502,-0.112 2.25,-0.347c32.797,-10.305 66.752,-13.604 100.923,-9.809c4.116,0.46 7.825,-2.509 8.282,-6.626c0.458,-4.117 -2.509,-7.825 -6.626,-8.282c-36.253,-4.027 -72.278,-0.526 -107.075,10.406c-3.952,1.243 -6.148,5.453 -4.907,9.404z"/>
26
+ <path fill="#ffffff" d="m91.998,88.26735c0.745,0 1.502,-0.112 2.25,-0.347c5.103,-1.604 10.325,-3.058 15.521,-4.324c4.024,-0.98 6.492,-5.037 5.512,-9.062s-5.038,-6.492 -9.062,-5.512c-5.513,1.342 -11.053,2.886 -16.468,4.587c-3.951,1.242 -6.148,5.452 -4.907,9.403c1.008,3.204 3.965,5.255 7.154,5.255z"/>
27
+ </g>
28
+ <g/>
29
+ <g/>
30
+ <g/>
31
+ <g/>
32
+ <g/>
33
+ <g/>
34
+ <g/>
35
+ <g/>
36
+ <g/>
37
+ <g/>
38
+ <g/>
39
+ <g/>
40
+ <g/>
41
+ <g/>
42
+ <g/>
43
+ </g>
44
+ </svg>
Binary file
@@ -0,0 +1,33 @@
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ title: 'EventCatalog',
5
+ tagline: 'Discover, Explore and Document your Event Driven Architectures',
6
+ organizationName: 'Your Company',
7
+ editUrl: 'https://github.com/boyney123/eventcatalog-demo/edit/master',
8
+ generators: [
9
+ [
10
+ '@eventcatalog/plugin-doc-generator-asyncapi',
11
+ {
12
+ file: './asyncapi.yml',
13
+ },
14
+ ],
15
+ ],
16
+ users: [
17
+ {
18
+ id: 'dboyne',
19
+ name: 'David Boyne',
20
+ avatarUrl: 'https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png',
21
+ role: 'Developer',
22
+ summary: 'Currently building tools for Event Architectures.',
23
+ },
24
+ {
25
+ id: 'mSmith',
26
+ name: 'Matthew Smith',
27
+ avatarUrl: 'https://randomuser.me/api/portraits/lego/3.jpg',
28
+ role: 'Developer',
29
+ summary:
30
+ 'About Fugiat ipsum ipsum deserunt culpa aute sint do nostrud anim incididunt cillum culpa consequat.',
31
+ },
32
+ ],
33
+ };
@@ -0,0 +1,39 @@
1
+ import { generate } from '../generate';
2
+ import config from './assets/eventcatalog.config';
3
+
4
+ import path from 'path';
5
+
6
+ beforeEach(() => {
7
+ jest.resetModules();
8
+ });
9
+
10
+ const mockPlugin = jest.fn();
11
+
12
+ jest.mock('@eventcatalog/plugin-doc-generator-asyncapi', () => ({
13
+ __esModule: true, // this property makes it work
14
+ default: mockPlugin,
15
+ namedExport: jest.fn(),
16
+ }));
17
+
18
+ let PROJECT_DIR: any;
19
+
20
+ describe('generate script', () => {
21
+ beforeAll(() => {
22
+ PROJECT_DIR = process.env.PROJECT_DIR;
23
+ process.env.PROJECT_DIR = path.join(__dirname, 'assets');
24
+ });
25
+
26
+ afterAll(() => {
27
+ process.env.PROJECT_DIR = PROJECT_DIR;
28
+ });
29
+
30
+ it('gets all generators from the `eventcatalog.config.js` file and runs them', async () => {
31
+ await generate();
32
+
33
+ expect(mockPlugin).toHaveBeenCalled();
34
+ expect(mockPlugin).toHaveBeenCalledWith(
35
+ { eventCatalogConfig: config },
36
+ { file: './asyncapi.yml' }
37
+ );
38
+ });
39
+ });
@@ -0,0 +1,28 @@
1
+ const path = require('path');
2
+ const chalk = require('chalk');
3
+
4
+ const generate = async () => {
5
+ const config = require(path.join(process.env.PROJECT_DIR, 'eventcatalog.config.js'));
6
+
7
+ const { generators = [] } = config;
8
+
9
+ const plugins = generators.map((generator) => {
10
+ const plugin = generator[0];
11
+ const pluginConfig = generator[1];
12
+ const { default: importedGenerator } = require(plugin);
13
+
14
+ console.log(chalk.blue(`Generating EventCatalog docs using: ${plugin}`));
15
+
16
+ return importedGenerator({ eventCatalogConfig: config }, pluginConfig);
17
+ });
18
+
19
+ await Promise.all(plugins);
20
+ };
21
+
22
+ if (!process.env.NODE_ENV === 'test') {
23
+ generate();
24
+ }
25
+
26
+ module.exports = {
27
+ generate,
28
+ };
@@ -0,0 +1,116 @@
1
+ .container {
2
+ padding: 0 2rem;
3
+ }
4
+
5
+ .main {
6
+ min-height: 100vh;
7
+ padding: 4rem 0;
8
+ flex: 1;
9
+ display: flex;
10
+ flex-direction: column;
11
+ justify-content: center;
12
+ align-items: center;
13
+ }
14
+
15
+ .footer {
16
+ display: flex;
17
+ flex: 1;
18
+ padding: 2rem 0;
19
+ border-top: 1px solid #eaeaea;
20
+ justify-content: center;
21
+ align-items: center;
22
+ }
23
+
24
+ .footer a {
25
+ display: flex;
26
+ justify-content: center;
27
+ align-items: center;
28
+ flex-grow: 1;
29
+ }
30
+
31
+ .title a {
32
+ color: #0070f3;
33
+ text-decoration: none;
34
+ }
35
+
36
+ .title a:hover,
37
+ .title a:focus,
38
+ .title a:active {
39
+ text-decoration: underline;
40
+ }
41
+
42
+ .title {
43
+ margin: 0;
44
+ line-height: 1.15;
45
+ font-size: 4rem;
46
+ }
47
+
48
+ .title,
49
+ .description {
50
+ text-align: center;
51
+ }
52
+
53
+ .description {
54
+ margin: 4rem 0;
55
+ line-height: 1.5;
56
+ font-size: 1.5rem;
57
+ }
58
+
59
+ .code {
60
+ background: #fafafa;
61
+ border-radius: 5px;
62
+ padding: 0.75rem;
63
+ font-size: 1.1rem;
64
+ font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
65
+ Bitstream Vera Sans Mono, Courier New, monospace;
66
+ }
67
+
68
+ .grid {
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ flex-wrap: wrap;
73
+ max-width: 800px;
74
+ }
75
+
76
+ .card {
77
+ margin: 1rem;
78
+ padding: 1.5rem;
79
+ text-align: left;
80
+ color: inherit;
81
+ text-decoration: none;
82
+ border: 1px solid #eaeaea;
83
+ border-radius: 10px;
84
+ transition: color 0.15s ease, border-color 0.15s ease;
85
+ max-width: 300px;
86
+ }
87
+
88
+ .card:hover,
89
+ .card:focus,
90
+ .card:active {
91
+ color: #0070f3;
92
+ border-color: #0070f3;
93
+ }
94
+
95
+ .card h2 {
96
+ margin: 0 0 1rem 0;
97
+ font-size: 1.5rem;
98
+ }
99
+
100
+ .card p {
101
+ margin: 0;
102
+ font-size: 1.25rem;
103
+ line-height: 1.5;
104
+ }
105
+
106
+ .logo {
107
+ height: 1em;
108
+ margin-left: 0.5rem;
109
+ }
110
+
111
+ @media (max-width: 600px) {
112
+ .grid {
113
+ width: 100%;
114
+ flex-direction: column;
115
+ }
116
+ }
@@ -0,0 +1,48 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ .mermaid svg {
6
+ width: 100%;
7
+ }
8
+
9
+ .prose .event-table table {
10
+ width: inherit;
11
+ table-layout: inherit;
12
+ text-align: inherit;
13
+ margin-top: 0px;
14
+ margin-bottom: 0px;
15
+ }
16
+
17
+ .prose .event-table tbody td:first-child,
18
+ .prose .event-table thead th:first-child {
19
+ padding-left: 20px;
20
+ }
21
+
22
+ .prose .event-table tbody td,
23
+ event-table thead th {
24
+ padding-top: 20px;
25
+ padding-bottom: 20px;
26
+ }
27
+
28
+ .prose pre {
29
+ padding: 0;
30
+ }
31
+
32
+ /* For the exampels component on markdown page */
33
+ .prose .examples a {
34
+ text-decoration: none;
35
+ }
36
+
37
+ .prose .examples a.selected {
38
+ --tw-text-opacity: 1;
39
+ color: rgba(5, 150, 105, var(--tw-text-opacity));
40
+ }
41
+
42
+ .node-label {
43
+ font-size: 12px;
44
+ padding: 1px 4px;
45
+ border-radius: 4px;
46
+ background-color: rgba(0, 0, 0, 0.5);
47
+ user-select: none;
48
+ }
@@ -0,0 +1,16 @@
1
+ module.exports = {
2
+ purge: [],
3
+ darkMode: false,
4
+ theme: {
5
+ extend: {},
6
+ },
7
+ variants: {
8
+ extend: {},
9
+ },
10
+ purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
11
+ plugins: [
12
+ require('@tailwindcss/typography'),
13
+ require('@tailwindcss/forms'),
14
+ require('@tailwindcss/line-clamp'),
15
+ ],
16
+ };