update: improve project structure and add linting/formatting
- Remove duplicate lucide-svelte package, keep @lucide/svelte - Move schema from src/lib/server/ to src/lib/db/ for better organization - Add path aliases to svelte.config.js (, , , , ) - Add ESLint and Prettier configuration with 2-space indentation - Update all imports to use new schema location and icon package
This commit is contained in:
@@ -4,7 +4,7 @@ import Credentials from '@auth/core/providers/credentials';
|
||||
import Google from '@auth/core/providers/google';
|
||||
import type { OAuthConfig } from '@auth/core/providers';
|
||||
import { db } from '$lib/server/db';
|
||||
import { users } from '$lib/server/schema';
|
||||
import { users } from '$lib/db/schema';
|
||||
import { eq } from 'drizzle-orm';
|
||||
import bcrypt from 'bcrypt';
|
||||
import { env } from '$env/dynamic/private';
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import WishlistSection from '$lib/components/dashboard/WishlistSection.svelte';
|
||||
import { getLocalWishlists, forgetLocalWishlist, toggleLocalFavorite, type LocalWishlist } from '$lib/utils/localWishlists';
|
||||
import { languageStore } from '$lib/stores/language.svelte';
|
||||
import { Star } from 'lucide-svelte';
|
||||
import { Star } from '@lucide/svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
let {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import WishlistGrid from '$lib/components/dashboard/WishlistGrid.svelte';
|
||||
import WishlistCard from '$lib/components/dashboard/WishlistCard.svelte';
|
||||
import { enhance } from '$app/forms';
|
||||
import { Star } from 'lucide-svelte';
|
||||
import { Star } from '@lucide/svelte';
|
||||
import { languageStore } from '$lib/stores/language.svelte';
|
||||
import SearchBar from '$lib/components/ui/SearchBar.svelte';
|
||||
import UnlockButton from '$lib/components/ui/UnlockButton.svelte';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import { ThemeToggle } from '$lib/components/ui/theme-toggle';
|
||||
import { LanguageToggle } from '$lib/components/ui/language-toggle';
|
||||
import { LayoutDashboard } from 'lucide-svelte';
|
||||
import { LayoutDashboard } from '@lucide/svelte';
|
||||
import { languageStore } from '$lib/stores/language.svelte';
|
||||
|
||||
let {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { X, Pencil } from 'lucide-svelte';
|
||||
import { X, Pencil } from '@lucide/svelte';
|
||||
import IconButton from './IconButton.svelte';
|
||||
|
||||
let {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import { Lock, LockOpen } from 'lucide-svelte';
|
||||
import { Lock, LockOpen } from '@lucide/svelte';
|
||||
import { languageStore } from '$lib/stores/language.svelte';
|
||||
|
||||
let {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { languageStore } from '$lib/stores/language.svelte';
|
||||
import { languages } from '$lib/i18n/translations';
|
||||
import Dropdown from '$lib/components/ui/Dropdown.svelte';
|
||||
import { Languages } from 'lucide-svelte';
|
||||
import { Languages } from '@lucide/svelte';
|
||||
|
||||
let { color }: { color?: string | null } = $props();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import Dropdown from '$lib/components/ui/Dropdown.svelte';
|
||||
import { Palette } from 'lucide-svelte';
|
||||
import { Palette } from '@lucide/svelte';
|
||||
import { AVAILABLE_THEMES } from '$lib/utils/themes';
|
||||
|
||||
let {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { themeStore } from '$lib/stores/theme.svelte';
|
||||
import { Sun, Moon, Monitor } from 'lucide-svelte';
|
||||
import { Sun, Moon, Monitor } from '@lucide/svelte';
|
||||
import IconButton from '../IconButton.svelte';
|
||||
|
||||
let {
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
import { Input } from "$lib/components/ui/input";
|
||||
import { Label } from "$lib/components/ui/label";
|
||||
import { Textarea } from "$lib/components/ui/textarea";
|
||||
import { Pencil, Check, X } from "lucide-svelte";
|
||||
import { Pencil, Check, X } from "@lucide/svelte";
|
||||
import ColorPicker from "$lib/components/ui/ColorPicker.svelte";
|
||||
import ThemePicker from "$lib/components/ui/theme-picker.svelte";
|
||||
import IconButton from "$lib/components/ui/IconButton.svelte";
|
||||
import type { Wishlist } from "$lib/server/schema";
|
||||
import type { Wishlist } from "$lib/db/schema";
|
||||
import { languageStore } from '$lib/stores/language.svelte';
|
||||
import { getCardStyle } from '$lib/utils/colors';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { Card, CardContent } from "$lib/components/ui/card";
|
||||
import type { Item } from "$lib/server/schema";
|
||||
import { GripVertical, ExternalLink } from "lucide-svelte";
|
||||
import type { Item } from "$lib/db/schema";
|
||||
import { GripVertical, ExternalLink } from "@lucide/svelte";
|
||||
import { getCardStyle } from '$lib/utils/colors';
|
||||
import { Button } from "$lib/components/ui/button";
|
||||
import { languageStore } from '$lib/stores/language.svelte';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { drizzle } from 'drizzle-orm/postgres-js';
|
||||
import postgres from 'postgres';
|
||||
import { env } from '$env/dynamic/private';
|
||||
import * as schema from './schema';
|
||||
import * as schema from '$lib/db/schema';
|
||||
|
||||
const client = postgres(env.DATABASE_URL!);
|
||||
export const db = drizzle(client, { schema });
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { json } from '@sveltejs/kit';
|
||||
import type { RequestHandler } from './$types';
|
||||
import { db } from '$lib/server/db';
|
||||
import { wishlists } from '$lib/server/schema';
|
||||
import { wishlists } from '$lib/db/schema';
|
||||
import { eq, or } from 'drizzle-orm';
|
||||
|
||||
export const GET: RequestHandler = async ({ params }) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { json } from '@sveltejs/kit';
|
||||
import type { RequestHandler } from './$types';
|
||||
import { db } from '$lib/server/db';
|
||||
import { wishlists } from '$lib/server/schema';
|
||||
import { wishlists } from '$lib/db/schema';
|
||||
import { createId } from '@paralleldrive/cuid2';
|
||||
import { sanitizeString, sanitizeColor } from '$lib/server/validation';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import type { PageServerLoad, Actions } from './$types';
|
||||
import { db } from '$lib/server/db';
|
||||
import { wishlists, savedWishlists, users } from '$lib/server/schema';
|
||||
import { wishlists, savedWishlists, users } from '$lib/db/schema';
|
||||
import { eq, and } from 'drizzle-orm';
|
||||
|
||||
export const load: PageServerLoad = async (event) => {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import WishlistSection from '$lib/components/dashboard/WishlistSection.svelte';
|
||||
import LocalWishlistsSection from '$lib/components/dashboard/LocalWishlistsSection.svelte';
|
||||
import { enhance } from '$app/forms';
|
||||
import { Star } from 'lucide-svelte';
|
||||
import { Star } from '@lucide/svelte';
|
||||
import { languageStore } from '$lib/stores/language.svelte';
|
||||
|
||||
let { data }: { data: PageData } = $props();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { fail, redirect } from '@sveltejs/kit';
|
||||
import type { Actions, PageServerLoad } from './$types';
|
||||
import { db } from '$lib/server/db';
|
||||
import { users } from '$lib/server/schema';
|
||||
import { users } from '$lib/db/schema';
|
||||
import { eq } from 'drizzle-orm';
|
||||
import bcrypt from 'bcrypt';
|
||||
import { env } from '$env/dynamic/private';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { error } from '@sveltejs/kit';
|
||||
import type { PageServerLoad, Actions } from './$types';
|
||||
import { db } from '$lib/server/db';
|
||||
import { wishlists, items, reservations, savedWishlists } from '$lib/server/schema';
|
||||
import { wishlists, items, reservations, savedWishlists } from '$lib/db/schema';
|
||||
import { eq, and } from 'drizzle-orm';
|
||||
|
||||
export const load: PageServerLoad = async ({ params, locals }) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { error } from '@sveltejs/kit';
|
||||
import type { PageServerLoad, Actions } from './$types';
|
||||
import { db } from '$lib/server/db';
|
||||
import { wishlists, items, savedWishlists } from '$lib/server/schema';
|
||||
import { wishlists, items, savedWishlists } from '$lib/db/schema';
|
||||
import { eq, and } from 'drizzle-orm';
|
||||
|
||||
export const load: PageServerLoad = async ({ params, locals }) => {
|
||||
|
||||
Reference in New Issue
Block a user