feat: save 'deprecated' messages in shrinkwrap.yaml

This commit is contained in:
zkochan
2017-10-14 16:13:03 +03:00
committed by Zoltan Kochan
parent 6742580c00
commit de36456d71
3 changed files with 9 additions and 2 deletions

View File

@@ -308,12 +308,12 @@ async function install (
throw err
}
}
if (pkg['deprecated']) {
if (pkg.deprecated) {
deprecationLogger.warn({
pkgName: pkg.name,
pkgVersion: pkg.version,
pkgId: fetchedPkg.id,
deprecated: pkg['deprecated'],
deprecated: pkg.deprecated,
depth: options.currentDepth,
})
}

View File

@@ -116,6 +116,9 @@ function toShrDependency (
if (pkg.bundledDependencies || pkg.bundleDependencies) {
result['bundledDependencies'] = pkg.bundledDependencies || pkg.bundleDependencies
}
if (pkg.deprecated) {
result['deprecated'] = pkg.deprecated
}
return result
}

View File

@@ -166,4 +166,8 @@ export type Package = {
},
cpu?: string[],
os?: string[],
// TODO: create a separate type called PackageManifest that will have `deprecated`
// and won't have `scripts`, `config` and other fields that are not returned by
// the registry
deprecated?: string,
}