Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.

Commit 0d6c174

Browse files
authored
Merge pull request #37 from datreeio/DT-259-remove-recommended-version
feat: removed recommended version from the cli
2 parents 9566d88 + 4ae033f commit 0d6c174

2 files changed

Lines changed: 7 additions & 14 deletions

File tree

lib/cli-renderer.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,8 @@ const score = require('./score')
44

55
const SOURCE_PACKAGE_TYPE = 'sourcePackage'
66
const ALTERNATIVE_PACKAGE_TYPE = 'alternativePackage'
7-
const PACKAGE_DISPLAY_HEADERS = ['Package Name', 'Smart Version', 'License', 'Description', 'My Usage', 'Score']
8-
const VERSION_DISPLAY_HEADERS = [
9-
'Package Name',
10-
'package.json Version',
11-
'Smart Version',
12-
'Latest Version',
13-
'Description'
14-
]
7+
const PACKAGE_DISPLAY_HEADERS = ['Package Name', 'Version', 'License', 'Description', 'My Usage', 'Score']
8+
const VERSION_DISPLAY_HEADERS = ['Package Name', 'package.json Version', 'Latest Version', 'Description']
159

1610
class Renderer {
1711
constructor({ logger }) {
@@ -63,7 +57,7 @@ class Renderer {
6357
if (data.quality.deprecated) style = style.red
6458
const dataSet = [
6559
`${style(data.name || '')}`,
66-
`${style(data.recommendedVersion || 'No Insight')}`,
60+
`${style(data.version || 'No Insight')}`,
6761
`${style(this.trimStringToLength(data.license, 4) || '')}`,
6862
`${style(this.trimStringToLength(data.description, 20) || '')}`
6963
]
@@ -81,7 +75,6 @@ class Renderer {
8175
return [
8276
`${style(data.name || '')}`,
8377
`${style(data.pkgJsonVersion || '')}`,
84-
`${style(data.recommendedVersion || 'No Insight')}`,
8578
`${style(data.version)}`,
8679
`${style(this.trimStringToLength(data.description, 20) || '')}`
8780
]
@@ -179,14 +172,14 @@ class Renderer {
179172
let packages = [pkgSet.source.name]
180173
if (pkgSet.alternatives && pkgSet.alternatives.length > 0) {
181174
packages = packages.concat(pkgSet.alternatives.map(alt => alt.name))
182-
this.queue.push(chalk`{blue.bold https://platform.datree.io/pkg/alternative-packages/${packages.join(',')}}`)
175+
this.queue.push(chalk`{blue.bold https://app.datree.io/pkg/alternative-packages/${packages.join(',')}}`)
183176
}
184177
}
185178

186179
_renderSinglePackageLinks(packageList) {
187180
for (const pkg of packageList)
188181
if (pkg && pkg.source && pkg.source.quality && pkg.source.quality.deprecated)
189-
this.queue.push(chalk`{blue.bold https://platform.datree.io/pkg/single-package/${pkg.source.name}}`)
182+
this.queue.push(chalk`{blue.bold https://app.datree.io/pkg/single-package/${pkg.source.name}}`)
190183
}
191184
}
192185

test/unit/cli-renderer.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ describe('Renderer', function() {
244244
})
245245

246246
it('should have the correct links for the footer', function() {
247-
renderer.queue[0].should.eql(chalk`{blue.bold https://platform.datree.io/pkg/single-package/koa}`)
248-
renderer.queue[1].should.eql(chalk`{blue.bold https://platform.datree.io/pkg/single-package/mongoose}`)
247+
renderer.queue[0].should.eql(chalk`{blue.bold https://app.datree.io/pkg/single-package/koa}`)
248+
renderer.queue[1].should.eql(chalk`{blue.bold https://app.datree.io/pkg/single-package/mongoose}`)
249249
})
250250
})
251251
})

0 commit comments

Comments
 (0)