npm-demo-changesets
v0.1.1
Published
Demo library showcasing Changesets automation
Readme
npm-demo-changesets
Demo library showcasing Changesets automation for NPM package publishing.
Features
- ✅ Manual change declaration through changeset files
- ✅ Collaborative changelog creation with CLI workflow
- ✅ Flexible versioning control with developer input
- ✅ Feature branch publishing with custom NPM dist-tags
- ✅ Automatic cleanup of feature branch aliases
Usage
import { hello } from 'npm-demo-changesets';
console.log(hello('World')); // "Hello, World!"Changesets Workflow
1. Make Your Changes
Make code changes as needed for your feature or fix.
2. Create a Changeset
npm run changesetThis will prompt you to:
- Select the type of change (patch, minor, major)
- Write a summary of the change
- Generate a changeset file in
.changeset/
3. Commit Everything
git add .
git commit -m "feat: add new feature with changeset"
git push4. Release Process
- Changesets action creates/updates a "Version Packages" PR
- Review and merge the PR
- Package is automatically published to NPM
Feature Branches
Pushes to feature/** or feat/** branches publish pre-release versions with branch-specific NPM tags.
Example Scenarios
Add Feature:
# Make changes npm run changeset # Select "minor", describe feature git add . && git commit -m "feat: add awesome feature"Fix Bug:
# Make changes npm run changeset # Select "patch", describe fix git add . && git commit -m "fix: resolve issue"Breaking Change:
# Make changes npm run changeset # Select "major", describe breaking change git add . && git commit -m "feat!: breaking API change"
Changesets Commands
npm run changeset- Create a new changesetnpm run version- Apply changesets and update versionnpm run release- Publish to NPM
Benefits of Changesets
- Explicit: Developers explicitly declare what changed
- Collaborative: Multiple people can contribute to changelogs
- Flexible: Full control over versioning decisions
- Transparent: Clear audit trail of what's being released
Learn More
This demo repository is featured in the comprehensive guide: "The Ultimate Guide to NPM Release Automation: Semantic Release vs Release Please vs Changesets" - a detailed comparison of different NPM release automation tools with practical examples.
