trello-cli-unofficial 0.11.2 → 0.11.3

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.11.3](https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.11.2...v0.11.3) (2025-11-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * switch to dynamic Commander import for better Windows compatibility ([e1ea7c5](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/e1ea7c588a10a635365a14099e7d6902a8f0eacb))
7
+
1
8
  ## [0.11.2](https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.11.1...v0.11.2) (2025-11-14)
2
9
 
3
10
 
package/dist/main.js CHANGED
@@ -28841,6 +28841,141 @@ var init_repositories = __esm(() => {
28841
28841
  init_TrelloApiRepository();
28842
28842
  });
28843
28843
 
28844
+ // src/shared/ErrorHandler.ts
28845
+ var init_ErrorHandler = __esm(() => {
28846
+ init_i18n();
28847
+ });
28848
+
28849
+ // src/shared/OutputFormatter.ts
28850
+ class OutputFormatter {
28851
+ format;
28852
+ constructor(format = "table") {
28853
+ this.format = format;
28854
+ }
28855
+ setFormat(format) {
28856
+ this.format = format;
28857
+ }
28858
+ output(data, options) {
28859
+ const format = options?.format || this.format;
28860
+ switch (format) {
28861
+ case "json":
28862
+ this.outputJson(data);
28863
+ break;
28864
+ case "csv":
28865
+ this.outputCsv(data, options);
28866
+ break;
28867
+ case "table":
28868
+ default:
28869
+ this.outputTable(data, options);
28870
+ break;
28871
+ }
28872
+ }
28873
+ outputJson(data) {
28874
+ console.log(JSON.stringify(data, null, 2));
28875
+ }
28876
+ outputCsv(data, options) {
28877
+ if (!Array.isArray(data) || data.length === 0) {
28878
+ console.log(t2("common.noData"));
28879
+ return;
28880
+ }
28881
+ const firstItem = data[0];
28882
+ if (!firstItem) {
28883
+ console.log(t2("common.noData"));
28884
+ return;
28885
+ }
28886
+ const plainItem = this.toPlainObject(firstItem);
28887
+ const fields = options?.fields || Object.keys(plainItem);
28888
+ const headers = options?.headers || fields;
28889
+ console.log(headers.join(","));
28890
+ for (const item of data) {
28891
+ const plainObject = this.toPlainObject(item);
28892
+ const row = fields.map((field) => {
28893
+ const value = plainObject[field];
28894
+ const stringValue = String(value || "");
28895
+ if (stringValue.includes(",") || stringValue.includes('"') || stringValue.includes(`
28896
+ `)) {
28897
+ return `"${stringValue.replace(/"/g, '""')}"`;
28898
+ }
28899
+ return stringValue;
28900
+ });
28901
+ console.log(row.join(","));
28902
+ }
28903
+ }
28904
+ outputTable(data, options) {
28905
+ if (!Array.isArray(data) || data.length === 0) {
28906
+ console.log(t2("common.noData"));
28907
+ return;
28908
+ }
28909
+ const firstItem = data[0];
28910
+ if (!firstItem) {
28911
+ console.log(t2("common.noData"));
28912
+ return;
28913
+ }
28914
+ const plainItem = this.toPlainObject(firstItem);
28915
+ const fields = options?.fields || Object.keys(plainItem);
28916
+ const headers = options?.headers || fields;
28917
+ const columnWidths = headers.map((header, index) => {
28918
+ const field = fields[index];
28919
+ const headerWidth = header.length;
28920
+ const maxDataWidth = Math.max(...data.map((item) => {
28921
+ const plainObject = this.toPlainObject(item);
28922
+ return String(plainObject[field] || "").length;
28923
+ }));
28924
+ return Math.max(headerWidth, maxDataWidth);
28925
+ });
28926
+ const headerRow = headers.map((header, index) => header.padEnd(columnWidths[index])).join(" | ");
28927
+ console.log(headerRow);
28928
+ const separator = columnWidths.map((width) => "-".repeat(width)).join("-+-");
28929
+ console.log(separator);
28930
+ for (const item of data) {
28931
+ const plainObject = this.toPlainObject(item);
28932
+ const row = fields.map((field, index) => {
28933
+ const value = String(plainObject[field] || "");
28934
+ return value.padEnd(columnWidths[index]);
28935
+ }).join(" | ");
28936
+ console.log(row);
28937
+ }
28938
+ }
28939
+ toPlainObject(obj) {
28940
+ if (obj === null || obj === undefined) {
28941
+ return {};
28942
+ }
28943
+ if (typeof obj === "object" && obj.constructor !== Object) {
28944
+ const plain = {};
28945
+ for (const key of Object.keys(obj)) {
28946
+ plain[key] = obj[key];
28947
+ }
28948
+ return plain;
28949
+ }
28950
+ return obj;
28951
+ }
28952
+ message(message) {
28953
+ console.log(message);
28954
+ }
28955
+ error(message) {
28956
+ console.error(`\u274C ${message}`);
28957
+ }
28958
+ success(message) {
28959
+ console.log(`\u2705 ${message}`);
28960
+ }
28961
+ warning(message) {
28962
+ console.log(`\u26A0\uFE0F ${message}`);
28963
+ }
28964
+ info(message) {
28965
+ console.log(`\u2139\uFE0F ${message}`);
28966
+ }
28967
+ }
28968
+ var init_OutputFormatter = __esm(() => {
28969
+ init_i18n();
28970
+ });
28971
+
28972
+ // src/shared/index.ts
28973
+ var init_shared = __esm(() => {
28974
+ init_ErrorHandler();
28975
+ init_OutputFormatter();
28976
+ init_types();
28977
+ });
28978
+
28844
28979
  // node_modules/commander/lib/error.js
28845
28980
  var require_error = __commonJS((exports) => {
28846
28981
  class CommanderError extends Error {
@@ -30935,6 +31070,20 @@ var require_commander = __commonJS((exports) => {
30935
31070
  });
30936
31071
 
30937
31072
  // node_modules/commander/esm.mjs
31073
+ var exports_esm = {};
31074
+ __export(exports_esm, {
31075
+ program: () => program,
31076
+ createOption: () => createOption,
31077
+ createCommand: () => createCommand,
31078
+ createArgument: () => createArgument,
31079
+ Option: () => Option,
31080
+ InvalidOptionArgumentError: () => InvalidOptionArgumentError,
31081
+ InvalidArgumentError: () => InvalidArgumentError,
31082
+ Help: () => Help,
31083
+ CommanderError: () => CommanderError,
31084
+ Command: () => Command,
31085
+ Argument: () => Argument
31086
+ });
30938
31087
  var import__, program, createCommand, createArgument, createOption, CommanderError, InvalidArgumentError, InvalidOptionArgumentError, Command, Argument, Option, Help;
30939
31088
  var init_esm17 = __esm(() => {
30940
31089
  import__ = __toESM(require_commander(), 1);
@@ -30953,141 +31102,6 @@ var init_esm17 = __esm(() => {
30953
31102
  } = import__.default);
30954
31103
  });
30955
31104
 
30956
- // src/shared/ErrorHandler.ts
30957
- var init_ErrorHandler = __esm(() => {
30958
- init_i18n();
30959
- });
30960
-
30961
- // src/shared/OutputFormatter.ts
30962
- class OutputFormatter {
30963
- format;
30964
- constructor(format = "table") {
30965
- this.format = format;
30966
- }
30967
- setFormat(format) {
30968
- this.format = format;
30969
- }
30970
- output(data, options) {
30971
- const format = options?.format || this.format;
30972
- switch (format) {
30973
- case "json":
30974
- this.outputJson(data);
30975
- break;
30976
- case "csv":
30977
- this.outputCsv(data, options);
30978
- break;
30979
- case "table":
30980
- default:
30981
- this.outputTable(data, options);
30982
- break;
30983
- }
30984
- }
30985
- outputJson(data) {
30986
- console.log(JSON.stringify(data, null, 2));
30987
- }
30988
- outputCsv(data, options) {
30989
- if (!Array.isArray(data) || data.length === 0) {
30990
- console.log(t2("common.noData"));
30991
- return;
30992
- }
30993
- const firstItem = data[0];
30994
- if (!firstItem) {
30995
- console.log(t2("common.noData"));
30996
- return;
30997
- }
30998
- const plainItem = this.toPlainObject(firstItem);
30999
- const fields = options?.fields || Object.keys(plainItem);
31000
- const headers = options?.headers || fields;
31001
- console.log(headers.join(","));
31002
- for (const item of data) {
31003
- const plainObject = this.toPlainObject(item);
31004
- const row = fields.map((field) => {
31005
- const value = plainObject[field];
31006
- const stringValue = String(value || "");
31007
- if (stringValue.includes(",") || stringValue.includes('"') || stringValue.includes(`
31008
- `)) {
31009
- return `"${stringValue.replace(/"/g, '""')}"`;
31010
- }
31011
- return stringValue;
31012
- });
31013
- console.log(row.join(","));
31014
- }
31015
- }
31016
- outputTable(data, options) {
31017
- if (!Array.isArray(data) || data.length === 0) {
31018
- console.log(t2("common.noData"));
31019
- return;
31020
- }
31021
- const firstItem = data[0];
31022
- if (!firstItem) {
31023
- console.log(t2("common.noData"));
31024
- return;
31025
- }
31026
- const plainItem = this.toPlainObject(firstItem);
31027
- const fields = options?.fields || Object.keys(plainItem);
31028
- const headers = options?.headers || fields;
31029
- const columnWidths = headers.map((header, index) => {
31030
- const field = fields[index];
31031
- const headerWidth = header.length;
31032
- const maxDataWidth = Math.max(...data.map((item) => {
31033
- const plainObject = this.toPlainObject(item);
31034
- return String(plainObject[field] || "").length;
31035
- }));
31036
- return Math.max(headerWidth, maxDataWidth);
31037
- });
31038
- const headerRow = headers.map((header, index) => header.padEnd(columnWidths[index])).join(" | ");
31039
- console.log(headerRow);
31040
- const separator = columnWidths.map((width) => "-".repeat(width)).join("-+-");
31041
- console.log(separator);
31042
- for (const item of data) {
31043
- const plainObject = this.toPlainObject(item);
31044
- const row = fields.map((field, index) => {
31045
- const value = String(plainObject[field] || "");
31046
- return value.padEnd(columnWidths[index]);
31047
- }).join(" | ");
31048
- console.log(row);
31049
- }
31050
- }
31051
- toPlainObject(obj) {
31052
- if (obj === null || obj === undefined) {
31053
- return {};
31054
- }
31055
- if (typeof obj === "object" && obj.constructor !== Object) {
31056
- const plain = {};
31057
- for (const key of Object.keys(obj)) {
31058
- plain[key] = obj[key];
31059
- }
31060
- return plain;
31061
- }
31062
- return obj;
31063
- }
31064
- message(message) {
31065
- console.log(message);
31066
- }
31067
- error(message) {
31068
- console.error(`\u274C ${message}`);
31069
- }
31070
- success(message) {
31071
- console.log(`\u2705 ${message}`);
31072
- }
31073
- warning(message) {
31074
- console.log(`\u26A0\uFE0F ${message}`);
31075
- }
31076
- info(message) {
31077
- console.log(`\u2139\uFE0F ${message}`);
31078
- }
31079
- }
31080
- var init_OutputFormatter = __esm(() => {
31081
- init_i18n();
31082
- });
31083
-
31084
- // src/shared/index.ts
31085
- var init_shared = __esm(() => {
31086
- init_ErrorHandler();
31087
- init_OutputFormatter();
31088
- init_types();
31089
- });
31090
-
31091
31105
  // src/presentation/cli/TrelloCliController.ts
31092
31106
  var exports_TrelloCliController = {};
31093
31107
  __export(exports_TrelloCliController, {
@@ -31149,7 +31163,8 @@ class CommandController {
31149
31163
  return;
31150
31164
  }
31151
31165
  try {
31152
- this.program = new Command;
31166
+ const { Command: Command2 } = await Promise.resolve().then(() => (init_esm17(), exports_esm));
31167
+ this.program = new Command2;
31153
31168
  } catch (error) {
31154
31169
  console.error(t2("menu.errors.commanderInitError"), error);
31155
31170
  throw new Error(t2("menu.errors.commanderInitFailed"));
@@ -31367,7 +31382,6 @@ class CommandController {
31367
31382
  var init_CommandController = __esm(() => {
31368
31383
  init_services();
31369
31384
  init_repositories();
31370
- init_esm17();
31371
31385
  init_i18n();
31372
31386
  init_shared();
31373
31387
  init_cli();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trello-cli-unofficial",
3
3
  "type": "module",
4
- "version": "0.11.2",
4
+ "version": "0.11.3",
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/)",
@@ -1,17 +1,16 @@
1
+ import type { Command } from 'commander';
1
2
  import type { OutputFormat } from '@/shared';
2
3
  import { readFileSync } from 'node:fs';
3
4
 
4
5
  import { join } from 'node:path';
5
-
6
6
  import { AuthenticationService } from '@domain/services';
7
7
  import {
8
8
  FileConfigRepository,
9
9
  TrelloApiRepository,
10
10
  } from '@infrastructure/repositories';
11
- import { Command } from 'commander';
12
-
13
11
  import { t } from '@/i18n';
14
12
  import { OutputFormatter } from '@/shared';
13
+
15
14
  import { AuthController, BoardController, CardController } from './index';
16
15
 
17
16
  export class CommandController {
@@ -34,7 +33,8 @@ export class CommandController {
34
33
  }
35
34
 
36
35
  try {
37
- // Use static import - Commander is already imported at the top
36
+ // Try dynamic import first (more compatible with bundling)
37
+ const { Command } = await import('commander');
38
38
  this.program = new Command();
39
39
  } catch (error) {
40
40
  console.error(t('menu.errors.commanderInitError'), error);