chore: update packages

This commit is contained in:
Roman Godmaire 2024-02-10 09:06:59 -05:00
parent 66451ff420
commit c2aa788a40
8 changed files with 997 additions and 1195 deletions

View file

@ -13,32 +13,33 @@
"format": "prettier --write ." "format": "prettier --write ."
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-auto": "^3.1.1",
"@sveltejs/kit": "^1.27.4", "@sveltejs/kit": "^2.5.0",
"@types/uuid": "^9.0.7", "@sveltejs/vite-plugin-svelte": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^6.0.0", "@types/uuid": "^9.0.8",
"@typescript-eslint/parser": "^6.0.0", "@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vitest/coverage-istanbul": "^1.2.2", "@vitest/coverage-istanbul": "^1.2.2",
"eslint": "^8.28.0", "eslint": "^8.56.0",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.30.0", "eslint-plugin-svelte": "^2.35.1",
"prettier": "^3.0.0", "prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.0.0", "prettier-plugin-svelte": "^3.1.2",
"prisma": "^5.6.0", "prisma": "^5.9.1",
"svelte": "^4.0.5", "svelte": "^4.2.10",
"svelte-check": "^3.6.0", "svelte-check": "^3.6.4",
"tslib": "^2.4.1", "tslib": "^2.6.2",
"typescript": "^5.0.0", "typescript": "^5.3.3",
"vite": "^4.4.2", "vite": "^5.1.1",
"vitest": "^1.2.2" "vitest": "^1.2.2"
}, },
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "^3.454.0", "@aws-sdk/client-s3": "^3.511.0",
"@lucia-auth/adapter-prisma": "^3.0.2", "@lucia-auth/adapter-prisma": "^3.0.2",
"@picocss/pico": "^1.5.10", "@picocss/pico": "^1.5.11",
"@prisma/client": "5.6.0", "@prisma/client": "5.9.1",
"lucia": "^2.7.4", "lucia": "^2.7.7",
"uuid": "^9.0.1" "uuid": "^9.0.1"
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,7 @@ import { validatePassword } from '$lib/validators';
export const load: PageServerLoad = async ({ locals: { authReq } }) => { export const load: PageServerLoad = async ({ locals: { authReq } }) => {
const session = await authReq.validate(); const session = await authReq.validate();
if (!session) throw redirect(302, '/login'); if (!session) redirect(302, '/login');
return { return {
username: session.user.username username: session.user.username
}; };
@ -102,6 +102,6 @@ export const actions: Actions = {
await auth.invalidateSession(session.sessionId); await auth.invalidateSession(session.sessionId);
authReq.setSession(null); // remove cookie authReq.setSession(null); // remove cookie
throw redirect(302, '/login'); redirect(302, '/login');
} }
}; };

View file

@ -6,7 +6,7 @@ import { fail, redirect } from '@sveltejs/kit';
export const load: PageServerLoad = async ({ locals: { authReq } }) => { export const load: PageServerLoad = async ({ locals: { authReq } }) => {
const session = await authReq.validate(); const session = await authReq.validate();
if (session) throw redirect(302, '/'); if (session) redirect(302, '/');
return {}; return {};
}; };
@ -49,6 +49,6 @@ export const actions: Actions = {
}); });
} }
throw redirect(302, '/'); redirect(302, '/');
} }
}; };

View file

@ -6,7 +6,7 @@ import { PrismaClientKnownRequestError } from '@prisma/client/runtime/library';
export const load: PageServerLoad = async ({ locals: { authReq } }) => { export const load: PageServerLoad = async ({ locals: { authReq } }) => {
const session = await authReq.validate(); const session = await authReq.validate();
if (session) throw redirect(302, '/'); if (session) redirect(302, '/');
return {}; return {};
}; };
@ -55,6 +55,6 @@ export const actions: Actions = {
}); });
} }
throw redirect(302, '/'); redirect(302, '/');
} }
}; };

View file

@ -4,12 +4,12 @@ import type { Actions, PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ params: { slug }, locals: { database } }) => { export const load: PageServerLoad = async ({ params: { slug }, locals: { database } }) => {
const trackId = parseInt(slug); const trackId = parseInt(slug);
if (isNaN(trackId)) { if (isNaN(trackId)) {
throw error(404, 'Track not found'); error(404, 'Track not found');
} }
let track = await database.fetchTrackPageData(trackId); let track = await database.fetchTrackPageData(trackId);
if (!track) { if (!track) {
throw error(440, 'Track not found'); error(440, 'Track not found');
} }
return { return {
@ -20,7 +20,7 @@ export const load: PageServerLoad = async ({ params: { slug }, locals: { databas
export const actions: Actions = { export const actions: Actions = {
comment: async ({ request, params: { slug }, locals: { authReq, database } }) => { comment: async ({ request, params: { slug }, locals: { authReq, database } }) => {
const session = await authReq.validate(); const session = await authReq.validate();
if (!session) throw redirect(302, '/login'); if (!session) redirect(302, '/login');
const trackId = parseInt(slug); const trackId = parseInt(slug);
@ -30,7 +30,7 @@ export const actions: Actions = {
const versionId = parseInt(version); const versionId = parseInt(version);
if (isNaN(versionId)) { if (isNaN(versionId)) {
throw error(404, 'Invalid version'); error(404, 'Invalid version');
} }
database.createComment(trackId, versionId, comment); database.createComment(trackId, versionId, comment);

View file

@ -5,14 +5,14 @@ import { v4 as uuidv4 } from 'uuid';
export const load: PageServerLoad = async ({ locals: { authReq } }) => { export const load: PageServerLoad = async ({ locals: { authReq } }) => {
const session = await authReq.validate(); const session = await authReq.validate();
if (!session) throw redirect(302, '/login'); if (!session) redirect(302, '/login');
return {}; return {};
}; };
export const actions: Actions = { export const actions: Actions = {
default: async ({ request, locals: { authReq, database, objectStorage } }) => { default: async ({ request, locals: { authReq, database, objectStorage } }) => {
const session = await authReq.validate(); const session = await authReq.validate();
if (!session) throw redirect(302, '/login'); if (!session) redirect(302, '/login');
const producerId = session.user.userId; const producerId = session.user.userId;
@ -33,6 +33,6 @@ export const actions: Actions = {
const track = await database.createTrack(producerId, title, objectKey); const track = await database.createTrack(producerId, title, objectKey);
await database.createTrackVersion(track.id); await database.createTrackVersion(track.id);
throw redirect(302, '/'); redirect(302, '/');
} }
}; };

View file

@ -1,5 +1,5 @@
import adapter from '@sveltejs/adapter-auto'; import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/kit/vite'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
const config = { const config = {