Skip to content

Commit

Permalink
feat!: migration from @effect/schema to effect package
Browse files Browse the repository at this point in the history
  • Loading branch information
totto2727 committed Dec 8, 2024
1 parent c614205 commit b59befe
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
"!dist/**/*.spec.*"
],
"peerDependencies": {
"@effect/schema": "^0.75.3",
"@exodus/schemasafe": "^1.3.0",
"@sinclair/typebox": "^0.34.9",
"@sveltejs/kit": "1.x || 2.x",
Expand Down Expand Up @@ -168,7 +167,7 @@
"@vinejs/vine": "^2.0.0",
"arktype": "^2.0.0-rc.23",
"class-validator": "^0.14.1",
"effect": "^3.9.1",
"effect": "^3.11.3",
"joi": "^17.13.3",
"json-schema-to-ts": "^3.1.1",
"superstruct": "^2.0.2",
Expand Down
18 changes: 10 additions & 8 deletions pnpm-lock.yaml

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

6 changes: 3 additions & 3 deletions src/lib/adapters/effect.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Schema, JSONSchema, ArrayFormatter } from '@effect/schema';
import { Either } from 'effect';
import { Effect, Schema, JSONSchema } from 'effect';
import type { ParseOptions } from 'effect/SchemaAST';
import { ArrayFormatter } from 'effect/ParseResult';
import type { JSONSchema as TJSONSchema } from '../jsonSchema/index.js';
import {
createAdapter,
Expand All @@ -10,7 +11,6 @@ import {
type ValidationAdapter,
type ValidationResult
} from './adapters.js';
import type { ParseOptions } from '@effect/schema/AST';
import { memoize } from '$lib/memoize.js';

export const effectToJSONSchema = <A, I>(schema: Schema.Schema<A, I>) => {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/adapters/typeSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import type { ZodSchema, input, output } from 'zod';
import type { SchemaTypes, Infer as VineInfer } from '@vinejs/vine/types';
import type { FromSchema, JSONSchema } from 'json-schema-to-ts';
import type { Struct, Infer as Infer$2 } from 'superstruct';
import type { Schema as Schema$1 } from '@effect/schema/Schema';
import type { Schema as Schema$1 } from 'effect';

/*
import type { SchemaObject } from 'ajv';
import type { Type as Type$1 } from '@deepkit/type';
import type { Schema as Schema$1 } from '@effect/schema/Schema';
import type { Schema as Schema$1 } from 'effect';
import type { Any, OutputOf, TypeOf } from 'io-ts';
import type { Predicate, Infer as Infer$1 } from 'ow';
import type { Runtype, Static } from 'runtypes';
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(v2)/v2/effect/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Schema } from '@effect/schema';
import { Schema } from 'effect';

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

Expand Down
2 changes: 1 addition & 1 deletion src/tests/superValidate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ import {
import { schemasafe } from '$lib/adapters/schemasafe.js';

import { effect } from '$lib/adapters/effect.js';
import { Schema } from '@effect/schema';
import { Schema } from 'effect';

import { traversePath } from '$lib/traversal.js';
import { splitPath } from '$lib/stringPath.js';
Expand Down

0 comments on commit b59befe

Please sign in to comment.