Comparing version 5.5.1 to 5.6.2
@@ -0,1 +1,21 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
### [5.6.2](https://github.com/oclif/cli-ux/compare/v5.6.1...v5.6.2) (2021-06-21) | ||
### [5.6.1](https://github.com/oclif/cli-ux/compare/v5.6.0...v5.6.1) (2021-06-11) | ||
## [5.6.0](https://github.com/oclif/cli-ux/compare/v5.5.1...v5.6.0) (2021-06-09) | ||
### Features | ||
* add title to tables and improve output structure ([#364](https://github.com/oclif/cli-ux/issues/364)) ([46f1c18](https://github.com/oclif/cli-ux/commit/46f1c18ef21d005b00f16b82aa4c7e622724ff1c)) | ||
### Bug Fixes | ||
* use npm-release-management-orb for CI ([#379](https://github.com/oclif/cli-ux/issues/379)) ([1d01a18](https://github.com/oclif/cli-ux/commit/1d01a188b55ef989e48634ad1ec38dfa3377a272)) | ||
## [5.5.1](https://github.com/oclif/cli-ux/compare/v5.5.0...v5.5.1) (2020-11-12) | ||
@@ -2,0 +22,0 @@ |
@@ -32,3 +32,3 @@ "use strict"; | ||
// assign options | ||
const { columns: cols, filter, csv, output, extended, sort, printLine } = options; | ||
const { columns: cols, filter, csv, output, extended, sort, title, printLine } = options; | ||
this.options = { | ||
@@ -42,3 +42,5 @@ columns: cols, | ||
printLine: printLine || ((s) => process.stdout.write(s + '\n')), | ||
rowStart: ' ', | ||
sort, | ||
title, | ||
}; | ||
@@ -222,5 +224,12 @@ } | ||
shouldShorten(); | ||
// print table title | ||
if (options.title) { | ||
options.printLine(options.title); | ||
// print title divider | ||
options.printLine(''.padEnd(columns.reduce((sum, col) => sum + col.width, 1), '=')); | ||
options.rowStart = '| '; | ||
} | ||
// print headers | ||
if (!options['no-header']) { | ||
let headers = ''; | ||
let headers = options.rowStart; | ||
for (const col of columns) { | ||
@@ -231,2 +240,9 @@ const header = col.header; | ||
options.printLine(chalk_1.default.bold(headers)); | ||
// print header dividers | ||
let dividers = options.rowStart; | ||
for (const col of columns) { | ||
const divider = ''.padEnd(col.maxWidth - 1, '─') + ' '; | ||
dividers += divider.padEnd(col.width); | ||
} | ||
options.printLine(chalk_1.default.bold(dividers)); | ||
} | ||
@@ -249,3 +265,3 @@ // print rows | ||
linesIndexess.forEach((i) => { | ||
let l = ''; | ||
let l = options.rowStart; | ||
for (const col of columns) { | ||
@@ -252,0 +268,0 @@ const width = col.width; |
{ | ||
"name": "cli-ux", | ||
"description": "cli IO utilities", | ||
"version": "5.5.1", | ||
"version": "5.6.2", | ||
"author": "Jeff Dickey @jdxcode", | ||
@@ -31,3 +31,3 @@ "bugs": "https://github.com/oclif/cli-ux/issues", | ||
"strip-ansi": "^6.0.0", | ||
"supports-color": "^7.1.0", | ||
"supports-color": "^8.1.0", | ||
"supports-hyperlinks": "^2.1.0", | ||
@@ -51,4 +51,4 @@ "tslib": "^2.0.0" | ||
"@types/strip-ansi": "^5.2.1", | ||
"@types/supports-color": "^5.3.0", | ||
"axios": "^0.20.0", | ||
"@types/supports-color": "^7.2.0", | ||
"axios": "^0.21.0", | ||
"chai": "^4.2.0", | ||
@@ -60,3 +60,3 @@ "chai-as-promised": "^7.1.1", | ||
"fancy-test": "^1.4.1", | ||
"mocha": "^5.2.0", | ||
"mocha": "^8.2.1", | ||
"ts-node": "^9.0.0", | ||
@@ -63,0 +63,0 @@ "typescript": "3.8.3" |
@@ -9,3 +9,2 @@ cli-ux | ||
[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/oclif/cli-ux?branch=master&svg=true)](https://ci.appveyor.com/project/heroku/cli-ux/branch/master) | ||
[![Codecov](https://codecov.io/gh/oclif/cli-ux/branch/master/graph/badge.svg)](https://codecov.io/gh/oclif/cli-ux) | ||
[![Known Vulnerabilities](https://snyk.io/test/npm/cli-ux/badge.svg)](https://snyk.io/test/npm/cli-ux) | ||
@@ -12,0 +11,0 @@ [![Downloads/week](https://img.shields.io/npm/dw/cli-ux.svg)](https://npmjs.org/package/cli-ux) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97056
1919
324
3
+ Addedsupports-color@8.1.1(transitive)
Updatedsupports-color@^8.1.0