Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

[Snyk] Upgrade commander from 2.20.3 to 8.3.0 #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snyk-bot
Copy link

@snyk-bot snyk-bot commented Feb 1, 2022

Snyk has created this PR to upgrade commander from 2.20.3 to 8.3.0.

merge advice
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


Warning: This is a major version upgrade, and may be a breaking change.

  • The recommended version is 35 versions ahead of your current version.
  • The recommended version was released 3 months ago, on 2021-10-22.
Release notes
Package name: commander
  • 8.3.0 - 2021-10-22

    Added

    • .getOptionValueSource() and .setOptionValueWithSource(), where expected values for source are one of 'default', 'env', 'config', 'cli' (#1613)

    Deprecated

    • .command('*'), use default command instead (#1612)
    • on('command:*'), use .showSuggestionAfterError() instead (#1612)
  • 8.2.0 - 2021-09-10

    Added

    • .showSuggestionAfterError() to show suggestions after unknown command or unknown option (#1590)
    • add Option support for values from environment variables using .env() (#1587)

    Changed

    • show error for unknown global option before subcommand (rather than just help) (#1590)

    Removed

    • TypeScript declaration of unimplemented Option method argumentRejected
  • 8.1.0 - 2021-07-27

    Added

    • .copyInheritedSettings() (#1557)
    • update Chinese translations for Commander v8 (#1570)
    • Argument methods for .argRequired() and .argOptional() (#1567)
  • 8.0.0 - 2021-06-25

    Added

    • .argument(name, description) for adding command-arguments (#1490)
      • supports default value for optional command-arguments (#1508)
      • supports custom processing function (#1508)
    • .createArgument() factory method (#1497)
    • .addArgument() (#1490)
    • Argument supports .choices() (#1525)
    • .showHelpAfterError() to display full help or a custom message after an error (#1534)
    • .hook() with support for 'preAction' and 'postAction' callbacks (#1514)
    • client typing of .opts() return type using TypeScript generics (#1539)
    • the number of command-arguments is checked for programs without an action handler (#1502)
    • .getOptionValue() and .setOptionValue() (#1521)

    Changed

    • refactor and simplify TypeScript declarations (with no default export) (#1520)
    • .parseAsync() is now declared as async (#1513)
    • Breaking: Help method .visibleArguments() returns array of Argument (#1490)
    • Breaking: Commander 8 requires Node.js 12 or higher (#1500)
    • Breaking: CommanderError code commander.invalidOptionArgument renamed commander.invalidArgument (#1508)
    • Breaking: TypeScript declaration for .addTextHelp() callback no longer allows result of undefined, now just string (#1516)
    • refactor index.tab into a file per class (#1522)
    • remove help suggestion from "unknown command" error message (see .showHelpAfteError()) (#1534)
    • Command property .arg initialised to empty array (was previously undefined) (#1529)
    • update dependencies

    Deprecated

    • second parameter of cmd.description(desc, argDescriptions) for adding argument descriptions (#1490)
      • (use new .argument(name, description) instead)
    • InvalidOptionArgumentError (replaced by InvalidArgumentError) (#1508)

    Removed

    • Breaking: TypeScript declaration for default export of global Command object (#1520)
      • (still available as named program export)

    Migration Tips

    If you have a simple program without an action handler, you will now get an error if
    there are missing command-arguments.

    program
      .option('-d, --debug')
      .arguments('<file>');
    program.parse();
    $ node trivial.js 
    error: missing required argument 'file'

    If you want to show the help in this situation, you could check the arguments before parsing:

    if (process.argv.length === 2)
      program.help();
    program.parse();

    Or, you might choose to show the help after any user error:

    program.showHelpAfterError();
  • 8.0.0-2 - 2021-06-06

    Added

    • .showHelpAfterError() to display full help or a custom message after an error (#1534)
    • custom argument processing function also called without action handler (only with action handler in v8.0.0-0) (#1529)

    Changed

    • remove help suggestion from "unknown command" error message (see .showHelpAfteError()) (#1534)
    • Command property .arg initialised to empty array (was previously undefined) (#1529)
  • 8.0.0-1 - 2021-05-31

    Added

    • .addArgument() (#1490)
    • Argument supports .choices() (#1525)
    • client typing of .opts() return type using TypeScript generics (#1539)

    Changed

    • refactor index.tab into a file per class (#1522)
    • update dependencies
  • 8.0.0-0 - 2021-05-22
    Read more
  • 7.2.0 - 2021-03-21

    Added

    • TypeScript typing for parent property on Command (#1475)
    • TypeScript typing for .attributeName() on Option (#1483)
    • support information in package (#1477)

    Changed

    • improvements to error messages, README, and tests
    • update dependencies
  • 7.1.0 - 2021-02-15
    Read more
  • 7.0.0 - 2021-01-15
    Read more
  • 7.0.0-2 - 2020-12-14
  • 7.0.0-1 - 2020-11-21
  • 7.0.0-0 - 2020-10-25
  • 6.2.1 - 2020-12-14
  • 6.2.0 - 2020-10-25
  • 6.1.0 - 2020-08-28
  • 6.0.0 - 2020-07-19
  • 6.0.0-0 - 2020-06-20
  • 5.1.0 - 2020-04-25
  • 5.0.0 - 2020-03-14
  • 5.0.0-4 - 2020-03-03
  • 5.0.0-3 - 2020-02-20
  • 5.0.0-2 - 2020-02-11
  • 5.0.0-1 - 2020-02-08
  • 5.0.0-0 - 2020-02-01
  • 4.1.1 - 2020-02-03
  • 4.1.0 - 2020-01-06
  • 4.0.1 - 2019-11-11
  • 4.0.0 - 2019-11-01
  • 4.0.0-1 - 2019-10-08
  • 4.0.0-0 - 2019-10-01
  • 3.0.2 - 2019-09-26
  • 3.0.1 - 2019-08-30
  • 3.0.0 - 2019-08-09
  • 3.0.0-0 - 2019-07-27
  • 2.20.3 - 2019-10-11
from commander GitHub release notes
Commit messages
Package name: commander
  • 43f4743 Fix date
  • 34366fd Prepare for 8.3.0
  • 0847a7f ci: update 'node-version'
  • 36c2f68 Change .action() JSDoc/TSDoc example (#1614)
  • 6e00f44 Add setOptionValueWithSource and getOptionValueSource (#1613)
  • a546970 Deprecate command:* command and event (#1612)
  • c1472bc Tidy up some old examples (#1604)
  • 950f742 Update CHANGELOG for one-last-thing for 8.2.0
  • 4a370a4 Remove stale argumentRejected method on Option (#1599)
  • b84534b Prepare for 8.2.0 (#1597)
  • 91ccfd5 Suggestion for unknown command and unknown option (#1590)
  • 2911e0e docs: update SECURITY.md
  • 8571a75 Add .env method to Option for consulting environment variable for option value (#1587)
  • 3a0ef21 Fixed deprecated documentation typo
  • 78e335f Fix minor typo (#1579)
  • 3f77e7e Update github-actions (#1574)
  • a9c9f17 Add link for version diff
  • 411ca95 Clarify that more than just README
  • a036bde Prepare for 8.1
  • e6943c4 Update Chinese docs
  • 6f51e4a Feature/argument arg explicit (#1567)
  • 4be69f1 Use getCommandAndParents for array of parents (#1566)
  • 56c4108 Follow jsdoc and tsdoc more closely, especially @ example (#1562)
  • 5517d25 Add copyInheritedSettings (#1557)

Compare


Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

🧐 View latest project report

🛠 Adjust upgrade PR settings

🔕 Ignore this dependency or unsubscribe from future upgrade PRs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant