Skip to content

Commit f56ac51

Browse files
committed
Merge commit 'refs/pull/522/merge' of github.com:ciscoheat/sveltekit-superforms
2 parents 6529549 + fb0b7ad commit f56ac51

File tree

6 files changed

+15
-16
lines changed

6 files changed

+15
-16
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,14 @@
102102
"!dist/**/*.spec.*"
103103
],
104104
"peerDependencies": {
105-
"@effect/schema": "^0.75.3",
106105
"@exodus/schemasafe": "^1.3.0",
107106
"@sinclair/typebox": "^0.34.9",
108107
"@sveltejs/kit": "1.x || 2.x",
109108
"@typeschema/class-validator": "^0.3.0",
110109
"@vinejs/vine": "^1.8.0 || ^2.0.0",
111110
"arktype": ">=2.0.0-rc.23",
112111
"class-validator": "^0.14.1",
113-
"effect": "^3.8.2",
112+
"effect": "^3.10.0",
114113
"joi": "^17.13.1",
115114
"superstruct": "^2.0.2",
116115
"svelte": "3.x || 4.x || >=5.0.0-next.51",

src/lib/adapters/effect.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { Schema, JSONSchema, ArrayFormatter } from '@effect/schema';
2-
import { Either } from 'effect';
1+
import { Schema, JSONSchema, Either } from 'effect';
2+
import type { ParseOptions } from 'effect/SchemaAST';
3+
import { ArrayFormatter } from 'effect/ParseResult';
34
import type { JSONSchema as TJSONSchema } from '../jsonSchema/index.js';
45
import {
56
createAdapter,
@@ -10,7 +11,6 @@ import {
1011
type ValidationAdapter,
1112
type ValidationResult
1213
} from './adapters.js';
13-
import type { ParseOptions } from '@effect/schema/AST';
1414
import { memoize } from '$lib/memoize.js';
1515

1616
export const effectToJSONSchema = <A, I>(schema: Schema.Schema<A, I>) => {

src/lib/adapters/typeSchema.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ import type { ZodSchema, input, output } from 'zod';
1818
import type { SchemaTypes, Infer as VineInfer } from '@vinejs/vine/types';
1919
import type { FromSchema, JSONSchema } from 'json-schema-to-ts';
2020
import type { Struct, Infer as Infer$2 } from 'superstruct';
21-
import type { Schema as Schema$1 } from '@effect/schema/Schema';
21+
import type { Schema as Schema$1 } from 'effect';
2222

2323
/*
2424
import type { SchemaObject } from 'ajv';
2525
import type { Type as Type$1 } from '@deepkit/type';
26-
import type { Schema as Schema$1 } from '@effect/schema/Schema';
26+
import type { Schema as Schema$1 } from 'effect';
2727
import type { Any, OutputOf, TypeOf } from 'io-ts';
2828
import type { Predicate, Infer as Infer$1 } from 'ow';
2929
import type { Runtype, Static } from 'runtypes';
@@ -159,11 +159,15 @@ interface SuperstructResolver extends Resolver {
159159

160160
interface EffectResolver extends Resolver {
161161
// eslint-disable-next-line @typescript-eslint/no-explicit-any
162-
base: Schema$1<any>;
162+
base: Schema$1.Schema<any>;
163163
// eslint-disable-next-line @typescript-eslint/no-explicit-any
164-
input: this['schema'] extends Schema$1<any> ? Schema$1.Encoded<this['schema']> : never;
164+
input: this['schema'] extends Schema$1.Schema<any>
165+
? Schema$1.Schema.Encoded<this['schema']>
166+
: never;
165167
// eslint-disable-next-line @typescript-eslint/no-explicit-any
166-
output: this['schema'] extends Schema$1<any> ? Schema$1.Type<this['schema']> : never;
168+
output: this['schema'] extends Schema$1.Schema<any>
169+
? Schema$1.Schema.Type<this['schema']>
170+
: never;
167171
}
168172

169173
/*

src/routes/(v2)/v2/effect/+page.svelte

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
<script lang="ts">
22
import { superForm } from '$lib/client/index.js';
33
import SuperDebug from '$lib/client/SuperDebug.svelte';
4-
//import { zod } from '$lib/adapters/zod.js'
5-
//import { schema } from './schema.js';
64
75
export let data;
86
97
const { form, errors, tainted, message, enhance } = superForm(data.form, {
108
taintedMessage: false
11-
//dataType: 'json',
12-
//validators: zod(schema)
139
});
1410
</script>
1511

src/routes/(v2)/v2/effect/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Schema } from '@effect/schema';
1+
import { Schema } from 'effect';
22

33
const emailRegex = /^[^@]+@[^@]+\.[^@]+$/;
44

src/tests/superValidate.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ import {
7979
import { schemasafe } from '$lib/adapters/schemasafe.js';
8080

8181
import { effect } from '$lib/adapters/effect.js';
82-
import { Schema } from '@effect/schema';
82+
import { Schema } from 'effect';
8383

8484
import { traversePath } from '$lib/traversal.js';
8585
import { splitPath } from '$lib/stringPath.js';

0 commit comments

Comments
 (0)