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
Provenance
- Commit
eced8e4- Tree
0707068- Author
John Gee <john@ruru.gen.nz>- Committer
GitHub <noreply@github.com>- Parent
b286da9
6 files changed+163 added−159 removed
modified:.github/workflows/tests.yml+1 added-1 removed
7 unmodified lines89101112121314151611 unmodified lines7 unmodified lines runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: node-version: [10.x, 12.x, 14.x, 15.x] node-version: [12.x, 14.x, 15.x] os: [ubuntu-latest, windows-latest, macos-latest]
steps: - uses: actions/checkout@v111 unmodified linesadded:changelogs/CHANGELOG-5.md+158 added
1+# Changelog for 5.x2+3+## [5.1.0] (2020-04-25)4+5+### Added6+7+- 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])9+10+### Fixed11+12+- omit masked help flags from the displayed help ([#645], [#1247])13+- remove old short help flag when change help flags using `helpOption` ([#1248])14+15+### Changed16+17+- 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])23+24+## [5.0.0] (2020-03-14)25+26+### Added27+28+* 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])44+45+### Fixed46+47+* 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])54+55+### Changed56+57+* *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 dependencies77+78+### Removed79+80+* 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])83+84+### Migration Tips85+86+If 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.87+88+If 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.89+90+If you use `.command('*')` to add a default command, you may be be able to switch to `isDefault:true` with a named command.91+92+If you want to continue combining short options with optional values as though they were boolean flags, set `combineFlagAndOptionalValue(false)`93+to expand `-fb` to `-f -b` rather than `-f b`.94+95+## [5.0.0-4] (2020-03-03)96+97+(Released in 5.0.0)98+99+## [5.0.0-3] (2020-02-20)100+101+(Released in 5.0.0)102+103+## [5.0.0-2] (2020-02-10)104+105+(Released in 5.0.0)106+107+## [5.0.0-1] (2020-02-08)108+109+(Released in 5.0.0)110+111+## [5.0.0-0] (2020-02-02)112+113+(Released in 5.0.0)114+115+[#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/1248151+152+[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-0modified:CHANGELOG.md+1 added-154 removed
223 unmodified lines224 ## [6.0.0-0] (2020-06-20)225 226 (Released in 6.0.0)227 228-## [5.1.0] (2020-04-25)228 230-### Added231-232-- 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])234-235-### Fixed236-237-- omit masked help flags from the displayed help ([#645], [#1247])238-- remove old short help flag when change help flags using `helpOption` ([#1248])239-240-### Changed241-242-- 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])248-249-## [5.0.0] (2020-03-14)250-251-### Added252-253-* 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])269-270-### Fixed271-272-* 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])279-280-### Changed281-282-* *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 dependencies302-303-### Removed304-305-* 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])308-309-### Migration Tips310-311-If 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.312-313-If 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.314-315-If you use `.command('*')` to add a default command, you may be be able to switch to `isDefault:true` with a named command.316-317-If you want to continue combining short options with optional values as though they were boolean flags, set `combineFlagAndOptionalValue(false)`318-to expand `-fb` to `-f -b` rather than `-f b`.319-320-## [5.0.0-4] (2020-03-03)321-322-(Released in 5.0.0)323-324-## [5.0.0-3] (2020-02-20)325-326-(Released in 5.0.0)327-328-## [5.0.0-2] (2020-02-10)329-330-(Released in 5.0.0)331-332-## [5.0.0-1] (2020-02-08)333-334-(Released in 5.0.0)335-336-## [5.0.0-0] (2020-02-02)337-338-(Released in 5.0.0)339-229 ## Older versions230 231+* [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)237 348-[#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/129640 unmodified lines284 [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-0modified:package.json+1 added-1 removed
60 unmodified lines61626364656566676860 unmodified lines "/node_modules/" ] }, "engines": { "node": ">= 10" "node": ">= 12" }, "support": true}modified:Readme.md+1 added-1 removed
908 unmodified lines909 More samples can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.910 911 ## Support912 913-The current version of Commander is fully supported on Long Term Support versions of node, and requires at least node v10.913+The 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.)915 916 The main forum for free and community support is the project [Issues](https://github.com/tj/commander.js/issues) on GitHub.917 5 unmodified linesmodified:SECURITY.md+1 added-2 removed
6 unmodified lines78910111211121314154 unmodified lines6 unmodified lines| Version | Supported || ------- | ------------------------------------------ || 7.x | :white_check_mark: || 6.x | :white_check_mark: support ends 2021-30-06 || 5.x | :white_check_mark: support ends 2021-01-20 || < 5 | :x: || < 6 | :x: |
Pull Requests for security issues will be considered for older versions back to 2.x.
## Reporting a Vulnerability4 unmodified lines