Skip to content

Commit b47379e

Browse files
committed
Improve README
1 parent cf3339d commit b47379e

File tree

5 files changed

+65
-16
lines changed

5 files changed

+65
-16
lines changed

README.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1-
# zod-error-viewer
1+
<p align="center">
2+
<img src="img/zod-error-viewer.png" width="200px" align="center" alt="" />
3+
<h1 align="center">zod-error-viewer</h1>
4+
<p align="center">
5+
<a href="https://github.com/benlorantfy/zod-error-viewer/actions?query=branch%3Amain"><img src="https://github.com/BenLorantfy/zod-error-viewer/actions/workflows/ci.yaml/badge.svg?event=push&branch=main" alt="zod-error-viewer CI status" /></a>
6+
<a href="https://twitter.com/benlorantfy" rel="nofollow"><img src="https://img.shields.io/badge/created%20by-@benlorantfy-4BBAAB.svg" alt="Created by Ben Lorantfy"></a>
7+
<a href="https://opensource.org/licenses/MIT" rel="nofollow"><img src="https://img.shields.io/github/license/benlorantfy/zod-error-viewer" alt="License"></a>
8+
</p>
9+
<p align="center">
10+
Quickly visualize and understand even the meanest zod errors ✔️
11+
</p>
12+
</p>
13+
<br/>
214

3-
Quickly understand zod errors visually
15+
<img src="./img/example.png" >
16+
17+
## Motivation
18+
19+
Zod is an amazing library. However, hairy zod errors can take a while to understand. The goal of `zod-error-viewer` is to drastically cut down on the time it takes to read and understand even the most complex zod errors.
20+
21+
## Getting Started
22+
23+
## Installing
24+
25+
```
26+
npm install zod-error-viewer
27+
```
28+
29+
## Basic Example
30+
31+
```tsx
32+
import { ZodErrorViewer } from "zod-error-viewer";
33+
34+
<ZodErrorViewer
35+
data={/* data that was validated */}
36+
error={/* ZodError that occurred */}
37+
/>;
38+
```
39+
40+
## Documentation
41+
42+
For more examples and documentation, see:

img/example.png

267 KB
Loading

img/zod-error-viewer.png

34 KB
Loading

package.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@
4141
"test": "vitest"
4242
},
4343
"dependencies": {
44-
"react": "^18.2.0",
45-
"react-dom": "^18.2.0",
46-
"zod": "^3.23.8"
44+
"zod": ">=3"
45+
},
46+
"peerDependencies": {
47+
"react": ">=16",
48+
"react-dom": ">=16"
4749
},
4850
"lint-staged": {
4951
"**/*.{js,ts,tsx,jsx}": [
@@ -59,28 +61,31 @@
5961
"@storybook/addon-links": "^8.1.5",
6062
"@storybook/addon-onboarding": "^8.1.5",
6163
"@storybook/blocks": "^8.1.5",
62-
"@storybook/react": "^8.1.5",
6364
"@storybook/react-vite": "^8.1.5",
65+
"@storybook/react": "^8.1.5",
6466
"@storybook/test": "^8.1.5",
6567
"@testing-library/react": "^15.0.7",
6668
"@testing-library/user-event": "^14.5.2",
67-
"@types/react": "^18.2.66",
6869
"@types/react-dom": "^18.2.22",
70+
"@types/react": "^18.2.66",
6971
"@typescript-eslint/eslint-plugin": "^7.2.0",
7072
"@typescript-eslint/parser": "^7.2.0",
7173
"@vitejs/plugin-react": "^4.2.1",
72-
"eslint": "^8.57.0",
7374
"eslint-config-prettier": "^9.1.0",
7475
"eslint-plugin-react-hooks": "^4.6.0",
7576
"eslint-plugin-react-refresh": "^0.4.6",
7677
"eslint-plugin-storybook": "^0.8.0",
78+
"eslint": "^8.57.0",
7779
"happy-dom": "^14.12.0",
7880
"husky": "^9.0.11",
7981
"lint-staged": "^15.2.5",
8082
"prettier": "3.3.0",
83+
"react-dom": "^18.2.0",
84+
"react": "^18.2.0",
8185
"storybook": "^8.1.5",
8286
"typescript": "^5.2.2",
8387
"vite": "^5.2.0",
84-
"vitest": "^1.6.0"
88+
"vitest": "^1.6.0",
89+
"zod": "^3.23.8"
8590
}
8691
}

pnpm-lock.yaml

Lines changed: 12 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)