@vitarx/release-cli 1.0.5 → 1.0.7

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.
Files changed (2) hide show
  1. package/dist/release.js +3 -1
  2. package/package.json +1 -1
package/dist/release.js CHANGED
@@ -134,6 +134,7 @@ async function publishPackage(pkgDir, packageManager, isDryRun = false, args, la
134
134
  const confirm = await prompt(`是否确认发布 ${pkg.name}@${newVersion}? (y/N) `);
135
135
  if (confirm && confirm.toLowerCase() !== 'y') {
136
136
  log.warn('已取消发布');
137
+ rollbackChanges(undefined, isDryRun, lastCommitHash);
137
138
  process.exit(0);
138
139
  }
139
140
  // -------------------- Step 4: 构建和测试项目 --------------------
@@ -174,6 +175,7 @@ async function publishPackage(pkgDir, packageManager, isDryRun = false, args, la
174
175
  const confirm = await prompt(chalk.yellow('⚠️ 生成 changelog 失败,要继续发布流程吗? (y/N) '));
175
176
  if (confirm.toLowerCase() !== 'y') {
176
177
  log.warn('已取消发布');
178
+ rollbackChanges(undefined, isDryRun, lastCommitHash);
177
179
  process.exit(0);
178
180
  }
179
181
  }
@@ -181,7 +183,7 @@ async function publishPackage(pkgDir, packageManager, isDryRun = false, args, la
181
183
  // -------------------- Step 6: 提交更改到 git --------------------
182
184
  log.info(`📤 Committing changes...`);
183
185
  runCommand(`git add ${pkgPath}${isRootPackage ? ` ${args.changelogInfile || 'CHANGELOG.md'}` : ''}`, isDryRun);
184
- runCommand(`git commit -m "build(${pkg.name}): release ${args.changelogTagPrefix + newVersion}"`, isDryRun);
186
+ runCommand(`git commit -m "release(${pkg.name}): release ${args.changelogTagPrefix + newVersion}"`, isDryRun);
185
187
  if (isRootPackage) {
186
188
  log.info(`🏷 Tagging: ${args.changelogTagPrefix + newVersion}`);
187
189
  runCommand(`git tag -a ${args.changelogTagPrefix + newVersion} -m "Release ${newVersion}"`, isDryRun);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitarx/release-cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "A CLI tool for automated npm package release with workspace support",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",