feat(core): support cli tools inside mono repos.
This commit is contained in:
@@ -3,9 +3,16 @@ import * as plugins from './plugins.js';
|
||||
import * as interfaces from './interfaces/index.js';
|
||||
|
||||
import { PublishModule } from './classes.publishmodule.js';
|
||||
import { GiteaAssets } from './classes.giteaassets.js';
|
||||
|
||||
export class TsPublish {
|
||||
constructor() {}
|
||||
public giteaAssetsInstance: GiteaAssets;
|
||||
|
||||
constructor() {
|
||||
this.giteaAssetsInstance = new GiteaAssets({
|
||||
giteaBaseUrl: 'https://code.foss.global',
|
||||
});
|
||||
}
|
||||
|
||||
public async publish(monorepoDirArg: string) {
|
||||
const publishModules = await this.getModuleSubDirs(monorepoDirArg);
|
||||
@@ -13,7 +20,7 @@ export class TsPublish {
|
||||
for (const publishModule of Object.keys(publishModules)) {
|
||||
logger.log(
|
||||
'info',
|
||||
`Publishing module: ${publishModule} -> ${publishModules[publishModule].name}`,
|
||||
`Publishing module: ${publishModule} -> ${publishModules[publishModule].name}`
|
||||
);
|
||||
}
|
||||
for (const publishModule of Object.keys(publishModules)) {
|
||||
@@ -22,7 +29,7 @@ export class TsPublish {
|
||||
logger.log('warn', `no name found in tspublish.json for ${publishModule}. Skipping...`);
|
||||
continue;
|
||||
}
|
||||
const publishModuleInstance = new PublishModule({
|
||||
const publishModuleInstance = new PublishModule(this, {
|
||||
monoRepoDir: monorepoDirArg,
|
||||
packageSubFolder: publishModule,
|
||||
});
|
||||
@@ -48,12 +55,12 @@ export class TsPublish {
|
||||
|
||||
logger.log('info', `found publish module: ${subDir}`);
|
||||
publishModules[subDir] = JSON.parse(
|
||||
plugins.smartfile.fs.toStringSync(plugins.path.join(subDir, 'tspublish.json')),
|
||||
plugins.smartfile.fs.toStringSync(plugins.path.join(subDir, 'tspublish.json'))
|
||||
);
|
||||
}
|
||||
logger.log('ok', `found ${Object.keys(publishModules).length} publish modules`);
|
||||
logger.log('info', `Ordering publish modules...`);
|
||||
|
||||
|
||||
return publishModules;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user