Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Create vine adapter #50

Merged
merged 2 commits into from
Apr 12, 2024
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
7 changes: 7 additions & 0 deletions .changeset/eleven-pears-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@typeschema/all": patch
"@typeschema/main": patch
"@typeschema/vine": minor
---

feat: add support to vine
6 changes: 6 additions & 0 deletions .gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/all/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"typebox",
"valibot",
"valita",
"vine",
"yup",
"zod"
],
Expand Down Expand Up @@ -91,6 +92,7 @@
"@typeschema/typebox": "workspace:*",
"@typeschema/valibot": "workspace:*",
"@typeschema/valita": "workspace:*",
"@typeschema/vine": "workspace:*",
"@typeschema/yup": "workspace:*",
"@typeschema/zod": "workspace:*"
},
Expand Down Expand Up @@ -118,6 +120,7 @@
"@gcornut/valibot-json-schema": "^0.0.25",
"valibot": "^0.30.0",
"@badrap/valita": "^0.3.6",
"@vinejs/vine": "^2.0.0",
"@sodaru/yup-to-json-schema": "^2.0.1",
"yup": "^1.4.0",
"zod": "^3.22.4",
Expand Down
82 changes: 82 additions & 0 deletions packages/all/src/__tests__/vine.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"typebox",
"valibot",
"valita",
"vine",
"yup",
"zod"
],
Expand Down Expand Up @@ -115,6 +116,8 @@
"valibot": "^0.30.0",
"@typeschema/valita": "workspace:*",
"@badrap/valita": "^0.3.6",
"@typeschema/vine": "workspace:*",
"@vinejs/vine": "^2.0.0",
"@typeschema/yup": "workspace:*",
"@sodaru/yup-to-json-schema": "^2.0.1",
"yup": "^1.4.0",
Expand All @@ -139,6 +142,7 @@
"@typeschema/typebox": "workspace:*",
"@typeschema/valibot": "workspace:*",
"@typeschema/valita": "workspace:*",
"@typeschema/vine": "workspace:*",
"@typeschema/yup": "workspace:*",
"@typeschema/zod": "workspace:*"
},
Expand Down Expand Up @@ -191,6 +195,9 @@
"@typeschema/valita": {
"optional": true
},
"@typeschema/vine": {
"optional": true
},
"@typeschema/yup": {
"optional": true
},
Expand Down
82 changes: 82 additions & 0 deletions packages/main/src/__tests__/vine.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/main/src/adapters.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/main/src/selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export type Select<TSchema> =
: TSchema extends {kind: unknown} ? 'deepkit'
: TSchema extends {addValidator: unknown} ? 'ow'
: TSchema extends {toTerminals: unknown} ? 'valita'
: TSchema extends {bail: unknown} ? 'vine'
: IsJSONSchema<TSchema> extends true ? 'json'
: 'fastestValidator'
: never;
Expand Down Expand Up @@ -129,6 +130,7 @@ export const select: <
if ('kind' in schema) return is.deepkit(notJSON(schema));
if ('addValidator' in schema) return is.ow(notJSON(schema));
if ('toTerminals' in schema) return is.valita(notJSON(schema));
if ('bail' in schema) return is.vine(notJSON(schema));
if (isJSONSchema(schema)) return is.json(schema);
return is.fastestValidator(schema);
}
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/serialization.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/main/src/validation.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions packages/vine/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading