feat: Integrate Directus CMS, add i18n with next-intl, and configure project tooling with pnpm, husky, and commitlint.**

This commit is contained in:
2026-02-05 01:18:06 +01:00
parent 765cfd4c69
commit e80140f7cf
65 changed files with 12793 additions and 5879 deletions

View File

@@ -0,0 +1,7 @@
export interface LoggerService {
debug(message: string, context?: Record<string, unknown>): void;
info(message: string, context?: Record<string, unknown>): void;
warn(message: string, context?: Record<string, unknown>): void;
error(message: string, context?: Record<string, unknown>): void;
child(context: Record<string, unknown>): LoggerService;
}

View File

@@ -0,0 +1,56 @@
import { pino, type Logger as PinoLogger } from "pino";
import type { LoggerService } from "./logger-service";
import { config } from "../../config";
export class PinoLoggerService implements LoggerService {
private logger: PinoLogger;
constructor(name?: string, parent?: PinoLogger) {
if (parent) {
this.logger = parent.child({ name });
} else {
const useTransport =
config.isDevelopment && typeof window === "undefined";
this.logger = pino({
name: name || "app",
level: config.logging.level,
transport: useTransport
? {
target: "pino-pretty",
options: {
colorize: true,
},
}
: undefined,
});
}
}
debug(message: string, context?: Record<string, unknown>) {
if (context) this.logger.debug(context, message);
else this.logger.debug(message);
}
info(message: string, context?: Record<string, unknown>) {
if (context) this.logger.info(context, message);
else this.logger.info(message);
}
warn(message: string, context?: Record<string, unknown>) {
if (context) this.logger.warn(context, message);
else this.logger.warn(message);
}
error(message: string, context?: Record<string, unknown>) {
if (context) this.logger.error(context, message);
else this.logger.error(message);
}
child(context: Record<string, unknown>): LoggerService {
const childPino = this.logger.child(context);
const service = new PinoLoggerService();
service.logger = childPino;
return service;
}
}