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

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

via Dev.to JavaScriptAlex Spinov

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 co

Continue reading on Dev.to JavaScript

Opens in a new tab

Read Full Article
2 views

Related Articles