From ff365ee5081091168b46a0087c5c736b229fc2ac Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Mon, 28 Oct 2024 01:36:24 +0100 Subject: [PATCH] fix(core): Fix issues with path keys in tsconfig and logger setup in logging.ts. --- changelog.md | 6 ++++++ ts/00_commitinfo_data.ts | 2 +- ts/classes.publishmodule.ts | 2 +- ts/classes.tspublish.ts | 6 ++++-- ts/logging.ts | 3 ++- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index 97485cb..3db5bf3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2024-10-28 - 1.5.4 - fix(core) +Fix issues with path keys in tsconfig and logger setup in logging.ts. + +- Corrected the iteration over paths in the createTsconfigJson method of PublishModule. +- Fixed logger setup by ensuring console is enabled in logging.ts. + ## 2024-10-28 - 1.5.3 - fix(core) Fix incorrect logging and directory preparation diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index c9b7197..bada5ed 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tspublish', - version: '1.5.3', + version: '1.5.4', description: 'A tool to publish multiple, concise, and small packages from monorepos, specifically for TypeScript projects within a git environment.' } diff --git a/ts/classes.publishmodule.ts b/ts/classes.publishmodule.ts index d704d9d..0d1bca6 100644 --- a/ts/classes.publishmodule.ts +++ b/ts/classes.publishmodule.ts @@ -81,7 +81,7 @@ export class PublishModule { plugins.path.join(paths.cwd, 'tsconfig.json') ); if (originalTsConfig?.compilerOptions?.paths) { - for (const path of originalTsConfig.compilerOptions.paths) { + for (const path of Object.keys(originalTsConfig.compilerOptions.paths)) { originalTsConfig.compilerOptions.paths[path][0] = `.${originalTsConfig.compilerOptions.paths[path][0]}`; } } diff --git a/ts/classes.tspublish.ts b/ts/classes.tspublish.ts index 0c7baaa..bf5d523 100644 --- a/ts/classes.tspublish.ts +++ b/ts/classes.tspublish.ts @@ -9,8 +9,10 @@ export class TsPublish { public async publish (monorepoDirArg: string) { const publishModules = await this.getModuleSubDirs(monorepoDirArg); - console.log(`Found ${Object.keys(publishModules).length} publish modules:`); - console.log(Object.keys(publishModules)); + logger.log('info', `Found ${Object.keys(publishModules).length} publish modules:`); + for (const publishModule of Object.keys(publishModules)) { + logger.log('info', `Publishing module: ${publishModule} -> ${publishModules[publishModule].name}`); + } for (const publishModule of Object.keys(publishModules)) { const publishModuleInstance = new PublishModule({ monoRepoDir: monorepoDirArg, diff --git a/ts/logging.ts b/ts/logging.ts index b88aad9..5e507fd 100644 --- a/ts/logging.ts +++ b/ts/logging.ts @@ -1,4 +1,5 @@ import * as plugins from './plugins.js'; import * as commitinfo from './00_commitinfo_data.js'; -export const logger = plugins.smartlog.Smartlog.createForCommitinfo(commitinfo.commitinfo); \ No newline at end of file +export const logger = plugins.smartlog.Smartlog.createForCommitinfo(commitinfo.commitinfo); +logger.enableConsole(); \ No newline at end of file