Skip to content

Make order not matter for adding combo positive/negative options - #2405

Merged
shadowspawn merged 3 commits into
tj:release/15.xfrom
shadowspawn:feature/combo-option-order-independent
Aug 4, 2025
Merged

shadowspawn merged 3 commits into
tj:release/15.xfrom
shadowspawn:feature/combo-option-order-independent

Conversation

@shadowspawn

@shadowspawn shadowspawn commented Aug 3, 2025 •

Copy link
Copy Markdown
Collaborator

Problem

Lone negated options default to true. (Historical.)
Positive then negative does not default to true. (By design.)
Negative then positive still defaults to true, for implementation reasons rather than by design.

See: #2397

Solution

Move the setting of the default to when the options are known.

Alternative approach to #2398. That PR retroactively removes the "default true" when the positive option is added second.

ChangeLog

Fix: only lone negated option defaults option value to true

@shadowspawn

This comment was marked as resolved.

@shadowspawn
shadowspawn force-pushed the feature/combo-option-order-independent branch from 7e149d1 to d1f9d8c Compare August 3, 2025 05:55
@shadowspawn
shadowspawn marked this pull request as ready for review August 3, 2025 06:03
@shadowspawn shadowspawn added the semver: major Releasing requires a major version bump, not backwards compatible label Aug 3, 2025
Comment thread lib/command.js Resolved

@abetomo abetomo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@shadowspawn
shadowspawn merged commit 63eed4a into tj:release/15.x Aug 4, 2025
@shadowspawn
shadowspawn deleted the feature/combo-option-order-independent branch August 4, 2025 02:12
@shadowspawn shadowspawn added the pending release Merged into a branch for a future release, but not released yet label Aug 4, 2025
@shadowspawn shadowspawn removed the pending release Merged into a branch for a future release, but not released yet label May 29, 2026
@shadowspawn

Copy link
Copy Markdown
Collaborator Author

huskas-2189 pushed a commit to huskas-2189/Bookmark that referenced this pull request Jun 14, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [commander](https://github.com/tj/commander.js) | [`14.0.3` → `15.0.0`](https://renovatebot.com/diffs/npm/commander/14.0.3/15.0.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/commander/15.0.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/commander/14.0.3/15.0.0?slim=true) |

---

### Release Notes

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

### [`v15.0.0`](https://github.com/tj/commander.js/blob/HEAD/CHANGELOG.md#1500-2026-05-29)

[Compare Source](tj/commander.js@v14.0.3...v15.0.0)

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](./docs/release-policy.md).

##### Added

- show excess command-arguments in error message (\[[#&#8203;2384](tj/commander.js#2384)])

##### Fixed

- *Breaking:* only lone `--no-*` option sets default option value to `true`, default not implicitly set when define both positive and negative option in either order (\[[#&#8203;2405](tj/commander.js#2405)])
- update example to use compatible character for MINGW64 (\[[#&#8203;2475](tj/commander.js#2475)])

##### Changed

- *Breaking:* migrated Commander implementation from CommonJS to ESM (\[[#&#8203;2464](tj/commander.js#2464)])
- *Breaking:* Commander 15 requires Node.js v22.12.0 or higher (for `require(esm)`).
- dev: switch tests from Jest to `node:test` test runner (\[[#&#8203;2463](tj/commander.js#2463)])

##### Deleted

- *Breaking:* removed deprecated export of `commander/esm.mjs` (\[[#&#8203;2464](tj/commander.js#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.

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

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

---

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

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xOTUuMCIsInVwZGF0ZWRJblZlciI6IjQzLjE5NS4wIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6W119-->

Reviewed-on: https://codeberg.org/huskas-2189/Bookmark/pulls/85
huskas-2189 pushed a commit to huskas-2189/Bookmark that referenced this pull request Jun 19, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [commander](https://github.com/tj/commander.js) | [`14.0.3` → `15.0.0`](https://renovatebot.com/diffs/npm/commander/14.0.3/15.0.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/commander/15.0.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/commander/14.0.3/15.0.0?slim=true) |

---

### Release Notes

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

### [`v15.0.0`](https://github.com/tj/commander.js/blob/HEAD/CHANGELOG.md#1500-2026-05-29)

[Compare Source](tj/commander.js@v14.0.3...v15.0.0)

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](./docs/release-policy.md).

##### Added

- show excess command-arguments in error message (\[[#&#8203;2384](tj/commander.js#2384)])

##### Fixed

- *Breaking:* only lone `--no-*` option sets default option value to `true`, default not implicitly set when define both positive and negative option in either order (\[[#&#8203;2405](tj/commander.js#2405)])
- update example to use compatible character for MINGW64 (\[[#&#8203;2475](tj/commander.js#2475)])

##### Changed

- *Breaking:* migrated Commander implementation from CommonJS to ESM (\[[#&#8203;2464](tj/commander.js#2464)])
- *Breaking:* Commander 15 requires Node.js v22.12.0 or higher (for `require(esm)`).
- dev: switch tests from Jest to `node:test` test runner (\[[#&#8203;2463](tj/commander.js#2463)])

##### Deleted

- *Breaking:* removed deprecated export of `commander/esm.mjs` (\[[#&#8203;2464](tj/commander.js#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.

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

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

---

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

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xOTUuMCIsInVwZGF0ZWRJblZlciI6IjQzLjE5NS4wIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6W119-->

Reviewed-on: https://codeberg.org/huskas-2189/Bookmark/pulls/85
huskas-2189 pushed a commit to huskas-2189/Bookmark that referenced this pull request Jun 19, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [commander](https://github.com/tj/commander.js) | [`14.0.3` → `15.0.0`](https://renovatebot.com/diffs/npm/commander/14.0.3/15.0.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/commander/15.0.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/commander/14.0.3/15.0.0?slim=true) |

---

### Release Notes

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

### [`v15.0.0`](https://github.com/tj/commander.js/blob/HEAD/CHANGELOG.md#1500-2026-05-29)

[Compare Source](tj/commander.js@v14.0.3...v15.0.0)

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](./docs/release-policy.md).

##### Added

- show excess command-arguments in error message (\[[#&#8203;2384](tj/commander.js#2384)])

##### Fixed

- *Breaking:* only lone `--no-*` option sets default option value to `true`, default not implicitly set when define both positive and negative option in either order (\[[#&#8203;2405](tj/commander.js#2405)])
- update example to use compatible character for MINGW64 (\[[#&#8203;2475](tj/commander.js#2475)])

##### Changed

- *Breaking:* migrated Commander implementation from CommonJS to ESM (\[[#&#8203;2464](tj/commander.js#2464)])
- *Breaking:* Commander 15 requires Node.js v22.12.0 or higher (for `require(esm)`).
- dev: switch tests from Jest to `node:test` test runner (\[[#&#8203;2463](tj/commander.js#2463)])

##### Deleted

- *Breaking:* removed deprecated export of `commander/esm.mjs` (\[[#&#8203;2464](tj/commander.js#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.

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

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

---

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

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xOTUuMCIsInVwZGF0ZWRJblZlciI6IjQzLjE5NS4wIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6W119-->

Reviewed-on: https://codeberg.org/huskas-2189/Bookmark/pulls/85
imjohnbo added a commit to Kit/kit-cli that referenced this pull request Dec 1, 2026
Commander 15 no longer sets a default of true when both --slim and
--no-slim are defined (tj/commander.js#2405). Without an explicit
default, opts.slim was undefined, so list commands stopped sending
slim=true.

Set the default on the hidden --slim option instead of relying on
declaration order.

Signed-off-by: John Bohannon <imjohnbo@kit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver: major Releasing requires a major version bump, not backwards compatible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants