Skip to content

Commit 6632fff

Browse files
ryancbahanclaude
andcommitted
Remove terminal-link, use existing ansi-escapes and supports-hyperlinks
The single call site in content-tokens.ts is replaced with a direct check of supportsHyperlinks.stdout and ansiEscapes.link(), both of which are already dependencies used by the Link.tsx component. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9941d53 commit 6632fff

3 files changed

Lines changed: 6 additions & 23 deletions

File tree

packages/cli-kit/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@
156156
"stacktracey": "2.1.8",
157157
"strip-ansi": "7.1.0",
158158
"supports-hyperlinks": "3.1.0",
159-
"terminal-link": "3.0.0",
160159
"ts-error": "1.0.6",
161160
"which": "4.0.0",
162161
"zod": "3.24.4"

packages/cli-kit/src/private/node/content-tokens.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import colors from '../../public/node/colors.js'
22
import {OutputMessage, stringifyMessage} from '../../public/node/output.js'
33
import {relativizePath} from '../../public/node/path.js'
4-
import terminalLink from 'terminal-link'
4+
import ansiEscapes from 'ansi-escapes'
5+
import supportsHyperlinks from 'supports-hyperlinks'
56
import cjs from 'color-json'
67
import type {Change} from 'diff'
78

@@ -35,7 +36,10 @@ export class LinkContentToken extends ContentToken<OutputMessage> {
3536
const text = colors.green(stringifyMessage(this.value))
3637
const url = this.link ?? ''
3738
const defaultFallback = this.value === this.link ? text : `${text} ( ${url} )`
38-
return terminalLink(text, url, {fallback: () => this.fallback ?? defaultFallback})
39+
if (supportsHyperlinks.stdout) {
40+
return ansiEscapes.link(text, url)
41+
}
42+
return this.fallback ?? defaultFallback
3943
}
4044
}
4145

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)