Disable version check with semver for now (#1810)

This commit is contained in:
Dominik Schenk 2021-05-13 00:33:17 +02:00 committed by GitHub
parent a68b4ee827
commit 66b6136e06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View File

@ -0,0 +1,5 @@
---
"cli.js": patch
---
Packages are checked with `!=` instead of `semver` for beta releases.

View File

@ -38,11 +38,11 @@ export class YarnManager implements IManager {
getLatestVersion(packageName: string): string {
const child = crossSpawnSync(
'yarn',
['info', packageName, 'versions', '--json'],
['info', packageName, 'version', '--json'],
{ cwd: appDir }
)
const output = String(child.output[1])
const packageJson = JSON.parse(output) as { data: string[] }
return packageJson.data[packageJson.data.length - 1]
const packageJson = JSON.parse(output) as { data: string }
return packageJson.data
}
}

View File

@ -5,7 +5,7 @@
import { sync as crossSpawnSync } from 'cross-spawn'
import { resolve as appResolve } from '../../helpers/app-paths'
import { existsSync } from 'fs'
import semver from 'semver'
// import semver from 'semver'
import { IManager, NpmManager, YarnManager, PnpmManager } from './managers'
const getManager = (): IManager => {
@ -60,7 +60,9 @@ function padVersion(version: string): string {
}
function semverLt(first: string, second: string): boolean {
return semver.lt(padVersion(first), padVersion(second))
return first !== second
// TODO: When version 1.0.0 is released this code should work again
// return semver.lt(padVersion(first), padVersion(second))
}
export {