## Summary This PR introduces [changesets](https://github.com/changesets/changesets) to automate version management and publishing for the Cherry Studio monorepo. ## Changes ### Changeset Setup - `.changeset/config.json` - Changeset configuration with GitHub changelog integration - `.changeset/README.md` - Documentation for using changesets and CI/CD release flow - `.changeset/initial-setup.md` - Initial changeset marking the setup ### CI/CD Workflows - `.github/workflows/release-packages.yml` - Automated release workflow (creates Version Packages PR, publishes on merge) - `.github/workflows/snapshot.yml` - Manual snapshot release workflow - `.github/workflows/ci.yml` - Added `changeset-check` job to verify PRs include changesets when packages are modified ### Package Updates - `package.json` - Added changeset scripts (`changeset`, `changeset:status`, `changeset:version`, `changeset:publish`, `packages:build`, `packages:release`) - `packages/aiCore/package.json` - Added `prepublishOnly` script - `packages/ai-sdk-provider/package.json` - Added `prepublishOnly` script - `packages/extension-table-plus/package.json` - Added `prepublishOnly` script - `packages/extension-table-plus/CHANGELOG-OLD.md` - Backup of historical changelog ## How It Works 1. **Developers**: Run `pnpm changeset add` in PRs that modify packages 2. **CI**: `changeset-check` job validates PRs include changesets when needed 3. **Accumulate**: Merging PRs with changesets auto-creates/updates a "Version Packages" PR 4. **Release**: Maintainers merge the Version Packages PR when ready → packages are published to npm ## Requirements - [ ] `NPM_TOKEN` secret must be configured in GitHub repository settings ## Test Plan - [x] `pnpm changeset:status` runs successfully - [x] `GITHUB_TOKEN=$(gh auth token) pnpm changeset:version` bumps versions and generates changelogs correctly - [x] `pnpm packages:build` builds all packages in correct order - [x] `pnpm format` passes ## Release Note ```release-note NONE (internal tooling change) ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: icarus <eurfelux@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
3.1 KiB
Changesets
This folder contains configuration and changeset files for managing package versioning and publishing in the Cherry Studio monorepo.
What is Changesets?
Changesets is a tool to help manage versioning and publishing for multi-package repositories. It tracks changes to packages and automates:
- Version bumping based on semantic versioning
- Changelog generation
- Package publishing
- Dependency updates between packages
Quick Start
Adding a changeset
When you make changes that should be published, run:
pnpm changeset add
This will:
- Ask which packages have changed
- Ask for the type of change (patch/minor/major)
- Ask for a description of the change
- Create a changeset file in
.changeset/
Note
: CI will check that PRs modifying packages include a changeset.
Versioning and publishing
Versioning and publishing are handled automatically by CI — you do not need to run changeset version or changeset publish locally. See the CI/CD Integration section below.
Configuration
See config.json for the changeset configuration:
- changelog: Uses
@changesets/changelog-githubto generate GitHub-linked changelogs - access:
public- packages are published publicly - baseBranch:
main- PRs target this branch - updateInternalDependencies:
patch- internal deps are updated on any change
Packages managed
| Package | Description |
|---|---|
@cherrystudio/ai-core |
Unified AI Provider Interface |
@cherrystudio/ai-sdk-provider |
AI SDK provider bundle with CherryIN routing |
@cherrystudio/extension-table-plus |
Table extension for Tiptap |
Dependency relationships
ai-core (peer-depends on) → ai-sdk-provider
Changeset automatically handles updating peer dependency ranges when ai-sdk-provider is published.
CI/CD Integration
The release workflow (.github/workflows/release-packages.yml) uses changesets/action and works in two phases:
Phase 1 — Accumulate changes
When a PR containing changeset files is merged to main, the action detects pending changesets and creates or updates a "Version Packages" PR. This PR:
- Bumps package versions based on all accumulated changesets
- Generates/updates
CHANGELOG.mdfor each package - Deletes consumed changeset files
Multiple PRs with changesets can merge before a release — the Version Packages PR keeps updating to include all of them.
Phase 2 — Publish
When a maintainer decides it's time to release, they merge the Version Packages PR. This triggers the workflow again, and since there are no more pending changesets, the action runs pnpm changeset:publish to publish the updated packages to npm.
In short: changesets accumulate automatically; you control when to release by merging the Version Packages PR.