@rsdk/core 1.0.7 → 1.0.9
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 +8 -0
- package/dist/app/platform.app.d.ts +1 -0
- package/dist/app/platform.app.js +24 -0
- package/dist/app/platform.app.js.map +1 -1
- package/dist/config/parsers/timespan/timespan.parser.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/app/platform.app.ts +32 -0
- package/src/config/parsers/timespan/timespan.parser.ts +1 -6
- package/.eslintignore +0 -4
- package/.eslintrc.js +0 -4
- package/.prettierignore +0 -1
- package/.prettierrc.json +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Nestjs based microservice chassis",
|
|
5
5
|
"license": "Apache License 2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"@nestjs/common": "^9.0.0",
|
|
28
28
|
"@nestjs/core": "^9.0.0",
|
|
29
29
|
"@nestjs/microservices": "^9.0.0",
|
|
30
|
-
"@rsdk/common": "^1.0.
|
|
31
|
-
"@rsdk/decorators": "^1.0.
|
|
32
|
-
"@rsdk/logging": "^1.0.
|
|
30
|
+
"@rsdk/common": "^1.0.9",
|
|
31
|
+
"@rsdk/decorators": "^1.0.9",
|
|
32
|
+
"@rsdk/logging": "^1.0.9",
|
|
33
33
|
"axios": "^1.1.3",
|
|
34
34
|
"lodash": "^4.17.21",
|
|
35
35
|
"reflect-metadata": "^0.1.13",
|
|
36
36
|
"rxjs": "^7.0.0"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "6bb1f85ba05ce2f0b1f724537a78d11eab072942"
|
|
39
39
|
}
|
package/src/app/platform.app.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { INestApplication } from '@nestjs/common/interfaces';
|
|
2
2
|
import { NestFactory } from '@nestjs/core';
|
|
3
|
+
import { text } from '@rsdk/common';
|
|
4
|
+
import { LoggerFactory } from '@rsdk/logging';
|
|
3
5
|
|
|
4
6
|
import { PlatformContext } from '../platform.context';
|
|
5
7
|
import type { PlatformAppMetadata, PlatformAppOptions } from '../types';
|
|
@@ -11,8 +13,38 @@ import type { PlatformAppMetadata, PlatformAppOptions } from '../types';
|
|
|
11
13
|
* ready to go!
|
|
12
14
|
*/
|
|
13
15
|
export class PlatformApp {
|
|
16
|
+
private static logger = LoggerFactory.create(PlatformApp);
|
|
17
|
+
|
|
14
18
|
private readonly context: PlatformContext;
|
|
15
19
|
|
|
20
|
+
static {
|
|
21
|
+
const { logger } = PlatformApp;
|
|
22
|
+
logger.info('Registering unhandled rejections handler...');
|
|
23
|
+
|
|
24
|
+
// This code enriches output if unhandled exceptions happen
|
|
25
|
+
process.on('unhandledRejection', (reason: any, promise) => {
|
|
26
|
+
logger.error(
|
|
27
|
+
text`
|
|
28
|
+
Unhandled promise rejection happened! Process is shutting down
|
|
29
|
+
with exit code 1. See: https://github.com/nodejs/node/issues/20392
|
|
30
|
+
and https://nodejs.org/api/process.html#event-unhandledrejection
|
|
31
|
+
`,
|
|
32
|
+
{ promise, reason },
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Additionally writes to standard console, because both <promise> and <reason>
|
|
37
|
+
* can be not serializable
|
|
38
|
+
*/
|
|
39
|
+
console.error('Found unhandled rejection', {
|
|
40
|
+
promise,
|
|
41
|
+
reason,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
process.exit(1);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
16
48
|
constructor(readonly platformAppOptions: PlatformAppOptions) {
|
|
17
49
|
this.context = new PlatformContext(platformAppOptions);
|
|
18
50
|
}
|
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
package/.prettierignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
**/*.spec.ts
|
package/.prettierrc.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"@rsdk/prettier-config"
|