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

Simplify typings #1520

Merged
merged 4 commits into from May 17, 2021
Merged

Conversation

shadowspawn
Copy link
Collaborator

@shadowspawn shadowspawn commented May 15, 2021

Pull Request

Problem

The TypeScript typings are pretty complicated to describe default export of a Command object in addition to
Classes. This was appropriate at the time as a faithful description of the javascript implementation.

Related issues: #1037 #1465 and mention in #1392 (comment)

#1037 was previously fixed by describing the class constructors as separate functions. (Yuck.)

Solution

Remove the default export of the program object and use named exports. Way simpler and tidier!

The default import of global Command object was removed from README in Commander v5. Deprecated from Commander v7. Deleted in this PR.

Fixes #1465 (and #1037 fixed too, in new way)

(Hide whitespace changes to make the diff look much simpler.)

ChangeLog

  • remove default export of global Command object from TypeScript declarations
  • refactor and simplify TypeScript declarations

@shadowspawn shadowspawn added this to the v8.0.0 milestone May 16, 2021
Copy link
Collaborator

@abetomo abetomo left a comment

LGTM!

@shadowspawn shadowspawn added the pending release label May 17, 2021
@shadowspawn shadowspawn merged commit ad3f947 into tj:release/8.x May 17, 2021
12 checks passed
@shadowspawn shadowspawn deleted the feature/simplify-typings branch May 17, 2021
@shadowspawn shadowspawn removed the pending release label Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants