unjs / consola

๐Ÿจ Elegant Console Logger for Node.js and Browser
Other
5.78k stars 165 forks source link

fix: export spinner function from utils prompt #293

Open m0nch1 opened 2 months ago

m0nch1 commented 2 months ago

๐Ÿ”— Linked issue

issue: https://github.com/unjs/consola/issues/284

โ“ Type of change

๐Ÿ“š Description

Use spinner in examples/spinner.ts, prompt.ts

๐Ÿ“ Checklist

note

Result of local run...

https://github.com/unjs/consola/assets/26811986/b1bf45b1-f5fd-4ca9-bde9-60700a56e017

adesombergh commented 2 months ago

Changing the examples does not fix the issue. Running consola.start(), await new Promise((resolve) => setTimeout(resolve, 1000));, consola.success() will still not show an animated spinner as expected.

m0nch1 commented 2 months ago

@adesombergh In the current implementation, consola.start does not have a spinner function, and the spinner is defined in utils/prompt.ts

And my PR only works with spinner in example, so there is no way to actually import consola and use it...

I think this needs to be implemented so that spinner can work with prompt...

m0nch1 commented 2 months ago

I tried to make spinner available from utils!

m0nch1 commented 1 month ago

@Atinux @adesombergh What do you think of this? I'm sure spinner is not used yet, and maybe it's okay to not support it, once it is!