Skip to content

Commit

Permalink
fix(deps): update dependency commander to v13 (#2102)
Browse files Browse the repository at this point in the history
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [commander](https://redirect.github.com/tj/commander.js) | [`12.1.0`
-> `13.0.0`](https://renovatebot.com/diffs/npm/commander/12.1.0/13.0.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/commander/13.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/commander/13.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/commander/12.1.0/13.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/commander/12.1.0/13.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>tj/commander.js (commander)</summary>

###
[`v13.0.0`](https://redirect.github.com/tj/commander.js/blob/HEAD/CHANGELOG.md#1300-2024-12-30)

[Compare
Source](https://redirect.github.com/tj/commander.js/compare/v12.1.0...v13.0.0)

##### Added

- support multiple calls to `.parse()` with default settings
(\[[#&#8203;2299](https://redirect.github.com/tj/commander.js/issues/2299)])
- add `.saveStateBeforeParse()` and `.restoreStateBeforeParse()` for use
by subclasses
(\[[#&#8203;2299](https://redirect.github.com/tj/commander.js/issues/2299)])
- style routines like `styleTitle()` to add color to help using
`.configureHelp()` or Help subclass
(\[[#&#8203;2251](https://redirect.github.com/tj/commander.js/issues/2251)])
- color related support in `.configureOutput()` for `getOutHasColors()`,
`getErrHasColors()`, and `stripColor()`
(\[[#&#8203;2251](https://redirect.github.com/tj/commander.js/issues/2251)])
- Help property for `minWidthToWrap`
(\[[#&#8203;2251](https://redirect.github.com/tj/commander.js/issues/2251)])
- Help methods for `displayWidth()`, `boxWrap()`, `preformatted()` et al
(\[[#&#8203;2251](https://redirect.github.com/tj/commander.js/issues/2251)])

##### Changed

- *Breaking*: excess command-arguments cause an error by default, see
migration tips
(\[[#&#8203;2223](https://redirect.github.com/tj/commander.js/issues/2223)])
- *Breaking*: throw during Option construction for unsupported option
flags, like multiple characters after single `-`
(\[[#&#8203;2270](https://redirect.github.com/tj/commander.js/issues/2270)])
- *Breaking*: throw on multiple calls to `.parse()` if
`storeOptionsAsProperties: true`
(\[[#&#8203;2299](https://redirect.github.com/tj/commander.js/issues/2299)])
- TypeScript: include implicit `this` in parameters for action handler
callback
(\[[#&#8203;2197](https://redirect.github.com/tj/commander.js/issues/2197)])

##### Deleted

- *Breaking*: `Help.wrap()` refactored into `formatItem()` and
`boxWrap()`
(\[[#&#8203;2251](https://redirect.github.com/tj/commander.js/issues/2251)])

##### Migration Tips

**Excess command-arguments**

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

Old code:

```js
program.option('-p, --port <number>', 'port number');
program.action((options) => {
  console.log(program.args);
});
```

Now shows an error:

```console
$ node example.js a b c
error: too many arguments. Expected 0 arguments but got 3.
```

You can declare the expected arguments. The help will then be more
accurate too. Note that declaring
new arguments will change what is passed to the action handler.

```js
program.option('-p, --port <number>', 'port number');
program.argument('[args...]', 'remote command and arguments'); // expecting zero or more arguments
program.action((args, options) => {
  console.log(args);
});
```

Or you could suppress the error, useful for minimising changes in legacy
code.

```js
program.option('-p, --port', 'port number');
program.allowExcessArguments();
program.action((options) => {
  console.log(program.args);
});
```

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **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.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/JoshuaKGoldberg/TypeStat).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS44NS4wIiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored Jan 2, 2025
1 parent 62abc65 commit 0dc034c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"automutate": "0.9.0",
"builtin-modules": "4.0.0",
"chalk": "5.4.1",
"commander": "12.1.0",
"commander": "13.0.0",
"enquirer": "2.4.1",
"glob": "11.0.0",
"strip-ansi": "7.1.0",
Expand Down
10 changes: 8 additions & 2 deletions pnpm-lock.yaml

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

0 comments on commit 0dc034c

Please sign in to comment.