@eventcatalog/core 2.19.5 → 2.19.7
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.
- package/README.md +4 -5
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-Q6OST5JI.js → chunk-3CL5OM5M.js} +1 -1
- package/dist/{chunk-OKHQFK4L.js → chunk-GHC5YZDP.js} +1 -1
- package/dist/{chunk-TWY4P4FZ.js → chunk-SBVM6HJV.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/src/components/Header.astro +2 -2
- package/eventcatalog/src/components/Tables/Table.tsx +81 -24
- package/eventcatalog/src/components/Tables/columns/DomainTableColumns.tsx +4 -5
- package/eventcatalog/src/components/Tables/columns/FlowTableColumns.tsx +2 -2
- package/eventcatalog/src/components/Tables/columns/MessageTableColumns.tsx +6 -6
- package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +5 -5
- package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +4 -2
- package/eventcatalog/src/layouts/DiscoverLayout.astro +8 -1
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +5 -2
- package/eventcatalog/src/pages/discover/[type]/index.astro +37 -5
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/index.astro +2 -2
- package/eventcatalog/tailwind.config.mjs +13 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h4>Features: Documentation generator for Event Driven Architectures, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
|
|
32
|
+
<h4>Features: Documentation generator for Event Driven Architectures, Integration with any broker, Docs and Code, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
|
|
33
33
|
|
|
34
34
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
35
35
|
[](#contributors-)
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
- ⭐ Discoverability feature (search, filter and more) ([demo](https://demo.eventcatalog.dev/discover/events))
|
|
53
53
|
- ⭐ Document teams and users ([demo](https://demo.eventcatalog.dev/docs/teams/full-stack))
|
|
54
54
|
- 🤖 Automate your catalogs with [generators](https://www.eventcatalog.dev/docs/development/plugins/plugin-overview) (e.g generate your catalogs from your [AsyncAPI](https://www.eventcatalog.dev/docs/ascynapi)/[OpenAPI](https://www.eventcatalog.dev/docs/openapi) documents)
|
|
55
|
+
- 👨🏼💻 Follows [Docs as code](https://www.writethedocs.org/guide/docs-as-code/) principles
|
|
55
56
|
- ⭐ And much more...
|
|
56
57
|
|
|
57
58
|
|
|
@@ -90,9 +91,9 @@ EventCatalog is focused on discovery and documentation and allows you to:
|
|
|
90
91
|
|
|
91
92
|
EventCatalog is technology agnostic, which means you can integrate your Catalog with any EDA technology of your choice and any schema formats.
|
|
92
93
|
|
|
93
|
-
EventCatalog supports a [Plugin Architecture](https://
|
|
94
|
+
EventCatalog supports a [Plugin Architecture](https://github.com/event-catalog/generators) which lets you generate documentation from your systems including OpenAPI, AsyncAPI, Event Brokers and more.
|
|
94
95
|
|
|
95
|
-
You can read more on [how it works on
|
|
96
|
+
You can read more on [how it works on GitHub](https://github.com/event-catalog/eventcatalog)
|
|
96
97
|
|
|
97
98
|
# Getting Started
|
|
98
99
|
|
|
@@ -126,8 +127,6 @@ Thank you to our project sponsors.
|
|
|
126
127
|
<a href="https://hookdeck.com/?ref=eventcatalog-sponsor" target="_blank" >Learn more</a>
|
|
127
128
|
</div> -->
|
|
128
129
|
|
|
129
|
-
<hr />
|
|
130
|
-
|
|
131
130
|
<div align="center">
|
|
132
131
|
<img alt="hookdeck" src="./images/sponsors/gravitee-logo-black.svg" width="50%" />
|
|
133
132
|
<p style="margin: 0; padding: 0;">Manage, secure, and govern every API in your organization</p>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-SBVM6HJV.js";
|
|
4
|
+
import "../chunk-3CL5OM5M.js";
|
|
5
|
+
import "../chunk-GHC5YZDP.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
package/dist/eventcatalog.js
CHANGED
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./chunk-SHCMAL37.js";
|
|
4
4
|
import {
|
|
5
5
|
log_build_default
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-SBVM6HJV.js";
|
|
7
|
+
import "./chunk-3CL5OM5M.js";
|
|
8
8
|
import {
|
|
9
9
|
catalogToAstro
|
|
10
10
|
} from "./chunk-WF34R5UT.js";
|
|
11
11
|
import {
|
|
12
12
|
VERSION
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GHC5YZDP.js";
|
|
14
14
|
import {
|
|
15
15
|
generate
|
|
16
16
|
} from "./chunk-YEQVKHST.js";
|
|
@@ -12,7 +12,7 @@ const logo = {
|
|
|
12
12
|
|
|
13
13
|
<nav
|
|
14
14
|
id="eventcatalog-header"
|
|
15
|
-
class="fixed top-0 left-0 right-0 bg-white border-b border-gray-100 py-3 font-bold text-xl bg-opacity-20 backdrop-blur-sm z-10"
|
|
15
|
+
class="fixed top-0 left-0 right-0 h-header bg-white border-b border-gray-100 py-3 font-bold text-xl bg-opacity-20 backdrop-blur-sm z-10"
|
|
16
16
|
>
|
|
17
17
|
<div class="px-4 sm:px-4 lg:px-4">
|
|
18
18
|
<div class="flex justify-between items-center">
|
|
@@ -76,7 +76,7 @@ const logo = {
|
|
|
76
76
|
</div>
|
|
77
77
|
</nav>
|
|
78
78
|
|
|
79
|
-
<div id="eventcatalog-header-spacer" class="h-
|
|
79
|
+
<div id="eventcatalog-header-spacer" class="h-header"></div>
|
|
80
80
|
<!-- Spacer to prevent content from being hidden under the fixed header -->
|
|
81
81
|
|
|
82
82
|
<script>
|
|
@@ -9,34 +9,100 @@ import {
|
|
|
9
9
|
useReactTable,
|
|
10
10
|
type Column,
|
|
11
11
|
type ColumnFiltersState,
|
|
12
|
-
type Row,
|
|
13
12
|
} from '@tanstack/react-table';
|
|
14
|
-
import type { CollectionEntry } from 'astro:content';
|
|
15
13
|
import DebouncedInput from './DebouncedInput';
|
|
16
14
|
|
|
17
15
|
import { getColumnsByCollection } from './columns';
|
|
18
|
-
import { useEffect, useMemo, useState
|
|
19
|
-
import type {
|
|
16
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
17
|
+
import type { CollectionMessageTypes } from '@types';
|
|
20
18
|
import { isSameVersion } from '@utils/collections/util';
|
|
21
19
|
|
|
22
20
|
declare module '@tanstack/react-table' {
|
|
23
21
|
// @ts-ignore
|
|
24
22
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
25
23
|
filterVariant?: 'collection' | 'name' | 'badges';
|
|
26
|
-
collectionFilterKey?:
|
|
24
|
+
collectionFilterKey?: 'producers' | 'consumers' | 'sends' | 'receives' | 'services';
|
|
27
25
|
showFilter?: boolean;
|
|
28
26
|
className?: string;
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
export
|
|
30
|
+
export type TCollectionTypes = 'domains' | 'services' | CollectionMessageTypes | 'flows';
|
|
31
|
+
|
|
32
|
+
export type TData<T extends TCollectionTypes> = {
|
|
33
|
+
collection: T;
|
|
34
|
+
data: {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
summary: string;
|
|
38
|
+
version: string;
|
|
39
|
+
latestVersion?: string; // Defined on getter collection utility
|
|
40
|
+
badges?: Array<{
|
|
41
|
+
id: string; // Where is it defined?
|
|
42
|
+
content: string;
|
|
43
|
+
backgroundColor: string;
|
|
44
|
+
textColor: string;
|
|
45
|
+
icon: any; // Where is it defined?
|
|
46
|
+
}>;
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
// Domains
|
|
49
|
+
services?: Array<{
|
|
50
|
+
collection: string; // Be more specific;
|
|
51
|
+
data: {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
version: string;
|
|
55
|
+
};
|
|
56
|
+
}>;
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
// Services
|
|
59
|
+
receives?: Array<{
|
|
60
|
+
collection: string; // Be more specific;
|
|
61
|
+
data: {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
version: string;
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
sends?: Array<{
|
|
68
|
+
collection: string; // Be more specific;
|
|
69
|
+
data: {
|
|
70
|
+
id: string;
|
|
71
|
+
name: string;
|
|
72
|
+
version: string;
|
|
73
|
+
};
|
|
74
|
+
}>;
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
// Messages
|
|
77
|
+
producers?: Array<{
|
|
78
|
+
collection: string; // Specify only 'services'?
|
|
79
|
+
data: {
|
|
80
|
+
id: string;
|
|
81
|
+
name: string;
|
|
82
|
+
version: string;
|
|
83
|
+
};
|
|
84
|
+
}>;
|
|
85
|
+
// Only for messages
|
|
86
|
+
consumers?: Array<{
|
|
87
|
+
collection: string; // Specify only 'services'?
|
|
88
|
+
data: {
|
|
89
|
+
id: string;
|
|
90
|
+
name: string;
|
|
91
|
+
version: string;
|
|
92
|
+
};
|
|
93
|
+
}>;
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const Table = <T extends TCollectionTypes>({
|
|
33
99
|
data: initialData,
|
|
34
100
|
collection,
|
|
35
101
|
mode = 'simple',
|
|
36
102
|
checkboxLatestId,
|
|
37
103
|
}: {
|
|
38
|
-
data:
|
|
39
|
-
collection:
|
|
104
|
+
data: TData<T>[];
|
|
105
|
+
collection: T;
|
|
40
106
|
checkboxLatestId: string;
|
|
41
107
|
mode?: 'simple' | 'full';
|
|
42
108
|
}) => {
|
|
@@ -68,7 +134,6 @@ export const Table = ({
|
|
|
68
134
|
const columns = useMemo(() => getColumnsByCollection(collection), [collection]);
|
|
69
135
|
|
|
70
136
|
const table = useReactTable({
|
|
71
|
-
// @ts-ignore
|
|
72
137
|
data,
|
|
73
138
|
columns,
|
|
74
139
|
onColumnFiltersChange: setColumnFilters,
|
|
@@ -106,7 +171,6 @@ export const Table = ({
|
|
|
106
171
|
<div className="text-md">
|
|
107
172
|
{header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}
|
|
108
173
|
</div>
|
|
109
|
-
{/* @ts-ignore */}
|
|
110
174
|
<div className="">
|
|
111
175
|
{header.column.columnDef.meta?.showFilter !== false && <Filter column={header.column} />}
|
|
112
176
|
{header.column.columnDef.meta?.showFilter == false && <div className="h-10" />}
|
|
@@ -201,23 +265,17 @@ export const Table = ({
|
|
|
201
265
|
);
|
|
202
266
|
};
|
|
203
267
|
|
|
204
|
-
function Filter({ column }: { column: Column<
|
|
205
|
-
const { filterVariant, collectionFilterKey
|
|
268
|
+
function Filter<T extends TCollectionTypes>({ column }: { column: Column<TData<T>, unknown> }) {
|
|
269
|
+
const { filterVariant, collectionFilterKey } = column.columnDef.meta ?? {};
|
|
206
270
|
|
|
207
271
|
const columnFilterValue = column.getFilterValue();
|
|
208
272
|
|
|
209
273
|
const sortedUniqueValues = useMemo(() => {
|
|
210
|
-
if (filterVariant === 'collection') {
|
|
274
|
+
if (filterVariant === 'collection' && collectionFilterKey) {
|
|
211
275
|
const rows = column.getFacetedRowModel().rows;
|
|
212
|
-
const data = rows
|
|
213
|
-
.map((row: Row<CollectionEntry<CollectionTypes>>) => {
|
|
214
|
-
// @ts-ignore
|
|
215
|
-
const items = row.original.data[collectionFilterKey];
|
|
216
|
-
return items as CollectionEntry<CollectionTypes>[];
|
|
217
|
-
})
|
|
218
|
-
.flat();
|
|
276
|
+
const data = rows.map((row) => row.original.data?.[collectionFilterKey] ?? []).flat();
|
|
219
277
|
|
|
220
|
-
const allItems = data.map((item) => `${item
|
|
278
|
+
const allItems = data.map((item) => `${item?.data.name} (v${item?.data.version})`);
|
|
221
279
|
const uniqueItemsInList = Array.from(new Set(allItems));
|
|
222
280
|
|
|
223
281
|
return uniqueItemsInList.sort().slice(0, 2000);
|
|
@@ -225,10 +283,9 @@ function Filter({ column }: { column: Column<any, unknown> }) {
|
|
|
225
283
|
if (filterVariant === 'name') {
|
|
226
284
|
const rows = column.getFacetedRowModel().rows;
|
|
227
285
|
const data = rows
|
|
228
|
-
.map((row
|
|
229
|
-
// @ts-ignore
|
|
286
|
+
.map((row) => {
|
|
230
287
|
const data = row.original;
|
|
231
|
-
return data
|
|
288
|
+
return data;
|
|
232
289
|
})
|
|
233
290
|
.flat();
|
|
234
291
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { ServerIcon } from '@heroicons/react/20/solid';
|
|
2
2
|
import { RectangleGroupIcon } from '@heroicons/react/20/solid';
|
|
3
3
|
import { createColumnHelper } from '@tanstack/react-table';
|
|
4
|
-
import
|
|
5
|
-
import { filterByBadge, filterByName, filterCollectionByName } from '../filters/custom-filters';
|
|
4
|
+
import { filterByName, filterCollectionByName } from '../filters/custom-filters';
|
|
6
5
|
import { buildUrl } from '@utils/url-builder';
|
|
7
|
-
import { Tag } from 'lucide-react';
|
|
8
6
|
import { createBadgesColumn } from './SharedColumns';
|
|
7
|
+
import type { TData } from '../Table';
|
|
9
8
|
|
|
10
|
-
const columnHelper = createColumnHelper<
|
|
9
|
+
const columnHelper = createColumnHelper<TData<'domains'>>();
|
|
11
10
|
|
|
12
11
|
export const columns = () => [
|
|
13
12
|
columnHelper.accessor('data.name', {
|
|
@@ -65,7 +64,7 @@ export const columns = () => [
|
|
|
65
64
|
|
|
66
65
|
return (
|
|
67
66
|
<ul>
|
|
68
|
-
{services.map((consumer
|
|
67
|
+
{services.map((consumer) => {
|
|
69
68
|
const color = 'pink';
|
|
70
69
|
return (
|
|
71
70
|
<li key={consumer.data.id} className="py-1 group ">
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createColumnHelper } from '@tanstack/react-table';
|
|
2
|
-
import type { CollectionEntry } from 'astro:content';
|
|
3
2
|
import { filterByName } from '../filters/custom-filters';
|
|
4
3
|
import { buildUrl } from '@utils/url-builder';
|
|
5
4
|
import { QueueListIcon } from '@heroicons/react/24/solid';
|
|
6
5
|
import { createBadgesColumn } from './SharedColumns';
|
|
6
|
+
import type { TData } from '../Table';
|
|
7
7
|
|
|
8
|
-
const columnHelper = createColumnHelper<
|
|
8
|
+
const columnHelper = createColumnHelper<TData<'flows'>>();
|
|
9
9
|
|
|
10
10
|
export const columns = () => [
|
|
11
11
|
columnHelper.accessor('data.name', {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ServerIcon, BoltIcon, ChatBubbleLeftIcon, MagnifyingGlassIcon } from '@heroicons/react/24/solid';
|
|
2
2
|
import { createColumnHelper } from '@tanstack/react-table';
|
|
3
|
-
import type { CollectionMessageTypes } from '@types';
|
|
4
|
-
import type { CollectionEntry } from 'astro:content';
|
|
5
3
|
import { useMemo } from 'react';
|
|
6
|
-
import { filterByName, filterCollectionByName
|
|
4
|
+
import { filterByName, filterCollectionByName } from '../filters/custom-filters';
|
|
7
5
|
import { buildUrl } from '@utils/url-builder';
|
|
8
6
|
import { createBadgesColumn } from './SharedColumns';
|
|
7
|
+
import type { TData } from '../Table';
|
|
8
|
+
import type { CollectionMessageTypes } from '@types';
|
|
9
9
|
|
|
10
|
-
const columnHelper = createColumnHelper<
|
|
10
|
+
const columnHelper = createColumnHelper<TData<CollectionMessageTypes>>();
|
|
11
11
|
|
|
12
12
|
export const getColorAndIconForMessageType = (type: string) => {
|
|
13
13
|
switch (type) {
|
|
@@ -80,7 +80,7 @@ export const columns = () => [
|
|
|
80
80
|
return <div className="font-light text-sm text-gray-400/60 text-left italic">No producers documented</div>;
|
|
81
81
|
return (
|
|
82
82
|
<ul className="">
|
|
83
|
-
{producers.map((producer
|
|
83
|
+
{producers.map((producer, index) => {
|
|
84
84
|
return (
|
|
85
85
|
<li className="py-2 group flex items-center space-x-2" key={`${producer.data.id}-${index}`}>
|
|
86
86
|
<a
|
|
@@ -120,7 +120,7 @@ export const columns = () => [
|
|
|
120
120
|
|
|
121
121
|
return (
|
|
122
122
|
<ul>
|
|
123
|
-
{consumers.map((consumer
|
|
123
|
+
{consumers.map((consumer, index) => {
|
|
124
124
|
return (
|
|
125
125
|
<li key={`${consumer.data.id}-${index}`} className="py-1 group font-light ">
|
|
126
126
|
<a
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ServerIcon, BoltIcon, ChatBubbleLeftIcon } from '@heroicons/react/24/solid';
|
|
2
2
|
import { createColumnHelper } from '@tanstack/react-table';
|
|
3
|
-
import type { CollectionEntry } from 'astro:content';
|
|
4
3
|
import { useMemo, useState } from 'react';
|
|
5
4
|
import { filterByName, filterCollectionByName } from '../filters/custom-filters';
|
|
6
5
|
import { buildUrl } from '@utils/url-builder';
|
|
7
6
|
import { getColorAndIconForMessageType } from './MessageTableColumns';
|
|
8
7
|
import { createBadgesColumn } from './SharedColumns';
|
|
8
|
+
import type { TData } from '../Table';
|
|
9
9
|
|
|
10
|
-
const columnHelper = createColumnHelper<
|
|
10
|
+
const columnHelper = createColumnHelper<TData<'services'>>();
|
|
11
11
|
|
|
12
12
|
export const columns = () => [
|
|
13
13
|
columnHelper.accessor('data.name', {
|
|
@@ -65,7 +65,7 @@ export const columns = () => [
|
|
|
65
65
|
|
|
66
66
|
const receiversWithIcons = useMemo(
|
|
67
67
|
() =>
|
|
68
|
-
receives?.map((consumer
|
|
68
|
+
receives?.map((consumer) => {
|
|
69
69
|
const type = consumer.collection.slice(0, -1);
|
|
70
70
|
return {
|
|
71
71
|
...consumer,
|
|
@@ -87,7 +87,7 @@ export const columns = () => [
|
|
|
87
87
|
)}
|
|
88
88
|
{isExpanded && (
|
|
89
89
|
<ul>
|
|
90
|
-
{receiversWithIcons.map((consumer
|
|
90
|
+
{receiversWithIcons.map((consumer, index: number) => (
|
|
91
91
|
<li key={`${consumer.data.id}-${index}`} className="py-1 group font-light ">
|
|
92
92
|
<a
|
|
93
93
|
href={buildUrl(`/docs/${consumer.collection}/${consumer.data.id}/${consumer.data.version}`)}
|
|
@@ -137,7 +137,7 @@ export const columns = () => [
|
|
|
137
137
|
)}
|
|
138
138
|
{isExpanded && (
|
|
139
139
|
<ul>
|
|
140
|
-
{sends.map((consumer
|
|
140
|
+
{sends.map((consumer, index) => {
|
|
141
141
|
const type = consumer.collection.slice(0, -1);
|
|
142
142
|
const color = type === 'event' ? 'orange' : 'blue';
|
|
143
143
|
const Icon = type === 'event' ? BoltIcon : ChatBubbleLeftIcon;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { createColumnHelper } from '@tanstack/react-table';
|
|
2
2
|
import { Tag } from 'lucide-react';
|
|
3
3
|
import { filterByBadge } from '../filters/custom-filters';
|
|
4
|
-
|
|
4
|
+
import type { TCollectionTypes, TData } from '../Table';
|
|
5
|
+
|
|
6
|
+
export const createBadgesColumn = <T extends { data: Pick<TData<U>['data'], 'badges'> }, U extends TCollectionTypes>(
|
|
5
7
|
columnHelper: ReturnType<typeof createColumnHelper<T>>
|
|
6
8
|
) => {
|
|
7
9
|
return columnHelper.accessor((row) => row.data.badges, {
|
|
@@ -16,7 +18,7 @@ export const createBadgesColumn = <T extends { data: { badges?: any[] } }>(
|
|
|
16
18
|
|
|
17
19
|
return (
|
|
18
20
|
<ul>
|
|
19
|
-
{badges.map((badge
|
|
21
|
+
{badges.map((badge, index) => {
|
|
20
22
|
return (
|
|
21
23
|
<li key={`${badge.id}-${index}`} className="py-1 group font-light ">
|
|
22
24
|
<div className="group-hover:text-primary flex space-x-1 items-center ">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { Table } from '@components/Tables/Table';
|
|
2
|
+
import { Table, type TData, type TCollectionTypes } from '@components/Tables/Table';
|
|
3
3
|
import { QueueListIcon, RectangleGroupIcon, BoltIcon, ChatBubbleLeftIcon } from '@heroicons/react/24/outline';
|
|
4
4
|
import ServerIcon from '@heroicons/react/24/outline/ServerIcon';
|
|
5
5
|
import { getCommands } from '@utils/commands';
|
|
@@ -20,6 +20,13 @@ const services = await getServices();
|
|
|
20
20
|
const domains = await getDomains();
|
|
21
21
|
const flows = await getFlows();
|
|
22
22
|
|
|
23
|
+
export interface Props<T extends TCollectionTypes> {
|
|
24
|
+
title: string;
|
|
25
|
+
subtitle: string;
|
|
26
|
+
data: TData<T>[];
|
|
27
|
+
type: T;
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
const { title, subtitle, data, type } = Astro.props;
|
|
24
31
|
const currentPath = Astro.url.pathname;
|
|
25
32
|
|
|
@@ -202,12 +202,15 @@ const showSideBarOnLoad = currentNavigationItem?.sidebar;
|
|
|
202
202
|
|
|
203
203
|
<div
|
|
204
204
|
id="sidebar"
|
|
205
|
-
class={`sidebar-transition h-
|
|
205
|
+
class={`sidebar-transition h-content px-5 py-4 overflow-y-auto bg-white bg-gradient-to-b from-white to-gray-100 border-r border-gray-200 w-60 shadow-lg ml-16 ${showSideBarOnLoad ? 'block' : 'hidden'}`}
|
|
206
206
|
>
|
|
207
207
|
<CatalogResourcesSideBar resources={sideNav} currentPath={currentPath} client:load />
|
|
208
208
|
</div>
|
|
209
209
|
</aside>
|
|
210
|
-
<main
|
|
210
|
+
<main
|
|
211
|
+
class={`sidebar-transition w-full max-h-content overflow-y-auto ${showSideBarOnLoad ? 'ml-0' : 'ml-16'}`}
|
|
212
|
+
id="content"
|
|
213
|
+
>
|
|
211
214
|
<slot />
|
|
212
215
|
</main>
|
|
213
216
|
</div>
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import DiscoverLayout from '@layouts/DiscoverLayout.astro';
|
|
3
|
-
import type { PageTypes } from '@types';
|
|
2
|
+
import DiscoverLayout, { type Props as DiscoverLayoutProps } from '@layouts/DiscoverLayout.astro';
|
|
4
3
|
import { getFlows } from '@utils/collections/flows';
|
|
5
4
|
|
|
6
5
|
import { pageDataLoader } from '@utils/page-loaders/page-data-loader';
|
|
7
|
-
type PageTypesWithFlows = PageTypes | 'flows';
|
|
8
6
|
|
|
9
7
|
export async function getStaticPaths() {
|
|
10
8
|
const loaders = {
|
|
@@ -12,7 +10,7 @@ export async function getStaticPaths() {
|
|
|
12
10
|
flows: getFlows,
|
|
13
11
|
};
|
|
14
12
|
|
|
15
|
-
const itemTypes
|
|
13
|
+
const itemTypes = ['events', 'commands', 'queries', 'services', 'domains', 'flows'] as const;
|
|
16
14
|
const allItems = await Promise.all(itemTypes.map((type) => loaders[type]()));
|
|
17
15
|
|
|
18
16
|
return allItems.flatMap((items, index) => ({
|
|
@@ -27,11 +25,45 @@ export async function getStaticPaths() {
|
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
const { type, data } = Astro.props;
|
|
28
|
+
|
|
29
|
+
function mapToItem(i: any) {
|
|
30
|
+
return {
|
|
31
|
+
collection: i.collection,
|
|
32
|
+
data: {
|
|
33
|
+
id: i.data.id,
|
|
34
|
+
name: i.data.name,
|
|
35
|
+
version: i.data.version,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
30
39
|
---
|
|
31
40
|
|
|
32
41
|
<DiscoverLayout
|
|
33
42
|
title={`${type} (${data.length})`}
|
|
34
43
|
subtitle={`Find, filter and search for any ${type} in your system.`}
|
|
35
|
-
data={data
|
|
44
|
+
data={data.map(
|
|
45
|
+
(d) =>
|
|
46
|
+
({
|
|
47
|
+
collection: d.collection,
|
|
48
|
+
data: {
|
|
49
|
+
id: d.data.id,
|
|
50
|
+
name: d.data.name,
|
|
51
|
+
summary: d.data?.summary,
|
|
52
|
+
version: d.data.version,
|
|
53
|
+
latestVersion: d.data?.latestVersion,
|
|
54
|
+
badges: d.data?.badges,
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
consumers: d.data?.consumers?.map(mapToItem) ?? [],
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
producers: d.data?.producers?.map(mapToItem) ?? [],
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
receives: d.data?.receives?.map(mapToItem) ?? [],
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
sends: d.data?.sends?.map(mapToItem) ?? [],
|
|
63
|
+
// @ts-ignore
|
|
64
|
+
services: d.data?.services?.map(mapToItem) ?? [],
|
|
65
|
+
},
|
|
66
|
+
}) as DiscoverLayoutProps<typeof type>['data'][0]
|
|
67
|
+
)}
|
|
36
68
|
type={type}
|
|
37
69
|
/>
|
|
@@ -42,7 +42,7 @@ const pathOnDisk = path.join(process.cwd(), 'public', pathToSpec);
|
|
|
42
42
|
const fileExists = fs.existsSync(pathOnDisk);
|
|
43
43
|
---
|
|
44
44
|
|
|
45
|
-
<VerticalSideBarLayout title="OpenAPI Spec"
|
|
45
|
+
<VerticalSideBarLayout title="OpenAPI Spec">
|
|
46
46
|
{
|
|
47
47
|
!fileExists ? (
|
|
48
48
|
<div class="text-center h-screen flex flex-col justify-center ">
|
|
@@ -65,7 +65,7 @@ const fileExists = fs.existsSync(pathOnDisk);
|
|
|
65
65
|
theme="light"
|
|
66
66
|
schema-style="table"
|
|
67
67
|
class="relative top-0"
|
|
68
|
-
style={{ height: '
|
|
68
|
+
style={{ height: '100%', width: '100%', zIndex: 100 }}
|
|
69
69
|
regular-font="ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji"
|
|
70
70
|
bg-color="#ffffff"
|
|
71
71
|
primary-color="#6b21a8"
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
/** @type {import('tailwindcss').Config} */
|
|
2
1
|
import config from './eventcatalog.config.js';
|
|
2
|
+
|
|
3
|
+
const HEADER_HEIGHT = '4rem';
|
|
3
4
|
const theme = config.theme || {};
|
|
5
|
+
|
|
6
|
+
/** @type {import('tailwindcss').Config} */
|
|
4
7
|
export default {
|
|
5
8
|
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
|
|
6
9
|
theme: {
|
|
7
10
|
extend: {
|
|
11
|
+
height: {
|
|
12
|
+
header: HEADER_HEIGHT,
|
|
13
|
+
content: `calc(100vh - ${HEADER_HEIGHT})`,
|
|
14
|
+
},
|
|
15
|
+
spacing: {
|
|
16
|
+
header: HEADER_HEIGHT,
|
|
17
|
+
content: `calc(100vh - ${HEADER_HEIGHT})`,
|
|
18
|
+
},
|
|
8
19
|
screens: {
|
|
9
20
|
xxl: '1990px',
|
|
10
21
|
},
|
|
@@ -17,7 +28,7 @@ export default {
|
|
|
17
28
|
DEFAULT: '#ff6633',
|
|
18
29
|
dark: '#cc3300',
|
|
19
30
|
},
|
|
20
|
-
...theme
|
|
31
|
+
...theme,
|
|
21
32
|
},
|
|
22
33
|
},
|
|
23
34
|
},
|