@eventcatalog/core 5.1.0 → 5.2.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 (34) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/architecture-export.cjs +34 -2
  6. package/dist/architecture-export.d.cts +25 -1
  7. package/dist/architecture-export.d.ts +25 -1
  8. package/dist/architecture-export.js +11 -3
  9. package/dist/{chunk-FHZXZWCY.js → chunk-66OL4B7U.js} +1 -1
  10. package/dist/chunk-IR5MKGKS.js +60 -0
  11. package/dist/{chunk-OT57IOWN.js → chunk-N2LLD5TR.js} +1 -1
  12. package/dist/{chunk-TBXLUIJD.js → chunk-NBYKF4Z4.js} +1 -1
  13. package/dist/{chunk-G3CHTDAE.js → chunk-RNYFUWJI.js} +1 -1
  14. package/dist/{chunk-WBUSFEBH.js → chunk-XI5HQWM2.js} +1 -1
  15. package/dist/constants.cjs +1 -1
  16. package/dist/constants.js +1 -1
  17. package/dist/docs/api/02-config.md +51 -0
  18. package/dist/docs/development/bring-your-own-documentation/_category_.json +1 -1
  19. package/dist/docs/development/customization/08-custom-properties.md +48 -1
  20. package/dist/docs/development/export/01-introduction.md +90 -0
  21. package/dist/docs/development/export/02-architecture-reference.md +74 -0
  22. package/dist/docs/development/export/03-custom-exports.md +257 -0
  23. package/dist/docs/development/export/04-reference.md +383 -0
  24. package/dist/docs/development/export/_category_.json +12 -0
  25. package/dist/eventcatalog.cjs +64 -1
  26. package/dist/eventcatalog.config.d.cts +28 -0
  27. package/dist/eventcatalog.config.d.ts +28 -0
  28. package/dist/eventcatalog.js +47 -7
  29. package/dist/generate.cjs +1 -1
  30. package/dist/generate.js +3 -3
  31. package/dist/utils/cli-logger.cjs +1 -1
  32. package/dist/utils/cli-logger.js +2 -2
  33. package/package.json +4 -4
  34. package/dist/chunk-E6WTCJUL.js +0 -32
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(analytics_exports);
36
36
  var import_os = __toESM(require("os"), 1);
37
37
 
38
38
  // package.json
39
- var version = "5.1.0";
39
+ var version = "5.2.0";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-FHZXZWCY.js";
3
+ } from "../chunk-66OL4B7U.js";
4
4
  import "../chunk-CPW6G62V.js";
5
- import "../chunk-OT57IOWN.js";
5
+ import "../chunk-N2LLD5TR.js";
6
6
  export {
7
7
  raiseEvent
8
8
  };
@@ -169,7 +169,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
169
169
  var import_os = __toESM(require("os"), 1);
170
170
 
171
171
  // package.json
172
- var version = "5.1.0";
172
+ var version = "5.2.0";
173
173
 
174
174
  // src/constants.ts
175
175
  var VERSION = version;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-G3CHTDAE.js";
3
+ } from "../chunk-RNYFUWJI.js";
4
4
  import "../chunk-AD7CL772.js";
5
- import "../chunk-FHZXZWCY.js";
5
+ import "../chunk-66OL4B7U.js";
6
6
  import "../chunk-ZAZHAVKB.js";
7
7
  import "../chunk-CA6WCQ2T.js";
8
8
  import "../chunk-CPW6G62V.js";
9
- import "../chunk-OT57IOWN.js";
9
+ import "../chunk-N2LLD5TR.js";
10
10
  import "../chunk-4G7FSRPN.js";
11
11
  export {
12
12
  log_build_default as default
@@ -31,9 +31,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var architecture_export_exports = {};
32
32
  __export(architecture_export_exports, {
33
33
  getArchitectureExportPath: () => getArchitectureExportPath,
34
+ getCustomExportsDir: () => getCustomExportsDir,
35
+ hasCustomExports: () => hasCustomExports,
34
36
  isCatalogAuthEnabled: () => isCatalogAuthEnabled,
35
37
  resolveArchitectureExport: () => resolveArchitectureExport,
36
- writeArchitectureExport: () => writeArchitectureExport
38
+ resolveCustomExports: () => resolveCustomExports,
39
+ writeArchitectureExport: () => writeArchitectureExport,
40
+ writeCustomExportsToBuild: () => writeCustomExportsToBuild
37
41
  });
38
42
  module.exports = __toCommonJS(architecture_export_exports);
39
43
  var import_node_fs = __toESM(require("fs"), 1);
@@ -60,10 +64,38 @@ var writeArchitectureExport = ({
60
64
  outputPath: getArchitectureExportPath({ outDir, isServer }),
61
65
  regenerateCommand: "npx eventcatalog build"
62
66
  });
67
+ var resolveCustomExports = (config, { authEnabled }) => {
68
+ const enabled = config?.exports?.custom?.enabled;
69
+ if (enabled === false) return { enabled: false, reason: "disabled" };
70
+ if (authEnabled && enabled !== true) return { enabled: false, reason: "auth" };
71
+ return { enabled: true };
72
+ };
73
+ var hasCustomExports = ({
74
+ projectDir,
75
+ config
76
+ }) => {
77
+ const folder = import_node_path.default.join(projectDir, config?.exports?.custom?.dir || import_exporters.DEFAULT_CUSTOM_EXPORTS_DIR);
78
+ return import_node_fs.default.existsSync(folder) && import_node_fs.default.readdirSync(folder).some((name) => /\.mdx?$/i.test(name));
79
+ };
80
+ var getCustomExportsDir = ({ outDir, isServer }) => import_node_path.default.join(outDir, isServer ? "client" : "", "exports");
81
+ var writeCustomExportsToBuild = ({
82
+ projectDir,
83
+ outDir,
84
+ isServer,
85
+ config
86
+ }) => (0, import_exporters.writeCustomExports)({
87
+ dir: projectDir,
88
+ outputDir: getCustomExportsDir({ outDir, isServer }),
89
+ config: config?.exports?.custom ?? {}
90
+ });
63
91
  // Annotate the CommonJS export names for ESM import in node:
64
92
  0 && (module.exports = {
65
93
  getArchitectureExportPath,
94
+ getCustomExportsDir,
95
+ hasCustomExports,
66
96
  isCatalogAuthEnabled,
67
97
  resolveArchitectureExport,
68
- writeArchitectureExport
98
+ resolveCustomExports,
99
+ writeArchitectureExport,
100
+ writeCustomExportsToBuild
69
101
  });
@@ -1,4 +1,5 @@
1
1
  import * as _eventcatalog_exporters from '@eventcatalog/exporters';
2
+ import { CustomExportsConfig } from '@eventcatalog/exporters';
2
3
 
3
4
  /** The part of eventcatalog.config.js that controls the architecture reference. */
4
5
  interface ArchitectureExportConfig {
@@ -6,6 +7,7 @@ interface ArchitectureExportConfig {
6
7
  html?: {
7
8
  enabled?: boolean;
8
9
  };
10
+ custom?: CustomExportsConfig;
9
11
  };
10
12
  }
11
13
  /**
@@ -44,5 +46,27 @@ declare const writeArchitectureExport: ({ projectDir, outDir, isServer, }: {
44
46
  outDir: string;
45
47
  isServer: boolean;
46
48
  }) => Promise<_eventcatalog_exporters.WriteHtmlResult>;
49
+ /** Custom exports (exports/*.mdx) follow the same rule as the reference: on unless turned off, and opt-in with auth. */
50
+ declare const resolveCustomExports: (config: ArchitectureExportConfig | null | undefined, { authEnabled }: {
51
+ authEnabled: boolean;
52
+ }) => ArchitectureExportDecision;
53
+ /** Whether the catalog has any custom export files, so a catalog without them never hears about custom exports. */
54
+ declare const hasCustomExports: ({ projectDir, config, }: {
55
+ projectDir: string;
56
+ config: ArchitectureExportConfig | null | undefined;
57
+ }) => boolean;
58
+ declare const getCustomExportsDir: ({ outDir, isServer }: {
59
+ outDir: string;
60
+ isServer: boolean;
61
+ }) => string;
62
+ declare const writeCustomExportsToBuild: ({ projectDir, outDir, isServer, config, }: {
63
+ projectDir: string;
64
+ outDir: string;
65
+ isServer: boolean;
66
+ config: ArchitectureExportConfig | null | undefined;
67
+ }) => Promise<{
68
+ written: _eventcatalog_exporters.WrittenCustomExport[];
69
+ failed: _eventcatalog_exporters.CustomExportFailure[];
70
+ }>;
47
71
 
48
- export { type ArchitectureExportConfig, type ArchitectureExportDecision, getArchitectureExportPath, isCatalogAuthEnabled, resolveArchitectureExport, writeArchitectureExport };
72
+ export { type ArchitectureExportConfig, type ArchitectureExportDecision, getArchitectureExportPath, getCustomExportsDir, hasCustomExports, isCatalogAuthEnabled, resolveArchitectureExport, resolveCustomExports, writeArchitectureExport, writeCustomExportsToBuild };
@@ -1,4 +1,5 @@
1
1
  import * as _eventcatalog_exporters from '@eventcatalog/exporters';
2
+ import { CustomExportsConfig } from '@eventcatalog/exporters';
2
3
 
3
4
  /** The part of eventcatalog.config.js that controls the architecture reference. */
4
5
  interface ArchitectureExportConfig {
@@ -6,6 +7,7 @@ interface ArchitectureExportConfig {
6
7
  html?: {
7
8
  enabled?: boolean;
8
9
  };
10
+ custom?: CustomExportsConfig;
9
11
  };
10
12
  }
11
13
  /**
@@ -44,5 +46,27 @@ declare const writeArchitectureExport: ({ projectDir, outDir, isServer, }: {
44
46
  outDir: string;
45
47
  isServer: boolean;
46
48
  }) => Promise<_eventcatalog_exporters.WriteHtmlResult>;
49
+ /** Custom exports (exports/*.mdx) follow the same rule as the reference: on unless turned off, and opt-in with auth. */
50
+ declare const resolveCustomExports: (config: ArchitectureExportConfig | null | undefined, { authEnabled }: {
51
+ authEnabled: boolean;
52
+ }) => ArchitectureExportDecision;
53
+ /** Whether the catalog has any custom export files, so a catalog without them never hears about custom exports. */
54
+ declare const hasCustomExports: ({ projectDir, config, }: {
55
+ projectDir: string;
56
+ config: ArchitectureExportConfig | null | undefined;
57
+ }) => boolean;
58
+ declare const getCustomExportsDir: ({ outDir, isServer }: {
59
+ outDir: string;
60
+ isServer: boolean;
61
+ }) => string;
62
+ declare const writeCustomExportsToBuild: ({ projectDir, outDir, isServer, config, }: {
63
+ projectDir: string;
64
+ outDir: string;
65
+ isServer: boolean;
66
+ config: ArchitectureExportConfig | null | undefined;
67
+ }) => Promise<{
68
+ written: _eventcatalog_exporters.WrittenCustomExport[];
69
+ failed: _eventcatalog_exporters.CustomExportFailure[];
70
+ }>;
47
71
 
48
- export { type ArchitectureExportConfig, type ArchitectureExportDecision, getArchitectureExportPath, isCatalogAuthEnabled, resolveArchitectureExport, writeArchitectureExport };
72
+ export { type ArchitectureExportConfig, type ArchitectureExportDecision, getArchitectureExportPath, getCustomExportsDir, hasCustomExports, isCatalogAuthEnabled, resolveArchitectureExport, resolveCustomExports, writeArchitectureExport, writeCustomExportsToBuild };
@@ -1,12 +1,20 @@
1
1
  import {
2
2
  getArchitectureExportPath,
3
+ getCustomExportsDir,
4
+ hasCustomExports,
3
5
  isCatalogAuthEnabled,
4
6
  resolveArchitectureExport,
5
- writeArchitectureExport
6
- } from "./chunk-E6WTCJUL.js";
7
+ resolveCustomExports,
8
+ writeArchitectureExport,
9
+ writeCustomExportsToBuild
10
+ } from "./chunk-IR5MKGKS.js";
7
11
  export {
8
12
  getArchitectureExportPath,
13
+ getCustomExportsDir,
14
+ hasCustomExports,
9
15
  isCatalogAuthEnabled,
10
16
  resolveArchitectureExport,
11
- writeArchitectureExport
17
+ resolveCustomExports,
18
+ writeArchitectureExport,
19
+ writeCustomExportsToBuild
12
20
  };
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-CPW6G62V.js";
5
5
  import {
6
6
  VERSION
7
- } from "./chunk-OT57IOWN.js";
7
+ } from "./chunk-N2LLD5TR.js";
8
8
 
9
9
  // src/analytics/analytics.js
10
10
  import os from "os";
@@ -0,0 +1,60 @@
1
+ // src/architecture-export.ts
2
+ import fs from "fs";
3
+ import path from "path";
4
+ import { DEFAULT_CUSTOM_EXPORTS_DIR, writeCustomExports, writeHtml } from "@eventcatalog/exporters";
5
+ var isCatalogAuthEnabled = ({
6
+ config,
7
+ projectDir,
8
+ isServer
9
+ }) => Boolean(config?.auth?.enabled) && isServer && fs.existsSync(path.join(projectDir, "eventcatalog.auth.js"));
10
+ var resolveArchitectureExport = (config, { authEnabled }) => {
11
+ const enabled = config?.exports?.html?.enabled;
12
+ if (enabled === false) return { enabled: false, reason: "disabled" };
13
+ if (authEnabled && enabled !== true) return { enabled: false, reason: "auth" };
14
+ return { enabled: true };
15
+ };
16
+ var getArchitectureExportPath = ({ outDir, isServer }) => path.join(outDir, isServer ? "client" : "", "architecture.html");
17
+ var writeArchitectureExport = ({
18
+ projectDir,
19
+ outDir,
20
+ isServer
21
+ }) => writeHtml({
22
+ dir: projectDir,
23
+ outputPath: getArchitectureExportPath({ outDir, isServer }),
24
+ regenerateCommand: "npx eventcatalog build"
25
+ });
26
+ var resolveCustomExports = (config, { authEnabled }) => {
27
+ const enabled = config?.exports?.custom?.enabled;
28
+ if (enabled === false) return { enabled: false, reason: "disabled" };
29
+ if (authEnabled && enabled !== true) return { enabled: false, reason: "auth" };
30
+ return { enabled: true };
31
+ };
32
+ var hasCustomExports = ({
33
+ projectDir,
34
+ config
35
+ }) => {
36
+ const folder = path.join(projectDir, config?.exports?.custom?.dir || DEFAULT_CUSTOM_EXPORTS_DIR);
37
+ return fs.existsSync(folder) && fs.readdirSync(folder).some((name) => /\.mdx?$/i.test(name));
38
+ };
39
+ var getCustomExportsDir = ({ outDir, isServer }) => path.join(outDir, isServer ? "client" : "", "exports");
40
+ var writeCustomExportsToBuild = ({
41
+ projectDir,
42
+ outDir,
43
+ isServer,
44
+ config
45
+ }) => writeCustomExports({
46
+ dir: projectDir,
47
+ outputDir: getCustomExportsDir({ outDir, isServer }),
48
+ config: config?.exports?.custom ?? {}
49
+ });
50
+
51
+ export {
52
+ isCatalogAuthEnabled,
53
+ resolveArchitectureExport,
54
+ getArchitectureExportPath,
55
+ writeArchitectureExport,
56
+ resolveCustomExports,
57
+ hasCustomExports,
58
+ getCustomExportsDir,
59
+ writeCustomExportsToBuild
60
+ };
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "5.1.0";
2
+ var version = "5.2.0";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-WBUSFEBH.js";
3
+ } from "./chunk-XI5HQWM2.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-AD7CL772.js";
4
4
  import {
5
5
  raiseEvent
6
- } from "./chunk-FHZXZWCY.js";
6
+ } from "./chunk-66OL4B7U.js";
7
7
  import {
8
8
  countResources,
9
9
  hashCatalogContent,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-OT57IOWN.js";
3
+ } from "./chunk-N2LLD5TR.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "5.1.0";
28
+ var version = "5.2.0";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-OT57IOWN.js";
3
+ } from "./chunk-N2LLD5TR.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -968,6 +968,57 @@ Enable tools like Claude, ChatGPT, GitHub Copilot, and Cursor to quickly underst
968
968
  See the [LLMs documentation](/docs/development/ask-your-architecture/llms.txt) for more information, how you can use it and examples.
969
969
 
970
970
 
971
+ ### `exports.html` {#exports.html}
972
+
973
+ <AddedIn version="5.1.0" />
974
+
975
+ - Type: `object`
976
+ - Default: `{ enabled: true }` (`false` when your catalog uses authentication)
977
+
978
+ Controls the [architecture reference](/docs/development/export/architecture-reference): your whole catalog as one HTML file, written to `architecture.html` in your build output on every build.
979
+
980
+ ```js title="eventcatalog.config.js"
981
+ module.exports = {
982
+ exports: {
983
+ html: {
984
+ enabled: false, // default is true
985
+ },
986
+ },
987
+ };
988
+ ```
989
+
990
+ Catalogs with authentication only get the reference when `enabled` is `true`, because files in the build output are served without the authentication checks.
991
+
992
+ ### `exports.custom` {#exports.custom}
993
+
994
+ <AddedIn version="5.2.0" />
995
+
996
+ - Type: `object`
997
+ - Default: `{ enabled: true }` (`false` when your catalog uses authentication)
998
+
999
+ Controls [custom exports](/docs/development/export/custom-exports) (see the [reference](/docs/development/export/reference#exports-custom)): the parts of your catalog you choose for partners, a regulator or another team, each written to `exports/<id>.html` in your build output on every build. Custom exports are only written when your catalog has custom export files.
1000
+
1001
+ | Option | Type | Description |
1002
+ | --- | --- | --- |
1003
+ | `enabled` | `boolean` | Write the custom exports when you build. |
1004
+ | `dir` | `string` | The folder with your custom export files. Defaults to `exports`. |
1005
+ | `only` | `string[]` | Build only these custom exports, by id. |
1006
+ | `defaults.hide` | `string[]` | The fields every custom export leaves out, unless it sets its own `hide`. Defaults to `['owners', 'repository', 'contacts', 'docs']`. |
1007
+ | `defaults.references` | `string` | What every custom export shows for links to resources outside it, unless it sets its own: `omit` (the default), `name-only` or `include`. |
1008
+ | `neverExport` | `object[]` | Resources no custom export may show, whatever it includes. Takes [selectors](/docs/development/export/reference#selectors), by id or by custom property. |
1009
+
1010
+ ```js title="eventcatalog.config.js"
1011
+ module.exports = {
1012
+ exports: {
1013
+ custom: {
1014
+ only: ['partner-payments'],
1015
+ defaults: { references: 'name-only' },
1016
+ neverExport: [{ service: 'fraud-detection' }, { 'x-internal': true }],
1017
+ },
1018
+ },
1019
+ };
1020
+ ```
1021
+
971
1022
  ### `fullCatalogAPIEnabled` {#fullCatalogAPIEnabled}
972
1023
 
973
1024
  <AddedIn version="3.10.2" />
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "label": "Bring your own documentation",
3
- "position": 5,
3
+ "position": 4.3,
4
4
  "collapsible": true,
5
5
  "collapsed": false,
6
6
  "link": {
@@ -167,10 +167,57 @@ const { tier, scrumMasters = [] } = Astro.props;
167
167
 
168
168
  Read [Pass data into components](/docs/development/components/custom-components/pass-data-into-components) to learn more about using resource frontmatter with your own components.
169
169
 
170
+ ## Choose what goes in a custom export
171
+
172
+ <AddedIn version="5.2.0" />
173
+
174
+ [Custom exports](/docs/development/export/custom-exports) are parts of your catalog exported for people outside your teams. Their `include` and `exclude` can match resources by custom property, so resources can opt in (or out) from their own frontmatter:
175
+
176
+ ```mdx title="exports/partners.mdx"
177
+ ---
178
+ title: Acme for partners
179
+ include:
180
+ - x-public: true
181
+ exclude:
182
+ - x-data-classification: [confidential, restricted]
183
+ ---
184
+ ```
185
+
186
+ The custom properties choose what's in the export, but they aren't shown in it. Read [custom exports](/docs/development/export/custom-exports#by-custom-property) for how values are matched.
187
+
188
+ ## Find resources by custom property
189
+
190
+ Use `getResourcesByProperty` in the [SDK](/docs/sdk) to find the resources with a custom property, optionally with a given value:
191
+
192
+ ```js
193
+ import utils from '@eventcatalog/sdk';
194
+
195
+ const { getResourcesByProperty } = utils('/path/to/eventcatalog');
196
+
197
+ // Everything with x-operational-tier
198
+ await getResourcesByProperty('x-operational-tier');
199
+
200
+ // The latest tier 1 services
201
+ await getResourcesByProperty('x-operational-tier', { equals: 1, types: ['service'], latestOnly: true });
202
+
203
+ // Resources classified as confidential or restricted
204
+ await getResourcesByProperty('x-data-classification', { in: ['confidential', 'restricted'] });
205
+ ```
206
+
207
+ Each result has the resource's `type`, `id`, `version`, the property's `value`, the `path` to its file, and whether it's the `latest` version. Values are compared as text (`1` matches `'1'`), and a list matches when any of its items does.
208
+
209
+ The SDK reads your catalog's frontmatter once and keeps it in memory, so repeated lookups don't read any files.
210
+
211
+ You can run it from the [CLI](/docs/cli) too:
212
+
213
+ ```bash
214
+ npx @eventcatalog/cli getResourcesByProperty "x-operational-tier" '{"equals":1}'
215
+ ```
216
+
170
217
  ## Naming and security guidance
171
218
 
172
219
  - Use stable, descriptive names such as `x-operational-tier` or `x-data-classification`.
173
220
  - Consider an organization namespace, such as `x-acme-cost-centre`, when properties may be shared across tools.
174
221
  - Keep the meaning and expected value type consistent across resources.
175
222
  - Do not store secrets, credentials, or private tokens in custom properties. Resource frontmatter is catalog content and may be included in generated output.
176
- - Custom properties are stored and rendered, but EventCatalog does not automatically use them for relationships, diagrams, search behavior, or validation beyond the `x-*` naming requirement.
223
+ - Custom properties are stored and rendered, but EventCatalog does not automatically use them for relationships, diagrams, search behavior, or validation beyond the `x-*` naming requirement. [Custom exports](/docs/development/export/custom-exports) use them only when an export's selectors name them.
@@ -0,0 +1,90 @@
1
+ ---
2
+ sidebar_position: 1
3
+ keywords:
4
+ - Export EventCatalog
5
+ - Export architecture documentation
6
+ - Share architecture
7
+ - Single HTML file
8
+ - Partner documentation
9
+ sidebar_label: Introduction
10
+ title: Export your catalog
11
+ description: Share your architecture with people who can't open your catalog, as one self-contained HTML file. Export all of it, or just the part someone needs.
12
+ ---
13
+
14
+ import AddedIn from '@site/src/components/MDX/AddedIn';
15
+
16
+ <AddedIn version="5.1.0" />
17
+
18
+ Some people need to understand your architecture but can't open your catalog: a partner integrating with your services, an auditor, the team at a company you've acquired, a contractor without access to your network.
19
+
20
+ Exporting your catalog gives them **one self-contained HTML file**. It doesn't need a server and there's nothing to sign in to, so you can attach it to an email, add it to a design review, keep it with an audit, or host it next to your catalog.
21
+
22
+ ![The overview of an architecture reference, listing the domains, systems and services in the sidebar and a summary of the catalog](./img/architecture-reference-overview.png)
23
+
24
+ [See the export of our demo catalog](https://demo.eventcatalog.dev/architecture.html)
25
+
26
+ ## Two ways to export
27
+
28
+ | | [Architecture reference](/docs/development/export/architecture-reference) | [Custom export](/docs/development/export/custom-exports) |
29
+ | --- | --- | --- |
30
+ | **What's in it** | Your whole catalog | The part of your catalog you choose, with your own introduction |
31
+ | **Who it's for** | People who should see everything: your teams in a design review, an architecture audit, an AI agent | People who need part of it: partners, a regulator, the team taking over a domain |
32
+ | **How you make it** | Nothing to set up | A file in your catalog's `exports` folder that says what's in it |
33
+ | **Where it's written** | `architecture.html` | `exports/<id>.html` |
34
+
35
+ You can have both: one reference, and as many custom exports as you have audiences.
36
+
37
+ ## What's in the file
38
+
39
+ Both are the same kind of file:
40
+
41
+ - **An overview**, with how many of each resource it documents (and, for a custom export, its title, who it's for and its introduction).
42
+ - **A section for every resource**, with its summary, badges and documentation (including mermaid diagrams).
43
+ - **Relationships on every section**: who produces and consumes a message, what a service sends and receives, which services read and write a data store, what lives inside a domain or system. Every relationship is a link.
44
+ - **Message attributes** from your JSON Schema, Avro and Protobuf schemas, with an example payload, a TypeScript type and the raw schema.
45
+ - **Your specifications** (OpenAPI, AsyncAPI and GraphQL), which readers can view and download.
46
+ - **Flows**, step by step, with every resource each step touches.
47
+ - **Search** across the file (press `⌘K` or `Ctrl+K`), a sidebar filter, and light and dark themes.
48
+
49
+ Only the latest version of each resource is included. Resources marked as hidden are left out.
50
+
51
+ ![A message in an export, with its attributes, producers, consumers and an example payload](./img/architecture-reference-message.png)
52
+
53
+ ## Written on every build
54
+
55
+ You don't have to remember to export anything. Every time you build your catalog, EventCatalog writes the reference and your custom exports to the build output:
56
+
57
+ | File | Static build | [Server mode](/docs/development/deployment/build-ssr-mode) | Hosted at |
58
+ | --- | --- | --- | --- |
59
+ | Architecture reference | `dist/architecture.html` | `dist/client/architecture.html` | `/architecture.html` |
60
+ | Custom exports | `dist/exports/<id>.html` | `dist/client/exports/<id>.html` | `/exports/<id>.html` |
61
+
62
+ Because they're written from your catalog on every build, a link you shared last month still shows what's true today.
63
+
64
+ To export without building your catalog, use the [`export` command](/docs/cli/cli-export) of the [EventCatalog CLI](/docs/cli):
65
+
66
+ ```bash
67
+ # The whole catalog
68
+ npx @eventcatalog/cli export --format html
69
+
70
+ # One custom export
71
+ npx @eventcatalog/cli export partner-payments
72
+ ```
73
+
74
+ ## Catalogs with authentication
75
+
76
+ If your catalog uses [authentication](/docs/development/authentication/introduction), nothing is exported when you build unless you turn it on. Files in the build output are served without the authentication checks, so anyone who knows the URL could read them.
77
+
78
+ To export anyway, set `exports.html.enabled` (for the reference) or `exports.custom.enabled` (for custom exports) to `true` in `eventcatalog.config.js`. You can always export with the CLI and share the file yourself.
79
+
80
+ ## Sharing an export
81
+
82
+ Exports use the `title`, `organizationName` and `logo` from your `eventcatalog.config.js` file. When you share a link to a hosted export in Slack, Teams or on social media, the preview shows the catalog's name (or the export's title) and what it documents.
83
+
84
+ Each file shows when it was generated.
85
+
86
+ ## Next steps
87
+
88
+ - [Export your whole catalog](/docs/development/export/architecture-reference) as an architecture reference.
89
+ - [Create a custom export](/docs/development/export/custom-exports) for partners, a regulator or another team.
90
+ - See the [reference](/docs/development/export/reference) for every field, option and command.
@@ -0,0 +1,74 @@
1
+ ---
2
+ sidebar_position: 2
3
+ keywords:
4
+ - EventCatalog architecture reference
5
+ - Export architecture documentation
6
+ - Single HTML file
7
+ sidebar_label: Architecture reference
8
+ title: Architecture reference
9
+ description: Export your whole catalog as one self-contained HTML file, on every build or with the CLI.
10
+ ---
11
+
12
+ import AddedIn from '@site/src/components/MDX/AddedIn';
13
+
14
+ <AddedIn version="5.1.0" />
15
+
16
+ The architecture reference is your whole catalog in one HTML file. Every domain, system, service, message, channel, data store, flow, entity and team gets its own section, linked to everything it relates to.
17
+
18
+ Use it for people who should see all of your architecture: your own teams in a design review, an architecture audit, or an AI agent that needs the full picture. For anyone who should see only part of it, [create a custom export](/docs/development/export/custom-exports) instead.
19
+
20
+ [See the demo architecture reference](https://demo.eventcatalog.dev/architecture.html)
21
+
22
+ ## Get it on every build
23
+
24
+ The reference is generated every time you build your catalog. You don't need to set anything up.
25
+
26
+ ```bash
27
+ npm run build
28
+ ```
29
+
30
+ It is written to `dist/architecture.html`, or to `dist/client/architecture.html` when your catalog [runs in server mode](/docs/development/deployment/build-ssr-mode). Wherever you host your catalog, the reference is available at `/architecture.html`.
31
+
32
+ ### Turn it off
33
+
34
+ Set `exports.html.enabled` to `false` in your `eventcatalog.config.js` file:
35
+
36
+ ```js title="eventcatalog.config.js"
37
+ module.exports = {
38
+ exports: {
39
+ html: {
40
+ enabled: false,
41
+ },
42
+ },
43
+ };
44
+ ```
45
+
46
+ ### Catalogs with authentication
47
+
48
+ If your catalog uses [authentication](/docs/development/authentication/introduction), the reference is **not** generated unless you turn it on. Files in the build output are served without the authentication checks, so anyone who knows the URL could read it.
49
+
50
+ To generate it anyway, set `exports.html.enabled` to `true`.
51
+
52
+ ## Export it with the CLI
53
+
54
+ Use the [`export` command](/docs/cli/cli-export) of the [EventCatalog CLI](/docs/cli) to export the reference on demand, without building the catalog. From the root of your catalog, run:
55
+
56
+ ```bash
57
+ npx @eventcatalog/cli export --format html
58
+ ```
59
+
60
+ This writes `architecture.html` and opens it in your browser.
61
+
62
+ | Option | Description |
63
+ | --- | --- |
64
+ | `--output <path>` | Where to write the file. Defaults to `architecture.html` |
65
+ | `--no-open` | Don't open the reference in your browser (useful in CI) |
66
+ | `--dir <path>` | Path to your catalog, if you aren't running the command from it |
67
+
68
+ For example, to export the reference in a CI pipeline and publish it as a build artifact:
69
+
70
+ ```bash
71
+ npx @eventcatalog/cli export --format html --output reports/architecture.html --no-open
72
+ ```
73
+
74
+ The file shows when it was generated, and the command to generate it again.