Skip to content

Commit

Permalink
Prepare for 13.0.0-0 (#2292)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowspawn authored Dec 6, 2024
1 parent d355b52 commit 53fc8a4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
26 changes: 21 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,37 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- markdownlint-disable MD024 -->
<!-- markdownlint-disable MD004 -->

## [13.x] (date goes here)
## [13.0.0-1] (2024-12-08)

### Added

- style routines like `styleTitle()` to add color to help using `.configureHelp()` or Help subclass ([#2251])
- color related support in `.configureOutput()` for `getOutHasColors()`, `getErrHasColors()`, and `stripColor()` ([#2251])
- Help property for `minWidthToWrap` ([#2251])
- Help methods for `displayWidth()`, `boxWrap()`, `preformatted()` et al ([#2251])

### Changed

- *Breaking*: excess command-arguments cause an error by default
- *Breaking*: excess command-arguments cause an error by default, see migration tips ([#2223])
- *Breaking*: throw during Option construction for unsupported option flags, like multiple characters after single `-` ([#2270])
- TypeScript: include implicit `this` in parameters for action handler callback ([#2197])

### Deleted

- *Breaking*: `Help.wrap()` refactored into `formatItem()` and `boxWrap()` ([#2251])


### Migration Tips

**Excess command-arguments**

It is now an error to pass more command-arguments than are expected.
It is now an error for the user to specify more command-arguments than are expected. (`allowExcessArguments` is now false by default.)

Old code:

Expand All @@ -29,6 +43,8 @@ program.action((options) => {
});
```

Now shows an error:

```console
$ node example.js a b c
error: too many arguments. Expected 0 arguments but got 3.
Expand All @@ -45,7 +61,7 @@ program.action((args, options) => {
});
```

Or you could suppress the error without changing the rest of the code:
Or you could suppress the error, useful for minimising changes in legacy code.

```js
program.option('-p, --port', 'port number');
Expand Down
2 changes: 1 addition & 1 deletion lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class Command extends EventEmitter {
* // color support, currently only used with Help
* getOutHasColors()
* getErrHasColors()
* stripColor() // used to remove ANSI escape codes if output does not have colours
* stripColor() // used to remove ANSI escape codes if output does not have colors
*
* @param {object} [configuration] - configuration options
* @return {(Command | object)} `this` command for chaining, or stored configuration
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commander",
"version": "12.1.0",
"version": "13.0.0-0",
"description": "the complete solution for node.js command-line programs",
"keywords": [
"commander",
Expand Down

0 comments on commit 53fc8a4

Please sign in to comment.