Skip to content

Commit dc70184

Browse files
authored
Fix peerDependencies (#158)
* Fix peerDependencies * Fix * Fix test
1 parent b56c6ea commit dc70184

File tree

4 files changed

+49
-34
lines changed

4 files changed

+49
-34
lines changed

package-lock.json

Lines changed: 28 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgs/typed-api-spec/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@notainc/typed-api-spec",
33
"version": "0.4.1",
44
"scripts": {
5-
"install:optional-peer-dependencies": "npm install --no-save zod valibot@0 express@4 @types/express@4 fastify fastify-type-provider-zod@2",
5+
"install:optional-peer-dependencies": "npm install --no-save zod valibot@1 express@4 @types/express@4 fastify fastify-type-provider-zod@2",
66
"build": "tsup",
77
"watch:build": "tsup --watch",
88
"format": "prettier --write .",
@@ -38,14 +38,14 @@
3838
"peerDependencies": {
3939
"@types/express": "^4",
4040
"@types/express-serve-static-core": "^4",
41-
"@valibot/to-json-schema": "^1.0.0-beta.4",
41+
"@valibot/to-json-schema": "^1.0.0",
4242
"express": "^4",
4343
"fastify": "^4 || ^5.0.0",
4444
"fastify-type-provider-zod": "^2",
4545
"msw": "^2",
4646
"typescript": "^5.3",
47-
"valibot": "1.0.0-beta.11",
48-
"zod": "^3.23.0"
47+
"valibot": "^1.0.0",
48+
"zod": "^3.24.0"
4949
},
5050
"peerDependenciesMeta": {
5151
"zod": {

pkgs/typed-api-spec/src/core/schema.test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,26 +92,24 @@ describe("newSSValidator", () => {
9292
expect(issues[0]).toEqual({
9393
abortEarly: undefined,
9494
abortPipeEarly: undefined,
95-
expected: "string",
95+
expected: `"${path}"`,
9696
input: undefined,
9797
issues: undefined,
9898
kind: "schema",
9999
lang: undefined,
100-
message: "Invalid type: Expected string but received undefined",
100+
message: `Invalid key: Expected "${path}" but received undefined`,
101101
path: [
102102
{
103-
input: {
104-
invalid: "invalidValue",
105-
},
103+
input: { invalid: "invalidValue" },
106104
key: path,
107-
origin: "value",
105+
origin: "key",
108106
type: "object",
109107
value: undefined,
110108
},
111109
],
112110
received: "undefined",
113111
requirement: undefined,
114-
type: "string",
112+
type: "object",
115113
});
116114
};
117115

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

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,26 +147,26 @@ describe("valibot", () => {
147147
{
148148
abortEarly: undefined,
149149
abortPipeEarly: undefined,
150-
expected: "string",
150+
expected: `"name"`,
151151
input: undefined,
152152
issues: undefined,
153153
kind: "schema",
154154
lang: undefined,
155-
message: "Invalid type: Expected string but received undefined",
155+
message: `Invalid key: Expected "name" but received undefined`,
156156
path: [
157157
{
158158
input: {
159159
desc: "test",
160160
},
161161
key: "name",
162-
origin: "value",
162+
origin: "key",
163163
type: "object",
164164
value: undefined,
165165
},
166166
],
167167
received: "undefined",
168168
requirement: undefined,
169-
type: "string",
169+
type: "object",
170170
},
171171
]);
172172
} else {
@@ -181,26 +181,26 @@ describe("valibot", () => {
181181
{
182182
abortEarly: undefined,
183183
abortPipeEarly: undefined,
184-
expected: "string",
184+
expected: `"name"`,
185185
input: undefined,
186186
issues: undefined,
187187
kind: "schema",
188188
lang: undefined,
189-
message: "Invalid type: Expected string but received undefined",
189+
message: `Invalid key: Expected "name" but received undefined`,
190190
path: [
191191
{
192192
input: {
193193
desc: "test",
194194
},
195195
key: "name",
196-
origin: "value",
196+
origin: "key",
197197
type: "object",
198198
value: undefined,
199199
},
200200
],
201201
received: "undefined",
202202
requirement: undefined,
203-
type: "string",
203+
type: "object",
204204
},
205205
]);
206206
} else {
@@ -214,25 +214,24 @@ describe("valibot", () => {
214214
{
215215
abortEarly: undefined,
216216
abortPipeEarly: undefined,
217-
expected: '"application/json"',
217+
expected: `"content-type"`,
218218
input: undefined,
219219
issues: undefined,
220220
kind: "schema",
221221
lang: undefined,
222-
message:
223-
'Invalid type: Expected "application/json" but received undefined',
222+
message: `Invalid key: Expected "content-type" but received undefined`,
224223
path: [
225224
{
226225
input: {},
227226
key: "content-type",
228-
origin: "value",
227+
origin: "key",
229228
type: "object",
230229
value: undefined,
231230
},
232231
],
233232
received: "undefined",
234233
requirement: undefined,
235-
type: "literal",
234+
type: "object",
236235
},
237236
]);
238237
} else {

0 commit comments

Comments
 (0)