We use changesets for independent versioning and publishing of each package in the monorepo.
Previously we used standard-version, but it's designed for single-package repos. It couldn't scope version bumps or changelogs to individual packages in a monorepo — every release was global. Changesets solves this by letting each package track its own changes independently.
packages/
├── sol/ # @toju.network/sol - Solana payments
├── fil/ # @toju.network/fil - Filecoin payments
└── eth/ # @toju.network/eth - Ethereum/Base payments (planned)
Each package has:
- Independent
package.jsonwith its own version - Independent
CHANGELOG.mdtracking changes - Independent release cycle
Different blockchain integrations evolve at different rates:
- Solana package may receive bug fixes while others are stable
- Filecoin package might add features without affecting Solana users
- Ethereum package could be in development while others are production-ready
Independent versioning means:
- Users only see relevant updates for their chain
- Breaking changes in one package don't force version bumps in others
- Each package can follow its own maturity timeline
There are three commands involved in the release process. Contributors only need to know the first one.
After making changes to a package, run:
pnpm changesetThis prompts you to:
- Select which packages changed (
@toju.network/sol,@toju.network/fil, etc.) - Choose the bump type (patch, minor, major)
- Write a summary of the change
A markdown file is created in .changeset/ describing the change. Commit this file alongside your code changes. No versions are bumped at this stage — the changeset is just a record of intent.
NOTE: the steps (2 & 3) below are reserved for maintainers
When ready to cut a release, a maintainer runs:
pnpm version-packagesThis consumes all pending changeset files and:
- Bumps the
versionin each affectedpackage.json - Updates each package's
CHANGELOG.md - Removes the consumed changeset files from
.changeset/
The result is a commit with updated versions and changelogs, ready to publish.
pnpm releaseThis publishes every package that has a new version not yet on the npm registry. Requires npm authentication (npm login or NPM_TOKEN in CI).
Use conventional commits for clear history:
Format:
<type>: <description in lowercase>
Types:
feat:- new featuresfix:- bug fixeschore:- maintenance, no user-facing changesdocs:- documentation updates
Scoped commits for package-specific changes:
feat(sol): add transaction retry logic
fix(fil): resolve USDFC decimals issue
Changesets use semver:
- patch (0.1.0 → 0.1.1): bug fixes, internal changes
- minor (0.1.0 → 0.2.0): new features, non-breaking additions
- major (0.1.0 → 1.0.0): breaking changes
# 1. make changes to @toju.network/sol
# 2. add a changeset
pnpm changeset
# → select @toju.network/sol, pick "patch", write "fix deposit confirmation timeout"
# 3. commit everything (changeset file included)
git add --all
git commit -m "fix(sol): deposit confirmation timeout"
# 4. release
pnpm version-packages
git add --all
git commit -m "chore: version packages"
git push
# 5. publish to npm
pnpm release