From 015e6801336c6a2c62b0ce6ac973a1a70761368d Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Mon, 24 Nov 2025 11:01:00 +0900 Subject: chore(backend/dev): remove cli-highlight dependency to reduce memory usage --- packages/backend/src/postgres.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'packages/backend/src/postgres.ts') diff --git a/packages/backend/src/postgres.ts b/packages/backend/src/postgres.ts index a3e659c110..3dcd3f0965 100644 --- a/packages/backend/src/postgres.ts +++ b/packages/backend/src/postgres.ts @@ -6,7 +6,6 @@ // https://github.com/typeorm/typeorm/issues/2400 import pg from 'pg'; import { DataSource, Logger, type QueryRunner } from 'typeorm'; -import * as highlight from 'cli-highlight'; import { entities as charts } from '@/core/chart/entities.js'; import { Config } from '@/config.js'; import MisskeyLogger from '@/logger.js'; @@ -25,7 +24,7 @@ import { MiAuthSession } from '@/models/AuthSession.js'; import { MiBlocking } from '@/models/Blocking.js'; import { MiChannelFollowing } from '@/models/ChannelFollowing.js'; import { MiChannelFavorite } from '@/models/ChannelFavorite.js'; -import { MiChannelMuting } from "@/models/ChannelMuting.js"; +import { MiChannelMuting } from '@/models/ChannelMuting.js'; import { MiClip } from '@/models/Clip.js'; import { MiClipNote } from '@/models/ClipNote.js'; import { MiClipFavorite } from '@/models/ClipFavorite.js'; @@ -101,12 +100,6 @@ export type LoggerProps = { printReplicationMode?: boolean, }; -function highlightSql(sql: string) { - return highlight.highlight(sql, { - language: 'sql', ignoreIllegals: true, - }); -} - function truncateSql(sql: string) { return sql.length > 100 ? `${sql.substring(0, 100)}...` : sql; } @@ -132,7 +125,7 @@ class MyCustomLogger implements Logger { modded = truncateSql(modded); } - return highlightSql(modded); + return modded; } @bindThis -- cgit v1.2.3-freya