mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-09 23:48:36 +01:00
Services rewrite
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
"scripts": {
|
||||
"dev": "node scripts/start_dev.js",
|
||||
"compile": "tsc",
|
||||
"build": "ts-node scripts/build.ts",
|
||||
"build": "node ../scripts/build.js",
|
||||
"build_all": "npm run compile && npm run build",
|
||||
"docker-build": "docker build -t litlyx-producer -f Dockerfile ../",
|
||||
"docker-inspect": "docker run -it litlyx-producer sh"
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
|
||||
import fs from 'fs';
|
||||
import { globSync } from 'glob';
|
||||
const tsconfigContent = fs.readFileSync('tsconfig.json', 'utf8');
|
||||
const tsconfigObject = JSON.parse(tsconfigContent);
|
||||
const paths = tsconfigObject.compilerOptions.paths;
|
||||
const filesList = globSync('dist/**/*.js');
|
||||
filesList.forEach(file => {
|
||||
let raw = fs.readFileSync(file, 'utf8');
|
||||
for (const path in paths) {
|
||||
const deep = (file.match(/\\|\//g) || []).length;
|
||||
const pathText = path.replace('*', '');
|
||||
const toReplaceText = new RegExp(`"${pathText}(.*?)"`, 'g');
|
||||
raw = raw.replace(toReplaceText, `"${new Array(deep - 2).fill('../').join('')}${paths[path][0].replace('*', '')}${'$1'}"`);
|
||||
}
|
||||
fs.writeFileSync(file, raw);
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Router, json } from "express";
|
||||
import { createSessionHash, getIPFromRequest } from "./utils";
|
||||
import { requireEnv } from "../../shared/utilts/requireEnv";
|
||||
import { requireEnv } from "@utils/requireEnv";
|
||||
import { RedisStreamService } from "@services/RedisStreamService";
|
||||
|
||||
const router = Router();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { requireEnv } from "../../shared/utilts/requireEnv";
|
||||
import { requireEnv } from "@utils/requireEnv";
|
||||
import { RedisStreamService } from "@services/RedisStreamService";
|
||||
|
||||
import express from 'express';
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
],
|
||||
"@functions/*": [
|
||||
"../shared/functions/*"
|
||||
],
|
||||
"@utils/*": [
|
||||
"../shared/utils/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user