Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable version check with semver for now #1810

Merged
merged 5 commits into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/cli.js-package-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cli.js": patch
---

Packages are checked with `!=` instead of `semver` for beta releases.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
6 changes: 4 additions & 2 deletions tooling/cli.js/src/api/dependency-manager/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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 {
Expand Down