1- import _pEvery from 'p-every'
21import pLocate from 'p-locate'
32import { type PackageJson } from 'read-package-up'
43import semver from 'semver'
@@ -9,9 +8,6 @@ import { SystemLogger } from '../plugins_core/types.js'
98import { PluginVersion } from './list.js'
109import { CONDITIONS } from './plugin_conditions.js'
1110
12- // the types of that package seem to be not correct and demand a `pEvery.default()` usage which is wrong
13- const pEvery = _pEvery as unknown as typeof import ( 'p-every' ) . default
14-
1511/**
1612 * Retrieve the `expectedVersion` of a plugin:
1713 * - This is the version which should be run
@@ -128,9 +124,13 @@ const getCompatibleEntry = async function ({
128124 return false
129125 }
130126
131- return await pEvery ( conditions , async ( { type, condition } ) =>
132- CONDITIONS [ type ] . test ( condition as any , { nodeVersion, packageJson, packagePath, buildDir } ) ,
133- )
127+ return (
128+ await Promise . all (
129+ conditions . map ( async ( { type, condition } ) =>
130+ CONDITIONS [ type ] . test ( condition as any , { nodeVersion, packageJson, packagePath, buildDir } ) ,
131+ ) ,
132+ )
133+ ) . every ( Boolean )
134134 } )
135135
136136 if ( compatibleEntry ) {
@@ -192,9 +192,13 @@ const getFirstCompatibleEntry = async function ({
192192 return true
193193 }
194194
195- return await pEvery ( conditions , async ( { type, condition } ) =>
196- CONDITIONS [ type ] . test ( condition as any , { nodeVersion, packageJson, packagePath, buildDir } ) ,
197- )
195+ return (
196+ await Promise . all (
197+ conditions . map ( async ( { type, condition } ) =>
198+ CONDITIONS [ type ] . test ( condition as any , { nodeVersion, packageJson, packagePath, buildDir } ) ,
199+ ) ,
200+ )
201+ ) . every ( Boolean )
198202 } )
199203
200204 if ( compatibleEntry ) {
0 commit comments