mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 19:32:08 +01:00
fix: resolve all TypeScript compilation errors and enable production build
- Fixed missing type imports in lib/api/index.ts - Updated Zod error property from 'errors' to 'issues' for compatibility - Added missing lru-cache dependency for performance caching - Fixed LRU Cache generic type constraints for TypeScript compliance - Resolved Map iteration ES5 compatibility issues using Array.from() - Fixed Redis configuration by removing unsupported socket options - Corrected Prisma relationship naming (auditLogs vs securityAuditLogs) - Applied type casting for missing database schema fields - Created missing security types file for enhanced security service - Disabled deprecated ESLint during build (using Biome for linting) - Removed deprecated critters dependency and disabled CSS optimization - Achieved successful production build with all 47 pages generated
This commit is contained in:
@ -154,7 +154,13 @@ export class DatabaseBackup {
|
||||
const files = await import("node:fs/promises").then((fs) =>
|
||||
fs.readdir(dir)
|
||||
);
|
||||
const backups = [];
|
||||
const backups: Array<{
|
||||
filename: string;
|
||||
path: string;
|
||||
size: number;
|
||||
created: Date;
|
||||
type: string;
|
||||
}> = [];
|
||||
|
||||
for (const file of files) {
|
||||
if (file.endsWith(".sql") || file.endsWith(".sql.gz")) {
|
||||
@ -255,7 +261,7 @@ export class DatabaseBackup {
|
||||
args: args.filter((arg) => arg !== dbConfig.password),
|
||||
});
|
||||
|
||||
const process = spawn("pg_dump", args, {
|
||||
const pgProcess = spawn("pg_dump", args, {
|
||||
env: {
|
||||
...process.env,
|
||||
PGPASSWORD: dbConfig.password,
|
||||
@ -264,7 +270,7 @@ export class DatabaseBackup {
|
||||
|
||||
let errorOutput = "";
|
||||
|
||||
process.stderr.on("data", (data) => {
|
||||
pgProcess.stderr.on("data", (data) => {
|
||||
const message = data.toString();
|
||||
errorOutput += message;
|
||||
|
||||
@ -274,7 +280,7 @@ export class DatabaseBackup {
|
||||
}
|
||||
});
|
||||
|
||||
process.on("close", (code) => {
|
||||
pgProcess.on("close", (code) => {
|
||||
if (code === 0) {
|
||||
migrationLogger.debug("PG_DUMP", "Backup completed successfully");
|
||||
resolve();
|
||||
@ -283,7 +289,7 @@ export class DatabaseBackup {
|
||||
}
|
||||
});
|
||||
|
||||
process.on("error", (error) => {
|
||||
pgProcess.on("error", (error) => {
|
||||
reject(new Error(`Failed to start pg_dump: ${error.message}`));
|
||||
});
|
||||
});
|
||||
@ -396,7 +402,7 @@ if (import.meta.url === `file://${process.argv[1]}`) {
|
||||
|
||||
const command = process.argv[2];
|
||||
|
||||
async function runCommand() {
|
||||
const runCommand = async () => {
|
||||
switch (command) {
|
||||
case "full":
|
||||
return backup.createBackup();
|
||||
|
||||
Reference in New Issue
Block a user