shadcn-ui-cli-package
zod
shadcn-ui-cli-package | zod | |
---|---|---|
2 | 323 | |
1 | 33,303 | |
- | - | |
4.5 | 9.2 | |
3 months ago | 20 days ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
shadcn-ui-cli-package
-
shadcn-ui/ui codebase analysis: How does shadcn-ui CLI work? — Part 2.3
I updated the commanderjs-usage-in-shadcnui with shadcn-ui CLI package code to understand the getConfig call in getProjectConfig. Turns out, this little detour to understand the series of function calls following getConfig are to check if there is existing component config.
-
shadcn-ui/ui codebase analysis: How does shadcn-ui CLI work? — Part 2.0
I created an example project on Github that demonstrates the usage of Commander.js, tsup and init command configuration in shadcn-ui/ui CLI package. These CLI options are parsed with zod before performing any further operations.
zod
- Zod: TypeScript-first schema validation with static type inference
- Fundamentals of React Native App Development: Dependencies, Performance, Native Modules, and Publishing Guide
-
NestJS vs. Ditsmod: Pipe Features
In this example, a controller method sets up a route that accepts a request body. Here, the pipe instance is passed directly in the @UsePipes() decorator. This way, the pipe's transform method receives the request body and validates it based on a prepared Zod schema.
-
Show HN: A tool to visualise Zod validation errors
I work on code generator that creates TypeScript SDKs from OpenAPI specs and Zod (https://zod.dev/) is a critical building block that I chose to power runtime validation in those SDKs. Depending on the complexity of a Zod schema, the resulting validation error message can contain a wall of JSON text - the serialised issues that were recorded during validation.
I wanted to try and create a small tool to help me better visualise and parse these errors. In code and the command line, we do also have the ability to pretty-print the errors but I still wanted a web UI which can let me share URLs for visualised errors.
I'm still iterating on it but would love any feedback if you do get to try it out.
-
Encore.ts — 3x faster than ElysiaJS & Hono
Encore.ts, as the name suggests, is designed from the ground up for TypeScript. But you can't actually run TypeScript: it first has to be compiled to JavaScript, by stripping all the type information. This means run-time type safety is much harder to achieve, which makes it difficult to do things like validating incoming requests, leading to solutions like Zod becoming popular for defining API schemas at runtime instead.
-
Understanding Genkit flows with Czech language tricks
Let's modify the pregenerated example flow, changing the name and input/output schemas. Genkit uses zod to define strongly typed schemas enforced even at runtime.
-
How to make your Express.js APIs 9x faster with Encore.ts
Express.js does not have built-in request validation. You have to use a library like Zod.
-
Handling custom error responses from ExpressoTS with TanStack Query, and NextJS
Here is the code for the request and response schemas. I'm using zod to do this on the front end:
-
Fullstack Serverless Starter with Hono.js, Cloudflare Workers, and Neon Postgres
Validation using Zod.
-
Validate your environment variables with Zod
Zod is the most famous validation library in the TypeScript ecosystem. With Zod, you create a schema and validate your data according to the schema. Observe the schema below:
What are some alternatives?
class-validator - Decorator-based property validation for classes.
joi - The most powerful data validation library for JS [Moved to: https://github.com/sideway/joi]
typebox - Json Schema Type Builder with Static Type Resolution for TypeScript
Yup - Dead simple Object schema validation
ajv - The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)
io-ts - Runtime type system for IO decoding/encoding
Superstruct - A simple and composable way to validate data in JavaScript (and TypeScript).
class-transformer - Decorator-based transformation, serialization, and deserialization between objects and classes.
runtypes - Runtime validation for static types
react-hook-form - 📋 React Hooks for form state management and validation (Web + React Native)
TypeScript - TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
zod-to-json-schema - Converts Zod schemas to Json schemas