From 40240f2ab922f4125664165615657d8b4fee95f4 Mon Sep 17 00:00:00 2001 From: Avior Date: Thu, 4 Nov 2021 11:51:09 +0100 Subject: [PATCH] fix: Fixed DB path (#134) * Fixed path Signed-off-by: Avior * Fixed Builder Signed-off-by: Avior --- server/compiler/utils/setUtil.ts | 2 +- server/compiler/utils/util.ts | 2 +- server/package.json | 2 +- tsconfig.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/compiler/utils/setUtil.ts b/server/compiler/utils/setUtil.ts index 58cb5db36..83858cb92 100644 --- a/server/compiler/utils/setUtil.ts +++ b/server/compiler/utils/setUtil.ts @@ -21,7 +21,7 @@ export async function getSet(name: string, serie = '*'): Promise { if (!setCache[name]) { try { const [path] = await smartGlob(`${DB_PATH}/data/${serie}/${name}.js`) - setCache[name] = (await import('../../' + path)).default + setCache[name] = (await import(`../../${path}`)).default } catch (error) { console.error(error) console.error(`Error trying to import importing (${`db/data/${serie}/${name}.js`})`) diff --git a/server/compiler/utils/util.ts b/server/compiler/utils/util.ts index ba0b1c736..981029862 100644 --- a/server/compiler/utils/util.ts +++ b/server/compiler/utils/util.ts @@ -7,7 +7,7 @@ interface fileCacheInterface { [key: string]: any } -export const DB_PATH = "../../" +export const DB_PATH = "../" const fileCache: fileCacheInterface = {} diff --git a/server/package.json b/server/package.json index 343e7b2ef..3ffe972d7 100644 --- a/server/package.json +++ b/server/package.json @@ -5,7 +5,7 @@ "description": "", "main": "index.js", "scripts": { - "compile": "ts-node compiler/index.ts", + "compile": "ts-node --project ../tsconfig.json compiler/index.ts", "dev": "ts-node-dev -T src/index.ts", "build": "tsc --project tsconfig.json", "start": "node dist/index.js" diff --git a/tsconfig.json b/tsconfig.json index 9e655ad13..e59674ba4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "include": ["data", "interfaces.d.ts"], + "include": ["data", "server/compiler", "interfaces.d.ts"], "compilerOptions": { "target": "es5", "module": "commonjs",