trello-cli-unofficial 0.9.0 → 0.9.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/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  [![CI/CD](https://img.shields.io/github/actions/workflow/status/JaegerCaiser/trello-cli-unofficial/ci.yml?branch=main&label=CI)](https://github.com/JaegerCaiser/trello-cli-unofficial/actions)
9
9
  [![Release](https://img.shields.io/github/actions/workflow/status/JaegerCaiser/trello-cli-unofficial/release.yml?branch=main&label=Release)](https://github.com/JaegerCaiser/trello-cli-unofficial/actions)
10
10
 
11
- An unofficial Trello CLI using Power-Up authentication, built with Bun for maximum performance. Features automated CI/CD with semantic versioning and NPM publishing.
11
+ An unofficial Trello CLI using Power-Up authentication, built with Bun for maximum performance. Features automated dependency management with Bun installation during setup.
12
12
 
13
13
  ## 🚀 Features
14
14
 
@@ -30,23 +30,22 @@ An unofficial Trello CLI using Power-Up authentication, built with Bun for maxim
30
30
  ### Prerequisites
31
31
 
32
32
  - **[Node.js 16+](https://nodejs.org/) (Required)**
33
- - **[Bun](https://bun.sh/) (Optional, for better performance)**
33
+ - **[Bun](https://bun.sh/) (Required - será instalado automaticamente se não estiver presente)**
34
34
  - Trello account with Power-Up enabled
35
35
  - **Supported Platforms:** Linux, macOS, Windows
36
36
 
37
37
  ### NPM Installation (Recommended)
38
38
 
39
- The CLI works with both Bun and Node.js. Choose the package manager you prefer:
39
+ O instalador verifica automaticamente se o Bun está presente no sistema. Se não estiver, perguntará se deseja instalá-lo.
40
40
 
41
41
  ```bash
42
- # Option 1: Using NPM (works with both Bun and Node.js)
42
+ # Installation with automatic Bun setup
43
43
  npm install -g trello-cli-unofficial
44
44
 
45
- # Option 2: Using Bun (recommended for better performance)
45
+ # Or with other package managers
46
46
  bun add -g trello-cli-unofficial
47
-
48
- # Option 3: Using Yarn
49
47
  yarn global add trello-cli-unofficial
48
+ ```
50
49
 
51
50
  # Option 4: Using PNPM
52
51
  pnpm add -g trello-cli-unofficial
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trello-cli-unofficial",
3
3
  "type": "module",
4
- "version": "0.9.0",
4
+ "version": "0.9.1",
5
5
  "private": false,
6
6
  "description": "Unofficial Trello CLI using Power-Up authentication, built with Bun for maximum performance",
7
7
  "author": "Matheus Caiser <matheus.kaiser@gmail.com> (https://www.mrdeveloper.com.br/)",
@@ -69,7 +69,8 @@
69
69
  "version:patch": "bun version patch && git push --follow-tags",
70
70
  "version:minor": "bun version minor && git push --follow-tags",
71
71
  "version:major": "bun version major && git push --follow-tags",
72
- "prepublishOnly": "bun run validate && bun run build"
72
+ "prepublishOnly": "bun run validate && bun run build",
73
+ "postinstall": "./scripts/check-dependencies.sh"
73
74
  },
74
75
  "peerDependencies": {
75
76
  "typescript": "^5"
@@ -0,0 +1,99 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # Detect language from environment or system locale
5
+ detect_language() {
6
+ # Check for explicit LANG env var
7
+ if [[ "${LANG:-}" == *"pt"* ]] || [[ "${LANGUAGE:-}" == *"pt"* ]]; then
8
+ echo "pt"
9
+ elif [[ "${LC_ALL:-}" == *"pt"* ]] || [[ "${LC_MESSAGES:-}" == *"pt"* ]]; then
10
+ echo "pt"
11
+ else
12
+ echo "en"
13
+ fi
14
+ }
15
+
16
+ LANG=$(detect_language)
17
+
18
+ # Messages in both languages
19
+ if [[ "$LANG" == "pt" ]]; then
20
+ MSG_CHECKING="🔍 Verificando dependências do Trello CLI Unofficial..."
21
+ MSG_BUN_FOUND="✅ Bun encontrado:"
22
+ MSG_BUN_NOT_FOUND="❌ Bun NÃO encontrado!"
23
+ MSG_BUN_REQUIRED="📦 O Trello CLI Unofficial requer Bun para funcionar corretamente."
24
+ MSG_BUN_BENEFIT=" Bun oferece performance 10-50x superior ao Node.js para este projeto."
25
+ MSG_INSTALL_PROMPT="🔧 Deseja instalar o Bun agora? (Y/n): "
26
+ MSG_INSTALLING="🚀 Instalando Bun..."
27
+ MSG_INSTALL_SUCCESS="✅ Bun instalado com sucesso!"
28
+ MSG_VERSION=" Versão:"
29
+ MSG_INSTALL_FAILED="❌ Falha ao instalar Bun. Verifique sua conexão e tente novamente."
30
+ MSG_CANCELLED="❌ Instalação cancelada."
31
+ MSG_MANUAL_INSTALL="💡 Para instalar manualmente:"
32
+ MSG_MANUAL_COMMAND=" curl -fsSL https://bun.sh/install | bash"
33
+ MSG_RETRY="🔄 Depois execute: npm install -g trello-cli-unofficial"
34
+ MSG_SUCCESS="🎉 Todas as dependências verificadas com sucesso!"
35
+ else
36
+ MSG_CHECKING="🔍 Checking Trello CLI Unofficial dependencies..."
37
+ MSG_BUN_FOUND="✅ Bun found:"
38
+ MSG_BUN_NOT_FOUND="❌ Bun NOT found!"
39
+ MSG_BUN_REQUIRED="📦 Trello CLI Unofficial requires Bun to work correctly."
40
+ MSG_BUN_BENEFIT=" Bun offers 10-50x better performance than Node.js for this project."
41
+ MSG_INSTALL_PROMPT="🔧 Do you want to install Bun now? (Y/n): "
42
+ MSG_INSTALLING="🚀 Installing Bun..."
43
+ MSG_INSTALL_SUCCESS="✅ Bun installed successfully!"
44
+ MSG_VERSION=" Version:"
45
+ MSG_INSTALL_FAILED="❌ Failed to install Bun. Check your connection and try again."
46
+ MSG_CANCELLED="❌ Installation cancelled."
47
+ MSG_MANUAL_INSTALL="💡 To install manually:"
48
+ MSG_MANUAL_COMMAND=" curl -fsSL https://bun.sh/install | bash"
49
+ MSG_RETRY="🔄 Then run: npm install -g trello-cli-unofficial"
50
+ MSG_SUCCESS="🎉 All dependencies checked successfully!"
51
+ fi
52
+
53
+ echo "$MSG_CHECKING"
54
+ echo ""
55
+
56
+ # Check if Bun is installed
57
+ if command -v bun &> /dev/null; then
58
+ echo "$MSG_BUN_FOUND $(bun --version)"
59
+ else
60
+ echo "$MSG_BUN_NOT_FOUND"
61
+ echo ""
62
+ echo "$MSG_BUN_REQUIRED"
63
+ echo "$MSG_BUN_BENEFIT"
64
+ echo ""
65
+
66
+ # Read user input with timeout and default
67
+ read -p "$MSG_INSTALL_PROMPT" -n 1 -r -t 30 REPLY || REPLY="y"
68
+ echo ""
69
+
70
+ if [[ $REPLY =~ ^[Yy]$ ]] || [[ -z $REPLY ]]; then
71
+ echo "$MSG_INSTALLING"
72
+ if curl -fsSL https://bun.sh/install | bash; then
73
+ # Add Bun to PATH for current session
74
+ export PATH="$HOME/.bun/bin:$PATH"
75
+
76
+ if command -v bun &> /dev/null; then
77
+ echo "$MSG_INSTALL_SUCCESS"
78
+ echo "$MSG_VERSION $(bun --version)"
79
+ else
80
+ echo "$MSG_INSTALL_FAILED"
81
+ exit 1
82
+ fi
83
+ else
84
+ echo "$MSG_INSTALL_FAILED"
85
+ exit 1
86
+ fi
87
+ else
88
+ echo "$MSG_CANCELLED"
89
+ echo ""
90
+ echo "$MSG_MANUAL_INSTALL"
91
+ echo "$MSG_MANUAL_COMMAND"
92
+ echo ""
93
+ echo "$MSG_RETRY"
94
+ exit 1
95
+ fi
96
+ fi
97
+
98
+ echo ""
99
+ echo "$MSG_SUCCESS"