Skip to content

Commit 270e561

Browse files
committed
refactor(cli): remove unused terminal-link dep and dead exports
- Remove terminal-link from dependencies (never imported) - Remove unused exports: printSuccess, printWarning, printInfo (human.ts), outputTableList (table.ts) - Remove corresponding test for printSuccess
1 parent f8b2afb commit 270e561

5 files changed

Lines changed: 1 addition & 165 deletions

File tree

pnpm-lock.yaml

Lines changed: 0 additions & 129 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/cli/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"cli-table3": "^0.6.5",
3434
"commander": "^14.0.0",
3535
"ora": "^8.2.0",
36-
"terminal-link": "^3.0.0",
3736
"ui-common": "workspace:*",
3837
"ws": "^8.20.0"
3938
},

ui/cli/src/output/human.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
import chalk from 'chalk'
22
import process from 'node:process'
33

4-
export const printSuccess = (message: string): void => {
5-
process.stdout.write(chalk.green(`✓ ${message}\n`))
6-
}
7-
84
export const printError = (message: string): void => {
95
process.stderr.write(chalk.red(`✗ ${message}\n`))
106
}
11-
12-
export const printWarning = (message: string): void => {
13-
process.stderr.write(chalk.yellow(`⚠ ${message}\n`))
14-
}
15-
16-
export const printInfo = (message: string): void => {
17-
process.stderr.write(chalk.dim(` ${message}\n`))
18-
}

ui/cli/src/output/table.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,3 @@ const displayGenericPayload = (payload: ResponsePayload): void => {
4141
process.stdout.write(chalk.green('✓ Success\n'))
4242
}
4343
}
44-
45-
export const outputTableList = <T extends Record<string, unknown>>(
46-
items: T[],
47-
columns: { header: string; key: keyof T }[]
48-
): void => {
49-
if (items.length === 0) {
50-
process.stdout.write(chalk.dim('(no items)\n'))
51-
return
52-
}
53-
const table = new Table({ head: columns.map(c => chalk.white(c.header)) })
54-
for (const item of items) {
55-
table.push(columns.map(c => String(item[c.key] ?? '')))
56-
}
57-
process.stdout.write(table.toString() + '\n')
58-
}

ui/cli/tests/output.test.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, it } from 'node:test'
33
import { ResponseStatus } from 'ui-common'
44

55
import { createFormatter } from '../src/output/formatter.js'
6-
import { printError, printSuccess } from '../src/output/human.js'
6+
import { printError } from '../src/output/human.js'
77
import { outputJson, outputJsonError } from '../src/output/json.js'
88
import { outputTable } from '../src/output/table.js'
99

@@ -117,13 +117,6 @@ await describe('output formatters', async () => {
117117
assert.ok(output.includes('Success'))
118118
})
119119

120-
await it('should write success message via printSuccess', () => {
121-
const output = captureStdout(() => {
122-
printSuccess('done')
123-
})
124-
assert.ok(output.includes('done'))
125-
})
126-
127120
await it('should write error message via printError', () => {
128121
const output = captureStderr(() => {
129122
printError('oops')

0 commit comments

Comments
 (0)