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​
| Parameter | Type |
|---|---|
catalogDir | string |
Returns​
Function
Parameters​
| Parameter | Type |
|---|---|
id | string |
changelog | Changelog |
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' });