trello-cli-unofficial 0.9.3 → 0.9.4

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,10 @@
1
+ ## [0.9.4](https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.9.3...v0.9.4) (2025-11-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * create CLI wrapper to ensure Bun execution ([87deabf](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/87deabf6c8be566a764bb52d057bebb49090f88f))
7
+
1
8
  ## [0.9.3](https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.9.2...v0.9.3) (2025-11-14)
2
9
 
3
10
 
package/bin/cli.js ADDED
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execSync, spawn } from 'node:child_process';
4
+ import path from 'node:path';
5
+ import process from 'node:process';
6
+ import { fileURLToPath } from 'node:url';
7
+
8
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
+
10
+ // Detect language from environment
11
+ function detectLanguage() {
12
+ const langVars = ['LANG', 'LANGUAGE', 'LC_ALL', 'LC_MESSAGES'];
13
+ for (const varName of langVars) {
14
+ const value = process.env[varName];
15
+ if (value && value.toLowerCase().includes('pt')) {
16
+ return 'pt';
17
+ }
18
+ }
19
+ return 'en';
20
+ }
21
+
22
+ const lang = detectLanguage();
23
+
24
+ const messages = {
25
+ pt: {
26
+ bunRequired: '❌ Bun é necessário para executar o Trello CLI Unofficial',
27
+ bunNotFound: 'Bun não foi encontrado no sistema',
28
+ installBun: '📦 Instale o Bun primeiro:',
29
+ installCommand: 'curl -fsSL https://bun.sh/install | bash',
30
+ windowsInstall: 'powershell -c "irm bun.sh/install.ps1 | iex"',
31
+ afterInstall: 'Após instalar, reinicie o terminal e execute novamente',
32
+ versionCommand: 'Verifique com: bun --version',
33
+ },
34
+ en: {
35
+ bunRequired: '❌ Bun is required to run Trello CLI Unofficial',
36
+ bunNotFound: 'Bun was not found on the system',
37
+ installBun: '📦 Please install Bun first:',
38
+ installCommand: 'curl -fsSL https://bun.sh/install | bash',
39
+ windowsInstall: 'powershell -c "irm bun.sh/install.ps1 | iex"',
40
+ afterInstall: 'After installation, restart your terminal and run again',
41
+ versionCommand: 'Check with: bun --version',
42
+ },
43
+ };
44
+
45
+ const msg = messages[lang];
46
+
47
+ // Check if Bun is available
48
+ function isBunAvailable() {
49
+ try {
50
+ execSync('bun --version', { stdio: 'pipe' });
51
+ return true;
52
+ }
53
+ catch {
54
+ return false;
55
+ }
56
+ }
57
+
58
+ // Main execution
59
+ if (!isBunAvailable()) {
60
+ console.log(msg.bunRequired);
61
+ console.log(msg.bunNotFound);
62
+ console.log('');
63
+ console.log(msg.installBun);
64
+
65
+ // Detect platform for appropriate install command
66
+ const platform = process.platform;
67
+ if (platform === 'win32') {
68
+ console.log(`Windows: ${msg.windowsInstall}`);
69
+ }
70
+ else {
71
+ console.log(`Unix/Linux/macOS: ${msg.installCommand}`);
72
+ }
73
+
74
+ console.log('');
75
+ console.log(msg.afterInstall);
76
+ console.log(msg.versionCommand);
77
+ process.exit(1);
78
+ }
79
+
80
+ // Bun is available, execute the main script
81
+ const mainScript = path.join(__dirname, '..', 'dist', 'main.js');
82
+ const args = process.argv.slice(2);
83
+
84
+ const child = spawn('bun', [mainScript, ...args], {
85
+ stdio: 'inherit',
86
+ cwd: process.cwd(),
87
+ });
88
+
89
+ child.on('exit', (code) => {
90
+ process.exit(code);
91
+ });
92
+
93
+ child.on('error', (error) => {
94
+ console.error('Failed to start Bun:', error.message);
95
+ process.exit(1);
96
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trello-cli-unofficial",
3
3
  "type": "module",
4
- "version": "0.9.3",
4
+ "version": "0.9.4",
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/)",
@@ -26,8 +26,8 @@
26
26
  ],
27
27
  "module": "main.ts",
28
28
  "bin": {
29
- "trello-cli-unofficial": "./dist/main.js",
30
- "tcu": "./dist/main.js"
29
+ "trello-cli-unofficial": "./bin/cli.js",
30
+ "tcu": "./bin/cli.js"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public",
@@ -38,6 +38,7 @@
38
38
  "LICENSE",
39
39
  "PAT_SETUP.md",
40
40
  "README.md",
41
+ "bin",
41
42
  "bun.lock",
42
43
  "bunfig.toml",
43
44
  "dist",