refactor: remove dead code identified by knip
Delete unused Fab component (superseded by QuickAddFab), unused server actions and queries (listDashboards, reorderDashboards, deleteCareLog, canAccessContainer, getOverduePlants, getCareDueSoon, addItemToDefaultList, reorderItems, getOrCreateDefaultList), unused helpers (getCurrentUser, BrandWordmark, TopbarSpacer, DEV_LOGIN_COOKIE, no-arg ensureDefault* wrappers, addListItem re-export), and drop export keyword from five internal-only functions. Verified with typecheck, eslint, and production build after each removal.
This commit is contained in:
@@ -49,12 +49,3 @@ export const { handlers, auth, signIn, signOut } = NextAuth({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export async function getCurrentUser() {
|
||||
const session = await auth();
|
||||
if (!session?.user?.id) return null;
|
||||
const user = await db.query.users.findFirst({
|
||||
where: (u, { eq }) => eq(u.id, session.user.id),
|
||||
});
|
||||
return user ?? null;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { computePresetLayoutFromMetas } from "./dashboard";
|
||||
/** Build a layout matching one of the design's three dashboard arrangements
|
||||
* using the live module registry. Server-only — the registry is empty on
|
||||
* the client. */
|
||||
export function computePresetLayout(preset: PresetId): DashboardLayout {
|
||||
function computePresetLayout(preset: PresetId): DashboardLayout {
|
||||
const { widgets } = getRegistry();
|
||||
if (widgets.length === 0) return { version: 1, widgets: [] };
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
export const DEV_LOGIN_COOKIE = "authjs.session-token";
|
||||
|
||||
if (
|
||||
process.env.NODE_ENV === "production" &&
|
||||
process.env.ENABLE_DEV_LOGIN === "true" &&
|
||||
|
||||
Reference in New Issue
Block a user