Skip to content

Commit 3c9a589

Browse files
kumavisruyadorno
authored andcommitted
feat/explain: show when an edge is a bundled edge
PR-URL: #2807 Credit: @kumavis Close: #2807 Reviewed-by: @ruyadorno
1 parent 2d682e4 commit 3c9a589

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/utils/explain-dep.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ const explainDependents = ({ name, dependents }, depth, color) => {
8686
return str.split('\n').join('\n ')
8787
}
8888

89-
const explainEdge = ({ name, type, from, spec }, depth, color) => {
89+
const explainEdge = ({ name, type, bundled, from, spec }, depth, color) => {
9090
const { bold } = color ? chalk : nocolor
9191
return (type === 'prod' ? '' : `${colorType(type, color)} `) +
92+
(bundled ? `${colorType('bundled', color)} ` : '') +
9293
`${bold(name)}@"${bold(spec)}" from ` +
9394
explainFrom(from, depth, color)
9495
}

tap-snapshots/test-lib-utils-explain-dep.js-TAP.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ manydep@1.0.0
2424
exports[`test/lib/utils/explain-dep.js TAP bundled > explain color deep 1`] = `
2525
bundle-of-joy@1.0.0 bundled
2626
node_modules/bundle-of-joy
27-
[1mprod-dep[22m@"[1m1.x[22m" from the root project
27+
[34mbundled[39m [1mprod-dep[22m@"[1m1.x[22m" from the root project
2828
`
2929

3030
exports[`test/lib/utils/explain-dep.js TAP bundled > explain nocolor shallow 1`] = `
3131
bundle-of-joy@1.0.0 bundled
3232
node_modules/bundle-of-joy
33-
prod-dep@"1.x" from the root project
33+
bundled prod-dep@"1.x" from the root project
3434
`
3535

3636
exports[`test/lib/utils/explain-dep.js TAP bundled > print color 1`] = `

test/lib/utils/explain-dep.js

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ const cases = {
107107
type: 'prod',
108108
name: 'prod-dep',
109109
spec: '1.x',
110+
bundled: true,
110111
from: {
111112
location: '/path/to/project',
112113
},

0 commit comments

Comments
 (0)