Skip to content

Commit 333eeda

Browse files
committed
Remove express zod, valibot type utils
1 parent bd604d6 commit 333eeda

File tree

10 files changed

+10
-159
lines changed

10 files changed

+10
-159
lines changed

examples/misc/express/valibot/express.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import express from "express";
22
import { asAsync } from "@notainc/typed-api-spec/express";
3+
import { ToHandlers, typed } from "@notainc/typed-api-spec/express/ss";
34
import { pathMap } from "../../spec/valibot";
4-
import { ToHandlers, typed } from "@notainc/typed-api-spec/express/valibot";
55

66
const emptyMiddleware = (
77
req: express.Request,

examples/misc/express/zod/express.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import express from "express";
22
import { pathMap } from "../../spec/zod";
3-
import { ToHandlers, typed } from "@notainc/typed-api-spec/express/zod";
3+
import { ToHandlers, typed } from "@notainc/typed-api-spec/express/ss";
44
import { asAsync } from "@notainc/typed-api-spec/express";
55

66
const emptyMiddleware = (

examples/misc/spec/valibot.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1+
import { SSApiEndpoints, ToApiEndpoints } from "@notainc/typed-api-spec/ss";
12
import * as v from "valibot";
2-
import {
3-
ToApiEndpoints,
4-
ValibotApiEndpoints,
5-
} from "@notainc/typed-api-spec/valibot";
63

74
const JsonHeader = v.object({
85
"Content-Type": v.literal("application/json"),
@@ -44,5 +41,5 @@ export const pathMap = {
4441
},
4542
},
4643
},
47-
} satisfies ValibotApiEndpoints;
44+
} satisfies SSApiEndpoints;
4845
export type PathMap = ToApiEndpoints<typeof pathMap>;

pkgs/typed-api-spec/package.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,10 @@
8888
"require": "./dist/express/index.js",
8989
"import": "./dist/express/index.mjs"
9090
},
91-
"./express/zod": {
92-
"types": "./dist/express/zod.d.ts",
93-
"require": "./dist/express/zod.js",
94-
"import": "./dist/express/zod.mjs"
95-
},
96-
"./express/valibot": {
97-
"types": "./dist/express/valibot.d.ts",
98-
"require": "./dist/express/valibot.js",
99-
"import": "./dist/express/valibot.mjs"
91+
"./express/ss": {
92+
"types": "./dist/express/ss.d.ts",
93+
"require": "./dist/express/ss.js",
94+
"import": "./dist/express/ss.mjs"
10095
},
10196
"./fastify/zod": {
10297
"types": "./dist/fastify/zod.d.ts",

pkgs/typed-api-spec/src/express/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ export const validatorMiddleware = <V extends RequestSpecValidatorGenerator>(
112112
body: req.body,
113113
});
114114
if (error) {
115-
// TODO: StandardSchemV1のFailureResultのフォーマットに合わせる
116115
return {
117116
query: () =>
118117
({

pkgs/typed-api-spec/src/express/valibot.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { asAsync, ValidateLocals, validatorMiddleware } from "./index";
55
import * as v from "valibot";
66
import { Request } from "express";
77
import { ParseUrlParams } from "../core";
8-
import { ToHandlers, typed } from "./valibot";
98
import {
109
newValidatorMethodNotFoundError,
1110
newValidatorPathNotFoundError,
1211
} from "../core/validator/validate";
1312
import { newSSValidator, SSApiEndpoints, SSApiSpec, SSValidators } from "../ss";
13+
import { ToHandlers, typed } from "./ss";
1414

1515
type SSValidateLocals<
1616
AS extends SSApiSpec,

pkgs/typed-api-spec/src/express/valibot.ts

Lines changed: 0 additions & 69 deletions
This file was deleted.

pkgs/typed-api-spec/src/express/zod.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { asAsync, ValidateLocals, validatorMiddleware } from "./index";
55
import { z } from "zod";
66
import { Request } from "express";
77
import { ParseUrlParams } from "../core";
8-
import { ToHandlers, typed } from "./zod";
98
import {
109
newValidatorMethodNotFoundError,
1110
newValidatorPathNotFoundError,
1211
} from "../core/validator/validate";
1312
import { newSSValidator, SSApiEndpoints, SSApiSpec, SSValidators } from "../ss";
13+
import { ToHandlers, typed } from "./ss";
1414

1515
type SSValidateLocals<
1616
AS extends SSApiSpec,

pkgs/typed-api-spec/src/express/zod.ts

Lines changed: 0 additions & 65 deletions
This file was deleted.

pkgs/typed-api-spec/src/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ export {
88
Handler as ExpressHandler,
99
} from "./express";
1010

11-
export {
12-
ToHandlers as ExpressToZodHandlers,
13-
ToHandler as ExpressToZodHandler,
14-
typed as expressZodTyped,
15-
} from "./express/zod";
16-
1711
import FetchT, { RequestInitT } from "./fetch";
1812
export { FetchT, RequestInitT };
1913

0 commit comments

Comments
 (0)