diff --git a/.github/workflows/release-canary.yml b/.github/workflows/release-canary.yml index 119dbe054..df8fc6161 100644 --- a/.github/workflows/release-canary.yml +++ b/.github/workflows/release-canary.yml @@ -4,7 +4,7 @@ name: Release on npm (canary) on: push: branches: - - "master" + - "main" paths: - "src/**" - ".github/workflows/release-canary.yml" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0f1abcdf..1feaf38fe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ name: Release on npm on: push: branches: - - "master" + - "main" paths: - package.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea85975c1..e0b1c266b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,10 +3,10 @@ name: test on: push: branches: - - "master" + - "main" pull_request: branches: - - master + - main jobs: test-node: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 616f4fb43..23afcd926 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ Before you start working on a contribution, create an issue describing what you - Fork the repo - Clone your forked repository: `git clone git@github.com:{your_username}/zod.git` - Enter the zod directory: `cd zod` -- Create a new branch off the `master` branch: `git checkout -b your-feature-name` +- Create a new branch off the `main` branch: `git checkout -b your-feature-name` - Implement your contributions (see the Development section for more information) - Push your branch to the repo: `git push origin your-feature-name` - Go to https://github.com/colinhacks/zod/compare and select the branch you just pushed in the "compare:" dropdown diff --git a/ERROR_HANDLING.md b/ERROR_HANDLING.md index 21d05d2cc..72d95ec1b 100644 --- a/ERROR_HANDLING.md +++ b/ERROR_HANDLING.md @@ -26,7 +26,7 @@ Each ZodError has an `issues` property that is an array of `ZodIssues`. Each iss `ZodIssue` is _not_ a class. It is a [discriminated union](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions). -The link above is the best way to learn about the concept. Discriminated unions are an ideal way to represent a data structures that may be one of many possible variants. You can see all the possible variants defined [here](https://github.com/colinhacks/zod/blob/master/src/ZodError.ts). They are also described in the table below if you prefer. +The link above is the best way to learn about the concept. Discriminated unions are an ideal way to represent a data structures that may be one of many possible variants. You can see all the possible variants defined [here](https://github.com/colinhacks/zod/blob/main/src/ZodError.ts). They are also described in the table below if you prefer. _Every_ ZodIssue has these fields: @@ -192,7 +192,7 @@ But how is the value of `ctx.defaultError` determined? Error messages in Zod are generated by passing metadata about a validation issue through a chain of error maps. Error maps with higher priority override messages generated by maps with lower priority. -The lowest priority map is the `defaultErrorMap`, which defined in [`src/errors.ts`](https://github.com/colinhacks/zod/blob/master/src/errors.ts). This produces the default error message for all issues in Zod. +The lowest priority map is the `defaultErrorMap`, which defined in [`src/errors.ts`](https://github.com/colinhacks/zod/blob/main/src/errors.ts). This produces the default error message for all issues in Zod. ### Global error map diff --git a/README.md b/README.md index 3e22dc2ff..e2e9ca6d9 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@


-Zod CI status +Zod CI status Created by Colin McDonnell License npm @@ -403,7 +403,7 @@ There are a growing number of tools that are built atop or support Zod natively! - [`zod-to-json-schema`](https://github.com/StefanTerdell/zod-to-json-schema): Convert your Zod schemas into [JSON Schemas](https://json-schema.org/). - [`@anatine/zod-openapi`](https://github.com/anatine/zod-plugins/tree/main/packages/zod-openapi): Converts a Zod schema to an OpenAPI v3.x `SchemaObject`. - [`zod-fast-check`](https://github.com/DavidTimms/zod-fast-check): Generate `fast-check` arbitraries from Zod schemas. -- [`zod-dto`](https://github.com/kbkk/abitia/tree/master/packages/zod-dto): Generate Nest.js DTOs from a Zod schema. +- [`zod-dto`](https://github.com/kbkk/abitia/tree/main/packages/zod-dto): Generate Nest.js DTOs from a Zod schema. - [`fastify-type-provider-zod`](https://github.com/turkerdev/fastify-type-provider-zod): Create Fastify type providers from Zod schemas. - [`zod-to-openapi`](https://github.com/asteasolutions/zod-to-openapi): Generate full OpenAPI (Swagger) docs from Zod, including schemas, endpoints & parameters. - [`nestjs-graphql-zod`](https://github.com/incetarik/nestjs-graphql-zod): Generates NestJS GraphQL model classes from Zod schemas. Provides GraphQL method decorators working with Zod schemas. @@ -414,7 +414,7 @@ There are a growing number of tools that are built atop or support Zod natively! #### X to Zod - [`ts-to-zod`](https://github.com/fabien0102/ts-to-zod): Convert TypeScript definitions into Zod schemas. -- [`@runtyping/zod`](https://github.com/johngeorgewright/runtyping/tree/master/packages/zod): Generate Zod from static types & JSON schema. +- [`@runtyping/zod`](https://github.com/johngeorgewright/runtyping/tree/main/packages/zod): Generate Zod from static types & JSON schema. - [`json-schema-to-zod`](https://github.com/StefanTerdell/json-schema-to-zod): Convert your [JSON Schemas](https://json-schema.org/) into Zod schemas. [Live demo](https://StefanTerdell.github.io/json-schema-to-zod-react/). - [`json-to-zod`](https://github.com/rsinohara/json-to-zod): Convert JSON objects into Zod schemas. [Live demo](https://rsinohara.github.io/json-to-zod-react/). - [`graphql-codegen-typescript-validation-schema`](https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema): GraphQL Code Generator plugin to generate form validation schema from your GraphQL schema. diff --git a/README_ZH.md b/README_ZH.md index a6ad7c5c4..0c9ab46a0 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -7,7 +7,7 @@


-Zod CI status +Zod CI status Created by Colin McDonnell License npm diff --git a/deno/lib/README.md b/deno/lib/README.md index 070227fe2..e2e9ca6d9 100644 --- a/deno/lib/README.md +++ b/deno/lib/README.md @@ -9,7 +9,7 @@


-Zod CI status +Zod CI status Created by Colin McDonnell License npm @@ -403,7 +403,7 @@ There are a growing number of tools that are built atop or support Zod natively! - [`zod-to-json-schema`](https://github.com/StefanTerdell/zod-to-json-schema): Convert your Zod schemas into [JSON Schemas](https://json-schema.org/). - [`@anatine/zod-openapi`](https://github.com/anatine/zod-plugins/tree/main/packages/zod-openapi): Converts a Zod schema to an OpenAPI v3.x `SchemaObject`. - [`zod-fast-check`](https://github.com/DavidTimms/zod-fast-check): Generate `fast-check` arbitraries from Zod schemas. -- [`zod-dto`](https://github.com/kbkk/abitia/tree/master/packages/zod-dto): Generate Nest.js DTOs from a Zod schema. +- [`zod-dto`](https://github.com/kbkk/abitia/tree/main/packages/zod-dto): Generate Nest.js DTOs from a Zod schema. - [`fastify-type-provider-zod`](https://github.com/turkerdev/fastify-type-provider-zod): Create Fastify type providers from Zod schemas. - [`zod-to-openapi`](https://github.com/asteasolutions/zod-to-openapi): Generate full OpenAPI (Swagger) docs from Zod, including schemas, endpoints & parameters. - [`nestjs-graphql-zod`](https://github.com/incetarik/nestjs-graphql-zod): Generates NestJS GraphQL model classes from Zod schemas. Provides GraphQL method decorators working with Zod schemas. @@ -414,7 +414,7 @@ There are a growing number of tools that are built atop or support Zod natively! #### X to Zod - [`ts-to-zod`](https://github.com/fabien0102/ts-to-zod): Convert TypeScript definitions into Zod schemas. -- [`@runtyping/zod`](https://github.com/johngeorgewright/runtyping/tree/master/packages/zod): Generate Zod from static types & JSON schema. +- [`@runtyping/zod`](https://github.com/johngeorgewright/runtyping/tree/main/packages/zod): Generate Zod from static types & JSON schema. - [`json-schema-to-zod`](https://github.com/StefanTerdell/json-schema-to-zod): Convert your [JSON Schemas](https://json-schema.org/) into Zod schemas. [Live demo](https://StefanTerdell.github.io/json-schema-to-zod-react/). - [`json-to-zod`](https://github.com/rsinohara/json-to-zod): Convert JSON objects into Zod schemas. [Live demo](https://rsinohara.github.io/json-to-zod-react/). - [`graphql-codegen-typescript-validation-schema`](https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema): GraphQL Code Generator plugin to generate form validation schema from your GraphQL schema. @@ -427,6 +427,7 @@ There are a growing number of tools that are built atop or support Zod natively! - [`@sanity-typed/zod`](https://github.com/saiichihashimoto/sanity-typed/tree/main/packages/zod): Generate Zod Schemas from [Sanity Schemas](https://www.sanity.io/docs/schema-types). - [`java-to-zod`](https://github.com/ivangreene/java-to-zod): Convert POJOs to Zod schemas - [`Orval`](https://github.com/anymaniax/orval): Generate Zod schemas from OpenAPI schemas +- [`Kubb`](https://github.com/kubb-labs/kubb): Generate SDKs and Zod schemas from your OpenAPI schemas #### Mocking diff --git a/index.html b/index.html index 0a755e4d6..787b72f69 100644 --- a/index.html +++ b/index.html @@ -92,24 +92,24 @@ onload="this.onload=null;this.rel='stylesheet';" /> - + .markdown-section { + padding: 10px; /* Adjust padding for smaller screens */ + } + } + - - - @@ -255,7 +252,7 @@ repo: "colinhacks/zod", routerMode: "history", crossOriginLinks: [ - "https://github.com/colinhacks/zod/actions?query=branch%3Amaster", + "https://github.com/colinhacks/zod/actions?query=branch%3Amain", "https://opensource.org/licenses/MIT", "https://www.npmjs.com/package/zod", "https://discord.gg/KaSRdyX2vc",