Skip to content

Finishing the project commands TS port #1449

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

brandenrodgers
Copy link
Contributor

Description and Context

This wraps up the work to port all of the project command files to TS. I had to make some yargs typing changes to make things work well. I'm trying to strike the balance between getting value out of the yargs types, and making this so clunky to use that it's too much of a hassle to follow the patterns.

I had to make a few changes:

  • I realized that the makeYargsBuilder util was incorrectly matching on command buckets for help output. For example, running hs project create --help was returning the help output for hs project --hlep. I fixed this by matching on the last command that the user ran (e.g "create" in hs project create --help)
  • I had to add some custom yargs types. The CommandModule interface is a little annoying to use because it makes the builder optional, and changes the type from a simple function to something else. I created some overrides that simplifies that type for our use cases
  • All of the commands use makeYargsBuilder now
  • All of the commands have one default export (except some of them also export their handler arg types)

Screenshots

TODO

Who to Notify

@brandenrodgers
Copy link
Contributor Author

I'm going to wait for this to be merged before I put this up for review.

@brandenrodgers brandenrodgers marked this pull request as ready for review April 18, 2025 16:30
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.

1 participant