This document describes how to use the new changeset-based release process for the RTS project.
The release process now uses @changesets/cli for managing versions, changelogs, and publishing. This provides a more robust and standardized approach to releases.
-
Install changeset CLI:
pnpm add -D @changesets/cli
-
Initialize changeset (first time only):
pnpm run changeset:init
When you make changes that should be released, create a changeset:
pnpm changesetThis will:
- Ask you which packages have changed
- Ask you what type of changes (patch, minor, major)
- Ask you to write a description of the changes
- Create a markdown file in
.changeset/directory
Before releasing, ensure the project builds correctly:
# Run tests
pnpm test
# Build the project (you need to implement this)
pnpm run build
# Validate build output
pnpm run release:buildWhen ready to release:
# Full release process
pnpm run release
# Dry run (no actual changes)
pnpm run release:dry-runThe release process will:
- ✅ Check prerequisites (changeset installed, changeset files exist)
- ✅ Run tests (unless
--skip-testsis used) - ✅ Build project (unless
--skip-buildis used) - ✅ Validate build output
- ✅ Update versions using changeset
- ✅ Publish to npm
- ✅ Push changes to git
- ✅ Create git tag for the release
- ✅ Clean up changeset files
The release script expects a build process that produces the following files:
dist/
├── index.js
├── index.d.ts
├── resolver/
│ ├── index.js
│ └── index.d.ts
├── transformer/
│ ├── ts.js
│ └── ts.d.ts
└── config/
├── index.js
└── index.d.ts
You need to implement the build script in package.json:
{
"scripts": {
"build": "your-build-command-here"
}
}pnpm changeset- Create a new changesetpnpm run changeset:init- Initialize changeset (first time setup)pnpm run changeset:version- Update versions and changelogpnpm run changeset:publish- Publish to npm
pnpm run release- Full release processpnpm run release:dry-run- Dry run (no actual changes)pnpm run release:build- Build and validatepnpm run release:test- Run tests onlypnpm run release:tag- Create git tag for current version
--dry-run- Run without making actual changes--skip-build- Skip the build process--skip-tests- Skip running tests
# 1. Create changeset
pnpm changeset
# 2. Build and test
pnpm run build
pnpm test
# 3. Release
pnpm run release# Test the release process without making changes
pnpm run release:dry-run# Release without building (if build is already done)
pnpm run release --skip-build# Release without running tests
pnpm run release --skip-tests# Create git tag for current version without full release
pnpm run release:tagChangeset files are created in .changeset/ directory with names like random-name.md. They contain:
---
"rts": patch
---
Description of changesThe changelog is automatically generated by changeset and includes:
- Version information
- Release date
- Categorized changes (Added, Changed, Fixed, Breaking Changes)
- Links to relevant issues/PRs
pnpm add -D @changesets/clipnpm changesetImplement the build script in package.json and ensure it produces the expected files in dist/ directory.
Ensure you have proper git configuration and permissions to push to the repository.
The old release process used manual version bumping. The new process:
- ✅ Uses changeset for version management
- ✅ Automatically generates changelog
- ✅ Provides better validation
- ✅ Supports multiple packages (future)
- ✅ Has better error handling
- Create changesets early - Create changesets as you make changes, not just before release
- Write clear descriptions - Good changelog entries help users understand changes
- Test before release - Always run tests and build validation
- Use dry runs - Test the release process with
--dry-runfirst - Review changes - Check the generated changelog before publishing