Skip to main content

Function: appendChangelog()

appendChangelog(catalogDir): (id, changelog, options) => Promise<void>

Defined in: changelogs.ts:91

Appends a changelog entry to an existing changelog for a resource. If no changelog exists, one is created.

New entries are prepended to the top of the existing content, separated by ---.

Parameters​

ParameterType
catalogDirstring

Returns​

Function

Parameters​

ParameterType
idstring
changelogChangelog
options{ format: "md" | "mdx"; version: string; }
options.format?"md" | "mdx"
options.version?string

Returns​

Promise<void>

Example​

import utils from '@eventcatalog/utils';

const { appendChangelog } = utils('/path/to/eventcatalog');

// Append to an existing changelog (or create if none exists)
await appendChangelog('OrderCreated', {
createdAt: '2024-09-01',
markdown: '### New field added\n\nAdded `priority` field.',
});

// Append to a specific version's changelog
await appendChangelog('OrderCreated', {
createdAt: '2024-09-01',
markdown: '### Bugfix\n\nFixed validation.',
}, { version: '1.0.0' });