trello-cli-unofficial 0.11.1 → 0.11.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,10 @@
1
+ ## [0.11.2](https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.11.1...v0.11.2) (2025-11-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * resolve Commander.js initialization issues ([c6588e7](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/c6588e75a5c9ca173921e1719849a7f8bce99abf))
7
+
1
8
  ## [0.11.1](https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.11.0...v0.11.1) (2025-11-14)
2
9
 
3
10
 
package/dist/main.js CHANGED
@@ -30954,142 +30954,8 @@ var init_esm17 = __esm(() => {
30954
30954
  });
30955
30955
 
30956
30956
  // src/shared/ErrorHandler.ts
30957
- class ErrorHandler {
30958
- static handle(error, context) {
30959
- if (error instanceof TrelloCliError) {
30960
- this.handleTrelloError(error, context);
30961
- } else if (error instanceof Error) {
30962
- this.handleGenericError(error, context);
30963
- } else {
30964
- this.handleUnknownError(error, context);
30965
- }
30966
- }
30967
- static handleTrelloError(error, context) {
30968
- const prefix = context ? `[${context}] ` : "";
30969
- switch (error.code) {
30970
- case "AUTH_ERROR":
30971
- console.error(t2("errors.authFailed", { message: error.message }));
30972
- console.error(t2("errors.trySetup"));
30973
- break;
30974
- case "API_ERROR":
30975
- console.error(t2("errors.apiError", { statusCode: error.statusCode, message: error.message }));
30976
- if (error instanceof ApiError && error.endpoint) {
30977
- console.error(t2("errors.endpoint", { endpoint: error.endpoint }));
30978
- }
30979
- break;
30980
- case "VALIDATION_ERROR":
30981
- console.error(t2("errors.validationError", { message: error.message }));
30982
- if (error instanceof ValidationError2 && error.field) {
30983
- console.error(t2("errors.field", { field: error.field }));
30984
- }
30985
- break;
30986
- case "NOT_FOUND_ERROR":
30987
- console.error(t2("errors.notFound", { message: error.message }));
30988
- if (error instanceof NotFoundError) {
30989
- if (error.resourceType) {
30990
- console.error(t2("errors.resourceType", { resourceType: error.resourceType }));
30991
- }
30992
- if (error.resourceId) {
30993
- console.error(t2("errors.resourceId", { resourceId: error.resourceId }));
30994
- }
30995
- }
30996
- break;
30997
- case "CONFIG_ERROR":
30998
- console.error(t2("errors.configError", { message: error.message }));
30999
- console.error(t2("errors.checkConfig"));
31000
- break;
31001
- case "NETWORK_ERROR":
31002
- console.error(t2("errors.networkError", { message: error.message }));
31003
- console.error(t2("errors.checkConnection"));
31004
- break;
31005
- default:
31006
- console.error(`\u274C ${prefix}${error.message}`);
31007
- }
31008
- process.exit(error.statusCode || 1);
31009
- }
31010
- static handleGenericError(error, _context) {
31011
- console.error(t2("errors.unexpectedError", { message: error.message }));
31012
- if (true) {
31013
- console.error(t2("errors.stackTrace"), error.stack);
31014
- }
31015
- process.exit(1);
31016
- }
31017
- static handleUnknownError(error, _context) {
31018
- console.error(t2("errors.unknownError"), error);
31019
- process.exit(1);
31020
- }
31021
- static async withErrorHandling(operation, context) {
31022
- try {
31023
- return await operation();
31024
- } catch (error) {
31025
- this.handle(error, context);
31026
- throw error;
31027
- }
31028
- }
31029
- static fromApiResponse(response, endpoint) {
31030
- const statusCode = response.status || response.statusCode || 500;
31031
- const message = response.message || response.error || t2("api.unknownApiError");
31032
- switch (statusCode) {
31033
- case 401:
31034
- return new AuthenticationError(t2("api.invalidToken"));
31035
- case 403:
31036
- return new AuthenticationError("Access denied");
31037
- case 404:
31038
- return new NotFoundError(t2("api.resourceNotFound"), "unknown");
31039
- case 400:
31040
- return new ValidationError2(message);
31041
- case 429:
31042
- return new ApiError(t2("api.rateLimitExceeded"), statusCode, endpoint);
31043
- case 500:
31044
- return new ApiError(t2("api.internalServerError"), statusCode, endpoint);
31045
- default:
31046
- return new ApiError(message, statusCode, endpoint);
31047
- }
31048
- }
31049
- }
31050
- var TrelloCliError, AuthenticationError, ApiError, ValidationError2, NotFoundError;
31051
30957
  var init_ErrorHandler = __esm(() => {
31052
30958
  init_i18n();
31053
- TrelloCliError = class TrelloCliError extends Error {
31054
- code;
31055
- statusCode;
31056
- constructor(message, code, statusCode) {
31057
- super(message);
31058
- this.code = code;
31059
- this.statusCode = statusCode;
31060
- this.name = this.constructor.name;
31061
- }
31062
- };
31063
- AuthenticationError = class AuthenticationError extends TrelloCliError {
31064
- constructor(message = "Authentication failed") {
31065
- super(message, "AUTH_ERROR", 401);
31066
- }
31067
- };
31068
- ApiError = class ApiError extends TrelloCliError {
31069
- statusCode;
31070
- endpoint;
31071
- constructor(message, statusCode, endpoint) {
31072
- super(message, "API_ERROR", statusCode);
31073
- this.statusCode = statusCode;
31074
- this.endpoint = endpoint;
31075
- }
31076
- };
31077
- ValidationError2 = class ValidationError2 extends TrelloCliError {
31078
- field;
31079
- constructor(message, field) {
31080
- super(message, "VALIDATION_ERROR", 400);
31081
- this.field = field;
31082
- }
31083
- };
31084
- NotFoundError = class NotFoundError extends TrelloCliError {
31085
- resourceType;
31086
- resourceId;
31087
- constructor(message, resourceType, resourceId) {
31088
- super(message, "NOT_FOUND_ERROR", 404);
31089
- this.resourceType = resourceType;
31090
- this.resourceId = resourceId;
31091
- }
31092
- };
31093
30959
  });
31094
30960
 
31095
30961
  // src/shared/OutputFormatter.ts
@@ -31329,7 +31195,7 @@ class CommandController {
31329
31195
  }
31330
31196
  await this.boardController.showBoards();
31331
31197
  } catch (error) {
31332
- ErrorHandler.handle(error, "boards list");
31198
+ console.error(t2("commands.errors.genericError"), error.message);
31333
31199
  }
31334
31200
  });
31335
31201
  boardsCmd.command("show <boardId>").description(t2("commands.boards.show.description")).option("-f, --format <format>", t2("commands.formatOption"), "table").action(async (boardId, options) => {
@@ -31340,7 +31206,7 @@ class CommandController {
31340
31206
  }
31341
31207
  await this.boardController.showBoardDetails(boardId);
31342
31208
  } catch (error) {
31343
- ErrorHandler.handle(error, "boards show");
31209
+ console.error(t2("commands.errors.genericError"), error.message);
31344
31210
  }
31345
31211
  });
31346
31212
  boardsCmd.command("create <name>").description(t2("commands.boards.create.description")).option("-d, --desc <description>", t2("commands.boards.create.descOption")).action(async (name, options) => {
@@ -31369,7 +31235,7 @@ class CommandController {
31369
31235
  }
31370
31236
  await this.boardController.showListsById(boardId);
31371
31237
  } catch (error) {
31372
- ErrorHandler.handle(error, "lists list");
31238
+ console.error(t2("commands.errors.genericError"), error.message);
31373
31239
  }
31374
31240
  });
31375
31241
  listsCmd.command("create <boardId> <name>").description(t2("commands.lists.create.description")).action(async (boardId, name) => {
@@ -31414,7 +31280,7 @@ class CommandController {
31414
31280
  }
31415
31281
  await this.boardController.showCardsByListId(listId);
31416
31282
  } catch (error) {
31417
- ErrorHandler.handle(error, "cards list");
31283
+ console.error(t2("commands.errors.genericError"), error.message);
31418
31284
  }
31419
31285
  });
31420
31286
  cardsCmd.command("create <listId> <name>").description(t2("commands.cards.create.description")).option("-d, --desc <description>", t2("commands.options.cardDescription")).action(async (listId, name, options) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trello-cli-unofficial",
3
3
  "type": "module",
4
- "version": "0.11.1",
4
+ "version": "0.11.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/)",
@@ -1,5 +1,6 @@
1
1
  import type { OutputFormat } from '@/shared';
2
2
  import { readFileSync } from 'node:fs';
3
+
3
4
  import { join } from 'node:path';
4
5
 
5
6
  import { AuthenticationService } from '@domain/services';
@@ -10,7 +11,7 @@ import {
10
11
  import { Command } from 'commander';
11
12
 
12
13
  import { t } from '@/i18n';
13
- import { ErrorHandler, OutputFormatter } from '@/shared';
14
+ import { OutputFormatter } from '@/shared';
14
15
  import { AuthController, BoardController, CardController } from './index';
15
16
 
16
17
  export class CommandController {
@@ -130,7 +131,7 @@ export class CommandController {
130
131
  }
131
132
  await this.boardController.showBoards();
132
133
  } catch (error) {
133
- ErrorHandler.handle(error, 'boards list');
134
+ console.error(t('commands.errors.genericError'), (error as Error).message);
134
135
  }
135
136
  });
136
137
 
@@ -146,7 +147,7 @@ export class CommandController {
146
147
  }
147
148
  await this.boardController.showBoardDetails(boardId);
148
149
  } catch (error) {
149
- ErrorHandler.handle(error, 'boards show');
150
+ console.error(t('commands.errors.genericError'), (error as Error).message);
150
151
  }
151
152
  });
152
153
 
@@ -200,7 +201,7 @@ export class CommandController {
200
201
  }
201
202
  await this.boardController.showListsById(boardId);
202
203
  } catch (error) {
203
- ErrorHandler.handle(error, 'lists list');
204
+ console.error(t('commands.errors.genericError'), (error as Error).message);
204
205
  }
205
206
  });
206
207
 
@@ -286,7 +287,7 @@ export class CommandController {
286
287
  }
287
288
  await this.boardController.showCardsByListId(listId);
288
289
  } catch (error) {
289
- ErrorHandler.handle(error, 'cards list');
290
+ console.error(t('commands.errors.genericError'), (error as Error).message);
290
291
  }
291
292
  });
292
293
 
@@ -449,7 +450,6 @@ export class CommandController {
449
450
  }
450
451
 
451
452
  async run(): Promise<void> {
452
- // Ensure program is initialized before parsing
453
453
  await this.initializeProgram();
454
454
  await this.setupCommands();
455
455