This change makes Bun's warning output much less scary by matching Node.js behavior.
Changes:
- Add --trace-warnings CLI flag support
- Format warnings as: (bun:PID) WarningName: message
- Show stack traces only when --trace-warnings is passed
- Show helpful hint about --trace-warnings flag (only once per process)
- Warnings go to stderr (not console.warn which showed full error objects)
Before:
process.emitWarning() would dump full error object with stack trace,
making every warning look like a critical error
After:
- Without --trace-warnings: Shows minimal format with helpful hint
- With --trace-warnings: Shows stack trace like Node.js
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>