Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Commit

Permalink
Replace boxen with simpler implementation (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Richter authored Jan 8, 2020
1 parent 369694f commit cdc2707
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 43 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@oclif/plugin-not-found": "^1.2.3",
"@oclif/plugin-warn-if-update-available": "^1.7.0",
"@sap/cloud-sdk-generator": ">=1.14.0",
"boxen": "^4.2.0",
"cli-ux": "^5.4.1",
"execa": "^3.4.0",
"fast-glob": "^3.1.1",
Expand Down
18 changes: 3 additions & 15 deletions src/utils/message-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@
* Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved.
*/

// The boxen dependency creates this warning in ci: Opening `/dev/tty` failed (6): Device not configured
// It is likely an issue of github actions: https://github.com/actions/runner/issues/241
// If this becomes an issue we will have to consider other solutions than boxen
import boxen = require('boxen');

export function boxMessage(lines: string[]): string {
return boxen(lines.join('\n'), {
borderStyle: {
topLeft: '+',
topRight: '+',
bottomLeft: '+',
bottomRight: '+',
horizontal: '-',
vertical: ' '
}
});
const lineLength = lines.reduce((prev, curr) => (prev < curr.length ? curr.length : prev), 0);
const sep = `+${[...Array(lineLength)].map(() => '-').join('')}+`;
return ['', sep, ...lines.map(line => ` ${line} `), sep].join('\n');
}
28 changes: 1 addition & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1076,20 +1076,6 @@ boxen@^3.0.0:
type-fest "^0.3.0"
widest-line "^2.0.0"

boxen@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64"
integrity sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==
dependencies:
ansi-align "^3.0.0"
camelcase "^5.3.1"
chalk "^3.0.0"
cli-boxes "^2.2.0"
string-width "^4.1.0"
term-size "^2.1.0"
type-fest "^0.8.1"
widest-line "^3.1.0"

brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
Expand Down Expand Up @@ -5546,7 +5532,7 @@ string-width@^3.0.0, string-width@^3.1.0:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^5.1.0"

string-width@^4.0.0, string-width@^4.1.0:
string-width@^4.1.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5"
integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==
Expand Down Expand Up @@ -5723,11 +5709,6 @@ term-size@^1.2.0:
dependencies:
execa "^0.7.0"

term-size@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.1.1.tgz#f81ec25854af91a480d2f9d0c77ffcb26594ed1a"
integrity sha512-UqvQSch04R+69g4RDhrslmGvGL3ucDRX/U+snYW0Mab4uCAyKSndUksaoqlJ81QKSpRnIsuOYQCbC2ZWx2896A==

terminal-link@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994"
Expand Down Expand Up @@ -6266,13 +6247,6 @@ widest-line@^2.0.0, widest-line@^2.0.1:
dependencies:
string-width "^2.1.1"

widest-line@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca"
integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==
dependencies:
string-width "^4.0.0"

winston-transport@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.3.0.tgz#df68c0c202482c448d9b47313c07304c2d7c2c66"
Expand Down

0 comments on commit cdc2707

Please sign in to comment.