Skip to content

feat(internal): improve format support in node and bun#6630

Closed
easrng wants to merge 3 commits intodenoland:mainfrom
easrng:node-bun-format
Closed

feat(internal): improve format support in node and bun#6630
easrng wants to merge 3 commits intodenoland:mainfrom
easrng:node-bun-format

Conversation

@easrng
Copy link
Copy Markdown

@easrng easrng commented Apr 29, 2025

Adds support for formatting objects in recent node and bun versions using util.inspect without compromising the experience for users of other runtimes

@easrng easrng requested a review from kt3k as a code owner April 29, 2025 01:12
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 29, 2025

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2025

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.73%. Comparing base (096f0be) to head (aa39536).
⚠️ Report is 278 commits behind head on main.

Files with missing lines Patch % Lines
internal/format.ts 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6630      +/-   ##
==========================================
- Coverage   94.74%   94.73%   -0.01%     
==========================================
  Files         583      583              
  Lines       46478    46488      +10     
  Branches     6523     6525       +2     
==========================================
+ Hits        44036    44042       +6     
- Misses       2399     2402       +3     
- Partials       43       44       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@easrng easrng force-pushed the node-bun-format branch 4 times, most recently from 2b5b348 to 59c70c3 Compare April 29, 2025 01:53
Copy link
Copy Markdown
Contributor

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. This looks nice and aligned with our recent direction (towards more node compatibility).

Left some comments about test structure.

Comment thread internal/format_test.ts
assertEquals(
stripAnsiCode(format({ a: 1, b: 2 })),
`{
if (typeof Deno.inspect === "function") {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you use ignore option of Deno.test instead of big if block to exclude some tests in some environment? ref https://docs.deno.com/api/deno/~/Deno.TestDefinition

import "../../fs/unstable_chmod_test.ts";
import "../../fs/unstable_umask_test.ts";
import "../../fs/unstable_utime_test.ts";
import "../../internal/format_test.ts";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@bartlomieju
Copy link
Copy Markdown
Member

Closing due to inactivity — this PR has been stale for almost 11 months. Review feedback from @kt3k (using Deno.test's ignore option instead of if blocks for conditional tests) was never addressed.

If you'd like to revisit this, feel free to open a fresh PR with the requested changes. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants