Skip to content

[codex] Clarify bun lockfile detection errors#85

Draft
aouxwoux wants to merge 3 commits into
browserslist:mainfrom
aouxwoux:codex/clarify-bun-lockfile-error
Draft

[codex] Clarify bun lockfile detection errors#85
aouxwoux wants to merge 3 commits into
browserslist:mainfrom
aouxwoux:codex/clarify-bun-lockfile-error

Conversation

@aouxwoux

@aouxwoux aouxwoux commented Jul 2, 2026

Copy link
Copy Markdown

Fixes #56.

What changed

  • Detect the actual Bun lockfile path, including bun.lockb.
  • Add an explicit package manager override through --package-manager and UPDATE_BROWSERSLIST_DB_PM.
  • Show a clearer error when a Bun lockfile selects Bun but bun is not available on PATH.
  • Document the override and add regression coverage for the Bun error and override path.

Verification

  • pnpm unit
  • pnpm test:lint
  • node cli.js --help
  • node cli.js --package-manager exits with the expected missing-value error

Note: pnpm test reaches the same passing unit/lint steps locally, but Windows skips the existing Yarn/Bun probes because they redirect to /dev/null; CI runs on Ubuntu with Bun installed.

Comment thread cli.js Outdated
process.exit(1)
}

let packageManagerIndex = args.indexOf('--package-manager')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This part is not very readable. Let’s add getArgValue() helper.

Comment thread index.js Outdated
Comment thread index.js
@aouxwoux
aouxwoux force-pushed the codex/clarify-bun-lockfile-error branch from e124ec2 to 8163aa9 Compare July 3, 2026 10:17
Comment thread cli.js Outdated
Comment thread cli.js Outdated
Comment thread index.js Outdated
Comment thread index.js Outdated
@aouxwoux

aouxwoux commented Jul 6, 2026

Copy link
Copy Markdown
Author

pushed a follow-up for the review notes:

  • moved the missing/flag-looking package-manager value check into getArgValue()
  • removed the extra isArg(--package-manager) validation branch
  • moved lockfile path setup into getLockfile()
  • changed auto-detection to keep the first lockfile object instead of calling getLockfile() twice

checks passing locally with npm/pnpm shims:
pnpm unit, pnpm test:lint, git diff --check

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.

Error: Command failed: bun update caniuse-lite 'bun' is not recognized as an internal or external command, operable program or batch file.

2 participants