Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 17, 2025

Removes the ansis external dependency by migrating to Node.js native util.styleText for terminal text styling.

Changes

  • Created shared color utility (src/utils/color.utils.ts) wrapping util.styleText with helper functions
  • Updated all command files to import from shared utility instead of ansis
  • Removed ansis dependency from package.json
  • Bumped minimum Node.js version to >=22.13.0 (where util.styleText is stable/backported)
  • Added ESLint override for n/no-unsupported-features/node-builtins to allow util.styleText

Example

Before:

import { cyan, green, red, yellow } from 'ansis'

After:

import { cyan, green, red, yellow } from '../utils/color.utils.js'

Where color.utils.ts provides:

import { styleText } from 'node:util'

export const cyan = (text: string) => styleText('cyan', text)
export const green = (text: string) => styleText('green', text)
// ... etc
Original prompt

Prepare a PR to migrate the usages of ansis to the new util.styleText node utility (https://nodejs.org/docs/latest-v22.x/api/util.html#utilstyletextformat-text-options) to remove that external dependency.

Check compatibility after migration and update relevant package details if needed (e.g. increase min Node version identifier in package.json, etc..)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Migrate usages of ansis to util.styleText utility Migrate from ansis to util.styleText Dec 17, 2025
Copilot AI requested a review from panz3r December 17, 2025 15:14
@panz3r panz3r marked this pull request as ready for review December 18, 2025 18:16
@panz3r panz3r changed the title Migrate from ansis to util.styleText feat!: migrate from ansis to util.styleText Dec 18, 2025
@panz3r panz3r merged commit cb63c99 into main Dec 18, 2025
11 checks passed
@panz3r panz3r deleted the copilot/migrate-ansis-to-util-styletext branch December 18, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants