Skip to content

feat(bundler): add verbose error logging to tsdown build and watch#165

Merged
zrosenbauer merged 3 commits into
mainfrom
feat/bundler-verbose-errors
Apr 14, 2026
Merged

feat(bundler): add verbose error logging to tsdown build and watch#165
zrosenbauer merged 3 commits into
mainfrom
feat/bundler-verbose-errors

Conversation

@zrosenbauer
Copy link
Copy Markdown
Member

Summary

  • Adds verbose error logging to tsdown build() and watch() steps, matching the existing behavior in bun compile()
  • Introduces formatBuildError() helper shared by both build and watch, which includes the full error message when verbose is enabled
  • Adds BuildOverrides type and verbose flag to WatchOverrides for per-call control

Test plan

  • pnpm typecheck passes
  • pnpm lint passes (0 warnings, 0 errors)
  • pnpm test passes (116 tests)

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 14, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
oss-kidd Ignored Ignored Preview Apr 14, 2026 8:41pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 14, 2026

🦋 Changeset detected

Latest commit: b459ae7

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 Minor
@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

…ests

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

codspeed-hq Bot commented Apr 14, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing feat/bundler-verbose-errors (b459ae7) with main (28be203)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

Warning

Rate limit exceeded

@zrosenbauer has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 43 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 6 minutes and 43 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5a1c2fe9-d65c-426e-8dc5-4bc4ca63a98c

📥 Commits

Reviewing files that changed from the base of the PR and between 5c61a40 and b459ae7.

📒 Files selected for processing (4)
  • packages/bundler/src/build/build.ts
  • packages/bundler/src/build/watch.ts
  • packages/bundler/src/utils/format-error.test.ts
  • packages/bundler/src/utils/format-error.ts
📝 Walkthrough

Walkthrough

This change introduces an optional verbose parameter throughout the bundler's build and watch lifecycle. A new formatBuildError utility conditionally formats error messages based on the verbose flag. The parameter is threaded through build(), watch(), the bundler factory's returned methods, and new BuildOverrides and WatchOverrides types, enabling per-call verbosity control over error output.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(bundler): add verbose error logging to tsdown build and watch' clearly and directly summarizes the main change: adding verbose error logging capability to build and watch functions.
Description check ✅ Passed The description is directly related to the changeset, detailing the addition of verbose error logging to tsdown build and watch steps, the new formatBuildError helper, and type additions, with verification of test passage.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/bundler-verbose-errors

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/bundler/src/build/build.ts`:
- Around line 20-33: Refactor the exported function formatBuildError to accept a
single object parameter (e.g., { phase, error, verbose }) instead of three
positional args, replace the current if/instanceof logic inside formatBuildError
with ts-pattern's match() to branch on verbose and the error type/message, and
update all call sites that invoke formatBuildError (notably the call in build.ts
that currently calls formatBuildError(...) and the call in watch.ts) to pass an
object with keys phase, error, and verbose.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f96ed92d-2da0-44e9-860e-70add95d11b5

📥 Commits

Reviewing files that changed from the base of the PR and between 28be203 and 5c61a40.

⛔ Files ignored due to path filters (1)
  • .changeset/bundler-verbose-errors.md is excluded by !.changeset/**
📒 Files selected for processing (4)
  • packages/bundler/src/build/build.ts
  • packages/bundler/src/build/watch.ts
  • packages/bundler/src/bundler.ts
  • packages/bundler/src/types.ts

Comment thread packages/bundler/src/build/build.ts Outdated
Co-Authored-By: Claude <noreply@anthropic.com>
@zrosenbauer zrosenbauer merged commit f5d402a into main Apr 14, 2026
12 checks passed
@zrosenbauer zrosenbauer deleted the feat/bundler-verbose-errors branch April 14, 2026 20:47
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