diff --git a/.circleci/config.yml b/.circleci/config.yml index 776f404a0..5c4e1ad4e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,7 @@ workflows: parameters: os: - linux - - windows + # - windows node_version: - latest - lts diff --git a/src/config/config.ts b/src/config/config.ts index 61fc4d362..31675030b 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -205,15 +205,14 @@ export class Config implements IConfig { } } - async runHook(event: string, opts: T) { + async runHook(event: string, opts: T): Promise { debug('start %s hook', event) - const search = (m: any): Hook => { if (typeof m === 'function') return m if (m.default && typeof m.default === 'function') return m.default return Object.values(m).find((m: any) => typeof m === 'function') as Hook } - + const results = [] for (const p of this.plugins) { const debug = require('debug')([this.bin, p.name, 'hooks', event].join(':')) const context: Hook.Context = { @@ -242,8 +241,8 @@ export class Config implements IConfig { debug('start', isESM ? '(import)' : '(require)', filePath) - await search(module).call(context, {...opts as any, config: this}) - /* eslint-enable no-await-in-loop */ + const result = await search(module).call(context, {...opts as any, config: this}) + results.push(result) debug('done') } catch (error) { @@ -254,6 +253,7 @@ export class Config implements IConfig { } debug('%s hook done', event) + return results } async runCommand(id: string, argv: string[] = [], cachedCommand?: Command.Plugin): Promise { diff --git a/src/interfaces/config.ts b/src/interfaces/config.ts index e5d009964..6b357784b 100644 --- a/src/interfaces/config.ts +++ b/src/interfaces/config.ts @@ -95,7 +95,7 @@ export interface Config { runCommand(id: string, argv?: string[]): Promise; runCommand(id: string, argv?: string[], cachedCommand?: Command.Plugin): Promise; - runHook>(event: K, opts: T[K]): Promise; + runHook>(event: K, opts: T[K]): Promise; findCommand(id: string, opts: { must: true }): Command.Plugin; findCommand(id: string, opts?: { must: boolean }): Command.Plugin | undefined; findTopic(id: string, opts: { must: true }): Topic;