trello-cli-unofficial 0.8.1 → 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
 
@@ -29,25 +29,23 @@ An unofficial Trello CLI using Power-Up authentication, built with Bun for maxim
29
29
 
30
30
  ### Prerequisites
31
31
 
32
- - **[Bun](https://bun.sh/) (Recommended)** or **Node.js 16+** installed
32
+ - **[Node.js 16+](https://nodejs.org/) (Required)**
33
+ - **[Bun](https://bun.sh/) (Required - será instalado automaticamente se não estiver presente)**
33
34
  - Trello account with Power-Up enabled
34
35
  - **Supported Platforms:** Linux, macOS, Windows
35
36
 
36
- **Note:** Bun provides better performance, but Node.js works perfectly fine.
37
-
38
37
  ### NPM Installation (Recommended)
39
38
 
40
- 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.
41
40
 
42
41
  ```bash
43
- # Option 1: Using NPM (works with both Bun and Node.js)
42
+ # Installation with automatic Bun setup
44
43
  npm install -g trello-cli-unofficial
45
44
 
46
- # Option 2: Using Bun (recommended for better performance)
45
+ # Or with other package managers
47
46
  bun add -g trello-cli-unofficial
48
-
49
- # Option 3: Using Yarn
50
47
  yarn global add trello-cli-unofficial
48
+ ```
51
49
 
52
50
  # Option 4: Using PNPM
53
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.8.1",
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/)",
@@ -47,7 +47,6 @@
47
47
  "src"
48
48
  ],
49
49
  "engines": {
50
- "bun": ">=1.0.0",
51
50
  "node": ">=16.0.0"
52
51
  },
53
52
  "scripts": {
@@ -63,13 +62,15 @@
63
62
  "test:coverage:threshold": "bun test --coverage --coverage-reporter=lcov && bun run scripts/check-coverage.js",
64
63
  "lint": "eslint .",
65
64
  "lint:fix": "eslint . --fix",
65
+ "lint:json": "node -e \"JSON.parse(require('fs').readFileSync(process.argv[1], 'utf8')); console.log('JSON is valid')\" --",
66
66
  "typecheck": "tsc --noEmit",
67
67
  "commitlint": "commitlint --edit",
68
68
  "validate": "bun run lint && bun run typecheck && bun run test:coverage:threshold",
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"
@@ -104,6 +105,9 @@
104
105
  "lint-staged": {
105
106
  "*.{js,ts,tsx}": [
106
107
  "eslint --max-warnings 0"
108
+ ],
109
+ "*.json": [
110
+ "bun run lint:json"
107
111
  ]
108
112
  }
109
113
  }
@@ -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"