fix(project): Fixed minor formatting issues and improved code consistency.

This commit is contained in:
2024-11-05 00:34:56 +01:00
parent 125be257d6
commit 750f081c03
11 changed files with 59 additions and 39 deletions

View File

@@ -7,11 +7,14 @@ import { PublishModule } from './classes.publishmodule.js';
export class TsPublish {
constructor() {}
public async publish (monorepoDirArg: string) {
public async publish(monorepoDirArg: string) {
const publishModules = await this.getModuleSubDirs(monorepoDirArg);
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}`);
logger.log(
'info',
`Publishing module: ${publishModule} -> ${publishModules[publishModule].name}`,
);
}
for (const publishModule of Object.keys(publishModules)) {
const publishModuleInstance = new PublishModule({
@@ -25,9 +28,9 @@ export class TsPublish {
}
}
public async getModuleSubDirs (dirArg: string) {
public async getModuleSubDirs(dirArg: string) {
const subDirs = await plugins.smartfile.fs.listFolders(dirArg);
const publishModules: {[key: string]: interfaces.ITsPublishJson} = {};
const publishModules: { [key: string]: interfaces.ITsPublishJson } = {};
for (const subDir of subDirs) {
if (!subDir.startsWith('ts')) {
continue;
@@ -38,9 +41,11 @@ export class TsPublish {
continue;
}
logger.log('info', `found publish module: ${subDir}`);
publishModules[subDir] = JSON.parse(plugins.smartfile.fs.toStringSync(plugins.path.join(subDir, 'tspublish.json')));
publishModules[subDir] = JSON.parse(
plugins.smartfile.fs.toStringSync(plugins.path.join(subDir, 'tspublish.json')),
);
}
logger.log('ok', `found ${publishModules.length} publish modules`);
return publishModules;
}
}
}