mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-03 13:37:31 -04:00
feat: print notice about latest version in summary
ref https://github.com/pnpm/pnpm/issues/921
This commit is contained in:
@@ -43,12 +43,14 @@
|
||||
"@types/common-tags": "^1.2.5",
|
||||
"@types/node": "^8.0.51",
|
||||
"@types/ramda": "^0.24.17",
|
||||
"@types/semver": "^5.4.0",
|
||||
"chalk": "^2.2.0",
|
||||
"common-tags": "^1.4.0",
|
||||
"log-update": "^2.3.0",
|
||||
"ndjson": "^1.5.0",
|
||||
"pretty-bytes": "^4.0.2",
|
||||
"ramda": "^0.25.0",
|
||||
"semver": "^5.4.1",
|
||||
"stacktracey": "^1.2.87",
|
||||
"xstream": "^11.0.0"
|
||||
},
|
||||
@@ -61,7 +63,7 @@
|
||||
"normalize-newline": "^3.0.0",
|
||||
"package-preview": "^1.0.0",
|
||||
"rimraf": "^2.5.4",
|
||||
"supi": "^0.7.4",
|
||||
"supi": "^0.7.5",
|
||||
"tape": "^4.8.0",
|
||||
"ts-node": "^3.3.0",
|
||||
"tslint": "^5.7.0",
|
||||
|
||||
@@ -2,12 +2,14 @@ dependencies:
|
||||
'@types/common-tags': 1.4.0
|
||||
'@types/node': 8.0.51
|
||||
'@types/ramda': 0.24.18
|
||||
'@types/semver': 5.4.0
|
||||
chalk: 2.3.0
|
||||
common-tags: 1.4.0
|
||||
log-update: 2.3.0
|
||||
ndjson: 1.5.0
|
||||
pretty-bytes: 4.0.2
|
||||
ramda: 0.25.0
|
||||
semver: 5.4.1
|
||||
stacktracey: 1.2.87
|
||||
xstream: 11.0.0
|
||||
devDependencies:
|
||||
@@ -19,7 +21,7 @@ devDependencies:
|
||||
normalize-newline: 3.0.0
|
||||
package-preview: 1.0.0
|
||||
rimraf: 2.6.2
|
||||
supi: 0.7.4
|
||||
supi: 0.7.5
|
||||
tape: 4.8.0
|
||||
ts-node: 3.3.0
|
||||
tslint: 5.8.0
|
||||
@@ -145,7 +147,6 @@ packages:
|
||||
resolution:
|
||||
integrity: sha512-LqJkY4VQ7S09XhI7kA3ON71AxauROhSv74639VsNXC9ish4IWHnIi98if+nP1MxQV3RMPqXSCYgpPsDHjlg9UQ==
|
||||
/@types/semver/5.4.0:
|
||||
dev: true
|
||||
resolution:
|
||||
integrity: sha512-PBHCvO98hNec9A491vBbh0ZNDOVxccwKL1u2pm6fs9oDgm7SEnw0lEHqHfjsYryDxnE3zaf7LvERWEXjOp1hig==
|
||||
/@types/tape/4.2.31:
|
||||
@@ -2500,8 +2501,9 @@ packages:
|
||||
node: '>=4'
|
||||
resolution:
|
||||
integrity: sha512-OQbpubrdUPz5xJa98eri+Gf7zfhoLbtQACh4myRaUrCHPYzCrKvw+07v3DrV/n1aRv0/yibWkqSGC/v03ijUug==
|
||||
/package-store/0.5.0:
|
||||
/package-store/0.5.1:
|
||||
dependencies:
|
||||
'@pnpm/types': 1.0.0
|
||||
'@types/load-json-file': 2.0.7
|
||||
'@types/node': 8.0.51
|
||||
'@types/ramda': 0.25.5
|
||||
@@ -2542,7 +2544,7 @@ packages:
|
||||
peerDependencies:
|
||||
'@pnpm/logger': ^1.0.0
|
||||
resolution:
|
||||
integrity: sha512-sIVto6OxyetDz7sxi823qfVIm7pdpYVHr3ouYigzZm+11498wSa8xn6EnakMqpw61QX7b66fHGjyz0bA1XzQIg==
|
||||
integrity: sha512-o7XZIy1Rxwyphw94z/p/2J8jPeRszF05YykmNt7EoIFJt56KY7gRryPaaZyV4K1splpntwHiJe9/6zCAmn4b2g==
|
||||
/pad-right/0.2.2:
|
||||
dependencies:
|
||||
repeat-string: 1.6.1
|
||||
@@ -3101,7 +3103,6 @@ packages:
|
||||
resolution:
|
||||
integrity: sha1-myzl094C0XxgEq0yaqa00M9U+U8=
|
||||
/semver/5.4.1:
|
||||
dev: true
|
||||
resolution:
|
||||
integrity: sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==
|
||||
/set-blocking/2.0.0:
|
||||
@@ -3360,7 +3361,7 @@ packages:
|
||||
node: '>=0.10.0'
|
||||
resolution:
|
||||
integrity: sha1-PFMZQukIwml8DsNEhYwobHygpgo=
|
||||
/supi/0.7.4:
|
||||
/supi/0.7.5:
|
||||
dependencies:
|
||||
'@pnpm/types': 1.0.0
|
||||
'@types/byline': 4.2.31
|
||||
@@ -3405,7 +3406,7 @@ packages:
|
||||
p-filter: 1.0.0
|
||||
p-limit: 1.1.0
|
||||
p-series: 1.0.0
|
||||
package-store: 0.5.0
|
||||
package-store: 0.5.1
|
||||
path-absolute: 1.0.0
|
||||
path-exists: 3.0.0
|
||||
path-name: 1.0.0
|
||||
@@ -3427,7 +3428,7 @@ packages:
|
||||
peerDependencies:
|
||||
'@pnpm/logger': ^1.0.0
|
||||
resolution:
|
||||
integrity: sha512-rwa39F+gVe/yRyViqRSCifWL1ji19eVN6uyAUIQcDcmiGTTfMBglu7WCVLfFRBV1dUuAt6qdsVFI32NTYGNK7Q==
|
||||
integrity: sha512-ruwD80VTUAfUTKw5Jo/RZqj17U1p8Q2ZWLzdBgrimRsw/Pe45edNVMv5kdS2wUtAjbLQj+uu/X4v29IwNelHEA==
|
||||
/supports-color/0.2.0:
|
||||
dev: true
|
||||
engines:
|
||||
@@ -3871,6 +3872,7 @@ specifiers:
|
||||
'@types/common-tags': ^1.2.5
|
||||
'@types/node': ^8.0.51
|
||||
'@types/ramda': ^0.24.17
|
||||
'@types/semver': ^5.4.0
|
||||
'@types/tape': ^4.2.30
|
||||
chalk: ^2.2.0
|
||||
commitizen: ^2.9.5
|
||||
@@ -3884,8 +3886,9 @@ specifiers:
|
||||
pretty-bytes: ^4.0.2
|
||||
ramda: ^0.25.0
|
||||
rimraf: ^2.5.4
|
||||
semver: ^5.4.1
|
||||
stacktracey: ^1.2.87
|
||||
supi: ^0.7.4
|
||||
supi: ^0.7.5
|
||||
tape: ^4.8.0
|
||||
ts-node: ^3.3.0
|
||||
tslint: ^5.7.0
|
||||
|
||||
@@ -4,6 +4,7 @@ import logUpdate = require('log-update')
|
||||
import os = require('os')
|
||||
import prettyBytes = require('pretty-bytes')
|
||||
import R = require('ramda')
|
||||
import semver = require('semver')
|
||||
import {
|
||||
DeprecationLog,
|
||||
InstallCheckLog,
|
||||
@@ -295,6 +296,9 @@ function printDiffs(pkgsDiff: PackageDiff[]) {
|
||||
result += ` ${pkg.name}`
|
||||
if (pkg.version) {
|
||||
result += ` ${chalk.grey(pkg.version)}`
|
||||
if (pkg.latest && semver.lt(pkg.version, pkg.latest)) {
|
||||
result += ` ${chalk.grey(`(${pkg.latest} is available)`)}`
|
||||
}
|
||||
}
|
||||
if (pkg.deprecated) {
|
||||
result += ` ${chalk.red('deprecated')}`
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface PackageDiff {
|
||||
name: string,
|
||||
version?: string,
|
||||
deprecated?: boolean,
|
||||
latest?: string,
|
||||
linked?: true,
|
||||
}
|
||||
|
||||
@@ -44,6 +45,7 @@ export default (log$: xs<Log>, deprecationLog$: xs<DeprecationLog>) => {
|
||||
pkgsDiff[rootLog['added'].dependencyType][`+${rootLog['added'].name}`] = {
|
||||
added: true,
|
||||
deprecated: deprecationSet.has(rootLog['added'].id),
|
||||
latest: rootLog['added'].latest,
|
||||
name: rootLog['added'].name,
|
||||
version: rootLog['added'].version,
|
||||
}
|
||||
|
||||
@@ -150,6 +150,7 @@ test('prints summary', t => {
|
||||
dependencyType: 'prod',
|
||||
name: 'foo',
|
||||
version: '1.0.0',
|
||||
latest: '2.0.0',
|
||||
id: 'registry.npmjs.org/foo/1.0.0',
|
||||
},
|
||||
})
|
||||
@@ -158,6 +159,7 @@ test('prints summary', t => {
|
||||
dependencyType: 'prod',
|
||||
name: 'bar',
|
||||
version: '2.0.0',
|
||||
latest: '1.0.0', // this won't be printed in summary because latest is less than current version
|
||||
id: 'registry.npmjs.org/bar/2.0.0',
|
||||
},
|
||||
})
|
||||
@@ -220,7 +222,7 @@ test('prints summary', t => {
|
||||
${h1('dependencies:')}
|
||||
${ADD} bar ${versionColor('2.0.0')} ${DEPRECATED}
|
||||
${SUB} foo ${versionColor('0.1.0')}
|
||||
${ADD} foo ${versionColor('1.0.0')}
|
||||
${ADD} foo ${versionColor('1.0.0')} ${versionColor('(2.0.0 is available)')}
|
||||
${SUB} is-13 ${versionColor('^1.0.0')}
|
||||
${ADD} is-negative ${versionColor('^1.0.0')}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user