From c926f15aabcdac602bb1a63eaac688f0accf7042 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sat, 3 Jan 2026 14:24:53 -0600 Subject: [PATCH] Fix circular dependency breaking ncc bundle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't export authRoutes from barrel file to break the cycle: services.ts → auth/index.ts → auth/routes.ts → services.ts Import authRoutes directly from ./auth/routes instead. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- express/auth/index.ts | 5 ++++- express/routes.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/express/auth/index.ts b/express/auth/index.ts index 383fd8e..35f06a9 100644 --- a/express/auth/index.ts +++ b/express/auth/index.ts @@ -1,9 +1,12 @@ // index.ts // // Barrel export for auth module. +// +// NOTE: authRoutes is NOT exported here to avoid circular dependency: +// services.ts → auth/index.ts → auth/routes.ts → services.ts +// Import authRoutes directly from "./auth/routes" instead. export { hashPassword, verifyPassword } from "./password"; -export { authRoutes } from "./routes"; export { AuthService } from "./service"; export { type AuthStore, InMemoryAuthStore } from "./store"; export { generateToken, hashToken, SESSION_COOKIE_NAME } from "./token"; diff --git a/express/routes.ts b/express/routes.ts index 3ef0093..26028b2 100644 --- a/express/routes.ts +++ b/express/routes.ts @@ -2,7 +2,7 @@ import nunjucks from "nunjucks"; import { DateTime } from "ts-luxon"; -import { authRoutes } from "./auth"; +import { authRoutes } from "./auth/routes"; import { contentTypes } from "./content-types"; import { multiHandler } from "./handlers"; import { HttpCode, httpCodes } from "./http-codes";