You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+175
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,140 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
8
8
<!-- markdownlint-disable MD024 -->
9
9
<!-- markdownlint-disable MD004 -->
10
10
11
+
## [12.1.0] (2024-05-18)
12
+
13
+
### Added
14
+
15
+
- auto-detect special node flags `node --eval` and `node --print` when call `.parse()` with no arguments ([#2164])
16
+
-
17
+
### Changed
18
+
19
+
- prefix require of Node.js core modules with `node:` ([#2170])
20
+
- format source files with Prettier ([#2180])
21
+
- switch from StandardJS to directly calling ESLint for linting ([#2153])
22
+
- extend security support for previous major version of Commander ([#2150])
23
+
24
+
### Removed
25
+
26
+
- removed unimplemented Option.fullDescription from TypeScript definition ([#2191])
27
+
28
+
## [12.0.0] (2024-02-03)
29
+
30
+
### Added
31
+
32
+
-`.addHelpOption()` as another way of configuring built-in help option ([#2006])
33
+
-`.helpCommand()` for configuring built-in help command ([#2087])
34
+
35
+
### Fixed
36
+
37
+
-*Breaking:* use non-zero exit code when spawned executable subcommand terminates due to a signal ([#2023])
38
+
-*Breaking:* check `passThroughOptions` constraints when using `.addCommand` and throw if parent command does not have `.enablePositionalOptions()` enabled ([#1937])
39
+
40
+
### Changed
41
+
42
+
-*Breaking:* Commander 12 requires Node.js v18 or higher ([#2027])
43
+
-*Breaking:* throw an error if add an option with a flag which is already in use ([#2055])
44
+
-*Breaking:* throw an error if add a command with name or alias which is already in use ([#2059])
45
+
-*Breaking:* throw error when calling `.storeOptionsAsProperties()` after setting an option value ([#1928])
46
+
- replace non-standard JSDoc of `@api private` with documented `@private` ([#1949])
47
+
-`.addHelpCommand()` now takes a Command (passing string or boolean still works as before but deprecated) ([#2087])
48
+
- refactor internal implementation of built-in help option ([#2006])
49
+
- refactor internal implementation of built-in help command ([#2087])
50
+
51
+
### Deprecated
52
+
53
+
-`.addHelpCommand()` passing string or boolean (use `.helpCommand()` or pass a Command) ([#2087])
54
+
55
+
### Removed
56
+
57
+
-*Breaking:* removed default export of a global Command instance from CommonJS (use the named `program` export instead) ([#2017])
58
+
59
+
### Migration Tips
60
+
61
+
**global program**
62
+
63
+
If you are using the [deprecated](./docs/deprecated.md#default-import-of-global-command-object) default import of the global Command object, you need to switch to using a named import (or create a new `Command`).
64
+
65
+
```js
66
+
// const program = require('commander');
67
+
const { program } =require('commander');
68
+
```
69
+
70
+
**option and command clashes**
71
+
72
+
A couple of configuration problems now throw an error, which will pick up issues in existing programs:
73
+
74
+
- adding an option which uses the same flag as a previous option
75
+
- adding a command which uses the same name or alias as a previous command
76
+
77
+
## [12.0.0-1] (2024-01-20)
78
+
79
+
(Released in 12.0.0)
80
+
81
+
## [12.0.0-0] (2023-11-11)
82
+
83
+
(Released in 12.0.0)
84
+
85
+
## [11.1.0] (2023-10-13)
86
+
87
+
### Fixed
88
+
89
+
- TypeScript: update `OptionValueSource` to allow any string, to match supported use of custom sources ([#1983])
90
+
- TypeScript: add that `Command.version()` can also be used as getter ([#1982])
91
+
- TypeScript: add null return type to `Commands.executableDir()`, for when not configured ([#1965])
92
+
- subcommands with an executable handler and only a short help flag are now handled correctly by the parent's help command ([#1930])
93
+
94
+
### Added
95
+
96
+
-`registeredArguments` property on `Command` with the array of defined `Argument` (like `Command.options` for `Option`) ([#2010])
97
+
- TypeScript declarations for Option properties: `envVar`, `presetArg` ([#2019])
98
+
- TypeScript declarations for Argument properties: `argChoices`, `defaultValue`, `defaultValueDescription` ([#2019])
99
+
- example file which shows how to configure help to display any custom usage in the list of subcommands ([#1896])
100
+
101
+
### Changed
102
+
103
+
- (developer) refactor TypeScript configs for multiple use-cases, and enable checks in JavaScript files in supporting editors ([#1969])
104
+
105
+
### Deprecated
106
+
107
+
-`Command._args` was private anyway, but now available as `registeredArguments` ([#2010])
108
+
109
+
## [11.0.0] (2023-06-16)
110
+
111
+
### Fixed
112
+
113
+
- help command works when help option is disabled ([#1864])
114
+
115
+
### Changed
116
+
117
+
- leading and trailing spaces are now ignored by the .arguments() method ([#1874])
118
+
- refine "types" exports for ESM to follow TypeScript guidelines ([#1886])
119
+
-*Breaking:* Commander 11 requires Node.js v16 or higher
120
+
121
+
## [10.0.1] (2023-04-15)
122
+
123
+
### Added
124
+
125
+
- improvements to documentation ([#1858], [#1859], [#1860])
126
+
127
+
### Fixed
128
+
129
+
- remove unused `Option.optionFlags` property from TypeScript definition ([#1844])
130
+
131
+
### Changed
132
+
133
+
- assume boolean option intended if caller passes string instead of hash to `.implies()` ([#1854])
134
+
135
+
## [10.0.0] (2023-01-13)
136
+
137
+
### Added
138
+
139
+
- wrap command description in help ([#1804])
140
+
141
+
### Changed
142
+
143
+
-*Breaking:* Commander 10 requires Node.js v14 or higher
0 commit comments