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(models): auto-generate JSDoc annotations #928

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

hanna-skryl
Copy link
Collaborator

Closes #827

This PR introduces a TypeScript transformer that automatically generates JSDoc annotations for type definitions within the models package. The transformer ensures that all Zod-based schemas are documented with reference links, providing easy navigation to Markdown documentation.

Demo

@hanna-skryl hanna-skryl self-assigned this Jan 31, 2025
@hanna-skryl hanna-skryl marked this pull request as ready for review January 31, 2025 01:20
Copy link

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared target commit 69a382c with source commit 6c7ed9f.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🟡 52 🟡 52 ↑ +0.2
Updates 🟡 77 🟡 77 ↑ +0.1
Code coverage 🟢 91 🟢 91 ↓ −0.1
Documentation 🔴 23 🔴 23 ↓ −0.1
Security 🟡 79 🟡 79
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Bug prevention 🟢 100 🟢 100
Code style 🟢 100 🟢 100
👍 2 groups improved, 👎 2 groups regressed, 👍 2 audits improved, 👎 8 audits regressed, 10 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🟡 52 🟡 52 ↑ +0.2
JS Packages NPM outdated dependencies 🟡 77 🟡 77 ↑ +0.1
Code coverage Code coverage metrics 🟢 91 🟢 91 ↓ −0.1
JSDoc coverage Documentation coverage 🔴 23 🔴 23 ↓ −0.1

14 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Speed Index 🟨 5.1 s 🟨 5.7 s ↑ +10.4 %
Lighthouse Largest Contentful Paint 🟨 3.7 s 🟨 3.5 s ↓ −5.2 %
Lighthouse First Contentful Paint 🟨 2.7 s 🟨 2.8 s ↑ +1.4 %
Lighthouse Total Blocking Time 🟥 3,740 ms 🟥 4,840 ms ↑ +29.3 %
Lighthouse Time to Interactive 🟥 14.1 s 🟥 14.8 s ↑ +4.9 %
JS Packages Outdated NPM dev dependencies. 🟨 47 outdated package versions (25 major, 14 minor, 8 patch) 🟨 47 outdated package versions (25 major, 14 minor, 8 patch)  +0 %
Code coverage Line coverage 🟩 90.1 % 🟨 89.8 % ↓ −0.3 %
Code coverage Branch coverage 🟨 86 % 🟨 85.9 % ↓ −0.1 %
JSDoc coverage Functions coverage 🟥 437 undocumented functions 🟥 439 undocumented functions ↑ +0.5 %
JSDoc coverage Variables coverage 🟥 197 undocumented variables 🟥 200 undocumented variables ↑ +1.5 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 1,808 KiB 🟩 Total size was 1,812 KiB ↑ +0.2 %
Lighthouse Minimizes main-thread work 🟥 13.0 s 🟥 15.7 s ↑ +21.3 %
Lighthouse Max Potential First Input Delay 🟥 2,660 ms 🟥 1,820 ms ↓ −31.6 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +4.9 %
Lighthouse JavaScript execution time 🟥 7.1 s 🟥 7.6 s ↑ +7 %
Lighthouse Uses efficient cache policy on static assets 🟨 27 resources found 🟨 27 resources found ↓ −0.1 %
Lighthouse Initial server response time was short 🟩 Root document took 340 ms 🟩 Root document took 450 ms ↑ +30.3 %
Lighthouse Server Backend Latencies 🟩 110 ms 🟩 170 ms ↑ +55 %
Lighthouse Network Round Trip Times 🟩 20 ms 🟩 50 ms ↑ +259.5 %
Lighthouse Eliminate render-blocking resources 🟥 Potential savings of 900 ms 🟥 Potential savings of 870 ms ↓ −3.8 %

576 other audits are unchanged.

@vmasek
Copy link
Collaborator

vmasek commented Jan 31, 2025

Really nice! I just found out few days ago about transformers in TS and how powerful they are and this is really amazing DX & UX improvement

Copy link
Collaborator

@matejchalk matejchalk left a comment

Choose a reason for hiding this comment

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

Amazing 😍 Good to learn about transformers 😁 Very elegant solution 💯

@hanna-skryl hanna-skryl merged commit 29cf02a into main Jan 31, 2025
17 checks passed
@hanna-skryl hanna-skryl deleted the feat/annotate-zod-types branch January 31, 2025 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typings and documentation issue in custom plugins
3 participants