Skip to content

Remove ansi-escapes from cli-kit (inline OSC-8 hyperlink)#7722

Draft
amcaplan wants to merge 1 commit into
mainfrom
remove-dep/ansi-escapes
Draft

Remove ansi-escapes from cli-kit (inline OSC-8 hyperlink)#7722
amcaplan wants to merge 1 commit into
mainfrom
remove-dep/ansi-escapes

Conversation

@amcaplan
Copy link
Copy Markdown
Contributor

@amcaplan amcaplan commented Jun 5, 2026

What

Removes the ansi-escapes npm dependency from @shopify/cli-kit and replaces its only usage with a self-contained 3-line OSC-8 hyperlink helper.

Why

ansi-escapes has generated 52 Dependabot version bumps over 24 months in this repo. The only API used is ansiEscapes.link(text, url), which is a trivial OSC-8 escape sequence. Inlining it eliminates the dependency entirely, reducing Dependabot churn with no functional change.

Implementation

The replacement helper (BEL terminator variant, matches the original library's output):

function osc8Link(text: string, url: string): string {
  return `\x1b]8;;\${url}\x07\${text}\x1b]8;;\x07`
}

Applied to:

  • packages/cli-kit/src/private/node/ui/components/Link.tsx
  • packages/cli-kit/src/private/node/content-tokens.ts

Platform/terminal hyperlink support detection continues to be handled externally by supports-hyperlinks — no change to that logic.

Validation

  • pnpm --filter @shopify/cli-kit type-check — passes
  • pnpm --filter @shopify/cli-kit lint — passes
  • pnpm --filter @shopify/cli-kit exec vitest run — Link + content-tokens tests: 10/10 passing

🤖 Automated dependency-removal initiative — AI-generated draft, needs human review.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant