@changesets/parse
v1.0.0-next.6RepositoryChangelogParse a changeset from its written format to a data object.
Installation
bash
$ pnpm add -D @changesets/parsebash
$ npm install -D @changesets/parsebash
$ yarn add -D @changesets/parseUsage
ts
import { parseChangesetFile } from "@changesets/parse";
const changeset = `---
"pkg-a": minor
"pkg-b": patch
---
A summary of the change`;
const parsedChangeset = parseChangesetFile(changeset);
// {
// "summary": "A summary of the change",
// "releases": [
// { "name": "pkg-a", "type": "minor" },
// { "name": "pkg-b", "type": "patch" }
// ]
// }Note that this does not include the changeset id, but it is normally given as the file name, which parse is not aware of.