phecda-server 7.0.0-alpha.9 → 7.0.1
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/assets/schema.json +12 -9
- package/bin/cli.mjs +95 -36
- package/dist/{chunk-5RBTN33A.js → chunk-4LLLQOMF.js} +10 -5
- package/dist/{chunk-7ZGYJ5OW.mjs → chunk-AIAO6SV6.mjs} +10 -34
- package/dist/{chunk-V5EYXVJT.js → chunk-DPPDWBYO.js} +53 -25
- package/dist/{chunk-CVPZWDXU.mjs → chunk-E7EAPAGM.mjs} +10 -20
- package/dist/{chunk-ODVWOXVB.mjs → chunk-MKRHYZCL.mjs} +30 -2
- package/dist/{chunk-FXTJ3BJ6.mjs → chunk-NQ55PA2X.mjs} +9 -4
- package/dist/{chunk-FX3LDQII.js → chunk-XKK2SQ7W.js} +60 -70
- package/dist/{chunk-KJUD2BKE.js → chunk-ZWPOWMZP.js} +25 -49
- package/dist/{core-D_cz0tKa.d.ts → core-DbqWh47p.d.mts} +3 -2
- package/dist/{core-BDkhrEyf.d.mts → core-Rq7BhPHE.d.ts} +3 -2
- package/dist/helper.d.mts +3 -5
- package/dist/helper.d.ts +3 -5
- package/dist/helper.js +3 -5
- package/dist/helper.mjs +2 -4
- package/dist/http/elysia/index.d.mts +4 -4
- package/dist/http/elysia/index.d.ts +4 -4
- package/dist/http/elysia/index.js +41 -40
- package/dist/http/elysia/index.mjs +4 -3
- package/dist/http/express/index.d.mts +3 -3
- package/dist/http/express/index.d.ts +3 -3
- package/dist/http/express/index.js +38 -37
- package/dist/http/express/index.mjs +3 -2
- package/dist/http/fastify/index.d.mts +3 -3
- package/dist/http/fastify/index.d.ts +3 -3
- package/dist/http/fastify/index.js +39 -38
- package/dist/http/fastify/index.mjs +4 -3
- package/dist/http/h3/index.d.mts +3 -3
- package/dist/http/h3/index.d.ts +3 -3
- package/dist/http/h3/index.js +39 -38
- package/dist/http/h3/index.mjs +3 -2
- package/dist/http/hono/index.d.mts +3 -3
- package/dist/http/hono/index.d.ts +3 -3
- package/dist/http/hono/index.js +35 -34
- package/dist/http/hono/index.mjs +3 -2
- package/dist/http/hyper-express/index.d.mts +3 -3
- package/dist/http/hyper-express/index.d.ts +3 -3
- package/dist/http/hyper-express/index.js +36 -35
- package/dist/http/hyper-express/index.mjs +3 -2
- package/dist/http/koa/index.d.mts +3 -3
- package/dist/http/koa/index.d.ts +3 -3
- package/dist/http/koa/index.js +38 -37
- package/dist/http/koa/index.mjs +3 -2
- package/dist/index.d.mts +76 -12
- package/dist/index.d.ts +76 -12
- package/dist/index.js +102 -49
- package/dist/index.mjs +66 -13
- package/dist/{meta-BX5jhe4Z.d.mts → meta-BoS1E-Nz.d.mts} +6 -23
- package/dist/{meta-BX5jhe4Z.d.ts → meta-BoS1E-Nz.d.ts} +6 -23
- package/dist/rpc/bullmq/index.d.mts +4 -6
- package/dist/rpc/bullmq/index.d.ts +4 -6
- package/dist/rpc/bullmq/index.js +12 -80
- package/dist/rpc/bullmq/index.mjs +4 -72
- package/dist/rpc/electron/index.d.mts +13 -0
- package/dist/rpc/electron/index.d.ts +13 -0
- package/dist/rpc/electron/index.js +72 -0
- package/dist/rpc/electron/index.mjs +72 -0
- package/dist/rpc/kafka/index.d.mts +4 -9
- package/dist/rpc/kafka/index.d.ts +4 -9
- package/dist/rpc/kafka/index.js +11 -90
- package/dist/rpc/kafka/index.mjs +4 -83
- package/dist/rpc/nats/index.d.mts +4 -6
- package/dist/rpc/nats/index.d.ts +4 -6
- package/dist/rpc/nats/index.js +12 -72
- package/dist/rpc/nats/index.mjs +3 -63
- package/dist/rpc/rabbitmq/index.d.mts +4 -6
- package/dist/rpc/rabbitmq/index.d.ts +4 -6
- package/dist/rpc/rabbitmq/index.js +13 -79
- package/dist/rpc/rabbitmq/index.mjs +4 -70
- package/dist/rpc/redis/index.d.mts +4 -9
- package/dist/rpc/redis/index.d.ts +4 -9
- package/dist/rpc/redis/index.js +11 -78
- package/dist/rpc/redis/index.mjs +4 -71
- package/dist/rpc/web-ext/index.d.mts +2 -0
- package/dist/rpc/web-ext/index.d.ts +2 -0
- package/dist/rpc/web-ext/index.js +1 -0
- package/dist/rpc/web-ext/index.mjs +0 -0
- package/dist/rpc/ws/index.d.mts +14 -0
- package/dist/rpc/ws/index.d.ts +14 -0
- package/dist/rpc/ws/index.js +73 -0
- package/dist/rpc/ws/index.mjs +73 -0
- package/dist/test.d.mts +7 -3
- package/dist/test.d.ts +7 -3
- package/dist/test.js +6 -6
- package/dist/test.mjs +2 -2
- package/dist/types-CInz3bD0.d.ts +14 -0
- package/dist/types-E-rqlg3-.d.mts +14 -0
- package/dist/{types-DKVhyZk_.d.mts → types-SCJZFCYt.d.mts} +1 -1
- package/dist/{types-CMeuFoyd.d.ts → types-xruyYmyu.d.ts} +1 -1
- package/package.json +24 -8
- package/register/export.mjs +30 -0
- package/register/index.mjs +2 -3
- package/register/loader.mjs +83 -90
- package/register/utils.mjs +36 -6
- package/assets/ps.json +0 -24
- package/assets/tsconfig.json +0 -21
- package/dist/types-B-rUM9Fm.d.mts +0 -19
- package/dist/types-MxxtkZXw.d.ts +0 -19
package/register/utils.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { basename } from 'path'
|
|
2
2
|
import { transform } from '@swc-node/core'
|
|
3
|
+
import psExports from './export.mjs'
|
|
3
4
|
const injectInlineSourceMap = ({ code, map }) => {
|
|
4
5
|
if (map) {
|
|
5
6
|
const base64Map = Buffer.from(map, 'utf8').toString('base64')
|
|
@@ -19,6 +20,32 @@ export async function compile(sourcecode, filename) {
|
|
|
19
20
|
emitDecoratorMetadata: true,
|
|
20
21
|
experimentalDecorators: true,
|
|
21
22
|
esModuleInterop: false,
|
|
23
|
+
swc: {
|
|
24
|
+
|
|
25
|
+
jsc: {
|
|
26
|
+
parser: {
|
|
27
|
+
syntax: 'typescript',
|
|
28
|
+
importAttributes: true,
|
|
29
|
+
decorators: true,
|
|
30
|
+
tsx: false,
|
|
31
|
+
dynamicImport: true,
|
|
32
|
+
strictPropertyInitialization: false,
|
|
33
|
+
},
|
|
34
|
+
experimental: {
|
|
35
|
+
keepImportAssertions: true,
|
|
36
|
+
},
|
|
37
|
+
transform: {
|
|
38
|
+
legacyDecorator: true,
|
|
39
|
+
decoratorMetadata: true,
|
|
40
|
+
},
|
|
41
|
+
// parser: {
|
|
42
|
+
// importAttributes: true
|
|
43
|
+
// },
|
|
44
|
+
// experimental: {
|
|
45
|
+
// keepImportAssertions: true
|
|
46
|
+
// }
|
|
47
|
+
},
|
|
48
|
+
},
|
|
22
49
|
})
|
|
23
50
|
|
|
24
51
|
return injectInlineSourceMap({ code, map })
|
|
@@ -26,18 +53,21 @@ export async function compile(sourcecode, filename) {
|
|
|
26
53
|
|
|
27
54
|
export async function genUnImportRet(opts) {
|
|
28
55
|
try {
|
|
29
|
-
const psExports = Object.keys(await import('../dist/index.mjs'))
|
|
30
56
|
const { createUnimport } = await import('unimport')
|
|
31
57
|
return createUnimport({
|
|
32
58
|
...opts,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
59
|
+
|
|
60
|
+
presets: [
|
|
61
|
+
{
|
|
62
|
+
from: 'phecda-server',
|
|
63
|
+
imports: psExports,
|
|
64
|
+
},
|
|
65
|
+
]
|
|
66
|
+
.concat(opts.presets || []),
|
|
38
67
|
})
|
|
39
68
|
}
|
|
40
69
|
catch (e) {
|
|
70
|
+
console.error(e)
|
|
41
71
|
return false
|
|
42
72
|
}
|
|
43
73
|
}
|
package/assets/ps.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://unpkg.com/phecda-server/assets/schema.json",
|
|
3
|
-
"resolve": [
|
|
4
|
-
{
|
|
5
|
-
"source": "controller",
|
|
6
|
-
"importer": "http",
|
|
7
|
-
"path": ".ps/http.js"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"source": "rpc",
|
|
11
|
-
"importer": "client",
|
|
12
|
-
"path": ".ps/rpc.js"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"unimport": {
|
|
16
|
-
"dirs": ["."],
|
|
17
|
-
"dirsScanOptions": {
|
|
18
|
-
"filePatterns": ["*.{service,controller,module,rpc,solo,guard,extension,pipe,filter,addon}.ts"]
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"virtualFile": {},
|
|
22
|
-
"moduleFile": []
|
|
23
|
-
|
|
24
|
-
}
|
package/assets/tsconfig.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "esnext",
|
|
4
|
-
"useDefineForClassFields": false,
|
|
5
|
-
"experimentalDecorators": true,
|
|
6
|
-
"emitDecoratorMetadata": true,
|
|
7
|
-
"module": "esnext",
|
|
8
|
-
"lib": ["esnext", "DOM"],
|
|
9
|
-
"strictPropertyInitialization": false,
|
|
10
|
-
"moduleResolution": "Node",
|
|
11
|
-
"strict": true,
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"esModuleInterop": true,
|
|
14
|
-
"noEmit": true,
|
|
15
|
-
"noUnusedLocals": true,
|
|
16
|
-
"noUnusedParameters": true,
|
|
17
|
-
"noImplicitReturns": true,
|
|
18
|
-
"skipLibCheck": true
|
|
19
|
-
},
|
|
20
|
-
"include": [".","./ps.d.ts"]
|
|
21
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { D as DefaultOptions, B as BaseCtx } from './meta-BX5jhe4Z.mjs';
|
|
2
|
-
|
|
3
|
-
interface RpcServerOptions extends DefaultOptions {
|
|
4
|
-
defaultQueue?: string;
|
|
5
|
-
}
|
|
6
|
-
interface RpcClientOptions {
|
|
7
|
-
key?: string;
|
|
8
|
-
timeout?: number;
|
|
9
|
-
max?: number;
|
|
10
|
-
}
|
|
11
|
-
interface RpcCtx extends BaseCtx {
|
|
12
|
-
args: any[];
|
|
13
|
-
id: string;
|
|
14
|
-
queue: string;
|
|
15
|
-
isEvent?: boolean;
|
|
16
|
-
category: 'rpc';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type { RpcCtx as R, RpcServerOptions as a, RpcClientOptions as b };
|
package/dist/types-MxxtkZXw.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { D as DefaultOptions, B as BaseCtx } from './meta-BX5jhe4Z.js';
|
|
2
|
-
|
|
3
|
-
interface RpcServerOptions extends DefaultOptions {
|
|
4
|
-
defaultQueue?: string;
|
|
5
|
-
}
|
|
6
|
-
interface RpcClientOptions {
|
|
7
|
-
key?: string;
|
|
8
|
-
timeout?: number;
|
|
9
|
-
max?: number;
|
|
10
|
-
}
|
|
11
|
-
interface RpcCtx extends BaseCtx {
|
|
12
|
-
args: any[];
|
|
13
|
-
id: string;
|
|
14
|
-
queue: string;
|
|
15
|
-
isEvent?: boolean;
|
|
16
|
-
category: 'rpc';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type { RpcCtx as R, RpcServerOptions as a, RpcClientOptions as b };
|