1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | Object.defineProperty(exports, "__esModule", { value: true });
|
7 | exports.ApplicationMetadataBooter = void 0;
|
8 | const tslib_1 = require("tslib");
|
9 | const core_1 = require("@loopback/core");
|
10 | const debug_1 = tslib_1.__importDefault(require("debug"));
|
11 | const path_1 = tslib_1.__importDefault(require("path"));
|
12 | const keys_1 = require("../keys");
|
13 | const debug = (0, debug_1.default)('loopback:boot:booter:application-metadata');
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | let ApplicationMetadataBooter = class ApplicationMetadataBooter {
|
22 | constructor(app, projectRoot) {
|
23 | this.app = app;
|
24 | this.projectRoot = projectRoot;
|
25 | }
|
26 | async configure() {
|
27 | try {
|
28 |
|
29 | const pkg = require(path_1.default.resolve(this.projectRoot, '../package.json'));
|
30 | this.app.setMetadata(pkg);
|
31 | }
|
32 | catch (err) {
|
33 | debug('package.json not found', err);
|
34 | }
|
35 | }
|
36 | };
|
37 | exports.ApplicationMetadataBooter = ApplicationMetadataBooter;
|
38 | exports.ApplicationMetadataBooter = ApplicationMetadataBooter = tslib_1.__decorate([
|
39 | tslib_1.__param(0, (0, core_1.inject)(core_1.CoreBindings.APPLICATION_INSTANCE)),
|
40 | tslib_1.__param(1, (0, core_1.inject)(keys_1.BootBindings.PROJECT_ROOT)),
|
41 | tslib_1.__metadata("design:paramtypes", [core_1.Application, String])
|
42 | ], ApplicationMetadataBooter);
|
43 |
|
\ | No newline at end of file |