@midwayjs/mikro 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.
@@ -72,8 +72,9 @@ let MikroConfiguration = class MikroConfiguration {
72
72
  }
73
73
  }
74
74
  };
75
+ exports.MikroConfiguration = MikroConfiguration;
75
76
  __decorate([
76
- (0, core_1.App)(),
77
+ (0, core_1.MainApp)(),
77
78
  __metadata("design:type", Object)
78
79
  ], MikroConfiguration.prototype, "app", void 0);
79
80
  __decorate([
@@ -90,7 +91,7 @@ __decorate([
90
91
  __metadata("design:paramtypes", []),
91
92
  __metadata("design:returntype", Promise)
92
93
  ], MikroConfiguration.prototype, "init", null);
93
- MikroConfiguration = __decorate([
94
+ exports.MikroConfiguration = MikroConfiguration = __decorate([
94
95
  (0, core_1.Configuration)({
95
96
  importConfigs: [
96
97
  {
@@ -102,5 +103,4 @@ MikroConfiguration = __decorate([
102
103
  namespace: 'mikro',
103
104
  })
104
105
  ], MikroConfiguration);
105
- exports.MikroConfiguration = MikroConfiguration;
106
106
  //# sourceMappingURL=configuration.js.map
@@ -20,7 +20,6 @@ let MikroDataSourceManager = class MikroDataSourceManager extends core_1.DataSou
20
20
  return 'mikro';
21
21
  }
22
22
  async createDataSource(config, dataSourceName) {
23
- var _a;
24
23
  if (config.logger && typeof config.logger === 'string') {
25
24
  const logger = this.loggerService.getLogger(config.logger);
26
25
  config.logger = message => {
@@ -31,7 +30,7 @@ let MikroDataSourceManager = class MikroDataSourceManager extends core_1.DataSou
31
30
  if (!config.contextName) {
32
31
  config.contextName = dataSourceName;
33
32
  }
34
- config.registerRequestContext = (_a = config.registerRequestContext) !== null && _a !== void 0 ? _a : false;
33
+ config.registerRequestContext = config.registerRequestContext ?? false;
35
34
  return core_2.MikroORM.init(config);
36
35
  }
37
36
  async checkConnected(dataSource) {
@@ -43,6 +42,7 @@ let MikroDataSourceManager = class MikroDataSourceManager extends core_1.DataSou
43
42
  }
44
43
  }
45
44
  };
45
+ exports.MikroDataSourceManager = MikroDataSourceManager;
46
46
  __decorate([
47
47
  (0, core_1.Config)('mikro'),
48
48
  __metadata("design:type", Object)
@@ -61,9 +61,8 @@ __decorate([
61
61
  __metadata("design:paramtypes", []),
62
62
  __metadata("design:returntype", Promise)
63
63
  ], MikroDataSourceManager.prototype, "init", null);
64
- MikroDataSourceManager = __decorate([
64
+ exports.MikroDataSourceManager = MikroDataSourceManager = __decorate([
65
65
  (0, core_1.Provide)(),
66
66
  (0, core_1.Scope)(core_1.ScopeEnum.Singleton)
67
67
  ], MikroDataSourceManager);
68
- exports.MikroDataSourceManager = MikroDataSourceManager;
69
68
  //# sourceMappingURL=dataSourceManager.js.map
package/dist/decorator.js CHANGED
@@ -6,20 +6,20 @@ exports.ENTITY_MODEL_KEY = 'mikro:entity_model_key';
6
6
  exports.ENTITY_MANAGER_KEY = 'mikro:entity_manager_key';
7
7
  exports.DATA_SOURCE_KEY = 'mikro:data_source_key';
8
8
  function InjectRepository(modelKey, connectionName) {
9
- return (0, core_1.createCustomPropertyDecorator)(exports.ENTITY_MODEL_KEY, {
9
+ return core_1.DecoratorManager.createCustomPropertyDecorator(exports.ENTITY_MODEL_KEY, {
10
10
  modelKey,
11
11
  connectionName,
12
12
  });
13
13
  }
14
14
  exports.InjectRepository = InjectRepository;
15
15
  function InjectEntityManager(connectionName) {
16
- return (0, core_1.createCustomPropertyDecorator)(exports.ENTITY_MANAGER_KEY, {
16
+ return core_1.DecoratorManager.createCustomPropertyDecorator(exports.ENTITY_MANAGER_KEY, {
17
17
  connectionName,
18
18
  });
19
19
  }
20
20
  exports.InjectEntityManager = InjectEntityManager;
21
21
  function InjectDataSource(dataSourceName) {
22
- return (0, core_1.createCustomPropertyDecorator)(exports.DATA_SOURCE_KEY, {
22
+ return core_1.DecoratorManager.createCustomPropertyDecorator(exports.DATA_SOURCE_KEY, {
23
23
  dataSourceName,
24
24
  });
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/mikro",
3
- "version": "3.19.2",
3
+ "version": "4.0.0-alpha.1",
4
4
  "main": "dist/index.js",
5
5
  "typings": "index.d.ts",
6
6
  "files": [
@@ -9,12 +9,12 @@
9
9
  "index.d.ts"
10
10
  ],
11
11
  "devDependencies": {
12
- "@midwayjs/core": "^3.19.0",
13
- "@midwayjs/koa": "^3.19.2",
14
- "@midwayjs/mock": "^3.19.2",
15
- "@mikro-orm/core": "6.4.1",
16
- "@mikro-orm/entity-generator": "6.4.1",
17
- "@mikro-orm/sqlite": "6.4.1"
12
+ "@midwayjs/core": "^4.0.0-alpha.1",
13
+ "@midwayjs/koa": "^4.0.0-alpha.1",
14
+ "@midwayjs/mock": "^4.0.0-alpha.1",
15
+ "@mikro-orm/core": "6.4.0",
16
+ "@mikro-orm/entity-generator": "6.4.0",
17
+ "@mikro-orm/sqlite": "6.4.0"
18
18
  },
19
19
  "author": {
20
20
  "name": "czy88840616",
@@ -26,12 +26,12 @@
26
26
  "license": "MIT",
27
27
  "scripts": {
28
28
  "build": "tsc",
29
- "test": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand",
30
- "cov": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand --coverage --forceExit"
29
+ "test": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand",
30
+ "cov": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand --coverage --forceExit"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",
34
34
  "url": "https://github.com/midwayjs/midway.git"
35
35
  },
36
- "gitHead": "57fd034be94897fb819b0d9ef776de0b9923ab0f"
36
+ "gitHead": "14bb4da91805a1cf52f190c0d37a74b395dd6372"
37
37
  }