Best Practices
Changesets
Release and version management for the monorepo packages
Not needed yet
Becomes relevant when @marketplace/ui or @marketplace/types get external consumers, a public changelog is needed, or internal versioning discipline is required to avoid silent breaking changes between packages. Recipe kept for that day.
The cal.diy pattern
.changeset/config.json with @changesets/changelog-github. Workflow:
- Developer runs
pnpm changesetas part of their PR — generates a.changeset/xyz.mdfile describing the change type (patch/minor/major) and a plain-English summary. - A GitHub Action runs on merge to main — bumps versions and opens a "Version Packages" PR.
- Merging the version PR publishes and generates a CHANGELOG.
Setup (30 min, when needed)
pnpm add -w -D @changesets/cli @changesets/changelog-github
pnpm changeset init{
"changelog": "@changesets/changelog-github",
"commit": false,
"baseBranch": "main",
"access": "restricted"
}{
"changeset": "changeset",
"version-packages": "changeset version",
"release": "turbo run build && changeset publish"
}CI integration
name: Release
on:
push:
branches: [main]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- uses: pnpm/action-setup@v3
- run: pnpm install --frozen-lockfile
- uses: changesets/action@v1
with:
publish: pnpm release
title: "chore: version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}Developer workflow (ongoing)
Every PR that changes the public API of @marketplace/types or @marketplace/ui includes a changeset file (pnpm changeset). The discipline matters more than the tooling — the tooling is just a reminder.