@notchjs/core 0.3.0 → 0.5.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/application.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare class Application {
|
|
|
27
27
|
close(signal?: string): Promise<void>;
|
|
28
28
|
getUrl(): Promise<string>;
|
|
29
29
|
protected shutdownOnSignal(signals?: (NodeJS.Signals | string)[]): void;
|
|
30
|
-
protected listenToSignals(signals:
|
|
30
|
+
protected listenToSignals(signals: NodeJS.Signals[]): void;
|
|
31
31
|
protected unsubscribeFromSignals(): void;
|
|
32
32
|
protected dispose(): Promise<void>;
|
|
33
33
|
private formatAddress;
|
package/dist/application.js
CHANGED
|
@@ -92,7 +92,7 @@ class Application {
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
shutdownOnSignal(signals = []) {
|
|
95
|
-
signals = (0, iterare_1.iterate)(Array.from(new Set(signals)))
|
|
95
|
+
signals = (0, iterare_1.iterate)(Array.from(new Set(['SIGTERM', ...signals])))
|
|
96
96
|
.map((signal) => signal.toString().toUpperCase().trim())
|
|
97
97
|
.filter((signal) => !this.activeSignals.includes(signal))
|
|
98
98
|
.toArray();
|
|
@@ -113,7 +113,7 @@ class Application {
|
|
|
113
113
|
process.kill(process.pid, signal);
|
|
114
114
|
}
|
|
115
115
|
catch (err) {
|
|
116
|
-
this.environment.log?.error(err.stack);
|
|
116
|
+
this.environment.log?.error(`Error during shutdown: ${err.stack}`);
|
|
117
117
|
process.exit(1);
|
|
118
118
|
}
|
|
119
119
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HttpAdapter } from '@notchjs/types';
|
|
2
2
|
export declare class HttpAdapterHost {
|
|
3
3
|
private _httpAdapter;
|
|
4
|
-
constructor(httpAdapter
|
|
5
|
-
get httpAdapter(): HttpAdapter
|
|
4
|
+
constructor(httpAdapter: HttpAdapter);
|
|
5
|
+
get httpAdapter(): HttpAdapter;
|
|
6
6
|
}
|
package/dist/logger-host.d.ts
CHANGED
package/dist/notch.module.js
CHANGED
|
@@ -16,10 +16,13 @@ class NotchModule {
|
|
|
16
16
|
{
|
|
17
17
|
provide: http_adapter_host_1.HttpAdapterHost.name,
|
|
18
18
|
useFactory: (container) => {
|
|
19
|
-
const
|
|
19
|
+
const httpAdapter = container.has(constants_1.HTTP_ADAPTER)
|
|
20
20
|
? container.get(constants_1.HTTP_ADAPTER)
|
|
21
21
|
: undefined;
|
|
22
|
-
|
|
22
|
+
if (!httpAdapter) {
|
|
23
|
+
throw new Error('HTTP adapter not found. Please register a compatible HTTP adapter with the "HTTP_ADAPTER" token.');
|
|
24
|
+
}
|
|
25
|
+
return new http_adapter_host_1.HttpAdapterHost(httpAdapter);
|
|
23
26
|
},
|
|
24
27
|
},
|
|
25
28
|
{
|
|
@@ -55,13 +58,10 @@ class NotchModule {
|
|
|
55
58
|
{
|
|
56
59
|
provide: application_1.Application.name,
|
|
57
60
|
useFactory: (container) => {
|
|
58
|
-
const httpAdapterHost = container.get(http_adapter_host_1.HttpAdapterHost.name);
|
|
59
|
-
if (!httpAdapterHost.httpAdapter) {
|
|
60
|
-
throw new Error('HTTP adapter not found. Please register a compatible HTTP adapter with the "HTTP_ADAPTER" token.');
|
|
61
|
-
}
|
|
62
61
|
const config = container.has('config')
|
|
63
62
|
? container.get('config')
|
|
64
63
|
: {};
|
|
64
|
+
const httpAdapterHost = container.get(http_adapter_host_1.HttpAdapterHost.name);
|
|
65
65
|
const loggerHost = container.get(logger_host_1.LoggerHost.name);
|
|
66
66
|
const hooks = container.get(hook_collector_1.HookCollector.name);
|
|
67
67
|
return new application_1.Application(httpAdapterHost.httpAdapter, hooks, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notchjs/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "A dependency injection based web framework (Node.js)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Augustus Kamau",
|
|
@@ -18,13 +18,14 @@
|
|
|
18
18
|
"test": "jest --detectOpenHandles"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@notchjs/util": "^0.
|
|
21
|
+
"@notchjs/util": "^0.5.0",
|
|
22
22
|
"iterare": "1.2.1",
|
|
23
23
|
"tslib": "2.6.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@notchjs/express": "^0.
|
|
27
|
-
"@notchjs/
|
|
26
|
+
"@notchjs/express": "^0.5.0",
|
|
27
|
+
"@notchjs/http": "^0.5.0",
|
|
28
|
+
"@notchjs/types": "^0.5.0"
|
|
28
29
|
},
|
|
29
30
|
"homepage": "https://github.com/notchjs/notch",
|
|
30
31
|
"bugs": {
|
|
@@ -40,5 +41,5 @@
|
|
|
40
41
|
"publishConfig": {
|
|
41
42
|
"access": "public"
|
|
42
43
|
},
|
|
43
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "8bdbc539ce57bf151fb310794d108d5e42294a66"
|
|
44
45
|
}
|