azure-pr-manager 2.0.5 → 2.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +22 -37
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azure-pr-manager",
3
- "version": "2.0.5",
3
+ "version": "2.1.1",
4
4
  "description": "CLI para criar Pull Requests no Azure DevOps automaticamente, com fluxo git completo (commit, push, publish branch)",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -54,7 +54,7 @@ function showBanner(subtitle) {
54
54
 
55
55
  console.log(c(" ║") + EMPTY + c("║"));
56
56
  console.log(c(" ║") + centerText(chalk.gray("Azure DevOps Pull Request Automation")) + c("║"));
57
- console.log(c(" ║") + centerText(chalk.gray("v2.0.5 — Desenvolvido por ") + chalk.white("Higor Santos")) + c("║"));
57
+ console.log(c(" ║") + centerText(chalk.gray("v2.1.1 — Desenvolvido por ") + chalk.white("Higor Santos")) + c("║"));
58
58
  console.log(c(" ║") + EMPTY + c("║"));
59
59
 
60
60
  if (subtitle) {
@@ -71,7 +71,7 @@ const program = new Command();
71
71
  program
72
72
  .name("azure-pr")
73
73
  .description("CLI para criar Pull Requests no Azure DevOps automaticamente")
74
- .version("2.0.5")
74
+ .version("2.1.1")
75
75
  .addHelpText("after", "\n Desenvolvido por Higor Santos");
76
76
 
77
77
  // ==================== INIT ====================
@@ -843,47 +843,32 @@ program
843
843
  }
844
844
 
845
845
  // Confirmacao
846
- console.log(chalk.cyan("\n ╔═══════════════════════════════════════════"));
847
- console.log(chalk.cyan("") + chalk.white(" Resumo do PR"));
848
- console.log(chalk.cyan(" ╠═══════════════════════════════════════════"));
849
- console.log(
850
- chalk.cyan(" ") +
851
- ` ${chalk.gray("Source:")} ${chalk.green(sourceBranch)}`
852
- );
853
- console.log(
854
- chalk.cyan("") +
855
- ` ${chalk.gray("Target:")} ${chalk.yellow(targetBranch)}`
856
- );
857
- console.log(
858
- chalk.cyan(" ║") + ` ${chalk.gray("Titulo:")} ${title}`
859
- );
846
+ const BOX_W = 60;
847
+ const boxLine = "".repeat(BOX_W);
848
+ const bx = (text) => chalk.cyan(" ") + " " + text;
849
+
850
+ console.log(chalk.cyan("\n " + boxLine + "╗"));
851
+ console.log(chalk.cyan(" ║") + chalk.white(" Resumo do PR") + " ".repeat(BOX_W - 14) + chalk.cyan("║"));
852
+ console.log(chalk.cyan(" ╠" + boxLine + "╣"));
853
+ console.log(bx(`${chalk.gray("Source:")} ${chalk.green(sourceBranch)}`));
854
+ console.log(bx(`${chalk.gray("Target:")} ${chalk.yellow(targetBranch)}`));
855
+ console.log(bx(`${chalk.gray("Titulo:")} ${title}`));
860
856
  if (description) {
861
- console.log(
862
- chalk.cyan("") +
863
- ` ${chalk.gray("Descricao:")} ${description.substring(0, 50)}${description.length > 50 ? "..." : ""}`
864
- );
857
+ const descLines = description.split("\n").filter((l) => l.trim());
858
+ console.log(bx(`${chalk.gray("Descricao:")}`));
859
+ descLines.forEach((line) => {
860
+ console.log(bx(` ${chalk.gray(line)}`));
861
+ });
865
862
  }
866
- console.log(
867
- chalk.cyan("") +
868
- ` ${chalk.gray("Draft:")} ${isDraft ? "Sim" : "Nao"}`
869
- );
870
- console.log(
871
- chalk.cyan(" ║") +
872
- ` ${chalk.gray("Auto-complete:")} ${autoComplete ? "Sim" : "Nao"}`
873
- );
863
+ console.log(bx(`${chalk.gray("Draft:")} ${isDraft ? "Sim" : "Nao"}`));
864
+ console.log(bx(`${chalk.gray("Auto-complete:")} ${autoComplete ? "Sim" : "Nao"}`));
874
865
  if (resolvedRequired.length > 0) {
875
- console.log(
876
- chalk.cyan(" ║") +
877
- ` ${chalk.gray("Required:")} ${resolvedRequired.map((r) => r.displayName).join(", ")}`
878
- );
866
+ console.log(bx(`${chalk.gray("Required:")} ${resolvedRequired.map((r) => r.displayName).join(", ")}`));
879
867
  }
880
868
  if (resolvedOptional.length > 0) {
881
- console.log(
882
- chalk.cyan(" ║") +
883
- ` ${chalk.gray("Optional:")} ${resolvedOptional.map((r) => r.displayName).join(", ")}`
884
- );
869
+ console.log(bx(`${chalk.gray("Optional:")} ${resolvedOptional.map((r) => r.displayName).join(", ")}`));
885
870
  }
886
- console.log(chalk.cyan(" ╚═══════════════════════════════════════════\n"));
871
+ console.log(chalk.cyan(" ╚" + boxLine + "╝\n"));
887
872
 
888
873
  const { confirm } = await inquirer.prompt([
889
874
  {