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

feat: update commander to v9 #3460

Merged
merged 4 commits into from
Oct 26, 2022
Merged

feat: update commander to v9 #3460

merged 4 commits into from
Oct 26, 2022

Conversation

snitin315
Copy link
Member

@snitin315 snitin315 commented Oct 22, 2022

What kind of change does this PR introduce?
feature

Did you add tests for your changes?
Updated snapshots and tests.

If relevant, did you update the documentation?
No

Summary

  • Update commander to v9
  • Commander v9 provides suggestions for unknown options by default. Removed our custom logic for suggestion options and kept the code for suggesting commands.
  • Ideally, the commander should export its API for suggestSimilar

Does this PR introduce a breaking change?
No

Other information
No

@snitin315 snitin315 requested a review from a team as a code owner October 22, 2022 01:38
@snitin315 snitin315 marked this pull request as draft October 22, 2022 01:38
@codecov
Copy link

codecov bot commented Oct 23, 2022

Codecov Report

Merging #3460 (7f28546) into next (1d362d4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             next    #3460   +/-   ##
=======================================
  Coverage   91.30%   91.30%           
=======================================
  Files          22       22           
  Lines        1587     1588    +1     
  Branches      447      447           
=======================================
+ Hits         1449     1450    +1     
  Misses        138      138           
Impacted Files Coverage Δ
packages/webpack-cli/src/webpack-cli.ts 92.70% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d362d4...7f28546. Read the comment docs.

@snitin315 snitin315 marked this pull request as ready for review October 23, 2022 02:46
[webpack-cli] Run 'webpack --help' to see available commands and options"
`;

exports[`unknown behaviour should log an error if an unknown flag is passed and suggests the closest match to an unknown flag using "b" command: stdout 1`] = `""`;

exports[`unknown behaviour should log an error if an unknown flag is passed and suggests the closest match to an unknown flag using "bundle" command: stderr 1`] = `
"[webpack-cli] Error: Unknown option '--entyr'
[webpack-cli] Did you mean '--entry'?
(Did you mean --entry?)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be great to have [webpack-cli] prefix here, is there the places where we can hook?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can disable it with this.program.showSuggestionAfterError(false); and keep our own logic.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one note

@snitin315
Copy link
Member Author

@alexander-akait Done 👍🏻

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to merge ⭐

@snitin315 snitin315 merged commit eeb3156 into next Oct 26, 2022
@snitin315 snitin315 deleted the update-commander branch October 26, 2022 08:45
snitin315 added a commit that referenced this pull request Nov 6, 2022
snitin315 added a commit that referenced this pull request Nov 8, 2022
alexander-akait pushed a commit that referenced this pull request Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants