From 13419ab79b283317268aa4b01fa0c69a92f005be Mon Sep 17 00:00:00 2001 From: 0-0Jia <1036748415@qq.com> Date: Mon, 20 Jan 2025 10:46:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9E=84=E5=BB=BA=E5=8A=A0=E4=B8=AA=20?= =?UTF-8?q?onAllBuildComplete=20=E9=92=A9=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands/build.ts | 1 + src/registerMethods.ts | 1 + src/types.ts | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/src/commands/build.ts b/src/commands/build.ts index f9557f9e..e28a96ee 100644 --- a/src/commands/build.ts +++ b/src/commands/build.ts @@ -19,6 +19,7 @@ export default (api: IApi) => { api.service.configManager!.mainConfigFile, ].filter(Boolean) as string[], }); + await api.applyPlugins({ key: 'onAllBuildComplete' }); }, }); }; diff --git a/src/registerMethods.ts b/src/registerMethods.ts index 9525eab6..7a848ff0 100644 --- a/src/registerMethods.ts +++ b/src/registerMethods.ts @@ -6,6 +6,7 @@ export default (api: IApi) => { 'addRegularCheckup', 'addSourceCheckup', 'addImportsCheckup', + 'onAllBuildComplete', ].forEach((name) => { api.registerMethod({ name }); }); diff --git a/src/types.ts b/src/types.ts index 7de151e4..fb973ffe 100644 --- a/src/types.ts +++ b/src/types.ts @@ -68,6 +68,11 @@ export type IApi = PluginAPI & */ config: Omit; userConfig: IFatherConfig; + + /** + * lifecycle + */ + onAllBuildComplete: () => void; }; export enum IFatherBuildTypes {