DEV Community

Alex Spinov
Alex Spinov

Posted on

Changesets Has a Free Version Management Tool — Automate Changelogs and npm Releases in Monorepos

Why Changesets?

Changesets manages versioning and changelogs for monorepos. Each PR adds a changeset file describing the change. At release time, Changesets bumps versions, updates changelogs, and publishes to npm.

npm install @changesets/cli
npx changeset init
Enter fullscreen mode Exit fullscreen mode

Workflow

1. Add a changeset (per PR):

npx changeset
# Interactive: pick packages, bump type (patch/minor/major), description
Enter fullscreen mode Exit fullscreen mode

Creates .changeset/cool-dogs-fly.md:

---
"@myorg/ui": minor
"@myorg/utils": patch
---

Added new Button variant and fixed utility type export
Enter fullscreen mode Exit fullscreen mode

2. Release (CI or manual):

npx changeset version  # Bumps versions, updates CHANGELOG.md
npx changeset publish  # Publishes to npm
Enter fullscreen mode Exit fullscreen mode

GitHub Action

name: Release
on:
  push:
    branches: [main]

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: changesets/action@v1
        with:
          publish: npx changeset publish
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Enter fullscreen mode Exit fullscreen mode

This creates a "Version Packages" PR that collects all changesets.

Changesets vs semantic-release

Feature Changesets semantic-release
Monorepo Native Plugin
Manual control Yes Commit-based
Changelog Curated Auto-generated
PR workflow Changeset files Commit messages

Need to extract data from any website at scale? I build custom web scrapers — 77 production scrapers running on Apify Store. Email me at spinov001@gmail.com for a tailored solution.

Top comments (0)