From a28d86ab7e653b83a85e3a84581876963c068a0c Mon Sep 17 00:00:00 2001 From: Alex Varchuk Date: Mon, 19 Sep 2022 18:46:49 +0300 Subject: [PATCH] chore: move boxen options to constant --- cli/index.ts | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/cli/index.ts b/cli/index.ts index 4ed2add6..55af2b6f 100644 --- a/cli/index.ts +++ b/cli/index.ts @@ -66,6 +66,14 @@ export const mimeTypes = { const BUNDLES_DIR = dirname(require.resolve('redoc')); +const boxenOptions = { + title: 'DEPRECATED', + titleAlignment: 'center', + padding: 1, + margin: 1, + borderColor: 'red', +} as boxen.Options; + const builderForBuildCommand = yargs => { yargs.positional('spec', { describe: 'path or URL to your spec', @@ -185,13 +193,7 @@ YargsParser.command( console.log(` ${boxen( 'This package is deprecated now.\n\nPlease use `@redocly/cli preview-docs ` instead.', - { - title: 'DEPRECATED', - titleAlignment: 'center', - padding: 1, - margin: 1, - borderColor: 'red', - }, + boxenOptions, )}`); return res; }, @@ -481,13 +483,7 @@ function notifyDeprecation(res: YargsParser.Arguments): YargsParser.Arguments { console.log( boxen( 'This package is deprecated now.\n\nPlease use `@redocly/cli build-docs ` instead.', - { - title: 'DEPRECATED', - titleAlignment: 'center', - padding: 1, - margin: 1, - borderColor: 'red', - }, + boxenOptions, ), ); return res;