@trpc/server 11.0.0-rc.390 → 11.0.0-rc.394

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
- "bundleSize": 105459,
3
- "bundleOrigSize": 153978,
4
- "bundleReduction": 31.51,
2
+ "bundleSize": 105501,
3
+ "bundleOrigSize": 154208,
4
+ "bundleReduction": 31.59,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/unstable-core-do-not-import/stream/stream.ts",
@@ -32,7 +32,7 @@
32
32
  "dependents": [
33
33
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
34
34
  ],
35
- "percent": 10.66,
35
+ "percent": 10.65,
36
36
  "reduction": 0
37
37
  },
38
38
  {
@@ -46,7 +46,7 @@
46
46
  "dependents": [
47
47
  "/src/unstable-core-do-not-import.ts"
48
48
  ],
49
- "percent": 10.29,
49
+ "percent": 10.28,
50
50
  "reduction": 3.08
51
51
  },
52
52
  {
@@ -77,8 +77,8 @@
77
77
  "removedExports": [],
78
78
  "dependents": [
79
79
  "/src/unstable-core-do-not-import.ts",
80
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
81
- "/src/unstable-core-do-not-import/initTRPC.ts"
80
+ "/src/unstable-core-do-not-import/initTRPC.ts",
81
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts"
82
82
  ],
83
83
  "percent": 5.68,
84
84
  "reduction": 41.05
@@ -172,9 +172,9 @@
172
172
  "removedExports": [],
173
173
  "dependents": [
174
174
  "/src/unstable-core-do-not-import.ts",
175
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
176
175
  "/src/unstable-core-do-not-import/router.ts",
177
- "/src/unstable-core-do-not-import/initTRPC.ts"
176
+ "/src/unstable-core-do-not-import/initTRPC.ts",
177
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts"
178
178
  ],
179
179
  "percent": 2.6,
180
180
  "reduction": 45.94
@@ -284,9 +284,9 @@
284
284
  "removedExports": [],
285
285
  "dependents": [
286
286
  "/src/unstable-core-do-not-import.ts",
287
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
288
287
  "/src/unstable-core-do-not-import/router.ts",
289
288
  "/src/unstable-core-do-not-import/middleware.ts",
289
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts",
290
290
  "/src/unstable-core-do-not-import/http/contentType.ts",
291
291
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
292
292
  ],
@@ -341,7 +341,7 @@
341
341
  ],
342
342
  "removedExports": [],
343
343
  "dependents": [],
344
- "percent": 1.45,
344
+ "percent": 1.44,
345
345
  "reduction": 27.6
346
346
  },
347
347
  {
@@ -369,8 +369,8 @@
369
369
  "removedExports": [],
370
370
  "dependents": [
371
371
  "/src/unstable-core-do-not-import.ts",
372
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
373
- "/src/unstable-core-do-not-import/error/getErrorShape.ts"
372
+ "/src/unstable-core-do-not-import/error/getErrorShape.ts",
373
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts"
374
374
  ],
375
375
  "percent": 1.2,
376
376
  "reduction": 23.5
@@ -390,11 +390,11 @@
390
390
  "removedExports": [],
391
391
  "dependents": [
392
392
  "/src/unstable-core-do-not-import.ts",
393
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
394
393
  "/src/unstable-core-do-not-import/error/TRPCError.ts",
395
394
  "/src/unstable-core-do-not-import/router.ts",
396
395
  "/src/unstable-core-do-not-import/transformer.ts",
397
396
  "/src/unstable-core-do-not-import/middleware.ts",
397
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts",
398
398
  "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
399
399
  "/src/unstable-core-do-not-import/http/contentType.ts",
400
400
  "/src/unstable-core-do-not-import/procedureBuilder.ts",
@@ -420,8 +420,8 @@
420
420
  },
421
421
  {
422
422
  "id": "/src/unstable-core-do-not-import/parser.ts",
423
- "size": 992,
424
- "origSize": 2266,
423
+ "size": 1034,
424
+ "origSize": 2496,
425
425
  "renderedExports": [
426
426
  "getParseFn"
427
427
  ],
@@ -430,8 +430,8 @@
430
430
  "/src/unstable-core-do-not-import.ts",
431
431
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
432
432
  ],
433
- "percent": 0.94,
434
- "reduction": 56.22
433
+ "percent": 0.98,
434
+ "reduction": 58.57
435
435
  },
436
436
  {
437
437
  "id": "/src/adapters/next-app-dir/redirect.ts",
@@ -633,9 +633,9 @@
633
633
  "reduction": 93.8
634
634
  },
635
635
  {
636
- "id": "/src/http.ts",
636
+ "id": "/src/index.ts",
637
637
  "size": 0,
638
- "origSize": 37,
638
+ "origSize": 32,
639
639
  "renderedExports": [],
640
640
  "removedExports": [],
641
641
  "dependents": [],
@@ -643,9 +643,9 @@
643
643
  "reduction": 100
644
644
  },
645
645
  {
646
- "id": "/src/index.ts",
646
+ "id": "/src/http.ts",
647
647
  "size": 0,
648
- "origSize": 32,
648
+ "origSize": 37,
649
649
  "renderedExports": [],
650
650
  "removedExports": [],
651
651
  "dependents": [],
@@ -2,6 +2,14 @@ export type ParserZodEsque<TInput, TParsedInput> = {
2
2
  _input: TInput;
3
3
  _output: TParsedInput;
4
4
  };
5
+ export type ParserValibotEsque<TInput, TParsedInput> = {
6
+ schema: {
7
+ _types?: {
8
+ input: TInput;
9
+ output: TParsedInput;
10
+ };
11
+ };
12
+ };
5
13
  export type ParserMyZodEsque<TInput> = {
6
14
  parse: (input: any) => TInput;
7
15
  };
@@ -16,7 +24,7 @@ export type ParserScaleEsque<TInput> = {
16
24
  assert(value: unknown): asserts value is TInput;
17
25
  };
18
26
  export type ParserWithoutInput<TInput> = ParserCustomValidatorEsque<TInput> | ParserMyZodEsque<TInput> | ParserScaleEsque<TInput> | ParserSuperstructEsque<TInput> | ParserYupEsque<TInput>;
19
- export type ParserWithInputOutput<TInput, TParsedInput> = ParserZodEsque<TInput, TParsedInput>;
27
+ export type ParserWithInputOutput<TInput, TParsedInput> = ParserZodEsque<TInput, TParsedInput> | ParserValibotEsque<TInput, TParsedInput>;
20
28
  export type Parser = ParserWithInputOutput<any, any> | ParserWithoutInput<any>;
21
29
  export type inferParser<TParser extends Parser> = TParser extends ParserWithInputOutput<infer $TIn, infer $TOut> ? {
22
30
  in: $TIn;
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/parser.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,cAAc,CAAC,MAAM,EAAE,YAAY,IAAI;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,MAAM,IAAI;IACrC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,MAAM,IAAI;IAC3C,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,MAAM,IAAI,CAC/C,KAAK,EAAE,OAAO,KACX,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAE9B,MAAM,MAAM,cAAc,CAAC,MAAM,IAAI;IACnC,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,MAAM,IAAI;IACrC,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,MAAM,IACjC,0BAA0B,CAAC,MAAM,CAAC,GAClC,gBAAgB,CAAC,MAAM,CAAC,GACxB,gBAAgB,CAAC,MAAM,CAAC,GACxB,sBAAsB,CAAC,MAAM,CAAC,GAC9B,cAAc,CAAC,MAAM,CAAC,CAAC;AAE3B,MAAM,MAAM,qBAA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AE,MAAM,CAAC;CACb,GACD,KAAK,CAAC;AAEZ,MAAM,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AAExE,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAuCzE"}
@@ -4,6 +4,7 @@
4
4
  function getParseFn(procedureParser) {
5
5
  const parser = procedureParser;
6
6
  if (typeof parser === 'function') {
7
+ // ParserValibotEsque (>= v0.31.0)
7
8
  // ParserCustomValidatorEsque
8
9
  return parser;
9
10
  }
@@ -13,7 +14,7 @@ function getParseFn(procedureParser) {
13
14
  }
14
15
  if (typeof parser.parse === 'function') {
15
16
  // ParserZodEsque
16
- // ParserValibotEsque (<= v0.12.X)
17
+ // ParserValibotEsque (< v0.13.0)
17
18
  return parser.parse.bind(parser);
18
19
  }
19
20
  if (typeof parser.validateSync === 'function') {
@@ -2,6 +2,7 @@
2
2
  function getParseFn(procedureParser) {
3
3
  const parser = procedureParser;
4
4
  if (typeof parser === 'function') {
5
+ // ParserValibotEsque (>= v0.31.0)
5
6
  // ParserCustomValidatorEsque
6
7
  return parser;
7
8
  }
@@ -11,7 +12,7 @@ function getParseFn(procedureParser) {
11
12
  }
12
13
  if (typeof parser.parse === 'function') {
13
14
  // ParserZodEsque
14
- // ParserValibotEsque (<= v0.12.X)
15
+ // ParserValibotEsque (< v0.13.0)
15
16
  return parser.parse.bind(parser);
16
17
  }
17
18
  if (typeof parser.validateSync === 'function') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-rc.390+d846f1796",
3
+ "version": "11.0.0-rc.394+eab054f77",
4
4
  "description": "The tRPC server library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -141,7 +141,7 @@
141
141
  "tslib": "^2.5.0",
142
142
  "tsx": "^4.0.0",
143
143
  "typescript": "^5.4.0",
144
- "valibot": "^0.30.0",
144
+ "valibot": "^0.31.0",
145
145
  "ws": "^8.0.0",
146
146
  "yup": "^1.0.0",
147
147
  "zod": "^3.0.0"
@@ -149,5 +149,5 @@
149
149
  "funding": [
150
150
  "https://trpc.io/sponsor"
151
151
  ],
152
- "gitHead": "d846f1796c969778b647dcba43b2bcff1b3a4830"
152
+ "gitHead": "eab054f77f6c86bee3a3959b8312fdefd739378a"
153
153
  }
@@ -4,6 +4,15 @@ export type ParserZodEsque<TInput, TParsedInput> = {
4
4
  _output: TParsedInput;
5
5
  };
6
6
 
7
+ export type ParserValibotEsque<TInput, TParsedInput> = {
8
+ schema: {
9
+ _types?: {
10
+ input: TInput;
11
+ output: TParsedInput;
12
+ };
13
+ };
14
+ };
15
+
7
16
  export type ParserMyZodEsque<TInput> = {
8
17
  parse: (input: any) => TInput;
9
18
  };
@@ -31,10 +40,9 @@ export type ParserWithoutInput<TInput> =
31
40
  | ParserSuperstructEsque<TInput>
32
41
  | ParserYupEsque<TInput>;
33
42
 
34
- export type ParserWithInputOutput<TInput, TParsedInput> = ParserZodEsque<
35
- TInput,
36
- TParsedInput
37
- >;
43
+ export type ParserWithInputOutput<TInput, TParsedInput> =
44
+ | ParserZodEsque<TInput, TParsedInput>
45
+ | ParserValibotEsque<TInput, TParsedInput>;
38
46
 
39
47
  export type Parser = ParserWithInputOutput<any, any> | ParserWithoutInput<any>;
40
48
 
@@ -57,6 +65,7 @@ export function getParseFn<TType>(procedureParser: Parser): ParseFn<TType> {
57
65
  const parser = procedureParser as any;
58
66
 
59
67
  if (typeof parser === 'function') {
68
+ // ParserValibotEsque (>= v0.31.0)
60
69
  // ParserCustomValidatorEsque
61
70
  return parser;
62
71
  }
@@ -68,7 +77,7 @@ export function getParseFn<TType>(procedureParser: Parser): ParseFn<TType> {
68
77
 
69
78
  if (typeof parser.parse === 'function') {
70
79
  // ParserZodEsque
71
- // ParserValibotEsque (<= v0.12.X)
80
+ // ParserValibotEsque (< v0.13.0)
72
81
  return parser.parse.bind(parser);
73
82
  }
74
83