[terminal] Add TerminalTable class; [rush-lib] remove cli-table dependency#5785
Merged
iclanton merged 9 commits intomicrosoft:mainfrom Apr 18, 2026
Merged
[terminal] Add TerminalTable class; [rush-lib] remove cli-table dependency#5785iclanton merged 9 commits intomicrosoft:mainfrom
iclanton merged 9 commits intomicrosoft:mainfrom
Conversation
Add TerminalTable to @rushstack/terminal as a drop-in replacement for the cli-table and cli-table3 npm packages. Handles ANSI escape sequences when calculating column widths, and matches the chars/head/colWidths constructor API used by both packages. Replace cli-table usage in rush-lib (ListAction, InteractiveUpgradeUI) with TerminalTable, and remove the cli-table dependency. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…less option, getLines() - Rename all ITerminalTableChars members from kebab-case to camelCase - Rename `chars` option to `borderCharacters` - Add `borderless: true` shorthand (replaces verbose empty-string chars override) - Add `getLines(): string[]` method - Add JSDoc to ITerminalTableChars members with visual reference diagram - Update tests and snapshots Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… borderless option, getLines()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
TerminalTableclass to@rushstack/terminalfor rendering fixed-column tables in terminal output, then uses it in@microsoft/rushto eliminate thecli-tablenpm dependency.The new class correctly handles ANSI escape sequences when calculating column widths (the existing
cli-tablepackage inflates column widths when cells contain colored text).Details
@rushstack/terminal— newTerminalTableclass:head,colWidths,borderless, andborderCharactersoptionsborderless: truesuppresses all border lines (convenient for inquirer-style choice lists)borderCharactersaccepts partial overrides of individual border charactersgetLines(): string[]andtoString(): stringrender methodsAnsiEscape.removeCodes()for ANSI-aware visual width calculation@microsoft/rush— removescli-tabledependency:InteractiveUpgradeUI.ts: replacesCliTablewithTerminalTable({ borderless: true, ... })ListAction.ts: replaces dynamicimport('cli-table')withTerminalTablecli-tableand@types/cli-tablefromrush-lib/package.jsoncli-tablefromnonbrowser-approved-packages.jsonHow it was tested
Unit tests added for
TerminalTablecovering: header + rows, no header, auto-sized columns, fixedcolWidths,borderlessmode, single-line-per-row behavior in borderless mode,borderCharactersoverrides on top ofborderless, ANSI stripping, and empty table.