0.4.1 • Published 8 months ago

@quick-hjk/parse v0.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@quick-hjk/parse

npm package View changelog

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 change

to

{
  "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

8 months ago