From 868564e7c2e637fb109d864c5999516210965df3 Mon Sep 17 00:00:00 2001 From: COOL Date: Wed, 21 Aug 2024 10:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E4=B8=80=E4=BA=9B=E6=AF=94?= =?UTF-8?q?=E8=BE=83=E6=9E=81=E7=AB=AF=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/plugin/service/types.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/modules/plugin/service/types.ts b/src/modules/plugin/service/types.ts index 98b4fc4..7551250 100644 --- a/src/modules/plugin/service/types.ts +++ b/src/modules/plugin/service/types.ts @@ -1,13 +1,14 @@ -import { App, Provide } from '@midwayjs/decorator'; import { BaseService } from '@cool-midway/core'; -import * as ts from 'typescript'; -import { IMidwayApplication } from '@midwayjs/core'; -import * as path from 'path'; -import * as fs from 'fs'; +import { IMidwayApplication, Inject } from '@midwayjs/core'; +import { App, Provide } from '@midwayjs/decorator'; import { InjectEntityModel } from '@midwayjs/typeorm'; -import { Repository } from 'typeorm'; -import { PluginInfoEntity } from '../entity/info'; +import * as fs from 'fs'; +import * as path from 'path'; import * as prettier from 'prettier'; +import { Repository } from 'typeorm'; +import * as ts from 'typescript'; +import { Utils } from '../../../comm/utils'; +import { PluginInfoEntity } from '../entity/info'; /** * 插件类型服务 @@ -20,6 +21,9 @@ export class PluginTypesService extends BaseService { @InjectEntityModel(PluginInfoEntity) pluginInfoEntity: Repository; + @Inject() + utils: Utils; + /** * 生成d.ts文件 * @param tsContent @@ -238,6 +242,7 @@ export class PluginTypesService extends BaseService { const tsContent = pluginInfo.tsContent?.data; if (tsContent) { await this.generateDtsFile(pluginInfo.keyName, tsContent); + await this.utils.sleep(200); } } }