1. @changesets/write
Writes a changeset to a file
@changesets/write
Package: @changesets/write
Created by: changesets
Last modified: Tue, 28 Nov 2023 06:40:33 GMT
Version: 0.3.0
License: MIT
Downloads: 2,459,542
Repository: https://github.com/changesets/changesets

Install

npm install @changesets/write
yarn add @changesets/write

@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.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code