@midwayjs/mock 3.0.0-beta.1 → 3.0.0-beta.13
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 +107 -0
- package/README.md +1 -1
- package/dist/creator.d.ts +3 -3
- package/dist/creator.js +5 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,113 @@
|
|
|
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.13](https://github.com/midwayjs/midway/compare/v3.0.0-beta.12...v3.0.0-beta.13) (2021-12-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @midwayjs/mock
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.0.0-beta.12](https://github.com/midwayjs/midway/compare/v3.0.0-beta.11...v3.0.0-beta.12) (2021-12-28)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @midwayjs/mock
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.0.0-beta.11](https://github.com/midwayjs/midway/compare/v3.0.0-beta.10...v3.0.0-beta.11) (2021-12-21)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @midwayjs/mock
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# [3.0.0-beta.10](https://github.com/midwayjs/midway/compare/v3.0.0-beta.9...v3.0.0-beta.10) (2021-12-20)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* 3.x upload ([#1422](https://github.com/midwayjs/midway/issues/1422)) ([cbd8e33](https://github.com/midwayjs/midway/commit/cbd8e334a918222f526552859401f0cf222737b6))
|
|
36
|
+
* default add session & bodyparser support for koa/express/faas ([#1420](https://github.com/midwayjs/midway/issues/1420)) ([cdaff31](https://github.com/midwayjs/midway/commit/cdaff317c3e862a95494a167995a28280af639bf))
|
|
37
|
+
* implement i18n for validate ([#1426](https://github.com/midwayjs/midway/issues/1426)) ([4c7ed2f](https://github.com/midwayjs/midway/commit/4c7ed2ff2e7ccf10f88f62abad230f92f5e76b97))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# [3.0.0-beta.9](https://github.com/midwayjs/midway/compare/v3.0.0-beta.8...v3.0.0-beta.9) (2021-12-09)
|
|
44
|
+
|
|
45
|
+
**Note:** Version bump only for package @midwayjs/mock
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# [3.0.0-beta.8](https://github.com/midwayjs/midway/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-12-08)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Bug Fixes
|
|
55
|
+
|
|
56
|
+
* express routing middleware takes effect at the controller level ([#1364](https://github.com/midwayjs/midway/issues/1364)) ([b9272e0](https://github.com/midwayjs/midway/commit/b9272e0971003443304b0c53815be31a0061b4bd))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
|
|
63
|
+
|
|
64
|
+
**Note:** Version bump only for package @midwayjs/mock
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
|
|
71
|
+
|
|
72
|
+
**Note:** Version bump only for package @midwayjs/mock
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
# [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
|
|
79
|
+
|
|
80
|
+
**Note:** Version bump only for package @midwayjs/mock
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Features
|
|
90
|
+
|
|
91
|
+
* add i18n ([#1375](https://github.com/midwayjs/midway/issues/1375)) ([bffefe0](https://github.com/midwayjs/midway/commit/bffefe07afe45777d49b5a76b9ab17fc2b9d9a55))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
# [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
|
|
98
|
+
|
|
99
|
+
**Note:** Version bump only for package @midwayjs/mock
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
|
|
106
|
+
|
|
107
|
+
**Note:** Version bump only for package @midwayjs/mock
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
6
113
|
# [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
|
|
7
114
|
|
|
8
115
|
|
package/README.md
CHANGED
package/dist/creator.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IMidwayApplication, IMidwayFramework } from '@midwayjs/core';
|
|
2
2
|
import { ComponentModule, MockAppConfigurationOptions } from './interface';
|
|
3
|
-
export declare function create<T extends IMidwayFramework<any, U>, U = T['configurationOptions']>(appDir?: string, options?: MockAppConfigurationOptions, customFramework?: {
|
|
3
|
+
export declare function create<T extends IMidwayFramework<any, any, U>, U = T['configurationOptions']>(appDir?: string, options?: MockAppConfigurationOptions, customFramework?: {
|
|
4
4
|
new (...args: any[]): T;
|
|
5
5
|
} | ComponentModule): Promise<T>;
|
|
6
|
-
export declare function createApp<T extends IMidwayFramework<any, U>, U = T['configurationOptions'], Y = ReturnType<T['getApplication']>>(baseDir?: string, options?: U & MockAppConfigurationOptions, customFramework?: {
|
|
6
|
+
export declare function createApp<T extends IMidwayFramework<any, any, U>, U = T['configurationOptions'], Y = ReturnType<T['getApplication']>>(baseDir?: string, options?: U & MockAppConfigurationOptions, customFramework?: {
|
|
7
7
|
new (...args: any[]): T;
|
|
8
8
|
} | ComponentModule): Promise<IMidwayApplication<any, any>>;
|
|
9
9
|
export declare function close(app: IMidwayApplication, options?: {
|
|
@@ -11,7 +11,7 @@ export declare function close(app: IMidwayApplication, options?: {
|
|
|
11
11
|
cleanTempDir?: boolean;
|
|
12
12
|
sleep?: number;
|
|
13
13
|
}): Promise<void>;
|
|
14
|
-
export declare function createFunctionApp<T extends IMidwayFramework<any, U>, U = T['configurationOptions'], Y = ReturnType<T['getApplication']>>(baseDir?: string, options?: MockAppConfigurationOptions, customFrameworkName?: {
|
|
14
|
+
export declare function createFunctionApp<T extends IMidwayFramework<any, any, U>, U = T['configurationOptions'], Y = ReturnType<T['getApplication']>>(baseDir?: string, options?: MockAppConfigurationOptions, customFrameworkName?: {
|
|
15
15
|
new (...args: any[]): T;
|
|
16
16
|
} | ComponentModule): Promise<Y>;
|
|
17
17
|
export declare function createLightApp(baseDir?: string, options?: MockAppConfigurationOptions): Promise<IMidwayApplication>;
|
package/dist/creator.js
CHANGED
|
@@ -8,6 +8,7 @@ const decorator_1 = require("@midwayjs/decorator");
|
|
|
8
8
|
const logger_1 = require("@midwayjs/logger");
|
|
9
9
|
const utils_1 = require("./utils");
|
|
10
10
|
const util_1 = require("util");
|
|
11
|
+
const fs_1 = require("fs");
|
|
11
12
|
const debug = (0, util_1.debuglog)('midway:debug');
|
|
12
13
|
process.setMaxListeners(0);
|
|
13
14
|
async function create(appDir = process.cwd(), options, customFramework) {
|
|
@@ -17,6 +18,9 @@ async function create(appDir = process.cwd(), options, customFramework) {
|
|
|
17
18
|
if (!(0, path_1.isAbsolute)(appDir)) {
|
|
18
19
|
appDir = (0, path_1.join)(process.cwd(), 'test', 'fixtures', appDir);
|
|
19
20
|
}
|
|
21
|
+
if (!(0, fs_1.existsSync)(appDir)) {
|
|
22
|
+
throw new core_1.MidwayCommonError(`Path "${appDir}" not exists, please check it.`);
|
|
23
|
+
}
|
|
20
24
|
(0, logger_1.clearAllLoggers)();
|
|
21
25
|
options = options || {};
|
|
22
26
|
if (options.baseDir) {
|
|
@@ -113,7 +117,7 @@ async function createFunctionApp(baseDir = process.cwd(), options, customFramewo
|
|
|
113
117
|
const framework = await createApp(baseDir, {
|
|
114
118
|
...options,
|
|
115
119
|
configurationModule: (0, utils_1.transformFrameworkToConfiguration)(customFramework),
|
|
116
|
-
});
|
|
120
|
+
}, customFrameworkName);
|
|
117
121
|
framework.configurationOptions = options;
|
|
118
122
|
return framework;
|
|
119
123
|
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare function findFirstExistModule(moduleList: any): string;
|
|
|
6
6
|
* transform a framework component or framework module to configuration class
|
|
7
7
|
* @param Framework
|
|
8
8
|
*/
|
|
9
|
-
export declare function transformFrameworkToConfiguration<T extends IMidwayFramework<any, any>>(Framework: any): {
|
|
9
|
+
export declare function transformFrameworkToConfiguration<T extends IMidwayFramework<any, any, any>>(Framework: any): {
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
Configuration: any;
|
|
12
12
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/mock",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.13",
|
|
4
4
|
"description": "create your test app from midway framework",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
},
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@midwayjs/core": "^3.0.0-beta.
|
|
30
|
-
"@midwayjs/decorator": "^3.0.0-beta.
|
|
31
|
-
"@midwayjs/logger": "^3.0.0-beta.
|
|
29
|
+
"@midwayjs/core": "^3.0.0-beta.13",
|
|
30
|
+
"@midwayjs/decorator": "^3.0.0-beta.13",
|
|
31
|
+
"@midwayjs/logger": "^3.0.0-beta.13",
|
|
32
32
|
"@types/amqplib": "*",
|
|
33
33
|
"amqplib": "*",
|
|
34
34
|
"socket.io": "^4.0.0",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"type": "git",
|
|
45
45
|
"url": "http://github.com/midwayjs/midway.git"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "d3c47770fee9dce33a8d148882173fd7782864ad"
|
|
48
48
|
}
|