From 4746d0e5bdaba36f35e6da65676af67f550a2019 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Fri, 21 Jun 2024 09:27:52 +0200 Subject: [PATCH] fix(backend): Build vitnode-backend package --- packages/backend/scripts/init.mjs | 3 ++- packages/backend/src/database/database.service.ts | 2 +- .../backend/{ => src}/templates/core/admin/database/index.ts | 0 .../{ => src}/templates/core/admin/database/schema/admins.ts | 0 .../{ => src}/templates/core/admin/database/schema/files.ts | 0 .../{ => src}/templates/core/admin/database/schema/groups.ts | 0 .../templates/core/admin/database/schema/languages.ts | 0 .../templates/core/admin/database/schema/moderators.ts | 0 .../{ => src}/templates/core/admin/database/schema/nav.ts | 0 .../{ => src}/templates/core/admin/database/schema/plugins.ts | 0 .../{ => src}/templates/core/admin/database/schema/sessions.ts | 0 .../{ => src}/templates/core/admin/database/schema/users.ts | 0 packages/backend/tsconfig.json | 2 +- 13 files changed, 4 insertions(+), 3 deletions(-) rename packages/backend/{ => src}/templates/core/admin/database/index.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/admins.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/files.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/groups.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/languages.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/moderators.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/nav.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/plugins.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/sessions.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/users.ts (100%) diff --git a/packages/backend/scripts/init.mjs b/packages/backend/scripts/init.mjs index a3d13180b..a6f0ea783 100755 --- a/packages/backend/scripts/init.mjs +++ b/packages/backend/scripts/init.mjs @@ -17,6 +17,7 @@ const copyDatabaseSchema = corePluginPath => { const currentPathToSchema = path.join( __dirname, "..", + "src", "templates", "core", "admin", @@ -24,7 +25,7 @@ const copyDatabaseSchema = corePluginPath => { ); if (!fs.existsSync(currentPathToSchema)) { throw new Error( - "Database schema not found in 'templates/core/admin/database' directory." + `Database schema not found in 'templates/core/admin/database' directory. "${currentPathToSchema}"` ); } diff --git a/packages/backend/src/database/database.service.ts b/packages/backend/src/database/database.service.ts index 21292cfec..8af9cbfc2 100644 --- a/packages/backend/src/database/database.service.ts +++ b/packages/backend/src/database/database.service.ts @@ -4,7 +4,7 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres"; import { DatabaseModuleArgs } from "./database.module"; import { createClientDatabase } from "./client"; -import coreSchemaDatabase from "@/../templates/core/admin/database"; +import coreSchemaDatabase from "@/templates/core/admin/database"; @Injectable() export class DatabaseService { diff --git a/packages/backend/templates/core/admin/database/index.ts b/packages/backend/src/templates/core/admin/database/index.ts similarity index 100% rename from packages/backend/templates/core/admin/database/index.ts rename to packages/backend/src/templates/core/admin/database/index.ts diff --git a/packages/backend/templates/core/admin/database/schema/admins.ts b/packages/backend/src/templates/core/admin/database/schema/admins.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/admins.ts rename to packages/backend/src/templates/core/admin/database/schema/admins.ts diff --git a/packages/backend/templates/core/admin/database/schema/files.ts b/packages/backend/src/templates/core/admin/database/schema/files.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/files.ts rename to packages/backend/src/templates/core/admin/database/schema/files.ts diff --git a/packages/backend/templates/core/admin/database/schema/groups.ts b/packages/backend/src/templates/core/admin/database/schema/groups.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/groups.ts rename to packages/backend/src/templates/core/admin/database/schema/groups.ts diff --git a/packages/backend/templates/core/admin/database/schema/languages.ts b/packages/backend/src/templates/core/admin/database/schema/languages.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/languages.ts rename to packages/backend/src/templates/core/admin/database/schema/languages.ts diff --git a/packages/backend/templates/core/admin/database/schema/moderators.ts b/packages/backend/src/templates/core/admin/database/schema/moderators.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/moderators.ts rename to packages/backend/src/templates/core/admin/database/schema/moderators.ts diff --git a/packages/backend/templates/core/admin/database/schema/nav.ts b/packages/backend/src/templates/core/admin/database/schema/nav.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/nav.ts rename to packages/backend/src/templates/core/admin/database/schema/nav.ts diff --git a/packages/backend/templates/core/admin/database/schema/plugins.ts b/packages/backend/src/templates/core/admin/database/schema/plugins.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/plugins.ts rename to packages/backend/src/templates/core/admin/database/schema/plugins.ts diff --git a/packages/backend/templates/core/admin/database/schema/sessions.ts b/packages/backend/src/templates/core/admin/database/schema/sessions.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/sessions.ts rename to packages/backend/src/templates/core/admin/database/schema/sessions.ts diff --git a/packages/backend/templates/core/admin/database/schema/users.ts b/packages/backend/src/templates/core/admin/database/schema/users.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/users.ts rename to packages/backend/src/templates/core/admin/database/schema/users.ts diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json index 3de750532..ccf0ad3f9 100644 --- a/packages/backend/tsconfig.json +++ b/packages/backend/tsconfig.json @@ -12,5 +12,5 @@ "@/*": ["./src/*"] } }, - "include": ["src/**/*", "scripts"] + "include": ["src/**/*"] }