Skip to content

fix(bundler): check bun exists in PATH before compile#98

Merged
zrosenbauer merged 1 commit intomainfrom
fix/bundler-check-bun-exists
Mar 24, 2026
Merged

fix(bundler): check bun exists in PATH before compile#98
zrosenbauer merged 1 commit intomainfrom
fix/bundler-check-bun-exists

Conversation

@zrosenbauer
Copy link
Copy Markdown
Member

Summary

  • Adds a bun --version check at the start of compile() to verify bun is available in PATH
  • Returns a clear error message with install link when bun is missing instead of a cryptic ENOENT
  • Adds test coverage for the missing-bun scenario and updates existing tests to account for the new check

Test plan

  • pnpm typecheck passes
  • pnpm lint passes (oxlint)
  • pnpm format passes (oxfmt)
  • pnpm test --filter=@kidd-cli/bundler — all 108 tests pass

Return a clear error when `bun` is not installed instead of failing with
a cryptic ENOENT from execFile.

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
oss-kidd Error Error Mar 24, 2026 6:40pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 24, 2026

🦋 Changeset detected

Latest commit: 6a0fbc5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@kidd-cli/bundler Patch
@kidd-cli/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 24, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing fix/bundler-check-bun-exists (6a0fbc5) with main (ea67f10)

Open in CodSpeed

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: de626e35-4a54-418d-a215-394476862cbb

📥 Commits

Reviewing files that changed from the base of the PR and between ea67f10 and 6a0fbc5.

⛔ Files ignored due to path filters (1)
  • .changeset/check-bun-exists.md is excluded by !.changeset/**
📒 Files selected for processing (2)
  • packages/bundler/src/compile/compile.test.ts
  • packages/bundler/src/compile/compile.ts

📝 Walkthrough

Walkthrough

The PR adds a preflight check to the compile() function that verifies bun availability by running bun --version before attempting compilation. A new private checkBunExists() function wraps this command and returns early with an error if bun is not installed. Corresponding test changes add a test case validating the error path and refactor existing tests to properly sequence multiple execFile mock implementations, since compile() now makes multiple invocations to execFile.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • kidd#96: Both PRs modify packages/bundler/src/compile/compile.ts and its tests to adjust bun invocation handling, including refactoring execFile call sequencing and error handling logic.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the primary change: adding a preflight check for bun existence before compilation.
Description check ✅ Passed The description clearly relates to the changeset, outlining the bun availability check, error handling improvement, and test coverage additions.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bundler-check-bun-exists

Comment @coderabbitai help to get the list of available commands and usage tips.

@zrosenbauer zrosenbauer merged commit 82740fc into main Mar 24, 2026
6 of 7 checks passed
@zrosenbauer zrosenbauer deleted the fix/bundler-check-bun-exists branch March 24, 2026 18:54
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.

1 participant