-
Notifications
You must be signed in to change notification settings - Fork 88
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
Support for new bun.lock file #2782
Comments
Thank you for filing this issue! |
Same issue here Sample failed run: https://github.com/CodeWithShreyans/guider/actions/runs/12439445332 |
same, using bun 1.1.40 |
# Why Bun v1.1.39 introduced a new text-based lockfile format (bun.lock) as an alternative to the binary format (bun.lockb). This change adds support for detecting and using both formats. https://bun.sh/blog/bun-lock-text-lockfile Similar to: expo/eas-cli#2782 (I am not sure how EAS resolves the package manager, hopefully through Expo?) # How The changes were implemented by: 1. Adding support for both lockfile formats in the package manager resolution logic: - Added `BUN_TEXT_LOCK_FILE` constant for the new 'bun.lock' format - Updated `resolvePackageManager` to check for both lockfile formats - Modified the lockFiles record to support multiple lockfile paths per package manager 2. Updated documentation: - Added new section about text-based lockfile in using-bun.mdx - Updated CLI help text to reflect support for both formats - Updated EAS build documentation to mention both lockfile formats 3. Added comprehensive test coverage: - Tests for text lockfile only - Tests for binary lockfile only - Tests for both lockfiles present - Tests for monorepo workspace scenarios 4. Updated cleanup utilities to handle both lockfile formats: - Modified `reinstallPackagesAsync` to clean up both `bun.lock` and `bun.lockb` - Updated gitignore to include both lockfile formats # Test Plan 1. Basic functionality test: ```bash expo/expo/packages/@expo/cli/build/bin/cli install @supabase/supabase-js ``` - Without changes: Incorrectly picks up npm as the package manager - With changes: Correctly identifies bun as the package manager when either `bun.lock` or `bun.lockb` is present 2. Automated tests: - Added comprehensive test suite in `nodeManagers-test.ts` covering: - Package manager resolution with text lockfile - Package manager resolution with binary lockfile - Package manager resolution with both lockfiles - Monorepo workspace scenarios - Various lockfile combinations # Checklist <!-- Please check the appropriate items below if they apply to your diff. --> - [x] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [x] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) --------- Co-authored-by: Cedric van Putten <[email protected]>
Bun v1.1.39 introduced a new text-based lockfile format (bun.lock) as an alternative to the binary format (bun.lockb). This change adds support for detecting and using both formats. https://bun.sh/blog/bun-lock-text-lockfile Similar to: expo/eas-cli#2782 (I am not sure how EAS resolves the package manager, hopefully through Expo?) The changes were implemented by: 1. Adding support for both lockfile formats in the package manager resolution logic: - Added `BUN_TEXT_LOCK_FILE` constant for the new 'bun.lock' format - Updated `resolvePackageManager` to check for both lockfile formats - Modified the lockFiles record to support multiple lockfile paths per package manager 2. Updated documentation: - Added new section about text-based lockfile in using-bun.mdx - Updated CLI help text to reflect support for both formats - Updated EAS build documentation to mention both lockfile formats 3. Added comprehensive test coverage: - Tests for text lockfile only - Tests for binary lockfile only - Tests for both lockfiles present - Tests for monorepo workspace scenarios 4. Updated cleanup utilities to handle both lockfile formats: - Modified `reinstallPackagesAsync` to clean up both `bun.lock` and `bun.lockb` - Updated gitignore to include both lockfile formats 1. Basic functionality test: ```bash expo/expo/packages/@expo/cli/build/bin/cli install @supabase/supabase-js ``` - Without changes: Incorrectly picks up npm as the package manager - With changes: Correctly identifies bun as the package manager when either `bun.lock` or `bun.lockb` is present 2. Automated tests: - Added comprehensive test suite in `nodeManagers-test.ts` covering: - Package manager resolution with text lockfile - Package manager resolution with binary lockfile - Package manager resolution with both lockfiles - Monorepo workspace scenarios - Various lockfile combinations <!-- Please check the appropriate items below if they apply to your diff. --> - [x] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [x] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) --------- Co-authored-by: Cedric van Putten <[email protected]> (cherry picked from commit a96a6fe)
…#482) # Why fixes expo/eas-cli#2782 # How - `@expo/[email protected]` supports bun text-based lock file. this pr bumps the version - replace `findWorkspaceRoot -> resolveWorkspaceRoot` because of breaking change from expo/expo#31124 - as new package-manager uses `node:fs` under the hood. it breaks jest tests, we have to replicate the [changes](expo/expo#31690) here
the updated |
Thanks for the quick addition! It works perfectly fine on EAS cloud builds, but if you try to build using Local Is there something extra that needs to be done for that? I have upgraded our app to the latest expo version. |
I opened up a PR for this supporting the new lock files on local builds as well - please take a look when you get a chance - #2817 |
Build/Submit details page URL
https://expo.dev/accounts/mubin-memorang/projects/new-bun-lock/builds/9bdab95d-e384-4223-b82e-40ed9e6e7ffd
Summary
With Bun v1.1.39, Bun has introduced a new text based lockfile. This really helps our workflow during reviews to see what changed, and is also something that will be the new default with Bun 1.2 (this replaces the binary lockfile
bun.lockb
).Right now, if you try to build the app with EAS using the new text based lockfile,
EAS
detects the project asyarn
based, causing it to useyarn
and create a lockfile from scratch.This should not be the case, and it should also start detecting the
bun.lock
file as a bun project.Managed or bare?
Managed
Environment
expo-env-info 1.2.1 environment info:
System:
OS: macOS 15.2
Shell: 5.9 - /bin/zsh
Binaries:
Node: 21.7.3 - ~/.nvm/versions/node/v21.7.3/bin/node
npm: 10.5.0 - ~/.nvm/versions/node/v21.7.3/bin/npm
Watchman: 2024.11.25.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.16.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 24.2, iOS 18.2, macOS 15.2, tvOS 18.2, visionOS 2.2, watchOS 11.2
Android SDK:
API Levels: 34, 35
Build Tools: 33.0.1, 34.0.0, 35.0.0, 35.0.0
System Images: android-34 | Google APIs ARM 64 v8a, android-34 | Google Play ARM 64 v8a
IDEs:
Android Studio: 2024.1 AI-241.18034.62.2411.12071903
Xcode: 16.2/16C5032a - /usr/bin/xcodebuild
npmPackages:
expo: ~52.0.20 => 52.0.21
expo-router: ~4.0.14 => 4.0.14
react: 18.3.1 => 18.3.1
react-dom: 18.3.1 => 18.3.1
react-native: 0.76.5 => 0.76.5
react-native-web: ~0.19.13 => 0.19.13
npmGlobalPackages:
eas-cli: 14.2.0
Expo Workflow: managed
✔ Check package.json for common issues
✔ Check Expo config for common issues
✔ Check native tooling versions
✔ Check if the project meets version requirements for submission to app stores
✔ Check for common project setup issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for app config fields that may not be synced in a non-CNG project
✔ Check npm/ yarn versions
✔ Check for issues with Metro config
✔ Validate packages against React Native Directory package metadata
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that native modules do not use incompatible support packages
✔ Check for legacy global CLI installed locally
✔ Check that native modules use compatible support package versions for installed Expo SDK
✔ Check that packages match versions required by installed Expo SDK
Didn't find any issues with the project!
Error output
No response
Reproducible demo or steps to reproduce from a blank project
bun create expo-app
and then migrated to use the new lockfile).projectId
andowner
inapp.json
to your credentials.eas build --platform ios --profile development-simulator
.The text was updated successfully, but these errors were encountered: