changeset_reader.ts view source
(content: string, filename?: string): ChangesetInfo | null Parses changeset content string from markdown format.
Pure function for testability - no file I/O, just string parsing.
Extracts package names, bump types, and summary from YAML frontmatter format.
Returns null if format is invalid or no packages found.
Expected format:
---
"package-name": patch
"@scope/package": minor
---
Summary of changes
content
changeset markdown with YAML frontmatter
type string
filename
optional filename for error reporting context
type string
default 'changeset.md'
returns
ChangesetInfo | null parsed changeset info or null if invalid format