@zjex/git-workflow 0.5.0 → 0.5.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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/scripts/release.sh +18 -11
- package/scripts/update-version-badge.js +43 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v0.5.0](https://github.com/iamzjt-front-end/git-workflow/compare/v0.4.7...v0.5.0) (2026-02-06)
|
|
4
|
+
|
|
5
|
+
- 🔖 chore(release): 发布 v0.5.0 ([51c5740](https://github.com/iamzjt-front-end/git-workflow/commit/51c5740))
|
|
6
|
+
- docs(readme): Add AI code review command example and update command list ([7e4ab78](https://github.com/iamzjt-front-end/git-workflow/commit/7e4ab78))
|
|
7
|
+
- 📝 docs: 自动更新测试数量徽章 [skip ci] ([bba208d](https://github.com/iamzjt-front-end/git-workflow/commit/bba208d))
|
|
8
|
+
- feat(review): Add AI code review command and documentation ([3f7b3b2](https://github.com/iamzjt-front-end/git-workflow/commit/3f7b3b2))
|
|
9
|
+
|
|
3
10
|
## [v0.4.7](https://github.com/iamzjt-front-end/git-workflow/compare/v0.4.6...v0.4.7) (2026-01-21)
|
|
4
11
|
|
|
5
12
|
- 🔖 chore(release): 发布 v0.4.7 ([61ae098](https://github.com/iamzjt-front-end/git-workflow/commit/61ae098))
|
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -4210,7 +4210,7 @@ process.on("SIGTERM", () => {
|
|
|
4210
4210
|
console.log("");
|
|
4211
4211
|
process.exit(0);
|
|
4212
4212
|
});
|
|
4213
|
-
var version = true ? "0.5.
|
|
4213
|
+
var version = true ? "0.5.1" : "0.0.0-dev";
|
|
4214
4214
|
async function mainMenu() {
|
|
4215
4215
|
console.log(
|
|
4216
4216
|
colors.green(`
|
package/package.json
CHANGED
package/scripts/release.sh
CHANGED
|
@@ -327,6 +327,20 @@ if check_tag_exists "$NEW_VERSION"; then
|
|
|
327
327
|
exit 1
|
|
328
328
|
fi
|
|
329
329
|
|
|
330
|
+
# 生成 changelog(在测试之前,这样可以包含在提交中)
|
|
331
|
+
print_step "生成 CHANGELOG..."
|
|
332
|
+
if [[ "$DRY_RUN" == false ]]; then
|
|
333
|
+
npm run changelog
|
|
334
|
+
fi
|
|
335
|
+
print_success "CHANGELOG 已更新"
|
|
336
|
+
|
|
337
|
+
# 更新 README 中的版本号
|
|
338
|
+
print_step "更新 README 版本号..."
|
|
339
|
+
if [[ "$DRY_RUN" == false ]]; then
|
|
340
|
+
node scripts/update-version-badge.js "$NEW_VERSION"
|
|
341
|
+
fi
|
|
342
|
+
print_success "README 版本号已更新"
|
|
343
|
+
|
|
330
344
|
# 运行测试(如果有)
|
|
331
345
|
if grep -q '"test"' package.json; then
|
|
332
346
|
print_step "运行测试..."
|
|
@@ -357,13 +371,6 @@ if [[ "$DRY_RUN" == false ]]; then
|
|
|
357
371
|
print_success "构建产物验证通过"
|
|
358
372
|
fi
|
|
359
373
|
|
|
360
|
-
# 生成 changelog
|
|
361
|
-
print_step "生成 CHANGELOG..."
|
|
362
|
-
if [[ "$DRY_RUN" == false ]]; then
|
|
363
|
-
npm run changelog
|
|
364
|
-
fi
|
|
365
|
-
print_success "CHANGELOG 已更新"
|
|
366
|
-
|
|
367
374
|
# 预览 changelog
|
|
368
375
|
if [[ "$DRY_RUN" == false ]]; then
|
|
369
376
|
echo ""
|
|
@@ -388,8 +395,8 @@ if [[ "$DRY_RUN" == true ]]; then
|
|
|
388
395
|
echo ""
|
|
389
396
|
print_success "Dry-run 完成!以下是将要执行的操作:"
|
|
390
397
|
echo ""
|
|
391
|
-
echo " 1. 提交更改: package.json, package-lock.json, CHANGELOG.md"
|
|
392
|
-
echo " 2. Commit 信息: 🔖 chore(release): v${NEW_VERSION}"
|
|
398
|
+
echo " 1. 提交更改: package.json, package-lock.json, CHANGELOG.md, README.md"
|
|
399
|
+
echo " 2. Commit 信息: 🔖 chore(release): 发布 v${NEW_VERSION}"
|
|
393
400
|
echo " 3. 创建 tag: v${NEW_VERSION}"
|
|
394
401
|
echo " 4. 推送到 GitHub: ${CURRENT_BRANCH} + v${NEW_VERSION}"
|
|
395
402
|
echo " 5. 发布到 npm: @zjex/git-workflow@${NEW_VERSION}"
|
|
@@ -410,8 +417,8 @@ fi
|
|
|
410
417
|
|
|
411
418
|
# 提交更改
|
|
412
419
|
print_step "提交更改..."
|
|
413
|
-
git add package.json package-lock.json CHANGELOG.md
|
|
414
|
-
git commit -m "🔖 chore(release): v${NEW_VERSION}"
|
|
420
|
+
git add package.json package-lock.json CHANGELOG.md README.md
|
|
421
|
+
git commit -m "🔖 chore(release): 发布 v${NEW_VERSION}"
|
|
415
422
|
print_success "更改已提交"
|
|
416
423
|
|
|
417
424
|
# 创建 tag
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 更新 README 中的版本号显示
|
|
5
|
+
* 用于发布时同步更新示例中的版本号
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
9
|
+
|
|
10
|
+
const version = process.argv[2];
|
|
11
|
+
|
|
12
|
+
if (!version) {
|
|
13
|
+
console.error('❌ 请提供版本号参数');
|
|
14
|
+
console.error('用法: node scripts/update-version-badge.js 0.5.0');
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const readmePath = 'README.md';
|
|
20
|
+
let content = readFileSync(readmePath, 'utf8');
|
|
21
|
+
|
|
22
|
+
// 更新示例中的版本号 (git-workflow v0.x.x)
|
|
23
|
+
const versionRegex = /git-workflow v\d+\.\d+\.\d+/g;
|
|
24
|
+
const newVersion = `git-workflow v${version}`;
|
|
25
|
+
|
|
26
|
+
if (content.match(versionRegex)) {
|
|
27
|
+
const oldContent = content;
|
|
28
|
+
content = content.replace(versionRegex, newVersion);
|
|
29
|
+
|
|
30
|
+
if (oldContent !== content) {
|
|
31
|
+
writeFileSync(readmePath, content);
|
|
32
|
+
console.log(`✅ README 版本号已更新为 v${version}`);
|
|
33
|
+
} else {
|
|
34
|
+
console.log(`ℹ️ 版本号无变化,保持 v${version}`);
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
console.log('⚠️ 未找到版本号模式,跳过更新');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error('❌ 更新版本号失败:', error.message);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|