Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(utils): formatTree utility #223

Merged
merged 10 commits into from
Dec 1, 2023
Merged

feat(utils): formatTree utility #223

merged 10 commits into from
Dec 1, 2023

Conversation

Barbapapazes
Copy link
Member

@Barbapapazes Barbapapazes commented Aug 10, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Add a logger that display a tree of items. This can be used in Nitro when pages are prerendered.

Supports:

  • Custome prefix
  • Global tree color
  • Color per item with a global color
  • Deep tree

image

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@Barbapapazes Barbapapazes self-assigned this Aug 10, 2023
@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Attention: 54 lines in your changes are missing coverage. Please review.

Comparison is base (7fc69ba) 61.13% compared to head (7e34ab5) 60.13%.
Report is 2 commits behind head on main.

❗ Current head 7e34ab5 differs from pull request most recent head af47a87. Consider uploading reports for the commit af47a87 to get more accurate results

Files Patch % Lines
src/utils/tree.ts 40.47% 50 Missing ⚠️
src/reporters/fancy.ts 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #223      +/-   ##
==========================================
- Coverage   61.13%   60.13%   -1.00%     
==========================================
  Files          13       14       +1     
  Lines        1379     1480     +101     
  Branches       58       58              
==========================================
+ Hits          843      890      +47     
- Misses        536      590      +54     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@Barbapapazes Barbapapazes requested a review from pi0 August 10, 2023 17:24
@Barbapapazes Barbapapazes added the enhancement New feature or request label Aug 10, 2023
src/utils/tree.ts Outdated Show resolved Hide resolved
src/utils/tree.ts Outdated Show resolved Hide resolved
src/utils/tree.ts Outdated Show resolved Hide resolved
src/utils/tree.ts Show resolved Hide resolved
@pi0 pi0 changed the title feat: add tree logger feat(utils): formatTree utility Dec 1, 2023
@pi0
Copy link
Member

pi0 commented Dec 1, 2023

Thanks for working on this it is a really useful addition! πŸ”₯

I have made a couple of reactors to keep the feature as an opt-in util. Despite normal log levels and also box where formatting for them is optional, with tree, when reporters don't implement it (basic, json, browser, etc) it will lead to and unreadable output. I am thinking to introduce more of formatting utils like this consola/utils subpath so we can easily scale without worrying about this.

@pi0 pi0 merged commit ce2b368 into main Dec 1, 2023
2 checks passed
@pi0 pi0 deleted the feat/format-tree branch December 1, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants