Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up state from previous parse call when calling parse() / parseAsync() #1919

Closed
wants to merge 18 commits into from

Commits on Jul 28, 2023

  1. Configuration menu
    Copy the full SHA
    3c6ef71 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b6d53b2 View commit details
    Browse the repository at this point in the history
  3. Improve logic for option values supplied in user code

    Public setOptionValueWithSource() method only accepts 'config' as source
    aweebit committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    437291f View commit details
    Browse the repository at this point in the history
  4. Remove public method functionality overlap

    Remove overlap between setOptionValue() and setOptionValueWithSource().
    Make the latter's source parameter required.
    aweebit committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    fbe911f View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2023

  1. Do not clear persistent state

    
    Co-authored-by: John Gee <john@ruru.gen.nz>
    aweebit and shadowspawn committed Jul 29, 2023
    Configuration menu
    Copy the full SHA
    ebf672a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7fd0b22 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    940b111 View commit details
    Browse the repository at this point in the history
  4. Use string instead of OptionValueSource

    OptionValueSource is only meaningful as defined in
    commander-js/extra-typings#3
    aweebit committed Jul 29, 2023
    Configuration menu
    Copy the full SHA
    52d5885 View commit details
    Browse the repository at this point in the history
  5. Make user-supplied option values non-persistent while parsing

    Relevant for setOptionValue() and setOptionValueWithSource() calls in
    hooks and actions.
    
    _asyncParsing is stored to avoid redundant property when merged with
    tj#1915 or tj#1917.
    aweebit committed Jul 29, 2023
    Configuration menu
    Copy the full SHA
    94e439d View commit details
    Browse the repository at this point in the history
  6. Add non-persistent user-supplied option support for subcommands

    ...by adding missing parameter in the _parseCommand() call in
    _dispatchSubcommand().
    aweebit committed Jul 29, 2023
    Configuration menu
    Copy the full SHA
    274be1a View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2023

  1. Configuration menu
    Copy the full SHA
    56eed63 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4a7bc41 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fcc97e2 View commit details
    Browse the repository at this point in the history
  4. Return proxy redirecting keys for options-as-properties from Command …

    …constructor
    
    Required for options-as-properties support in resetParseState().
    Has the added benefit of supporting (in a limited way) option names
    conflicting with instance's properties even when options-as-properties
    are enabled.
    aweebit committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    36fa763 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    829655d View commit details
    Browse the repository at this point in the history
  6. Use right variable name

    aweebit committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    633e4e4 View commit details
    Browse the repository at this point in the history
  7. Fully support options with names conflicting with instance properties

    Additionally fix comment impreciseness
    aweebit committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    be00f59 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2023

  1. Return proxy from constructor further up the prototype chain

    Borrowed from eb142d8 that was supposed to land in the now-closed tj#1921.
    
    The change ensures the this object used in Command is the proxy from the
    very beginning, even in the constructor. This solves pretty much all
    issues with returning the proxy from a constructor. For example, private
    fields can be used now. More details available at:
    tj#1921 (comment)
    
    Additionally, the ownKeys() trap and wrong spelling in comments have
    been fixed (the former change being borrowed from fc927c8).
    aweebit committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    b53703b View commit details
    Browse the repository at this point in the history