wrangler-action/node_modules/@changesets/write
2023-08-07 15:11:15 -05:00
..
dist Temp fix for deps issue 2023-08-07 15:11:15 -05:00
node_modules Temp fix for deps issue 2023-08-07 15:11:15 -05:00
src Temp fix for deps issue 2023-08-07 15:11:15 -05:00
CHANGELOG.md Temp fix for deps issue 2023-08-07 15:11:15 -05:00
package.json Temp fix for deps issue 2023-08-07 15:11:15 -05:00
README.md Temp fix for deps issue 2023-08-07 15:11:15 -05:00

@changesets/write

Writes a changeset to a file.

import write from "@changesets/write";

const changeset = {
  summary: "A description of a minor change",
  releases: [
    { name: "@changesets/something", type: "minor" },
    { name: "@changesets/something-else", type: "patch" },
  ],
};

const uniqueId = await write(changeset, cwd);
console.log(uniqueId); // orange-foxes-waggle

For example, it can convert:

{
  "summary": "A description of a minor change",
  "releases": [
    { "name": "@changesets/something", "type": "minor" },
    { "name": "@changesets/something-else", "type": "patch" }
  ]
}

to

---
"@changesets/something": minor
"@changesets/something-else": patch
---

A description of a minor change

This package will take care of generating a unique id for the changeset.