Skip to content

chore: replace strip-ansi with util.stripVTControlCharacters #5267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

Phillip9587
Copy link
Contributor

@Phillip9587 Phillip9587 commented Dec 6, 2024

PR Checklist

Overview

Replaced strip-ansi with util.stripVTControlCharacters

Copy link

linux-foundation-easycla bot commented Dec 6, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

@JoshuaKGoldberg
Copy link
Member

Indeed, still in triage. I want to wait and see if the other members of @mochajs/maintenance-crew have inputs. Marking this PR as a draft in the meantime. Thanks for sending!

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as draft December 7, 2024 17:49
@JoshuaKGoldberg
Copy link
Member

Nobody posted and this seems like a pretty straightforward dependency-to-builtin swap. I marked the issue as accepting PRs. Let's do this! 🚀

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review January 2, 2025 04:22
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

🚀 Great, glad it's such a straightforward swap-out!

I ran this locally and confirmed http://localhost:8080/#command-line-usage still has control characters stripped out.

@JoshuaKGoldberg JoshuaKGoldberg changed the title feat: replace strip-ansi with util.stripVTControlCharacters docs: replace strip-ansi with util.stripVTControlCharacters Jan 2, 2025
@JoshuaKGoldberg JoshuaKGoldberg changed the title docs: replace strip-ansi with util.stripVTControlCharacters chore: replace strip-ansi with util.stripVTControlCharacters Jan 2, 2025
@JoshuaKGoldberg JoshuaKGoldberg merged commit 3c191c0 into mochajs:main Jan 2, 2025
106 of 107 checks passed
@Phillip9587 Phillip9587 deleted the remove-strip-ansi branch January 2, 2025 08:22
@voxpelli voxpelli requested a review from Copilot June 12, 2025 07:57
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Replaces the external strip-ansi dependency with Node’s built-in util.stripVTControlCharacters for stripping ANSI/VTE control codes.

  • Removed strip-ansi from devDependencies in package.json
  • Updated the usage example in docs/_data/usage.js to import and call stripVTControlCharacters from the Node util module

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
package.json Removed the obsolete strip-ansi entry
docs/_data/usage.js Swapped out strip-ansi for util.stripVTControlCharacters
Comments suppressed due to low confidence (1)

package.json:164

  • Since util.stripVTControlCharacters is only available in Node.js v16.9.0 and later, consider updating the engines field in package.json to enforce a minimum Node.js version, preventing unexpected build or runtime errors.
"strip-ansi": "^6.0.0",

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.

🛠️ Repo: Replace strip-ansi with util.stripVTControlCharacters
2 participants