@midwayjs/core 3.0.0-beta.8 → 3.0.0-beta.9
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/CHANGELOG.md +11 -0
- package/dist/common/webRouterCollector.js +4 -0
- package/dist/context/container.js +7 -2
- package/dist/interface.d.ts +2 -2
- package/dist/setup.js +6 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.0.0-beta.9](https://github.com/midwayjs/midway/compare/v3.0.0-beta.8...v3.0.0-beta.9) (2021-12-09)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* faas missing config in framework ([#1413](https://github.com/midwayjs/midway/issues/1413)) ([7ab16a2](https://github.com/midwayjs/midway/commit/7ab16a24b29d5254a762bfffcdf18385effdf639))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [3.0.0-beta.8](https://github.com/midwayjs/midway/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-12-08)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -6,6 +6,7 @@ const util_1 = require("../util");
|
|
|
6
6
|
const container_1 = require("../context/container");
|
|
7
7
|
const fileDetector_1 = require("./fileDetector");
|
|
8
8
|
const util = require("util");
|
|
9
|
+
const error_1 = require("../error");
|
|
9
10
|
const debug = util.debuglog('midway:debug');
|
|
10
11
|
class WebRouterCollector {
|
|
11
12
|
constructor(baseDir = '', options = {}) {
|
|
@@ -70,6 +71,9 @@ class WebRouterCollector {
|
|
|
70
71
|
if (controllerIgnoreGlobalPrefix) {
|
|
71
72
|
prefix = ignorePrefix;
|
|
72
73
|
}
|
|
74
|
+
if (/\*/.test(prefix)) {
|
|
75
|
+
throw new error_1.MidwayCommonError(`Router prefix ${prefix} can't set string with *`);
|
|
76
|
+
}
|
|
73
77
|
// set prefix
|
|
74
78
|
if (!this.routes.has(prefix)) {
|
|
75
79
|
this.routes.set(prefix, []);
|
|
@@ -64,8 +64,13 @@ class ContainerConfiguration {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
addImportConfigs(importConfigs) {
|
|
67
|
-
if (importConfigs
|
|
68
|
-
|
|
67
|
+
if (importConfigs) {
|
|
68
|
+
if (Array.isArray(importConfigs)) {
|
|
69
|
+
this.container.get(configService_1.MidwayConfigService).add(importConfigs);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.container.get(configService_1.MidwayConfigService).addObject(importConfigs);
|
|
73
|
+
}
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
76
|
addImports(imports = []) {
|
package/dist/interface.d.ts
CHANGED
|
@@ -400,9 +400,9 @@ export interface IMidwayBootstrapOptions {
|
|
|
400
400
|
moduleDetector?: 'file' | IFileDetector | false;
|
|
401
401
|
logger?: boolean | ILogger;
|
|
402
402
|
ignore?: string[];
|
|
403
|
-
globalConfig?: {
|
|
403
|
+
globalConfig?: Array<{
|
|
404
404
|
[environmentName: string]: Record<string, any>;
|
|
405
|
-
}
|
|
405
|
+
}> | Record<string, any>;
|
|
406
406
|
}
|
|
407
407
|
export interface IConfigurationOptions {
|
|
408
408
|
logger?: ILogger;
|
package/dist/setup.js
CHANGED
|
@@ -75,7 +75,12 @@ async function initializeGlobalApplicationContext(globalOptions) {
|
|
|
75
75
|
// bind user code module
|
|
76
76
|
await applicationContext.ready();
|
|
77
77
|
if (globalOptions.globalConfig) {
|
|
78
|
-
|
|
78
|
+
if (Array.isArray(globalOptions.globalConfig)) {
|
|
79
|
+
configService.add(globalOptions.globalConfig);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
configService.addObject(globalOptions.globalConfig);
|
|
83
|
+
}
|
|
79
84
|
}
|
|
80
85
|
// merge config
|
|
81
86
|
await configService.load();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/core",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.9",
|
|
4
4
|
"description": "midway core",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@midwayjs/decorator": "^3.0.0-beta.
|
|
24
|
+
"@midwayjs/decorator": "^3.0.0-beta.9",
|
|
25
25
|
"koa": "^2.13.4",
|
|
26
26
|
"midway-test-component": "*",
|
|
27
27
|
"mm": "3",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@midwayjs/glob": "^1.0.2",
|
|
35
|
-
"@midwayjs/logger": "^3.0.0-beta.
|
|
35
|
+
"@midwayjs/logger": "^3.0.0-beta.9",
|
|
36
36
|
"class-transformer": "^0.5.1",
|
|
37
37
|
"extend2": "^1.0.0",
|
|
38
38
|
"picomatch": "^2.2.2",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=12"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "d23e4a4fee58097b98461625c428a37d55535cec"
|
|
50
50
|
}
|