@ eventcatalog/ 输出者
导出 a 事件目录 改为其他格式.
它输出 结构参考: 您的完整目录作为一个自成一体的 HTML 文件, 您可以在任何地方共享、 附加或主机 。 每个域,系统,服务,消息,信道,数据存储,流量,实体和团队都会获得自己的部分,与它相关的一切相关联,并带有来自您计划(JSON Schema, Avro and Protobuf)的信息属性,实例有效载荷,TypeScript类型以及您的规格.
你可能不需要这个包裹
-
eventcatalog build写入architecture.html输入每个建筑的建材输出。 关掉eventcatalog.config.js数字 :export default { exports: { html: { enabled: false }, }, }; -
国家行动倡议 按需导出并在浏览器中打开:
npx @eventcatalog/cli export --format html --output architecture.html
自定义导出: 团队外人员的目录部分
自定义导出是您为合伙人、 公众或监管者选择的目录的一部分, 作为文件写入其中 exports/它的前题是它里面的东西; 它的身体是介绍读者先看的.
---
# exports/partner-payments.mdx
title: Payments for partners
summary: How partners take payment for orders.
audience: Partners integrating with Acme Checkout
version: 2026.10
include:
- system: payment-processing-system # a domain or system brings what's in it
- service: checkout-api
version: 1.x
- event: payment-succeeded
- x-public: true # every resource with this custom property (x- in its frontmatter)
kind: [service, event] # optional: only these kinds
exclude:
- service: payment-worker # wins over include, and brings nothing with it
- x-data-classification: [confidential, restricted] # any of these values
references: omit # pointers at anything not in the export: omit, name-only or include (one level)
hide: [owners, repository, contacts, docs] # the default
---
Welcome! This guide covers everything you need to take payment for an Acme order.
eventcatalog build每个自定义导出到exports/<id>.html在构建输出中( 带有认证, 仅在exports.custom.enabled实值true) (中文(简体) ). 有问题的文件会被警告跳过,其他文件仍然被写入.npx @eventcatalog/cli export partner-payments写入; 添加--check列出里面的东西 被遗漏的东西和原因 而不写.--check当导出名称不在目录中时失败, CI 通知重命名 .exports.custom内eventcatalog.config.js套装defaults(单位:千美元)hide, (中文(简体) ),references每一次自定义出口,only来建造其中的一部分,dir用于文件夹,以及neverExport用于任何自定义的输出,无论它包括什么.
选择者命名一个资源( S)service: checkout-api,带有可选 version)或匹配自定义属性(x-public: true) (中文(简体) ). 在属性选择器中 x- 字段必须匹配; 当资源值是给定的值之一时, 字段匹配( 作为文本比较, 所以) true 匹配 "true"),并在资源前题中的列表中与其任何项目匹配。 一个匹配的域或系统带来了里面的东西,就像一个由id命名的. 自定义属性本身从不输出.
资源被取出 exclude 或者说 neverExport 从未命名 : 投放指针, 并在 docs 中将其链接改为“ 另一种服务 ”.
使用软件包
import { renderHtml, writeHtml, loadCatalog, renderCustomExports, formatCustomExportReport } from '@eventcatalog/exporters';
// Render the reference as a string
const { html } = await renderHtml('/path/to/catalog');
// Or write it to a file
const { path, bytes, durationMs } = await writeHtml({ dir: '/path/to/catalog', outputPath: 'architecture.html' });
// Or load the catalog into one resolved model (relationships, schemas, owners) to build your own export
const model = await loadCatalog('/path/to/catalog');
// The custom exports in exports/: rendered, with a report of what's in each and what was left out.
// Each stands alone: one that can't be exported is in `failed`, with its error, and the rest are still rendered.
const { rendered, failed } = await renderCustomExports('/path/to/catalog');
console.log(formatCustomExportReport(rendered[0].report));
许可证
麻省理工学院