0.4.1 • Published 11 months ago
@quick-hjk/parse v0.4.1
@quick-hjk/parse
Parses a changeset from its written format to a data object.
import parse from "@quick-hjk/parse";
const changeset = `---
"@quick-hjk/something": minor
"@quick-hjk/something-else": patch
---
A description of a minor change`;
const parsedChangeset = parse(changeset);For example, it can convert:
---
"@quick-hjk/something": minor
"@quick-hjk/something-else": patch
---
A description of a minor changeto
{
"summary": "A description of a minor change",
"releases": [
{ "name": "@quick-hjk/something", "type": "minor" },
{ "name": "@quick-hjk/something-else", "type": "patch" }
]
}Note that this is not quite a complete Changeset for most tools as it lacks an id.
For written changesets, the id is normally given as the file name, which parse is not aware of.
0.4.1
11 months ago