Skip to content

fix: workaround for bun mangling unicode#104

Merged
JoshuaKGoldberg merged 4 commits intodmnd:mainfrom
mister-ben:fix-bun-unicode
Dec 17, 2025
Merged

fix: workaround for bun mangling unicode#104
JoshuaKGoldberg merged 4 commits intodmnd:mainfrom
mister-ben:fix-bun-unicode

Conversation

@mister-ben
Copy link
Copy Markdown
Contributor

PR Checklist

Overview

  • Adds a workaround to restore unicode characters mangled by Bun with a string replacement. This replacement runs only in a Bun environment. If the issue gets fixed in Bun, then a test for the version of process.versions.bun could perhaps be added later.
  • Adds types for Bun, needed for that environment check to lint.
  • Adds test:bun as a script, so that pnpm run test:bun will test decent.test.js with Bun's test runner instead of Jest, as long as Bun is installed. Includes a note in DEVELOPING.md.
  • Adds a test which failed before the change with Bun (but passed with Node/Jest).

Copy link
Copy Markdown
Collaborator

@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.

LGTM, thanks for jumping on this! ❤️

Just opining: I normally don't like adding in high-level/userland workarounds for lower-level/environment issues. But this one is pretty painful and the dedent project is pretty sedentary. We can remove it if and when Bun fixes Unicode handling.

@JoshuaKGoldberg JoshuaKGoldberg merged commit f7cb548 into dmnd:main Dec 17, 2025
11 checks passed
@JoshuaKGoldberg
Copy link
Copy Markdown
Collaborator

Published to dedent@1.7.1 on npm. 🚀

@mister-ben mister-ben deleted the fix-bun-unicode branch December 17, 2025 15:04
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 1, 2026

🎉 This is included in version v1.7.1 🎉

The release is available on:

Cheers! 📦🚀

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.

🐛 Bug: Unicode Get Mangled

2 participants