From 9bddf09aa737412846aafc3c033a14c2305a3213 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Tue, 5 Nov 2024 00:51:07 +0100 Subject: [PATCH] fix(core): Fix issue with tspublish.json name validation in TsPublish class --- changelog.md | 6 ++++++ ts/00_commitinfo_data.ts | 2 +- ts/classes.tspublish.ts | 5 +---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index ff0a8ee..76c5b84 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2024-11-05 - 1.7.5 - fix(core) +Fix issue with tspublish.json name validation in TsPublish class + +- Resolved incorrect JSON parsing and validation for 'name' property in tspublish.json in the TsPublish.publish method. +- Removed redundant JSON parse from plugin.smartfile.fs.toStringSync in publish method. + ## 2024-11-05 - 1.7.4 - fix(classes.tspublish) Refactor getModuleSubDirs method to streamline name validation for publish modules diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 739bfe3..1e4de6e 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.7.4', + version: '1.7.5', 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.tspublish.ts b/ts/classes.tspublish.ts index ed80a3e..dabbccb 100644 --- a/ts/classes.tspublish.ts +++ b/ts/classes.tspublish.ts @@ -18,10 +18,7 @@ export class TsPublish { } for (const publishModule of Object.keys(publishModules)) { // lets check wether there is a name - const tspublishJson = JSON.parse( - plugins.smartfile.fs.toStringSync(plugins.path.join(publishModule, 'tspublish.json')), - ); - if (!tspublishJson.name) { + if (!publishModules[publishModule].name) { logger.log('warn', `no name found in tspublish.json for ${publishModule}. Skipping...`); continue; }