Open JoshuaKGoldberg opened 1 year ago
@cpreston321 that PR doesn't resolve this issue though. It just runs s.start
and s.stop
around the tasks. This issue is for nesting tasks within the spinners.
@JoshuaKGoldberg Got it, i reopened the issue.
So if task 1 completes it moves to task 2.. Let's say if task 2 fails does that kick out of the task process / cancel the spinner ?
Also if it easier you can create a draft pull request with some examples. I think for this functionality we can keep this at the @clack/prompt
level. I think in the future we can think more of creating standalone helper primitives in a separate package.
if task 2 fails does that kick out of the task process / cancel the spinner ?
I would think so, yeah. At least by default. Maybe there could be an API option for whether to bail or continue?
create a draft pull request with some examples
Yes! https://github.com/natemoo-re/clack/pull/158 is roughly what I was thinking of. I haven't put too much thought into the API design, pending posting here.
Is your feature request related to a problem? Please describe.
Grouping (https://github.com/natemoo-re/clack/tree/24a3f4a20019c7dad2f69bcf163a8b5a3f747a16/packages/prompts#grouping) is available right now for prompts, but not for spinners. But I'd like to group the spinners together too: having a parent task and sub-task.
Describe the solution you'd like
Could we add a new spinner API analogous to
p.group
? Maybe,p.spinnerGroup
?Describe alternatives you've considered
In https://github.com/JoshuaKGoldberg/template-typescript-node-package/issues/708 -> https://github.com/JoshuaKGoldberg/create-typescript-app/pull/710 I kind of did it manually, wrapping around Clack. It's not great.
https://github.com/natemoo-re/clack/assets/3335181/a3c6cbe4-8abe-4357-977a-377d4e53d9d1
Additional context
I'd be happy to contribute this, or if you don't want to keep it as a core feature, publish it as a standalone helper package.