@midwayjs/process-agent 3.19.2 → 4.0.0-alpha.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/dist/configuration.js
CHANGED
|
@@ -19,7 +19,7 @@ const http = require("http");
|
|
|
19
19
|
const qs = require("querystring");
|
|
20
20
|
let ProcessAgentConfiguration = class ProcessAgentConfiguration {
|
|
21
21
|
async onReady() {
|
|
22
|
-
const modules =
|
|
22
|
+
const modules = core_1.DecoratorManager.listModule('primary:primary');
|
|
23
23
|
const handlers = {};
|
|
24
24
|
let sockFile = path.join(os.tmpdir(), 'midway-primary.sock');
|
|
25
25
|
if (process.platform === 'win32') {
|
|
@@ -53,7 +53,7 @@ let ProcessAgentConfiguration = class ProcessAgentConfiguration {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
for (const module of modules) {
|
|
56
|
-
const rules =
|
|
56
|
+
const rules = core_1.MetadataManager.getOwnMetadata('primary:primary:options', module);
|
|
57
57
|
for (const rule of rules) {
|
|
58
58
|
if ((0, utils_1.isPrimary)()) {
|
|
59
59
|
handlers[rule.name] = async (...args) => {
|
|
@@ -73,14 +73,14 @@ let ProcessAgentConfiguration = class ProcessAgentConfiguration {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
+
exports.ProcessAgentConfiguration = ProcessAgentConfiguration;
|
|
76
77
|
__decorate([
|
|
77
|
-
(0, core_1.
|
|
78
|
+
(0, core_1.MainApp)(),
|
|
78
79
|
__metadata("design:type", Object)
|
|
79
80
|
], ProcessAgentConfiguration.prototype, "app", void 0);
|
|
80
|
-
ProcessAgentConfiguration = __decorate([
|
|
81
|
+
exports.ProcessAgentConfiguration = ProcessAgentConfiguration = __decorate([
|
|
81
82
|
(0, core_1.Configuration)({
|
|
82
83
|
namespace: 'process-agent',
|
|
83
84
|
})
|
|
84
85
|
], ProcessAgentConfiguration);
|
|
85
|
-
exports.ProcessAgentConfiguration = ProcessAgentConfiguration;
|
|
86
86
|
//# sourceMappingURL=configuration.js.map
|
|
@@ -9,7 +9,7 @@ const utils_1 = require("../utils/utils");
|
|
|
9
9
|
const qs = require("querystring");
|
|
10
10
|
function RunInPrimary() {
|
|
11
11
|
return function (target, propertyKey, descriptor) {
|
|
12
|
-
|
|
12
|
+
core_1.DecoratorManager.saveModule('primary:primary', target.constructor);
|
|
13
13
|
const sockFile = path.join(os.tmpdir(), 'midway-primary.sock');
|
|
14
14
|
if (!(0, utils_1.isPrimary)()) {
|
|
15
15
|
descriptor.value = (...args) => {
|
|
@@ -39,7 +39,7 @@ function RunInPrimary() {
|
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
core_1.MetadataManager.attachMetadata('primary:primary:options', {
|
|
43
43
|
name: `${target.constructor.name}_${propertyKey}`,
|
|
44
44
|
value: descriptor.value,
|
|
45
45
|
}, target.constructor);
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/process-agent",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
|
-
"test": "node
|
|
10
|
-
"cov": "node
|
|
9
|
+
"test": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand",
|
|
10
|
+
"cov": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand --coverage --forceExit"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [
|
|
13
13
|
"midway",
|
|
@@ -25,12 +25,13 @@
|
|
|
25
25
|
},
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@midwayjs/core": "^
|
|
29
|
-
"@midwayjs/koa": "^
|
|
30
|
-
"@midwayjs/mock": "^
|
|
28
|
+
"@midwayjs/core": "^4.0.0-alpha.1",
|
|
29
|
+
"@midwayjs/koa": "^4.0.0-alpha.1",
|
|
30
|
+
"@midwayjs/mock": "^4.0.0-alpha.1",
|
|
31
|
+
"koa-bodyparser": "4.4.1"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
34
|
"request": "2.88.2"
|
|
34
35
|
},
|
|
35
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "14bb4da91805a1cf52f190c0d37a74b395dd6372"
|
|
36
37
|
}
|