mirror of
https://github.com/pnpm/pnpm.git
synced 2026-07-26 07:27:20 -04:00
fix: audit output (#5984)
Wrap text in `pnpm audit` output for better readability. close #5981
This commit is contained in:
committed by
GitHub
parent
cc591d8378
commit
2ff11e77a6
7
.changeset/tidy-mice-obey.md
Normal file
7
.changeset/tidy-mice-obey.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-audit": patch
|
||||
"@pnpm/audit": patch
|
||||
pnpm: patch
|
||||
---
|
||||
|
||||
Wrap text in `pnpm audit` output for better readability [#5981](https://github.com/pnpm/pnpm/issues/5981)
|
||||
@@ -109,7 +109,7 @@ async function searchPackagePaths (
|
||||
|
||||
function _walker (packages: PackageNode[], depPath: string) {
|
||||
for (const pkg of packages) {
|
||||
const nextDepPath = `${depPath}>${pkg.name}@${pkg.version}`
|
||||
const nextDepPath = `${depPath} > ${pkg.name}@${pkg.version}`
|
||||
if (pkg.dependencies?.length) {
|
||||
_walker(pkg.dependencies, nextDepPath)
|
||||
} else {
|
||||
|
||||
@@ -28,6 +28,14 @@ const AUDIT_COLOR = {
|
||||
high: chalk.bold.red,
|
||||
critical: chalk.bold.red,
|
||||
}
|
||||
|
||||
const AUDIT_TABLE_OPTIONS = TABLE_OPTIONS
|
||||
AUDIT_TABLE_OPTIONS.columns = {
|
||||
1: {
|
||||
width: 54, // = table width of 80
|
||||
wrapWord: true,
|
||||
},
|
||||
}
|
||||
// eslint-enable
|
||||
|
||||
export const rcOptionsTypes = cliOptionsTypes
|
||||
@@ -223,7 +231,7 @@ ${JSON.stringify(newOverrides, null, 2)}`,
|
||||
['Patched versions', advisory.patched_versions],
|
||||
['Paths', advisory.findings.map(({ paths }) => paths).flat().join('\n\n')],
|
||||
['More info', advisory.url],
|
||||
], TABLE_OPTIONS)
|
||||
], AUDIT_TABLE_OPTIONS)
|
||||
}
|
||||
return {
|
||||
exitCode: output ? 1 : 0,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user