@midwayjs/mock 3.15.6 → 3.16.0

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/creator.d.ts CHANGED
@@ -18,9 +18,9 @@ export declare function createFunctionApp<T extends IMidwayFramework<any, any, a
18
18
  } | ComponentModule): Promise<Y>;
19
19
  /**
20
20
  * Create a real project but not ready or a virtual project
21
- * @param baseDir
21
+ * @param baseDirOrOptions
22
22
  * @param options
23
23
  */
24
- export declare function createLightApp(baseDir?: string, options?: MockAppConfigurationOptions): Promise<IMidwayApplication>;
24
+ export declare function createLightApp(baseDirOrOptions: string | MockAppConfigurationOptions, options?: MockAppConfigurationOptions): Promise<IMidwayApplication>;
25
25
  export declare function createBootstrap(entryFile: string, options?: MockBootstrapOptions): Promise<IBootstrapAppStarter>;
26
26
  //# sourceMappingURL=creator.d.ts.map
package/dist/creator.js CHANGED
@@ -473,11 +473,15 @@ class BootstrapAppStarter {
473
473
  }
474
474
  /**
475
475
  * Create a real project but not ready or a virtual project
476
- * @param baseDir
476
+ * @param baseDirOrOptions
477
477
  * @param options
478
478
  */
479
- async function createLightApp(baseDir = '', options = {}) {
479
+ async function createLightApp(baseDirOrOptions, options = {}) {
480
480
  var _a;
481
+ if (baseDirOrOptions && typeof baseDirOrOptions === 'object') {
482
+ options = baseDirOrOptions;
483
+ baseDirOrOptions = options.baseDir || '';
484
+ }
481
485
  (0, core_1.Framework)()(LightFramework);
482
486
  options.globalConfig = Object.assign({
483
487
  midwayLogger: {
@@ -495,7 +499,7 @@ async function createLightApp(baseDir = '', options = {}) {
495
499
  });
496
500
  options.moduleLoadType = (pkgJSON === null || pkgJSON === void 0 ? void 0 : pkgJSON.type) === 'module' ? 'esm' : 'commonjs';
497
501
  }
498
- return createApp(baseDir, {
502
+ return createApp(baseDirOrOptions, {
499
503
  ...options,
500
504
  imports: [
501
505
  await (0, utils_1.transformFrameworkToConfiguration)(LightFramework, options.moduleLoadType),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/mock",
3
- "version": "3.15.6",
3
+ "version": "3.16.0",
4
4
  "description": "create your test app from midway framework",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -29,17 +29,17 @@
29
29
  },
30
30
  "license": "MIT",
31
31
  "devDependencies": {
32
- "@midwayjs/core": "^3.15.6",
32
+ "@midwayjs/core": "^3.16.0",
33
33
  "@midwayjs/logger": "^3.0.0",
34
34
  "@types/amqplib": "0.10.5",
35
- "amqplib": "0.10.3",
35
+ "amqplib": "0.10.4",
36
36
  "kafkajs": "2.2.4",
37
- "socket.io": "4.7.4",
38
- "socket.io-client": "4.7.4",
39
- "ws": "8.16.0"
37
+ "socket.io": "4.7.5",
38
+ "socket.io-client": "4.7.5",
39
+ "ws": "8.17.0"
40
40
  },
41
41
  "dependencies": {
42
- "@midwayjs/async-hooks-context-manager": "^3.15.6",
42
+ "@midwayjs/async-hooks-context-manager": "^3.16.0",
43
43
  "@types/superagent": "4.1.14",
44
44
  "@types/supertest": "2.0.16",
45
45
  "js-yaml": "4.1.0",
@@ -51,5 +51,5 @@
51
51
  "type": "git",
52
52
  "url": "https://github.com/midwayjs/midway.git"
53
53
  },
54
- "gitHead": "b04e58d015b8f4ffb48c98ad72180d88c70011e5"
54
+ "gitHead": "7e75fe1bdc9a6df2956f9c22e704063aaa022d76"
55
55
  }