From aad10d84b0d9c077c60e4c2a6f3d51f7d0441162 Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Wed, 13 Jun 2018 08:00:40 +0200 Subject: [PATCH] chore: migrate to cli-table3 --- package.json | 2 +- scripts/all-command-help.js | 2 +- src/util/commandline/category-command.ts | 4 ++-- src/util/commandline/help.ts | 2 +- src/util/interaction/out.ts | 12 ++++++------ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index b4717fba3..2762833e5 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "bplist": "0.0.4", "chalk": "^1.1.3", "cli-spinner": "^0.2.5", - "cli-table2": "^0.2.0", + "cli-table3": "^0.5.0", "date-fns": "^1.28.5", "debug": "^2.2.0", "event-stream": "^3.3.4", diff --git a/scripts/all-command-help.js b/scripts/all-command-help.js index e7b3c2f08..b7cac9aaa 100644 --- a/scripts/all-command-help.js +++ b/scripts/all-command-help.js @@ -11,7 +11,7 @@ const fs = require('fs') const os = require('os') const path = require('path') const util = require('util') -const Table = require('cli-table2') +const Table = require('cli-table3') const { getClassHelpText, getOptionsDescription, getPositionalOptionsDescription } = require('../dist/util/commandline/option-decorators') const { getOptionsForTwoColumnTableWithNoBorders } = require('../dist/util/interaction/out') function checkStats(dir, fileName, checker) { diff --git a/src/util/commandline/category-command.ts b/src/util/commandline/category-command.ts index f9156ccf7..353105ac3 100644 --- a/src/util/commandline/category-command.ts +++ b/src/util/commandline/category-command.ts @@ -7,7 +7,7 @@ import { scriptName } from "../misc"; import { getClassHelpText } from "./option-decorators"; import * as chalk from "chalk"; -const Table = require("cli-table2"); +const Table = require("cli-table3"); const debug = require("debug")("appcenter-cli:util:commandline:category-command"); // "filler" command used to display category help @@ -52,7 +52,7 @@ export class CategoryCommand extends Command { debug(`Looking for category description in directory ${this.commandPath}`); const helpPath = path.join(this.commandPath, category, "category.txt"); try { - // Replacing CRLF with LF to make sure that cli-table2 will be able to correctly split the string + // Replacing CRLF with LF to make sure that cli-table3 will be able to correctly split the string const helpText = fs.readFileSync(helpPath, "utf8").replace(/\r\n/g, "\n"); return helpText; } catch (err) { diff --git a/src/util/commandline/help.ts b/src/util/commandline/help.ts index 59ed0bfe1..b0ccc86f8 100644 --- a/src/util/commandline/help.ts +++ b/src/util/commandline/help.ts @@ -7,7 +7,7 @@ import * as chalk from "chalk"; const debug = require("debug")("appcenter-cli:util:commandline:help"); -const Table = require("cli-table2"); +const Table = require("cli-table3"); import { getClassHelpText, getOptionsDescription, getPositionalOptionsDescription diff --git a/src/util/interaction/out.ts b/src/util/interaction/out.ts index 44d8b61b8..b8f762ec5 100644 --- a/src/util/interaction/out.ts +++ b/src/util/interaction/out.ts @@ -7,7 +7,7 @@ import * as os from "os"; import * as wrap from "wordwrap"; import * as tty from "tty"; -const Table = require("cli-table2"); +const Table = require("cli-table3"); const Spinner = require("cli-spinner").Spinner; import { terminal } from "./terminal"; @@ -96,9 +96,9 @@ export function text(...args: any[]): void { // // Output tabular data. -// By default, does a simple default table using cli-table2. +// By default, does a simple default table using cli-table3. // If you want to, you can pass in explicit table initialization -// options. See https://github.com/jamestalmage/cli-table2 for docs +// options. See https://github.com/jamestalmage/cli-table3 for docs // on the module. // export function table(options: any, data: any[]): void; @@ -123,7 +123,7 @@ export function table(...args: any[]): void { } } -// Formatting helper for cli-table2 - default command output table style +// Formatting helper for cli-table3 - default command output table style export function getCommandOutputTableOptions(header: string[]): object { return { head: header, @@ -134,7 +134,7 @@ export function getCommandOutputTableOptions(header: string[]): object { } // -// Formatting helper for cli-table2 - two columns with no table outlines. Used by +// Formatting helper for cli-table3 - two columns with no table outlines. Used by // help commands for formatting lists of options, commands, etc. // export function getOptionsForTwoColumnTableWithNoBorders(firstColumnWidth: number) { @@ -421,7 +421,7 @@ function getMarginStringFromLevel(level: number) { } // -// Formatting helper for cli-table2 - table with borders which can be moved to the right +// Formatting helper for cli-table3 - table with borders which can be moved to the right // It is used to show sub-tables // function getTableWithLeftMarginOptions(leftMargin: string) {