@eggjs/tegg-plugin 3.51.2 → 4.0.0-beta.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/app/extend/application.d.ts +2 -2
- package/app/extend/application.js +22 -24
- package/app/extend/application.unittest.d.ts +2 -2
- package/app/extend/application.unittest.js +7 -8
- package/app/extend/context.d.ts +8 -7
- package/app/extend/context.js +11 -15
- package/app/middleware/tegg_ctx_lifecycle_middleware.d.ts +3 -2
- package/app/middleware/tegg_ctx_lifecycle_middleware.js +4 -10
- package/app.d.ts +5 -5
- package/app.js +28 -25
- package/index.d.ts +3 -0
- package/index.js +4 -0
- package/lib/AppLoadUnit.js +28 -28
- package/lib/AppLoadUnitInstance.js +20 -21
- package/lib/CompatibleUtil.d.ts +2 -2
- package/lib/CompatibleUtil.js +21 -25
- package/lib/ConfigSourceLoadUnitHook.js +7 -11
- package/lib/EggAppLoader.d.ts +3 -2
- package/lib/EggAppLoader.js +47 -49
- package/lib/EggCompatibleObject.d.ts +1 -1
- package/lib/EggCompatibleObject.js +15 -14
- package/lib/EggCompatibleProtoImpl.d.ts +1 -0
- package/lib/EggCompatibleProtoImpl.js +18 -16
- package/lib/EggContextCompatibleHook.d.ts +3 -3
- package/lib/EggContextCompatibleHook.js +13 -16
- package/lib/EggContextHandler.js +9 -12
- package/lib/EggContextImpl.d.ts +2 -2
- package/lib/EggContextImpl.js +12 -14
- package/lib/EggModuleLoader.d.ts +1 -1
- package/lib/EggModuleLoader.js +16 -18
- package/lib/EggQualifierProtoHook.js +18 -21
- package/lib/ModuleConfigLoader.js +30 -37
- package/lib/ModuleHandler.d.ts +1 -1
- package/lib/ModuleHandler.js +20 -25
- package/lib/Utils.js +2 -5
- package/lib/ctx_lifecycle_middleware.d.ts +2 -2
- package/lib/ctx_lifecycle_middleware.js +8 -11
- package/lib/run_in_background.js +10 -14
- package/lib/types.d.ts +43 -0
- package/lib/types.js +2 -0
- package/package.json +38 -29
- package/typings/index.d.ts +1 -79
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"teggConfig"
|
|
7
7
|
]
|
|
8
8
|
},
|
|
9
|
-
"version": "
|
|
9
|
+
"version": "4.0.0-beta.1",
|
|
10
10
|
"description": "module plugin for egg",
|
|
11
11
|
"keywords": [
|
|
12
12
|
"egg",
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"tegg"
|
|
17
17
|
],
|
|
18
18
|
"files": [
|
|
19
|
+
"index.js",
|
|
20
|
+
"index.d.ts",
|
|
19
21
|
"app.js",
|
|
20
22
|
"app.d.ts",
|
|
21
23
|
"lib/**/*.js",
|
|
@@ -24,13 +26,21 @@
|
|
|
24
26
|
"app/**/*.d.ts",
|
|
25
27
|
"typings/*.d.ts"
|
|
26
28
|
],
|
|
27
|
-
"
|
|
29
|
+
"type": "module",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./index.d.ts",
|
|
33
|
+
"default": "./index.js"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
28
37
|
"scripts": {
|
|
29
|
-
"test": "
|
|
38
|
+
"test": "egg-bin test",
|
|
39
|
+
"cov": "egg-bin cov",
|
|
30
40
|
"clean": "tsc -b --clean",
|
|
31
|
-
"tsc": "npm run clean && tsc -p ./tsconfig.json",
|
|
32
|
-
"tsc:pub": "npm run
|
|
33
|
-
"prepublishOnly": "npm run tsc
|
|
41
|
+
"tsc": "npm run clean && tsc -p ./tsconfig.pub.json",
|
|
42
|
+
"tsc:pub": "npm run tsc",
|
|
43
|
+
"prepublishOnly": "npm run tsc"
|
|
34
44
|
},
|
|
35
45
|
"homepage": "https://github.com/eggjs/tegg",
|
|
36
46
|
"bugs": {
|
|
@@ -42,36 +52,35 @@
|
|
|
42
52
|
"directory": "plugin/tegg"
|
|
43
53
|
},
|
|
44
54
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
55
|
+
"node": ">=20.0.0"
|
|
46
56
|
},
|
|
47
57
|
"dependencies": {
|
|
48
|
-
"@eggjs/
|
|
49
|
-
"@eggjs/
|
|
50
|
-
"@eggjs/tegg
|
|
51
|
-
"@eggjs/tegg-
|
|
52
|
-
"@eggjs/tegg-
|
|
53
|
-
"@eggjs/tegg-
|
|
54
|
-
"@eggjs/tegg-
|
|
55
|
-
"@eggjs/tegg-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
+
"@eggjs/core": "^6.4.0",
|
|
59
|
+
"@eggjs/egg-module-common": "^4.0.0-beta.1",
|
|
60
|
+
"@eggjs/tegg": "^4.0.0-beta.1",
|
|
61
|
+
"@eggjs/tegg-background-task": "^4.0.0-beta.1",
|
|
62
|
+
"@eggjs/tegg-common-util": "^4.0.0-beta.1",
|
|
63
|
+
"@eggjs/tegg-dynamic-inject-runtime": "^4.0.0-beta.1",
|
|
64
|
+
"@eggjs/tegg-loader": "^4.0.0-beta.1",
|
|
65
|
+
"@eggjs/tegg-metadata": "^4.0.0-beta.1",
|
|
66
|
+
"@eggjs/tegg-runtime": "^4.0.0-beta.1",
|
|
67
|
+
"extend2": "^4.0.0",
|
|
68
|
+
"sdk-base": "^5.0.1"
|
|
58
69
|
},
|
|
59
70
|
"devDependencies": {
|
|
60
|
-
"@eggjs/
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
64
|
-
"
|
|
71
|
+
"@eggjs/bin": "7",
|
|
72
|
+
"@eggjs/mock": "6",
|
|
73
|
+
"@eggjs/tegg-config": "^4.0.0-beta.1",
|
|
74
|
+
"@eggjs/tracer": "3",
|
|
75
|
+
"@types/mocha": "10",
|
|
76
|
+
"@types/node": "22",
|
|
77
|
+
"egg": "4",
|
|
65
78
|
"egg-logger": "^3.0.1",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"egg-tracer": "^2.0.0",
|
|
69
|
-
"mocha": "^10.2.0",
|
|
70
|
-
"ts-node": "^10.9.1",
|
|
71
|
-
"typescript": "^5.0.4"
|
|
79
|
+
"ts-node": "10",
|
|
80
|
+
"typescript": "5"
|
|
72
81
|
},
|
|
73
82
|
"publishConfig": {
|
|
74
83
|
"access": "public"
|
|
75
84
|
},
|
|
76
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "79a22905272d6de7fe06152231dff65d213d9166"
|
|
77
86
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -1,79 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Context } from 'egg';
|
|
3
|
-
import '@eggjs/tegg-config';
|
|
4
|
-
import { EggPrototypeCreatorFactory } from '@eggjs/tegg-metadata';
|
|
5
|
-
import {
|
|
6
|
-
EggPrototypeFactory,
|
|
7
|
-
LoadUnitLifecycleUtil,
|
|
8
|
-
LoadUnitFactory,
|
|
9
|
-
EggPrototypeLifecycleUtil,
|
|
10
|
-
} from '@eggjs/tegg-metadata';
|
|
11
|
-
import {
|
|
12
|
-
EggContainerFactory,
|
|
13
|
-
LoadUnitInstanceFactory,
|
|
14
|
-
LoadUnitInstanceLifecycleUtil,
|
|
15
|
-
EggContextLifecycleUtil,
|
|
16
|
-
EggObjectLifecycleUtil,
|
|
17
|
-
AbstractEggContext,
|
|
18
|
-
EggObjectFactory,
|
|
19
|
-
EggContext,
|
|
20
|
-
} from '@eggjs/tegg-runtime';
|
|
21
|
-
import { LoaderFactory } from '@eggjs/tegg-loader';
|
|
22
|
-
import { IdenticalUtil, EggProtoImplClass, QualifierInfo } from '@eggjs/tegg';
|
|
23
|
-
import { ModuleHandler } from '../lib/ModuleHandler';
|
|
24
|
-
import { EggContextHandler } from '../lib/EggContextHandler';
|
|
25
|
-
|
|
26
|
-
declare module 'egg' {
|
|
27
|
-
export interface EggModule {
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface EggContextModule {
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface EggApplicationModule {
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface TEggApplication {
|
|
37
|
-
eggPrototypeCreatorFactory: typeof EggPrototypeCreatorFactory;
|
|
38
|
-
eggPrototypeFactory: EggPrototypeFactory;
|
|
39
|
-
eggContainerFactory: typeof EggContainerFactory;
|
|
40
|
-
loadUnitFactory: typeof LoadUnitFactory;
|
|
41
|
-
eggObjectFactory: typeof EggObjectFactory;
|
|
42
|
-
loadUnitInstanceFactory: typeof LoadUnitInstanceFactory;
|
|
43
|
-
abstractEggContext: typeof AbstractEggContext;
|
|
44
|
-
identicalUtil: typeof IdenticalUtil;
|
|
45
|
-
loaderFactory: typeof LoaderFactory;
|
|
46
|
-
|
|
47
|
-
loadUnitLifecycleUtil: typeof LoadUnitLifecycleUtil;
|
|
48
|
-
loadUnitInstanceLifecycleUtil: typeof LoadUnitInstanceLifecycleUtil;
|
|
49
|
-
eggPrototypeLifecycleUtil: typeof EggPrototypeLifecycleUtil;
|
|
50
|
-
eggContextLifecycleUtil: typeof EggContextLifecycleUtil;
|
|
51
|
-
eggObjectLifecycleUtil: typeof EggObjectLifecycleUtil;
|
|
52
|
-
teggContext: EggContext;
|
|
53
|
-
moduleHandler: ModuleHandler;
|
|
54
|
-
eggContextHandler: EggContextHandler;
|
|
55
|
-
|
|
56
|
-
mockModuleContext(data?: any): Promise<Context>;
|
|
57
|
-
mockModuleContextScope<R=any>(fn: (ctx: Context) => Promise<R>, data?: any): Promise<R>;
|
|
58
|
-
destroyModuleContext(context: Context): Promise<void>;
|
|
59
|
-
// 兼容现有 module 的定义
|
|
60
|
-
module: EggModule & EggApplicationModule;
|
|
61
|
-
|
|
62
|
-
getEggObject<T>(clazz: EggProtoImplClass<T>, name?: string, qualifiers?: QualifierInfo | QualifierInfo[]): Promise<T>;
|
|
63
|
-
getEggObjectFromName<T>(name: string, qualifiers?: QualifierInfo | QualifierInfo[]): Promise<unknown>;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface TEggContext {
|
|
67
|
-
beginModuleScope(func: () => Promise<void>): Promise<void>;
|
|
68
|
-
// 兼容现有 module 的定义
|
|
69
|
-
module: EggModule & EggContextModule;
|
|
70
|
-
|
|
71
|
-
getEggObject<T>(clazz: EggProtoImplClass<T>, name?: string, qualifiers?: QualifierInfo | QualifierInfo[]): Promise<T>;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
interface Application extends TEggApplication {
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
interface Context extends TEggContext {
|
|
78
|
-
}
|
|
79
|
-
}
|
|
1
|
+
import 'egg';
|