@rg-dev/stdlib 1.0.47 → 1.0.49
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.
- package/lib/common-env.cjs +1 -1
- package/lib/common-env.js +1 -1
- package/lib/trpc-helpers.d.cts +3 -31
- package/lib/trpc-helpers.d.ts +3 -31
- package/lib/trpc-helpers.js +1 -3
- package/package.json +8 -5
package/lib/common-env.cjs
CHANGED
|
@@ -210,7 +210,7 @@ function doSafe(safe, onError) {
|
|
|
210
210
|
try {
|
|
211
211
|
const result = safe();
|
|
212
212
|
if (isPromise(result)) {
|
|
213
|
-
(_a = result["catch"]) == null ? void 0 : _a.call(
|
|
213
|
+
(_a = result == null ? void 0 : result["catch"]) == null ? void 0 : _a.call(
|
|
214
214
|
result,
|
|
215
215
|
(error) => {
|
|
216
216
|
if (error instanceof Error) {
|
package/lib/common-env.js
CHANGED
|
@@ -175,7 +175,7 @@ function doSafe(safe, onError) {
|
|
|
175
175
|
try {
|
|
176
176
|
const result = safe();
|
|
177
177
|
if (isPromise(result)) {
|
|
178
|
-
(_a = result["catch"]) == null ? void 0 : _a.call(
|
|
178
|
+
(_a = result == null ? void 0 : result["catch"]) == null ? void 0 : _a.call(
|
|
179
179
|
result,
|
|
180
180
|
(error) => {
|
|
181
181
|
if (error instanceof Error) {
|
package/lib/trpc-helpers.d.cts
CHANGED
|
@@ -1,39 +1,11 @@
|
|
|
1
|
-
import * as _trpc_server from '@trpc/server';
|
|
2
1
|
import { initTRPC } from '@trpc/server';
|
|
3
|
-
import * as _trpc_server_dist_unstable_core_do_not_import from '@trpc/server/dist/unstable-core-do-not-import';
|
|
4
2
|
import * as trpcExpress from '@trpc/server/adapters/express';
|
|
3
|
+
import { Handler } from 'express';
|
|
5
4
|
|
|
6
5
|
type TrpcExpressRootType = ReturnType<ReturnType<typeof initTRPC.context<trpcExpress.CreateExpressContextOptions>>['create']>;
|
|
7
6
|
declare class TrpcServerHelpers {
|
|
8
|
-
static createExpressTrpcServer():
|
|
9
|
-
|
|
10
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
11
|
-
meta: object;
|
|
12
|
-
errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
|
|
13
|
-
transformer: false;
|
|
14
|
-
}>;
|
|
15
|
-
procedure: _trpc_server_dist_unstable_core_do_not_import.ProcedureBuilder<trpcExpress.CreateExpressContextOptions, object, object, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, false>;
|
|
16
|
-
middleware: <$ContextOverrides>(fn: _trpc_server_dist_unstable_core_do_not_import.MiddlewareFunction<trpcExpress.CreateExpressContextOptions, object, object, $ContextOverrides, unknown>) => _trpc_server_dist_unstable_core_do_not_import.MiddlewareBuilder<trpcExpress.CreateExpressContextOptions, object, $ContextOverrides, unknown>;
|
|
17
|
-
router: <TInput extends _trpc_server_dist_unstable_core_do_not_import.CreateRouterOptions>(input: TInput) => _trpc_server_dist_unstable_core_do_not_import.BuiltRouter<{
|
|
18
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
19
|
-
meta: object;
|
|
20
|
-
errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
|
|
21
|
-
transformer: false;
|
|
22
|
-
}, _trpc_server_dist_unstable_core_do_not_import.DecorateCreateRouterOptions<TInput>>;
|
|
23
|
-
mergeRouters: typeof _trpc_server_dist_unstable_core_do_not_import.mergeRouters;
|
|
24
|
-
createCallerFactory: <TRecord extends _trpc_server.RouterRecord>(router: Pick<_trpc_server_dist_unstable_core_do_not_import.Router<{
|
|
25
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
26
|
-
meta: object;
|
|
27
|
-
errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
|
|
28
|
-
transformer: false;
|
|
29
|
-
}, TRecord>, "_def">) => _trpc_server_dist_unstable_core_do_not_import.RouterCaller<{
|
|
30
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
31
|
-
meta: object;
|
|
32
|
-
errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
|
|
33
|
-
transformer: false;
|
|
34
|
-
}, TRecord>;
|
|
35
|
-
};
|
|
36
|
-
static createTrpcExpressMiddleware(opts: Omit<Parameters<typeof trpcExpress.createExpressMiddleware>[0], 'createContext'>): express.Handler;
|
|
7
|
+
static createExpressTrpcServer(): TrpcExpressRootType;
|
|
8
|
+
static createTrpcExpressMiddleware(opts: Omit<Parameters<typeof trpcExpress.createExpressMiddleware>[0], 'createContext'>): Handler;
|
|
37
9
|
}
|
|
38
10
|
|
|
39
11
|
export { type TrpcExpressRootType, TrpcServerHelpers };
|
package/lib/trpc-helpers.d.ts
CHANGED
|
@@ -1,39 +1,11 @@
|
|
|
1
|
-
import * as _trpc_server from '@trpc/server';
|
|
2
1
|
import { initTRPC } from '@trpc/server';
|
|
3
|
-
import * as _trpc_server_dist_unstable_core_do_not_import from '@trpc/server/dist/unstable-core-do-not-import';
|
|
4
2
|
import * as trpcExpress from '@trpc/server/adapters/express';
|
|
3
|
+
import { Handler } from 'express';
|
|
5
4
|
|
|
6
5
|
type TrpcExpressRootType = ReturnType<ReturnType<typeof initTRPC.context<trpcExpress.CreateExpressContextOptions>>['create']>;
|
|
7
6
|
declare class TrpcServerHelpers {
|
|
8
|
-
static createExpressTrpcServer():
|
|
9
|
-
|
|
10
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
11
|
-
meta: object;
|
|
12
|
-
errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
|
|
13
|
-
transformer: false;
|
|
14
|
-
}>;
|
|
15
|
-
procedure: _trpc_server_dist_unstable_core_do_not_import.ProcedureBuilder<trpcExpress.CreateExpressContextOptions, object, object, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, false>;
|
|
16
|
-
middleware: <$ContextOverrides>(fn: _trpc_server_dist_unstable_core_do_not_import.MiddlewareFunction<trpcExpress.CreateExpressContextOptions, object, object, $ContextOverrides, unknown>) => _trpc_server_dist_unstable_core_do_not_import.MiddlewareBuilder<trpcExpress.CreateExpressContextOptions, object, $ContextOverrides, unknown>;
|
|
17
|
-
router: <TInput extends _trpc_server_dist_unstable_core_do_not_import.CreateRouterOptions>(input: TInput) => _trpc_server_dist_unstable_core_do_not_import.BuiltRouter<{
|
|
18
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
19
|
-
meta: object;
|
|
20
|
-
errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
|
|
21
|
-
transformer: false;
|
|
22
|
-
}, _trpc_server_dist_unstable_core_do_not_import.DecorateCreateRouterOptions<TInput>>;
|
|
23
|
-
mergeRouters: typeof _trpc_server_dist_unstable_core_do_not_import.mergeRouters;
|
|
24
|
-
createCallerFactory: <TRecord extends _trpc_server.RouterRecord>(router: Pick<_trpc_server_dist_unstable_core_do_not_import.Router<{
|
|
25
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
26
|
-
meta: object;
|
|
27
|
-
errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
|
|
28
|
-
transformer: false;
|
|
29
|
-
}, TRecord>, "_def">) => _trpc_server_dist_unstable_core_do_not_import.RouterCaller<{
|
|
30
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
31
|
-
meta: object;
|
|
32
|
-
errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
|
|
33
|
-
transformer: false;
|
|
34
|
-
}, TRecord>;
|
|
35
|
-
};
|
|
36
|
-
static createTrpcExpressMiddleware(opts: Omit<Parameters<typeof trpcExpress.createExpressMiddleware>[0], 'createContext'>): express.Handler;
|
|
7
|
+
static createExpressTrpcServer(): TrpcExpressRootType;
|
|
8
|
+
static createTrpcExpressMiddleware(opts: Omit<Parameters<typeof trpcExpress.createExpressMiddleware>[0], 'createContext'>): Handler;
|
|
37
9
|
}
|
|
38
10
|
|
|
39
11
|
export { type TrpcExpressRootType, TrpcServerHelpers };
|
package/lib/trpc-helpers.js
CHANGED
|
@@ -19,9 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
|
|
21
21
|
// src/trpc-helpers.ts
|
|
22
|
-
import {
|
|
23
|
-
initTRPC
|
|
24
|
-
} from "@trpc/server";
|
|
22
|
+
import { initTRPC } from "@trpc/server";
|
|
25
23
|
import * as trpcExpress from "@trpc/server/adapters/express";
|
|
26
24
|
import superjson from "superjson";
|
|
27
25
|
var TrpcServerHelpers = class {
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rg-dev/stdlib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.49",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
-
"build": "tsup && node after-build.mjs"
|
|
7
|
+
"build": "tsup && node after-build.mjs",
|
|
8
|
+
"ts":"tsdown"
|
|
8
9
|
},
|
|
9
10
|
"author": "",
|
|
10
11
|
"license": "ISC",
|
|
@@ -13,7 +14,7 @@
|
|
|
13
14
|
],
|
|
14
15
|
"typesVersions": {
|
|
15
16
|
"*": {
|
|
16
|
-
|
|
17
|
+
"lib/trpc-helpers": [
|
|
17
18
|
"lib/trpc-helpers.d.ts"
|
|
18
19
|
],
|
|
19
20
|
"lib/common-env": [
|
|
@@ -33,8 +34,8 @@
|
|
|
33
34
|
"types": "./lib/index.d.cts",
|
|
34
35
|
"type": "module",
|
|
35
36
|
"exports": {
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
"./lib/trpc-helpers": {
|
|
38
|
+
"import": "./lib/trpc-helpers.js",
|
|
38
39
|
"require": "./lib/trpc-helpers.cjs",
|
|
39
40
|
"types": "./lib/trpc-helpers.d.ts"
|
|
40
41
|
},
|
|
@@ -65,8 +66,10 @@
|
|
|
65
66
|
"access": "public"
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
69
|
+
"tsdown": "^0.19.0",
|
|
68
70
|
"@trpc/server": "^11.1.1",
|
|
69
71
|
"@types/command-exists": "^1.2.3",
|
|
72
|
+
"@types/express": "^5.0.6",
|
|
70
73
|
"@types/fs-extra": "^11.0.4",
|
|
71
74
|
"@types/node": "^18.19.3",
|
|
72
75
|
"builtin-modules": "^3.3.0",
|