From f2d656327319cdbdb5c34146da54ec9de1c2c2c6 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Sat, 27 Jun 2026 23:32:30 +0200 Subject: [PATCH] fix: remove nodeLinker=hoisted, replace transitive imports with existing deps --- packages/common/src/object.ts | 17 ++++++++++++++--- .../logs/transports/redis-transport.ts | 8 ++------ pnpm-workspace.yaml | 1 - 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/packages/common/src/object.ts b/packages/common/src/object.ts index 96ec46dbb..045a7b699 100644 --- a/packages/common/src/object.ts +++ b/packages/common/src/object.ts @@ -1,5 +1,3 @@ -import { hashKey } from "@tanstack/query-core"; - export function objectKeys(obj: O): (keyof O)[] { return Object.keys(obj) as (keyof O)[]; } @@ -11,5 +9,18 @@ type Entries = { export const objectEntries = (obj: T) => Object.entries(obj) as Entries; export const hashObjectBase64 = (obj: object) => { - return Buffer.from(hashKey([obj])).toString("base64"); + const json = JSON.stringify([obj], (_, val) => + typeof val === "object" && val !== null && !Array.isArray(val) + ? Object.keys(val) + .sort() + .reduce( + (acc, key) => { + acc[key] = (val as Record)[key]; + return acc; + }, + {} as Record, + ) + : val, + ); + return Buffer.from(json).toString("base64"); }; diff --git a/packages/core/src/infrastructure/logs/transports/redis-transport.ts b/packages/core/src/infrastructure/logs/transports/redis-transport.ts index e063f60dd..5e0eb8b51 100644 --- a/packages/core/src/infrastructure/logs/transports/redis-transport.ts +++ b/packages/core/src/infrastructure/logs/transports/redis-transport.ts @@ -1,5 +1,5 @@ import superjson from "superjson"; -import Transport from "winston-transport"; +import winston from "winston"; import type { RedisClient } from "../../redis/client"; import { createRedisClient } from "../../redis/client"; @@ -7,11 +7,7 @@ import { createRedisClient } from "../../redis/client"; const messageSymbol = Symbol.for("message"); const levelSymbol = Symbol.for("level"); -// -// Inherit from `winston-transport` so you can take advantage -// of the base functionality and `.exceptions.handle()`. -// -export class RedisTransport extends Transport { +export class RedisTransport extends winston.Transport { private redis: RedisClient | null = null; public static readonly publishChannel = "pubSub:logging"; diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index ac314911b..df6c958b8 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -192,7 +192,6 @@ catalog: zod-validation-error: ^5.0.0 catalogMode: strict enableGlobalVirtualStore: true -nodeLinker: hoisted strictPeerDependencies: false engineStrict: true verifyDepsBeforeRun: warn