Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/utils/explain-dep.js3
-rw-r--r--tap-snapshots/test-lib-utils-explain-dep.js-TAP.test.js4
-rw-r--r--test/lib/utils/explain-dep.js1
3 files changed, 5 insertions, 3 deletions
diff --git a/lib/utils/explain-dep.js b/lib/utils/explain-dep.js
index 213493c65..c01bc780b 100644
--- a/lib/utils/explain-dep.js
+++ b/lib/utils/explain-dep.js
@@ -86,9 +86,10 @@ const explainDependents = ({ name, dependents }, depth, color) => {
return str.split('\n').join('\n ')
}
-const explainEdge = ({ name, type, from, spec }, depth, color) => {
+const explainEdge = ({ name, type, bundled, from, spec }, depth, color) => {
const { bold } = color ? chalk : nocolor
return (type === 'prod' ? '' : `${colorType(type, color)} `) +
+ (bundled ? `${colorType('bundled', color)} ` : '') +
`${bold(name)}@"${bold(spec)}" from ` +
explainFrom(from, depth, color)
}
diff --git a/tap-snapshots/test-lib-utils-explain-dep.js-TAP.test.js b/tap-snapshots/test-lib-utils-explain-dep.js-TAP.test.js
index 6d169bca6..7e77081f9 100644
--- a/tap-snapshots/test-lib-utils-explain-dep.js-TAP.test.js
+++ b/tap-snapshots/test-lib-utils-explain-dep.js-TAP.test.js
@@ -24,13 +24,13 @@ manydep@1.0.0
exports[`test/lib/utils/explain-dep.js TAP bundled > explain color deep 1`] = `
bundle-of-joy@1.0.0 bundled
node_modules/bundle-of-joy
- prod-dep@"1.x" from the root project
+ bundled prod-dep@"1.x" from the root project
`
exports[`test/lib/utils/explain-dep.js TAP bundled > explain nocolor shallow 1`] = `
bundle-of-joy@1.0.0 bundled
node_modules/bundle-of-joy
- prod-dep@"1.x" from the root project
+ bundled prod-dep@"1.x" from the root project
`
exports[`test/lib/utils/explain-dep.js TAP bundled > print color 1`] = `
diff --git a/test/lib/utils/explain-dep.js b/test/lib/utils/explain-dep.js
index 1b8c4ae38..1fee61050 100644
--- a/test/lib/utils/explain-dep.js
+++ b/test/lib/utils/explain-dep.js
@@ -107,6 +107,7 @@ const cases = {
type: 'prod',
name: 'prod-dep',
spec: '1.x',
+ bundled: true,
from: {
location: '/path/to/project',
},