Skip to content

Conversation

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Dec 24, 2025

Summary by CodeRabbit

  • Chores
    • Modernized package manifest to support both ESM and CJS consumers, added publish tag, license and author, and consolidated top‑level configuration.
    • Upgraded tooling dependency (oxfmt).
    • Moved and clarified lint-staged configuration.
  • Style
    • Fixed JSON/tsconfig formatting and adjusted module/compiler settings in fixture configs.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings December 24, 2025 15:46
@coderabbitai
Copy link

coderabbitai bot commented Dec 24, 2025

📝 Walkthrough

Walkthrough

Modernizes packaging: adds ESM/CJS entry points, types, exports map, publishConfig, license/author, and lint-staged configuration in package.json; upgrades oxfmt. Also fixes JSON trailing commas and minor formatting across several tsconfig.json fixture files and project configs.

Changes

Cohort / File(s) Summary
Package manifest
package.json
Adds type: "module", files, main, module, types, exports (import/require + ./package.json), publishConfig, license, author; moves/centralizes lint-staged config; updates oxfmt version; retains packageManager. Review exports mapping, dual ESM/CJS paths, and publish metadata.
Top-level TS config
tsconfig.json
Removes trailing commas / formatting fixes. No semantic change.
Test fixtures TS configs
test/fixtures/ts-cjs-es2021/tsconfig.json, test/fixtures/ts-esm/tsconfig.json, test/fixtures/ts/tsconfig.json
Formatting/trailing-comma fixes; no functional changes.
MTS fixture
test/mts/tsconfig.json
Replaces extends with explicit compiler options: sets module and moduleResolution to NodeNext. Review NodeNext module behavior for tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • feat: use undici v6 #514 — modifies package.json exports/entry points and engine requirements; related to manifest/exports changes.

Poem

🐰
I adjusted maps and chased a comma,
Packed exports neat, both ESM and soma,
Types snug in dist, lint-staged aligned,
Oxfmt hopped forward, tidy and kind,
A rabbit cheers — the manifest blooms! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title focuses on an oxfmt dependency upgrade, but the changeset includes significant package.json modernization (exports map, type/module/main fields, publishConfig, license, author) beyond just the oxfmt upgrade from ^0.17.0 to ^0.20.0. Update the title to reflect the primary change: consider 'chore: modernize package.json with ESM/CJS exports and oxfmt upgrade' or similar to accurately represent the comprehensive packaging updates.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch oxfmt-0.20

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@gemini-code-assist
Copy link

Summary of Changes

Hello @fengmk2, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on a chore update, specifically upgrading the oxfmt formatting tool to version 0.20.0. This update also includes a significant refactoring of the package.json file to enhance module compatibility by explicitly defining CommonJS and ES Module entry points and types, alongside minor formatting adjustments across various tsconfig.json files to ensure consistent code style.

Highlights

  • Dependency Update: The oxfmt formatting tool has been updated to version 0.20.0.
  • Package Configuration Modernization: The package.json file has been significantly refactored to explicitly define module entry points (main, module, types, exports) and declare type: "module", enhancing CommonJS and ES Module compatibility.
  • Code Formatting Consistency: Several tsconfig.json files have been updated to remove trailing commas, likely a result of applying the updated oxfmt formatter for consistent code style.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@socket-security
Copy link

socket-security bot commented Dec 24, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedoxfmt@​0.17.0 ⏵ 0.20.085 +11008695 +1100

View full report

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 24, 2025

Open in StackBlitz

npm i https://pkg.pr.new/node-modules/urllib@627

commit: e48ba81

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 24, 2025

CodSpeed Performance Report

Merging #627 will not alter performance

Comparing oxfmt-0.20 (e48ba81) with master (9bd576e)

Summary

✅ 9 untouched

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the oxfmt formatter to version 0.20.0 and applies its formatting rules across the project. The changes primarily consist of reordering fields in package.json for better organization and removing trailing commas from various tsconfig.json files, which enforces a stricter JSON format. These modifications improve code style consistency and are a direct result of the tool update. The changes are sound and I found no issues.

@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.14%. Comparing base (9bd576e) to head (e48ba81).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #627      +/-   ##
==========================================
- Coverage   94.57%   93.14%   -1.43%     
==========================================
  Files          14       14              
  Lines        1474     1474              
  Branches      321      319       -2     
==========================================
- Hits         1394     1373      -21     
- Misses         76       97      +21     
  Partials        4        4              

☔ 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.

Copy link

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 updates the oxfmt formatter from version 0.17 to 0.20. The changes include formatting updates across multiple TypeScript configuration files (removing trailing commas) and reorganizing the package.json file structure.

Key Changes

  • Updated oxfmt dependency from ^0.17.0 to ^0.20.0
  • Removed trailing commas in tsconfig.json files to comply with new formatter rules
  • Reorganized package.json fields for better structure (moved exports, types, etc.)

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tsconfig.json Removed trailing commas from isolatedDeclarations and exclude properties
test/mts/tsconfig.json Removed trailing commas from skipLibCheck and include properties
test/fixtures/ts/tsconfig.json Removed trailing commas from nested objects in paths configuration
test/fixtures/ts-esm/tsconfig.json Removed trailing commas from nested objects in paths configuration
test/fixtures/ts-cjs-es2021/tsconfig.json Removed trailing commas from nested objects in paths configuration
pnpm-lock.yaml Updated oxfmt version and related dependencies, reformatted package entries
package.json Updated oxfmt version to ^0.20.0, reorganized fields alphabetically

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings December 24, 2025 15:49
@fengmk2 fengmk2 merged commit e901311 into master Dec 24, 2025
28 checks passed
@fengmk2 fengmk2 deleted the oxfmt-0.20 branch December 24, 2025 15:52
Copy link

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

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"outDir": "dist",
"skipLibCheck": false,
"module": "NodeNext",
"moduleResolution": "NodeNext"
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

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

The removal of the "extends" field that previously referenced "@tsconfig/strictest" and "@tsconfig/node18" may weaken TypeScript checking for this test directory. The previous configuration provided strict type checking rules and Node 18 compatibility settings. Consider explicitly adding critical compiler options such as "strict": true, "target": "ES2022", and other strict checking options that were previously inherited from these base configurations to maintain the same level of type safety.

Suggested change
"moduleResolution": "NodeNext"
"moduleResolution": "NodeNext",
"target": "ES2022",
"lib": ["ES2022"],
"strict": true,
"forceConsistentCasingInFileNames": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"useUnknownInCatchVariables": true

Copilot uses AI. Check for mistakes.
Copy link

@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: 0

🧹 Nitpick comments (1)
package.json (1)

116-121: Consider limiting lint-staged to specific file types.

The current configuration runs on all files ("*"), which may include non-code files (images, binaries, markdown, etc.). While oxlint and oxfmt typically handle this gracefully, you might improve performance by limiting to relevant extensions:

"lint-staged": {
  "*.{js,ts,mjs,cjs,jsx,tsx,json}": [
    "npm run lint -- --fix",
    "oxfmt"
  ]
}
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4130c62 and e48ba81.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • package.json
  • test/fixtures/ts-cjs-es2021/tsconfig.json
  • test/fixtures/ts-esm/tsconfig.json
  • test/fixtures/ts/tsconfig.json
  • test/mts/tsconfig.json
  • tsconfig.json
✅ Files skipped from review due to trivial changes (2)
  • test/fixtures/ts-cjs-es2021/tsconfig.json
  • test/fixtures/ts-esm/tsconfig.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • tsconfig.json
  • test/fixtures/ts/tsconfig.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Upload results
  • GitHub Check: Test (ubuntu-latest, 24)
  • GitHub Check: Test (ubuntu-latest, 22)
  • GitHub Check: Test (windows-latest, 22)
  • GitHub Check: Test (windows-latest, 18)
  • GitHub Check: Test (windows-latest, 24)
  • GitHub Check: Test (windows-latest, 20)
🔇 Additional comments (6)
package.json (5)

31-43: LGTM! Well-structured exports map.

The exports map properly implements conditional exports with separate type declarations for ESM and CJS. The inclusion of "./package.json" export is a good practice for tooling compatibility.


17-18: LGTM! Essential metadata additions.

The addition of license, author, and files fields improves package metadata and publishing configuration:

  • License clarifies usage rights
  • Author provides proper attribution
  • Files array ensures only dist and src are published, excluding test files and development artifacts

Also applies to: 23-26


44-46: LGTM! Standard publish configuration.

The publishConfig with "tag": "latest" is a standard practice for package publishing.


27-30: The package.json configuration correctly supports dual ESM/CJS consumption.

The "type": "module" declaration (line 27) combined with the properly structured exports map (lines 31-43) is a valid modern dual-package pattern. The exports field defines conditional entry points that correctly route import requests to ESM and require requests to CommonJS, regardless of the "type" field. The legacy main, module, and types fields serve as fallbacks for older tools and don't conflict with this setup.

The dist directory not existing in the current state is expected—it's generated at build time. No separate package.json files in dist subdirectories are needed; the root configuration properly handles module type routing through the exports field.


104-104: No action needed. Oxfmt v0.20.0 has no documented breaking changes from v0.17.0, and the codebase is properly configured with .oxfmtrc.json for compatibility.

test/mts/tsconfig.json (1)

6-7: NodeNext module resolution is appropriate for the dual ESM/CJS package structure.

The test/mts configuration is intentionally standalone (similar to other test fixtures like test/fixtures/ts-esm) and does not extend the root tsconfig. The NodeNext settings correctly support the dual ESM/CommonJS exports configured in package.json. Note that test/mts lacks the strict type checking (strict, noImplicitAny, isolatedDeclarations) defined in the root configuration—verify this is intentional for your test isolation requirements.

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