SvelteKit Updated, Uppy broken

This commit is contained in:
Mawoka
2025-09-21 10:48:07 +02:00
parent a87f59f5c0
commit fa533257b3
20 changed files with 1017 additions and 810 deletions
+16 -16
View File
@@ -24,9 +24,10 @@
"@sentry/browser": "^10.12.0", "@sentry/browser": "^10.12.0",
"@sentry/tracing": "^7.120.4", "@sentry/tracing": "^7.120.4",
"@simplewebauthn/browser": "^13.2.0", "@simplewebauthn/browser": "^13.2.0",
"@sveltejs/adapter-auto": "^2.1.1", "@sveltejs/adapter-auto": "^6.1.0",
"@sveltejs/adapter-node": "^1.3.1", "@sveltejs/adapter-node": "^5.3.2",
"@sveltejs/kit": "^1.30.4", "@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@tailwindcss/postcss": "^4.1.13", "@tailwindcss/postcss": "^4.1.13",
"@tailwindcss/typography": "^0.5.18", "@tailwindcss/typography": "^0.5.18",
"@types/canvas-confetti": "^1.9.0", "@types/canvas-confetti": "^1.9.0",
@@ -37,16 +38,15 @@
"@types/ua-parser-js": "^0.7.39", "@types/ua-parser-js": "^0.7.39",
"@typescript-eslint/eslint-plugin": "^8.44.0", "@typescript-eslint/eslint-plugin": "^8.44.0",
"@typescript-eslint/parser": "^8.44.0", "@typescript-eslint/parser": "^8.44.0",
"@uppy/compressor": "^1.1.4", "@uppy/compressor": "^2.3.2",
"@uppy/core": "^3.13.1", "@uppy/core": "^4.5.3",
"@uppy/dashboard": "^3.9.1", "@uppy/dashboard": "^4.4.3",
"@uppy/drag-drop": "^3.1.1", "@uppy/drag-drop": "^4.2.2",
"@uppy/drop-target": "^2.1.0", "@uppy/drop-target": "^3.2.2",
"@uppy/image-editor": "^2.4.6", "@uppy/image-editor": "^3.4.2",
"@uppy/progress-bar": "^3.1.1", "@uppy/status-bar": "^4.2.3",
"@uppy/status-bar": "^3.3.3", "@uppy/svelte": "^4.6.2",
"@uppy/svelte": "^3.1.5", "@uppy/xhr-upload": "^4.4.2",
"@uppy/xhr-upload": "^3.6.8",
"autoprefixer": "^10.4.21", "autoprefixer": "^10.4.21",
"canvas-confetti": "^1.9.3", "canvas-confetti": "^1.9.3",
"ckeditor5": "^46.1.1", "ckeditor5": "^46.1.1",
@@ -78,8 +78,8 @@
"sass": "^1.93.0", "sass": "^1.93.0",
"socket.io-client": "^4.8.1", "socket.io-client": "^4.8.1",
"svelte": "^4.2.20", "svelte": "^4.2.20",
"svelte-check": "^3.8.6", "svelte-check": "^4.3.1",
"svelte-preprocess": "^5.1.4", "svelte-preprocess": "^6.0.3",
"svelte-range-slider-pips": "^4.0.7", "svelte-range-slider-pips": "^4.0.7",
"svelte-tippy": "^1.3.2", "svelte-tippy": "^1.3.2",
"swiper": "^12.0.2", "swiper": "^12.0.2",
@@ -90,7 +90,7 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "~5.0.4", "typescript": "~5.0.4",
"ua-parser-js": "^2.0.5", "ua-parser-js": "^2.0.5",
"vite": "^4.5.14", "vite": "^5.0.0",
"vite-plugin-cross-origin-isolation": "^0.1.6", "vite-plugin-cross-origin-isolation": "^0.1.6",
"vite-plugin-iso-import": "^1.3.0", "vite-plugin-iso-import": "^1.3.0",
"yup": "^1.7.0" "yup": "^1.7.0"
+976 -768
View File
File diff suppressed because it is too large Load Diff
+4 -3
View File
@@ -8,8 +8,8 @@ SPDX-License-Identifier: MPL-2.0
import '../app.css'; import '../app.css';
import Navbar from '$lib/navbar.svelte'; import Navbar from '$lib/navbar.svelte';
import { navbarVisible, pathname } from '$lib/stores'; import { navbarVisible, pathname } from '$lib/stores';
import * as Sentry from '@sentry/browser'; // import * as Sentry from '@sentry/browser';
import { BrowserTracing } from '@sentry/tracing'; // import { BrowserTracing } from '@sentry/tracing';
import { initLocalizationContext } from '$lib/i18n'; import { initLocalizationContext } from '$lib/i18n';
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import CommandPalette from '$lib/components/commandpalette.svelte'; import CommandPalette from '$lib/components/commandpalette.svelte';
@@ -54,7 +54,7 @@ SPDX-License-Identifier: MPL-2.0
start_language = localStorage.getItem('language') ?? 'en'; start_language = localStorage.getItem('language') ?? 'en';
} }
initLocalizationContext(start_language); initLocalizationContext(start_language);
/*
if (import.meta.env.VITE_SENTRY !== undefined && import.meta.env.PROD) { if (import.meta.env.VITE_SENTRY !== undefined && import.meta.env.PROD) {
Sentry.init({ Sentry.init({
dsn: String(import.meta.env.VITE_SENTRY), dsn: String(import.meta.env.VITE_SENTRY),
@@ -66,6 +66,7 @@ SPDX-License-Identifier: MPL-2.0
tracesSampleRate: 0.5 tracesSampleRate: 0.5
}); });
} }
*/
</script> </script>
<svelte:head> <svelte:head>
+1 -1
View File
@@ -7,7 +7,7 @@ import { redirect } from '@sveltejs/kit';
export const load = async ({ parent }) => { export const load = async ({ parent }) => {
const { email } = await parent(); const { email } = await parent();
if (email) { if (email) {
throw redirect(302, '/dashboard'); redirect(302, '/dashboard');
} }
return { return {
email email
@@ -8,7 +8,7 @@ import { error } from '@sveltejs/kit';
export const load = (async ({ fetch, params }) => { export const load = (async ({ fetch, params }) => {
const res = await fetch(`/api/v1/box-controller/web/controller?id=${params.controller_id}`); const res = await fetch(`/api/v1/box-controller/web/controller?id=${params.controller_id}`);
if (res.status !== 200) { if (res.status !== 200) {
throw error(res.status, await res.text()); error(res.status, await res.text());
} }
const json: { const json: {
id: string; id: string;
@@ -9,7 +9,7 @@ export const load = (({ url }) => {
const code = url.searchParams.get('code'); const code = url.searchParams.get('code');
const id = url.searchParams.get('id'); const id = url.searchParams.get('id');
if (!id || !code) { if (!id || !code) {
throw error(404, JSON.stringify({ detail: 'id and/or code are/is missing' })); error(404, JSON.stringify({ detail: 'id and/or code are/is missing' }));
} }
return { return {
id, id,
@@ -11,7 +11,7 @@ export async function load({ parent, url }) {
const { email } = await parent(); const { email } = await parent();
if (email) { if (email) {
throw redirect(302, returnTo); redirect(302, returnTo);
} }
return { return {
verified: verified !== null verified: verified !== null
@@ -7,7 +7,7 @@ import { redirect } from '@sveltejs/kit';
export async function load({ parent }) { export async function load({ parent }) {
const { email } = await parent(); const { email } = await parent();
if (email) { if (email) {
throw redirect(302, '/dashboard'); redirect(302, '/dashboard');
} }
return {}; return {};
} }
@@ -7,7 +7,7 @@ import { redirect } from '@sveltejs/kit';
export async function load({ parent }) { export async function load({ parent }) {
const { email } = await parent(); const { email } = await parent();
if (email) { if (email) {
throw redirect(302, '/dashboard'); redirect(302, '/dashboard');
} }
return {}; return {};
} }
@@ -7,7 +7,7 @@ import { redirect } from '@sveltejs/kit';
export async function load({ parent }) { export async function load({ parent }) {
const { email } = await parent(); const { email } = await parent();
if (!email) { if (!email) {
throw redirect(302, '/account/login?returnTo=/account/settings'); redirect(302, '/account/login?returnTo=/account/settings');
} }
return { return {
email email
+1 -1
View File
@@ -7,7 +7,7 @@ import { redirect } from '@sveltejs/kit';
export async function load({ parent, url }) { export async function load({ parent, url }) {
const { email } = await parent(); const { email } = await parent();
if (!email) { if (!email) {
throw redirect(302, '/account/login'); redirect(302, '/account/login');
} }
const token = url.searchParams.get('token'); const token = url.searchParams.get('token');
const pin = url.searchParams.get('pin'); const pin = url.searchParams.get('pin');
+1 -1
View File
@@ -7,7 +7,7 @@ import { redirect } from '@sveltejs/kit';
export async function load({ parent }) { export async function load({ parent }) {
const { email } = await parent(); const { email } = await parent();
if (!email) { if (!email) {
throw redirect(302, '/account/login?returnTo=/create'); redirect(302, '/account/login?returnTo=/create');
} }
return {}; return {};
} }
@@ -7,7 +7,7 @@ import { redirect } from '@sveltejs/kit';
export const load = async ({ parent }) => { export const load = async ({ parent }) => {
const { email } = await parent(); const { email } = await parent();
if (!email) { if (!email) {
throw redirect(302, '/account/login?returnTo=/dashboard'); redirect(302, '/account/login?returnTo=/dashboard');
} }
return { return {
email email
+2 -2
View File
@@ -9,7 +9,7 @@ export async function load({ url, parent }) {
const quiz_id = url.searchParams.get('quiz_id'); const quiz_id = url.searchParams.get('quiz_id');
const { email } = await parent(); const { email } = await parent();
if (!email) { if (!email) {
throw redirect(302, `/account/login?returnTo=/edit?quiz_id=${quiz_id}`); redirect(302, `/account/login?returnTo=/edit?quiz_id=${quiz_id}`);
} }
if (email) { if (email) {
@@ -17,7 +17,7 @@ export async function load({ url, parent }) {
} }
if (quiz_id === null) { if (quiz_id === null) {
throw error(404); error(404);
} }
return { return {
quiz_id quiz_id
+1 -1
View File
@@ -7,7 +7,7 @@ import { signedIn } from '$lib/stores';
export async function load({ parent }) { export async function load({ parent }) {
const { email } = await parent(); const { email } = await parent();
if (!email) { if (!email) {
throw redirect(302, '/account/login?returnTo=/import'); redirect(302, '/account/login?returnTo=/import');
} else { } else {
if (email) { if (email) {
signedIn.set(true); signedIn.set(true);
+2 -2
View File
@@ -9,11 +9,11 @@ import type { Data } from '$lib/quiztivity/types';
export const load = (async ({ url, fetch }) => { export const load = (async ({ url, fetch }) => {
const id = url.searchParams.get('id'); const id = url.searchParams.get('id');
if (!id) { if (!id) {
throw error(400, 'id missing'); error(400, 'id missing');
} }
const resp = await fetch(`/api/v1/quiztivity/${id}`); const resp = await fetch(`/api/v1/quiztivity/${id}`);
if (!resp.ok) { if (!resp.ok) {
throw error(404, 'quiztivity not found'); error(404, 'quiztivity not found');
} }
const data: Data = await resp.json(); const data: Data = await resp.json();
return { return {
+2 -2
View File
@@ -10,7 +10,7 @@ export const load = (async ({ url, fetch }) => {
const id = url.searchParams.get('id'); const id = url.searchParams.get('id');
const share = url.searchParams.get('share') === 'true'; const share = url.searchParams.get('share') === 'true';
if (!id) { if (!id) {
throw error(400, 'id missing'); error(400, 'id missing');
} }
let resp: Response; let resp: Response;
if (share) { if (share) {
@@ -19,7 +19,7 @@ export const load = (async ({ url, fetch }) => {
resp = await fetch(`/api/v1/quiztivity/${id}`); resp = await fetch(`/api/v1/quiztivity/${id}`);
} }
if (!resp.ok) { if (!resp.ok) {
throw error(resp.status); error(resp.status);
} }
const data: Data = await resp.json(); const data: Data = await resp.json();
return { return {
@@ -8,5 +8,5 @@ import type { PageServerLoad } from './$types';
export const load = (({ params }) => { export const load = (({ params }) => {
const quiz_id = params.share_id; const quiz_id = params.share_id;
throw redirect(301, `/quiztivity/play?id=${quiz_id}&share=true`); redirect(301, `/quiztivity/play?id=${quiz_id}&share=true`);
}) satisfies PageServerLoad; }) satisfies PageServerLoad;
@@ -9,7 +9,7 @@ export const load = async ({ params, parent }) => {
const res = await fetch(`${process.env.API_URL}/api/v1/quiz/get/public/${quiz_id}`); const res = await fetch(`${process.env.API_URL}/api/v1/quiz/get/public/${quiz_id}`);
const { email } = await parent(); const { email } = await parent();
if (res.status === 404 || res.status === 400) { if (res.status === 404 || res.status === 400) {
throw error(404); error(404);
} else if (res.status === 200) { } else if (res.status === 200) {
const quiz = await res.json(); const quiz = await res.json();
return { return {
@@ -17,6 +17,6 @@ export const load = async ({ params, parent }) => {
logged_in: Boolean(email) logged_in: Boolean(email)
}; };
} else { } else {
throw error(500); error(500);
} }
}; };
+1 -3
View File
@@ -1,6 +1,6 @@
//{ //{
// "compilerOptions": { // "compilerOptions": {
// "moduleResolution": "node", // "moduleResolution": "bundler",
// "module": "es2020", // "module": "es2020",
// "lib": ["es2020", "DOM"], // "lib": ["es2020", "DOM"],
// "target": "es2020", // "target": "es2020",
@@ -8,12 +8,10 @@
// svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript // svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript
// to enforce using \`import type\` instead of \`import\` for Types. // to enforce using \`import type\` instead of \`import\` for Types.
// */ // */
// "importsNotUsedAsValues": "error",
// /** // /**
// TypeScript doesn't know about import usages in the template because it only sees the // TypeScript doesn't know about import usages in the template because it only sees the
// script of a Svelte file. Therefore preserve all value imports. Requires TS 4.5 or higher. // script of a Svelte file. Therefore preserve all value imports. Requires TS 4.5 or higher.
// */ // */
// "preserveValueImports": true,
// "isolatedModules": true, // "isolatedModules": true,
// "resolveJsonModule": true, // "resolveJsonModule": true,
// /** // /**