优化类型重新生成逻辑

This commit is contained in:
cool 2024-06-01 16:23:12 +08:00
parent 18c63ba5f9
commit d79932ecd9

View File

@ -80,7 +80,7 @@ export class PluginTypesService extends BaseService {
}; };
const program = ts.createProgram(['file.ts'], options, compilerHost); const program = ts.createProgram(['file.ts'], options, compilerHost);
const emitResult = program.emit(); program.emit();
if (!output) { if (!output) {
// Provide a default value if the output is still empty // Provide a default value if the output is still empty
@ -231,6 +231,7 @@ export class PluginTypesService extends BaseService {
async reGenerate() { async reGenerate() {
const pluginInfos = await this.pluginInfoEntity const pluginInfos = await this.pluginInfoEntity
.createQueryBuilder('a') .createQueryBuilder('a')
.where('a.status = :status', { status: 1 })
.select(['a.id', 'a.status', 'a.tsContent', 'a.keyName']) .select(['a.id', 'a.status', 'a.tsContent', 'a.keyName'])
.getMany(); .getMany();
for (const pluginInfo of pluginInfos) { for (const pluginInfo of pluginInfos) {