This project uses standard-version for versioning and changelog management.
- Node.js and pnpm installed
- Commit access to the repository
We follow Conventional Commits:
| Type | Description | Version Bump |
|---|---|---|
feat: |
New feature | minor (x.y.z) |
fix: |
Bug fix | patch (x.y.z) |
BREAKING CHANGE: |
Breaking change | major (x.y.z) |
| Type | Description | In Changelog? |
|---|---|---|
feat: |
New feature | Yes |
fix: |
Bug fix | Yes |
chore: |
Maintenance | No |
docs: |
Documentation | No |
style: |
Styles (formatting) | No |
refactor: |
Code refactoring | No |
perf: |
Performance improvements | No |
test: |
Tests | No |
git commit -m "feat: add dark mode support"
git commit -m "fix: resolve login redirect issue"
git commit -m "feat: change API response format
BREAKING CHANGE: The API now returns JSON instead of XML"pnpm releasestandard-version will analyze your commits since last release and determine the appropriate bump.
# Patch release (1.2.0 → 1.2.1)
pnpm run release:patch
# Minor release (1.2.0 → 1.3.0)
pnpm run release:minor
# Major release (1.2.0 → 2.0.0)
pnpm run release:major
# Dry run (preview only)
pnpm run release:dry# Specific version
pnpm release -- --release-as 2.0.0CHANGELOG.md is automatically generated when running pnpm release. It includes:
- All
feat:commits under "Features" - All
fix:commits under "Bug Fixes" - Links to commits and issues
pnpm release -- --dry-rungit statuspnpm releaseThis will:
- Bump version in
package.json - Update
CHANGELOG.md - Create a git tag (e.g.,
v1.2.0) - Commit changes
git push --follow-tags origin masterThe --follow-tags flag pushes both commits and tags.
After pushing tags:
npm publishAdd to your CI workflow (GitHub Actions example):
name: Release
on:
push:
branches: [master]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- run: pnpm install
- run: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git push --follow-tags origin master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}Create an NPM token at https://www.npmjs.com/settings/[your-username]/tokens and add it as NPM_TOKEN secret in your repository settings.
If this is your first release:
# Install dependencies
pnpm install
# Create initial release (will bump from 0.0.0 to 1.0.0)
pnpm release -- --release-as minorIf something goes wrong:
# Remove the last tag
git tag -d v1.2.0
# Remove the release commit
git reset --hard HEAD~1
# Push the changes
git push --force origin master