@midwayjs/core 3.3.2 → 3.3.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.
@@ -49,6 +49,22 @@ let MidwayFrameworkService = class MidwayFrameworkService {
49
49
  var _a, _b;
50
50
  return new pipelineService_1.MidwayPipelineService((_b = (_a = instance[interface_1.REQUEST_OBJ_CTX_KEY]) === null || _a === void 0 ? void 0 : _a.requestContext) !== null && _b !== void 0 ? _b : this.applicationContext, meta.valves);
51
51
  });
52
+ // register @App decorator handler
53
+ this.decoratorService.registerPropertyHandler(decorator_1.APPLICATION_KEY, (propertyName, mete) => {
54
+ if (mete.type) {
55
+ const framework = this.applicationManager.getApplication(mete.type);
56
+ if (!framework) {
57
+ throw new error_1.MidwayCommonError(`Framework ${mete.type} not Found`);
58
+ }
59
+ return framework;
60
+ }
61
+ else {
62
+ return this.getMainApp();
63
+ }
64
+ });
65
+ this.decoratorService.registerPropertyHandler(decorator_1.PLUGIN_KEY, (key, target) => {
66
+ return this.getMainApp()[key];
67
+ });
52
68
  let frameworks = (0, decorator_1.listModule)(decorator_1.FRAMEWORK_KEY);
53
69
  // filter proto
54
70
  frameworks = filterProtoFramework(frameworks);
@@ -77,22 +93,6 @@ let MidwayFrameworkService = class MidwayFrameworkService {
77
93
  this.applicationManager.addFramework((_a = definition === null || definition === void 0 ? void 0 : definition.namespace) !== null && _a !== void 0 ? _a : frameworkInstance.getFrameworkName(), frameworkInstance);
78
94
  this.globalFrameworkList.push(frameworkInstance);
79
95
  }
80
- // register @App decorator handler
81
- this.decoratorService.registerPropertyHandler(decorator_1.APPLICATION_KEY, (propertyName, mete) => {
82
- if (mete.type) {
83
- const framework = this.applicationManager.getApplication(mete.type);
84
- if (!framework) {
85
- throw new error_1.MidwayCommonError(`Framework ${mete.type} not Found`);
86
- }
87
- return framework;
88
- }
89
- else {
90
- return this.getMainApp();
91
- }
92
- });
93
- this.decoratorService.registerPropertyHandler(decorator_1.PLUGIN_KEY, (key, target) => {
94
- return this.getMainApp()[key];
95
- });
96
96
  const nsSet = this.applicationContext['namespaceSet'];
97
97
  let mainNs;
98
98
  if (nsSet.size > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/core",
3
- "version": "3.3.2",
3
+ "version": "3.3.4",
4
4
  "description": "midway core",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index.d.ts",
@@ -21,12 +21,12 @@
21
21
  ],
22
22
  "license": "MIT",
23
23
  "devDependencies": {
24
- "@midwayjs/decorator": "^3.1.6",
24
+ "@midwayjs/decorator": "^3.3.4",
25
25
  "koa": "2.13.4",
26
26
  "midway-test-component": "*",
27
27
  "mm": "3.2.0",
28
28
  "raw-body": "2.5.1",
29
- "sinon": "13.0.1"
29
+ "sinon": "13.0.2"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@midwayjs/decorator": "*"
@@ -45,5 +45,5 @@
45
45
  "engines": {
46
46
  "node": ">=12"
47
47
  },
48
- "gitHead": "2c7c235421ba904f8943efe31a71f452089d5d53"
48
+ "gitHead": "0c2785a87217f57a184a661c71b1d9562af02242"
49
49
  }