diff --git a/frontend/.prettierrc b/frontend/.prettierrc
index 819fa57..13f9f03 100644
--- a/frontend/.prettierrc
+++ b/frontend/.prettierrc
@@ -1,16 +1,17 @@
{
- "useTabs": true,
- "singleQuote": true,
- "trailingComma": "none",
- "printWidth": 100,
- "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
- "overrides": [
- {
- "files": "*.svelte",
- "options": {
- "parser": "svelte"
- }
- }
- ],
- "tailwindStylesheet": "./src/routes/layout.css"
+ "useTabs": false,
+ "tabWidth": 4,
+ "singleQuote": true,
+ "trailingComma": "none",
+ "printWidth": 100,
+ "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
+ "overrides": [
+ {
+ "files": "*.svelte",
+ "options": {
+ "parser": "svelte"
+ }
+ }
+ ],
+ "tailwindStylesheet": "./src/routes/layout.css"
}
diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js
index 0014edd..8e77353 100644
--- a/frontend/eslint.config.js
+++ b/frontend/eslint.config.js
@@ -11,34 +11,34 @@ import svelteConfig from './svelte.config.js';
const gitignorePath = path.resolve(import.meta.dirname, '.gitignore');
export default defineConfig(
- includeIgnoreFile(gitignorePath),
- js.configs.recommended,
- ts.configs.recommended,
- svelte.configs.recommended,
- prettier,
- svelte.configs.prettier,
- {
- languageOptions: { globals: { ...globals.browser, ...globals.node } },
- rules: {
- // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
- // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
- 'no-undef': 'off'
- }
- },
- {
- files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
- languageOptions: {
- parserOptions: {
- projectService: true,
- extraFileExtensions: ['.svelte'],
- parser: ts.parser,
- svelteConfig
- }
- }
- },
- {
- // Override or add rule settings here, such as:
- // 'svelte/button-has-type': 'error'
- rules: {}
- }
+ includeIgnoreFile(gitignorePath),
+ js.configs.recommended,
+ ts.configs.recommended,
+ svelte.configs.recommended,
+ prettier,
+ svelte.configs.prettier,
+ {
+ languageOptions: { globals: { ...globals.browser, ...globals.node } },
+ rules: {
+ // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
+ // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
+ 'no-undef': 'off'
+ }
+ },
+ {
+ files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
+ languageOptions: {
+ parserOptions: {
+ projectService: true,
+ extraFileExtensions: ['.svelte'],
+ parser: ts.parser,
+ svelteConfig
+ }
+ }
+ },
+ {
+ // Override or add rule settings here, such as:
+ // 'svelte/button-has-type': 'error'
+ rules: {}
+ }
);
diff --git a/frontend/package.json b/frontend/package.json
index cb47397..f9bf09b 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -1,50 +1,50 @@
{
- "name": "frontend",
- "private": true,
- "version": "0.0.1",
- "type": "module",
- "scripts": {
- "dev": "vite dev",
- "build": "vite build",
- "preview": "vite preview",
- "prepare": "svelte-kit sync || echo ''",
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
- "lint": "prettier --check . && eslint .",
- "format": "prettier --write .",
- "test:e2e": "playwright test",
- "test": "npm run test:unit -- --run && npm run test:e2e",
- "test:unit": "vitest"
- },
- "devDependencies": {
- "@eslint/compat": "^2.0.3",
- "@eslint/js": "^10.0.1",
- "@fontsource/fira-mono": "^5.2.7",
- "@neoconfetti/svelte": "^2.2.2",
- "@playwright/test": "^1.58.2",
- "@sveltejs/adapter-auto": "^7.0.0",
- "@sveltejs/kit": "^2.50.2",
- "@sveltejs/vite-plugin-svelte": "^6.2.4",
- "@tailwindcss/forms": "^0.5.11",
- "@tailwindcss/typography": "^0.5.19",
- "@tailwindcss/vite": "^4.1.18",
- "@types/node": "^24",
- "@vitest/browser-playwright": "^4.1.0",
- "eslint": "^10.0.3",
- "eslint-config-prettier": "^10.1.8",
- "eslint-plugin-svelte": "^3.15.2",
- "globals": "^17.4.0",
- "playwright": "^1.58.2",
- "prettier": "^3.8.1",
- "prettier-plugin-svelte": "^3.4.1",
- "prettier-plugin-tailwindcss": "^0.7.2",
- "svelte": "^5.54.0",
- "svelte-check": "^4.4.2",
- "tailwindcss": "^4.1.18",
- "typescript": "^5.9.3",
- "typescript-eslint": "^8.57.0",
- "vite": "^7.3.1",
- "vitest": "^4.1.0",
- "vitest-browser-svelte": "^2.0.2"
- }
+ "name": "frontend",
+ "private": true,
+ "version": "0.0.1",
+ "type": "module",
+ "scripts": {
+ "dev": "vite dev",
+ "build": "vite build",
+ "preview": "vite preview",
+ "prepare": "svelte-kit sync || echo ''",
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
+ "lint": "prettier --check . && eslint .",
+ "format": "prettier --write .",
+ "test:e2e": "playwright test",
+ "test": "npm run test:unit -- --run && npm run test:e2e",
+ "test:unit": "vitest"
+ },
+ "devDependencies": {
+ "@eslint/compat": "^2.0.3",
+ "@eslint/js": "^10.0.1",
+ "@fontsource/fira-mono": "^5.2.7",
+ "@neoconfetti/svelte": "^2.2.2",
+ "@playwright/test": "^1.58.2",
+ "@sveltejs/adapter-auto": "^7.0.0",
+ "@sveltejs/kit": "^2.50.2",
+ "@sveltejs/vite-plugin-svelte": "^6.2.4",
+ "@tailwindcss/forms": "^0.5.11",
+ "@tailwindcss/typography": "^0.5.19",
+ "@tailwindcss/vite": "^4.1.18",
+ "@types/node": "^24",
+ "@vitest/browser-playwright": "^4.1.0",
+ "eslint": "^10.0.3",
+ "eslint-config-prettier": "^10.1.8",
+ "eslint-plugin-svelte": "^3.15.2",
+ "globals": "^17.4.0",
+ "playwright": "^1.58.2",
+ "prettier": "^3.8.1",
+ "prettier-plugin-svelte": "^3.4.1",
+ "prettier-plugin-tailwindcss": "^0.7.2",
+ "svelte": "^5.54.0",
+ "svelte-check": "^4.4.2",
+ "tailwindcss": "^4.1.18",
+ "typescript": "^5.9.3",
+ "typescript-eslint": "^8.57.0",
+ "vite": "^7.3.1",
+ "vitest": "^4.1.0",
+ "vitest-browser-svelte": "^2.0.2"
+ }
}
diff --git a/frontend/pnpm-workspace.yaml b/frontend/pnpm-workspace.yaml
index efc037a..7cb5b88 100644
--- a/frontend/pnpm-workspace.yaml
+++ b/frontend/pnpm-workspace.yaml
@@ -1,2 +1,2 @@
onlyBuiltDependencies:
- - esbuild
+ - esbuild
diff --git a/frontend/src/app.d.ts b/frontend/src/app.d.ts
index da08e6d..d76242a 100644
--- a/frontend/src/app.d.ts
+++ b/frontend/src/app.d.ts
@@ -1,13 +1,13 @@
// See https://svelte.dev/docs/kit/types#app.d.ts
// for information about these interfaces
declare global {
- namespace App {
- // interface Error {}
- // interface Locals {}
- // interface PageData {}
- // interface PageState {}
- // interface Platform {}
- }
+ namespace App {
+ // interface Error {}
+ // interface Locals {}
+ // interface PageData {}
+ // interface PageState {}
+ // interface Platform {}
+ }
}
export {};
diff --git a/frontend/src/app.html b/frontend/src/app.html
index dc49ff8..bffaaa1 100644
--- a/frontend/src/app.html
+++ b/frontend/src/app.html
@@ -1,14 +1,17 @@
-
-
-
-
-
-
- %sveltekit.head%
-
-
- %sveltekit.body%
-
+
+
+
+
+
+
+ %sveltekit.head%
+
+
+ %sveltekit.body%
+
diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts
index 9efac37..3cc8529 100644
--- a/frontend/src/lib/api.ts
+++ b/frontend/src/lib/api.ts
@@ -1,10 +1,10 @@
-import type { FileRecord } from "$lib/types";
+import type { FileRecord } from '$lib/types';
export async function loadFiles(): Promise {
const res = await fetch('/api/files', {
credentials: 'include'
});
-
+
if (res.status === 401) {
window.location.href = '/auth';
return [];
@@ -14,10 +14,9 @@ export async function loadFiles(): Promise {
throw new Error(`Failed to load files: ${res.status}`);
}
- return await res.json()
+ return await res.json();
}
-
export async function uploadFile(file: File): Promise {
const formData = new FormData();
formData.append('file', file);
@@ -28,10 +27,10 @@ export async function uploadFile(file: File): Promise {
});
if (!res.ok) {
- throw new Error(`Upload failed: ${res.status}`)
+ throw new Error(`Upload failed: ${res.status}`);
}
- return await res.json()
+ return await res.json();
}
export async function downloadFile(fileId: number): Promise {
@@ -39,10 +38,10 @@ export async function downloadFile(fileId: number): Promise {
credentials: 'include'
});
if (!res.ok) {
- throw new Error(`Download failed: ${res.status}`)
+ throw new Error(`Download failed: ${res.status}`);
}
- return await res.blob()
+ return await res.blob();
}
export async function deleteFile(fileId: number): Promise {
diff --git a/frontend/src/lib/components/FilePreview.svelte b/frontend/src/lib/components/FilePreview.svelte
index a471d03..ad771ff 100644
--- a/frontend/src/lib/components/FilePreview.svelte
+++ b/frontend/src/lib/components/FilePreview.svelte
@@ -1,33 +1,50 @@
- { if (e.key === 'Escape') onclose(); }} />
+ {
+ if (e.key === 'Escape') onclose();
+ }}
+/>
e.stopPropagation()}
>
-
-
{file.name}
-