From 7aab1ab789c46cf35cd9f9be1ef5050d528acb6d Mon Sep 17 00:00:00 2001 From: Joachim Hummel Date: Mon, 1 Dec 2025 08:56:31 +0000 Subject: [PATCH] Move types to lib directory for better organization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move types/location.ts to lib/types.ts - Update all imports from @/types/location to @/lib/types - Remove empty types/ directory - Better aligns with Next.js conventions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/admin/page.tsx | 2 +- app/api/locations/route.ts | 2 +- components/map/MapView.tsx | 2 +- lib/devices.ts | 2 +- types/location.ts => lib/types.ts | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename types/location.ts => lib/types.ts (100%) diff --git a/app/admin/page.tsx b/app/admin/page.tsx index b30e48e..90e8588 100644 --- a/app/admin/page.tsx +++ b/app/admin/page.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from "react"; import { useSession } from "next-auth/react"; -import { LocationResponse } from "@/types/location"; +import { LocationResponse } from "@/lib/types"; interface DeviceInfo { id: string; diff --git a/app/api/locations/route.ts b/app/api/locations/route.ts index a016d6d..08fadec 100644 --- a/app/api/locations/route.ts +++ b/app/api/locations/route.ts @@ -1,5 +1,5 @@ import { NextRequest, NextResponse } from "next/server"; -import type { LocationResponse } from "@/types/location"; +import type { LocationResponse } from "@/lib/types"; import { locationDb, Location, deviceDb, userDb } from "@/lib/db"; import { auth } from "@/lib/auth"; diff --git a/components/map/MapView.tsx b/components/map/MapView.tsx index d0bfc7a..96696be 100644 --- a/components/map/MapView.tsx +++ b/components/map/MapView.tsx @@ -1,7 +1,7 @@ "use client"; import { useEffect, useState, useRef } from "react"; -import { Location, LocationResponse } from "@/types/location"; +import { Location, LocationResponse } from "@/lib/types"; import { getDevice, DEFAULT_DEVICE } from "@/lib/devices"; import L from "leaflet"; import { diff --git a/lib/devices.ts b/lib/devices.ts index b265c16..5ba9b7d 100644 --- a/lib/devices.ts +++ b/lib/devices.ts @@ -1,4 +1,4 @@ -import { Device } from '@/types/location'; +import { Device } from '@/lib/types'; export const DEVICES: Record = { '10': { id: '10', name: 'Device A', color: '#e74c3c' }, diff --git a/types/location.ts b/lib/types.ts similarity index 100% rename from types/location.ts rename to lib/types.ts