clawt 2.8.0 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/docs/spec.md +3 -3
- package/package.json +8 -8
- package/scripts/postinstall.ts +1 -1
- package/scripts/release.sh +9 -9
package/README.md
CHANGED
package/docs/spec.md
CHANGED
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
| -------- | ----------------------------- |
|
|
37
37
|
| 运行时 | Node.js >= 18 |
|
|
38
38
|
| 语言 | TypeScript |
|
|
39
|
-
| 包管理 |
|
|
39
|
+
| 包管理 | pnpm |
|
|
40
40
|
| CLI 框架 | Commander.js |
|
|
41
41
|
| 日志库 | winston (按日期滚动文件) |
|
|
42
42
|
| 交互式 | enquirer (选项选择/确认对话) |
|
|
43
43
|
| 构建 | tsup / tsc |
|
|
44
|
-
| 分发 |
|
|
44
|
+
| 分发 | pnpm 全局安装 (`pnpm add -g clawt`) |
|
|
45
45
|
|
|
46
46
|
---
|
|
47
47
|
|
|
@@ -754,7 +754,7 @@ clawt merge [-m <commitMessage>]
|
|
|
754
754
|
|
|
755
755
|
**路径:** `~/.clawt/config.json`
|
|
756
756
|
|
|
757
|
-
**生成时机:**
|
|
757
|
+
**生成时机:** 全局安装后自动生成(通过 `postinstall` 脚本)。
|
|
758
758
|
|
|
759
759
|
**升级策略:** 配置文件已存在时,执行增量合并而非简单跳过:
|
|
760
760
|
|
package/package.json
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawt",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.1",
|
|
4
4
|
"description": "本地并行执行多个Claude Code Agent任务,融合 Git Worktree 与 Claude Code CLI 的命令行工具",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"clawt": "dist/index.js"
|
|
9
9
|
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "tsup",
|
|
12
|
-
"dev": "tsup --watch",
|
|
13
|
-
"postinstall": "node dist/postinstall.js",
|
|
14
|
-
"release": "bash scripts/release.sh"
|
|
15
|
-
},
|
|
16
10
|
"keywords": [
|
|
17
11
|
"claude",
|
|
18
12
|
"worktree",
|
|
@@ -35,5 +29,11 @@
|
|
|
35
29
|
},
|
|
36
30
|
"engines": {
|
|
37
31
|
"node": ">=18"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsup",
|
|
35
|
+
"dev": "tsup --watch",
|
|
36
|
+
"postinstall": "node dist/postinstall.js",
|
|
37
|
+
"release": "bash scripts/release.sh"
|
|
38
38
|
}
|
|
39
|
-
}
|
|
39
|
+
}
|
package/scripts/postinstall.ts
CHANGED
package/scripts/release.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# ============================================================
|
|
3
3
|
# release.sh - Clawt 自动发布脚本
|
|
4
|
-
# 功能: 构建 → 交互式选择版本级别 → 更新 package.json → 提交 → 打 tag → push →
|
|
4
|
+
# 功能: 构建 → 交互式选择版本级别 → 更新 package.json → 提交 → 打 tag → push → pnpm publish
|
|
5
5
|
# 用法: bash scripts/release.sh
|
|
6
6
|
# ============================================================
|
|
7
7
|
|
|
@@ -138,7 +138,7 @@ echo ""
|
|
|
138
138
|
|
|
139
139
|
TAG="v${NEW_VERSION}"
|
|
140
140
|
|
|
141
|
-
# 回滚函数:
|
|
141
|
+
# 回滚函数:pnpm publish 失败时撤销 commit、tag、push
|
|
142
142
|
# 参数 $1: 是否已推送到远程("pushed" 表示已推送)
|
|
143
143
|
rollback() {
|
|
144
144
|
local pushed="${1:-}"
|
|
@@ -166,7 +166,7 @@ rollback() {
|
|
|
166
166
|
# ────────────────────────────────────────
|
|
167
167
|
|
|
168
168
|
print_step "构建项目..."
|
|
169
|
-
|
|
169
|
+
pnpm build
|
|
170
170
|
print_success "构建完成"
|
|
171
171
|
|
|
172
172
|
# ────────────────────────────────────────
|
|
@@ -174,8 +174,8 @@ print_success "构建完成"
|
|
|
174
174
|
# ────────────────────────────────────────
|
|
175
175
|
|
|
176
176
|
print_step "更新版本号: ${CURRENT_VERSION} → ${NEW_VERSION}"
|
|
177
|
-
# 使用
|
|
178
|
-
|
|
177
|
+
# 使用 pnpm version 更新版本号,--no-git-tag-version 避免自动打 tag
|
|
178
|
+
pnpm version "$NEW_VERSION" --no-git-tag-version > /dev/null
|
|
179
179
|
print_success "版本号已更新"
|
|
180
180
|
|
|
181
181
|
# ────────────────────────────────────────
|
|
@@ -183,7 +183,7 @@ print_success "版本号已更新"
|
|
|
183
183
|
# ────────────────────────────────────────
|
|
184
184
|
|
|
185
185
|
print_step "提交版本变更..."
|
|
186
|
-
git add package.json
|
|
186
|
+
git add package.json pnpm-lock.yaml 2>/dev/null || git add package.json
|
|
187
187
|
git commit -m "build: bump version to ${NEW_VERSION}"
|
|
188
188
|
print_success "版本变更已提交"
|
|
189
189
|
|
|
@@ -197,14 +197,14 @@ print_success "tag 已创建: ${TAG}"
|
|
|
197
197
|
|
|
198
198
|
# ────────────────────────────────────────
|
|
199
199
|
# 步骤 5: 发布到 npm(先发布,成功后再推送 git)
|
|
200
|
-
# 调整顺序:
|
|
200
|
+
# 调整顺序:pnpm publish 放在 git push 之前
|
|
201
201
|
# 如果 publish 失败,只需回滚本地 commit 和 tag,无需处理远程
|
|
202
202
|
# ────────────────────────────────────────
|
|
203
203
|
|
|
204
204
|
print_step "发布到 npm..."
|
|
205
|
-
# 临时关闭 set -e,手动捕获
|
|
205
|
+
# 临时关闭 set -e,手动捕获 pnpm publish 的退出码
|
|
206
206
|
set +e
|
|
207
|
-
NPM_OUTPUT=$(
|
|
207
|
+
NPM_OUTPUT=$(pnpm publish --access public --registry https://registry.npmjs.org/ --no-git-checks 2>&1)
|
|
208
208
|
NPM_EXIT_CODE=$?
|
|
209
209
|
set -e
|
|
210
210
|
|