privatenumber / tasuku

✅ タスク — The minimal task visualizer for Node.js
MIT License
1.91k stars 30 forks source link

Configurable renderers? #25

Open mmkal opened 2 months ago

mmkal commented 2 months ago

Is your feature request related to a problem?

Hi, I want to add listr2/tasuku-like support to a migration library I maintain, umzug. The default behaviour of tasuku is perfect for running it from a dev machine/via CLI. But an important use case for umzug is also calling it via API, for example in a server hosted in the cloud. For those cases right now, umzug accepts a logger as input, so you can pass in a JSON logger (or any logger) to control what is output.

I'm trying to figure out whether it would be possible to integrate tasuku without that being the only way logs can be emitted.

Describe the solution you'd like

listr2 supports custom renderers - I think that's roughly what I'm looking for.

Describe alternatives you've considered

I'm not sure - maybe I'm thinking about this in the wrong way?

Additional context

I think that running migrations using tasuku to control the output will involve tasuku being pretty deeply integrated into the umzug codebase, but maybe there's a lighter-touch way of doing things?