-
Notifications
You must be signed in to change notification settings - Fork 0
feat: pretty print console logs to terminal and browser console #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- import util.inspect and implement Result.log() and private #log(depth)
- pretty-print Ok/Err with colorized, structured output and truncated inspection for objects
- implement Node inspector hook ([Symbol.for('nodejs.util.inspect.custom')]) and custom toStringTag
- add tests/log.test.ts covering various value types and nested results
…ser) - Implement browser DevTools formatter for Result with styled header/body and inline value rendering (src/result.ts) - Improve terminal inspection (compact, numeric separators, maxArrayLength) and simplify Result.log() - Add LOG.md and image assets (.github/*) and update README to use new asset paths and mention pretty-printing - Update tests to exercise pretty logging (tests/log.test.ts) - Add @rolldown/plugin-node-polyfills and enable it in rolldown.config.ts (package.json & bun.lock updated)
🦋 Changeset detectedLatest commit: 93a7415 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds pretty printing functionality for Result objects in both terminal and browser environments. It introduces custom logging methods with ANSI colors for terminal output and custom DevTools formatters for browser consoles.
- Implements
log()method and custom inspect symbols for Result visualization - Adds browser DevTools formatter for enhanced console display
- Includes comprehensive test coverage for various data types
Reviewed Changes
Copilot reviewed 7 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/result.ts | Adds logging methods, custom inspect symbols, and browser DevTools formatter |
| tests/log.test.ts | Adds comprehensive tests for pretty printing various data types |
| rolldown.config.ts | Adds node polyfills plugin for util.inspect support |
| package.json | Adds @rolldown/plugin-node-polyfills dependency |
| README.md | Updates image paths and adds pretty print feature mention |
| LOG.md | New documentation file showcasing pretty log examples |
| .changeset/curvy-cars-teach.md | Changeset documenting the new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.