Skip to content

Conversation

@thomasKn
Copy link
Contributor

Summary

Bun 1.2 introduced bun.lock as a text-based alternative to the binary bun.lockb lockfile. This PR adds support for detecting either lockfile format in the Hydrogen CLI.

Changes

  • Added alternativeLockfiles property to the PackageManager interface to support multiple lockfile formats per package manager
  • Updated lockfile detection in check-lockfile.ts to check both primary and alternative lockfiles
  • Updated deploy error handling in deploy.ts to recognize changes to alternative lockfiles
  • Added tests for both bun.lock and bun.lockb detection

Related

Test plan

  • Added unit tests for bun.lock detection
  • Added unit tests for bun.lockb detection
  • All existing tests pass

🤖 Generated with Claude Code

thomasKn and others added 2 commits January 25, 2026 00:33
Bun 1.2 introduced bun.lock as a text-based alternative to the binary
bun.lockb. This change adds an alternativeLockfiles property to the
PackageManager interface to support detecting either lockfile format.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@thomasKn thomasKn requested a review from a team as a code owner January 25, 2026 05:46
- Revert variable name to foundPackageManagers to reduce diff
- Add npm-shrinkwrap.json as alternative lockfile for npm
- Improve tests to verify actual lockfile names in output
'@shopify/cli-hydrogen': patch
---

Add support for Bun's text-based lockfile (`bun.lock`) introduced in Bun 1.2, in addition to the existing binary lockfile (`bun.lockb`).
Copy link
Contributor

@fredericoo fredericoo Jan 28, 2026

Choose a reason for hiding this comment

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

Suggested change
Add support for Bun's text-based lockfile (`bun.lock`) introduced in Bun 1.2, in addition to the existing binary lockfile (`bun.lockb`).
Add support for Bun's text-based lockfile (`bun.lock`) introduced in Bun 1.2, and npm's shrinkwrap lockfile (`npm-shrinkwrap.json`), as alternatives to their respective primary lockfiles (`bun.lockb` and `package-lock.json`).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done ✅

Copy link
Contributor

@fredericoo fredericoo left a comment

Choose a reason for hiding this comment

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

my only nitpick was the changeset, but no one uses shrinkwrap anyway so dont take it as a requirement

@graygilmore graygilmore merged commit 284675a into Shopify:main Jan 29, 2026
11 of 13 checks passed
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