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(core): enhance config validation #890

Merged
merged 4 commits into from
Dec 13, 2024

Conversation

hanna-skryl
Copy link
Collaborator

Fixes #704

This PR introduces zod-validation-error as a new project dependency to make Zod validation errors more compact and readable. Due to the limited scope of the issue being resolved, zod-validation-error is currently used only to validate coreConfigSchema.

Formatted config validation errors ConfigValidationErrors

Copy link

github-actions bot commented Dec 12, 2024

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared target commit c8d85d5 with source commit 9099514.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
SEO 🟡 61 🟡 85 ↑ +23.3
Performance 🟡 54 🟡 51 ↓ −3.2
Updates 🟡 74 🟡 75 ↑ +0.8
Security 🟡 82 🟡 81 ↓ −0.3
Code coverage 🟢 90 🟢 90 ↓ −0.1
Accessibility 🟢 91 🟢 91
Best Practices 🟢 100 🟢 100
Bug prevention 🟢 100 🟢 100
Code style 🟢 100 🟢 100
👍 2 groups improved, 👎 3 groups regressed, 👍 2 audits improved, 👎 10 audits regressed, 13 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse SEO 🟡 61 🟡 85 ↑ +23.3
Lighthouse Performance 🟡 54 🟡 51 ↓ −3.2
JS Packages NPM outdated dependencies 🟡 74 🟡 75 ↑ +0.8
JS Packages NPM audit 🟡 82 🟡 81 ↓ −0.3
Code coverage Code coverage metrics 🟢 90 🟢 90 ↓ −0.1

12 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Page isn’t blocked from indexing 🟥 failed 🟩 passed ↑ +∞ %
Lighthouse robots.txt is valid 🟩 passed 🟥 failed ↓ −100 %
Lighthouse Speed Index 🟨 5.7 s 🟥 6.7 s ↑ +17.5 %
Lighthouse First Contentful Paint 🟨 2.9 s 🟥 3.2 s ↑ +10.3 %
Lighthouse Time to Interactive 🟥 13.3 s 🟥 16.2 s ↑ +21.8 %
Lighthouse Largest Contentful Paint 🟨 3.2 s 🟨 3.2 s ↑ +2.4 %
JS Packages Vulnerabilities for NPM dev dependencies. 🟥 12 vulnerabilities (6 high, 4 moderate, 2 low) 🟥 13 vulnerabilities (6 high, 4 moderate, 3 low) ↑ +8.3 %
Lighthouse Total Blocking Time 🟥 3,530 ms 🟥 8,410 ms ↑ +138 %
JS Packages Outdated NPM prod dependencies. 🟨 9 outdated package versions (5 major, 2 minor, 2 patch) 🟨 10 outdated package versions (5 major, 4 minor, 1 patch) ↑ +11.1 %
Code coverage Function coverage 🟩 92.9 % 🟩 92.8 % ↓ −0.1 %
Code coverage Line coverage 🟩 90.6 % 🟩 90.6 % ↓ −0.1 %
Code coverage Branch coverage 🟨 85.2 % 🟨 85.2 % ↓ −0.1 %
Lighthouse Minimizes main-thread work 🟥 13.4 s 🟥 22.3 s ↑ +66 %
Lighthouse JavaScript execution time 🟥 6.3 s 🟥 12.5 s ↑ +97.4 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 1,820 KiB 🟩 Total size was 1,817 KiB ↓ −0.2 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +21.8 %
Lighthouse Max Potential First Input Delay 🟥 1,600 ms 🟥 2,860 ms ↑ +78.9 %
Lighthouse Uses efficient cache policy on static assets 🟨 28 resources found 🟨 28 resources found ↓ −0.1 %
Lighthouse Server Backend Latencies 🟩 330 ms 🟩 80 ms ↓ −76.5 %
Lighthouse Initial server response time was short 🟩 Root document took 520 ms 🟩 Root document took 430 ms ↓ −17.9 %
Lighthouse Eliminate render-blocking resources 🟥 Potential savings of 1,120 ms 🟥 Potential savings of 1,050 ms ↓ −6.8 %
Lighthouse Network Round Trip Times 🟩 80 ms 🟩 90 ms ↑ +7.9 %
Lighthouse Avoid large layout shifts 🟩 0 🟩 1 layout shift found ↑ +∞ %
Lighthouse Avoids an excessive DOM size 🟥 2,163 elements 🟥 2,162 elements ↓ −0.1 %
Lighthouse Cumulative Layout Shift 🟩 0 🟩 0.001 ↑ +∞ %

483 other audits are unchanged.

@hanna-skryl hanna-skryl marked this pull request as ready for review December 12, 2024 01:44
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.

I like how the error messages are formatted, good job 👍

packages/core/src/lib/implementation/read-rc-file.ts Outdated Show resolved Hide resolved
packages/models/src/lib/category-config.ts Outdated Show resolved Hide resolved
packages/models/src/lib/implementation/schemas.ts Outdated Show resolved Hide resolved
packages/utils/src/index.ts Outdated Show resolved Hide resolved
packages/utils/src/lib/zod-validation.unit.test.ts Outdated Show resolved Hide resolved
packages/models/src/lib/category-config.unit.test.ts Outdated Show resolved Hide resolved
@hanna-skryl hanna-skryl merged commit 836b242 into main Dec 13, 2024
16 checks passed
@hanna-skryl hanna-skryl deleted the fix/better-parsing-error-messages branch December 13, 2024 14:58
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.

Add better error messages
2 participants