@@ -17,6 +17,7 @@ import { NpmOptions } from '../types/NpmOptions'
17
17
import { Options } from '../types/Options'
18
18
import { SpawnOptions } from '../types/SpawnOptions'
19
19
import { SpawnPleaseOptions } from '../types/SpawnPleaseOptions'
20
+ import { Version } from '../types/Version'
20
21
import { VersionSpec } from '../types/VersionSpec'
21
22
import * as npm from './npm'
22
23
@@ -293,6 +294,37 @@ export const newest = withNpmConfigFromYarn(npm.newest)
293
294
export const patch = withNpmConfigFromYarn ( npm . patch )
294
295
export const semver = withNpmConfigFromYarn ( npm . semver )
295
296
296
- export { getEngines , getPeerDependencies , packageAuthorChanged } from './npm'
297
+ export { getPeerDependencies } from './npm'
298
+
299
+ /**
300
+ * Fetches the engines list from the registry for a specific package version.
301
+ *
302
+ * @param packageName
303
+ * @param version
304
+ * @returns Promised engines collection
305
+ */
306
+ export const getEngines = async (
307
+ packageName : string ,
308
+ version : Version ,
309
+ options : Options = { } ,
310
+ ) : Promise < Index < VersionSpec | undefined > > =>
311
+ npm . getEngines ( packageName , version , options , await npmConfigFromYarn ( options ) )
312
+
313
+ /**
314
+ * Check if package author changed between current and upgraded version.
315
+ *
316
+ * @param packageName Name of the package
317
+ * @param currentVersion Current version declaration (may be range)
318
+ * @param upgradedVersion Upgraded version declaration (may be range)
319
+ * @param npmConfigLocal Additional npm config variables that are merged into the system npm config
320
+ * @returns A promise that fulfills with boolean value.
321
+ */
322
+ export const packageAuthorChanged = async (
323
+ packageName : string ,
324
+ currentVersion : VersionSpec ,
325
+ upgradedVersion : VersionSpec ,
326
+ options : Options = { } ,
327
+ ) : Promise < boolean > =>
328
+ npm . packageAuthorChanged ( packageName , currentVersion , upgradedVersion , options , await npmConfigFromYarn ( options ) )
297
329
298
330
export default spawnYarn
0 commit comments