Move database to toplevel

This commit is contained in:
Rory&
2026-06-11 19:12:23 +02:00
parent 6992d8dc44
commit f95acfd68a
18 changed files with 67 additions and 38 deletions
+5 -4
View File
@@ -21,13 +21,14 @@ import { Request, Response, Router } from "express";
import morgan from "morgan";
import { Server, ServerOptions } from "lambert-server/Server";
import { red } from "picocolors";
import { Config, ConnectionConfig, ConnectionLoader, Email, JSONReplacer, WebAuthn, initDatabase, initEvent, registerRoutes, getDatabase, getRevInfoOrFail } from "@spacebar/util";
import { Authentication, CORS, ImageProxy, BodyParser, ErrorHandler, initRateLimits, initTranslation } from "./middlewares";
import { initInstance } from "./util/handlers/Instance";
import { route } from "./util";
import { getDatabase, initDatabase } from "@spacebar/database";
import { Config, ConnectionConfig, ConnectionLoader, Email, JSONReplacer, WebAuthn, initEvent, registerRoutes, getRevInfoOrFail } from "@spacebar/util";
import { ProcessLifecycle } from "../util/util/ProcessLifecycle";
import { Monitoring } from "../util/monitoring/Monitoring";
import { BcryptWorkerPool } from "../util/util/workers/bcrypt/BcryptWorkerPool";
import { Authentication, CORS, ImageProxy, BodyParser, ErrorHandler, initRateLimits, initTranslation } from "./middlewares";
import { initInstance } from "./util/handlers/Instance";
import { route } from "./util";
const ASSETS_FOLDER = path.join(__dirname, "..", "..", "assets");
const PUBLIC_ASSETS_FOLDER = path.join(ASSETS_FOLDER, "public");
+1 -1
View File
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { route } from "@spacebar/api";
import { getDatabase } from "@spacebar/util";
import { getDatabase } from "@spacebar/database";
const router = Router({ mergeParams: true });
+1 -1
View File
@@ -18,7 +18,7 @@
import { Router, Response, Request } from "express";
import { route } from "@spacebar/api";
import { getDatabase } from "@spacebar/util";
import { getDatabase } from "@spacebar/database";
const router = Router({ mergeParams: true });
+3 -3
View File
@@ -16,7 +16,10 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { HTTPError } from "lambert-server/HTTPError";
import { Equal, In, Or } from "typeorm";
import { fillMessageUrlEmbeds, randomString } from "@spacebar/api";
import { getDatabase } from "@spacebar/database";
import { mathLogBase, arrayDistributeSequentially } from "@spacebar/extensions";
import {
Application,
@@ -28,7 +31,6 @@ import {
emitEvent,
EVERYONE_MENTION,
FieldErrors,
getDatabase,
getPermission,
getRights,
Guild,
@@ -53,8 +55,6 @@ import {
USER_MENTION,
Webhook,
} from "@spacebar/util";
import { HTTPError } from "lambert-server/HTTPError";
import { Equal, In, Or } from "typeorm";
import {
ActionRowComponent,
BaseMessageComponents,