diff --git a/.yarn/versions/fcca52e4.yml b/.yarn/versions/fcca52e4.yml new file mode 100644 index 00000000000..8d31f3d7cc5 --- /dev/null +++ b/.yarn/versions/fcca52e4.yml @@ -0,0 +1,33 @@ +releases: + "@yarnpkg/builder": patch + "@yarnpkg/cli": patch + "@yarnpkg/core": patch + "@yarnpkg/doctor": patch + "@yarnpkg/extensions": patch + "@yarnpkg/nm": patch + "@yarnpkg/plugin-compat": patch + "@yarnpkg/plugin-constraints": patch + "@yarnpkg/plugin-dlx": patch + "@yarnpkg/plugin-essentials": patch + "@yarnpkg/plugin-exec": patch + "@yarnpkg/plugin-file": patch + "@yarnpkg/plugin-git": patch + "@yarnpkg/plugin-github": patch + "@yarnpkg/plugin-http": patch + "@yarnpkg/plugin-init": patch + "@yarnpkg/plugin-interactive-tools": patch + "@yarnpkg/plugin-jsr": patch + "@yarnpkg/plugin-link": patch + "@yarnpkg/plugin-nm": patch + "@yarnpkg/plugin-npm": patch + "@yarnpkg/plugin-npm-cli": patch + "@yarnpkg/plugin-pack": patch + "@yarnpkg/plugin-patch": patch + "@yarnpkg/plugin-pnp": patch + "@yarnpkg/plugin-pnpm": patch + "@yarnpkg/plugin-stage": patch + "@yarnpkg/plugin-typescript": patch + "@yarnpkg/plugin-version": patch + "@yarnpkg/plugin-workspace-tools": patch + "@yarnpkg/pnpify": patch + "@yarnpkg/sdks": patch diff --git a/packages/yarnpkg-core/sources/Configuration.ts b/packages/yarnpkg-core/sources/Configuration.ts index 891cb390209..0cc36b8fa4b 100644 --- a/packages/yarnpkg-core/sources/Configuration.ts +++ b/packages/yarnpkg-core/sources/Configuration.ts @@ -2015,7 +2015,7 @@ export class Configuration { } } - async reduceHook, V, HooksDefinition = Hooks>(get: (hooks: HooksDefinition) => ((reduced: V, ...args: U) => Promise) | undefined, initialValue: V, ...args: U): Promise { + async reduceHook, V, HooksDefinition = Hooks>(get: (hooks: HooksDefinition) => ((reduced: V, ...args: U) => Promise | V) | undefined, initialValue: V, ...args: U): Promise { let value = initialValue; for (const plugin of this.plugins.values()) { diff --git a/packages/yarnpkg-core/sources/Plugin.ts b/packages/yarnpkg-core/sources/Plugin.ts index 1dc93934d30..f27099d8d03 100644 --- a/packages/yarnpkg-core/sources/Plugin.ts +++ b/packages/yarnpkg-core/sources/Plugin.ts @@ -79,7 +79,7 @@ export interface Hooks { locator: Locator, scriptName: string, extra: {script: string, args: Array, cwd: PortablePath, env: NodeJS.ProcessEnv, stdin: Readable | null, stdout: Writable, stderr: Writable}, - ) => Promise<() => Promise>; + ) => Promise<() => Promise> | (() => Promise); /** * Called when a network request is being made. The `executor` function @@ -90,7 +90,7 @@ export interface Hooks { wrapNetworkRequest?: ( executor: () => Promise, extra: WrapNetworkRequestInfo - ) => Promise<() => Promise>; + ) => Promise<() => Promise> | (() => Promise); /** * Called before the build, to compute a global hash key that we will use