From 8c53778dc21cdc31e9d54b21e4dff8182fb413a4 Mon Sep 17 00:00:00 2001 From: Mark Griffiths Date: Wed, 3 Nov 2021 17:12:40 +0000 Subject: [PATCH] Capture help tests --- index.js | 71 +++++++++++++------------- src/cli/help.js | 5 +- src/cli/index.js | 65 ++++++++++++------------ src/index.js | 14 +++--- src/lib/classes/image.js | 16 +++--- src/lib/classes/line-fitter.js | 8 +-- src/lib/classes/panel.js | 2 +- src/lib/classes/tokeniser.js | 8 +-- src/lib/classes/wrap-tool.js | 12 ++--- test-out | 36 ++++++++++++++ test/cli.js | 10 ++++ test/snapshots/cli.js.md | 79 +++++++++++++++++++++++++++++ test/snapshots/cli.js.snap | Bin 0 -> 9816 bytes truwrap.js | 88 +++++++++++++++++---------------- 14 files changed, 270 insertions(+), 144 deletions(-) create mode 100644 test-out create mode 100644 test/snapshots/cli.js.md create mode 100644 test/snapshots/cli.js.snap diff --git a/index.js b/index.js index b380a94..5d432ef 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,7 @@ import meta from '@thebespokepixel/meta'; import { createSelector } from '@thebespokepixel/n-selector'; import _ from 'lodash'; import { simple, palette } from 'trucolor'; +import { Buffer } from 'node:buffer'; import { statSync, readFileSync } from 'node:fs'; import ansiRegex from 'ansi-regex'; @@ -20,7 +21,7 @@ const newlineRegex$1 = /\n/g; class Tokeniser { /** * Create a new tokeniser - * @param {Regexp} tokenisingRegex - The regex that forms the word boundaries. + * @param {RegExp} tokenisingRegex - The regex that forms the word boundaries. */ constructor(tokenisingRegex) { this.tokenisingRegex = tokenisingRegex || (function () { @@ -48,8 +49,8 @@ class Tokeniser { } /** * Reconstruct the line, flushing any remaining tokens - * @param {String} source - Line to process - * @return {String} - Process line + * @param {string} source - Line to process + * @return {string} - Process line */ restore(source) { return source @@ -60,7 +61,7 @@ class Tokeniser { /** * Creates a tokeniser. * @private - * @param {} tokenisingRegex The tokenising regular expression + * @param {RegExp} tokenisingRegex The tokenising regular expression * @see {@link Tokeniser} * @return {Tokeniser} { A tokeniser instance. } */ @@ -103,7 +104,7 @@ class LineFitter { /** * Add a token to the line. * @param {string} token The word token to add. - * @returns {Boolean} Causes newline. + * @returns {boolean} Causes newline. */ add(token) { if (newlineRegex.test(token)) { @@ -161,9 +162,9 @@ class LineFitter { /** * Creates a line fitter - a new line of wrapped text.. * @private - * @param {String} margin The left margin, made up of spaces - * @param {Number} width The width the line can take up - * @param {Number} tabWidth Desired TAB width + * @param {string} margin The left margin, made up of spaces + * @param {number} width The width the line can take up + * @param {number} tabWidth Desired TAB width * @return {LineFitter} The line fitter. */ function createLineFitter(margin, width, tabWidth) { @@ -178,9 +179,9 @@ class WrapTool { /** * Create a new line wrapping tool. * @param {options} $0 - The supplied options - * @param {Number} $0.left - The left margins - * @param {Number} $0.width - The width of the view, in chars - * @param {Regex} $0.tokenRegex - An optional regex passed to the Tokeniser + * @param {number} $0.left - The left margins + * @param {number} $0.width - The width of the view, in chars + * @param {RegExp} $0.tokenRegex - An optional regex passed to the Tokeniser */ constructor({ left, @@ -195,8 +196,8 @@ class WrapTool { } /** * Apply instance settings to source text. - * @param {String} text - The text that require wrapping to the view. - * @return {String} - Text with wrapping applied. + * @param {string} text - The text that require wrapping to the view. + * @return {string} - Text with wrapping applied. */ wrap(text) { this.lines = []; @@ -221,7 +222,7 @@ class WrapTool { /** * Creates a wrap tool. * @private - * @param {Object} options The options + * @param {object} options The options * @return {WrapTool} The wrap tool. */ function createWrapTool(options) { @@ -231,11 +232,11 @@ function createWrapTool(options) { const clr = _.merge( simple({format: 'sgr'}), palette({format: 'sgr'}, - { - title: 'bold #9994D1', - bright: 'bold rgb(255,255,255)', - dark: '#333', - }), + { + title: 'bold #9994D1', + bright: 'bold rgb(255,255,255)', + dark: '#333', + }), ); const colorReplacer = new TemplateTag( replaceSubstitutionTransformer( @@ -257,9 +258,9 @@ class Image { * @param {string} $0.file - The filename of the image. * @param {string} $0.name - The name of the image * [will be taken from image if missing] - * @param {String} $0.width - Can be X(chars), Xpx(pixels), + * @param {string} $0.width - Can be X(chars), Xpx(pixels), * X%(% width of window) or 'auto' - * @param {String} $0.height - Can be Y(chars), Ypx(pixels), + * @param {string} $0.height - Can be Y(chars), Ypx(pixels), * Y%(% width of window) or 'auto' */ constructor({ @@ -291,29 +292,29 @@ class Image { } /** * Load and render the image into the CLI - * @param {Object} options - The options to set + * @param {object} options - The options to set * @property {number} align - The line count needed to realign the cursor. - * @property {Boolean} stretch - Do we stretch the image to match the width + * @property {boolean} stretch - Do we stretch the image to match the width * and height. - * @property {Boolean} nobreak - Do we clear the image with a newline? + * @property {boolean} nobreak - Do we clear the image with a newline? * @return {string} The string to insert into the output buffer, with base64 * encoded image. */ render(options) { - const {align, stretch = false, nobreak} = options; + const {align, stretch = false, nobreak, spacing = ''} = options; const content = Buffer.from(readFileSync(this.filePath)); const aspect = stretch ? 'preserveAspectRatio=0;' : ''; const linebreak = nobreak ? '' : '\n'; const newline = align > 1 ? `\u001BH\u001B[${align}A` : linebreak; return `${prefix}${aspect}size=${content.length}${this.config}:${ content.toString('base64') - }${suffix}${newline}` + }${suffix}${newline}${spacing}` } } /** * Creates an image. * @private - * @param {String} source The source + * @param {string} source The source * @return {Image} A configured (but not yet loaded) image. */ function createImage(source) { @@ -325,7 +326,7 @@ function createImage(source) { * @private * @param {string} buffer_ Input plain text. * @param {string} delimiter_ Field delimiter. - * @param {Number} width_ Panel width. + * @param {number} width_ Panel width. * @return {object} The columnify configuration. */ function panel(buffer_, delimiter_, width_) { @@ -428,7 +429,7 @@ function truwrap({ if (outStream.isTTY) { return outStream.columns || outStream.getWindowSize()[0] } - return Infinity + return 120 })(); const viewWidth = (function () { if (ttyWidth - left - right > 1) { @@ -468,15 +469,15 @@ function truwrap({ /** * Fetch the width in characters of the wrapping view. * @function - * @return {Number} wrapping width + * @return {number} wrapping width */ getWidth: unimplemented, /** * Create a multicolumn panel within this view * @function * @param {panelObject} content - Object for columnify - * @param {Object} configuration - Configuration for columnify - * @return {String} - The rendered panel. + * @param {object} configuration - Configuration for columnify + * @return {string} - The rendered panel. */ panel(content, configuration) { if (outStream._isStdio) { @@ -487,7 +488,7 @@ function truwrap({ /** * Generate linebreaks within this view * @function - * @param {Number} newlines - number of new lines to add. + * @param {number} newlines - number of new lines to add. * @return {api} has side effect of writing to stream. */ break(newlines = 1) { @@ -506,7 +507,7 @@ function truwrap({ /** * Write text via the wrapping logic * @function - * @param {String} text - The raw, unwrapped test to wrap. + * @param {string} text - The raw, unwrapped test to wrap. * @return {api} has side effect of writing to stream. */ write(text) { @@ -516,7 +517,7 @@ function truwrap({ }; switch (true) { case !ttyActive: - console.info(colorReplacer`${'yellow|Non-TTY'}: width: Infinity`); + console.info(colorReplacer`${'yellow|Non-TTY'}: width: 120`); /** * @name noTTY * @private diff --git a/src/cli/help.js b/src/cli/help.js index d6ef95e..1c12fc7 100644 --- a/src/cli/help.js +++ b/src/cli/help.js @@ -35,11 +35,11 @@ const images = (function () { /** * Render help when asked for. * @param {yargs} yargsInstance - yargs object defined in cli - * @return {undefined} Writes help to stdout. + * @return {null} Writes help to stdout. */ export default async function help(yargsInstance) { const header = () => stripIndent(colorReplacer)` - ${`title| ${metadata.name}`} + ${`title|${metadata.name}`} ${images.space}${metadata.description} ${images.space}${`grey|${metadata.version(3)}`} ` @@ -75,6 +75,7 @@ export default async function help(yargsInstance) { container.write(images.cc.render({ nobreak: false, align: 2, + spacing: ' ', })) container.write(header()).break() container.write(`${clr.dark}${'—'.repeat(windowWidth)}${clr.dark.out}`).break() diff --git a/src/cli/index.js b/src/cli/index.js index 330cbb7..e56ba96 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -1,7 +1,6 @@ /* ────────────╮ │ truwrap CLI │ ╰─────────────┴─────────────────────────────────────────────────────────────── */ -/* eslint unicorn/no-process-exit:0,quotes:0 */ import {format} from 'util' @@ -156,43 +155,41 @@ if (!(process.env.USER === 'root' && process.env.SUDO_USER !== process.env.USER) if (argv.help) { (async () => { await help(yargsInstance) - process.exit(0) })() -} - -const viewSettings = { - left: argv.left, - right: argv.right, - mode: argv.mode, - tabWidth: argv.tab, - outStream -} - -if (argv.regex) { - viewSettings.tokenRegex = new RegExp(argv.regex, 'g') -} +} else { + const viewSettings = { + left: argv.left, + right: argv.right, + mode: argv.mode, + tabWidth: argv.tab, + outStream + } -if (argv.width) { - viewSettings.width = argv.width -} + if (argv.regex) { + viewSettings.tokenRegex = new RegExp(argv.regex, 'g') + } -const renderer = truwrap(viewSettings) + if (argv.width) { + viewSettings.width = argv.width + } -if (argv.stamp) { - renderer.write(format(...argv._)) - process.exit(0) -} + const renderer = truwrap(viewSettings) -getStdin().then(input => { - if (argv.panel) { - const panel = parsePanel(input, argv.delimiter, renderer.getWidth()) - renderer.panel(panel.content, { - maxLineWidth: renderer.getWidth(), - showHeaders: false, - truncate: argv.truncate, - config: panel.configuration - }) + if (argv.stamp) { + renderer.write(format(...argv._)) } else { - renderer.write(input) + getStdin().then(input => { + if (argv.panel) { + const panel = parsePanel(input, argv.delimiter, renderer.getWidth()) + renderer.panel(panel.content, { + maxLineWidth: renderer.getWidth(), + showHeaders: false, + truncate: argv.truncate, + config: panel.configuration + }) + } else { + renderer.write(input) + } + }) } -}) +} diff --git a/src/index.js b/src/index.js index f5bdde0..a3ddcd9 100644 --- a/src/index.js +++ b/src/index.js @@ -69,7 +69,7 @@ export function truwrap({ return outStream.columns || outStream.getWindowSize()[0] } - return Infinity + return 120 })() const viewWidth = (function () { @@ -116,7 +116,7 @@ export function truwrap({ /** * Fetch the width in characters of the wrapping view. * @function - * @return {Number} wrapping width + * @return {number} wrapping width */ getWidth: unimplemented, @@ -124,8 +124,8 @@ export function truwrap({ * Create a multicolumn panel within this view * @function * @param {panelObject} content - Object for columnify - * @param {Object} configuration - Configuration for columnify - * @return {String} - The rendered panel. + * @param {object} configuration - Configuration for columnify + * @return {string} - The rendered panel. */ panel(content, configuration) { if (outStream._isStdio) { @@ -138,7 +138,7 @@ export function truwrap({ /** * Generate linebreaks within this view * @function - * @param {Number} newlines - number of new lines to add. + * @param {number} newlines - number of new lines to add. * @return {api} has side effect of writing to stream. */ break(newlines = 1) { @@ -159,7 +159,7 @@ export function truwrap({ /** * Write text via the wrapping logic * @function - * @param {String} text - The raw, unwrapped test to wrap. + * @param {string} text - The raw, unwrapped test to wrap. * @return {api} has side effect of writing to stream. */ write(text) { @@ -170,7 +170,7 @@ export function truwrap({ switch (true) { case !ttyActive: - console.info(colorReplacer`${'yellow|Non-TTY'}: width: Infinity`) + console.info(colorReplacer`${'yellow|Non-TTY'}: width: 120`) /** * @name noTTY diff --git a/src/lib/classes/image.js b/src/lib/classes/image.js index 70292ee..a42b835 100644 --- a/src/lib/classes/image.js +++ b/src/lib/classes/image.js @@ -22,9 +22,9 @@ class Image { * @param {string} $0.file - The filename of the image. * @param {string} $0.name - The name of the image * [will be taken from image if missing] - * @param {String} $0.width - Can be X(chars), Xpx(pixels), + * @param {string} $0.width - Can be X(chars), Xpx(pixels), * X%(% width of window) or 'auto' - * @param {String} $0.height - Can be Y(chars), Ypx(pixels), + * @param {string} $0.height - Can be Y(chars), Ypx(pixels), * Y%(% width of window) or 'auto' */ constructor({ @@ -61,16 +61,16 @@ class Image { /** * Load and render the image into the CLI - * @param {Object} options - The options to set + * @param {object} options - The options to set * @property {number} align - The line count needed to realign the cursor. - * @property {Boolean} stretch - Do we stretch the image to match the width + * @property {boolean} stretch - Do we stretch the image to match the width * and height. - * @property {Boolean} nobreak - Do we clear the image with a newline? + * @property {boolean} nobreak - Do we clear the image with a newline? * @return {string} The string to insert into the output buffer, with base64 * encoded image. */ render(options) { - const {align, stretch = false, nobreak} = options + const {align, stretch = false, nobreak, spacing = ''} = options const content = Buffer.from(readFileSync(this.filePath)) @@ -80,14 +80,14 @@ class Image { return `${prefix}${aspect}size=${content.length}${this.config}:${ content.toString('base64') - }${suffix}${newline}` + }${suffix}${newline}${spacing}` } } /** * Creates an image. * @private - * @param {String} source The source + * @param {string} source The source * @return {Image} A configured (but not yet loaded) image. */ export default function createImage(source) { diff --git a/src/lib/classes/line-fitter.js b/src/lib/classes/line-fitter.js index 45574c4..29dbaa2 100644 --- a/src/lib/classes/line-fitter.js +++ b/src/lib/classes/line-fitter.js @@ -45,7 +45,7 @@ class LineFitter { /** * Add a token to the line. * @param {string} token The word token to add. - * @returns {Boolean} Causes newline. + * @returns {boolean} Causes newline. */ add(token) { if (newlineRegex.test(token)) { @@ -113,9 +113,9 @@ class LineFitter { /** * Creates a line fitter - a new line of wrapped text.. * @private - * @param {String} margin The left margin, made up of spaces - * @param {Number} width The width the line can take up - * @param {Number} tabWidth Desired TAB width + * @param {string} margin The left margin, made up of spaces + * @param {number} width The width the line can take up + * @param {number} tabWidth Desired TAB width * @return {LineFitter} The line fitter. */ export default function createLineFitter(margin, width, tabWidth) { diff --git a/src/lib/classes/panel.js b/src/lib/classes/panel.js index c95d98a..34b32a8 100644 --- a/src/lib/classes/panel.js +++ b/src/lib/classes/panel.js @@ -10,7 +10,7 @@ import _ from 'lodash' * @private * @param {string} buffer_ Input plain text. * @param {string} delimiter_ Field delimiter. - * @param {Number} width_ Panel width. + * @param {number} width_ Panel width. * @return {object} The columnify configuration. */ export default function panel(buffer_, delimiter_, width_) { diff --git a/src/lib/classes/tokeniser.js b/src/lib/classes/tokeniser.js index 0fbbd2b..0a26649 100644 --- a/src/lib/classes/tokeniser.js +++ b/src/lib/classes/tokeniser.js @@ -16,7 +16,7 @@ const newlineRegex = /\n/g class Tokeniser { /** * Create a new tokeniser - * @param {Regexp} tokenisingRegex - The regex that forms the word boundaries. + * @param {RegExp} tokenisingRegex - The regex that forms the word boundaries. */ constructor(tokenisingRegex) { this.tokenisingRegex = tokenisingRegex || (function () { @@ -46,8 +46,8 @@ class Tokeniser { /** * Reconstruct the line, flushing any remaining tokens - * @param {String} source - Line to process - * @return {String} - Process line + * @param {string} source - Line to process + * @return {string} - Process line */ restore(source) { return source @@ -59,7 +59,7 @@ class Tokeniser { /** * Creates a tokeniser. * @private - * @param {} tokenisingRegex The tokenising regular expression + * @param {RegExp} tokenisingRegex The tokenising regular expression * @see {@link Tokeniser} * @return {Tokeniser} { A tokeniser instance. } */ diff --git a/src/lib/classes/wrap-tool.js b/src/lib/classes/wrap-tool.js index 205b810..5eaa71f 100644 --- a/src/lib/classes/wrap-tool.js +++ b/src/lib/classes/wrap-tool.js @@ -14,9 +14,9 @@ class WrapTool { /** * Create a new line wrapping tool. * @param {options} $0 - The supplied options - * @param {Number} $0.left - The left margins - * @param {Number} $0.width - The width of the view, in chars - * @param {Regex} $0.tokenRegex - An optional regex passed to the Tokeniser + * @param {number} $0.left - The left margins + * @param {number} $0.width - The width of the view, in chars + * @param {RegExp} $0.tokenRegex - An optional regex passed to the Tokeniser */ constructor({ left, @@ -32,8 +32,8 @@ class WrapTool { /** * Apply instance settings to source text. - * @param {String} text - The text that require wrapping to the view. - * @return {String} - Text with wrapping applied. + * @param {string} text - The text that require wrapping to the view. + * @return {string} - Text with wrapping applied. */ wrap(text) { this.lines = [] @@ -62,7 +62,7 @@ class WrapTool { /** * Creates a wrap tool. * @private - * @param {Object} options The options + * @param {object} options The options * @return {WrapTool} The wrap tool. */ export default function createWrapTool(options) { diff --git a/test-out b/test-out new file mode 100644 index 0000000..3d23394 --- /dev/null +++ b/test-out @@ -0,0 +1,36 @@ + +]1337;File=inline=1;size=8717width=auto;height=3;name=bG9nbw==:iVBORw0KGgoAAAANSUhEUgAAAtAAAALQCAMAAACOibeuAAABPlBMVEUAAABAQHMfI04fIk4fI04gI08gIk0gI00fIk0gIk0gIk4fIk4jJlQgI04fIk0fIk0gIk0gI00hJU8qKmMgJVAgIk0fIk4gIk0fJE4fIk319/c6PGIzNl4tL1ikp7eJjKKdn7Hz9fbb3eJkZ4R4e5Tq7O7u8PJ7fpfg4ebV2N7S1NteYX8nKlMiJU91d5EqLVbY2uBYW3olKFLLzdZ/gpnGx9GztcKrrbxydI5VWHji5OiWmayusL5FSGvIy9RKTnDP0tq+wMs2OmAwM1vAws2ws8GUlqpqbYnDxc+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1ZdhanTXP/iw4w6Ey6JC2yOBGD/zuDIZjko1TrIO0B55IOjLIQzrUmjmg8j6SPpnEPODZO+oeEEvwL+mwi0AHHqkkfsYkF3wZ9ZWx/w63OdEBECd5FHbHbAy7tdExmWxYuNVnvaN3hCQQdZ2SU4FBtOiHTjIY7VdYpXBYNf3p9x+4KvFrrL36j8RRq048ysTs4Mmb9Yks3Gm40W/0q8kYFnFhE/UerA+71Ool9LLiTdALZaDg0SBJnNJ5E0hl6KkMUbdHrLJHuHQrWRJ1py4QFxRq3OltmCo5C1VkXMJJKKNLadJmefDSKU/V6x28H/KuzrmCBbgcK0gTTdTK3G6AYu6zrRe5UQhG6qJuwgeIQD1cNpluZAmMWPNQYJt3SlHi1Ag/Tpkm3ZokeHh6iTqZZbNYc07izdr3RjOKKAhF3U62iZvcWXpm2YHbNa3jTnVgclh07AJjJolsO0XRvmz6sli9111Z827jaomq7+mW5Cv1Gl/sD4e8KNrArXqIAAAAASUVORK5CYII=H truwrap + Smarter terminal text wrapping (handles 24bit color) + v2.0.4 +———————————————————————————————————————————————————————————————————————————————— +Synopsis: +cat inputFile | truwrap [options] + +Options: + -h, --help Display this help. + -v, --version Return the current version on stdout. -vv Return name & versi + on. [count] + -V, --verbose Be verbose. -VV Be loquacious. [count] + -o, --stderr Use stderr rather than stdout [boolean] [default: false] + -l, --left Left margin [default: 2] + -r, --right Right margin [default: 2] + -w, --width Set total width. Overrides terminal window’s width. + -t, --tab Set tab width. [default: 2] + -m, --mode Wrapping mode + [choices: "hard", "soft", "keep", "container"] [default: "soft"] + -s, --stamp Print arguments rather than stdin. printf-style options suppo + rted. [boolean] + -p, --panel Render a tabular panel into the available console width. + [boolean] + -c, --truncate Truncate panel cells. [boolean] + -d, --delimiter The column delimiter when reading data for a panel. + [default: "|"] + -x, --regex Character run selection regex. + --color Force color depth --color=256|16m. Disable with --no-color + +Usage: +Reads unformatted text from stdin and typographically applies paragraph wrapping it for the currently active tty. + +————————————————————————————————————————————————————————————————————————————————truwrap ©2021 The Bespoke Pixel. Released under the MIT License. +An Open Source component from ByteTree.com's terminal visualisation toolkit +Issues?: https://github.com/thebespokepixel/truwrap/issues diff --git a/test/cli.js b/test/cli.js index 492035a..0e475d3 100644 --- a/test/cli.js +++ b/test/cli.js @@ -11,3 +11,13 @@ test(`Module name/version is '${pkg.name} v${expectedVersion}'.`, async t => { const {stdout} = await execPromise('./truwrap.js -vv') t.is(stdout.trim(), `${pkg.name} v${expectedVersion}`) }) + +test('Module help with image', async t => { + const {stderr} = await execPromise('./truwrap.js --help --color=256') + t.snapshot(stderr) +}) + +test('Module help, no color', async t => { + const {stderr} = await execPromise('./truwrap.js --help --no-color') + t.snapshot(stderr) +}) diff --git a/test/snapshots/cli.js.md b/test/snapshots/cli.js.md new file mode 100644 index 0000000..46efd93 --- /dev/null +++ b/test/snapshots/cli.js.md @@ -0,0 +1,79 @@ +# Snapshot report for `test/cli.js` + +The actual snapshot is saved in `cli.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## Module help with image + +> Snapshot 1 + + `␊ + ]1337;File=inline=1;size=8717width=auto;height=3;name=bG9nbw==:iVBORw0KGgoAAAANSUhEUgAAAtAAAALQCAMAAACOibeuAAABPlBMVEUAAABAQHMfI04fIk4fI04gI08gIk0gI00fIk0gIk0gIk4fIk4jJlQgI04fIk0fIk0gIk0gI00hJU8qKmMgJVAgIk0fIk4gIk0fJE4fIk319/c6PGIzNl4tL1ikp7eJjKKdn7Hz9fbb3eJkZ4R4e5Tq7O7u8PJ7fpfg4ebV2N7S1NteYX8nKlMiJU91d5EqLVbY2uBYW3olKFLLzdZ/gpnGx9GztcKrrbxydI5VWHji5OiWmayusL5FSGvIy9RKTnDP0tq+wMs2OmAwM1vAws2ws8GUlqpqbYnDxc+2ucaforSipbXo6+2oqrlvco3s7vCOkaZSVXZIS25AQme7vsmMjqSEh51cXn1PU3Tw8vS4u8iRk6hCRWnd3+SanK6HiZ9naodhZII9QGVsb4vl5+rMz9dOUXKBhJu1t8T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dExmWxYuNVnvaN3hCQQdZ2SU4FBtOiHTjIY7VdYpXBYNf3p9x+4KvFrrL36j8RRq048ysTs4Mmb9Yks3Gm40W/0q8kYFnFhE/UerA+71Ool9LLiTdALZaDg0SBJnNJ5E0hl6KkMUbdHrLJHuHQrWRJ1py4QFxRq3OltmCo5C1VkXMJJKKNLadJmefDSKU/V6x28H/KuzrmCBbgcK0gTTdTK3G6AYu6zrRe5UQhG6qJuwgeIQD1cNpluZAmMWPNQYJt3SlHi1Ag/Tpkm3ZokeHh6iTqZZbNYc07izdr3RjOKKAhF3U62iZvcWXpm2YHbNa3jTnVgclh07AJjJolsO0XRvmz6sli9111Z827jaomq7+mW5Cv1Gl/sD4e8KNrArXqIAAAAASUVORK5CYII=H truwrap␊ + Smarter terminal text wrapping (handles 24bit color)␊ + v2.0.4␊ + ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————␊ + Synopsis:␊ + cat inputFile | truwrap [options]␊ + ␊ + Options:␊ + -h, --help Display this help.␊ + -v, --version Return the current version on stdout. -vv Return name & version. [count]␊ + -V, --verbose Be verbose. -VV Be loquacious. [count]␊ + -o, --stderr Use stderr rather than stdout [boolean] [default: false]␊ + -l, --left Left margin [default: 2]␊ + -r, --right Right margin [default: 2]␊ + -w, --width Set total width. Overrides terminal window’s width.␊ + -t, --tab Set tab width. [default: 2]␊ + -m, --mode Wrapping mode [choices: "hard", "soft", "keep", "container"] [default: "soft"]␊ + -s, --stamp Print arguments rather than stdin. printf-style options supported. [boolean]␊ + -p, --panel Render a tabular panel into the available console width. [boolean]␊ + -c, --truncate Truncate panel cells. [boolean]␊ + -d, --delimiter The column delimiter when reading data for a panel. [default: "|"]␊ + -x, --regex Character run selection regex.␊ + --color Force color depth --color=256|16m. Disable with --no-color␊ + ␊ + Usage:␊ + Reads unformatted text from stdin and typographically applies paragraph wrapping it for the currently active tty.␊ + ␊ + ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————truwrap ©2021 The Bespoke Pixel. Released under the MIT License.␊ + An Open Source component from ByteTree.com's terminal visualisation toolkit␊ + Issues?: https://github.com/thebespokepixel/truwrap/issues␊ + ` + +## Module help, no color + +> Snapshot 1 + + `␊ + truwrap␊ + Smarter terminal text wrapping (handles 24bit color)␊ + v2.0.4␊ + ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————␊ + Synopsis:␊ + cat inputFile | truwrap [options]␊ + ␊ + Options:␊ + -h, --help Display this help.␊ + -v, --version Return the current version on stdout. -vv Return name & version. [count]␊ + -V, --verbose Be verbose. -VV Be loquacious. [count]␊ + -o, --stderr Use stderr rather than stdout [boolean] [default: false]␊ + -l, --left Left margin [default: 2]␊ + -r, --right Right margin [default: 2]␊ + -w, --width Set total width. Overrides terminal window’s width.␊ + -t, --tab Set tab width. [default: 2]␊ + -m, --mode Wrapping mode [choices: "hard", "soft", "keep", "container"] [default: "soft"]␊ + -s, --stamp Print arguments rather than stdin. printf-style options supported. [boolean]␊ + -p, --panel Render a tabular panel into the available console width. [boolean]␊ + -c, --truncate Truncate panel cells. [boolean]␊ + -d, --delimiter The column delimiter when reading data for a panel. [default: "|"]␊ + -x, --regex Character run selection regex.␊ + --color Force color depth --color=256|16m. Disable with --no-color␊ + ␊ + Usage:␊ + Reads unformatted text from stdin and typographically applies paragraph wrapping it for the currently active tty.␊ + ␊ + ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————truwrap ©2021 The Bespoke Pixel. Released under the MIT License.␊ + An Open Source component from ByteTree.com's terminal visualisation toolkit␊ + Issues?: https://github.com/thebespokepixel/truwrap/issues␊ + ` diff --git a/test/snapshots/cli.js.snap b/test/snapshots/cli.js.snap new file mode 100644 index 0000000000000000000000000000000000000000..f1bdd2cdedce3a40496ed72ed69043661b2e493d GIT binary patch literal 9816 zcmV-eCa2j!RzV-oR@ zk8~-QCf)QtS)25uNSonfFPGw@Y{NV)=Pn%PqF?6!{1-_QE}?(~HHe>4Zfh2m19+UmJ-r}M8l{PV8x zZ(0nwKrwj}<(JXmi-wf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 diff --git a/truwrap.js b/truwrap.js index b9d115c..db024be 100755 --- a/truwrap.js +++ b/truwrap.js @@ -18,16 +18,17 @@ import { createConsole } from 'verbosity'; import meta from '@thebespokepixel/meta'; import { createSelector } from '@thebespokepixel/n-selector'; import ansiRegex from 'ansi-regex'; +import { Buffer } from 'node:buffer'; import { statSync, readFileSync } from 'node:fs'; const clr = _.merge( simple({format: 'sgr'}), palette({format: 'sgr'}, - { - title: 'bold #9994D1', - bright: 'bold rgb(255,255,255)', - dark: '#333', - }), + { + title: 'bold #9994D1', + bright: 'bold rgb(255,255,255)', + dark: '#333', + }), ); const colorReplacer = new TemplateTag( replaceSubstitutionTransformer( @@ -209,14 +210,14 @@ class Image { })(); } render(options) { - const {align, stretch = false, nobreak} = options; + const {align, stretch = false, nobreak, spacing = ''} = options; const content = Buffer.from(readFileSync(this.filePath)); const aspect = stretch ? 'preserveAspectRatio=0;' : ''; const linebreak = nobreak ? '' : '\n'; const newline = align > 1 ? `\u001BH\u001B[${align}A` : linebreak; return `${prefix}${aspect}size=${content.length}${this.config}:${ content.toString('base64') - }${suffix}${newline}` + }${suffix}${newline}${spacing}` } } function createImage(source) { @@ -305,7 +306,7 @@ function truwrap({ if (outStream.isTTY) { return outStream.columns || outStream.getWindowSize()[0] } - return Infinity + return 120 })(); const viewWidth = (function () { if (ttyWidth - left - right > 1) { @@ -355,7 +356,7 @@ function truwrap({ }; switch (true) { case !ttyActive: - console.info(colorReplacer`${'yellow|Non-TTY'}: width: Infinity`); + console.info(colorReplacer`${'yellow|Non-TTY'}: width: 120`); return Object.assign(Object.create(api), { getWidth: () => ttyWidth }) @@ -404,7 +405,7 @@ const images = (function () { })(); async function help(yargsInstance) { const header = () => stripIndent(colorReplacer)` - ${`title| ${metadata.name}`} + ${`title|${metadata.name}`} ${images.space}${metadata.description} ${images.space}${`grey|${metadata.version(3)}`} `; @@ -418,7 +419,7 @@ async function help(yargsInstance) { `; const epilogue = stripIndent(colorReplacer)` ${`title|${metadata.name}`} ${`white|${metadata.copyright}`}. ${`grey|Released under the ${metadata.license} License.`} - ${`grey|An Open Source component from ByteTree.com's terminal visualisation toolkit.`} + ${'grey|An Open Source component from ByteTree.com\'s terminal visualisation toolkit'} ${`grey|Issues?: ${metadata.bugs}`} `; const container = truwrap({ @@ -436,6 +437,7 @@ async function help(yargsInstance) { container.write(images.cc.render({ nobreak: false, align: 2, + spacing: ' ', })); container.write(header()).break(); container.write(`${clr.dark}${'—'.repeat(windowWidth)}${clr.dark.out}`).break(); @@ -578,37 +580,37 @@ if (!(process.env.USER === 'root' && process.env.SUDO_USER !== process.env.USER) if (argv.help) { (async () => { await help(yargsInstance); - process.exit(0); })(); -} -const viewSettings = { - left: argv.left, - right: argv.right, - mode: argv.mode, - tabWidth: argv.tab, - outStream -}; -if (argv.regex) { - viewSettings.tokenRegex = new RegExp(argv.regex, 'g'); -} -if (argv.width) { - viewSettings.width = argv.width; -} -const renderer = truwrap(viewSettings); -if (argv.stamp) { - renderer.write(format(...argv._)); - process.exit(0); -} -getStdin().then(input => { - if (argv.panel) { - const panel$1 = panel(input, argv.delimiter, renderer.getWidth()); - renderer.panel(panel$1.content, { - maxLineWidth: renderer.getWidth(), - showHeaders: false, - truncate: argv.truncate, - config: panel$1.configuration - }); - } else { - renderer.write(input); +} else { + const viewSettings = { + left: argv.left, + right: argv.right, + mode: argv.mode, + tabWidth: argv.tab, + outStream + }; + if (argv.regex) { + viewSettings.tokenRegex = new RegExp(argv.regex, 'g'); } -}); + if (argv.width) { + viewSettings.width = argv.width; + } + const renderer = truwrap(viewSettings); + if (argv.stamp) { + renderer.write(format(...argv._)); + process.exit(0); + } + getStdin().then(input => { + if (argv.panel) { + const panel$1 = panel(input, argv.delimiter, renderer.getWidth()); + renderer.panel(panel$1.content, { + maxLineWidth: renderer.getWidth(), + showHeaders: false, + truncate: argv.truncate, + config: panel$1.configuration + }); + } else { + renderer.write(input); + } + }); +}