@liangjie559567/ultrapower 5.5.39 → 5.5.41
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -8
- package/docs/CLAUDE.md +1 -1
- package/docs/INSTALL.md +2 -2
- package/docs/REFERENCE.md +1 -1
- package/docs/RELEASE.md +49 -0
- package/docs/RELEASE_GUIDE.md +218 -0
- package/docs/RELEASE_RECOVERY.md +84 -0
- package/docs/standards/README.md +1 -1
- package/package.json +9 -3
- package/scripts/release-steps.mjs +24 -7
- package/scripts/sync-marketplace.mjs +15 -0
- package/scripts/validate-plugin-configs.mjs +58 -0
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
{
|
|
9
9
|
"name": "ultrapower",
|
|
10
10
|
"description": "Disciplined multi-agent orchestration: workflow enforcement + parallel execution",
|
|
11
|
-
"version": "5.5.
|
|
11
|
+
"version": "5.5.41",
|
|
12
12
|
"source": {
|
|
13
13
|
"source": "npm",
|
|
14
14
|
"package": "@liangjie559567/ultrapower",
|
|
15
|
-
"version": "5.5.
|
|
15
|
+
"version": "5.5.41"
|
|
16
16
|
},
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "liangjie559567"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultrapower",
|
|
3
3
|
"description": "Disciplined multi-agent orchestration: workflow enforcement + parallel execution",
|
|
4
|
-
"version": "5.5.
|
|
4
|
+
"version": "5.5.41",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "liangjie559567"
|
|
7
7
|
},
|
|
@@ -19,11 +19,5 @@
|
|
|
19
19
|
"claudecode",
|
|
20
20
|
"anthropic",
|
|
21
21
|
"llm"
|
|
22
|
-
]
|
|
23
|
-
"statusline": {
|
|
24
|
-
"command": "node",
|
|
25
|
-
"args": [
|
|
26
|
-
"dist/hud/index.js"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
22
|
+
]
|
|
29
23
|
}
|
package/docs/CLAUDE.md
CHANGED
package/docs/INSTALL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ultrapower 安装部署详细教程
|
|
2
2
|
|
|
3
|
-
ultrapower v5.5.
|
|
3
|
+
ultrapower v5.5.40 完整安装指南,覆盖从零开始到完全配置的所有步骤。
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -88,7 +88,7 @@ git --version
|
|
|
88
88
|
|
|
89
89
|
**预期输出:**
|
|
90
90
|
```
|
|
91
|
-
✓ Installing ultrapower v5.5.
|
|
91
|
+
✓ Installing ultrapower v5.5.40...
|
|
92
92
|
✓ Hooks registered: 39
|
|
93
93
|
✓ Agents loaded: 49
|
|
94
94
|
✓ Skills available: 71
|
package/docs/REFERENCE.md
CHANGED
package/docs/RELEASE.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# 发布流程
|
|
2
|
+
|
|
3
|
+
## 自动化发布(推荐)
|
|
4
|
+
|
|
5
|
+
### 1. 创建 changeset
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run changeset
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
回答问题:
|
|
12
|
+
- 选择变更类型(patch/minor/major)
|
|
13
|
+
- 输入变更描述
|
|
14
|
+
|
|
15
|
+
### 2. 提交 changeset
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
git add .changeset
|
|
19
|
+
git commit -m "chore: add changeset for feature X"
|
|
20
|
+
git push origin dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 3. 合并到 main
|
|
24
|
+
|
|
25
|
+
创建 PR 从 dev 到 main,合并后 GitHub Actions 自动:
|
|
26
|
+
- 运行测试
|
|
27
|
+
- 更新版本号
|
|
28
|
+
- 生成 CHANGELOG
|
|
29
|
+
- 发布到 npm
|
|
30
|
+
- 创建 GitHub Release
|
|
31
|
+
|
|
32
|
+
## 手动发布
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm run changeset # 创建 changeset
|
|
36
|
+
npm run version # 更新版本
|
|
37
|
+
npm run release # 发布到 npm
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## GitHub Secrets 配置
|
|
41
|
+
|
|
42
|
+
在仓库设置中添加:
|
|
43
|
+
- `NPM_TOKEN`: 从 npmjs.com 获取访问令牌
|
|
44
|
+
|
|
45
|
+
## 版本规范
|
|
46
|
+
|
|
47
|
+
- **patch** (5.5.39 → 5.5.40): Bug 修复
|
|
48
|
+
- **minor** (5.5.39 → 5.6.0): 新功能
|
|
49
|
+
- **major** (5.5.39 → 6.0.0): 破坏性变更
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# ultrapower 插件发布完整指南
|
|
2
|
+
|
|
3
|
+
## 📋 目录
|
|
4
|
+
|
|
5
|
+
1. [快速发布流程](#快速发布流程)
|
|
6
|
+
2. [发布架构](#发布架构)
|
|
7
|
+
3. [详细步骤](#详细步骤)
|
|
8
|
+
4. [高级配置](#高级配置)
|
|
9
|
+
5. [故障排查](#故障排查)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 快速发布流程
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# 1. 更新版本
|
|
17
|
+
node scripts/bump-version.mjs 5.5.41
|
|
18
|
+
|
|
19
|
+
# 2. 提交到 dev
|
|
20
|
+
git add .
|
|
21
|
+
git commit -m "chore: bump version to 5.5.41"
|
|
22
|
+
git push origin dev
|
|
23
|
+
|
|
24
|
+
# 3. 合并到 main(触发自动发布)
|
|
25
|
+
git checkout main
|
|
26
|
+
git merge dev
|
|
27
|
+
git push origin main
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
GitHub Actions 自动执行:构建 → 测试 → NPM 发布 → GitHub Release → 插件市场同步
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 发布架构
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
版本更新 → 构建验证 → NPM 发布 → GitHub Release → 插件市场同步
|
|
38
|
+
↓ ↓ ↓ ↓ ↓
|
|
39
|
+
bump-version tsc+test npm publish gh release git push dev
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 5 步流水线
|
|
43
|
+
|
|
44
|
+
1. **Preflight** - 版本同步校验(5 个配置文件)
|
|
45
|
+
2. **Validate** - TypeScript + 构建 + 测试
|
|
46
|
+
3. **Publish** - NPM 发布(带 provenance)
|
|
47
|
+
4. **Release** - GitHub Release 创建
|
|
48
|
+
5. **Sync** - Marketplace 同步到 dev 分支
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 详细步骤
|
|
53
|
+
|
|
54
|
+
### Step 1: 版本号更新
|
|
55
|
+
|
|
56
|
+
**自动同步 5 个文件:**
|
|
57
|
+
- `package.json`
|
|
58
|
+
- `.claude-plugin/plugin.json`
|
|
59
|
+
- `.cursor-plugin/plugin.json`
|
|
60
|
+
- `.claude-plugin/marketplace.json`
|
|
61
|
+
- `marketplace.json`
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
node scripts/bump-version.mjs 5.5.41
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**验证版本一致性:**
|
|
68
|
+
```bash
|
|
69
|
+
node scripts/bump-version.mjs
|
|
70
|
+
# 输出: ✓ All in sync
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Step 2: 本地验证
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# TypeScript 类型检查
|
|
77
|
+
tsc --noEmit
|
|
78
|
+
|
|
79
|
+
# 完整构建
|
|
80
|
+
npm run build
|
|
81
|
+
|
|
82
|
+
# 运行测试
|
|
83
|
+
npm test
|
|
84
|
+
|
|
85
|
+
# 预览打包内容
|
|
86
|
+
npm pack --dry-run
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Step 3: 提交变更
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git add .
|
|
93
|
+
git commit -m "chore: bump version to 5.5.41"
|
|
94
|
+
git push origin dev
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Step 4: 触发发布
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# 合并到 main 触发 GitHub Actions
|
|
101
|
+
git checkout main
|
|
102
|
+
git merge dev
|
|
103
|
+
git push origin main
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Step 5: 验证发布
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# 检查 NPM
|
|
110
|
+
npm view @liangjie559567/ultrapower@5.5.41
|
|
111
|
+
|
|
112
|
+
# 检查 GitHub Release
|
|
113
|
+
gh release view v5.5.41
|
|
114
|
+
|
|
115
|
+
# 检查 provenance
|
|
116
|
+
npm audit signatures
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 高级配置
|
|
122
|
+
|
|
123
|
+
### NPM Provenance(供应链安全)
|
|
124
|
+
|
|
125
|
+
**已启用:** 发布时自动添加 `--provenance` 标志
|
|
126
|
+
|
|
127
|
+
**验证:**
|
|
128
|
+
```bash
|
|
129
|
+
npm audit signatures
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**查看 provenance:**
|
|
133
|
+
访问 https://www.npmjs.com/package/@liangjie559567/ultrapower
|
|
134
|
+
查看验证徽章
|
|
135
|
+
|
|
136
|
+
### GitHub Actions 缓存
|
|
137
|
+
|
|
138
|
+
**已启用:** 依赖缓存加速 CI/CD
|
|
139
|
+
|
|
140
|
+
**缓存策略:**
|
|
141
|
+
- 路径:`~/.npm`
|
|
142
|
+
- 键:`${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}`
|
|
143
|
+
- 节省时间:30-60 秒
|
|
144
|
+
|
|
145
|
+
### Changesets 集成
|
|
146
|
+
|
|
147
|
+
**当前配置:** 使用 Changesets action 自动化版本管理
|
|
148
|
+
|
|
149
|
+
**工作流:**
|
|
150
|
+
1. 推送到 main → Changesets 检测变更
|
|
151
|
+
2. 有 changeset → 创建版本 PR
|
|
152
|
+
3. 合并 PR → 自动发布
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 故障排查
|
|
157
|
+
|
|
158
|
+
### 常见问题
|
|
159
|
+
|
|
160
|
+
**Q: 版本不一致错误**
|
|
161
|
+
```bash
|
|
162
|
+
# 重新同步版本
|
|
163
|
+
node scripts/bump-version.mjs 5.5.41
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Q: 循环依赖错误**
|
|
167
|
+
```bash
|
|
168
|
+
# 检查 package.json dependencies
|
|
169
|
+
# 确保不包含 @liangjie559567/ultrapower
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Q: NPM 发布失败**
|
|
173
|
+
```bash
|
|
174
|
+
# 检查 NPM_TOKEN
|
|
175
|
+
echo $NPM_TOKEN
|
|
176
|
+
|
|
177
|
+
# 手动发布
|
|
178
|
+
npm publish --access public --provenance
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Q: GitHub Release 失败**
|
|
182
|
+
```bash
|
|
183
|
+
# 手动创建
|
|
184
|
+
gh release create v5.5.41 --generate-notes
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 发布失败恢复
|
|
188
|
+
|
|
189
|
+
详见 [RELEASE_RECOVERY.md](./RELEASE_RECOVERY.md)
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 安全最佳实践
|
|
194
|
+
|
|
195
|
+
✅ **已实施:**
|
|
196
|
+
- NPM provenance 声明
|
|
197
|
+
- GitHub Actions 权限最小化
|
|
198
|
+
- 短期证书(非长期密钥)
|
|
199
|
+
- 依赖缓存(加速 + 安全)
|
|
200
|
+
|
|
201
|
+
✅ **版本控制:**
|
|
202
|
+
- 严格 semver 格式验证
|
|
203
|
+
- 5 文件版本同步
|
|
204
|
+
- 循环依赖检测
|
|
205
|
+
|
|
206
|
+
✅ **发布验证:**
|
|
207
|
+
- 构建前类型检查
|
|
208
|
+
- 测试门禁
|
|
209
|
+
- 打包内容预览
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 参考资料
|
|
214
|
+
|
|
215
|
+
- [NPM Package Provenance](https://github.blog/2023-04-19-introducing-npm-package-provenance)
|
|
216
|
+
- [GitHub Actions Caching](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows)
|
|
217
|
+
- [Changesets Documentation](https://github.com/changesets/changesets)
|
|
218
|
+
- [发布失败恢复指南](./RELEASE_RECOVERY.md)
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# 发布失败恢复指南
|
|
2
|
+
|
|
3
|
+
## 快速诊断
|
|
4
|
+
|
|
5
|
+
发布流程的 5 个步骤:
|
|
6
|
+
1. **Preflight** - 版本同步校验
|
|
7
|
+
2. **Validate** - 构建 + 测试
|
|
8
|
+
3. **Publish** - NPM 发布
|
|
9
|
+
4. **Release** - GitHub Release
|
|
10
|
+
5. **Sync** - Marketplace 同步
|
|
11
|
+
|
|
12
|
+
## 恢复策略
|
|
13
|
+
|
|
14
|
+
### 场景 1: NPM 发布成功,但后续步骤失败
|
|
15
|
+
|
|
16
|
+
**症状:** 包已在 npmjs.com 上,但没有 GitHub Release
|
|
17
|
+
|
|
18
|
+
**恢复步骤:**
|
|
19
|
+
```bash
|
|
20
|
+
# 方案 A: 手动创建 GitHub Release
|
|
21
|
+
gh release create v5.5.40 --generate-notes
|
|
22
|
+
|
|
23
|
+
# 方案 B: 标记为弃用并重新发布(< 72小时)
|
|
24
|
+
npm deprecate @liangjie559567/ultrapower@5.5.40 "Incomplete release, use 5.5.41"
|
|
25
|
+
node scripts/bump-version.mjs 5.5.41
|
|
26
|
+
npm run build
|
|
27
|
+
npm publish --provenance
|
|
28
|
+
gh release create v5.5.41 --generate-notes
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 场景 2: 发布后发现严重 Bug
|
|
32
|
+
|
|
33
|
+
**72 小时内且无依赖:**
|
|
34
|
+
```bash
|
|
35
|
+
npm unpublish @liangjie559567/ultrapower@5.5.40
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**任何时候(推荐):**
|
|
39
|
+
```bash
|
|
40
|
+
npm deprecate @liangjie559567/ultrapower@5.5.40 "Critical bug, use 5.5.41"
|
|
41
|
+
node scripts/bump-version.mjs 5.5.41
|
|
42
|
+
npm run build
|
|
43
|
+
npm test
|
|
44
|
+
npm publish --provenance
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 场景 3: 从特定步骤恢复
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# 从 publish 步骤开始
|
|
51
|
+
node scripts/release-local.mjs --start-from=publish
|
|
52
|
+
|
|
53
|
+
# 从 release 步骤开始
|
|
54
|
+
node scripts/release-local.mjs --start-from=release
|
|
55
|
+
|
|
56
|
+
# 从 sync 步骤开始
|
|
57
|
+
node scripts/release-local.mjs --start-from=sync
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## 预防措施
|
|
61
|
+
|
|
62
|
+
### 发布前检查清单
|
|
63
|
+
|
|
64
|
+
- [ ] 所有测试通过 (`npm test`)
|
|
65
|
+
- [ ] 版本号已更新且一致 (`node scripts/bump-version.mjs`)
|
|
66
|
+
- [ ] 无循环依赖
|
|
67
|
+
- [ ] Git 工作区干净
|
|
68
|
+
- [ ] 本地验证打包内容 (`npm pack --dry-run`)
|
|
69
|
+
|
|
70
|
+
### Dry-run 测试
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# 完整 dry-run(不实际执行)
|
|
74
|
+
npm run release:dry-run
|
|
75
|
+
|
|
76
|
+
# 或
|
|
77
|
+
node scripts/release-local.mjs --dry-run
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## 紧急联系
|
|
81
|
+
|
|
82
|
+
- NPM 包页面: https://www.npmjs.com/package/@liangjie559567/ultrapower
|
|
83
|
+
- GitHub Releases: https://github.com/liangjie559567/ultrapower/releases
|
|
84
|
+
- 问题报告: https://github.com/liangjie559567/ultrapower/issues
|
package/docs/standards/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
> **最后更新**: 2026-03-02
|
|
6
6
|
> **真理之源**: `docs/standards/audit-report.md`
|
|
7
7
|
|
|
8
|
-
ultrapower v5.5.
|
|
8
|
+
ultrapower v5.5.40 具备 49 个 agents、70 个 skills、35 个 hooks 的完整体系。本规范体系从现有代码反向提取,覆盖运行时防护、Hook 执行顺序、状态机、Agent 生命周期、用户使用指南和贡献规范,使 ultrapower 从"能用"升级为"可靠、易用、可扩展"。
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liangjie559567/ultrapower",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.41",
|
|
4
4
|
"description": "Disciplined multi-agent orchestration: workflow enforcement + parallel execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"sync-metadata:verify": "tsx scripts/sync-metadata.ts --verify",
|
|
58
58
|
"sync-metadata:dry-run": "tsx scripts/sync-metadata.ts --dry-run",
|
|
59
59
|
"prepare": "npm run build",
|
|
60
|
-
"prepublishOnly": "npm run build && npm run compose-docs",
|
|
60
|
+
"prepublishOnly": "npm run build && npm run compose-docs && npm run sync:marketplace",
|
|
61
61
|
"postinstall": "node scripts/plugin-setup.mjs",
|
|
62
62
|
"release:local": "node scripts/release-local.mjs",
|
|
63
63
|
"release:dry-run": "node scripts/release-local.mjs --dry-run",
|
|
@@ -65,10 +65,15 @@
|
|
|
65
65
|
"validate:versions": "node scripts/validate-versions.mjs",
|
|
66
66
|
"sync:version": "node scripts/sync-version.mjs",
|
|
67
67
|
"sync:version:dry": "node scripts/sync-version.mjs --dry-run",
|
|
68
|
+
"sync:marketplace": "node scripts/sync-marketplace.mjs",
|
|
69
|
+
"changeset": "changeset",
|
|
70
|
+
"version": "changeset version && npm run sync:version && npm run sync:marketplace",
|
|
71
|
+
"release": "npm run build && npm test && changeset publish",
|
|
68
72
|
"validate:counts": "node scripts/validate-counts.mjs",
|
|
69
73
|
"validate:counts:fix": "node scripts/validate-counts.mjs --fix",
|
|
70
74
|
"check:links": "node scripts/check-links.mjs",
|
|
71
|
-
"check:links:fix": "node scripts/check-links.mjs --fix"
|
|
75
|
+
"check:links:fix": "node scripts/check-links.mjs --fix",
|
|
76
|
+
"validate:plugins": "node scripts/validate-plugin-configs.mjs"
|
|
72
77
|
},
|
|
73
78
|
"dependencies": {
|
|
74
79
|
"@anthropic-ai/claude-agent-sdk": "^0.1.0",
|
|
@@ -87,6 +92,7 @@
|
|
|
87
92
|
"zod": "^3.23.8"
|
|
88
93
|
},
|
|
89
94
|
"devDependencies": {
|
|
95
|
+
"@changesets/cli": "^2.30.0",
|
|
90
96
|
"@eslint/js": "^9.39.2",
|
|
91
97
|
"@types/node": "^22.19.7",
|
|
92
98
|
"@types/ws": "^8.18.1",
|
|
@@ -29,7 +29,7 @@ export async function preflight(opts = {}) {
|
|
|
29
29
|
export async function validateBuild(opts = {}) {
|
|
30
30
|
const { skipTests = false, dryRun = false } = opts;
|
|
31
31
|
try {
|
|
32
|
-
run('tsc --noEmit', dryRun);
|
|
32
|
+
run('npx tsc --noEmit', dryRun);
|
|
33
33
|
run('npm run build', dryRun);
|
|
34
34
|
if (!skipTests) run('npm run test:run', dryRun);
|
|
35
35
|
return { success: true, output: 'Build validation passed' };
|
|
@@ -39,10 +39,11 @@ export async function validateBuild(opts = {}) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export async function publishNpm(opts = {}) {
|
|
42
|
-
const { dryRun = false, tag = 'latest' } = opts;
|
|
42
|
+
const { dryRun = false, tag = 'latest', provenance = true } = opts;
|
|
43
43
|
const version = getVersion();
|
|
44
44
|
try {
|
|
45
|
-
|
|
45
|
+
const provenanceFlag = provenance && process.env.GITHUB_ACTIONS ? '--provenance' : '';
|
|
46
|
+
run(`npm publish --access public --tag ${tag} ${provenanceFlag}`.trim(), dryRun);
|
|
46
47
|
return { success: true, version };
|
|
47
48
|
} catch (err) {
|
|
48
49
|
return { success: false, version, output: err.message };
|
|
@@ -78,6 +79,17 @@ export async function syncMarketplace(opts = {}) {
|
|
|
78
79
|
if (p.source?.version !== version) { p.source.version = version; changed = true; }
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
if (!changed) {
|
|
83
|
+
console.log('syncMarketplace: versions already in sync');
|
|
84
|
+
return { success: true };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (dryRun) {
|
|
88
|
+
console.log('[dry-run] Would update marketplace.json and plugin.json');
|
|
89
|
+
console.log('[dry-run] Would commit and push to dev');
|
|
90
|
+
return { success: true };
|
|
91
|
+
}
|
|
92
|
+
|
|
81
93
|
// Sync plugin.json
|
|
82
94
|
const pluginPath = resolve('.claude-plugin/plugin.json');
|
|
83
95
|
const plugin = JSON.parse(readFileSync(pluginPath, 'utf-8'));
|
|
@@ -93,9 +105,9 @@ export async function syncMarketplace(opts = {}) {
|
|
|
93
105
|
|
|
94
106
|
writeFileSync(marketplacePath, JSON.stringify(market, null, 2) + '\n');
|
|
95
107
|
writeFileSync(pluginPath, JSON.stringify(plugin, null, 2) + '\n');
|
|
96
|
-
run(`git add .claude-plugin/marketplace.json .claude-plugin/plugin.json`, dryRun);
|
|
97
108
|
|
|
98
109
|
try {
|
|
110
|
+
run(`git add .claude-plugin/marketplace.json .claude-plugin/plugin.json`, dryRun);
|
|
99
111
|
run(`git commit -m "chore: sync marketplace.json to v${version}"`, dryRun);
|
|
100
112
|
run(`git push origin HEAD:dev`, dryRun);
|
|
101
113
|
console.log(`syncMarketplace: updated to v${version} and pushed to dev`);
|
|
@@ -143,7 +155,12 @@ if (cliStep && ['preflight', 'validate', 'publish', 'release', 'sync'].includes(
|
|
|
143
155
|
const dryRun = process.argv.includes('--dry-run');
|
|
144
156
|
const version = process.env.GITHUB_REF_NAME?.replace(/^v/, '') || undefined;
|
|
145
157
|
const stepMap = { preflight, validate: validateBuild, publish: publishNpm, release: createGithubRelease, sync: syncMarketplace };
|
|
146
|
-
stepMap[cliStep]({ dryRun, version })
|
|
147
|
-
|
|
148
|
-
|
|
158
|
+
stepMap[cliStep]({ dryRun, version })
|
|
159
|
+
.then(r => {
|
|
160
|
+
if (!r.success) { console.error(`Step ${cliStep} failed: ${r.output ?? ''}`); process.exit(1); }
|
|
161
|
+
})
|
|
162
|
+
.catch(err => {
|
|
163
|
+
console.error(`Step ${cliStep} threw exception: ${err.message}`);
|
|
164
|
+
process.exit(1);
|
|
165
|
+
});
|
|
149
166
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
3
|
+
|
|
4
|
+
const pkg = JSON.parse(readFileSync('package.json', 'utf8'));
|
|
5
|
+
const marketplace = JSON.parse(readFileSync('.claude-plugin/marketplace.json', 'utf8'));
|
|
6
|
+
const plugin = JSON.parse(readFileSync('.claude-plugin/plugin.json', 'utf8'));
|
|
7
|
+
|
|
8
|
+
// 同步版本号
|
|
9
|
+
marketplace.plugins[0].version = pkg.version;
|
|
10
|
+
plugin.version = pkg.version;
|
|
11
|
+
|
|
12
|
+
writeFileSync('.claude-plugin/marketplace.json', JSON.stringify(marketplace, null, 2) + '\n');
|
|
13
|
+
writeFileSync('.claude-plugin/plugin.json', JSON.stringify(plugin, null, 2) + '\n');
|
|
14
|
+
|
|
15
|
+
console.log(`✅ Marketplace & plugin version synced to ${pkg.version}`);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Validate plugin.json files for completeness and consistency
|
|
3
|
+
import { readFileSync } from 'fs';
|
|
4
|
+
import { resolve } from 'path';
|
|
5
|
+
|
|
6
|
+
const REQUIRED_FIELDS = ['name', 'version', 'statusline'];
|
|
7
|
+
const PLUGIN_FILES = [
|
|
8
|
+
'.claude-plugin/plugin.json',
|
|
9
|
+
'.cursor-plugin/plugin.json'
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
let hasErrors = false;
|
|
13
|
+
|
|
14
|
+
// Read package.json version
|
|
15
|
+
const pkg = JSON.parse(readFileSync('package.json', 'utf-8'));
|
|
16
|
+
const expectedVersion = pkg.version;
|
|
17
|
+
|
|
18
|
+
console.log(`Validating plugin configs against version ${expectedVersion}\n`);
|
|
19
|
+
|
|
20
|
+
for (const file of PLUGIN_FILES) {
|
|
21
|
+
try {
|
|
22
|
+
const config = JSON.parse(readFileSync(resolve(file), 'utf-8'));
|
|
23
|
+
|
|
24
|
+
// Check required fields
|
|
25
|
+
for (const field of REQUIRED_FIELDS) {
|
|
26
|
+
if (!config[field]) {
|
|
27
|
+
console.error(`❌ ${file}: Missing required field "${field}"`);
|
|
28
|
+
hasErrors = true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Check version consistency
|
|
33
|
+
if (config.version !== expectedVersion) {
|
|
34
|
+
console.error(`❌ ${file}: Version mismatch (${config.version} !== ${expectedVersion})`);
|
|
35
|
+
hasErrors = true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Check statusline config
|
|
39
|
+
if (config.statusline && (!config.statusline.command || !config.statusline.args)) {
|
|
40
|
+
console.error(`❌ ${file}: Invalid statusline config`);
|
|
41
|
+
hasErrors = true;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!hasErrors) {
|
|
45
|
+
console.log(`✓ ${file}`);
|
|
46
|
+
}
|
|
47
|
+
} catch (err) {
|
|
48
|
+
console.error(`❌ ${file}: ${err.message}`);
|
|
49
|
+
hasErrors = true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (hasErrors) {
|
|
54
|
+
console.error('\n❌ Plugin config validation failed');
|
|
55
|
+
process.exit(1);
|
|
56
|
+
} else {
|
|
57
|
+
console.log('\n✅ All plugin configs valid');
|
|
58
|
+
}
|