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: add kebab-case options to cli flags #5395

Merged
merged 14 commits into from
Jan 18, 2023

Conversation

khendrikse
Copy link
Contributor

@khendrikse khendrikse commented Jan 16, 2023

πŸŽ‰ Thanks for submitting a pull request! πŸŽ‰

Summary

Fixes https://github.com/netlify/team-dev/issues/55

This is an example of the way we could work on implementing new kebab-case options as CLI flags, as described in the above ticket.

In this example you can see how we could achieve the following:

  • Add kebab-case options to flags that are currently camelCase.
  • Keep supporting camelCase, but hide the option from the help command.

For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code πŸ§‘β€πŸ’». This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire πŸ”₯ (e.g. incident related), you can skip this step.
  • Read the contribution guidelines πŸ“–. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) πŸ§ͺ
  • Update or add documentation (if features were changed or added) πŸ“
  • Make sure the status checks below are successful βœ…

A picture of a cute animal (not mandatory, but encouraged)

@github-actions
Copy link

github-actions bot commented Jan 16, 2023

πŸ“Š Benchmark results

Comparing with 87adddc

Package size: 267 MB

(no change)

^                  267 MB  267 MB  267 MB 
β”‚  260 MB  260 MB   β”Œβ”€β”€β”    β”Œβ”€β”€β”    β”Œβ”€β”€β”  
β”‚   β”Œβ”€β”€β”    β”Œβ”€β”€β”    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |β–’β–’|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-4     T-3     T-2     T-1      T    
Legend

@khendrikse khendrikse force-pushed the feat-55/add-kebab-case-options-to-cli-flags branch 4 times, most recently from c59a8c0 to ac0c729 Compare January 16, 2023 13:30
@khendrikse khendrikse force-pushed the feat-55/add-kebab-case-options-to-cli-flags branch from ac0c729 to c7fae0c Compare January 16, 2023 13:31
src/commands/base-command.mjs Outdated Show resolved Hide resolved
src/commands/base-command.mjs Outdated Show resolved Hide resolved
src/utils/option-deprecation.mjs Outdated Show resolved Hide resolved
@khendrikse khendrikse self-assigned this Jan 16, 2023
@khendrikse
Copy link
Contributor Author

@eduardoboucas mentioned that it might be worth not deprecating the old options and just keeping them but hidden. This way we don't have to add all the deprecation logic and it should not be a big maintenance overhead.

Planning to reduce the scope of the issue to not include warnings about deprecating older options.

@khendrikse khendrikse changed the title feat: add kebab-case options to cli flags - first example feat: add kebab-case options to cli flags Jan 17, 2023
@khendrikse khendrikse marked this pull request as ready for review January 17, 2023 17:19
@khendrikse khendrikse requested a review from a team as a code owner January 17, 2023 17:19
Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

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

❀️ Nice! Left a couple of minor comments, but this is looking great.

src/commands/dev/dev.mjs Show resolved Hide resolved
src/commands/dev/dev.mjs Show resolved Hide resolved
@khendrikse khendrikse merged commit 6d6531a into main Jan 18, 2023
@khendrikse khendrikse deleted the feat-55/add-kebab-case-options-to-cli-flags branch January 18, 2023 09:48
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