diff --git a/packages/cli/package.json b/packages/cli/package.json index 23e99fc58..db56cad6d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -23,7 +23,7 @@ "opener": "1.5.1", "pretty-bytes": "^5.1.0", "std-env": "^2.2.1", - "wrap-ansi": "^4.0.0" + "wrap-ansi": "^5.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/cli/src/utils/formatting.js b/packages/cli/src/utils/formatting.js index b22f5bcba..59f91184b 100644 --- a/packages/cli/src/utils/formatting.js +++ b/packages/cli/src/utils/formatting.js @@ -22,7 +22,7 @@ export function indentLines(string, spaces, firstLineSpaces) { } export function foldLines(string, spaces, firstLineSpaces, charsPerLine = maxCharsPerLine()) { - return indentLines(wrapAnsi(string, charsPerLine, { trim: false }), spaces, firstLineSpaces) + return indentLines(wrapAnsi(string, charsPerLine), spaces, firstLineSpaces) } export function colorize(text) { diff --git a/packages/cli/test/unit/__snapshots__/command.test.js.snap b/packages/cli/test/unit/__snapshots__/command.test.js.snap index 96b3942fe..fc6f1cf37 100644 --- a/packages/cli/test/unit/__snapshots__/command.test.js.snap +++ b/packages/cli/test/unit/__snapshots__/command.test.js.snap @@ -1,36 +1,36 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`cli/command builds help text 1`] = ` -" Usage: nuxt this is how you do it +" Usage: nuxt this is how you do it [options] - a very long description that should wrap - to the next line because is not longer + a very long description that should wrap + to the next line because is not longer than the terminal width Options: --spa, -s Launch in SPA mode - --universal, -u Launch in Universal + --universal, -u Launch in Universal mode (default) - --config-file, -c Path to Nuxt.js + --config-file, -c Path to Nuxt.js config file (default: nuxt.config.js) - --modern, -m Build/Start app for - modern browsers, e.g. server, client and + --modern, -m Build/Start app for + modern browsers, e.g. server, client and false - --force-exit Whether Nuxt.js - should force exit after the command has + --force-exit Whether Nuxt.js + should force exit after the command has finished - --version, -v Display the Nuxt + --version, -v Display the Nuxt version --help, -h Display this message - --port, -p Port number on which + --port, -p Port number on which to start the application - --hostname, -H Hostname on which to + --hostname, -H Hostname on which to start the application --unix-socket, -n Path to a UNIX socket - --foo very long option that - is longer than the terminal width and + --foo very long option that + is longer than the terminal width and should wrap to the next line " diff --git a/yarn.lock b/yarn.lock index 7eb9d953f..ed742e553 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11183,6 +11183,15 @@ wrap-ansi@^4.0.0: string-width "^2.1.1" strip-ansi "^4.0.0" +wrap-ansi@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.0.0.tgz#c3838a85fbac6a647558ca97024d41d7631721dc" + integrity sha512-3ThemJUfTTju0SKG2gjGExzGRHxT5l/KEM5sff3TQReaVWe/bFTiF1GEr8DKr/j0LxGt8qPzx0yhd2RLyqgy2Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"