Skip to content

Conversation

@sxzz
Copy link
Contributor

@sxzz sxzz commented Nov 17, 2025

  • Drop the CJS build
  • Require Node.js 20.19+ (require(esm))
  • Simplify the tsdown configuration

Since the CLI is typically used as an entry point, this won’t affect most users.

Summary by CodeRabbit

  • Chores
    • Updated Node.js version requirement to 20.19 or higher.
    • Streamlined build configuration and export paths.

@graphite-app
Copy link

graphite-app bot commented Nov 17, 2025

How to use the Graphite Merge Queue

Add the label ready-to-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@coderabbitai
Copy link

coderabbitai bot commented Nov 17, 2025

Walkthrough

Build configuration updated to standardize on ES modules exclusively. Node engine requirement bumped to 20.19 minimum, binary and module entry points now use .mjs extension, and exports map simplified. Build configuration consolidated from dual-entry pattern to single globbed entry with unified options.

Changes

Cohort / File(s) Change Summary
Package Configuration
cli/package.json
Node engine requirement raised from ≥16 to ≥20.19; binary entry path changed from ./dist/cli.js to ./dist/cli.mjs; main, module, and types fields updated to use .mjs and .d.mts extensions; exports map restructured to point directly to ./dist/index.mjs for root export and new ./cli subpath export to ./dist/cli.mjs.
Build Configuration
cli/tsdown.config.ts
Build configuration consolidated from array of two separate configs (index and cli with individual format/target/dts options) into single unified config using globbed entry pattern ./src/{index,cli}.ts; per-entry configuration options removed and replaced with simplified options (entry, sourcemap, exports: true).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • cli/package.json: Verify that output file extensions (.mjs, .d.mts) match the actual build artifacts produced by the new build configuration
  • cli/tsdown.config.ts: Confirm that the unified exports: true setting and globbed entry pattern correctly generate both ESM outputs with the expected structure and that no format-specific logic is lost in the consolidation

Poem

🐰 From dual configs, one emerges clean,
Node twenty-point-nineteen on the scene,
Module files in .mjs dress,
Exports streamlined—build success!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main changes: dropping CommonJS build support and requiring Node 20.19+, which aligns with the package.json and tsdown config updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1dcc4e and 390c0e9.

📒 Files selected for processing (2)
  • cli/package.json (1 hunks)
  • cli/tsdown.config.ts (1 hunks)
🔇 Additional comments (5)
cli/package.json (4)

16-18: LGTM! Entry points correctly updated for pure ESM.

The main, module, and types fields are correctly updated to use .mjs and .d.mts extensions, which are the standard for pure ESM packages.


19-23: LGTM! Exports map correctly simplified for ESM-only.

The exports map is correctly simplified by removing the import/require condition split, now directly pointing to .mjs files. This aligns with the breaking change to drop CommonJS support.


12-15: The napi-raw binary path is correct.

The cli.mjs file exists at the package root and is a development wrapper script that runs TypeScript source directly via Node.js import hooks. The current setup is intentional and follows a standard pattern:

  • napi-raw./cli.mjs (development entry point, runs TypeScript source)
  • napi./dist/cli.mjs (production entry point, runs compiled output)

No changes needed.


10-10: Node.js 20.19 require(esm) support verified.

Node v20.19.0 enables loading native ES modules via require() by default, confirming that the specified version requirement is correct and appropriate for this breaking change.

cli/tsdown.config.ts (1)

3-7: No issues found — simplified tsdown configuration is correct.

Verification confirms:

  • Type declarations (.d.mts) auto-generate due to the types field in cli/package.json ✓
  • Default output format is ESM (.mjs) ✓
  • Glob pattern ./src/{index,cli}.ts is valid brace expansion syntax ✓

Tip

📝 Customizable high-level summaries are now available!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide custom instructions to shape the summary (bullet lists, tables, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example:

"Create a concise high-level summary as a bullet-point list. Then include a Markdown table showing lines added and removed by each contributing author."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

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.

1 participant