Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate to cli-table3 #451

Merged
merged 1 commit into from
Jun 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion scripts/all-command-help.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/util/commandline/category-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/util/commandline/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/util/interaction/out.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand All @@ -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,
Expand All @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down