Skip to content

Commit 6e04a2c

Browse files
committed
refactor(types): move adapters types back to adapters/ directory
1 parent 3c18fd3 commit 6e04a2c

File tree

14 files changed

+13
-13
lines changed

14 files changed

+13
-13
lines changed

packages/next-safe-action/src/action-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { isNotFoundError } from "next/dist/client/components/not-found.js";
22
import { isRedirectError } from "next/dist/client/components/redirect.js";
33
import type {} from "zod";
4-
import type { Infer, InferArray, InferIn, InferInArray, Schema, ValidationAdapter } from "./adapters.types";
4+
import type { Infer, InferArray, InferIn, InferInArray, Schema, ValidationAdapter } from "./adapters/types";
55
import type {
66
MiddlewareFn,
77
MiddlewareResult,

packages/next-safe-action/src/adapters/valibot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Code courtesy of https://github.com/decs/typeschema/blob/main/packages/valibot/src/validation.ts
22

33
import { getDotPath, safeParseAsync, type GenericSchema, type GenericSchemaAsync } from "valibot";
4-
import type { IfInstalled, Infer, ValidationAdapter } from "../adapters.types";
4+
import type { IfInstalled, Infer, ValidationAdapter } from "./types";
55

66
class ValibotAdapter implements ValidationAdapter {
77
async validate<S extends IfInstalled<GenericSchema | GenericSchemaAsync>>(schema: S, data: unknown) {

packages/next-safe-action/src/adapters/yup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import type { Schema as YupSchema } from "yup";
44
import { ValidationError } from "yup";
5-
import type { IfInstalled, Infer, ValidationAdapter, ValidationIssue } from "../adapters.types";
5+
import type { IfInstalled, Infer, ValidationAdapter, ValidationIssue } from "./types";
66

77
class YupAdapter implements ValidationAdapter {
88
async validate<S extends IfInstalled<YupSchema>>(schema: S, data: unknown) {

packages/next-safe-action/src/adapters/zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// https://github.com/decs/typeschema/blob/main/packages/zod/src/validation.ts
22

33
import type { z } from "zod";
4-
import type { IfInstalled, Infer, ValidationAdapter } from "../adapters.types";
4+
import type { IfInstalled, Infer, ValidationAdapter } from "./types";
55

66
export type ZodSchema = z.ZodType;
77

packages/next-safe-action/src/hooks-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from "react";
22
import {} from "react/experimental";
33
import type {} from "zod";
4-
import type { InferIn, Schema } from "./adapters.types";
4+
import type { InferIn, Schema } from "./adapters/types";
55
import type { HookActionStatus, HookCallbacks, HookResult } from "./hooks.types";
66

77
export const getActionStatus = <

packages/next-safe-action/src/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as React from "react";
66
import * as ReactDOM from "react-dom";
77
import {} from "react/experimental";
88
import type {} from "zod";
9-
import type { InferIn, Schema } from "./adapters.types";
9+
import type { InferIn, Schema } from "./adapters/types";
1010
import { getActionShorthandStatusObject, getActionStatus, useActionCallbacks } from "./hooks-utils";
1111
import type { HookCallbacks, HookResult, HookSafeActionFn } from "./hooks.types";
1212
import { isError } from "./utils";

packages/next-safe-action/src/hooks.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { InferIn, Schema } from "./adapters.types";
1+
import type { InferIn, Schema } from "./adapters/types";
22
import type { SafeActionResult } from "./index.types";
33
import type { MaybePromise, Prettify } from "./utils.types";
44

packages/next-safe-action/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Infer, Schema } from "./adapters.types";
1+
import type { Infer, Schema } from "./adapters/types";
22
import type { DVES, SafeActionClientOpts } from "./index.types";
33
import { SafeActionClient } from "./safe-action-client";
44
import { DEFAULT_SERVER_ERROR_MESSAGE } from "./utils";

packages/next-safe-action/src/index.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Infer, InferArray, InferIn, InferInArray, Schema, ValidationAdapter } from "./adapters.types";
1+
import type { Infer, InferArray, InferIn, InferInArray, Schema, ValidationAdapter } from "./adapters/types";
22
import type { MaybePromise, Prettify } from "./utils.types";
33
import type { BindArgsValidationErrors, ValidationErrors } from "./validation-errors.types";
44

0 commit comments

Comments
 (0)