From 9fce59ed0a3b46ef97e2f826bea0e57dd8fa2110 Mon Sep 17 00:00:00 2001 From: elim64 Date: Tue, 29 Oct 2024 04:23:56 +0500 Subject: [PATCH 1/5] migration to Svelte 5 --- package.json | 16 +++---- src/lib/emails/welcome_email_text.svelte | 9 +++- .../(admin)/account/(menu)/+layout.svelte | 17 ++++--- .../account/(menu)/billing/+page.svelte | 2 +- .../account/(menu)/settings/+page.svelte | 2 +- .../(menu)/settings/change_email/+page.svelte | 2 +- .../change_email_subscription/+page.svelte | 2 +- .../settings/change_password/+page.svelte | 8 ++-- .../settings/delete_account/+page.svelte | 2 +- .../(menu)/settings/edit_profile/+page.svelte | 2 +- .../(menu)/settings/settings_module.svelte | 44 +++++++++++++------ src/routes/(admin)/account/+layout.svelte | 12 +++-- .../account/create_profile/+page.svelte | 10 +++-- .../(admin)/account/sign_out/+page.svelte | 4 +- src/routes/(marketing)/+layout.svelte | 15 +++++-- .../(marketing)/blog/(posts)/+layout.svelte | 19 +++++--- .../(marketing)/contact_us/+page.svelte | 6 +-- src/routes/(marketing)/login/+layout.svelte | 9 +++- .../login/forgot_password/+page.svelte | 2 +- .../(marketing)/login/sign_in/+page.svelte | 2 +- .../(marketing)/login/sign_up/+page.svelte | 2 +- .../(marketing)/pricing/pricing_module.svelte | 19 +++++--- src/routes/(marketing)/search/+page.svelte | 26 ++++++----- src/routes/+layout.svelte | 7 ++- 24 files changed, 154 insertions(+), 85 deletions(-) diff --git a/package.json b/package.json index 1013222e..8a19e805 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ }, "devDependencies": { "@sveltejs/adapter-auto": "^3.2.0", - "@sveltejs/kit": "^2.0.0", - "@sveltejs/vite-plugin-svelte": "^3.1.1", + "@sveltejs/kit": "^2.5.27", + "@sveltejs/vite-plugin-svelte": "^4.0.0", "@tailwindcss/typography": "^0.5.13", "@types/glob": "^8.1.0", "@types/html-to-text": "^9.0.4", @@ -28,19 +28,19 @@ "daisyui": "^4.7.3", "eslint": "^8.28.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.30.0", + "eslint-plugin-svelte": "^2.45.1", "fuse.js": "^7.0.0", "glob": "^10.4.5", "html-to-text": "^9.0.5", "jsdom": "^24.1.1", "postcss": "^8.4.31", - "prettier": "^3.0.3", - "prettier-plugin-svelte": "^3.0.3", + "prettier": "^3.1.0", + "prettier-plugin-svelte": "^3.2.6", "super-sitemap": "^0.15.1", - "svelte": "^4.2.19", - "svelte-check": "^3.4.3", + "svelte": "^5.0.0", + "svelte-check": "^4.0.0", "tailwindcss": "^3.4.1", - "typescript": "^5.0.0", + "typescript": "^5.5.0", "vite": "^5.4.8", "vitest": "^1.0.0" }, diff --git a/src/lib/emails/welcome_email_text.svelte b/src/lib/emails/welcome_email_text.svelte index b25da5a1..a03ff612 100644 --- a/src/lib/emails/welcome_email_text.svelte +++ b/src/lib/emails/welcome_email_text.svelte @@ -7,8 +7,13 @@ // must be set to true to render email on server export const ssr = true - // Define all your props here - export let companyName: string = "" + + interface Props { + // Define all your props here + companyName?: string; + } + + let { companyName = "" }: Props = $props(); Welcome to {companyName}! diff --git a/src/routes/(admin)/account/(menu)/+layout.svelte b/src/routes/(admin)/account/(menu)/+layout.svelte index de559a3c..dbb9a48b 100644 --- a/src/routes/(admin)/account/(menu)/+layout.svelte +++ b/src/routes/(admin)/account/(menu)/+layout.svelte @@ -3,10 +3,15 @@ import { writable } from "svelte/store" import { setContext } from "svelte" import { WebsiteName } from "../../../../config" + interface Props { + children?: import("svelte").Snippet + } + + let { children }: Props = $props() const adminSectionStore = writable("") setContext("adminSection", adminSectionStore) - let adminSection: string + let adminSection: string = $state() adminSectionStore.subscribe((value) => { adminSection = value }) @@ -47,12 +52,12 @@
- + {@render children?.()}
-