@hyperfrontend/versioning/changelog

Changelog Module

The changelog module provides comprehensive parsing, manipulation, and serialization of CHANGELOG.md files.

Architecture Overview

Module Dependencies

Data Model

Parse Pipeline

Section Types

The module recognizes these standard changelog section types:

Type Common Headings
breaking Breaking Changes, BREAKING
features Features, Added, New
fixes Bug Fixes, Fixed
performance Performance, Perf
documentation Documentation, Docs
deprecations Deprecated
refactoring Refactored, Refactor
tests Tests, Testing
build Build, Dependencies
ci CI, Continuous Integration
chores Chores, Misc
other Other (fallback)

Usage Examples

Parsing a Changelog

import { parseChangelog } from '@hyperfrontend/versioning'

const markdown = `
# Changelog

## [1.0.0] - 2024-01-15

### Features
- Initial release
`

const changelog = parseChangelog(markdown)

Creating a Changelog Programmatically

import { createChangelog, createChangelogEntry, createChangelogSection, createChangelogItem } from '@hyperfrontend/versioning'

const changelog = createChangelog({
  header: { title: '# Changelog', description: [], links: [] },
  entries: [
    createChangelogEntry('1.0.0', {
      date: '2024-01-15',
      sections: [createChangelogSection('features', 'Features', [createChangelogItem('Initial release')])],
    }),
  ],
  metadata: { format: 'keep-a-changelog', isConventional: false, warnings: [] },
})

Serializing to Markdown

import { serializeChangelog } from '@hyperfrontend/versioning'

const markdown = serializeChangelog(changelog, {
  includeScope: true,
  useAsterisks: false,
})

Comparing Changelogs

import { isChangelogEqual, diffChangelogs } from '@hyperfrontend/versioning'

const areEqual = isChangelogEqual(changelog1, changelog2)
const diff = diffChangelogs(changelog1, changelog2)

Filtering Entries

import { filterByVersionRange, filterBreakingChanges } from '@hyperfrontend/versioning'

const recent = filterByVersionRange(changelog, '1.0.0', '2.0.0')
const breaking = filterBreakingChanges(changelog)

Merging Changelogs

import { mergeChangelogs } from '@hyperfrontend/versioning'

const result = mergeChangelogs(source, target, {
  entryStrategy: 'union',
  sectionStrategy: 'union',
  itemStrategy: 'union',
})

Transforming Entries

import { transformEntries, sortEntries, compact } from '@hyperfrontend/versioning'

const updated = transformEntries(changelog, (entry) => ({
  ...entry,
  date: entry.date ?? new Date().toISOString().split('T')[0],
}))

const sorted = sortEntries(updated)
const cleaned = compact(sorted)

Merge Strategies

Strategy Entry Behavior Section Behavior Item Behavior
source Use source entry Use source section Use source item
target Use target entry Use target section Use target item
union Include both (unique) Combine sections Combine items
latest Use newer entry Merge by type Replace by description

Design Principles

  1. Immutability: All operations return new objects; inputs are never mutated
  2. No Regex: Character-by-character parsing to prevent ReDoS vulnerabilities
  3. Functional: Pure functions without class-based state
  4. Lossless: Round-trip parsing preserves original formatting where possible
  5. Type-Safe: Full TypeScript support with strict typing

See Also

  • semver/ — Version parsing and comparison
  • commits/ — Generates changelog entries from commits
  • flow/ — Orchestrates changelog generation
  • workspace/ — Discovers changelog files
  • Main README — Package overview and quick start
  • ARCHITECTURE.md — Design principles and data flow

API Reference

ƒ Functions

§function

addEntry(changelog: Changelog, entry: ChangelogEntry, options?: AddEntryOptions): Changelog

Adds a new entry to a changelog.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to add to
§entry
ChangelogEntry
The entry to add
§options?
AddEntryOptions
Optional add options

Returns

Changelog
A new changelog with the entry added

Example

Adding a new entry to a changelog

const newChangelog = addEntry(changelog, {
  version: '1.2.0',
  date: '2024-01-15',
  unreleased: false,
  sections: [...]
})
§function

addItemToEntry(changelog: Changelog, version: string, sectionType: string, item: ChangelogItem): Changelog

Adds an item to a specific section within an entry.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog containing the entry to modify
§version
string
The version identifier of the entry to update
§sectionType
string
Category identifier for grouping changes (e.g., 'features', 'fixes')
§item
ChangelogItem
Description of the change with optional scope and metadata

Returns

Changelog
A new changelog with the item added

Example

Adding a feature item to an entry

const item = { description: 'Add dark mode support', scope: 'ui' }
const updated = addItemToEntry(changelog, '1.2.0', 'features', item)
// Item added to the features section of version 1.2.0
§function

addUnreleasedEntry(changelog: Changelog, sections: unknown): Changelog

Adds or updates an unreleased entry.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to add the unreleased entry to
§sections
unknown
Sections to include in the unreleased entry

Returns

Changelog
A new changelog with unreleased entry added/updated

Example

Adding an unreleased entry with sections

const sections = [createChangelogSection('features', 'Added', [item])]
const updated = addUnreleasedEntry(changelog, sections)
// => Changelog with unreleased entry at the top
§function

appendChangelog(source: Changelog, target: Changelog, position: "start" | "end"): Changelog

Appends entries from target to source (no conflict resolution).

Parameters

NameTypeDescription
§source
Changelog
The base changelog to append to
§target
Changelog
The changelog whose entries will be appended
§position
"start" | "end"
Where to insert ('start' or 'end')
(default: 'end')

Returns

Changelog
A new changelog with combined entries

Example

Appending entries to a changelog

const combined = appendChangelog(mainChangelog, newChangelog, 'start')
// newChangelog entries appear before mainChangelog entries
§function

checkSchemaCompatibility(source: Changelog, target: Changelog): CompatibilityResult

Checks if two changelogs have compatible schemas. Used to detect format incompatibilities before merge/compare.

Parameters

NameTypeDescription
§source
Changelog
The source changelog
§target
Changelog
The target changelog

Returns

CompatibilityResult
Compatibility result with any differences found

Example

Checking schema compatibility before merge

const result = checkSchemaCompatibility(mainChangelog, branchChangelog)
if (!result.compatible) {
  console.log('Schema differences:', result.differences)
}
§function

cloneChangelog(changelog: Changelog): Changelog

Clones a changelog deeply (for modification without affecting original).

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to clone

Returns

Changelog
A deep copy of the changelog

Example

Cloning a changelog

const copy = cloneChangelog(changelog)
// Independent deep copy, safe to mutate
§function

combineChangelogs(changelogs: unknown, options?: MergeOptions): Changelog

Combines multiple changelogs into one.

Parameters

NameTypeDescription
§changelogs
unknown
Array of changelogs to combine
§options?
MergeOptions
Optional merge options

Returns

Changelog
The combined changelog

Example

Combining multiple changelogs

const unified = combineChangelogs([pkg1Changelog, pkg2Changelog], {
  strategy: 'merge-sections',
})
// All entries from both changelogs merged with conflict resolution
§function

compact(changelog: Changelog, keepUnreleased: boolean): Changelog

Compacts a changelog by removing empty sections and entries.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to compact
§keepUnreleased
boolean
Whether to keep empty unreleased entry (default: true)
(default: true)

Returns

Changelog
A new compacted changelog

Example

Compacting a changelog

const compacted = compact(changelog)
// Empty sections and entries removed (unreleased kept)

const strict = compact(changelog, false)
// Even empty unreleased entry is removed
§function

createChangelog(options?: Partial<Changelog>): Changelog

Creates a new changelog with default values.

Parameters

NameTypeDescription
§options?
Partial<Changelog>
Optional configuration to customize the changelog

Returns

Changelog
A new Changelog object with the specified options or defaults

Example

Creating a changelog with custom source

const changelog = createChangelog({ source: 'CHANGELOG.md' })
// => { source: 'CHANGELOG.md', header: { title: '# Changelog', ... }, entries: [] }
§function

createChangelogEntry(version: string, options?: Partial<Omit<ChangelogEntry, "version">>): ChangelogEntry

Creates a new changelog entry.

Parameters

NameTypeDescription
§version
string
The version string (e.g., '1.0.0')
§options?
Partial<Omit<ChangelogEntry, "version">>
Optional configuration for date, sections, and other properties

Returns

ChangelogEntry
A new ChangelogEntry object

Example

Creating a changelog entry with date and sections

const entry = createChangelogEntry('1.0.0', {
  date: '2024-01-15',
  sections: [createChangelogSection('features', 'Added', items)],
})
§function

createChangelogItem(description: string, options?: Partial<Omit<ChangelogItem, "description">>): ChangelogItem

Creates a new changelog item.

Parameters

NameTypeDescription
§description
string
The description text of the change
§options?
Partial<Omit<ChangelogItem, "description">>
Optional configuration for scope, commits, references, and breaking flag

Returns

ChangelogItem
A new ChangelogItem object

Example

Creating a changelog item with options

const item = createChangelogItem('Add user authentication', {
  scope: 'auth',
  breaking: false,
  references: [{ number: 42, type: 'issue' }],
})
§function

createChangelogSection(type: ChangelogSectionType, heading: string, items: unknown): ChangelogSection

Creates a new changelog section.

Parameters

NameTypeDescription
§type
ChangelogSectionType
The type of section (features, fixes, breaking, etc.)
§heading
string
The display heading for the section
§items
unknown
Optional array of changelog items in this section
(default: [])

Returns

ChangelogSection
A new ChangelogSection object

Example

Creating a features section with items

const section = createChangelogSection('features', 'Added', [
  createChangelogItem('New dashboard widget'),
])
§function

createCommitRef(hash: string, url?: string): CommitRef

Creates a commit reference from a full hash.

Parameters

NameTypeDescription
§hash
string
The full commit hash
§url?
string
Optional URL to the commit

Returns

CommitRef
A new CommitRef object with both full and short hash

Example

Creating a commit reference

const ref = createCommitRef('abc1234def5678', 'https://github.com/org/repo/commit/abc1234def5678')
// => { hash: 'abc1234def5678', shortHash: 'abc1234', url: 'https://...' }
§function

createEmptyChangelog(): Changelog

Creates a new empty changelog with standard header.

Returns

Changelog
A new empty Changelog with Keep a Changelog format

Example

Creating an empty changelog with standard header

const changelog = createEmptyChangelog()
// => Changelog with standard Keep a Changelog header and no entries
§function

createIssueRef(number: number, type: "issue" | "pull-request", url?: string): IssueRef

Creates an issue reference.

Parameters

NameTypeDescription
§number
number
The issue or PR number
§type
"issue" | "pull-request"
The type of reference ('issue' or 'pull-request')
(default: 'issue')
§url?
string
Optional URL to the issue or PR

Returns

IssueRef
A new IssueRef object

Example

Creating issue and PR references

const issueRef = createIssueRef(42, 'issue', 'https://github.com/org/repo/issues/42')
// => { number: 42, type: 'issue', url: 'https://...' }

const prRef = createIssueRef(123, 'pull-request')
// => { number: 123, type: 'pull-request', url: undefined }
§function

createSpacing(count: number, lineEnding: string): string

Creates blank lines for spacing.

Parameters

NameTypeDescription
§count
number
Number of blank lines
§lineEnding
string
Line ending style

Returns

string
String with specified number of blank lines

Example

Creating blank line spacing

createSpacing(2, '\n')
// => '\n\n'
§function

createUnreleasedEntry(sections: unknown): ChangelogEntry

Creates an unreleased changelog entry.

Parameters

NameTypeDescription
§sections
unknown
Optional array of changelog sections
(default: [])

Returns

ChangelogEntry
A new ChangelogEntry object marked as unreleased

Example

Creating an unreleased entry

const unreleased = createUnreleasedEntry([
  createChangelogSection('features', 'Added', [item]),
])
// => { version: 'Unreleased', date: null, unreleased: true, sections: [...] }
§function

deduplicateItems(changelog: Changelog): Changelog

Removes duplicate items across all sections.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to deduplicate

Returns

Changelog
A new changelog without duplicate items

Example

Deduplicating items across sections

const deduped = deduplicateItems(changelog)
// Duplicate items (same scope:description) are removed
§function

diffChangelogs(source: Changelog, target: Changelog): ChangelogDiff

Computes the diff between two changelogs.

Parameters

NameTypeDescription
§source
Changelog
The source/original changelog
§target
Changelog
The target/modified changelog

Returns

ChangelogDiff
Detailed diff of changes

Example

Comparing two changelogs

const diff = diffChangelogs(mainChangelog, branchChangelog)
console.log(`Added: ${diff.added.length}, Removed: ${diff.removed.length}`)
§function

diffEntries(source: ChangelogEntry, target: ChangelogEntry): EntryDiff

Computes the diff between two changelog entries.

Parameters

NameTypeDescription
§source
ChangelogEntry
The source entry
§target
ChangelogEntry
The target entry

Returns

EntryDiff
Detailed entry diff

Example

Computing diff between two entries

const diff = diffEntries(entryV1, entryV2)
// => { version: '1.0.0', changes: [{ path: ['date'], type: 'changed', ... }], sectionsChanged: true }
§function

excludeByScope(changelog: Changelog, scopes: unknown): Changelog

Excludes items by scope.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to filter
§scopes
unknown
Scopes to exclude

Returns

Changelog
A new changelog without items matching the scopes

Example

Excluding items by scope

const publicChanges = excludeByScope(changelog, ['internal', 'test'])
// Items scoped to 'internal' or 'test' are removed
§function

filterBreakingChanges(changelog: Changelog): Changelog

Filters entries that have breaking changes.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to filter

Returns

Changelog
A new changelog with only entries containing breaking changes

Example

Filtering for breaking changes

const breaking = filterBreakingChanges(changelog)
// Only entries containing breaking changes or items marked as breaking
§function

filterByDateRange(changelog: Changelog, startDate?: string, endDate?: string): Changelog

Filters entries by release date.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to filter
§startDate?
string
Start date (inclusive, ISO format)
§endDate?
string
End date (inclusive, ISO format)

Returns

Changelog
A new changelog with entries in the date range

Example

Filtering entries by date range

const q1 = filterByDateRange(changelog, '2024-01-01', '2024-03-31')
// Entries released in Q1 2024
§function

filterByScope(changelog: Changelog, scopes: unknown): Changelog

Filters items by scope.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to filter
§scopes
unknown
Scopes to include

Returns

Changelog
A new changelog with only items matching the scopes

Example

Filtering items by scope

const apiChanges = filterByScope(changelog, ['api', 'core'])
// Only items scoped to 'api' or 'core'
§function

filterByVersionRange(changelog: Changelog, range: string): Changelog

Filters entries by version range using semver.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to filter
§range
string
Semver range string (e.g., '>=1.0.0 <2.0.0')

Returns

Changelog
A new changelog with entries matching the range

Example

Filtering by semver range

const majors = filterByVersionRange(changelog, '>=1.0.0 <2.0.0')
§function

filterEntries(changelog: Changelog, predicate: EntryPredicate): Changelog

Filters entries using a predicate function.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to filter
§predicate
EntryPredicate
Function that returns true for entries to keep

Returns

Changelog
A new changelog with filtered entries

Example

Filtering out unreleased entries

const filtered = filterEntries(changelog, (entry) => !entry.unreleased)
§function

filterFromVersion(changelog: Changelog, startVersion: string): Changelog

Filters entries from a start version.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to filter
§startVersion
string
The minimum version (inclusive)

Returns

Changelog
A new changelog with entries >= startVersion

Example

Filtering from a start version

const recent = filterFromVersion(changelog, '2.0.0')
// Only entries for version 2.0.0 and later
§function

filterItems(changelog: Changelog, predicate: ItemPredicate): Changelog

Filters items within sections.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to filter
§predicate
ItemPredicate
Function that returns true for items to keep

Returns

Changelog
A new changelog with filtered items

Example

Filtering items with references

const withRefs = filterItems(changelog, (item) => item.references.length > 0)
// Only items with issue/PR references
§function

filterRecentEntries(changelog: Changelog, count: number, includeUnreleased: boolean): Changelog

Gets the N most recent entries.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to filter
§count
number
Number of entries to keep
§includeUnreleased
boolean
Whether to include unreleased in count (default: false)
(default: false)

Returns

Changelog
A new changelog with only the most recent entries

Example

Getting the most recent entries

const latest = filterRecentEntries(changelog, 5)
// Last 5 released versions (plus unreleased if present)
§function

filterSections(changelog: Changelog, predicate: SectionPredicate): Changelog

Filters sections within each entry.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to filter
§predicate
SectionPredicate
Function that returns true for sections to keep

Returns

Changelog
A new changelog with filtered sections

Example

Filtering for user-facing sections

const userFacing = filterSections(changelog, (section) =>
  ['features', 'fixes', 'breaking'].includes(section.type)
)
§function

filterSectionTypes(changelog: Changelog, types: unknown): Changelog

Keeps only specified section types.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to filter
§types
unknown
Section types to keep

Returns

Changelog
A new changelog with only specified section types

Example

Filtering to specific section types

const userChanges = filterSectionTypes(changelog, ['features', 'fixes'])
// Only features and fixes sections remain
§function

filterToVersion(changelog: Changelog, endVersion: string): Changelog

Filters entries up to an end version.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to apply the version filter to
§endVersion
string
The maximum version (inclusive)

Returns

Changelog
A new changelog with entries <= endVersion

Example

Filtering to an end version

const legacy = filterToVersion(changelog, '1.9.9')
// Only entries for versions up to 1.9.9
§function

filterVersionRange(changelog: Changelog, startVersion: string, endVersion: string): Changelog

Gets entries within a version range (inclusive).

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to filter
§startVersion
string
The minimum version (inclusive)
§endVersion
string
The maximum version (inclusive)

Returns

Changelog
A new changelog with entries in the range

Example

Filtering entries within a version range

const range = filterVersionRange(changelog, '1.5.0', '2.0.0')
// Entries from 1.5.0 through 2.0.0
§function

getEntryByVersion(changelog: Changelog, version: string): ChangelogEntry

Gets an entry by version from a changelog.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to search
§version
string
The version to find

Returns

ChangelogEntry
The entry if found, undefined otherwise

Example

Getting an entry by version

const entry = getEntryByVersion(changelog, '1.0.0')
// => ChangelogEntry for 1.0.0 or undefined
§function

getListMarker(useAsterisks: boolean): string

Creates a list item marker.

Parameters

NameTypeDescription
§useAsterisks
boolean
Whether to use * instead of -

Returns

string
The list item marker ('- ' or '* ')

Example

Getting list markers

getListMarker(false) // => '- '
getListMarker(true)  // => '* '
§function

getSectionHeading(type: ChangelogSectionType, customHeadings?: Partial<Record<ChangelogSectionType, string>>): string

Gets the heading for a section type, respecting custom headings.

Parameters

NameTypeDescription
§type
ChangelogSectionType
The changelog section type to get the heading for
§customHeadings?
Partial<Record<ChangelogSectionType, string>>
Optional map of custom section type to heading overrides

Returns

string
The heading string to use

Example

Getting section headings

getSectionHeading('features')
// => 'Added'

getSectionHeading('features', { features: 'New Features' })
// => 'New Features'
§function

getSectionType(heading: string): ChangelogSectionType

Determines the section type from a heading string. Returns 'other' if the heading is not recognized.

Parameters

NameTypeDescription
§heading
string
The heading string to parse

Returns

ChangelogSectionType
The corresponding ChangelogSectionType

Example

Mapping heading strings to section types

getSectionType('Added')
// => 'features'

getSectionType('Bug Fixes')
// => 'fixes'

getSectionType('Custom Section')
// => 'other'
§function

getShortHash(hash: string): string

Extracts the short hash from a full commit hash.

Parameters

NameTypeDescription
§hash
string
The full commit hash

Returns

string
The first 7 characters of the hash

Example

Extracting short hash from full hash

getShortHash('abc1234def5678901234567890')
// => 'abc1234'
§function

hasVersion(changelog: Changelog, version: string): boolean

Checks if a changelog contains a specific version.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to search
§version
string
The version to look for

Returns

boolean
True if the version exists in the changelog

Example

Checking if a changelog contains a version

hasVersion(changelog, '2.0.0')
// => true if an entry for version 2.0.0 exists
§function

haveSameVersions(a: Changelog, b: Changelog): boolean

Checks if two changelogs have the same entries (by version). Does not compare entry contents, only versions present.

Parameters

NameTypeDescription
Changelog
First changelog
Changelog
Second changelog

Returns

boolean
True if both changelogs have the same versions

Example

Checking if changelogs have the same versions

haveSameVersions(changelog1, changelog2)
// => true if both have entries for the same version strings
§function

isChangelogEqual(a: Changelog, b: Changelog): boolean

Checks if two changelogs are structurally identical.

Parameters

NameTypeDescription
Changelog
First changelog
Changelog
Second changelog

Returns

boolean
True if changelogs are identical

Example

Checking changelog equality

if (isChangelogEqual(mainChangelog, branchChangelog)) {
  console.log('Changelogs are identical')
}
§function

isCommitRefEqual(a: CommitRef, b: CommitRef): boolean

Checks if two commit references are equal.

Parameters

NameTypeDescription
CommitRef
First commit ref
CommitRef
Second commit ref

Returns

boolean
True if commit refs are equal

Example

Comparing commit references

isCommitRefEqual(commitA, commitB)
// => true if hash, shortHash, and url match
§function

isEntryEqual(a: ChangelogEntry, b: ChangelogEntry): boolean

Checks if two changelog entries are equal.

Parameters

NameTypeDescription
ChangelogEntry
First entry
ChangelogEntry
Second entry

Returns

boolean
True if entries are equal

Example

Comparing changelog entries

isEntryEqual(entryA, entryB)
// => true if version, date, sections, and all nested data match
§function

isHeaderEqual(a: ChangelogHeader, b: ChangelogHeader): boolean

Checks if two changelog headers are equal.

Parameters

NameTypeDescription
ChangelogHeader
First header
ChangelogHeader
Second header

Returns

boolean
True if headers are equal

Example

Comparing changelog headers

isHeaderEqual(changelog1.header, changelog2.header)
// => true if titles, descriptions, and links match
§function

isIssueRefEqual(a: IssueRef, b: IssueRef): boolean

Checks if two issue references are equal.

Parameters

NameTypeDescription
IssueRef
First issue ref
IssueRef
Second issue ref

Returns

boolean
True if issue refs are equal

Example

Comparing issue references

isIssueRefEqual({ number: 42, type: 'issue' }, { number: 42, type: 'issue' })
// => true
§function

isItemEqual(a: ChangelogItem, b: ChangelogItem): boolean

Checks if two changelog items are equal.

Parameters

NameTypeDescription
ChangelogItem
First item
ChangelogItem
Second item

Returns

boolean
True if items are equal

Example

Comparing changelog items

isItemEqual(itemA, itemB)
// => true if description, scope, breaking, commits, and references match
§function

isLinkEqual(a: ChangelogLink, b: ChangelogLink): boolean

Checks if two changelog links are equal.

Parameters

NameTypeDescription
ChangelogLink
First link
ChangelogLink
Second link

Returns

boolean
True if links are equal

Example

Comparing changelog links

isLinkEqual({ label: '1.0.0', url: '...' }, { label: '1.0.0', url: '...' })
// => true
§function

isMetadataEqual(a: ChangelogMetadata, b: ChangelogMetadata): boolean

Checks if two changelog metadata objects are equal.

Parameters

NameTypeDescription
ChangelogMetadata
First metadata
ChangelogMetadata
Second metadata

Returns

boolean
True if metadata are equal

Example

Comparing changelog metadata

isMetadataEqual(changelog1.metadata, changelog2.metadata)
// => true if format, isConventional, repositoryUrl, and warnings match
§function

isSectionEqual(a: ChangelogSection, b: ChangelogSection): boolean

Checks if two changelog sections are equal.

Parameters

NameTypeDescription
ChangelogSection
First section
ChangelogSection
Second section

Returns

boolean
True if sections are equal

Example

Comparing changelog sections

isSectionEqual(featuresA, featuresB)
// => true if type, heading, and all items match
§function

mergeChangelogs(source: Changelog, target: Changelog, options?: MergeOptions): MergeResult

Merges two changelogs together.

Parameters

NameTypeDescription
§source
Changelog
The source changelog
§target
Changelog
The target changelog
§options?
MergeOptions
Optional merge options

Returns

MergeResult
The merge result with merged changelog and stats

Example

Merging two changelogs

const result = mergeChangelogs(mainChangelog, branchChangelog)
console.log(`Merged ${result.stats.merged} entries`)
§function

normalizeSectionHeadings(changelog: Changelog): Changelog

Normalizes section headings to standard format.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to normalize

Returns

Changelog
A new changelog with normalized section headings

Example

Normalizing section headings

const normalized = normalizeSectionHeadings(changelog)
// 'New Features' becomes 'Added', 'Bug Fixes' becomes 'Fixed', etc.
§function

parseChangelog(content: string, source?: string): Changelog

Parses a changelog markdown string into a Changelog object.

Parameters

NameTypeDescription
§content
string
The markdown content to parse
§source?
string
Optional source file path

Returns

Changelog
Parsed Changelog object

Example

Parsing a changelog markdown string

const markdown = `# Changelog

## [1.0.0] - 2024-01-15

### Added
- Initial release`

const changelog = parseChangelog(markdown, 'CHANGELOG.md')
// => { header: { title: '# Changelog', ... }, entries: [{ version: '1.0.0', ... }] }
§function

parseCommitRefs(text: string, baseUrl?: string): CommitRef[]

Parses commit references from a line. Examples: (abc1234), [abc1234], commit abc1234

Parameters

NameTypeDescription
§text
string
The text to parse for commit references
§baseUrl?
string
Optional base URL for constructing commit links

Returns

CommitRef[]
An array of parsed CommitRef objects

Example

Parsing commit references from text

parseCommitRefs('Fixed bug (abc1234)', 'https://github.com/org/repo')
// => [{ hash: 'abc1234', shortHash: 'abc1234', url: 'https://github.com/org/repo/commit/abc1234' }]
§function

parseIssueRefs(text: string, baseUrl?: string): IssueRef[]

Parses issue/PR references from a line. Examples: #123, GH-123, closes #123

Parameters

NameTypeDescription
§text
string
The text to parse for issue references
§baseUrl?
string
Optional base URL for constructing issue links

Returns

IssueRef[]
An array of parsed IssueRef objects

Example

Parsing issue references from text

parseIssueRefs('Closes #42 and PR #123', 'https://github.com/org/repo')
// => [{ number: 42, type: 'issue', url: '...' }, { number: 123, type: 'pull-request', url: '...' }]
§function

parseScopeFromItem(text: string): ScopeFromItem

Parses the scope from a changelog item. Example: "scope: description" -> { scope: "scope", description: "description" }

Parameters

NameTypeDescription
§text
string
The text to parse for scope

Returns

ScopeFromItem
An object with optional scope and the description

Example

Parsing scope from changelog items

parseScopeFromItem('**api:** Add new endpoint')
// => { scope: 'api', description: 'Add new endpoint' }

parseScopeFromItem('Simple change without scope')
// => { scope: undefined, description: 'Simple change without scope' }
§function

parseVersionFromHeading(heading: string): ParsedVersionHeading

Parses a version string from a heading. Examples: "1.2.3", "v1.2.3", "[1.2.3]", "1.2.3 - 2024-01-01"

Parameters

NameTypeDescription
§heading
string
The heading string to parse

Returns

ParsedVersionHeading
An object containing the parsed version, date, and optional compareUrl

Example

Parsing version headings

parseVersionFromHeading('[1.2.3] - 2024-01-15')
// => { version: '1.2.3', date: '2024-01-15', compareUrl: undefined }

parseVersionFromHeading('v2.0.0')
// => { version: '2.0.0', date: null, compareUrl: undefined }
§function

releaseUnreleased(changelog: Changelog, version: string, date?: string, compareUrl?: string): Changelog

Creates a new release entry from the current unreleased entry.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog containing the unreleased entry
§version
string
The version number for the release
§date?
string
The release date (defaults to today)
§compareUrl?
string
Optional comparison URL

Returns

Changelog
A new changelog with the unreleased entry converted to a release

Example

Releasing unreleased changes as a new version

const released = releaseUnreleased(changelog, '2.0.0', '2024-03-01')
// Unreleased entry becomes version 2.0.0 with the specified date
§function

removeEmptyEntries(changelog: Changelog, keepUnreleased: boolean): Changelog

Removes empty entries (entries with no sections or only empty sections).

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to remove empty entries from
§keepUnreleased
boolean
Whether to keep an empty unreleased entry (default: true)
(default: true)

Returns

Changelog
A new changelog with empty entries removed

Example

Removing empty entries

const cleaned = removeEmptyEntries(changelog)
// Entries with no content are removed (unreleased kept by default)

const strict = removeEmptyEntries(changelog, false)
// Even empty unreleased entry is removed
§function

removeEmptySections(changelog: Changelog): Changelog

Removes empty sections from all entries.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to remove empty sections from

Returns

Changelog
A new changelog with empty sections removed

Example

Removing empty sections from all entries

const cleaned = removeEmptySections(changelog)
// Sections with no items are removed from all entries
§function

removeEntries(changelog: Changelog, versions: unknown, options?: RemoveEntryOptions): Changelog

Removes multiple entries from a changelog.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to remove from
§versions
unknown
The versions to remove
§options?
RemoveEntryOptions
Optional removal options

Returns

Changelog
A new changelog without the specified entries

Example

Removing multiple entries

const cleaned = removeEntries(changelog, ['0.1.0', '0.2.0'])
// Pre-release versions removed from changelog
§function

removeEntry(changelog: Changelog, version: string, options?: RemoveEntryOptions): Changelog

Removes an entry from a changelog by version.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to remove from
§version
string
The version to remove
§options?
RemoveEntryOptions
Optional removal options

Returns

Changelog
A new changelog without the specified entry

Example

Removing an entry by version

const newChangelog = removeEntry(changelog, '1.0.0')
§function

removeItem(changelog: Changelog, version: string, sectionType: string, itemDescription: string, options?: RemoveSectionOptions): Changelog

Removes an item from an entry by description.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog containing the entry to modify
§version
string
The version of the entry to modify
§sectionType
string
The section type containing the item
§itemDescription
string
The description of the item to remove
§options?
RemoveSectionOptions
Optional removal options

Returns

Changelog
A new changelog without the specified item

Example

Removing a specific item from a section

const updated = removeItem(changelog, '1.0.0', 'features', 'Add dark mode')
// The 'Add dark mode' item is removed from features in 1.0.0
§function

removeSection(changelog: Changelog, version: string, sectionType: string, options?: RemoveSectionOptions): Changelog

Removes a section from an entry.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog containing the entry to modify
§version
string
The version of the entry to modify
§sectionType
string
The section type to remove
§options?
RemoveSectionOptions
Optional removal options

Returns

Changelog
A new changelog without the specified section

Example

Removing a deprecated section

const updated = removeSection(changelog, '1.0.0', 'deprecated')
// Version 1.0.0 no longer has a deprecated section
§function

removeUnreleased(changelog: Changelog, options?: RemoveEntryOptions): Changelog

Removes the unreleased entry if it exists.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to remove the unreleased entry from
§options?
RemoveEntryOptions
Optional removal options

Returns

Changelog
A new changelog without the unreleased entry

Example

Removing the unreleased entry

const released = removeUnreleased(changelog)
// Changelog without the unreleased entry

// Silently ignore if not found
const safe = removeUnreleased(changelog, { throwIfNotFound: false })
§function

resolveOptions(options?: SerializeOptions): Required<SerializeOptions>

Merges user options with defaults.

Parameters

NameTypeDescription
§options?
SerializeOptions
User-provided options

Returns

Required<SerializeOptions>
Complete options with defaults applied

Example

Resolving serialize options with defaults

const opts = resolveOptions({ includeCommits: true })
// => { includeCommits: true, includeScope: true, lineEnding: '\n', ... }
§function

reverseEntries(changelog: Changelog): Changelog

Reverses the order of entries.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to reverse

Returns

Changelog
A new changelog with reversed entries

Example

Reversing entry order

const reversed = reverseEntries(changelog)
// Oldest entries now appear first
§function

serializeChangelog(changelog: Changelog, options?: SerializeOptions): string

Serializes a Changelog object to markdown string.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to serialize
§options?
SerializeOptions
Optional serialization options

Returns

string
The markdown string representation

Examples

Basic serialization

const markdown = serializeChangelog(changelog)

Serializing with custom options

const markdown = serializeChangelog(changelog, {
  includeCommits: false,
  useAsterisks: true,
})
§function

serializeChangelogToJson(changelog: Changelog, options?: JsonSerializeOptions): string

Serializes a Changelog object to JSON string.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog object to convert to JSON
§options?
JsonSerializeOptions
Optional JSON serialization options

Returns

string
The JSON string representation

Examples

Basic JSON serialization

const json = serializeChangelogToJson(changelog)

Pretty-printing with custom indentation

const json = serializeChangelogToJson(changelog, {
  pretty: true,
  indent: 4,
})
§function

sortEntries(changelog: Changelog): Changelog

Sorts entries by version (descending - newest first).

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to sort

Returns

Changelog
A new changelog with sorted entries

Example

Sorting changelog entries by version

const sorted = sortEntries(changelog)
// Entries ordered: Unreleased, 2.0.0, 1.1.0, 1.0.0, ...
§function

sortEntriesByDate(changelog: Changelog): Changelog

Sorts entries by date (newest first).

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to sort

Returns

Changelog
A new changelog with sorted entries

Example

Sorting entries by date

const sorted = sortEntriesByDate(changelog)
// Entries ordered by release date, most recent first
§function

sortSections(changelog: Changelog, order?: unknown): Changelog

Sorts sections within each entry by a specified order.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to sort
§order?
unknown
Optional custom section order (defaults to standard order)

Returns

Changelog
A new changelog with sorted sections

Example

Sorting sections within entries

const sorted = sortSections(changelog)
// Sections in each entry follow: breaking, features, fixes, ...

const custom = sortSections(changelog, ['fixes', 'features', 'breaking'])
// Custom ordering: fixes first, then features, then breaking
§function

stripMetadata(changelog: Changelog): Changelog

Strips metadata from a changelog.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to strip

Returns

Changelog
A new changelog with minimal metadata

Example

Stripping metadata from a changelog

const stripped = stripMetadata(changelog)
// Source and warnings removed, only format and isConventional retained
§function

summarizeDiff(diff: ChangelogDiff): string

Creates a human-readable summary of a changelog diff.

Parameters

NameTypeDescription
§diff
ChangelogDiff
The diff to summarize

Returns

string
A string summary of the changes

Example

Creating human-readable diff summary

const diff = diffChangelogs(oldChangelog, newChangelog)
summarizeDiff(diff)
// => 'Added 2 version(s): 1.2.0, 1.1.0; Modified 1 version(s): 1.0.0'
§function

toJsonObject(changelog: Changelog, options?: JsonSerializeOptions): Record<string, unknown>

Converts a Changelog to a plain JSON-serializable object. Useful when you need the object itself rather than a string.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to convert
§options?
JsonSerializeOptions
Optional JSON serialization options

Returns

Record<string, unknown>
A plain object suitable for JSON serialization

Example

Converting changelog to plain object

const obj = toJsonObject(changelog, { includeSource: true })
// => { source: 'CHANGELOG.md', header: { title: '...', ... }, entries: [...] }

// Send as API response
res.json(obj)
§function

tokenize(input: string): Token[]

Tokenizes a changelog markdown string into tokens.

Parameters

NameTypeDescription
§input
string
The markdown content to tokenize

Returns

Token[]
Array of tokens

Example

Tokenizing changelog markdown

const tokens = tokenize('# Changelog\n\n## [1.0.0]\n- Added feature')
// => [{ type: 'heading-1', value: 'Changelog', ... }, { type: 'heading-2', ... }, ...]
§function

transformEntries(changelog: Changelog, transformer: EntryTransformer): Changelog

Transforms all entries in a changelog.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to transform
§transformer
EntryTransformer
Function to transform each entry

Returns

Changelog
A new changelog with transformed entries

Example

Transforming all entries

const transformed = transformEntries(changelog, (entry) => ({
  ...entry,
  date: entry.date?.toUpperCase()
}))
§function

transformItems(changelog: Changelog, transformer: ItemTransformer): Changelog

Transforms all items in all sections.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to transform
§transformer
ItemTransformer
Function to transform each item

Returns

Changelog
A new changelog with transformed items

Example

Prefixing item descriptions with scope

const prefixed = transformItems(changelog, (item) => ({
  ...item,
  description: `[${item.scope || 'misc'}] ${item.description}`,
}))
§function

transformSections(changelog: Changelog, transformer: SectionTransformer): Changelog

Transforms all sections in all entries.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to transform
§transformer
SectionTransformer
Function to transform each section

Returns

Changelog
A new changelog with transformed sections

Example

Uppercasing section headings

const renamed = transformSections(changelog, (section) => ({
  ...section,
  heading: section.heading.toUpperCase(),
}))
§function

updateEntry(changelog: Changelog, version: string, updates: Partial<ChangelogEntry> | (entry: ChangelogEntry) => ChangelogEntry): Changelog

Updates a specific entry by version.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to update
§version
string
Version of entry to update
§updates
Partial<ChangelogEntry> | (entry: ChangelogEntry) => ChangelogEntry
Partial entry updates or transformer function

Returns

Changelog
A new changelog with updated entry

Example

Updating a specific entry

const updated = updateEntry(changelog, '1.0.0', { date: '2024-01-15' })

// Or with transformer function
const modified = updateEntry(changelog, '1.0.0', (entry) => ({
  ...entry,
  compareUrl: `https://github.com/org/repo/compare/v0.9.0...v${entry.version}`,
}))
§function

updateHeader(changelog: Changelog, updates: Partial<ChangelogHeader>): Changelog

Updates the header of a changelog.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to update
§updates
Partial<ChangelogHeader>
Partial header updates

Returns

Changelog
A new changelog with updated header

Example

Updating the changelog header

const updated = updateHeader(changelog, { title: '# Release Notes' })
§function

updateMetadata(changelog: Changelog, updates: Partial<ChangelogMetadata>): Changelog

Updates the metadata of a changelog.

Parameters

NameTypeDescription
§changelog
Changelog
The changelog to update
§updates
Partial<ChangelogMetadata>
Partial metadata updates

Returns

Changelog
A new changelog with updated metadata

Example

Updating changelog metadata

const updated = updateMetadata(changelog, { repositoryUrl: 'https://github.com/org/repo' })
§function

validateChangelog(changelog: unknown): ValidationResult

Validates a changelog object against the schema.

Parameters

NameTypeDescription
§changelog
unknown
The changelog object to validate

Returns

ValidationResult
Validation result with any errors

Example

Validating a changelog object

const result = validateChangelog(myChangelog)
if (!result.valid) {
  console.log('Validation errors:', result.errors)
}

Interfaces

§interface

RemoveSectionOptions

Options for removing a section or item.

Properties

§readonly throwIfNotFound?:boolean
Throw error if section/item not found (default: true)
§interface

AddEntryOptions

Options for adding an entry.

Properties

§readonly position?:number | "start" | "end"
Position to insert (default: 0, at the beginning)
§readonly replaceExisting?:boolean
Replace existing entry with same version
§readonly updateMetadata?:boolean
Update metadata after adding
§interface

Changelog

Changelog
Complete representation of a CHANGELOG.md file. Designed for lossless round-tripping: parse -> modify -> serialize.

Properties

§readonly entries:unknown
Version entries, ordered newest first
§readonly header:ChangelogHeader
File header/preamble content
§readonly metadata:ChangelogMetadata
Additional metadata extracted during parsing
§readonly source?:string
Original file path (if parsed from file)
§interface

ChangelogDiff

Represents the diff between two changelogs.

Properties

§readonly added:unknown
Entries added in target but not in source
§readonly identical:boolean
Whether changelogs are structurally identical
§readonly modified:unknown
Entries present in both but with differences
§readonly removed:unknown
Entries removed from source but not in target
§readonly stats:DiffStats
Summary statistics
§interface

ChangelogEntry

Changelog Entry
Represents a single version entry in a changelog.

Properties

§readonly compareUrl?:string
Compare URL (e.g., GitHub compare link)
§readonly date:string
Release date (ISO format or null for unreleased)
§readonly rawContent?:string
Raw text for entries that couldn't be parsed structurally
§readonly sections:unknown
Grouped changes by category
§readonly unreleased:boolean
Whether this is an unreleased/upcoming section
§readonly version:string
Version string (e.g., "1.2.3")
§interface

ChangelogHeader

Changelog Header
The header section of a changelog file.

Properties

§readonly description:unknown
Description paragraphs between title and first entry
§readonly title:string
Title (e.g., "# Changelog")
§interface

ChangelogItem

Changelog Item
Represents an individual change within a changelog section.

Properties

§readonly breaking:boolean
Whether this is a breaking change
§readonly commits:unknown
Commit references
§readonly description:string
Description of the change
§readonly indirect?:boolean
Whether this is an indirect change (dependency or infrastructure)
§readonly references:unknown
Issue/PR references
§readonly scope?:string
Scope (e.g., "api", "cli")
§readonly source?:CommitSource
Classification source (for auditing/debugging)
§interface

ChangelogMetadata

Changelog Metadata
Additional information extracted during parsing.

Properties

§readonly format:ChangelogFormat
Detected changelog format/style
§readonly isConventional:boolean
Whether the file follows conventional changelog spec
§readonly packageName?:string
Package name if detected
§readonly repositoryUrl?:string
Repository URL if detected
§readonly warnings:unknown
Parser warnings/notes
§interface

ChangelogSection

Changelog Section
Represents a category of changes (Features, Bug Fixes, etc.)

Properties

§readonly heading:string
Section heading as it appears in file
§readonly items:unknown
Individual change items
§readonly type:ChangelogSectionType
Section type (features, fixes, etc.)
§interface

CommitRef

Commit Reference
Represents a reference to a git commit in a changelog item.

Properties

§readonly hash:string
Full commit hash
§readonly shortHash:string
Short commit hash (typically 7 characters)
§readonly url?:string
URL to the commit (e.g., GitHub commit link)
§interface

CompatibilityResult

Schema compatibility check result.

Properties

§readonly compatible:boolean
Whether schemas are compatible
§readonly differences:unknown
List of schema differences found
§interface

DiffStats

Statistics about the diff.

Properties

§readonly addedCount:number
Number of added entries
§readonly modifiedCount:number
Number of modified entries
§readonly removedCount:number
Number of removed entries
§readonly totalChanges:number
Total number of property changes across all modified entries
§interface

EntryDiff

Represents differences in a single entry.

Properties

§readonly addedSections:unknown
Sections added in target
§readonly changes:unknown
List of property differences
§readonly modifiedSections:unknown
Sections that were modified
§readonly removedSections:unknown
Sections removed from source
§readonly source:ChangelogEntry
Original entry (from source)
§readonly target:ChangelogEntry
Modified entry (from target)
§readonly version:string
Version of the entry
§interface

IssueRef

Issue/PR Reference
Represents a reference to an issue or pull request.

Properties

§readonly number:number
Issue or PR number
§readonly type:"issue" | "pull-request"
Type of reference
§readonly url?:string
URL to the issue/PR
§interface

ItemDiff

Represents differences in a single item.

Properties

§readonly changes:unknown
List of property changes
§readonly source:ChangelogItem
Source item
§readonly sourceDescription:string
Description from source
§readonly target:ChangelogItem
Target item
§interface

JsonSerializeOptions

JSON serialization options.

Properties

§readonly includeEmptyArrays?:boolean
Include empty arrays
§readonly includeMetadata?:boolean
Include metadata in output
§readonly includeSource?:boolean
Include source path in output
§readonly indent?:number
Indentation size (for pretty printing)
§readonly pretty?:boolean
Pretty print with indentation
§interface

MergeOptions

Options for merging changelogs.

Properties

§readonly entryStrategy?:MergeStrategy
Strategy for conflicting entries (default: 'union')
§readonly itemStrategy?:MergeStrategy
Strategy for conflicting items (default: 'union')
§readonly removeDuplicates?:boolean
Remove duplicates
§readonly sectionStrategy?:MergeStrategy
Strategy for conflicting sections (default: 'union')
§readonly sortByVersion?:boolean
Sort entries by version after merge
§readonly useSourceHeader?:boolean
Use source header (default: true)
§interface

MergeResult

Result of a merge operation.

Properties

§readonly changelog:Changelog
The merged changelog
§readonly stats:MergeStats
Statistics about the merge
§interface

MergeStats

Statistics about a merge operation.

Properties

§readonly conflictsResolved:number
Number of conflicts resolved
§readonly merged:number
Entries merged from both
§readonly sourceOnly:number
Entries only in source
§readonly targetOnly:number
Entries only in target
§readonly totalEntries:number
Number of entries in result
§interface

PropertyDiff

Represents a single property difference.

Properties

§readonly newValue?:unknown
New value (for 'added' and 'changed')
§readonly oldValue?:unknown
Previous value (for 'removed' and 'changed')
§readonly path:unknown
Path to the property (e.g., ['date'], ['sections', '0', 'heading'])
§readonly type:"added" | "changed" | "removed"
Type of change
§interface

RemoveEntryOptions

Options for removing an entry.

Properties

§readonly throwIfNotFound?:boolean
Throw error if entry not found (default: true)
§interface

SchemaDifference

A single schema difference.

Properties

§readonly path:string
JSON path where difference was found
§readonly sourceType?:string
Type in source schema
§readonly targetType?:string
Type in target schema
§readonly type:"type-mismatch" | "missing-property" | "extra-property"
Type of difference
§interface

SectionDiff

Represents differences in a single section.

Properties

§readonly addedItems:unknown
Items added in target
§readonly modifiedItems:unknown
Items that were modified
§readonly removedItems:unknown
Items removed from source
§readonly source:ChangelogSection
Original section (from source)
§readonly target:ChangelogSection
Modified section (from target)
§readonly type:string
Section type
§interface

SerializeOptions

Serialization options for controlling output format.

Properties

§readonly entrySpacing?:number
Number of blank lines between entries
§readonly includeCommits?:boolean
Include commit references
§readonly includeCompareUrls?:boolean
Include compare URLs for entries
§readonly includeDescription?:boolean
Include preamble description in header
§readonly includeRawContent?:boolean
Include raw content fallback
§readonly includeReferences?:boolean
Include issue/PR references
§readonly includeScope?:boolean
Include scope in items
§readonly lineEnding?:" " | " "
Line ending style
§readonly sectionHeadings?:Partial<Record<ChangelogSectionType, string>>
Custom section headings (overrides defaults)
§readonly sectionOrder?:unknown
Section ordering (defaults to standard order)
§readonly sectionSpacing?:number
Number of blank lines between sections
§readonly useAsterisks?:boolean
Use asterisks (*) instead of dashes (-) for list items
§interface

Token

Represents a single parsed token from the changelog markdown.

Properties

§readonly column:number
Column position where the token starts (1-indexed)
§readonly line:number
Line number where the token appears (1-indexed)
§readonly type:TokenType
The type classification of the token
§readonly value:string
The raw text content of the token

Types

§type

ChangelogFormat

Changelog Format
Detected format/style of the changelog file.
type ChangelogFormat = "keep-a-changelog" | "conventional" | "custom" | "unknown"
§type

ChangelogSectionType

Changelog Section Types
Categories for grouping changes in a changelog entry.
type ChangelogSectionType = "breaking" | "features" | "fixes" | "performance" | "documentation" | "deprecations" | "refactoring" | "tests" | "build" | "ci" | "chores" | "other"
§type

EntryPredicate

Predicate function for filtering entries.
type EntryPredicate = (entry: ChangelogEntry, index: number) => boolean
§type

EntryTransformer

Transformation function for entries.
type EntryTransformer = (entry: ChangelogEntry, index: number) => ChangelogEntry
§type

ItemPredicate

Predicate function for filtering items.
type ItemPredicate = (item: ChangelogItem, section: ChangelogSection, entry: ChangelogEntry) => boolean
§type

ItemTransformer

Transformation function for items.
type ItemTransformer = (item: ChangelogItem, section: ChangelogSection, entry: ChangelogEntry) => ChangelogItem
§type

MergeStrategy

Strategy for resolving merge conflicts.
type MergeStrategy = "source" | "target" | "union" | "latest"
§type

SectionPredicate

Predicate function for filtering sections.
type SectionPredicate = (section: ChangelogSection, entry: ChangelogEntry) => boolean
§type

SectionTransformer

Transformation function for sections.
type SectionTransformer = (section: ChangelogSection, entry: ChangelogEntry) => ChangelogSection
§type

TokenType

Token Types
type TokenType = "heading-1" | "heading-2" | "heading-3" | "heading-4" | "list-item" | "link-text" | "link-url" | "text" | "newline" | "blank-line" | "bold" | "code" | "eof"

Variables

§type

changelogSchema

JSON Schema for a complete Changelog document. Used for validation and format compatibility checking.
§type

DEFAULT_MERGE_OPTIONS

Default merge options.
§type

DEFAULT_SERIALIZE_OPTIONS

Default serialization options.
§type

SECTION_HEADINGS

Standard section headings for serialization. Maps section types to their preferred heading text.
§type

SECTION_TYPE_MAP

Maps section headings to their canonical types. Used during parsing to normalize different heading styles.