chore(deps): update commander to v15#404
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #404 +/- ##
=======================================
Coverage 84.35% 84.35%
=======================================
Files 153 153
Lines 7996 7996
Branches 2163 2163
=======================================
Hits 6745 6745
Misses 1250 1250
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/package.json`:
- Line 54: The package.json for the CLI package is missing a Node.js engine
constraint required by commander v15. Add an "engines" field to the package.json
with a minimum Node.js version requirement of ">=22.12.0" to ensure
compatibility with commander v15 and prevent installation on incompatible
Node.js versions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 71748fd1-1f78-4e36-bb5f-60b342313e82
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (1)
packages/cli/package.json
| "@toon-format/toon": "^2.1.0", | ||
| "chalk": "^5.4.1", | ||
| "commander": "^14.0.2", | ||
| "commander": "^15.0.0", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
What are the breaking changes in Commander v15 regarding error codes, exitOverride() behavior, and configureOutput() API compared to v14?
💡 Result:
Commander v15, released in May 2026, focuses primarily on migrating the library to pure ESM (ECMAScript Modules) [1][2]. Contrary to expectations of breaking changes in error handling APIs, the core functionality of error codes, exitOverride, and configureOutput remains consistent with v14 [1][3][4]. Key takeaways regarding your specific queries: 1. Error Codes and exitOverride Behavior: There are no breaking changes to how exitOverride functions or how error codes are handled [1][4]. Commander continues to use the same CommanderError mechanism [3][4]. When exitOverride is enabled, the library still throws a CommanderError containing exitCode, code, and message properties rather than calling process.exit [3][4]. The behavior remains consistent, where the callback is triggered after the display of errors, help, or version information [3][4]. 2. configureOutput API: There are no breaking changes to the configureOutput API in v15 [1][4]. It continues to allow customization of output streams (writeOut, writeErr) and error formatting (outputError) as it did in previous versions [3][4]. 3. Major Breaking Changes in v15: While the APIs you mentioned remained stable, the primary breaking changes in v15 are: - ESM-Only: The entire implementation was migrated from CommonJS to pure ESM [1][5]. - Node.js Requirement: Commander 15 requires Node.js v22.12.0 or higher [1]. - Deprecated Export Removal: The legacy commander/esm.mjs export has been removed [1][5]. - Option Parsing: A specific breaking change was made where only lone --no-* options now implicitly set a default value of true; implicit defaults are no longer set when both positive and negative options are defined [1][6]. If you are upgrading from v14 and your environment supports ESM, these changes should be largely transparent regarding your error and output handling logic [1][2]. If you encounter issues with ESM support in your build tools or runtime, it is recommended to stay on v14, which will receive security updates until May 2027 [1][6].
Citations:
- 1: https://github.com/tj/commander.js/releases/tag/v15.0.0
- 2: https://github.com/tj/commander.js/releases/tag/v15.0.0-0
- 3: https://registry.npmjs.org/commander
- 4: https://npmx.dev/package/commander/v/15.0.0
- 5: Switching to esm-only tj/commander.js#2464
- 6: https://newreleases.io/project/npm/commander/release/15.0.0-0
Add Node.js engine constraint for commander v15 compatibility.
Commander v15 requires Node.js v22.12.0+. Add "engines": { "node": ">=22.12.0" } to packages/cli/package.json.
The API compatibility concerns with exitOverride(), configureOutput(), and error codes are not issues—these remain unchanged in v15. The --no-color option will continue to work as expected since it's defined as a lone option.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/cli/package.json` at line 54, The package.json for the CLI package
is missing a Node.js engine constraint required by commander v15. Add an
"engines" field to the package.json with a minimum Node.js version requirement
of ">=22.12.0" to ensure compatibility with commander v15 and prevent
installation on incompatible Node.js versions.
9a67611 to
8f42f62
Compare
8f42f62 to
dd04888
Compare
This PR contains the following updates:
^14.0.2→^15.0.0Release Notes
tj/commander.js (commander)
v15.0.0Compare Source
Commander 15 is ESM only. This is expected to be seamless for ESM consumers, but some CommonJS consumers may hit issues with tooling requiring configuration for ESM-only dependencies. See Migration Tips below.
The release of Commander 15 moves Commander 14 into maintenance. Commander 14 will get security updates for
12 months (to May 2027). For more info see Release Policy.
Added
Fixed
--no-*option sets default option value totrue, default not implicitly set when define both positive and negative option in either order ([#2405])Changed
require(esm)).node:testtest runner ([#2463])Deleted
commander/esm.mjs([#2464])Migration Tips
Commander 15 is ESM only, but this does not mean you need to migrate to ESM to use it. Importing ESM from CommonJS is
supported by Node.js, and Bun, and Deno. Hopefully it Just Works for you! However, you may be using a different runtime or
some other part of your setup that may not yet natively support importing ESM from CommonJS, such as your testing framework
or bundler.
If you have problems using Commander 15 in your environment, one option is stay on Commander 14 for now. Commander 14 will
get security updates until May 2027 and things will hopefully improve for your setup in the meantime.
v14.0.3Compare Source
Added
Changes
.outputHelp()([#2427])Configuration
📅 Schedule: (in timezone UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.
Summary by CodeRabbit