fix(classes.tspublish): Refactor getModuleSubDirs method to streamline name validation for publish modules
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tspublish',
|
||||
version: '1.7.3',
|
||||
version: '1.7.4',
|
||||
description: 'A tool to publish multiple, concise, and small packages from monorepos, specifically for TypeScript projects within a git environment.'
|
||||
}
|
||||
|
@ -17,6 +17,14 @@ 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) {
|
||||
logger.log('warn', `no name found in tspublish.json for ${publishModule}. Skipping...`);
|
||||
continue;
|
||||
}
|
||||
const publishModuleInstance = new PublishModule({
|
||||
monoRepoDir: monorepoDirArg,
|
||||
packageSubFolder: publishModule,
|
||||
@ -41,21 +49,14 @@ export class TsPublish {
|
||||
continue;
|
||||
}
|
||||
|
||||
// lets check wether there is a name
|
||||
const tspublishJson = JSON.parse(
|
||||
plugins.smartfile.fs.toStringSync(plugins.path.join(subDir, 'tspublish.json')),
|
||||
);
|
||||
if (!tspublishJson.name) {
|
||||
logger.log('warn', `no name found in tspublish.json for ${subDir}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
logger.log('info', `found publish module: ${subDir}`);
|
||||
publishModules[subDir] = JSON.parse(
|
||||
plugins.smartfile.fs.toStringSync(plugins.path.join(subDir, 'tspublish.json')),
|
||||
);
|
||||
}
|
||||
logger.log('ok', `found ${publishModules.length} publish modules`);
|
||||
logger.log('info', `Ordering publish modules...`);
|
||||
|
||||
return publishModules;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user