From 390cffbf3c4406ed154fa346855ba038dbd74c10 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Tue, 13 Feb 2024 17:51:34 +0100 Subject: [PATCH] Update the deps to reap benefits from the patches --- package-lock.json | 16 ++++++++-------- package.json | 4 ++-- src/back/index.ts | 20 +++++++++++--------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index b5c6e84..ce89218 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@koa/router": "^12.0.1", "@playwright/test": "^1.36.1", "@sealcode/jdd": "^0.2.16", - "@sealcode/sealgen": "^0.12.9", + "@sealcode/sealgen": "^0.12.10", "@sealcode/ts-predicates": "^0.4.3", "@types/kill-port": "^2.0.0", "get-port": "^7.0.0", @@ -26,7 +26,7 @@ "object-path": "^0.11.8", "sealious": "^0.17.48", "stimulus": "^2.0.0", - "tempstream": "^0.3.5", + "tempstream": "^0.3.7", "vitest": "^1.1.0" }, "devDependencies": { @@ -1302,9 +1302,9 @@ } }, "node_modules/@sealcode/sealgen": { - "version": "0.12.9", - "resolved": "https://registry.npmjs.org/@sealcode/sealgen/-/sealgen-0.12.9.tgz", - "integrity": "sha512-cW3AptUq/QE3RoqpsQ3Zy9vxy4ppJ99KgzPJ3TtotACLaCqDi8LBr7MDpTzqVVExlx9AgOFhF45IaWD6qQvs7g==", + "version": "0.12.10", + "resolved": "https://registry.npmjs.org/@sealcode/sealgen/-/sealgen-0.12.10.tgz", + "integrity": "sha512-xKr35a10YnQfTJrd/Kr/LQBB5bj+HzxGv+EvLSNZCgN6w0WKRb3UQmK0hpNp1OpmisG96QCBN+NFRUriVG8Auw==", "dependencies": { "@koa/router": "^12.0.1", "@sealcode/ts-predicates": "^0.4.3", @@ -10162,9 +10162,9 @@ } }, "node_modules/tempstream": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/tempstream/-/tempstream-0.3.5.tgz", - "integrity": "sha512-qFj9fh48fSllY+FZJWIwLAV9nmP6KVKG3A4cHHlhNzHJ82aCamroc2cKkE/2VHlaj5QeKoKisQbJVJPbk5aEug==", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/tempstream/-/tempstream-0.3.7.tgz", + "integrity": "sha512-YCnVG5xhu43mtGFyWk4pO9RJniZjc3U44oSrAiDCWiW+/YNmcT0k7rMhtv1Q09BhKuQzPv8YRVjuoz2LW23jnA==", "dependencies": { "classnames": "^2.5.1" } diff --git a/package.json b/package.json index 0c72190..4d27ee8 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@koa/router": "^12.0.1", "@playwright/test": "^1.36.1", "@sealcode/jdd": "^0.2.16", - "@sealcode/sealgen": "^0.12.9", + "@sealcode/sealgen": "^0.12.10", "@sealcode/ts-predicates": "^0.4.3", "@types/kill-port": "^2.0.0", "get-port": "^7.0.0", @@ -47,7 +47,7 @@ "object-path": "^0.11.8", "sealious": "^0.17.48", "stimulus": "^2.0.0", - "tempstream": "^0.3.5", + "tempstream": "^0.3.7", "vitest": "^1.1.0" }, "devDependencies": { diff --git a/src/back/index.ts b/src/back/index.ts index 9099446..ea1509c 100644 --- a/src/back/index.ts +++ b/src/back/index.ts @@ -1,28 +1,30 @@ import kill from "kill-port"; import _locreq from "locreq"; import TheApp from "./app.js"; -import { SEALIOUS_SANITY } from "./config.js"; +import { PORT, SEALIOUS_SANITY } from "./config.js"; import { mainRouter } from "./routes/index.js"; import { module_dirname } from "./util.js"; const locreq = _locreq(module_dirname(import.meta.url)); const app = new TheApp(); -kill(app.config["www-server"].port) - .then(() => app.start()) - .then(async () => { +(async function () { + await kill(PORT); + await kill(PORT); + + try { + app.HTTPServer.addStaticRoute("/", locreq.resolve("public")); + await app.start(); if (SEALIOUS_SANITY) { console.error("Exiting with error code 0"); process.exit(0); } mainRouter(app.HTTPServer.router); - }) - .catch((error) => { + } catch (error) { console.error(error); if (SEALIOUS_SANITY) { console.error("EXITING WITH STATUS 1"); process.exit(1); } - }); - -app.HTTPServer.addStaticRoute("/", locreq.resolve("public")); + } +})();