feat: add support for `consola.group` & `consola.groupEnd`
resolves #184
Preview:
Codecov Report
Attention: Patch coverage is 30.61224% with 34 lines in your changes missing coverage. Please review.
Project coverage is 29.11%. Comparing base (
24c98ce) to head (d536a3e). Report is 57 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| examples/group.ts | 0.00% | 15 Missing and 1 partial :warning: |
| src/reporters/basic.ts | 7.14% | 13 Missing :warning: |
| src/consola.ts | 50.00% | 4 Missing :warning: |
| src/reporters/fancy.ts | 66.66% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #374 +/- ##
===========================================
- Coverage 61.08% 29.11% -31.98%
===========================================
Files 13 44 +31
Lines 1380 1769 +389
Branches 58 92 +34
===========================================
- Hits 843 515 -328
- Misses 537 1226 +689
- Partials 0 28 +28
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
I plan to use indentation to display groups, consistent with native behavior. What do you think? 🤔
consola.info('0 - Hello World!')
consola.group('0 - Group')
consola.info('1 - Hello World!')
consola.warn('1 - Hello World!')
consola.error(new Error('1 - Hello World!'))
consola.group('1 - Group')
consola.info('1-1 - Hello World!')
consola.warn('1-1 - Hello World!')
consola.error(new Error('1-1 - Hello World!'))
consola.groupEnd()
consola.info('1 - Hello World!')
consola.warn('1 - Hello World!')
consola.error(new Error('1 - Hello World!'))
consola.groupEnd()
consola.info('0 - Hello World!')
Would this work for you? (vertical line added) @pi0
Surely we can also use them for indentation (array.length), I am thinking to allow show a vertical line | in left to make it more organized better than what Node.js console does wdyt?
Any news on this? Would love this feature! @kricsleo are you still working on this one? Thanks for your effort!
I currently leave this PR as it is until more changes are requested. (And, the author, pi0 might not have enough bandwith for this for now)
It is a VERY nice addition and my todo.