minor fixes
nclazz/depresolve/pipeline/head This commit looks good Details

develop
Niclas Thobaben 2022-11-27 11:52:44 +01:00
parent e45a3118f5
commit 299c40e359
2 changed files with 4 additions and 0 deletions

View File

@ -19,11 +19,13 @@ export class NpmResolver implements Resolver<NpmResolverOptions> {
}
private async resolveWithYarn(): Promise<ResolveResult[]> {
console.log('Run npm resolver using yarn')
try {
child_process.execSync('yarn outdated', { })
}catch (e: any) {
// Unfortunately the command throws an error, that we have to catch
const stdout = String(e.stdout)
console.debug(stdout)
return parseOutdatedLibraries(stdout, 'package.json')
}
return []

View File

@ -30,6 +30,8 @@ export const parseOutdatedLibraries = (stdout: string, location: string): Resolv
const results = lines
.map(([name, current, , latest, packageType, url]) => {
console.debug('Parse yarn outdated output', name, current, latest, packageType, url)
const currentVersion = parseSemver(current)
const recommendedVersion = parseSemver(latest)
const changeType = compareVersions(currentVersion, recommendedVersion)