From 95c0246194cd5fa24e6144739faa945bf82dfc3b Mon Sep 17 00:00:00 2001 From: Fabian Hiller Date: Mon, 20 May 2024 18:23:45 -0400 Subject: [PATCH] Bump version to v0.31.0-rc.0 and update readme and changelog --- README.md | 14 +++++++------- library/.eslintrc.cjs | 3 +-- library/CHANGELOG.md | 4 ++++ library/README.md | 14 +++++++------- library/jsr.json | 2 +- library/package.json | 4 ++-- package.json | 2 +- 7 files changed, 23 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index ba3c1c284..43e9737ff 100644 --- a/README.md +++ b/README.md @@ -27,22 +27,22 @@ First you create a schema that describes a structured data set. A schema can be ```ts -import { email, minLength, object, type Output, parse, string } from 'valibot'; // 1.54 kB +import * as v from 'valibot'; // 1.12 kB // Create login schema with email and password -const LoginSchema = object({ - email: string([email()]), - password: string([minLength(8)]), +const LoginSchema = v.object({ + email: v.pipe(v.string(), v.email()), + password: v.pipe(v.string(), v.minLength(8)), }); // Infer output TypeScript type of login schema -type LoginData = Output; // { email: string; password: string } +type LoginData = v.InferOutput; // { email: string; password: string } // Throws error for `email` and `password` -parse(LoginSchema, { email: '', password: '' }); +v.parse(LoginSchema, { email: '', password: '' }); // Returns data as { email: string; password: string } -parse(LoginSchema, { email: 'jane@example.com', password: '12345678' }); +v.parse(LoginSchema, { email: 'jane@example.com', password: '12345678' }); ``` Apart from `parse` I also offer a non-exception-based API with `safeParse` and a type guard function with `is`. You can read more about it [here](https://valibot.dev/guides/parse-data/). diff --git a/library/.eslintrc.cjs b/library/.eslintrc.cjs index d31cea36e..c0fd8aca0 100644 --- a/library/.eslintrc.cjs +++ b/library/.eslintrc.cjs @@ -66,12 +66,11 @@ module.exports = { // Disable rules ---------------------------------------------------------- // TypeScript - // '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/no-non-null-assertion': 'off', // Imports - // 'no-duplicate-imports': 'off', + 'no-duplicate-imports': 'off', // Security 'security/detect-object-injection': 'off', // Too many false positives diff --git a/library/CHANGELOG.md b/library/CHANGELOG.md index f8ce527b4..8a3388fb2 100644 --- a/library/CHANGELOG.md +++ b/library/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the library will be documented in this file. +## v0.31.0 (Month DD, YYYY) + +- More details will follow soon + ## v0.30.0 (March 06, 2024) - Add `Default` and `DefaultAsync` type and refactor codebase diff --git a/library/README.md b/library/README.md index ba3c1c284..43e9737ff 100644 --- a/library/README.md +++ b/library/README.md @@ -27,22 +27,22 @@ First you create a schema that describes a structured data set. A schema can be ```ts -import { email, minLength, object, type Output, parse, string } from 'valibot'; // 1.54 kB +import * as v from 'valibot'; // 1.12 kB // Create login schema with email and password -const LoginSchema = object({ - email: string([email()]), - password: string([minLength(8)]), +const LoginSchema = v.object({ + email: v.pipe(v.string(), v.email()), + password: v.pipe(v.string(), v.minLength(8)), }); // Infer output TypeScript type of login schema -type LoginData = Output; // { email: string; password: string } +type LoginData = v.InferOutput; // { email: string; password: string } // Throws error for `email` and `password` -parse(LoginSchema, { email: '', password: '' }); +v.parse(LoginSchema, { email: '', password: '' }); // Returns data as { email: string; password: string } -parse(LoginSchema, { email: 'jane@example.com', password: '12345678' }); +v.parse(LoginSchema, { email: 'jane@example.com', password: '12345678' }); ``` Apart from `parse` I also offer a non-exception-based API with `safeParse` and a type guard function with `is`. You can read more about it [here](https://valibot.dev/guides/parse-data/). diff --git a/library/jsr.json b/library/jsr.json index 6b5b4a067..792656d2f 100644 --- a/library/jsr.json +++ b/library/jsr.json @@ -1,5 +1,5 @@ { "name": "@valibot/valibot", - "version": "0.30.0", + "version": "0.31.0-rc.0", "exports": "./src/index.ts" } diff --git a/library/package.json b/library/package.json index a0f58cdce..2652a0088 100644 --- a/library/package.json +++ b/library/package.json @@ -1,7 +1,7 @@ { "name": "valibot", - "description": "The modular and TypeScript-first schema library", - "version": "0.30.0", + "description": "The modular and type safe schema library for validating structural data", + "version": "0.31.0-rc.0", "license": "MIT", "author": "Fabian Hiller", "homepage": "https://valibot.dev", diff --git a/package.json b/package.json index 5daa31304..fa3c9b89a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "valibot", - "description": "The modular and TypeScript-first schema library", + "description": "The modular and type safe schema library for validating structural data ", "version": "0.0.0", "license": "MIT", "author": "Fabian Hiller",