.addHelpOption() as another way of configuring built-in help option (#2006)
.helpCommand() for configuring built-in help command (#2087)
Fixed
Breaking: use non-zero exit code when spawned executable subcommand terminates due to a signal (#2023)
Breaking: check passThroughOptions constraints when using .addCommand and throw if parent command does not have .enablePositionalOptions() enabled (#1937)
Changed
Breaking: Commander 12 requires Node.js v18 or higher (#2027)
Breaking: throw an error if add an option with a flag which is already in use (#2055)
Breaking: throw an error if add a command with name or alias which is already in use (#2059)
Breaking: throw error when calling .storeOptionsAsProperties() after setting an option value (#1928)
replace non-standard JSDoc of @api private with documented @private (#1949)
.addHelpCommand() now takes a Command (passing string or boolean still works as before but deprecated) (#2087)
refactor internal implementation of built-in help option (#2006)
refactor internal implementation of built-in help command (#2087)
Deprecated
.addHelpCommand() passing string or boolean (use .helpCommand() or pass a Command) (#2087)
Removed
Breaking: removed default export of a global Command instance from CommonJS (use the named program export instead) (#2017)
Migration Tips
global program
If you are using the deprecated default import of the global Command object, you need to switch to using a named import (or create a new Command).
// const program = require('commander');const{ program }=require('commander');
option and command clashes
A couple of configuration problems now throw an error, which will pick up issues in existing programs:
adding an option which uses the same flag as a previous option
adding a command which uses the same name or alias as a previous command
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.
All Depfu comment commands
@depfu rebase
Rebases against your default branch and redoes this update
@depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@depfu cancel merge
Cancels automatic merging of this PR
@depfu close
Closes this PR and deletes the branch
@depfu reopen
Restores the branch and reopens this PR (if it's closed)
@depfu pause
Ignores all future updates for this dependency and closes this PR
@depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)
Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.
What changed?
✳️ commander (11.1.0 → 12.0.0) · Repo · Changelog
Release Notes
12.0.0
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 62 commits:
Bump version to 12.0.0
Merge pull request #2140 from tj/release/12.x
Update CHANGELOG for v12 (#2133)
Update dependencies preparing for release (#2132)
Merge remote-tracking branch 'origin/develop' into release/12.x
Add links in CHANGELOG
12.0.0-1
Add 12.0.0-1 changes to CHANGELOG
Refactor help option implementation to hold actual Option (#2006)
Refactor help command implementation to hold actual Command (#2087)
Bump eslint from 8.54.0 to 8.56.0 (#2107)
Bump @types/jest from 29.5.8 to 29.5.11 (#2102)
Bump typescript from 5.2.2 to 5.3.3 (#2100)
Bump @typescript-eslint/eslint-plugin from 6.10.0 to 6.18.0 (#2117)
Bump github/codeql-action from 2 to 3 (#2108)
Improve JSDoc (#2103)
Rework exitOverride description (#2098)
Bump @typescript-eslint/parser from 6.10.0 to 6.13.1 (#2091)
Bump eslint-config-standard-with-typescript from 39.1.1 to 40.0.0 (#2083)
Bump eslint from 8.53.0 to 8.54.0 (#2082)
Add Removed section to Deprecated (#2078)
Update url per npm advice (#2077)
Bump eslint-plugin-n from 16.2.0 to 16.3.1 (#2075)
Bump @typescript-eslint/parser from 6.9.1 to 6.10.0 (#2073)
Bump @typescript-eslint/eslint-plugin from 6.9.1 to 6.10.0 (#2072)
Bump @types/node from 20.8.10 to 20.9.0 (#2074)
Bump @types/jest from 29.5.7 to 29.5.8 (#2076)
Bump @typescript-eslint/parser from 6.9.0 to 6.9.1 (#2062)
Bump @typescript-eslint/eslint-plugin from 6.9.0 to 6.9.1 (#2060)
Bump @types/node from 20.8.9 to 20.8.10 (#2063)
Bump eslint from 8.52.0 to 8.53.0 (#2061)
Bump @types/jest from 29.5.6 to 29.5.7 (#2064)
12.0.0-0
Bump required version in package-lock
Prepare for prerelease 12.0.0-0
Update CHANGELOG for 12.0.0 (#2066)
Merge pull request #2065 from shadowspawn/feature/merge-develop-into-12
Merge branch 'release/12.x' of github.com:tj/commander.js into release/12.x
Merge remote-tracking branch 'upstream/develop' into release/12.x
Add check for overlapping command names or aliases (#2059)
Throw error when add option with clashing flags (#2055)
Change npm package checks in dependabot to monthly (#2057)
Bump @typescript-eslint/parser from 6.8.0 to 6.9.0 (#2050)
Bump eslint-plugin-import from 2.28.1 to 2.29.0 (#2051)
Bump @typescript-eslint/eslint-plugin from 6.7.5 to 6.9.0 (#2053)
Bump actions/setup-node from 3 to 4 (#2054)
Bump @types/node from 20.8.6 to 20.8.9 (#2052)
Bump eslint-plugin-jest from 27.4.3 to 27.6.0 (#2049)
Bump eslint from 8.51.0 to 8.52.0 (#2046)
Bump eslint-plugin-jest from 27.4.2 to 27.4.3 (#2045)
Bump @typescript-eslint/parser from 6.7.5 to 6.8.0 (#2043)
Bump eslint-plugin-n from 15.7.0 to 16.2.0 (#2044)
Bump @types/jest from 29.5.5 to 29.5.6 (#2047)
Add migration tips for default import
Bump tsd from 0.28.1 to 0.29.0
Add explicit note to only call parse once (#2036)
Bump @typescript-eslint/eslint-plugin from 5.59.7 to 6.7.5 (#2032)
Bump eslint-config-standard from 17.0.0 to 17.1.0 (#2031)
Bump @typescript-eslint/parser from 5.59.7 to 5.62.0 (#2030)
Bump eslint from 8.41.0 to 8.51.0 (#2033)
Bump @types/node from 20.2.5 to 20.8.5 (#2034)
Restore extra sanity check when enabling storeOptionsAsProperties (#2029)
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with
@depfu rebase
.All Depfu comment commands