From 4905ee152c46ede64c2bffc152b6c7d09b1499bb Mon Sep 17 00:00:00 2001 From: Bradley Shellnut Date: Tue, 18 Jul 2023 14:26:41 -0700 Subject: [PATCH] Update to Svelte 4. --- package.json | 8 ++++---- .../components/dialog/ClearCollectionDialog.svelte | 2 +- src/lib/components/dialog/DefaultDialog.svelte | 4 ++-- .../components/dialog/RemoveCollectionDialog.svelte | 2 +- .../components/dialog/RemoveWishlistDialog.svelte | 2 +- src/lib/components/game/index.svelte | 4 ++-- src/lib/components/listbox.svelte | 2 +- src/lib/components/pagination/index.svelte | 2 +- src/lib/components/preferences/profile.svelte | 2 +- src/lib/components/preferences/themes.svelte | 2 +- src/lib/components/search/textSearch/index.svelte | 2 +- src/lib/components/toast/Toast.svelte | 4 ++-- src/lib/components/transition/index.svelte | 2 +- src/lib/types.ts | 2 +- src/routes/api/game/search/+server.ts | 12 ++++++------ src/routes/game/[id]/+page.svelte | 4 ++-- 16 files changed, 28 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index ce95e6f..0915d93 100644 --- a/package.json +++ b/package.json @@ -44,14 +44,14 @@ "prettier-plugin-svelte": "^2.10.1", "prisma": "^4.16.2", "sass": "^1.63.6", - "svelte": "^3.59.2", - "svelte-check": "^2.10.3", + "svelte": "^4.0.0", + "svelte-check": "^3.4.3", "svelte-preprocess": "^5.0.4", "sveltekit-superforms": "^1.3.0", "tailwindcss": "^3.3.3", "ts-node": "^10.9.1", "tslib": "^2.6.0", - "typescript": "^4.9.5", + "typescript": "^5.0.0", "vite": "^4.4.4", "vitest": "^0.25.3", "zod": "^3.21.4" @@ -92,4 +92,4 @@ "tailwindcss-animate": "^1.0.6", "zod-to-json-schema": "^3.21.4" } -} +} \ No newline at end of file diff --git a/src/lib/components/dialog/ClearCollectionDialog.svelte b/src/lib/components/dialog/ClearCollectionDialog.svelte index 1738b63..5f6ed4d 100644 --- a/src/lib/components/dialog/ClearCollectionDialog.svelte +++ b/src/lib/components/dialog/ClearCollectionDialog.svelte @@ -28,7 +28,7 @@ }} static > --> -
+
diff --git a/src/lib/components/dialog/DefaultDialog.svelte b/src/lib/components/dialog/DefaultDialog.svelte index 40756e0..5e22afb 100644 --- a/src/lib/components/dialog/DefaultDialog.svelte +++ b/src/lib/components/dialog/DefaultDialog.svelte @@ -16,7 +16,7 @@ export let passive = false; export let primaryButtonText = ''; export let primaryButtonDisabled = false; - export let primaryButtonIcon: typeof SvelteComponent = undefined; + export let primaryButtonIcon: typeof SvelteComponent = undefined; export let primaryButtonIconDescription = ''; export let secondaryButtonText = ''; @@ -32,7 +32,7 @@ }} static > --> -
+
diff --git a/src/lib/components/dialog/RemoveCollectionDialog.svelte b/src/lib/components/dialog/RemoveCollectionDialog.svelte index 13cd0bc..abd6e84 100644 --- a/src/lib/components/dialog/RemoveCollectionDialog.svelte +++ b/src/lib/components/dialog/RemoveCollectionDialog.svelte @@ -64,7 +64,7 @@ }} static > -
+
Remove from collection diff --git a/src/lib/components/dialog/RemoveWishlistDialog.svelte b/src/lib/components/dialog/RemoveWishlistDialog.svelte index 15e5459..865184a 100644 --- a/src/lib/components/dialog/RemoveWishlistDialog.svelte +++ b/src/lib/components/dialog/RemoveWishlistDialog.svelte @@ -31,7 +31,7 @@ }} static > --> -
+
diff --git a/src/lib/components/game/index.svelte b/src/lib/components/game/index.svelte index cf22cb3..bfe6874 100644 --- a/src/lib/components/game/index.svelte +++ b/src/lib/components/game/index.svelte @@ -85,7 +85,7 @@ $: wishlistText = existsInWishlist ? 'Remove from wishlist' : 'Add to wishlist'; -
+
{game.game_name} @@ -141,7 +141,7 @@
- {#if open} -
+
{#each shows as anime (anime.id)} -
+
{#each pageSizes as size (size)} {#if open} -
+
--> {#if open} -
+
{#each Object.entries(themes) as [key, theme] (key)} diff --git a/src/lib/components/search/textSearch/index.svelte b/src/lib/components/search/textSearch/index.svelte index 3d266dc..15110db 100644 --- a/src/lib/components/search/textSearch/index.svelte +++ b/src/lib/components/search/textSearch/index.svelte @@ -181,7 +181,7 @@ {#if disclosureOpen} -
+
diff --git a/src/lib/components/toast/Toast.svelte b/src/lib/components/toast/Toast.svelte index 1b495a5..53ca49f 100644 --- a/src/lib/components/toast/Toast.svelte +++ b/src/lib/components/toast/Toast.svelte @@ -13,8 +13,8 @@ aria-label={toastData.dismissible ? 'Click to dismiss' : `${toastData.message}`} on:click={() => toastData.dismissible && toast.remove(toastData.id)} on:keydown={() => toastData.dismissible && toast.remove(toastData.id)} - in:fly={{ opacity: 0, x: 100 }} - out:fade + in:fly|global={{ opacity: 0, x: 100 }} + out:fade|global animate:flip class={`toast ${toastData.type.toLowerCase()}`} > diff --git a/src/lib/components/transition/index.svelte b/src/lib/components/transition/index.svelte index dda860c..4da06e5 100644 --- a/src/lib/components/transition/index.svelte +++ b/src/lib/components/transition/index.svelte @@ -14,7 +14,7 @@ {#if transition.type === 'page' && url}
{#key url} -
+
{/key} diff --git a/src/lib/types.ts b/src/lib/types.ts index 59f86ad..3c39c38 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -17,7 +17,7 @@ export type CollectionItemWithGame = Prisma.CollectionItemGetPayload<{ export type Dialog = { isOpen: boolean; - content?: typeof SvelteComponent; + content?: typeof SvelteComponent; additionalData?: SavedGameType | GameType; }; diff --git a/src/routes/api/game/search/+server.ts b/src/routes/api/game/search/+server.ts index ab0c3bb..d4170d5 100644 --- a/src/routes/api/game/search/+server.ts +++ b/src/routes/api/game/search/+server.ts @@ -7,12 +7,12 @@ import { search_schema } from '$lib/zodValidation.js'; // Search a user's collection export const GET = async ({ url, locals, params, request }) => { - try { - z.parse; - } catch (e) { - console.error(e); - return error(500, { message: 'Something went wrong' }); - } + // try { + // z.parse; + // } catch (e) { + // console.error(e); + // return error(500, { message: 'Something went wrong' }); + // } const searchParams = Object.fromEntries(url.searchParams); const q = searchParams?.q || ''; diff --git a/src/routes/game/[id]/+page.svelte b/src/routes/game/[id]/+page.svelte index 0a3477b..d4a0a2b 100644 --- a/src/routes/game/[id]/+page.svelte +++ b/src/routes/game/[id]/+page.svelte @@ -145,12 +145,12 @@ {#if game?.description_preview} {#if !seeMore} -
+
{`${game?.description_preview.substring(0, 250)}...`}
{/if} {#if seeMore} -
+
{@html game?.description}
{/if}