@midwayjs/info 3.19.0 → 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.
@@ -22,11 +22,12 @@ let InfoConfiguration = class InfoConfiguration {
22
22
  });
23
23
  }
24
24
  };
25
+ exports.InfoConfiguration = InfoConfiguration;
25
26
  __decorate([
26
27
  (0, core_1.Inject)(),
27
28
  __metadata("design:type", core_1.MidwayApplicationManager)
28
29
  ], InfoConfiguration.prototype, "applicationManager", void 0);
29
- InfoConfiguration = __decorate([
30
+ exports.InfoConfiguration = InfoConfiguration = __decorate([
30
31
  (0, core_1.Configuration)({
31
32
  namespace: 'info',
32
33
  importConfigs: [
@@ -36,5 +37,4 @@ InfoConfiguration = __decorate([
36
37
  ],
37
38
  })
38
39
  ], InfoConfiguration);
39
- exports.InfoConfiguration = InfoConfiguration;
40
40
  //# sourceMappingURL=configuration.js.map
@@ -182,13 +182,12 @@ let InfoService = class InfoService {
182
182
  };
183
183
  }
184
184
  midwayService() {
185
- var _a;
186
185
  const info = {};
187
- if ((_a = this.container) === null || _a === void 0 ? void 0 : _a.registry) {
186
+ if (this.container?.registry) {
188
187
  for (const item of this.container.registry) {
189
188
  const [key, value] = item;
190
- const name = value ? (value === null || value === void 0 ? void 0 : value.name) || value : typeof value;
191
- info[key] = `${(value === null || value === void 0 ? void 0 : value.namespace) ? `${value === null || value === void 0 ? void 0 : value.namespace}:` : ''}${name}${(value === null || value === void 0 ? void 0 : value.scope) ? ` [${value === null || value === void 0 ? void 0 : value.scope}]` : ''}`;
189
+ const name = value ? value?.name || value : typeof value;
190
+ info[key] = `${value?.namespace ? `${value?.namespace}:` : ''}${name}${value?.scope ? ` [${value?.scope}]` : ''}`;
192
191
  }
193
192
  }
194
193
  return {
@@ -253,6 +252,7 @@ let InfoService = class InfoService {
253
252
  return '';
254
253
  }
255
254
  };
255
+ exports.InfoService = InfoService;
256
256
  __decorate([
257
257
  (0, core_1.Inject)(),
258
258
  __metadata("design:type", core_2.MidwayInformationService)
@@ -283,9 +283,8 @@ __decorate([
283
283
  __metadata("design:paramtypes", []),
284
284
  __metadata("design:returntype", Promise)
285
285
  ], InfoService.prototype, "init", null);
286
- InfoService = __decorate([
286
+ exports.InfoService = InfoService = __decorate([
287
287
  (0, core_1.Provide)(),
288
288
  (0, core_1.Scope)(core_1.ScopeEnum.Singleton)
289
289
  ], InfoService);
290
- exports.InfoService = InfoService;
291
290
  //# sourceMappingURL=infoService.js.map
@@ -14,7 +14,7 @@ const core_1 = require("@midwayjs/core");
14
14
  const infoService_1 = require("../infoService");
15
15
  let InfoMiddleware = class InfoMiddleware {
16
16
  resolve(app) {
17
- if (app.getFrameworkType() === core_1.MidwayFrameworkType.WEB_EXPRESS) {
17
+ if ('express' === app.getNamespace()) {
18
18
  return async (req, res, next) => {
19
19
  if (req.path === this.infoPath) {
20
20
  // return html
@@ -40,6 +40,7 @@ let InfoMiddleware = class InfoMiddleware {
40
40
  return 'info';
41
41
  }
42
42
  };
43
+ exports.InfoMiddleware = InfoMiddleware;
43
44
  __decorate([
44
45
  (0, core_1.Config)('info.infoPath'),
45
46
  __metadata("design:type", Object)
@@ -48,8 +49,7 @@ __decorate([
48
49
  (0, core_1.Inject)(),
49
50
  __metadata("design:type", infoService_1.InfoService)
50
51
  ], InfoMiddleware.prototype, "infoService", void 0);
51
- InfoMiddleware = __decorate([
52
+ exports.InfoMiddleware = InfoMiddleware = __decorate([
52
53
  (0, core_1.Middleware)()
53
54
  ], InfoMiddleware);
54
- exports.InfoMiddleware = InfoMiddleware;
55
55
  //# sourceMappingURL=info.middleware.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midwayjs/info",
3
3
  "description": "midway info",
4
- "version": "3.19.0",
4
+ "version": "4.0.0-alpha.1",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
7
7
  "files": [
@@ -13,12 +13,10 @@
13
13
  "picomatch": "2.3.1"
14
14
  },
15
15
  "devDependencies": {
16
- "@midwayjs/core": "^3.19.0",
17
- "@midwayjs/express": "^3.19.0",
18
- "@midwayjs/koa": "^3.19.0",
19
- "@midwayjs/mock": "^3.19.0",
20
- "@midwayjs/serverless-fc-starter": "^3.19.0",
21
- "@midwayjs/serverless-scf-starter": "^3.14.0"
16
+ "@midwayjs/core": "^4.0.0-alpha.1",
17
+ "@midwayjs/express": "^4.0.0-alpha.1",
18
+ "@midwayjs/koa": "^4.0.0-alpha.1",
19
+ "@midwayjs/mock": "^4.0.0-alpha.1"
22
20
  },
23
21
  "keywords": [
24
22
  "midway"
@@ -27,8 +25,8 @@
27
25
  "license": "MIT",
28
26
  "scripts": {
29
27
  "build": "tsc",
30
- "test": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand",
31
- "cov": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand --coverage --forceExit",
28
+ "test": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand",
29
+ "cov": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand --coverage --forceExit",
32
30
  "ci": "npm run test",
33
31
  "lint": "mwts check"
34
32
  },
@@ -39,5 +37,5 @@
39
37
  "type": "git",
40
38
  "url": "https://github.com/midwayjs/midway.git"
41
39
  },
42
- "gitHead": "437e92d9375b0e375f83aa363f3e6a60187c7109"
40
+ "gitHead": "14bb4da91805a1cf52f190c0d37a74b395dd6372"
43
41
  }