mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #119] [CLOSED] fix(deploy): detect bun.lock text format and walk up to monorepo root #326
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#326
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/119
Author: @harrisrobin
Created: 2/26/2026
Status: ❌ Closed
Base:
main← Head:fix/bun-lock-detection📝 Commits (2)
dd656fechore: add .worktrees/ to .gitignore3d1203dfix(deploy): detect bun.lock text format and walk up to monorepo root📊 Changes
3 files changed (+104 additions, -8 deletions)
View changed files
📝
.gitignore(+3 -0)📝
packages/vinext/src/utils/project.ts(+42 -8)📝
tests/deploy.test.ts(+59 -0)📄 Description
Problem
detectPackageManager(anddetectPackageManagerName) inutils/project.tshad two bugs that combined to makevinext deployfail in Bun monorepos:Wrong lockfile name. The function only checked for
bun.lockb— the legacy binary format. Bun v1.0+ writes a text-basedbun.lockfile. Projects using Bun ≥ v1.0 were not detected as Bun workspaces.No upward directory traversal. In a monorepo the lock file lives at the workspace root, not inside each app directory. When called from e.g.
apps/web/, the function only checked that directory — missed the root — and fell through tonpm install -D.Both issues together produced this confusing error at the end of the npm fallback:
Fix
bun.lockcheck alongside the existingbun.lockbcheck.detectPackageManager(returns install command) anddetectPackageManagerName(returns pm name).The helper is refactored into two small functions:
checkLockFiles(single-directory check) andfindLockFile(the upward walk), keeping each unit testable in isolation.Tests
7 new unit tests in
tests/deploy.test.ts:pnpm-lock.yamlyarn.lockbun.lock(text, new)bun.lockb(binary, legacy)apps/web/→ lock file at workspace root)pnpm-lock.yamlbeats outerbun.lock)pnpm run lintandpnpm run typecheckpass clean./bonk
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.