@trpc/server 11.0.0-alpha-tmp.162 → 11.0.0-alpha-tmp.171

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.
@@ -2,5 +2,6 @@ import { AnyRouter } from '@trpc/core';
2
2
  import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next/types';
3
3
  import { NodeHTTPCreateContextFnOptions, NodeHTTPHandlerOptions } from './node-http';
4
4
  export type CreateNextContextOptions = NodeHTTPCreateContextFnOptions<NextApiRequest, NextApiResponse>;
5
+ export type { NextApiHandler, NextApiRequest, NextApiResponse, } from 'next/types';
5
6
  export declare function createNextApiHandler<TRouter extends AnyRouter>(opts: NodeHTTPHandlerOptions<TRouter, NextApiRequest, NextApiResponse>): NextApiHandler;
6
7
  //# sourceMappingURL=next.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/adapters/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;AAElD,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,eAAe,EAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EAEvB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,wBAAwB,GAAG,8BAA8B,CACnE,cAAc,EACd,eAAe,CAChB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,SAAS,EAC5D,IAAI,EAAE,sBAAsB,CAAC,OAAO,EAAE,cAAc,EAAE,eAAe,CAAC,GACrE,cAAc,CA8ChB"}
1
+ {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/adapters/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;AAElD,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,eAAe,EAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EAEvB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,wBAAwB,GAAG,8BAA8B,CACnE,cAAc,EACd,eAAe,CAChB,CAAC;AACF,YAAY,EACV,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAC;AAMpB,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,SAAS,EAC5D,IAAI,EAAE,sBAAsB,CAAC,OAAO,EAAE,cAAc,EAAE,eAAe,CAAC,GACrE,cAAc,CA8ChB"}
@@ -9,6 +9,10 @@ require('@trpc/core/http');
9
9
  require('./node-http/content-type/json/index.js');
10
10
  require('../contentType-8c16408e.js');
11
11
 
12
+ // export * from '@trpc/core/http';
13
+ // export * from '@trpc/core/shared';
14
+ // export * from '@trpc/core';
15
+ // export * from './node-http';
12
16
  function createNextApiHandler(opts) {
13
17
  return async (req, res)=>{
14
18
  function getPath() {
@@ -5,6 +5,10 @@ import '@trpc/core/http';
5
5
  import './node-http/content-type/json/index.mjs';
6
6
  import '../contentType-3194ed5f.mjs';
7
7
 
8
+ // export * from '@trpc/core/http';
9
+ // export * from '@trpc/core/shared';
10
+ // export * from '@trpc/core';
11
+ // export * from './node-http';
8
12
  function createNextApiHandler(opts) {
9
13
  return async (req, res)=>{
10
14
  function getPath() {
@@ -1,7 +1,7 @@
1
1
  {
2
- "bundleSize": 52040,
3
- "bundleOrigSize": 71699,
4
- "bundleReduction": 27.42,
2
+ "bundleSize": 52159,
3
+ "bundleOrigSize": 72117,
4
+ "bundleReduction": 27.67,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/adapters/ws.ts",
@@ -14,7 +14,7 @@
14
14
  "dependents": [
15
15
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
16
16
  ],
17
- "percent": 18.45,
17
+ "percent": 18.41,
18
18
  "reduction": 0
19
19
  },
20
20
  {
@@ -30,7 +30,7 @@
30
30
  "dependents": [
31
31
  "/src/adapters/node-http/content-type/form-data/index.ts"
32
32
  ],
33
- "percent": 11.3,
33
+ "percent": 11.27,
34
34
  "reduction": 7.43
35
35
  },
36
36
  {
@@ -46,7 +46,7 @@
46
46
  "dependents": [
47
47
  "/src/adapters/node-http/content-type/form-data/index.ts"
48
48
  ],
49
- "percent": 9.49,
49
+ "percent": 9.47,
50
50
  "reduction": 36.93
51
51
  },
52
52
  {
@@ -70,7 +70,7 @@
70
70
  "dependents": [
71
71
  "/home/runner/work/trpc/trpc/node_modules/.pnpm/@web3-storage+multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/index.js"
72
72
  ],
73
- "percent": 8.56,
73
+ "percent": 8.54,
74
74
  "reduction": 35.63
75
75
  },
76
76
  {
@@ -84,7 +84,7 @@
84
84
  ],
85
85
  "removedExports": [],
86
86
  "dependents": [],
87
- "percent": 8.36,
87
+ "percent": 8.35,
88
88
  "reduction": 34.46
89
89
  },
90
90
  {
@@ -98,7 +98,7 @@
98
98
  "dependents": [
99
99
  "/src/adapters/node-http/index.ts"
100
100
  ],
101
- "percent": 6.8,
101
+ "percent": 6.79,
102
102
  "reduction": 13.45
103
103
  },
104
104
  {
@@ -112,7 +112,7 @@
112
112
  "dependents": [
113
113
  "/src/adapters/fetch/index.ts"
114
114
  ],
115
- "percent": 6.11,
115
+ "percent": 6.1,
116
116
  "reduction": 9.29
117
117
  },
118
118
  {
@@ -131,7 +131,7 @@
131
131
  "dependents": [
132
132
  "/src/adapters/aws-lambda/index.ts"
133
133
  ],
134
- "percent": 5.69,
134
+ "percent": 5.68,
135
135
  "reduction": 39.31
136
136
  },
137
137
  {
@@ -146,7 +146,7 @@
146
146
  "/src/adapters/fastify/fastifyTRPCPlugin.ts",
147
147
  "/src/adapters/fastify/index.ts"
148
148
  ],
149
- "percent": 4.92,
149
+ "percent": 4.91,
150
150
  "reduction": 28.7
151
151
  },
152
152
  {
@@ -158,7 +158,7 @@
158
158
  ],
159
159
  "removedExports": [],
160
160
  "dependents": [],
161
- "percent": 4.11,
161
+ "percent": 4.1,
162
162
  "reduction": 34.12
163
163
  },
164
164
  {
@@ -172,20 +172,20 @@
172
172
  "dependents": [
173
173
  "/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts"
174
174
  ],
175
- "percent": 2.68,
175
+ "percent": 2.67,
176
176
  "reduction": 0
177
177
  },
178
178
  {
179
179
  "id": "/src/adapters/next.ts",
180
- "size": 1253,
181
- "origSize": 1664,
180
+ "size": 1390,
181
+ "origSize": 1891,
182
182
  "renderedExports": [
183
183
  "createNextApiHandler"
184
184
  ],
185
185
  "removedExports": [],
186
186
  "dependents": [],
187
- "percent": 2.41,
188
- "reduction": 24.7
187
+ "percent": 2.66,
188
+ "reduction": 26.49
189
189
  },
190
190
  {
191
191
  "id": "/src/adapters/fastify/fastifyTRPCPlugin.ts",
@@ -198,7 +198,7 @@
198
198
  "dependents": [
199
199
  "/src/adapters/fastify/index.ts"
200
200
  ],
201
- "percent": 2.3,
201
+ "percent": 2.29,
202
202
  "reduction": 36.52
203
203
  },
204
204
  {
@@ -212,7 +212,7 @@
212
212
  "dependents": [
213
213
  "/src/adapters/node-http/content-type/json/index.ts"
214
214
  ],
215
- "percent": 2.11,
215
+ "percent": 2.1,
216
216
  "reduction": 0
217
217
  },
218
218
  {
@@ -232,7 +232,7 @@
232
232
  "/src/adapters/node-http/content-type/form-data/memoryUploadHandler.ts",
233
233
  "/src/adapters/node-http/content-type/form-data/index.ts"
234
234
  ],
235
- "percent": 1.4,
235
+ "percent": 1.39,
236
236
  "reduction": 67.43
237
237
  },
238
238
  {
@@ -264,7 +264,7 @@
264
264
  "dependents": [
265
265
  "/src/adapters/node-http/content-type/form-data/index.ts"
266
266
  ],
267
- "percent": 1.32,
267
+ "percent": 1.31,
268
268
  "reduction": 71.31
269
269
  },
270
270
  {
@@ -321,18 +321,6 @@
321
321
  "percent": 0.19,
322
322
  "reduction": 87.45
323
323
  },
324
- {
325
- "id": "/src/index.ts",
326
- "size": 18,
327
- "origSize": 687,
328
- "renderedExports": [
329
- "foo"
330
- ],
331
- "removedExports": [],
332
- "dependents": [],
333
- "percent": 0.03,
334
- "reduction": 97.38
335
- },
336
324
  {
337
325
  "id": "/src/adapters/fastify/index.ts",
338
326
  "size": 0,
@@ -367,6 +355,26 @@
367
355
  "percent": 0,
368
356
  "reduction": 100
369
357
  },
358
+ {
359
+ "id": "/src/http.ts",
360
+ "size": 0,
361
+ "origSize": 106,
362
+ "renderedExports": [],
363
+ "removedExports": [],
364
+ "dependents": [],
365
+ "percent": 0,
366
+ "reduction": 100
367
+ },
368
+ {
369
+ "id": "/src/index.ts",
370
+ "size": 0,
371
+ "origSize": 772,
372
+ "renderedExports": [],
373
+ "removedExports": [],
374
+ "dependents": [],
375
+ "percent": 0,
376
+ "reduction": 100
377
+ },
370
378
  {
371
379
  "id": "/src/observable.ts",
372
380
  "size": 0,
@@ -398,5 +406,5 @@
398
406
  "reduction": 100
399
407
  }
400
408
  ],
401
- "moduleCount": 28
409
+ "moduleCount": 29
402
410
  }
package/dist/http.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from '@trpc/core/http';
2
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC"}
package/dist/http.js ADDED
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var http = require('@trpc/core/http');
6
+
7
+
8
+
9
+ Object.keys(http).forEach(function (k) {
10
+ if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
11
+ enumerable: true,
12
+ get: function () { return http[k]; }
13
+ });
14
+ });
package/dist/http.mjs ADDED
@@ -0,0 +1 @@
1
+ export * from '@trpc/core/http';
package/dist/index.d.ts CHANGED
@@ -10,10 +10,13 @@ export type {
10
10
  * Use `Awaited<ReturnType<T>>` instead
11
11
  */
12
12
  inferAsyncReturnType, } from '@trpc/core';
13
- export type { AnyRouter as AnyTRPCRouter,
13
+ export type { AnyRouter as AnyTRPCRouter, AnyProcedure as AnyTRPCProcedure,
14
14
  /**
15
15
  * @deprecated use `AnyTRPCRouter` instead
16
16
  */
17
- AnyRouter, } from '@trpc/core';
18
- export declare const foo = "bar";
17
+ AnyRouter,
18
+ /**
19
+ * @deprecated use `AnyTRPCProcedure` instead
20
+ */
21
+ AnyProcedure, } from '@trpc/core';
19
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACL,QAAQ;AACR;;GAEG;AACH,iCAAiC,EACjC,iCAAiC,IAAI,2BAA2B,EAChE,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AAEpB,YAAY;AACV;;;GAGG;AACH,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,SAAS,IAAI,aAAa;AAC1B;;GAEG;AACH,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACL,QAAQ;AACR;;GAEG;AACH,iCAAiC,EACjC,iCAAiC,IAAI,2BAA2B,EAChE,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AAEpB,YAAY;AACV;;;GAGG;AACH,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,SAAS,IAAI,aAAa,EAC1B,YAAY,IAAI,gBAAgB;AAChC;;GAEG;AACH,SAAS;AACT;;GAEG;AACH,YAAY,GACb,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@trpc/core');
6
6
 
7
- const foo = 'bar';
7
+
8
8
 
9
9
  Object.defineProperty(exports, 'TRPCError', {
10
10
  enumerable: true,
@@ -22,4 +22,3 @@ Object.defineProperty(exports, 'initTRPC', {
22
22
  enumerable: true,
23
23
  get: function () { return core.initTRPC; }
24
24
  });
25
- exports.foo = foo;
package/dist/index.mjs CHANGED
@@ -1,5 +1 @@
1
1
  export { TRPCError, experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, initTRPC } from '@trpc/core';
2
-
3
- const foo = 'bar';
4
-
5
- export { foo };
@@ -0,0 +1 @@
1
+ export * from '../dist/http';
package/http/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/http');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-alpha-tmp.162+b68ce2f51",
3
+ "version": "11.0.0-alpha-tmp.171+9bdc993ce",
4
4
  "description": "The tRPC server library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -94,6 +94,11 @@
94
94
  "require": "./dist/adapters/ws.js",
95
95
  "default": "./dist/adapters/ws.js"
96
96
  },
97
+ "./http": {
98
+ "import": "./dist/http.mjs",
99
+ "require": "./dist/http.js",
100
+ "default": "./dist/http.js"
101
+ },
97
102
  "./observable": {
98
103
  "import": "./dist/observable.mjs",
99
104
  "require": "./dist/observable.js",
@@ -116,6 +121,7 @@
116
121
  "README.md",
117
122
  "package.json",
118
123
  "adapters",
124
+ "http",
119
125
  "observable",
120
126
  "rpc",
121
127
  "shared",
@@ -125,7 +131,7 @@
125
131
  "access": "public"
126
132
  },
127
133
  "dependencies": {
128
- "@trpc/core": "11.0.0-alpha-tmp.162+b68ce2f51"
134
+ "@trpc/core": "11.0.0-alpha-tmp.171+9bdc993ce"
129
135
  },
130
136
  "devDependencies": {
131
137
  "@fastify/websocket": "^7.1.2",
@@ -164,5 +170,5 @@
164
170
  "funding": [
165
171
  "https://trpc.io/sponsor"
166
172
  ],
167
- "gitHead": "b68ce2f51be850f98f319a2b77217a34caba4b9f"
173
+ "gitHead": "9bdc993ce388bce677d7f1a0502c95ed524d605b"
168
174
  }
@@ -15,6 +15,15 @@ export type CreateNextContextOptions = NodeHTTPCreateContextFnOptions<
15
15
  NextApiRequest,
16
16
  NextApiResponse
17
17
  >;
18
+ export type {
19
+ NextApiHandler,
20
+ NextApiRequest,
21
+ NextApiResponse,
22
+ } from 'next/types';
23
+ // export * from '@trpc/core/http';
24
+ // export * from '@trpc/core/shared';
25
+ // export * from '@trpc/core';
26
+ // export * from './node-http';
18
27
 
19
28
  export function createNextApiHandler<TRouter extends AnyRouter>(
20
29
  opts: NodeHTTPHandlerOptions<TRouter, NextApiRequest, NextApiResponse>,
package/src/http.ts ADDED
@@ -0,0 +1,2 @@
1
+ // Note: this should likely be moved to a sort of `@trpc/plugin` package
2
+ export * from '@trpc/core/http';
package/src/index.ts CHANGED
@@ -23,10 +23,13 @@ export type {
23
23
 
24
24
  export type {
25
25
  AnyRouter as AnyTRPCRouter,
26
+ AnyProcedure as AnyTRPCProcedure,
26
27
  /**
27
28
  * @deprecated use `AnyTRPCRouter` instead
28
29
  */
29
30
  AnyRouter,
31
+ /**
32
+ * @deprecated use `AnyTRPCProcedure` instead
33
+ */
34
+ AnyProcedure,
30
35
  } from '@trpc/core';
31
-
32
- export const foo = 'bar';