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

refactor(utils): use build-md for markdown formatting #755

Merged
merged 1 commit into from
Jul 22, 2024
Merged

Conversation

matejchalk
Copy link
Collaborator

@matejchalk matejchalk commented Jul 21, 2024

I've published a library called build-md for dynamically rendering Markdown documents 🚀

I refactored our Markdown rendering logic to use this library. The advantage is our logic now focuses on document semantics, and is no longer concerned with Markdown formatting rules (like where to add separator lines and what to indent). The library's Markdown output is better formatted (fewer Markdown lint violations) - HTML is only used when necessary (context-sensitive rendering), there are no extra or missing separator lines, and the table columns are automatically aligned (as if by Prettier).

image


The reason I want this to be a standalone library is because it's applicable to other projects as well like @code-pushup/eslint-config (migrated in code-pushup/eslint-config@8ac8793) or zod2md (migration planned).

@github-actions github-actions bot added 📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🧩 core 🧩 utils 🛠️ tooling labels Jul 21, 2024
Copy link

github-actions bot commented Jul 21, 2024

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared target commit 0dfbb15 with source commit d45213d.

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🟡 55 🟡 54 ↓ −1.3
Updates 🟡 78 🟡 79 ↑ +0.7
Code coverage 🟡 89 🟡 90 ↑ +0.3
Accessibility 🟢 91 🟢 91
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Bug prevention 🟢 100 🟢 100
Code style 🟢 99 🟢 99
Security 🟢 100 🟢 100
Custom checks 🟡 67 🟡 67

🗃️ Groups

👍 2 groups improved, 👎 1 group regressed
🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🟡 55 🟡 54 ↓ −1.3
JS Packages NPM outdated dependencies 🟡 78 🟡 79 ↑ +0.7
Code coverage Code coverage metrics 🟡 89 🟡 90 ↑ +0.3

17 other groups are unchanged.

🛡️ Audits

👍 4 audits improved, 👎 5 audits regressed, 14 audits changed without impacting score
🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Speed Index 🟥 6.4 s 🟨 5.3 s ↓ −17 %
Lighthouse Largest Contentful Paint 🟨 2.9 s 🟨 3.2 s ↑ +13 %
Lighthouse First Contentful Paint 🟨 2.8 s 🟨 2.9 s ↑ +5 %
Lighthouse First Meaningful Paint 🟨 2.8 s 🟨 2.9 s ↑ +5 %
Lighthouse Time to Interactive 🟥 16.4 s 🟥 17.1 s ↑ +4 %
JS Packages Outdated NPM prod dependencies. 🟨 13 outdated package versions (4 major, 3 minor, 6 patch) 🟨 13 outdated package versions (4 major, 3 minor, 6 patch)  +0 %
Code coverage Function coverage 🟩 91.9 % 🟩 92.3 % ↑ +0 %
Code coverage Branch coverage 🟨 83.4 % 🟨 83.7 % ↑ +0 %
Code coverage Line coverage 🟩 91.9 % 🟩 91.7 % ↓ +0 %
Lighthouse Total Blocking Time 🟥 7,360 ms 🟥 8,870 ms ↑ +21 %
Lighthouse Max Potential First Input Delay 🟥 2,900 ms 🟥 3,930 ms ↑ +36 %
Lighthouse JavaScript execution time 🟥 9.5 s 🟥 10.4 s ↑ +10 %
Lighthouse Metrics 🟩 16429 🟩 17059 ↑ +4 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 1,786 KiB 🟩 Total size was 1,785 KiB ↓ +0 %
Lighthouse Eliminate render-blocking resources 🟥 Potential savings of 810 ms 🟥 Potential savings of 1,310 ms ↑ +63 %
Lighthouse Uses efficient cache policy on static assets 🟨 27 resources found 🟨 27 resources found ↓ +0 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 105 KiB 🟥 Potential savings of 105 KiB ↑ +30 %
Lighthouse Initial server response time was short 🟩 Root document took 460 ms 🟩 Root document took 340 ms ↓ −25 %
Lighthouse Server Backend Latencies 🟩 220 ms 🟩 130 ms ↓ −41 %
Lighthouse Minimizes main-thread work 🟥 20.5 s 🟥 20.6 s ↑ +0 %
Lighthouse Network Round Trip Times 🟩 50 ms 🟩 20 ms ↓ −59 %
Lighthouse Avoids an excessive DOM size 🟥 2,187 elements 🟥 2,186 elements ↓ +0 %
Lighthouse Cumulative Layout Shift 🟩 0 🟩 0 ↓ −100 %

486 other audits are unchanged.

@matejchalk matejchalk marked this pull request as ready for review July 21, 2024 10:58
@matejchalk matejchalk added ➕ enhancement new feature or request and removed 📖 Project documentation improvements or additions to the project documentation 🧩 core labels Jul 21, 2024
@BioPhoton
Copy link
Collaborator

BioPhoton commented Jul 21, 2024

Really good!! It's funny that I thought about that area yesterday.
Can we maybe move the lib into our org?

@matejchalk
Copy link
Collaborator Author

Can we maybe move the lib into our org?

I built this library in my free time, and it has applications beyong Code PushUp (e.g. zod2md), so I want to keep it under my account.

Copy link
Collaborator

@Tlacenka Tlacenka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The markdown composition is much more readable now 👏

vmasek
vmasek previously approved these changes Jul 22, 2024
BioPhoton
BioPhoton previously approved these changes Jul 22, 2024
Copy link
Collaborator

@Tlacenka Tlacenka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@matejchalk matejchalk merged commit 9388b49 into main Jul 22, 2024
30 checks passed
@matejchalk matejchalk deleted the build-md branch July 22, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧩 core ➕ enhancement new feature or request 📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🛠️ tooling 🧩 utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants