Skip to content

refactor: replace chalk with Node.js built-in styleText#234

Open
kbrahmateja wants to merge 1 commit intoatlassian:mainfrom
kbrahmateja:main
Open

refactor: replace chalk with Node.js built-in styleText#234
kbrahmateja wants to merge 1 commit intoatlassian:mainfrom
kbrahmateja:main

Conversation

@kbrahmateja
Copy link
Copy Markdown

@kbrahmateja kbrahmateja commented Feb 8, 2026

What

This PR removes the chalk dependency and replaces it with Node.js built-in util.styleText for terminal styling.

Why

  • Reduces dependencies - Eliminates an external dependency by using Node.js native functionality
  • Smaller package size - No need to bundle chalk and its transitive dependencies
  • Future-proof - Uses the standard Node.js API that will be maintained as part of the runtime

Changes

  • Replaced all chalk usage in validation error formatters:
    • src/validation-errors/additional-prop.js
    • src/validation-errors/default.js
    • src/validation-errors/enum.js
    • src/validation-errors/required.js
  • Removed chalk from package.json dependencies
  • Updated test snapshots to reflect the new output format

Breaking Change ⚠️

This is a major version bump because it requires Node.js >= 20.12.0 (when util.styleText was introduced).


Rovo Dev couldn't review this pull request
Upgrade to Rovo Dev Standard to continue using code review.

@atlassian-cla-bot
Copy link
Copy Markdown

Thank you for your submission! Like many open source projects, we ask that you sign our CLA (Contributor License Agreement) before we can accept your contribution.
If your email is listed below, please ensure that you sign the CLA with the same email address.

The following users still need to sign our CLA:
❌kbrahmateja

Already signed the CLA? To re-check, try refreshing the page.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 8, 2026

🦋 Changeset detected

Latest commit: 8d4aa3a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@decompil3d
Copy link
Copy Markdown

@atlassian-cla-bot check

@decompil3d
Copy link
Copy Markdown

CLA is signed. Thank you for your patience.

Copy link
Copy Markdown
Author

@kbrahmateja kbrahmateja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Team,

Summary of changes:

  • Replaced chalk dependency with Node.js built-in util.styleText
  • Reduces external dependencies by leveraging native Node.js functionality
  • All tests pass with updated snapshots
    This is marked as a major version bump since it requires Node.js >= 20.12.0.
    Looking forward to your feedback! 🙏

"column": 19,
"line": 6,
"offset": 60,
"offset": 65,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kbrahmateja, sorry about the late review :(

I was wondering if we can avoid updating these offsets.

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.

3 participants