azure-pr-manager 1.0.0 → 1.0.2

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 +43 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azure-pr-manager",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
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
@@ -13,14 +13,16 @@ const program = new Command();
13
13
  program
14
14
  .name("azure-pr")
15
15
  .description("CLI para criar Pull Requests no Azure DevOps automaticamente")
16
- .version("1.0.0");
16
+ .version("1.0.2")
17
+ .addHelpText("after", "\n Desenvolvido por Higor Santos");
17
18
 
18
19
  // ==================== INIT ====================
19
20
  program
20
21
  .command("init")
21
22
  .description("Inicializa a configuracao do projeto (.prmanager.json)")
22
23
  .action(async () => {
23
- console.log(chalk.cyan("\n Azure PR Manager - Configuracao\n"));
24
+ console.log(chalk.cyan("\n Azure PR Manager - Configuracao"));
25
+ console.log(chalk.gray(" Desenvolvido por ") + chalk.white("Higor Santos\n"));
24
26
 
25
27
  const existing = await loadConfig();
26
28
  const defaults = existing || getDefaultConfig();
@@ -66,7 +68,8 @@ program
66
68
  console.log(chalk.gray(" │") + chalk.white(" Como criar o Personal Access Token (PAT):"));
67
69
  console.log(chalk.gray(" │"));
68
70
  console.log(chalk.gray(" │") + " 1. Acesse " + chalk.cyan("dev.azure.com") + " e faca login");
69
- console.log(chalk.gray(" │") + " 2. Clique no seu avatar (canto superior direito)");
71
+ console.log(chalk.gray(" │") + " 2. No canto superior direito, clique em " + chalk.white("User Settings"));
72
+ console.log(chalk.gray(" │") + " (icone de engrenagem ao lado do seu avatar)");
70
73
  console.log(chalk.gray(" │") + " 3. Selecione " + chalk.white("Personal access tokens"));
71
74
  console.log(chalk.gray(" │") + " 4. Clique em " + chalk.white("+ New Token"));
72
75
  console.log(chalk.gray(" │") + " 5. De um nome, ex: " + chalk.yellow("\"PR Manager CLI\""));
@@ -75,7 +78,7 @@ program
75
78
  console.log(chalk.gray(" │") + chalk.green(" ✓ Code > Read & Write"));
76
79
  console.log(chalk.gray(" │") + chalk.green(" ✓ Identity > Read"));
77
80
  console.log(chalk.gray(" │") + chalk.green(" ✓ Member Entitlement Management > Read"));
78
- console.log(chalk.gray(" │") + " 8. Clique em Create e copie o token gerado");
81
+ console.log(chalk.gray(" │") + " 8. Clique em " + chalk.white("Create") + " e copie o token gerado");
79
82
  console.log(chalk.gray(" │"));
80
83
  console.log(chalk.gray(" │") + chalk.red(" O token so aparece uma vez! Salve em lugar seguro."));
81
84
  console.log(chalk.gray(" └─────────────────────────────────────────────────────\n"));
@@ -283,7 +286,8 @@ program
283
286
  process.exit(1);
284
287
  }
285
288
 
286
- console.log(chalk.cyan("\n Azure PR Manager - Criar Pull Request\n"));
289
+ console.log(chalk.cyan("\n Azure PR Manager - Criar Pull Request"));
290
+ console.log(chalk.gray(" Desenvolvido por ") + chalk.white("Higor Santos\n"));
287
291
 
288
292
  // ── ETAPA 1: Verificar repositorio git ──
289
293
  if (!git.isGitRepo()) {
@@ -604,24 +608,48 @@ program
604
608
  )
605
609
  );
606
610
 
611
+ // Detectar default inteligente
612
+ const defaultTarget = targetChoices.includes("main")
613
+ ? "main"
614
+ : targetChoices.includes("master")
615
+ ? "master"
616
+ : targetChoices.includes("develop")
617
+ ? "develop"
618
+ : undefined;
619
+
620
+ const listChoices = [
621
+ ...targetChoices,
622
+ new inquirer.Separator("─────────────────────────────"),
623
+ { name: chalk.yellow("Digitar outro nome de branch..."), value: "_type" },
624
+ ];
625
+
607
626
  const { target } = await inquirer.prompt([
608
627
  {
609
628
  type: "list",
610
629
  name: "target",
611
- message: "Branch de destino (target):",
612
- choices: targetChoices,
613
- default: targetChoices.includes("main")
614
- ? "main"
615
- : targetChoices.includes("master")
616
- ? "master"
617
- : targetChoices.includes("develop")
618
- ? "develop"
619
- : undefined,
630
+ message: "Branch de destino (selecione ou escolha digitar):",
631
+ choices: listChoices,
632
+ default: defaultTarget,
620
633
  loop: false,
621
634
  pageSize: 15,
622
635
  },
623
636
  ]);
624
- targetBranch = target;
637
+
638
+ if (target === "_type") {
639
+ const { typedTarget } = await inquirer.prompt([
640
+ {
641
+ type: "input",
642
+ name: "typedTarget",
643
+ message: "Digite o nome da branch de destino:",
644
+ default: defaultTarget,
645
+ validate: (v) =>
646
+ v.trim() ? true : "O nome da branch e obrigatorio",
647
+ },
648
+ ]);
649
+ targetBranch = typedTarget.trim();
650
+ } else {
651
+ targetBranch = target;
652
+ }
625
653
  }
626
654
 
627
655
  // Titulo