feat: adopt @changesets/cli for synchronized version management #243

Merged
xiaomo merged 2 commits from feat/changesets-version-management into main 2026-05-13 12:57:42 +00:00
Owner

What

Adopt @changesets/cli with fixed mode + fix package exports, bump all to 0.4.0.

Merges #241 and #242 into one PR.

Why

  1. Exports 坏了import 指向 ./src/index.ts,但发布的 tarball 只含 dist/,消费者装了找不到入口
  2. 版本管理手动 — 靠 scripts/publish.sh 手动 bump,容易不同步

Changes

Exports 修复

  • 所有包加 bun 条件(本地开发走 src)
  • import 指向 ./dist/index.js(npm 消费者走 dist)
  • types 指向 ./dist/index.d.ts

Changesets 版本管理

  • .changeset/config.json: fixed mode ["@uncaged/*"],ignore dashboard
  • package.json: 新增 changeset/version/release 脚本
  • 自动生成每个包的 CHANGELOG.md
  • publish.sh: 兼容 workspace:^ 前缀

版本

  • 所有 @uncaged/* 包 → 0.4.0(via changeset version

Usage

# 1. 每个 PR 加 changeset
bun changeset

# 2. 发版时统一 bump
bun version

# 3. 发布到 Gitea
GITEA_TOKEN=xxx bun release

Ref

Closes #241, Closes #242

## What Adopt `@changesets/cli` with **fixed mode** + fix package exports, bump all to 0.4.0. Merges #241 and #242 into one PR. ## Why 1. **Exports 坏了** — `import` 指向 `./src/index.ts`,但发布的 tarball 只含 `dist/`,消费者装了找不到入口 2. **版本管理手动** — 靠 `scripts/publish.sh` 手动 bump,容易不同步 ## Changes ### Exports 修复 - 所有包加 `bun` 条件(本地开发走 src) - `import` 指向 `./dist/index.js`(npm 消费者走 dist) - `types` 指向 `./dist/index.d.ts` ### Changesets 版本管理 - `.changeset/config.json`: fixed mode `["@uncaged/*"]`,ignore dashboard - `package.json`: 新增 `changeset`/`version`/`release` 脚本 - 自动生成每个包的 CHANGELOG.md - `publish.sh`: 兼容 `workspace:^` 前缀 ### 版本 - 所有 `@uncaged/*` 包 → **0.4.0**(via `changeset version`) ## Usage ```bash # 1. 每个 PR 加 changeset bun changeset # 2. 发版时统一 bump bun version # 3. 发布到 Gitea GITEA_TOKEN=xxx bun release ``` ## Ref Closes #241, Closes #242
xingyue added 2 commits 2026-05-13 12:52:35 +00:00
- All @uncaged/* packages → 0.4.0
- Internal deps: workspace:* → workspace:^ (resolves to ^0.4.0 on publish)
- Fix exports: add 'bun' condition for local dev (src), 'import' for consumers (dist)
- Remove stale 'main: src/index.ts' from 6 packages
- Fix publish.sh topo sort to match workspace:^ prefix

星月 <xingyue@shazhou.work>
- Install @changesets/cli as dev dependency
- Configure fixed mode: all @uncaged/* packages share the same version
- Ignore workflow-dashboard (private, not published)
- Add npm scripts: changeset, version, release
- Keep scripts/publish.sh as fallback

Closes #242
xingyue force-pushed feat/changesets-version-management from 5339ad15b6 to 522afdd4bd 2026-05-13 12:56:29 +00:00 Compare
xiaomo approved these changes 2026-05-13 12:57:38 +00:00
xiaomo left a comment
Owner

LGTM. Clean infrastructure PR — exports fix is correct (bun condition for dev, dist for npm consumers), changesets config looks good with fixed mode, and the publish.sh workspace prefix fix is a nice catch.

LGTM. Clean infrastructure PR — exports fix is correct (bun condition for dev, dist for npm consumers), changesets config looks good with fixed mode, and the publish.sh workspace prefix fix is a nice catch.
xiaomo merged commit 439e203113 into main 2026-05-13 12:57:42 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#243