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
Workflow
1. Add a changeset (per PR):
npx changeset
# Interactive: pick packages, bump type (patch/minor/major), description
Creates .changeset/cool-dogs-fly.md:
---
"@myorg/ui": minor
"@myorg/utils": patch
---
Added new Button variant and fixed utility type export
2. Release (CI or manual):
npx changeset version # Bumps versions, updates CHANGELOG.md
npx changeset publish # Publishes to npm
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 }}
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)