Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/polite-parents-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"valimock": minor
---

Support Valibot v1.1.0
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [18, 20]
node-version: [20, 22, 24]

steps:
- name: Check out code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
node-version: 22
cache: "yarn"

- name: Install Dependencies
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public-hoist-pattern[]=*vitest*
public-hoist-pattern[]=vite-node
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.1.1.cjs

This file was deleted.

948 changes: 948 additions & 0 deletions .yarn/releases/yarn-4.9.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.1.1.cjs
yarnPath: .yarn/releases/yarn-4.9.1.cjs
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,23 @@ yarn add -D valimock @faker-js/faker
Import and optionally configure a new instance of the `Valimock` class, then pass along your `valibot` schema to `mock()`, that's it!

```ts
import { parse, array, union, string, url, number, maxValue } from "valibot";
import {
parse,
array,
union,
string,
pipe,
url,
number,
maxValue
} from "valibot";
import { Valimock } from "valimock";

describe(`example test`, () => {
it(`should generate valid mock data`, () => {
const schema = array(union([string([url()]), number([maxValue(20)])]));
const schema = array(
union([pipe(string(), url()), pipe(number(), maxValue(20))])
);
const result = new Valimock().mock(schema);
expect(parse(schema, result)).toStrictEqual(result);
});
Expand Down
45 changes: 21 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "valimock",
"description": "Generate mock data for Valibot schemas using Faker",
"version": "0.1.3",
"version": "1.0.0",
"license": "MIT",
"author": "Drake Costa <[email protected]> (https://saeris.gg)",
"keywords": [
Expand All @@ -21,7 +21,7 @@
"engines": {
"node": ">=18.x"
},
"packageManager": "yarn@4.1.1",
"packageManager": "yarn@4.9.1",
"type": "module",
"main": "./dist/Valimock.js",
"module": "./dist/Valimock.js",
Expand All @@ -33,10 +33,6 @@
"types": "./dist/Valimock.d.ts",
"default": "./dist/Valimock.js"
},
"require": {
"types": "./dist/Valimock.d.cts",
"default": "./dist/Valimock.cjs"
},
"default": "./dist/Valimock.js"
},
"./package.json": "./package.json"
Expand All @@ -55,32 +51,33 @@
"typecheck": "tsc --noemit"
},
"dependencies": {
"colorjs.io": "^0.5.2",
"randexp": "^0.5.3"
},
"peerDependencies": {
"@faker-js/faker": ">= 8.0.0",
"valibot": ">= 0.30.0"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@faker-js/faker": "^8.4.1",
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.3",
"@faker-js/faker": "^9.7.0",
"@saeris/eslint-config": "^2.6.0",
"@types/eslint": "^8.56.6",
"@types/node": "20.11.30",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"@vitest/coverage-v8": "^1.4.0",
"eslint": "^8.57.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-vitest": "^0.4.0",
"prettier": "^3.2.5",
"tsup": "^8.0.2",
"tsx": "^4.7.1",
"typescript": "5.4.3",
"valibot": "^0.30.0",
"vitest": "^1.4.0"
"@types/eslint": "^8.56.12",
"@types/node": "22.15.14",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vitest/coverage-v8": "^3.1.3",
"eslint": "^8.57.1",
"eslint-import-resolver-typescript": "^3.10.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-vitest": "^0.4.1",
"prettier": "^3.5.3",
"tsup": "^8.4.0",
"tsx": "^4.19.4",
"typescript": "5.8.3",
"valibot": "^1.1.0",
"vitest": "^3.1.3"
},
"eslintConfig": {
"root": true,
Expand Down
Loading