Skip to content

fix: properly quote dependencies with colon in yarn.lock #21194

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

robobun
Copy link
Collaborator

@robobun robobun commented Jul 19, 2025

Summary

  • Fixed yarn.lock generation to properly quote dependencies with special characters like catalog:* and workspace:*
  • Added : to the list of characters that require quoting in dependency names
  • Added regression test to ensure the fix works correctly

Test plan

  • Added regression test in test/regression/issue/20774.test.ts
  • Test passes with debug build (bun bd test)
  • Test fails with original bun (bun test)
  • Manually verified yarn.lock output with workspace dependencies

Fixes #20774

🤖 Generated with Claude Code

When using `bun install --yarn`, dependencies with special characters like `catalog:*` and `workspace:*` were not being properly quoted in the generated yarn.lock file. This could cause installation issues when using the lockfile with yarn.

This fix adds `:` to the list of characters that require quoting in dependency names, ensuring proper YAML escaping.

Fixes #20774

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@robobun
Copy link
Collaborator Author

robobun commented Jul 19, 2025

Updated 4:39 AM PT - Jul 19th, 2025

@autofix-ci[bot], your commit 20efc37 is building: #21001

Copy link
Member

@dylan-conway dylan-conway left a comment

Choose a reason for hiding this comment

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

Let's move the test out of test/regression because the issue is not a regression. We'll probably want to update this. I think it's causing claude to always create regression tests.

* `regression/issue/[number]` - Regression tests, always make one when fixing a particular issue

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.

Incorrect Quoting in generated lockfile with bun install --yarn
2 participants