trello-cli-unofficial 0.9.0 → 0.9.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [0.9.2](https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.9.1...v0.9.2) (2025-11-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add automatic Bun dependency check during installation ([362f68b](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/362f68bb26d330617da2bd7194e7ed0ee273d312))
7
+ * add eslint --fix to lint-staged ([17c0d98](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/17c0d9856d044b7a83606951e0a5a995f2b6b619))
8
+ * add NPM_TOKEN to semantic-release workflow ([9c93a67](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/9c93a678a0c46ea8a6697e05b3b38d38e756e140))
9
+
1
10
  # Changelog
2
11
 
3
12
  All notable changes to this project will be documented in this file.
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.2",
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": "node scripts/check-dependencies.js"
73
74
  },
74
75
  "peerDependencies": {
75
76
  "typescript": "^5"
@@ -103,6 +104,7 @@
103
104
  },
104
105
  "lint-staged": {
105
106
  "*.{js,ts,tsx}": [
107
+ "eslint --fix",
106
108
  "eslint --max-warnings 0"
107
109
  ],
108
110
  "*.json": [
@@ -0,0 +1,154 @@
1
+ #!/usr/bin/env node
2
+
3
+ /* eslint-disable node/prefer-global/process */
4
+ /* eslint-disable unused-imports/no-unused-vars */
5
+
6
+ import { execSync } from 'node:child_process';
7
+ import os from 'node:os';
8
+
9
+ // Detect language from environment
10
+ function detectLanguage() {
11
+ const langVars = ['LANG', 'LANGUAGE', 'LC_ALL', 'LC_MESSAGES'];
12
+ for (const varName of langVars) {
13
+ const value = process.env[varName];
14
+ if (value && value.toLowerCase().includes('pt')) {
15
+ return 'pt';
16
+ }
17
+ }
18
+ return 'en';
19
+ }
20
+
21
+ const lang = detectLanguage();
22
+
23
+ // Messages in both languages
24
+ const messages = {
25
+ pt: {
26
+ checking: '🔍 Verificando dependências do Trello CLI Unofficial...',
27
+ bunFound: '✅ Bun encontrado:',
28
+ bunNotFound: '❌ Bun NÃO encontrado!',
29
+ bunRequired: '📦 O Trello CLI Unofficial requer Bun para funcionar corretamente.',
30
+ bunBenefit: ' Bun oferece performance 10-50x superior ao Node.js para este projeto.',
31
+ installPrompt: '🔧 Deseja instalar o Bun agora? (Y/n): ',
32
+ installing: '🚀 Instalando Bun...',
33
+ installSuccess: '✅ Bun instalado com sucesso!',
34
+ version: ' Versão:',
35
+ installFailed: '❌ Falha ao instalar Bun. Verifique sua conexão e tente novamente.',
36
+ cancelled: '❌ Instalação cancelada.',
37
+ manualInstall: '💡 Para instalar manualmente:',
38
+ manualCommand: os.platform() === 'win32'
39
+ ? ' powershell -c "irm bun.sh/install.ps1 | iex"'
40
+ : ' curl -fsSL https://bun.sh/install | bash',
41
+ retry: '🔄 Depois execute: npm install -g trello-cli-unofficial',
42
+ success: '🎉 Todas as dependências verificadas com sucesso!',
43
+ },
44
+ en: {
45
+ checking: '🔍 Checking Trello CLI Unofficial dependencies...',
46
+ bunFound: '✅ Bun found:',
47
+ bunNotFound: '❌ Bun NOT found!',
48
+ bunRequired: '📦 Trello CLI Unofficial requires Bun to work correctly.',
49
+ bunBenefit: ' Bun offers 10-50x better performance than Node.js for this project.',
50
+ installPrompt: '🔧 Do you want to install Bun now? (Y/n): ',
51
+ installing: '🚀 Installing Bun...',
52
+ installSuccess: '✅ Bun installed successfully!',
53
+ version: ' Version:',
54
+ installFailed: '❌ Failed to install Bun. Check your connection and try again.',
55
+ cancelled: '❌ Installation cancelled.',
56
+ manualInstall: '💡 To install manually:',
57
+ manualCommand: os.platform() === 'win32'
58
+ ? ' powershell -c "irm bun.sh/install.ps1 | iex"'
59
+ : ' curl -fsSL https://bun.sh/install | bash',
60
+ retry: '🔄 Then run: npm install -g trello-cli-unofficial',
61
+ success: '🎉 All dependencies checked successfully!',
62
+ },
63
+ };
64
+
65
+ const msg = messages[lang];
66
+
67
+ console.log(msg.checking);
68
+ console.log('');
69
+
70
+ // Check if Bun is installed
71
+ function isBunInstalled() {
72
+ try {
73
+ const result = execSync('bun --version', { stdio: 'pipe' });
74
+ return result.toString().trim();
75
+ }
76
+ catch (error) {
77
+ return false;
78
+ }
79
+ }
80
+
81
+ const bunVersion = isBunInstalled();
82
+
83
+ if (bunVersion) {
84
+ console.log(`${msg.bunFound} ${bunVersion}`);
85
+ }
86
+ else {
87
+ console.log(msg.bunNotFound);
88
+ console.log('');
89
+ console.log(msg.bunRequired);
90
+ console.log(msg.bunBenefit);
91
+ console.log('');
92
+
93
+ // Read user input
94
+ process.stdout.write(msg.installPrompt);
95
+
96
+ process.stdin.setRawMode(true);
97
+ process.stdin.resume();
98
+
99
+ process.stdin.once('data', (key) => {
100
+ process.stdin.setRawMode(false);
101
+ process.stdin.pause();
102
+
103
+ const answer = key.toString().toLowerCase();
104
+ console.log(''); // New line after input
105
+
106
+ if (answer === 'y' || answer === '\r' || answer === '\n') {
107
+ console.log(msg.installing);
108
+
109
+ try {
110
+ // Install Bun based on platform
111
+ const platform = os.platform();
112
+ let installCommand;
113
+
114
+ if (platform === 'win32') {
115
+ // Windows - use PowerShell
116
+ installCommand = 'powershell -c "irm bun.sh/install.ps1 | iex"';
117
+ }
118
+ else {
119
+ // Unix-like systems
120
+ installCommand = 'curl -fsSL https://bun.sh/install | bash';
121
+ }
122
+
123
+ execSync(installCommand, { stdio: 'inherit' });
124
+
125
+ // Check if installation was successful
126
+ const newBunVersion = isBunInstalled();
127
+ if (newBunVersion) {
128
+ console.log(msg.installSuccess);
129
+ console.log(`${msg.version} ${newBunVersion}`);
130
+ }
131
+ else {
132
+ console.log(msg.installFailed);
133
+ process.exit(1);
134
+ }
135
+ }
136
+ catch (error) {
137
+ console.log(msg.installFailed);
138
+ process.exit(1);
139
+ }
140
+ }
141
+ else {
142
+ console.log(msg.cancelled);
143
+ console.log('');
144
+ console.log(msg.manualInstall);
145
+ console.log(msg.manualCommand);
146
+ console.log('');
147
+ console.log(msg.retry);
148
+ process.exit(1);
149
+ }
150
+ });
151
+ }
152
+
153
+ console.log('');
154
+ console.log(msg.success);
@@ -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"
@@ -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"
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "�� Validating package.json..."
5
+ node -e "JSON.parse(require(fs).readFileSync(package.json)); console.log(✅ package.json is valid)"
6
+
7
+ echo "🎯 Running lint-staged..."
8
+ npx lint-staged