changelog()
Write the CHANGELOG.md files from Node.js with changelog(), the changelog of each package and the root one, for a bump result or a range of commits.
ts
function changelog(options?: Partial<ChangelogOptions>): Promise<void>changelog() runs relizy changelog: it writes the CHANGELOG.md of each package (and the root one in a monorepo), then runs the format command. It resolves once the files are written.
Options
The flags of relizy changelog, camelCased, and the shared options:
| Option | Description |
|---|---|
bumpResult | BumpResultTruthy, the result of bump(): the changelogs of the bumped packages, at their new version |
from, to | The commit range, instead of the last release tag and HEAD |
formatCmd | Overrides changelog.formatCmd |
rootChangelog | Overrides changelog.rootChangelog |
force | Without bumpResult, includes the packages without commits |
suffix | Without bumpResult, the prerelease suffix of the versions, as for bump() |
privatePackages | Overrides monorepo.privatePackages |
includeCommitBody | Overrides changelog.includeCommitBody |
See ChangelogOptions for the types.
Examples
ts
import { bump, changelog } from 'relizy'
const bumpResult = await bump({ yes: true })
if (bumpResult.bumped) {
await changelog({ bumpResult })
}A given range, previewed:
ts
await changelog({ from: 'v1.0.0', to: 'v1.1.0', dryRun: true })