refactor: migrate discord-gateway from winston to @bete/shared/logger and utils
- Replace all local logger imports (../../shared/logger/logger.js) with @bete/shared/logger across 26 files - Remove winston dependency, add pino to discord-gateway package.json - Delete shared/logger/logger.ts (winston-based, 132 lines) and serialization.ts (109 lines) - Replace local retryWithBackoff imports with @bete/shared/utils across 6 files - Delete shared/utils/retry.ts (42 lines) - Add CustomLogger type alias to @bete/shared/logger for backwards compatibility - Remove logger param from all retryWithBackoff calls and uploadToTele interfaces - Frontend: convert entity type files to re-exports from shared/api/client.ts - Full monorepo typecheck clean (4/4 packages) 35 files changed, 42 insertions(+), 488 deletions(-)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { config } from "../../shared/config/config.js";
|
||||
import { createChildLogger } from "../../shared/logger/logger.js";
|
||||
import { createChildLogger } from "@bete/shared/logger";
|
||||
import { uploadToTele } from "./teleUpload.js";
|
||||
import {
|
||||
updateAttachmentAsFailedUpload,
|
||||
@@ -45,7 +45,6 @@ export async function uploadAttachmentToTele(
|
||||
uploadUrl: config.TELE_UPLOAD_URL,
|
||||
timeoutMs: config.ATTACHMENT_UPLOAD_TIMEOUT_MS,
|
||||
retries: 0,
|
||||
logger,
|
||||
});
|
||||
|
||||
return result.url;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sharp from "sharp";
|
||||
import { createChildLogger } from "../../shared/logger/logger.js";
|
||||
import { createChildLogger } from "@bete/shared/logger";
|
||||
|
||||
const log = createChildLogger("imageResizer");
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { CustomLogger } from "../../shared/logger/logger.js";
|
||||
import { retryWithBackoff } from "../../shared/utils/retry.js";
|
||||
import { retryWithBackoff } from "@bete/shared/utils";
|
||||
|
||||
export interface TeleUploadResponse {
|
||||
download_url: string;
|
||||
@@ -37,7 +36,6 @@ export async function uploadToTele(input: {
|
||||
uploadUrl: string;
|
||||
timeoutMs?: number;
|
||||
retries: number;
|
||||
logger: CustomLogger;
|
||||
}): Promise<TeleUploadResult> {
|
||||
const {
|
||||
buffer,
|
||||
@@ -46,7 +44,6 @@ export async function uploadToTele(input: {
|
||||
uploadUrl,
|
||||
timeoutMs,
|
||||
retries,
|
||||
logger,
|
||||
} = input;
|
||||
|
||||
const response = await retryWithBackoff(
|
||||
@@ -77,7 +74,6 @@ export async function uploadToTele(input: {
|
||||
retries,
|
||||
minTimeout: 0,
|
||||
maxTimeout: 0,
|
||||
logger,
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user