Skip to content

Conversation

@Refzlund
Copy link
Owner

@Refzlund Refzlund commented Nov 6, 2025

No description provided.

- 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)
@Refzlund Refzlund requested a review from Copilot November 6, 2025 20:13
@changeset-bot
Copy link

changeset-bot bot commented Nov 6, 2025

🦋 Changeset detected

Latest commit: 93a7415

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

This PR includes changesets to release 1 package
Name Type
xult Minor

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

Copy link
Contributor

Copilot AI left a 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.

Refzlund and others added 2 commits November 6, 2025 21:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Refzlund Refzlund merged commit c853595 into release Nov 6, 2025
1 check passed
@Refzlund Refzlund deleted the feat-console-logging branch November 6, 2025 20:18
@github-actions github-actions bot mentioned this pull request Nov 6, 2025
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.

2 participants