fix(core): Fix incorrect logging and directory preparation

This commit is contained in:
Philipp Kunz 2024-10-28 01:30:39 +01:00
parent d47ac4793d
commit f74a6bf2ad
4 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,11 @@
# Changelog
## 2024-10-28 - 1.5.3 - fix(core)
Fix incorrect logging and directory preparation
- Corrected logging to accurately report the number of detected publish modules.
- Ensured the publish directory is emptied before creating package.json.
## 2024-10-28 - 1.5.2 - fix(core)
Add logging for found publish modules

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tspublish',
version: '1.5.2',
version: '1.5.3',
description: 'A tool to publish multiple, concise, and small packages from monorepos, specifically for TypeScript projects within a git environment.'
}

View File

@ -142,9 +142,9 @@ export class PublishModule {
this.options.monoRepoDir,
`dist_publish_${this.options.packageSubFolder}`
);
await plugins.smartfile.fs.ensureEmptyDir(this.options.publishModDirFullPath);
// package.json
await plugins.smartfile.fs.ensureEmptyDir(this.options.publishModDirFullPath);
const packageJson = await plugins.smartfile.SmartFile.fromString(
plugins.path.join(this.options.publishModDirFullPath, 'package.json'),
await this.createPackageJson(),

View File

@ -9,8 +9,8 @@ export class TsPublish {
public async publish (monorepoDirArg: string) {
const publishModules = await this.getModuleSubDirs(monorepoDirArg);
console.log(`Found ${publishModules.length} publish modules:`);
console.log(publishModules);
console.log(`Found ${Object.keys(publishModules).length} publish modules:`);
console.log(Object.keys(publishModules));
for (const publishModule of Object.keys(publishModules)) {
const publishModuleInstance = new PublishModule({
monoRepoDir: monorepoDirArg,