@trpc/server 11.0.1-canary.6 → 11.0.2-canary.4

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": 201924,
3
- "bundleOrigSize": 234627,
4
- "bundleReduction": 13.94,
2
+ "bundleSize": 202129,
3
+ "bundleOrigSize": 234830,
4
+ "bundleReduction": 13.93,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
@@ -14,7 +14,7 @@
14
14
  "dependents": [
15
15
  "/src/unstable-core-do-not-import.ts"
16
16
  ],
17
- "percent": 10.44,
17
+ "percent": 10.43,
18
18
  "reduction": 0
19
19
  },
20
20
  {
@@ -30,7 +30,7 @@
30
30
  "dependents": [
31
31
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
32
32
  ],
33
- "percent": 9.98,
33
+ "percent": 9.97,
34
34
  "reduction": 0
35
35
  },
36
36
  {
@@ -47,7 +47,7 @@
47
47
  "/src/unstable-core-do-not-import.ts",
48
48
  "/src/unstable-core-do-not-import/http/resolveResponse.ts"
49
49
  ],
50
- "percent": 9.88,
50
+ "percent": 9.87,
51
51
  "reduction": 0
52
52
  },
53
53
  {
@@ -77,7 +77,7 @@
77
77
  ],
78
78
  "removedExports": [],
79
79
  "dependents": [],
80
- "percent": 6.02,
80
+ "percent": 6.01,
81
81
  "reduction": 11.62
82
82
  },
83
83
  {
@@ -98,7 +98,7 @@
98
98
  "/src/unstable-core-do-not-import/initTRPC.ts",
99
99
  "/src/unstable-core-do-not-import/http/contentType.ts"
100
100
  ],
101
- "percent": 5.03,
101
+ "percent": 5.02,
102
102
  "reduction": 29.54
103
103
  },
104
104
  {
@@ -228,7 +228,7 @@
228
228
  "/src/adapters/node-http/index.ts",
229
229
  "/src/adapters/node-http/nodeHTTPRequestHandler.ts"
230
230
  ],
231
- "percent": 2.01,
231
+ "percent": 2,
232
232
  "reduction": 6.81
233
233
  },
234
234
  {
@@ -246,7 +246,7 @@
246
246
  "dependents": [
247
247
  "/src/observable/index.ts"
248
248
  ],
249
- "percent": 1.94,
249
+ "percent": 1.93,
250
250
  "reduction": 1.66
251
251
  },
252
252
  {
@@ -260,7 +260,7 @@
260
260
  "dependents": [
261
261
  "/src/adapters/next-app-dir.ts"
262
262
  ],
263
- "percent": 1.61,
263
+ "percent": 1.6,
264
264
  "reduction": 22.52
265
265
  },
266
266
  {
@@ -274,7 +274,7 @@
274
274
  "dependents": [
275
275
  "/src/adapters/aws-lambda/getPlanner.ts"
276
276
  ],
277
- "percent": 1.39,
277
+ "percent": 1.38,
278
278
  "reduction": 0
279
279
  },
280
280
  {
@@ -343,7 +343,7 @@
343
343
  "/src/unstable-core-do-not-import/initTRPC.ts",
344
344
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
345
345
  ],
346
- "percent": 1.3,
346
+ "percent": 1.29,
347
347
  "reduction": 55.88
348
348
  },
349
349
  {
@@ -371,10 +371,10 @@
371
371
  "/src/unstable-core-do-not-import/router.ts",
372
372
  "/src/unstable-core-do-not-import/transformer.ts",
373
373
  "/src/unstable-core-do-not-import/middleware.ts",
374
+ "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
374
375
  "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
375
376
  "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
376
377
  "/src/unstable-core-do-not-import/http/resolveResponse.ts",
377
- "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
378
378
  "/src/unstable-core-do-not-import/http/contentType.ts",
379
379
  "/src/unstable-core-do-not-import/http/abortError.ts",
380
380
  "/src/unstable-core-do-not-import/procedureBuilder.ts",
@@ -488,6 +488,21 @@
488
488
  "percent": 1,
489
489
  "reduction": 3.8
490
490
  },
491
+ {
492
+ "id": "/src/unstable-core-do-not-import/parser.ts",
493
+ "size": 1815,
494
+ "origSize": 3704,
495
+ "renderedExports": [
496
+ "getParseFn"
497
+ ],
498
+ "removedExports": [],
499
+ "dependents": [
500
+ "/src/unstable-core-do-not-import.ts",
501
+ "/src/unstable-core-do-not-import/procedureBuilder.ts"
502
+ ],
503
+ "percent": 0.9,
504
+ "reduction": 51
505
+ },
491
506
  {
492
507
  "id": "/src/adapters/fastify/fastifyTRPCPlugin.ts",
493
508
  "size": 1777,
@@ -547,21 +562,6 @@
547
562
  "percent": 0.8,
548
563
  "reduction": 17.81
549
564
  },
550
- {
551
- "id": "/src/unstable-core-do-not-import/parser.ts",
552
- "size": 1610,
553
- "origSize": 3501,
554
- "renderedExports": [
555
- "getParseFn"
556
- ],
557
- "removedExports": [],
558
- "dependents": [
559
- "/src/unstable-core-do-not-import.ts",
560
- "/src/unstable-core-do-not-import/procedureBuilder.ts"
561
- ],
562
- "percent": 0.8,
563
- "reduction": 54.01
564
- },
565
565
  {
566
566
  "id": "/src/adapters/next.ts",
567
567
  "size": 1326,
@@ -885,21 +885,19 @@
885
885
  "reduction": 100
886
886
  },
887
887
  {
888
- "id": "/src/http.ts",
888
+ "id": "/src/shared.ts",
889
889
  "size": 0,
890
- "origSize": 37,
890
+ "origSize": 653,
891
891
  "renderedExports": [],
892
892
  "removedExports": [],
893
- "dependents": [
894
- "/src/adapters/ws.ts"
895
- ],
893
+ "dependents": [],
896
894
  "percent": 0,
897
895
  "reduction": 100
898
896
  },
899
897
  {
900
- "id": "/src/shared.ts",
898
+ "id": "/src/rpc.ts",
901
899
  "size": 0,
902
- "origSize": 653,
900
+ "origSize": 36,
903
901
  "renderedExports": [],
904
902
  "removedExports": [],
905
903
  "dependents": [],
@@ -907,12 +905,14 @@
907
905
  "reduction": 100
908
906
  },
909
907
  {
910
- "id": "/src/rpc.ts",
908
+ "id": "/src/http.ts",
911
909
  "size": 0,
912
- "origSize": 36,
910
+ "origSize": 37,
913
911
  "renderedExports": [],
914
912
  "removedExports": [],
915
- "dependents": [],
913
+ "dependents": [
914
+ "/src/adapters/ws.ts"
915
+ ],
916
916
  "percent": 0,
917
917
  "reduction": 100
918
918
  },
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,MAAM,MAAM,cAAc,CAAC,MAAM,EAAE,YAAY,IAAI;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,MAAM,EAAE,YAAY,IAAI;IACrD,MAAM,EAAE;QACN,MAAM,CAAC,EAAE;YACP,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,YAAY,CAAC;SACtB,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,MAAM,EAAE,YAAY,IAAI;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,YAAY,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,yBAAyB,CAAC,MAAM,EAAE,YAAY,IAAI,gBAAgB,CAC5E,MAAM,EACN,YAAY,CACb,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,MAA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D,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,qBAAqB,CAAC,MAAM,EAAE,YAAY,IAClD,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,GACpC,kBAAkB,CAAC,MAAM,EAAE,YAAY,CAAC,GACxC,kBAAkB,CAAC,MAAM,EAAE,YAAY,CAAC,GACxC,yBAAyB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAEpD,MAAM,MAAM,MAAM,GAAG,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAE/E,MAAM,MAAM,WAAW,CAAC,OAAO,SAAS,MAAM,IAC5C,OAAO,SAAS,qBAAqB,CAAC,MAAM,IAAI,EAAE,MAAM,KAAK,CAAC,GAC1D;IACE,EAAE,EAAE,IAAI,CAAC;IACT,GAAG,EAAE,KAAK,CAAC;CACZ,GACD,OAAO,SAAS,kBAAkB,CAAC,MAAM,MAAM,CAAC,GAC9C;IACE,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACb,GACD,KAAK,CAAC;AAEd,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,CAwDzE"}
@@ -4,13 +4,14 @@ var error = require('../vendor/standard-schema-v1/error.js');
4
4
 
5
5
  function getParseFn(procedureParser) {
6
6
  const parser = procedureParser;
7
+ const isStandardSchema = '~standard' in parser;
7
8
  if (typeof parser === 'function' && typeof parser.assert === 'function') {
8
9
  // ParserArkTypeEsque - arktype schemas shouldn't be called as a function because they return a union type instead of throwing
9
10
  return parser.assert.bind(parser);
10
11
  }
11
- if (typeof parser === 'function') {
12
+ if (typeof parser === 'function' && !isStandardSchema) {
12
13
  // ParserValibotEsque (>= v0.31.0)
13
- // ParserCustomValidatorEsque
14
+ // ParserCustomValidatorEsque - note the check for standard-schema conformance - some libraries like `effect` use function schemas which are *not* a "parse" function.
14
15
  return parser;
15
16
  }
16
17
  if (typeof parser.parseAsync === 'function') {
@@ -37,7 +38,7 @@ function getParseFn(procedureParser) {
37
38
  return value;
38
39
  };
39
40
  }
40
- if ('~standard' in parser) {
41
+ if (isStandardSchema) {
41
42
  // StandardSchemaEsque
42
43
  return async (value)=>{
43
44
  const result = await parser['~standard'].validate(value);
@@ -2,13 +2,14 @@ import { StandardSchemaV1Error } from '../vendor/standard-schema-v1/error.mjs';
2
2
 
3
3
  function getParseFn(procedureParser) {
4
4
  const parser = procedureParser;
5
+ const isStandardSchema = '~standard' in parser;
5
6
  if (typeof parser === 'function' && typeof parser.assert === 'function') {
6
7
  // ParserArkTypeEsque - arktype schemas shouldn't be called as a function because they return a union type instead of throwing
7
8
  return parser.assert.bind(parser);
8
9
  }
9
- if (typeof parser === 'function') {
10
+ if (typeof parser === 'function' && !isStandardSchema) {
10
11
  // ParserValibotEsque (>= v0.31.0)
11
- // ParserCustomValidatorEsque
12
+ // ParserCustomValidatorEsque - note the check for standard-schema conformance - some libraries like `effect` use function schemas which are *not* a "parse" function.
12
13
  return parser;
13
14
  }
14
15
  if (typeof parser.parseAsync === 'function') {
@@ -35,7 +36,7 @@ function getParseFn(procedureParser) {
35
36
  return value;
36
37
  };
37
38
  }
38
- if ('~standard' in parser) {
39
+ if (isStandardSchema) {
39
40
  // StandardSchemaEsque
40
41
  return async (value)=>{
41
42
  const result = await parser['~standard'].validate(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.1-canary.6+e3bc61c2f",
3
+ "version": "11.0.2-canary.4+8cc1aa5ea",
4
4
  "description": "The tRPC server library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -152,5 +152,5 @@
152
152
  "peerDependencies": {
153
153
  "typescript": ">=5.7.2"
154
154
  },
155
- "gitHead": "e3bc61c2ff4b2c60111cf1ace42807dddc77135b"
155
+ "gitHead": "8cc1aa5eaa62a48c5a10cccf4250d23b2ce44918"
156
156
  }
@@ -78,15 +78,16 @@ export type ParseFn<TType> = (value: unknown) => Promise<TType> | TType;
78
78
 
79
79
  export function getParseFn<TType>(procedureParser: Parser): ParseFn<TType> {
80
80
  const parser = procedureParser as any;
81
+ const isStandardSchema = '~standard' in parser;
81
82
 
82
83
  if (typeof parser === 'function' && typeof parser.assert === 'function') {
83
84
  // ParserArkTypeEsque - arktype schemas shouldn't be called as a function because they return a union type instead of throwing
84
85
  return parser.assert.bind(parser);
85
86
  }
86
87
 
87
- if (typeof parser === 'function') {
88
+ if (typeof parser === 'function' && !isStandardSchema) {
88
89
  // ParserValibotEsque (>= v0.31.0)
89
- // ParserCustomValidatorEsque
90
+ // ParserCustomValidatorEsque - note the check for standard-schema conformance - some libraries like `effect` use function schemas which are *not* a "parse" function.
90
91
  return parser;
91
92
  }
92
93
 
@@ -119,7 +120,7 @@ export function getParseFn<TType>(procedureParser: Parser): ParseFn<TType> {
119
120
  };
120
121
  }
121
122
 
122
- if ('~standard' in parser) {
123
+ if (isStandardSchema) {
123
124
  // StandardSchemaEsque
124
125
  return async (value) => {
125
126
  const result = await parser['~standard'].validate(value);