Skip to content
Myr

Update required node version, supported versions, refactor CHANGELOG. (#1500)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by John Gee · committed by GitHub · parent b286da9 · Browse files · 6 files+163 added−159 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+163 added−159 removed

  • other:+163 added−159 removed

6 files+163 added−159 removed

modified:.github/workflows/tests.yml+1 added-1 removed
added:changelogs/CHANGELOG-5.md+158 added
1# Changelog for 5.x23## [5.1.0] (2020-04-25)45### Added67- support for multiple command aliases, the first of which is shown in the auto-generated help ([#531], [#1236])8- configuration support in `addCommand()` for `hidden` and `isDefault` ([#1232])910### Fixed1112- omit masked help flags from the displayed help ([#645], [#1247])13- remove old short help flag when change help flags using `helpOption` ([#1248])1415### Changed1617- remove use of `arguments` to improve auto-generated help in editors ([#1235])18- rename `.command()` configuration `noHelp` to `hidden` (but not remove old support) ([#1232])19- improvements to documentation20- update dependencies21- update tested versions of node22- eliminate lint errors in TypeScript ([#1208])2324## [5.0.0] (2020-03-14)2526### Added2728* support for nested commands with action-handlers ([#1] [#764] [#1149])29* `.addCommand()` for adding a separately configured command ([#764] [#1149])30* allow a non-executable to be set as the default command ([#742] [#1149])31* implicit help command when there are subcommands (previously only if executables) ([#1149])32* customise implicit help command with `.addHelpCommand()` ([#1149])33* display error message for unknown subcommand, by default ([#432] [#1088] [#1149])34* display help for missing subcommand, by default ([#1088] [#1149])35* combined short options as single argument may include boolean flags and value flag and value (e.g. `-a -b -p 80` can be written as `-abp80`) ([#1145])36* `.parseOption()` includes short flag and long flag expansions ([#1145])37* `.helpInformation()` returns help text as a string, previously a private routine ([#1169])38* `.parse()` implicitly uses `process.argv` if arguments not specified ([#1172])39* optionally specify where `.parse()` arguments "from", if not following node conventions ([#512] [#1172])40* suggest help option along with unknown command error ([#1179])41* TypeScript definition for `commands` property of `Command` ([#1184])42* export `program` property ([#1195])43* `createCommand` factory method to simplify subclassing ([#1191])4445### Fixed4647* preserve argument order in subcommands ([#508] [#962] [#1138])48* do not emit `command:*` for executable subcommands ([#809] [#1149])49* action handler called whether or not there are non-option arguments ([#1062] [#1149])50* combining option short flag and value in single argument now works for subcommands ([#1145])51* only add implicit help command when it will not conflict with other uses of argument ([#1153] [#1149])52* implicit help command works with command aliases ([#948] [#1149])53* options are validated whether or not there is an action handler ([#1149])5455### Changed5657* *Breaking* `.args` contains command arguments with just recognised options removed ([#1032] [#1138])58* *Breaking* display error if required argument for command is missing ([#995] [#1149])59* tighten TypeScript definition of custom option processing function passed to `.option()` ([#1119])60* *Breaking* `.allowUnknownOption()` ([#802] [#1138])61 * unknown options included in arguments passed to command action handler62 * unknown options included in `.args`63* only recognised option short flags and long flags are expanded (e.g. `-ab` or `--foo=bar`) ([#1145])64* *Breaking* `.parseOptions()` ([#1138])65 * `args` in returned result renamed `operands` and does not include anything after first unknown option66 * `unknown` in returned result has arguments after first unknown option including operands, not just options and values67* *Breaking* `.on('command:*', callback)` and other command events passed (changed) results from `.parseOptions`, i.e. operands and unknown ([#1138])68* refactor Option from prototype to class ([#1133])69* refactor Command from prototype to class ([#1159])70* changes to error handling ([#1165])71 * throw for author error, not just display message72 * preflight for variadic error73 * add tips to missing subcommand executable74* TypeScript fluent return types changed to be more subclass friendly, return `this` rather than `Command` ([#1180])75* `.parseAsync` returns `Promise<this>` to be consistent with `.parse()` ([#1180])76* update dependencies7778### Removed7980* removed EventEmitter from TypeScript definition for Command, eliminating implicit peer dependency on `@types/node` ([#1146])81* removed private function `normalize` (the functionality has been integrated into `parseOptions`) ([#1145])82* `parseExpectedArgs` is now private ([#1149])8384### Migration Tips8586If you use `.on('command:*')` or more complicated tests to detect an unrecognised subcommand, you may be able to delete the code and rely on the default behaviour.8788If you use `program.args` or more complicated tests to detect a missing subcommand, you may be able to delete the code and rely on the default behaviour.8990If you use `.command('*')` to add a default command, you may be be able to switch to `isDefault:true` with a named command.9192If you want to continue combining short options with optional values as though they were boolean flags, set `combineFlagAndOptionalValue(false)`93to expand `-fb` to `-f -b` rather than `-f b`.9495## [5.0.0-4] (2020-03-03)9697(Released in 5.0.0)9899## [5.0.0-3] (2020-02-20)100101(Released in 5.0.0)102103## [5.0.0-2] (2020-02-10)104105(Released in 5.0.0)106107## [5.0.0-1] (2020-02-08)108109(Released in 5.0.0)110111## [5.0.0-0] (2020-02-02)112113(Released in 5.0.0)114115[#1]: https://github.com/tj/commander.js/issues/1116[#432]: https://github.com/tj/commander.js/issues/432117[#508]: https://github.com/tj/commander.js/issues/508118[#512]: https://github.com/tj/commander.js/issues/512119[#531]: https://github.com/tj/commander.js/issues/531120[#645]: https://github.com/tj/commander.js/issues/645121[#742]: https://github.com/tj/commander.js/issues/742122[#764]: https://github.com/tj/commander.js/issues/764123[#802]: https://github.com/tj/commander.js/issues/802124[#809]: https://github.com/tj/commander.js/issues/809125[#962]: https://github.com/tj/commander.js/issues/962126[#995]: https://github.com/tj/commander.js/issues/995127[#1062]: https://github.com/tj/commander.js/pull/1062128[#1088]: https://github.com/tj/commander.js/issues/1088129[#1119]: https://github.com/tj/commander.js/pull/1119130[#1133]: https://github.com/tj/commander.js/pull/1133131[#1138]: https://github.com/tj/commander.js/pull/1138132[#1145]: https://github.com/tj/commander.js/pull/1145133[#1146]: https://github.com/tj/commander.js/pull/1146134[#1149]: https://github.com/tj/commander.js/pull/1149135[#1153]: https://github.com/tj/commander.js/issues/1153136[#1159]: https://github.com/tj/commander.js/pull/1159137[#1165]: https://github.com/tj/commander.js/pull/1165138[#1169]: https://github.com/tj/commander.js/pull/1169139[#1172]: https://github.com/tj/commander.js/pull/1172140[#1179]: https://github.com/tj/commander.js/pull/1179141[#1180]: https://github.com/tj/commander.js/pull/1180142[#1184]: https://github.com/tj/commander.js/pull/1184143[#1191]: https://github.com/tj/commander.js/pull/1191144[#1195]: https://github.com/tj/commander.js/pull/1195145[#1208]: https://github.com/tj/commander.js/pull/1208146[#1232]: https://github.com/tj/commander.js/pull/1232147[#1235]: https://github.com/tj/commander.js/pull/1235148[#1236]: https://github.com/tj/commander.js/pull/1236149[#1247]: https://github.com/tj/commander.js/pull/1247150[#1248]: https://github.com/tj/commander.js/pull/1248151152[5.1.0]: https://github.com/tj/commander.js/compare/v5.0.0..v5.1.0153[5.0.0]: https://github.com/tj/commander.js/compare/v4.1.1..v5.0.0154[5.0.0-4]: https://github.com/tj/commander.js/compare/v5.0.0-3..v5.0.0-4155[5.0.0-3]: https://github.com/tj/commander.js/compare/v5.0.0-2..v5.0.0-3156[5.0.0-2]: https://github.com/tj/commander.js/compare/v5.0.0-1..v5.0.0-2157[5.0.0-1]: https://github.com/tj/commander.js/compare/v5.0.0-0..v5.0.0-1158[5.0.0-0]: https://github.com/tj/commander.js/compare/v4.1.1..v5.0.0-0
modified:CHANGELOG.md+1 added-154 removed
223 unmodified lines
224## [6.0.0-0] (2020-06-20)225226(Released in 6.0.0)227228## [5.1.0] (2020-04-25)228230### Added231232- support for multiple command aliases, the first of which is shown in the auto-generated help ([#531], [#1236])233- configuration support in `addCommand()` for `hidden` and `isDefault` ([#1232])234235### Fixed236237- omit masked help flags from the displayed help ([#645], [#1247])238- remove old short help flag when change help flags using `helpOption` ([#1248])239240### Changed241242- remove use of `arguments` to improve auto-generated help in editors ([#1235])243- rename `.command()` configuration `noHelp` to `hidden` (but not remove old support) ([#1232])244- improvements to documentation245- update dependencies246- update tested versions of node247- eliminate lint errors in TypeScript ([#1208])248249## [5.0.0] (2020-03-14)250251### Added252253* support for nested commands with action-handlers ([#1] [#764] [#1149])254* `.addCommand()` for adding a separately configured command ([#764] [#1149])255* allow a non-executable to be set as the default command ([#742] [#1149])256* implicit help command when there are subcommands (previously only if executables) ([#1149])257* customise implicit help command with `.addHelpCommand()` ([#1149])258* display error message for unknown subcommand, by default ([#432] [#1088] [#1149])259* display help for missing subcommand, by default ([#1088] [#1149])260* combined short options as single argument may include boolean flags and value flag and value (e.g. `-a -b -p 80` can be written as `-abp80`) ([#1145])261* `.parseOption()` includes short flag and long flag expansions ([#1145])262* `.helpInformation()` returns help text as a string, previously a private routine ([#1169])263* `.parse()` implicitly uses `process.argv` if arguments not specified ([#1172])264* optionally specify where `.parse()` arguments "from", if not following node conventions ([#512] [#1172])265* suggest help option along with unknown command error ([#1179])266* TypeScript definition for `commands` property of `Command` ([#1184])267* export `program` property ([#1195])268* `createCommand` factory method to simplify subclassing ([#1191])269270### Fixed271272* preserve argument order in subcommands ([#508] [#962] [#1138])273* do not emit `command:*` for executable subcommands ([#809] [#1149])274* action handler called whether or not there are non-option arguments ([#1062] [#1149])275* combining option short flag and value in single argument now works for subcommands ([#1145])276* only add implicit help command when it will not conflict with other uses of argument ([#1153] [#1149])277* implicit help command works with command aliases ([#948] [#1149])278* options are validated whether or not there is an action handler ([#1149])279280### Changed281282* *Breaking* `.args` contains command arguments with just recognised options removed ([#1032] [#1138])283* *Breaking* display error if required argument for command is missing ([#995] [#1149])284* tighten TypeScript definition of custom option processing function passed to `.option()` ([#1119])285* *Breaking* `.allowUnknownOption()` ([#802] [#1138])286 * unknown options included in arguments passed to command action handler287 * unknown options included in `.args`288* only recognised option short flags and long flags are expanded (e.g. `-ab` or `--foo=bar`) ([#1145])289* *Breaking* `.parseOptions()` ([#1138])290 * `args` in returned result renamed `operands` and does not include anything after first unknown option291 * `unknown` in returned result has arguments after first unknown option including operands, not just options and values292* *Breaking* `.on('command:*', callback)` and other command events passed (changed) results from `.parseOptions`, i.e. operands and unknown ([#1138])293* refactor Option from prototype to class ([#1133])294* refactor Command from prototype to class ([#1159])295* changes to error handling ([#1165])296 * throw for author error, not just display message297 * preflight for variadic error298 * add tips to missing subcommand executable299* TypeScript fluent return types changed to be more subclass friendly, return `this` rather than `Command` ([#1180])300* `.parseAsync` returns `Promise<this>` to be consistent with `.parse()` ([#1180])301* update dependencies302303### Removed304305* removed EventEmitter from TypeScript definition for Command, eliminating implicit peer dependency on `@types/node` ([#1146])306* removed private function `normalize` (the functionality has been integrated into `parseOptions`) ([#1145])307* `parseExpectedArgs` is now private ([#1149])308309### Migration Tips310311If you use `.on('command:*')` or more complicated tests to detect an unrecognised subcommand, you may be able to delete the code and rely on the default behaviour.312313If you use `program.args` or more complicated tests to detect a missing subcommand, you may be able to delete the code and rely on the default behaviour.314315If you use `.command('*')` to add a default command, you may be be able to switch to `isDefault:true` with a named command.316317If you want to continue combining short options with optional values as though they were boolean flags, set `combineFlagAndOptionalValue(false)`318to expand `-fb` to `-f -b` rather than `-f b`.319320## [5.0.0-4] (2020-03-03)321322(Released in 5.0.0)323324## [5.0.0-3] (2020-02-20)325326(Released in 5.0.0)327328## [5.0.0-2] (2020-02-10)329330(Released in 5.0.0)331332## [5.0.0-1] (2020-02-08)333334(Released in 5.0.0)335336## [5.0.0-0] (2020-02-02)337338(Released in 5.0.0)339229## Older versions230231* [5.x](./changelogs/CHANGELOG-5.md)232* [4.x](./changelogs/CHANGELOG-4.md)233* [3.x](./changelogs/CHANGELOG-3.md)234* [2.x](./changelogs/CHANGELOG-2.md)235* [1.x](./changelogs/CHANGELOG-1.md)236* [0.x](./changelogs/CHANGELOG-0.md)237348[#1]: https://github.com/tj/commander.js/issues/1349[#432]: https://github.com/tj/commander.js/issues/432350[#508]: https://github.com/tj/commander.js/issues/508351[#512]: https://github.com/tj/commander.js/issues/512352[#531]: https://github.com/tj/commander.js/issues/531353[#645]: https://github.com/tj/commander.js/issues/645354[#742]: https://github.com/tj/commander.js/issues/742355[#764]: https://github.com/tj/commander.js/issues/764356[#802]: https://github.com/tj/commander.js/issues/802357[#809]: https://github.com/tj/commander.js/issues/809238[#948]: https://github.com/tj/commander.js/issues/948359[#962]: https://github.com/tj/commander.js/issues/962360[#995]: https://github.com/tj/commander.js/issues/995239[#1032]: https://github.com/tj/commander.js/issues/1032362[#1062]: https://github.com/tj/commander.js/pull/1062363[#1088]: https://github.com/tj/commander.js/issues/1088364[#1119]: https://github.com/tj/commander.js/pull/1119365[#1133]: https://github.com/tj/commander.js/pull/1133366[#1138]: https://github.com/tj/commander.js/pull/1138367[#1145]: https://github.com/tj/commander.js/pull/1145368[#1146]: https://github.com/tj/commander.js/pull/1146369[#1149]: https://github.com/tj/commander.js/pull/1149370[#1153]: https://github.com/tj/commander.js/issues/1153371[#1159]: https://github.com/tj/commander.js/pull/1159372[#1165]: https://github.com/tj/commander.js/pull/1165373[#1169]: https://github.com/tj/commander.js/pull/1169374[#1172]: https://github.com/tj/commander.js/pull/1172375[#1179]: https://github.com/tj/commander.js/pull/1179376[#1180]: https://github.com/tj/commander.js/pull/1180377[#1184]: https://github.com/tj/commander.js/pull/1184378[#1191]: https://github.com/tj/commander.js/pull/1191379[#1195]: https://github.com/tj/commander.js/pull/1195380[#1208]: https://github.com/tj/commander.js/pull/1208381[#1232]: https://github.com/tj/commander.js/pull/1232382[#1235]: https://github.com/tj/commander.js/pull/1235383[#1236]: https://github.com/tj/commander.js/pull/1236384[#1247]: https://github.com/tj/commander.js/pull/1247385[#1248]: https://github.com/tj/commander.js/pull/1248240[#1250]: https://github.com/tj/commander.js/pull/1250241[#1256]: https://github.com/tj/commander.js/pull/1256242[#1275]: https://github.com/tj/commander.js/pull/1275243[#1296]: https://github.com/tj/commander.js/pull/1296
40 unmodified lines
284[6.2.0]: https://github.com/tj/commander.js/compare/v6.1.0..v6.2.0285[6.1.0]: https://github.com/tj/commander.js/compare/v6.0.0..v6.1.0286[6.0.0]: https://github.com/tj/commander.js/compare/v5.1.0..v6.0.0287[6.0.0-0]: https://github.com/tj/commander.js/compare/v5.1.0..v6.0.0-0434[5.1.0]: https://github.com/tj/commander.js/compare/v5.0.0..v5.1.0435[5.0.0]: https://github.com/tj/commander.js/compare/v4.1.1..v5.0.0436[5.0.0-4]: https://github.com/tj/commander.js/compare/v5.0.0-3..v5.0.0-4437[5.0.0-3]: https://github.com/tj/commander.js/compare/v5.0.0-2..v5.0.0-3438[5.0.0-2]: https://github.com/tj/commander.js/compare/v5.0.0-1..v5.0.0-2439[5.0.0-1]: https://github.com/tj/commander.js/compare/v5.0.0-0..v5.0.0-1440[5.0.0-0]: https://github.com/tj/commander.js/compare/v4.1.1..v5.0.0-0
modified:package.json+1 added-1 removed
modified:Readme.md+1 added-1 removed
908 unmodified lines
909More samples can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.910911## Support912913The current version of Commander is fully supported on Long Term Support versions of node, and requires at least node v10.913The current version of Commander is fully supported on Long Term Support versions of node, and requires at least node v12.914(For older versions of node, use an older version of Commander. Commander version 2.x has the widest support.)915916The main forum for free and community support is the project [Issues](https://github.com/tj/commander.js/issues) on GitHub.917
5 unmodified lines
modified:SECURITY.md+1 added-2 removed