consola icon indicating copy to clipboard operation
consola copied to clipboard

Animated spinner

Open adesombergh opened this issue 2 years ago • 4 comments

Environment

"consola": "^3.2.3" Tested on node 20 and 18

Reproduction

Stackblitz reproduction here Github repo here

Describe the bug

Following this exemple i expect consola to show a spinner while the promise resolve. However only a static ◐ character is visible.

Additional context

I don't know if it's related but the spinner function in /src/utils/prompt.ts is never called in the project.

Logs

No response

adesombergh avatar Mar 21 '24 14:03 adesombergh

I search sipnner in the repo and find out sippner in src/utils/prompt.ts is never imported

zerosrat avatar Apr 15 '24 07:04 zerosrat

I search sipnner in the repo and find out sippner in src/utils/prompt.ts is never imported

As mentioned above, I think that spinner is simply not used in the sample, although it is available as an implementation. So I created a PR!

cc: @adesombergh @zerosrat

m0nch1 avatar Apr 17 '24 02:04 m0nch1

Thank you @m0nch1 , however 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.

adesombergh avatar Apr 17 '24 08:04 adesombergh

I think another way to address the use of spinner is to use other npm packages, such as ora+cli-spinners. That's what I'm doing now, using consola for the non-spinner parts and other npm packages for the spinner parts.

zerosrat avatar Apr 23 '24 09:04 zerosrat