Skip to content

Conversation

@matejchalk
Copy link
Collaborator

@matejchalk matejchalk commented Oct 24, 2025

Part of #888

This PR focuses on how Zod errors are displayed to the user.

  • Uses a new validate function everywhere instead of .parse, as it throws a more readable error.
    • To give more context, prints a schema title, which is provided by adding .meta({ title: '...' }) for all our named schemas (also moved descriptions there).
  • Uses stringifyError everywhere to convert unknown errors to a string.
    • Implemented one-liner formatting option, which the new Logger uses for its inline spinner and group errors.
      image

@nx-cloud
Copy link

nx-cloud bot commented Oct 24, 2025

View your CI Pipeline Execution ↗ for commit ff2d4be

Command Status Duration Result
nx code-pushup --nx-bail -- compare ✅ Succeeded 52s View ↗
nx code-pushup --nx-bail -- ✅ Succeeded 1m 3s View ↗
nx code-pushup --nx-bail -- print-config --outp... ✅ Succeeded 3m 42s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-29 12:12:16 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 24, 2025

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1130

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1130

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1130

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1130

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1130

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1130

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1130

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1130

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1130

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1130

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1130

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1130

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1130

@code-pushup/models-transformers

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models-transformers@1130

commit: ff2d4be

@matejchalk matejchalk force-pushed the unify-zod-error-handling branch from 4cba07e to d41393f Compare October 24, 2025 08:57
@matejchalk matejchalk force-pushed the unify-zod-error-handling branch from d41393f to f5a8b2f Compare October 24, 2025 09:04
@matejchalk matejchalk added ➕ enhancement new feature or request 🤓 UX UX improvement for CLI users labels Oct 24, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2025

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit d051f10 with previous commit 169b915.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Best Practices 🟢 100 🟢 97 ↓ −3.4
Performance 🔴 36 🔴 40 ↑ +3.2
Documentation 🔴 36 🔴 36 ↑ +0.4
Code coverage 🟢 90 🟢 90 ↑ +0.2
Security 🟡 56 🟡 56
Updates 🟡 73 🟡 73
Accessibility 🟢 92 🟢 92
SEO 🟡 61 🟡 61
Type Safety 🟢 100 🟢 100
Bug prevention 🟢 100 🟢 100
Miscellaneous 🟢 100 🟢 100
Code style 🟢 100 🟢 100
👍 3 groups improved, 👎 1 group regressed, 👍 9 audits improved, 👎 3 audits regressed, 15 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Best Practices 🟢 100 🟢 97 ↓ −3.4
Lighthouse Performance 🔴 36 🔴 40 ↑ +3.2
JSDoc coverage Documentation coverage 🔴 36 🔴 36 ↑ +0.4
Code coverage Code coverage metrics 🟢 90 🟢 90 ↑ +0.2

17 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse No browser errors logged to the console 🟩 passed 🟥 failed ↓ −100 %
Lighthouse Elements with visible text labels have matching accessible names. 🟥 failed 🟩 passed ↑ +∞ %
Lighthouse First Contentful Paint 🟥 3.3 s 🟥 3.1 s ↓ −8.3 %
Lighthouse Total Blocking Time 🟥 1,530 ms 🟥 1,190 ms ↓ −21.7 %
JSDoc coverage Classes coverage 🟥 8 undocumented classes 🟥 7 undocumented classes ↓ −12.5 %
Lighthouse Time to Interactive 🟥 13.2 s 🟥 12.6 s ↓ −4.8 %
Lighthouse Speed Index 🟥 6.7 s 🟥 6.8 s ↑ +1.5 %
Lighthouse Max Potential First Input Delay 🟥 1,410 ms 🟥 800 ms ↓ −43.2 %
Code coverage Line coverage 🟨 86.6 % 🟨 86.8 % ↑ +0.3 %
Code coverage Function coverage 🟩 92.8 % 🟩 93.1 % ↑ +0.3 %
JSDoc coverage Types coverage 🟥 243 undocumented types 🟥 242 undocumented types ↓ −0.4 %
JSDoc coverage Variables coverage 🟥 293 undocumented variables 🟥 294 undocumented variables ↑ +0.3 %
Lighthouse JavaScript execution time 🟥 5.0 s 🟥 3.7 s ↓ −24.7 %
Lighthouse Minimizes main-thread work 🟥 12.0 s 🟥 10.9 s ↓ −9.4 %
Lighthouse Server Backend Latencies 🟩 1,200 ms 🟩 260 ms ↓ −77.9 %
Lighthouse Metrics 🟩 100% 🟩 100% ↓ −4.7 %
Lighthouse Largest Contentful Paint 🟥 11.3 s 🟥 10.7 s ↓ −4.5 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,029 KiB 🟩 Total size was 2,029 KiB ↑ +0.1 %
Lighthouse Initial server response time was short 🟩 Root document took 320 ms 🟩 Root document took 560 ms ↑ +76 %
Lighthouse Reduce unused JavaScript 🟥 Potential savings of 180 KiB 🟥 Potential savings of 180 KiB ↓ −15.9 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 103 KiB 🟥 Potential savings of 103 KiB ↑ +23 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 85 KiB 🟥 Potential savings of 102 KiB ↑ +30.4 %
Lighthouse Uses efficient cache policy on static assets 🟨 30 resources found 🟨 30 resources found ↓ −0.1 %
Lighthouse Avoids an excessive DOM size 🟥 2,261 elements 🟥 2,301 elements ↑ +1.8 %
Lighthouse Network Round Trip Times 🟩 40 ms 🟩 20 ms ↓ −55.2 %
Lighthouse Cumulative Layout Shift 🟩 0 🟩 0.009 ↑ +∞ %
Code coverage Branch coverage 🟨 85.9 % 🟨 85.9 % ↓ −0.1 %

583 other audits are unchanged.

@matejchalk matejchalk marked this pull request as ready for review October 24, 2025 09:15
@matejchalk matejchalk requested a review from BioPhoton as a code owner October 24, 2025 09:15
Copy link
Collaborator

@vmasek vmasek left a comment

Choose a reason for hiding this comment

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

I've been looking forward to this one since zod4 release 🚀

@matejchalk matejchalk force-pushed the unify-zod-error-handling branch from a76d65a to ff2d4be Compare October 29, 2025 11:56
@matejchalk matejchalk merged commit fb236e1 into main Oct 29, 2025
21 checks passed
@matejchalk matejchalk deleted the unify-zod-error-handling branch October 29, 2025 12:43
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.

4 participants