From 1c49527ff16b203ef3fbfcd4e92e9cf4921392f2 Mon Sep 17 00:00:00 2001 From: ruzell22 Date: Fri, 22 Nov 2024 00:45:56 +0800 Subject: [PATCH] ci(github): fix type exports in packages/cactus-common Primary Changes --------------- 1. Remove packages/cactus-common/hyperledger-cactus-common-*.tgz in ignore paths in get-all-tgz-path.ts file 2. Added the log-level.ts for the missing exports detected by attw -f json 3. Added exports in public-api.ts from log-level.ts Fixes: #3635 Signed-off-by: ruzell22 --- .../src/main/typescript/log-level.ts | 18 ++++++++++++++++++ .../src/main/typescript/public-api.ts | 3 ++- tools/custom-checks/get-all-tgz-path.ts | 2 -- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 packages/cactus-common/src/main/typescript/log-level.ts diff --git a/packages/cactus-common/src/main/typescript/log-level.ts b/packages/cactus-common/src/main/typescript/log-level.ts new file mode 100644 index 0000000000..1c083bf1ed --- /dev/null +++ b/packages/cactus-common/src/main/typescript/log-level.ts @@ -0,0 +1,18 @@ +export const LogLevel = { + TRACE: 0, + DEBUG: 1, + INFO: 2, + WARN: 3, + ERROR: 4, + SILENT: 5, +} as const; +export type LogLevelNumbers = (typeof LogLevel)[keyof typeof LogLevel]; +export type LogLevelDesc = + | LogLevelNumbers + | "trace" + | "debug" + | "info" + | "warn" + | "error" + | "silent" + | keyof typeof LogLevel; diff --git a/packages/cactus-common/src/main/typescript/public-api.ts b/packages/cactus-common/src/main/typescript/public-api.ts index 6dd0e177d0..c3ce443cbe 100755 --- a/packages/cactus-common/src/main/typescript/public-api.ts +++ b/packages/cactus-common/src/main/typescript/public-api.ts @@ -1,6 +1,7 @@ export { LoggerProvider } from "./logging/logger-provider"; export { Logger, ILoggerOptions } from "./logging/logger"; -export { LogLevelDesc } from "loglevel"; +export { LogLevel, LogLevelNumbers, LogLevelDesc } from "./log-level"; + export { Objects } from "./objects"; export { Strings } from "./strings"; export { Bools } from "./bools"; diff --git a/tools/custom-checks/get-all-tgz-path.ts b/tools/custom-checks/get-all-tgz-path.ts index d95bf71fb5..19d44af963 100644 --- a/tools/custom-checks/get-all-tgz-path.ts +++ b/tools/custom-checks/get-all-tgz-path.ts @@ -58,8 +58,6 @@ export async function getAllTgzPath(): Promise { "packages/cactus-verifier-client/hyperledger-cactus-verifier-client-*.tgz", // link for issue ticket relating to this package: https://github.com/hyperledger-cacti/cacti/issues/3634 "packages/cactus-plugin-ledger-connector-polkadot/hyperledger-cactus-plugin-ledger-connector-polkadot-*.tgz", - // link for issue ticket relating to this package: https://github.com/hyperledger-cacti/cacti/issues/3635 - "packages/cactus-common/hyperledger-cactus-common-*.tgz", ], };