@tsed/cli 7.0.0-beta.14 → 7.0.0-beta.16
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/lib/esm/commands/init/InitCmd.js +2 -1
- package/lib/esm/templates/index.template.js +13 -23
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/commands/index.d.ts +4 -0
- package/lib/types/commands/init/InitCmd.d.ts +1 -4
- package/lib/types/commands/init/InitOptionsCmd.d.ts +2 -0
- package/lib/types/commands/mcp/McpCommand.d.ts +2 -0
- package/package.json +6 -6
|
@@ -166,6 +166,7 @@ export class InitCmd {
|
|
|
166
166
|
}
|
|
167
167
|
$afterPostInstall() {
|
|
168
168
|
return [
|
|
169
|
+
this.packageManagers.task("Check installed dependencies"),
|
|
169
170
|
{
|
|
170
171
|
title: "Generate barrels files",
|
|
171
172
|
task: () => {
|
|
@@ -275,7 +276,7 @@ export class InitCmd {
|
|
|
275
276
|
"index",
|
|
276
277
|
"index.config.util",
|
|
277
278
|
"index.logger",
|
|
278
|
-
|
|
279
|
+
"index.controller",
|
|
279
280
|
ctx.commands && "index.command",
|
|
280
281
|
"barrels",
|
|
281
282
|
"readme",
|
|
@@ -11,35 +11,25 @@ export default defineTemplate({
|
|
|
11
11
|
return `import {$log} from "@tsed/logger";
|
|
12
12
|
import {PlatformBuilder} from "@tsed/platform-http";
|
|
13
13
|
|
|
14
|
-
const SIG_EVENTS = [
|
|
15
|
-
"beforeExit",
|
|
16
|
-
"SIGHUP",
|
|
17
|
-
"SIGINT",
|
|
18
|
-
"SIGQUIT",
|
|
19
|
-
"SIGILL",
|
|
20
|
-
"SIGTRAP",
|
|
21
|
-
"SIGABRT",
|
|
22
|
-
"SIGBUS",
|
|
23
|
-
"SIGFPE",
|
|
24
|
-
"SIGUSR1",
|
|
25
|
-
"SIGSEGV",
|
|
26
|
-
"SIGUSR2",
|
|
27
|
-
"SIGTERM"
|
|
28
|
-
];
|
|
29
|
-
|
|
30
14
|
try {
|
|
31
15
|
const platform = await PlatformBuilder.bootstrap(Server);
|
|
32
16
|
|
|
33
17
|
await platform.listen();
|
|
34
18
|
|
|
35
|
-
|
|
19
|
+
const close = () => {
|
|
20
|
+
$log.warn('Stop server gracefully...');
|
|
21
|
+
|
|
22
|
+
platform
|
|
23
|
+
.stop()
|
|
24
|
+
.then(() => process.exit(0))
|
|
25
|
+
.catch((error) => {
|
|
26
|
+
console.error(error);
|
|
27
|
+
process.exit(-1);
|
|
28
|
+
});
|
|
29
|
+
};
|
|
36
30
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
$log.error({event: "SERVER_" + evt.toUpperCase(), message: error.message, stack: error.stack});
|
|
40
|
-
await platform.stop();
|
|
41
|
-
})
|
|
42
|
-
);
|
|
31
|
+
process.on('SIGINT', close);
|
|
32
|
+
process.on('SIGTERM', close);
|
|
43
33
|
} catch (error) {
|
|
44
34
|
$log.error({event: "SERVER_BOOTSTRAP_ERROR", message: error.message, stack: error.stack});
|
|
45
35
|
}
|