@eventcatalog/core 3.36.3 → 3.36.5
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/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-SPFT3VTV.js → chunk-2WL2AHTJ.js} +1 -1
- package/dist/{chunk-6L5LHQ3C.js → chunk-CZV4WMQ2.js} +1 -1
- package/dist/{chunk-ZE3NM2MH.js → chunk-J3ZV5QI5.js} +1 -1
- package/dist/{chunk-DTE424XY.js → chunk-TGSOUKM7.js} +1 -1
- package/dist/{chunk-4U6TPQGC.js → chunk-VDTDZ4XR.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/docs/api/09-flow-api.md +38 -0
- package/dist/docs/api/11-data-api.md +6 -1
- package/dist/docs/development/bring-your-own-documentation/custom-pages/03-components.md +7 -0
- package/dist/docs/development/components/components/08-flow.md +14 -5
- package/dist/docs/development/components/components/12-nodegraph.md +7 -4
- package/dist/docs/development/guides/flows/01-introduction.md +1 -1
- package/dist/docs/development/guides/flows/03-flow-nodes.md +58 -4
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +5 -5
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/components/MDX/Flow/Flow.astro +10 -6
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +10 -5
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/root-index.astro +32 -28
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +41 -12
- package/eventcatalog/src/utils/markdown.ts +8 -3
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-J3ZV5QI5.js";
|
|
4
|
+
import "../chunk-VDTDZ4XR.js";
|
|
5
5
|
import "../chunk-4UVFXLPI.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-TGSOUKM7.js";
|
|
7
7
|
import "../chunk-5T63CXKU.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
|
@@ -261,7 +261,45 @@ Flows allow you to create [service nodes](/docs/services). Services link to your
|
|
|
261
261
|
|
|
262
262
|
_[See example of Message node in a workflow](https://demo.eventcatalog.dev/visualiser/flows/CancelSubscription/0.0.1)._
|
|
263
263
|
|
|
264
|
+
#### Container Nodes
|
|
264
265
|
|
|
266
|
+
<AddedIn version="3.36.3" />
|
|
267
|
+
|
|
268
|
+
Flows allow you to create [container (data store) nodes](/docs/development/guides/data/introduction). Containers link to your defined data stores in EventCatalog. The container's sidebar will automatically show a "Flows" section linking back to any flow that references it.
|
|
269
|
+
|
|
270
|
+
```md title="Example"
|
|
271
|
+
---
|
|
272
|
+
steps:
|
|
273
|
+
- id: "orders_db"
|
|
274
|
+
title: "Orders DB"
|
|
275
|
+
container:
|
|
276
|
+
id: "orders-db"
|
|
277
|
+
version: "1.0.0"
|
|
278
|
+
next_step:
|
|
279
|
+
id: "next_step"
|
|
280
|
+
label: "Persist order records"
|
|
281
|
+
---
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
#### Data Product Nodes
|
|
285
|
+
|
|
286
|
+
<AddedIn version="3.36.3" />
|
|
287
|
+
|
|
288
|
+
Flows allow you to create [data product nodes](/docs/development/guides/data-products/introduction). Data products link to your defined data products in EventCatalog. The data product's sidebar will automatically show a "Flows" section linking back to any flow that references it.
|
|
289
|
+
|
|
290
|
+
```md title="Example"
|
|
291
|
+
---
|
|
292
|
+
steps:
|
|
293
|
+
- id: "order_analytics"
|
|
294
|
+
title: "Order Analytics"
|
|
295
|
+
dataProduct:
|
|
296
|
+
id: "order-analytics"
|
|
297
|
+
version: "1.0.0"
|
|
298
|
+
next_step:
|
|
299
|
+
id: "next_step"
|
|
300
|
+
label: "Prepare fulfillment KPIs"
|
|
301
|
+
---
|
|
302
|
+
```
|
|
265
303
|
|
|
266
304
|
## Optional fields {#optional-fields}
|
|
267
305
|
|
|
@@ -235,7 +235,12 @@ Options:
|
|
|
235
235
|
| `changelog` | `object` | No | An object with a `visible` property to show/hide the changelog button |
|
|
236
236
|
| `owners` | `object` | No | An object with a `visible` property to show/hide the owners section |
|
|
237
237
|
| `attachments` | `object` | No | An object with a `visible` property to show/hide the attachments section |
|
|
238
|
-
| `repository` | `object` | No | An object with a `visible` property to show/hide the repository section |
|
|
238
|
+
| `repository` | `object` | No | An object with a `visible` property to show/hide the repository section |
|
|
239
|
+
| `flows` | `object` | No | An object with a `visible` property to show/hide the flows section |
|
|
240
|
+
|
|
241
|
+
**`flows`** <AddedIn version="3.36.3" />
|
|
242
|
+
|
|
243
|
+
Shows which flows reference this data store as a step. Flows are surfaced automatically when a [flow step](/docs/development/guides/flows/flow-nodes) uses the `container` node type to reference this resource.
|
|
239
244
|
|
|
240
245
|
### `attachments` {#attachments}
|
|
241
246
|
|
|
@@ -36,6 +36,10 @@ This is my custom documentation page, here is a NodeGraph:
|
|
|
36
36
|
Rest of my markdown content...
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
:::note Required props
|
|
40
|
+
In custom documentation pages, `id`, `version`, and `type` are all required. A `<NodeGraph />` missing any of these props is silently ignored.
|
|
41
|
+
:::
|
|
42
|
+
|
|
39
43
|
#### NodeGraph props
|
|
40
44
|
|
|
41
45
|
| Prop | Type | Required | Description |
|
|
@@ -43,4 +47,7 @@ Rest of my markdown content...
|
|
|
43
47
|
| `id` | string | Yes | The id of the resource (domain, service, or message) |
|
|
44
48
|
| `version` | string | Yes | The version of the resource |
|
|
45
49
|
| `type` | string | Yes | The type of the resource (domain, service, command, event, query) |
|
|
50
|
+
| `search` | boolean | No | Show or hide the search bar. Accepts `true`/`false` or `"true"`/`"false"`. Defaults to `true`. |
|
|
51
|
+
| `legend` | boolean | No | Show or hide the legend. Accepts `true`/`false` or `"true"`/`"false"`. Defaults to `true`. |
|
|
52
|
+
| `mode` | string | No | `"simple"` or `"full"`. Defaults to `"simple"`. |
|
|
46
53
|
|
|
@@ -14,20 +14,29 @@ Embed flows into your pages.
|
|
|
14
14
|
**Example**
|
|
15
15
|
|
|
16
16
|
```jsx /domains/MyDomain/index.mdx
|
|
17
|
-
<Flow id="CancelSubscription" version="latest"
|
|
17
|
+
<Flow id="CancelSubscription" version="latest" legend={false} />
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
### Output
|
|
21
21
|

|
|
22
22
|
|
|
23
23
|
### Props
|
|
24
|
+
|
|
25
|
+
<AddedIn version="3.36.3" />
|
|
26
|
+
|
|
24
27
|
| Name | Type | Default | Description |
|
|
25
28
|
| ----------------------- | --------- | ----------------- | ----------------------------------------------------------------- |
|
|
26
29
|
| `id` (required) | `string` | (empty) | Flow id to render in your page |
|
|
27
|
-
| `version` (optional) | `string` | "latest" | Version of the flow to render. Supports exact version and semver versions (e.g 1.0.x, ^1.3.5, latest)|
|
|
28
|
-
| `
|
|
29
|
-
| `search` (optional) | `boolean` |
|
|
30
|
-
| `
|
|
30
|
+
| `version` (optional) | `string` | `"latest"` | Version of the flow to render. Supports exact version and semver versions (e.g 1.0.x, ^1.3.5, latest)|
|
|
31
|
+
| `legend` (optional) | `boolean` | `true` | Show or hide the diagram key. Accepts `true`/`false` or `"true"`/`"false"`. `includeKey` is still accepted as an alias. |
|
|
32
|
+
| `search` (optional) | `boolean` | `false` | Show or hide the search bar in the flow. Accepts `true`/`false` or `"true"`/`"false"`. |
|
|
33
|
+
| `walkthrough` (optional) | `boolean` | `false` | Show or hide the step walkthrough controls. Accepts `true`/`false` or `"true"`/`"false"`. |
|
|
34
|
+
| `mode` (optional) | `string` ("simple" or "full") | `"simple"` | `simple` renders the flow in a simplified view without descriptions. `full` renders descriptions and other information.|
|
|
35
|
+
|
|
36
|
+
:::tip Multiple embeds per page
|
|
37
|
+
You can embed multiple `<Flow />` components on the same page and each one renders independently.
|
|
38
|
+
:::
|
|
39
|
+
|
|
31
40
|
|
|
32
41
|
## Interactive controls
|
|
33
42
|
|
|
@@ -25,12 +25,15 @@ The `<NodeGraph/>` component is supported in domains, services, and all messages
|
|
|
25
25
|

|
|
26
26
|
|
|
27
27
|
#### Props
|
|
28
|
+
|
|
29
|
+
<AddedIn version="3.36.3" />
|
|
30
|
+
|
|
28
31
|
| Name | Type | Default | Description |
|
|
29
32
|
| ----------------------- | --------- | ----------------- | ----------------------------------------------------------------- |
|
|
30
|
-
| `maxHeight` (optional) | `string` | 30 | Max height to set the nodegraph in your document|
|
|
31
|
-
| `search` (optional) | `boolean` | true | Show or hide the search bar
|
|
32
|
-
| `legend` (optional) | `boolean` | true | Show or hide the legend
|
|
33
|
-
| `mode` (optional) | `string` ("simple" or "full") | "simple" | `simple`
|
|
33
|
+
| `maxHeight` (optional) | `string` | `30` | Max height to set the nodegraph in your document|
|
|
34
|
+
| `search` (optional) | `boolean` | `true` | Show or hide the search bar. Accepts `true`/`false` or `"true"`/`"false"`. |
|
|
35
|
+
| `legend` (optional) | `boolean` | `true` | Show or hide the legend. Accepts `true`/`false` or `"true"`/`"false"`. |
|
|
36
|
+
| `mode` (optional) | `string` ("simple" or "full") | `"simple"` | `simple` renders a simplified view without descriptions. `full` renders descriptions and other information.|
|
|
34
37
|
|
|
35
38
|
|
|
36
39
|
## Interactive controls
|
|
@@ -12,7 +12,7 @@ import AddedIn from '@site/src/components/MDX/AddedIn';
|
|
|
12
12
|
|
|
13
13
|
<AddedIn version="2.5.0" />
|
|
14
14
|
|
|
15
|
-
Flows are a way to document business workflows in your organization. You can reuse your documented resources (e.g services, messages, data stores) in your flows.
|
|
15
|
+
Flows are a way to document business workflows in your organization. You can reuse your documented resources (e.g services, messages, data stores, data products) in your flows.
|
|
16
16
|
|
|
17
17
|
An example of a flow would be when a user makes a payment to an e-commence system, this interaction triggers many parts of the architecture (services, external services, commands, queries and events):
|
|
18
18
|
|
|
@@ -13,9 +13,7 @@ import AddedIn from '@site/src/components/MDX/AddedIn';
|
|
|
13
13
|
|
|
14
14
|
Flow nodes are the building blocks of flows. They are used to represent the different steps in a flow.
|
|
15
15
|
|
|
16
|
-
With flow nodes you can reference your services, events, commands and queries, external systems, users (actors) or
|
|
17
|
-
|
|
18
|
-
EventCatalog (> 2.34.2) you can also reference flows as a node type.
|
|
16
|
+
With flow nodes you can reference your services, events, commands and queries, external systems, users (actors), data stores (containers), data products, or create your own custom nodes.
|
|
19
17
|
|
|
20
18
|
## Common step properties
|
|
21
19
|
|
|
@@ -31,7 +29,7 @@ Every flow step (regardless of node type) supports these properties:
|
|
|
31
29
|
| `next_steps` | [Step reference](#connecting-steps)[] | No | Multiple next steps for branching (cannot be used with `next_step`) |
|
|
32
30
|
|
|
33
31
|
:::tip Type exclusivity rule
|
|
34
|
-
Each step can only use **one** node type property. You cannot combine `message`, `service`, `flow`, `actor`, `custom`, or `externalSystem` on the same step.
|
|
32
|
+
Each step can only use **one** node type property. You cannot combine `message`, `service`, `flow`, `container`, `dataProduct`, `actor`, `custom`, or `externalSystem` on the same step.
|
|
35
33
|
:::
|
|
36
34
|
|
|
37
35
|
## Connecting steps {#connecting-steps}
|
|
@@ -67,6 +65,8 @@ next_steps:
|
|
|
67
65
|
- [message](#message) — Represents an event, command or query resource in EventCatalog
|
|
68
66
|
- [service](#service) — Represents a service resource in EventCatalog
|
|
69
67
|
- [flow](#flow) — Represents a flow in EventCatalog (added in EventCatalog 2.34.2)
|
|
68
|
+
- [container](#container) — Represents a data store (container) resource in EventCatalog
|
|
69
|
+
- [dataProduct](#dataproduct) — Represents a data product resource in EventCatalog
|
|
70
70
|
- [custom](#custom) — A custom node type with configurable title, summary, icon, properties and more
|
|
71
71
|
|
|
72
72
|
|
|
@@ -202,6 +202,60 @@ Click a flow node in the visualiser to expand the referenced flow's steps inline
|
|
|
202
202
|
|
|
203
203
|
---
|
|
204
204
|
|
|
205
|
+
### container
|
|
206
|
+
|
|
207
|
+
<AddedIn version="3.36.3" />
|
|
208
|
+
|
|
209
|
+
Represents and refers to a data store (container) resource in EventCatalog. When a flow references a container, the container's sidebar automatically shows a "Flows" section linking back to the referencing flow.
|
|
210
|
+
|
|
211
|
+
#### Container properties
|
|
212
|
+
|
|
213
|
+
| Property | Type | Required | Description |
|
|
214
|
+
|----------|------|----------|-------------|
|
|
215
|
+
| `id` | `string` | **Yes** | The id of the container in your catalog |
|
|
216
|
+
| `version` | `string` | No | The version to reference (defaults to `latest`) |
|
|
217
|
+
|
|
218
|
+
```yml
|
|
219
|
+
steps:
|
|
220
|
+
- id: "orders_db"
|
|
221
|
+
title: "Orders DB"
|
|
222
|
+
container:
|
|
223
|
+
id: "orders-db"
|
|
224
|
+
version: "1.0.0"
|
|
225
|
+
next_step:
|
|
226
|
+
id: "next_step"
|
|
227
|
+
label: "Persist order records"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
### dataProduct
|
|
233
|
+
|
|
234
|
+
<AddedIn version="3.36.3" />
|
|
235
|
+
|
|
236
|
+
Represents and refers to a data product resource in EventCatalog. When a flow references a data product, the data product's sidebar automatically shows a "Flows" section linking back to the referencing flow.
|
|
237
|
+
|
|
238
|
+
#### Data product properties
|
|
239
|
+
|
|
240
|
+
| Property | Type | Required | Description |
|
|
241
|
+
|----------|------|----------|-------------|
|
|
242
|
+
| `id` | `string` | **Yes** | The id of the data product in your catalog |
|
|
243
|
+
| `version` | `string` | No | The version to reference (defaults to `latest`) |
|
|
244
|
+
|
|
245
|
+
```yml
|
|
246
|
+
steps:
|
|
247
|
+
- id: "order_analytics"
|
|
248
|
+
title: "Order Analytics"
|
|
249
|
+
dataProduct:
|
|
250
|
+
id: "order-analytics"
|
|
251
|
+
version: "1.0.0"
|
|
252
|
+
next_step:
|
|
253
|
+
id: "next_step"
|
|
254
|
+
label: "Prepare fulfillment KPIs"
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
205
259
|
### custom
|
|
206
260
|
|
|
207
261
|
<AddedIn version="2.30.6" />
|
package/dist/eventcatalog.cjs
CHANGED
|
@@ -114,7 +114,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
114
114
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
115
115
|
|
|
116
116
|
// package.json
|
|
117
|
-
var version = "3.36.
|
|
117
|
+
var version = "3.36.5";
|
|
118
118
|
|
|
119
119
|
// src/constants.ts
|
|
120
120
|
var VERSION = version;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
} from "./chunk-K3ZVEX2Y.js";
|
|
14
14
|
import {
|
|
15
15
|
log_build_default
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-J3ZV5QI5.js";
|
|
17
|
+
import "./chunk-VDTDZ4XR.js";
|
|
18
18
|
import "./chunk-4UVFXLPI.js";
|
|
19
19
|
import {
|
|
20
20
|
catalogToAstro
|
|
@@ -28,13 +28,13 @@ import {
|
|
|
28
28
|
} from "./chunk-ULZYHF3V.js";
|
|
29
29
|
import {
|
|
30
30
|
generate
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-CZV4WMQ2.js";
|
|
32
32
|
import {
|
|
33
33
|
logger
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-2WL2AHTJ.js";
|
|
35
35
|
import {
|
|
36
36
|
VERSION
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-TGSOUKM7.js";
|
|
38
38
|
import {
|
|
39
39
|
getEventCatalogConfigFile,
|
|
40
40
|
verifyRequiredFieldsAreInCatalogConfigFile
|
package/dist/generate.cjs
CHANGED
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-CZV4WMQ2.js";
|
|
4
|
+
import "./chunk-2WL2AHTJ.js";
|
|
5
|
+
import "./chunk-TGSOUKM7.js";
|
|
6
6
|
import "./chunk-5T63CXKU.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -6,10 +6,15 @@ import AstroNodeGraph from '../NodeGraph/AstroNodeGraph';
|
|
|
6
6
|
import { getVersionFromCollection } from '@utils/collections/versions';
|
|
7
7
|
import { isVisualiserEnabled, isEventCatalogChatEnabled, isDevMode } from '@utils/feature';
|
|
8
8
|
import { loadSavedLayout, applyLayoutToNodes, buildResourceKey } from '@utils/node-graphs/layout-persistence';
|
|
9
|
+
import { randomUUID } from 'node:crypto';
|
|
10
|
+
import { parseMdxBooleanProp } from '@utils/markdown';
|
|
9
11
|
|
|
10
12
|
const isChatEnabled = isEventCatalogChatEnabled();
|
|
11
13
|
|
|
12
|
-
const { id, version = 'latest', maxHeight,
|
|
14
|
+
const { id, version = 'latest', maxHeight, mode = 'simple' } = Astro.props;
|
|
15
|
+
const includeKey = parseMdxBooleanProp(Astro.props.legend ?? Astro.props.includeKey, true);
|
|
16
|
+
const search = parseMdxBooleanProp(Astro.props.search, false);
|
|
17
|
+
const walkthrough = parseMdxBooleanProp(Astro.props.walkthrough, false);
|
|
13
18
|
|
|
14
19
|
// Find the flow for the given id and version
|
|
15
20
|
const flows = await getFlows();
|
|
@@ -28,6 +33,7 @@ const { nodes, edges } = await getNodesAndEdges({
|
|
|
28
33
|
const resourceKey = buildResourceKey('flows', id, flow.data.version);
|
|
29
34
|
const savedLayout = await loadSavedLayout(resourceKey);
|
|
30
35
|
const nodesWithLayout = applyLayoutToNodes(nodes, savedLayout);
|
|
36
|
+
const portalId = `${id}-${flow.data.version}-flow-${randomUUID()}-portal`;
|
|
31
37
|
---
|
|
32
38
|
|
|
33
39
|
{
|
|
@@ -45,7 +51,7 @@ const nodesWithLayout = applyLayoutToNodes(nodes, savedLayout);
|
|
|
45
51
|
|
|
46
52
|
<div
|
|
47
53
|
class="h-[30em] my-6 mb-12 w-full relative border border-[rgb(var(--ec-page-border))] rounded-md"
|
|
48
|
-
id={
|
|
54
|
+
id={portalId}
|
|
49
55
|
style={{
|
|
50
56
|
maxHeight: maxHeight ? `${maxHeight}em` : `30em`,
|
|
51
57
|
}}
|
|
@@ -57,12 +63,10 @@ const nodesWithLayout = applyLayoutToNodes(nodes, savedLayout);
|
|
|
57
63
|
id={id}
|
|
58
64
|
nodes={nodesWithLayout}
|
|
59
65
|
edges={edges}
|
|
60
|
-
|
|
61
|
-
href={isVisualiserEnabled() ? `/visualiser/flows/${id}/${version}` : undefined}
|
|
62
|
-
linkTo={'visualiser'}
|
|
66
|
+
mode={mode}
|
|
63
67
|
includeKey={includeKey}
|
|
64
|
-
footerLabel=`Flow diagram - ${flow.data.name} - v(${flow.data.version})`
|
|
65
68
|
client:only="react"
|
|
69
|
+
portalId={portalId}
|
|
66
70
|
showFlowWalkthrough={walkthrough}
|
|
67
71
|
showSearch={search}
|
|
68
72
|
isChatEnabled={isChatEnabled}
|
|
@@ -9,7 +9,7 @@ import mdxComponents from '@components/MDX/components';
|
|
|
9
9
|
import { getOwner } from '@utils/collections/owners';
|
|
10
10
|
import { buildUrl, buildEditUrlForResource } from '@utils/url-builder';
|
|
11
11
|
import { resourceToCollectionMap } from '@utils/collections/util';
|
|
12
|
-
import { getMDXComponentsByName } from '@utils/markdown';
|
|
12
|
+
import { getMDXComponentsByName, parseMdxBooleanProp } from '@utils/markdown';
|
|
13
13
|
import { getAdjacentPages, getNavigationItems } from '@enterprise/custom-documentation/utils/custom-docs';
|
|
14
14
|
import CustomDocsNav from '@enterprise/custom-documentation/components/CustomDocsNav/CustomDocsNav.astro';
|
|
15
15
|
import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
|
|
@@ -22,7 +22,10 @@ const doc = props.data;
|
|
|
22
22
|
const { Content, headings } = await render(props as any);
|
|
23
23
|
const currentSlug = props.id;
|
|
24
24
|
|
|
25
|
-
const nodeGraphs =
|
|
25
|
+
const nodeGraphs =
|
|
26
|
+
getMDXComponentsByName(props.body, 'NodeGraph')?.filter((nodeGraph: any) => {
|
|
27
|
+
return nodeGraph.id && nodeGraph.version && nodeGraph.type;
|
|
28
|
+
}) || [];
|
|
26
29
|
|
|
27
30
|
const { prev, next } = await getAdjacentPages(currentSlug);
|
|
28
31
|
|
|
@@ -152,8 +155,10 @@ const editUrl =
|
|
|
152
155
|
version={nodeGraph.version}
|
|
153
156
|
collection={collection}
|
|
154
157
|
title={nodeGraph.title}
|
|
155
|
-
mode=
|
|
158
|
+
mode={nodeGraph.mode || 'simple'}
|
|
156
159
|
linksToVisualiser={true}
|
|
160
|
+
showSearch={parseMdxBooleanProp(nodeGraph.search, true)}
|
|
161
|
+
showLegend={parseMdxBooleanProp(nodeGraph.legend, true)}
|
|
157
162
|
href={
|
|
158
163
|
isVisualiserEnabled()
|
|
159
164
|
? {
|
|
@@ -177,7 +182,7 @@ const editUrl =
|
|
|
177
182
|
class="group flex flex-col border border-[rgb(var(--ec-page-border))] rounded-lg p-4 hover:border-[rgb(var(--ec-content-text-muted))] hover:bg-[rgb(var(--ec-content-hover))] transition-colors w-full sm:w-1/2"
|
|
178
183
|
>
|
|
179
184
|
<span class="text-sm text-[rgb(var(--ec-page-text-muted))] mb-1">Previous</span>
|
|
180
|
-
<span class="font-medium text-[rgb(var(--ec-page-text))] group-hover:text-
|
|
185
|
+
<span class="font-medium text-[rgb(var(--ec-page-text))] group-hover:text-[rgb(var(--ec-accent))] transition-colors">
|
|
181
186
|
{prev.label}
|
|
182
187
|
</span>
|
|
183
188
|
</a>
|
|
@@ -193,7 +198,7 @@ const editUrl =
|
|
|
193
198
|
class="group flex flex-col items-end text-right border border-[rgb(var(--ec-page-border))] rounded-lg p-4 hover:border-[rgb(var(--ec-content-text-muted))] hover:bg-[rgb(var(--ec-content-hover))] transition-colors w-full sm:w-1/2"
|
|
194
199
|
>
|
|
195
200
|
<span class="text-sm text-[rgb(var(--ec-page-text-muted))] mb-1">Next</span>
|
|
196
|
-
<span class="font-medium text-[rgb(var(--ec-page-text))] group-hover:text-
|
|
201
|
+
<span class="font-medium text-[rgb(var(--ec-page-text))] group-hover:text-[rgb(var(--ec-accent))] transition-colors">
|
|
197
202
|
{next.label}
|
|
198
203
|
</span>
|
|
199
204
|
</a>
|
|
@@ -99,28 +99,28 @@ if (!isCustomDocsEnabled()) {
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
101
|
<VerticalSideBarLayout title="Custom Documentation" showNestedSideBar={false}>
|
|
102
|
-
<body class="min-h-screen font-inter">
|
|
102
|
+
<body class="min-h-screen font-inter bg-[rgb(var(--ec-page-bg))] text-[rgb(var(--ec-page-text))]">
|
|
103
103
|
<main class="container px-8 lg:px-8 mx-auto py-8 max-w-[80em]">
|
|
104
104
|
<div class="mb-12">
|
|
105
105
|
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-6">
|
|
106
106
|
<div>
|
|
107
107
|
<div class="flex flex-wrap items-center gap-3 mb-3">
|
|
108
|
-
<h1 class="text-4xl font-semibold text-
|
|
108
|
+
<h1 class="text-4xl font-semibold text-[rgb(var(--ec-page-text))] font-inter">Custom Documentation</h1>
|
|
109
109
|
<div
|
|
110
110
|
class="inline-flex items-center px-3 py-1.5 rounded-full text-xs font-medium bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent-text))] border border-[rgb(var(--ec-accent)/0.3)] shadow-xs"
|
|
111
111
|
>
|
|
112
112
|
Pro feature
|
|
113
113
|
</div>
|
|
114
114
|
</div>
|
|
115
|
-
<p class="text-base mb-0 text-
|
|
115
|
+
<p class="text-base mb-0 text-[rgb(var(--ec-page-text-muted))] max-w-3xl">
|
|
116
116
|
Add custom documentation to EventCatalog to create a unified source of truth for your team. Document your
|
|
117
117
|
architecture decisions, patterns, and guidelines.
|
|
118
118
|
</p>
|
|
119
119
|
</div>
|
|
120
120
|
<div class="flex space-x-4 shrink-0">
|
|
121
121
|
<a
|
|
122
|
-
href="https://www.eventcatalog.dev/docs/custom-
|
|
123
|
-
class="inline-flex items-center justify-center px-5 py-2 border border-
|
|
122
|
+
href="https://www.eventcatalog.dev/docs/development/bring-your-own-documentation/custom-pages/introduction"
|
|
123
|
+
class="inline-flex items-center justify-center px-5 py-2 border border-[rgb(var(--ec-page-border))] text-sm font-medium rounded-md text-[rgb(var(--ec-page-text))] bg-[rgb(var(--ec-card-bg))] hover:bg-[rgb(var(--ec-content-hover))] transition-colors"
|
|
124
124
|
>
|
|
125
125
|
Read documentation →
|
|
126
126
|
</a>
|
|
@@ -128,7 +128,7 @@ if (!isCustomDocsEnabled()) {
|
|
|
128
128
|
!isCustomDocsEnabled() && (
|
|
129
129
|
<a
|
|
130
130
|
href="https://www.eventcatalog.dev/pro/trial"
|
|
131
|
-
class="inline-flex items-center justify-center px-5 py-2 border border-transparent text-sm font-medium rounded-md text-
|
|
131
|
+
class="inline-flex items-center justify-center px-5 py-2 border border-transparent text-sm font-medium rounded-md text-[rgb(var(--ec-button-text))] bg-gradient-to-r from-[rgb(var(--ec-accent-gradient-from))] to-[rgb(var(--ec-accent-gradient-to))] hover:opacity-90 shadow-xs"
|
|
132
132
|
>
|
|
133
133
|
Start 14-day trial
|
|
134
134
|
</a>
|
|
@@ -138,58 +138,62 @@ if (!isCustomDocsEnabled()) {
|
|
|
138
138
|
</div>
|
|
139
139
|
</div>
|
|
140
140
|
|
|
141
|
-
<h2 class="text-2xl font-semibold mb-2 text-
|
|
142
|
-
<p class="text-
|
|
141
|
+
<h2 class="text-2xl font-semibold mb-2 text-[rgb(var(--ec-page-text))]">Setup Guide</h2>
|
|
142
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mb-8 max-w-3xl">
|
|
143
143
|
Custom documentation let's you bring any documentation into EventCatalog. This is useful for documenting your architecture
|
|
144
144
|
decisions, patterns, and guidelines. Follow these steps to get started:
|
|
145
145
|
</p>
|
|
146
146
|
|
|
147
147
|
<div class="space-y-10 mb-12">
|
|
148
|
-
<div class="bg-
|
|
148
|
+
<div class="bg-[rgb(var(--ec-card-bg))] p-6 rounded-lg shadow-xs border border-[rgb(var(--ec-page-border))]">
|
|
149
149
|
<div class="flex items-start gap-4">
|
|
150
150
|
<div
|
|
151
|
-
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-
|
|
151
|
+
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent))] text-lg font-medium shrink-0 mt-1"
|
|
152
152
|
>
|
|
153
153
|
1
|
|
154
154
|
</div>
|
|
155
155
|
<div class="w-full">
|
|
156
|
-
<h3 class="text-xl font-semibold text-
|
|
157
|
-
<p class="text-
|
|
156
|
+
<h3 class="text-xl font-semibold text-[rgb(var(--ec-page-text))] mb-3">Create the content structure</h3>
|
|
157
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mb-4">
|
|
158
|
+
Create a folder structure in your directory to organize your documentation.
|
|
159
|
+
</p>
|
|
158
160
|
<Code code={folderStructureExample} lang="bash" frame="terminal" />
|
|
159
161
|
</div>
|
|
160
162
|
</div>
|
|
161
163
|
</div>
|
|
162
164
|
|
|
163
|
-
<div class="bg-
|
|
165
|
+
<div class="bg-[rgb(var(--ec-card-bg))] p-6 rounded-lg shadow-xs border border-[rgb(var(--ec-page-border))]">
|
|
164
166
|
<div class="flex items-start gap-4">
|
|
165
167
|
<div
|
|
166
|
-
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-
|
|
168
|
+
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent))] text-lg font-medium shrink-0 mt-1"
|
|
167
169
|
>
|
|
168
170
|
2
|
|
169
171
|
</div>
|
|
170
172
|
<div class="w-full">
|
|
171
|
-
<h3 class="text-xl font-semibold text-
|
|
172
|
-
<p class="text-
|
|
173
|
+
<h3 class="text-xl font-semibold text-[rgb(var(--ec-page-text))] mb-3">Add MDX files</h3>
|
|
174
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mb-4">Create MDX files with frontmatter and markdown content.</p>
|
|
173
175
|
<Code code={mdxFileExample} lang="mdx" frame="terminal" />
|
|
174
176
|
</div>
|
|
175
177
|
</div>
|
|
176
178
|
</div>
|
|
177
179
|
|
|
178
|
-
<div class="bg-
|
|
180
|
+
<div class="bg-[rgb(var(--ec-card-bg))] p-6 rounded-lg shadow-xs border border-[rgb(var(--ec-page-border))]">
|
|
179
181
|
<div class="flex items-start gap-4">
|
|
180
182
|
<div
|
|
181
|
-
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-
|
|
183
|
+
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent))] text-lg font-medium shrink-0 mt-1"
|
|
182
184
|
>
|
|
183
185
|
3
|
|
184
186
|
</div>
|
|
185
187
|
<div class="w-full">
|
|
186
|
-
<h3 class="text-xl font-semibold text-
|
|
187
|
-
<p class="text-
|
|
188
|
+
<h3 class="text-xl font-semibold text-[rgb(var(--ec-page-text))] mb-3">Update your eventcatalog.config.js file</h3>
|
|
189
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mb-4">
|
|
188
190
|
Add the customDocs configuration to your eventcatalog.config.js file to define your sidebar structure.
|
|
189
191
|
</p>
|
|
190
192
|
<Code code={configExample} lang="js" frame="terminal" />
|
|
191
|
-
<p class="text-
|
|
192
|
-
|
|
193
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mt-4">
|
|
194
|
+
This configuration defines the sidebar structure for your custom documentation:
|
|
195
|
+
</p>
|
|
196
|
+
<ul class="list-disc list-inside text-[rgb(var(--ec-page-text-muted))] mt-2 ml-2 space-y-1">
|
|
193
197
|
<li>
|
|
194
198
|
<strong>label</strong>: The display name for each sidebar section
|
|
195
199
|
</li>
|
|
@@ -210,25 +214,25 @@ if (!isCustomDocsEnabled()) {
|
|
|
210
214
|
</div>
|
|
211
215
|
</div>
|
|
212
216
|
|
|
213
|
-
<div class="bg-
|
|
217
|
+
<div class="bg-[rgb(var(--ec-card-bg))] p-6 rounded-lg shadow-xs border border-[rgb(var(--ec-page-border))]">
|
|
214
218
|
<div class="flex items-start gap-4">
|
|
215
219
|
<div
|
|
216
|
-
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-
|
|
220
|
+
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent))] text-lg font-medium shrink-0 mt-1"
|
|
217
221
|
>
|
|
218
222
|
4
|
|
219
223
|
</div>
|
|
220
224
|
<div class="w-full">
|
|
221
|
-
<h3 class="text-xl font-semibold text-
|
|
222
|
-
<p class="text-
|
|
225
|
+
<h3 class="text-xl font-semibold text-[rgb(var(--ec-page-text))] mb-3">Restart EventCatalog</h3>
|
|
226
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mb-4">
|
|
223
227
|
After configuring your documentation, restart EventCatalog to see your custom documentation.
|
|
224
228
|
</p>
|
|
225
229
|
<div class="mb-4">
|
|
226
230
|
<Code code="npm run dev" lang="bash" frame="terminal" />
|
|
227
231
|
</div>
|
|
228
|
-
<p class="text-
|
|
232
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mb-4">
|
|
229
233
|
Once restarted, you'll see your custom documentation displayed with the sidebar structure you defined:
|
|
230
234
|
</p>
|
|
231
|
-
<div class="border border-
|
|
235
|
+
<div class="border border-[rgb(var(--ec-page-border))] rounded-lg overflow-hidden">
|
|
232
236
|
<img src="/images/custom-docs-placeholder.png" alt="Example of custom documentation interface" class="w-full" />
|
|
233
237
|
</div>
|
|
234
238
|
</div>
|
|
@@ -150,7 +150,7 @@ const navigationItems = [
|
|
|
150
150
|
href: getDefaultUrl('docs/custom', '/docs/custom'),
|
|
151
151
|
current: currentPath.includes('/docs/custom'),
|
|
152
152
|
isPremium: true,
|
|
153
|
-
visible: isCustomDocsEnabled(),
|
|
153
|
+
visible: isCustomDocsEnabled() && customDocs.length > 0,
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
id: '/schemas/explorer',
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
isRSSEnabled,
|
|
44
44
|
isExportPDFEnabled,
|
|
45
45
|
} from '@utils/feature';
|
|
46
|
-
import { getMDXComponentsByName } from '@utils/markdown';
|
|
46
|
+
import { getMDXComponentsByName, parseMdxBooleanProp } from '@utils/markdown';
|
|
47
47
|
|
|
48
48
|
import type { CollectionTypes } from '@types';
|
|
49
49
|
|
|
@@ -265,10 +265,40 @@ const generatePromptForResource = (props: any) => {
|
|
|
265
265
|
};
|
|
266
266
|
|
|
267
267
|
// Handle node graphs in the markdown
|
|
268
|
-
|
|
268
|
+
const currentPageNodeGraph = {
|
|
269
|
+
id: props.data.id,
|
|
270
|
+
version: props.data.version,
|
|
271
|
+
type: collectionToResourceMap[props.collection as keyof typeof collectionToResourceMap],
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
let nodeGraphs =
|
|
275
|
+
getMDXComponentsByName(props.body || '', 'NodeGraph')?.map((nodeGraph: any) => {
|
|
276
|
+
const graph = nodeGraph.id === undefined ? { ...currentPageNodeGraph, ...nodeGraph } : nodeGraph;
|
|
277
|
+
|
|
278
|
+
return {
|
|
279
|
+
...graph,
|
|
280
|
+
search: parseMdxBooleanProp(nodeGraph.search, true),
|
|
281
|
+
legend: parseMdxBooleanProp(nodeGraph.legend, true),
|
|
282
|
+
};
|
|
283
|
+
}) || [];
|
|
284
|
+
const flowEmbeds = getMDXComponentsByName(props.body || '', 'Flow') || [];
|
|
269
285
|
|
|
270
286
|
// Get props for the node graph (when no id is passed, we assume its the current page)
|
|
271
|
-
const
|
|
287
|
+
const hasCurrentFlowEmbed =
|
|
288
|
+
props.collection === 'flows' &&
|
|
289
|
+
flowEmbeds.some((flowEmbed: any) => {
|
|
290
|
+
const flowId = flowEmbed.id;
|
|
291
|
+
const flowVersion = flowEmbed.version || 'latest';
|
|
292
|
+
|
|
293
|
+
return flowId === props.data.id && (flowVersion === 'latest' || flowVersion === props.data.version);
|
|
294
|
+
});
|
|
295
|
+
const hasCurrentPageNodeGraph = nodeGraphs.some((nodeGraph: any) => {
|
|
296
|
+
return (
|
|
297
|
+
nodeGraph.id === currentPageNodeGraph.id &&
|
|
298
|
+
nodeGraph.version === currentPageNodeGraph.version &&
|
|
299
|
+
nodeGraph.type === currentPageNodeGraph.type
|
|
300
|
+
);
|
|
301
|
+
});
|
|
272
302
|
|
|
273
303
|
const shouldRenderVersionList =
|
|
274
304
|
shouldRenderSideBarSection(props, 'versions') && props.data.versions && props.data.versions.length > 1;
|
|
@@ -287,15 +317,14 @@ const httpMethodStyle = httpOperation?.method
|
|
|
287
317
|
? httpMethodColors[httpOperation.method.toUpperCase()] || { background: '#6b7280', color: '#ffffff' }
|
|
288
318
|
: undefined;
|
|
289
319
|
|
|
290
|
-
// This will render the graph for this page
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
});
|
|
320
|
+
// This will render the graph for this page. Flow pages can already render their graph explicitly via <Flow />.
|
|
321
|
+
if (!hasCurrentFlowEmbed && !hasCurrentPageNodeGraph) {
|
|
322
|
+
nodeGraphs.push({
|
|
323
|
+
...currentPageNodeGraph,
|
|
324
|
+
search: true,
|
|
325
|
+
legend: true,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
299
328
|
---
|
|
300
329
|
|
|
301
330
|
<VerticalSideBarLayout title={pageTitle} description={props.data.summary}>
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// rarely used, but useful for components that need to know how many times
|
|
3
3
|
// the user wants to render a component in a markdown file
|
|
4
4
|
export const getMDXComponentsByName = (document: string, componentName: string) => {
|
|
5
|
-
// Define regex pattern to match
|
|
6
|
-
const pattern = new RegExp(`<${componentName}\\s+
|
|
5
|
+
// Define regex pattern to match self-closing MDX components with or without props.
|
|
6
|
+
const pattern = new RegExp(`<${componentName}(\\s+[^>]*)?\\s*\\/>`, 'g');
|
|
7
7
|
|
|
8
8
|
// Find all matches of the pattern
|
|
9
9
|
const matches = [...document.matchAll(pattern)];
|
|
10
10
|
|
|
11
11
|
// Extract the properties of each SchemaViewer
|
|
12
12
|
const components = matches.map((match) => {
|
|
13
|
-
const propsString = match[1];
|
|
13
|
+
const propsString = match[1] || '';
|
|
14
14
|
const props = {};
|
|
15
15
|
|
|
16
16
|
// Use regex to extract key-value pairs from propsString
|
|
@@ -28,3 +28,8 @@ export const getMDXComponentsByName = (document: string, componentName: string)
|
|
|
28
28
|
|
|
29
29
|
return components;
|
|
30
30
|
};
|
|
31
|
+
|
|
32
|
+
export const parseMdxBooleanProp = (value: unknown, defaultValue: boolean) => {
|
|
33
|
+
if (value === undefined) return defaultValue;
|
|
34
|
+
return value === true || value === 'true';
|
|
35
|
+
};
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "3.36.
|
|
10
|
+
"version": "3.36.5",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"uuid": "^10.0.0",
|
|
108
108
|
"zod": "^4.3.6",
|
|
109
109
|
"@eventcatalog/linter": "1.0.23",
|
|
110
|
-
"@eventcatalog/
|
|
111
|
-
"@eventcatalog/
|
|
110
|
+
"@eventcatalog/sdk": "2.21.1",
|
|
111
|
+
"@eventcatalog/visualiser": "^3.20.3"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@astrojs/check": "^0.9.9",
|