bombshell-dev / clack

Effortlessly build beautiful command-line apps
https://clack.cc
5.53k stars 90 forks source link

Prettify group return type #107

Closed chrissantamaria closed 1 year ago

chrissantamaria commented 1 year ago

👋 tiny enhancement PR - I noticed that the return type exposed to consumers of select is wrapped by PromptGroupAwaitedReturn:

Screenshot 2023-03-14 at 2 31 02 PM

This has two undesirable consequences:

To make this more clear, this PR wraps the return in a Prettify helper type to make the exposed type a bare object:

Screenshot 2023-03-14 at 2 30 32 PM

This should be a functional noop, but let me know if you notice any undesirable consequences! This pattern is also used a fair amount in other TypeScript projects.

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: 7ffd1cf92f22b44a82a15228f77f7abd54e84357

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

ulken commented 1 year ago

Thank you for your detailed PR, but someone beat you to it 😉: https://github.com/natemoo-re/clack/pull/105

ulken commented 1 year ago

Since the former has been merged, I'm gonna go ahead and close this.

chrissantamaria commented 1 year ago

hah, funny timing - had been thinking about that for a while but never got around to making a PR 😛