From 808d8467377618d401aa3ab71c3faf862c748170 Mon Sep 17 00:00:00 2001 From: Niccolo Borgioli Date: Fri, 17 Jan 2025 18:11:03 +0100 Subject: [PATCH 1/4] remove proxy --- packages/frontend/vite.config.js | 9 +++++++-- packages/proxy/package.json | 12 ------------ packages/proxy/proxy.js | 16 ---------------- 3 files changed, 7 insertions(+), 30 deletions(-) delete mode 100644 packages/proxy/package.json delete mode 100644 packages/proxy/proxy.js diff --git a/packages/frontend/vite.config.js b/packages/frontend/vite.config.js index 2c7d320..265832f 100644 --- a/packages/frontend/vite.config.js +++ b/packages/frontend/vite.config.js @@ -1,12 +1,17 @@ import { sveltekit } from '@sveltejs/kit/vite' import precompileIntl from 'svelte-intl-precompile/sveltekit-plugin' -const port = 8001 +const port = 3000 /** @type {import('vite').UserConfig} */ const config = { clearScreen: false, - server: { port }, + server: { + port, + proxy: { + '/api': 'http://localhost:8000', + }, + }, preview: { port }, plugins: [sveltekit(), precompileIntl('locales')], } diff --git a/packages/proxy/package.json b/packages/proxy/package.json deleted file mode 100644 index 24a2156..0000000 --- a/packages/proxy/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "private": true, - "name": "@cryptgeon/proxy", - "type": "module", - "main": "./proxy.js", - "scripts": { - "dev": "node ." - }, - "dependencies": { - "http-proxy": "^1.18.1" - } -} diff --git a/packages/proxy/proxy.js b/packages/proxy/proxy.js deleted file mode 100644 index f434436..0000000 --- a/packages/proxy/proxy.js +++ /dev/null @@ -1,16 +0,0 @@ -import http from 'http' -import httpProxy from 'http-proxy' - -const proxy = httpProxy.createProxyServer() -proxy.on('error', function (err, req, res) { - console.error(err) - res.writeHead(500, { 'Content-Type': 'text/plain' }) - res.end('500 Internal Server Error') -}) - -const server = http.createServer(function (req, res) { - const target = req.url.startsWith('/api/') ? 'http://127.0.0.1:8000' : 'http://localhost:8001' - proxy.web(req, res, { target, proxyTimeout: 250, timeout: 250 }) -}) -server.listen(3000) -console.log('Proxy on http://localhost:3000') From e440e4b7e0def43e90cd4e86762980947e5717a1 Mon Sep 17 00:00:00 2001 From: Niccolo Borgioli Date: Fri, 17 Jan 2025 18:11:26 +0100 Subject: [PATCH 2/4] update to svelte 5 --- package.json | 2 +- packages/frontend/package.json | 26 +- .../src/lib/icons/IconContrast.svelte | 2 + .../frontend/src/lib/icons/IconCopy.svelte | 2 + .../frontend/src/lib/icons/IconDice.svelte | 2 + .../frontend/src/lib/icons/IconEye.svelte | 2 + .../frontend/src/lib/icons/IconEyeOff.svelte | 2 + .../frontend/src/lib/ui/AboutParagraph.svelte | 11 +- .../src/lib/ui/AdvancedParameters.svelte | 20 +- packages/frontend/src/lib/ui/Button.svelte | 12 +- packages/frontend/src/lib/ui/Canvas.svelte | 14 +- .../frontend/src/lib/ui/FileUpload.svelte | 15 +- packages/frontend/src/lib/ui/Icon.svelte | 14 +- packages/frontend/src/lib/ui/Loader.svelte | 2 + .../frontend/src/lib/ui/NoteResult.svelte | 12 +- packages/frontend/src/lib/ui/ShowNote.svelte | 38 +- packages/frontend/src/lib/ui/Switch.svelte | 15 +- packages/frontend/src/lib/ui/TextArea.svelte | 11 +- packages/frontend/src/lib/ui/TextInput.svelte | 58 +- .../frontend/src/lib/ui/ThemeToggle.svelte | 23 +- packages/frontend/src/lib/views/Create.svelte | 53 +- packages/frontend/src/lib/views/Header.svelte | 2 +- packages/frontend/src/routes/+layout.svelte | 7 +- .../frontend/src/routes/imprint/+page.svelte | 20 +- .../src/routes/note/[id]/+page.svelte | 25 +- pnpm-lock.yaml | 2302 +++++------------ 26 files changed, 954 insertions(+), 1738 deletions(-) diff --git a/package.json b/package.json index 4550ca1..ee16149 100644 --- a/package.json +++ b/package.json @@ -17,5 +17,5 @@ "npm-run-all": "^4.1.5", "shelljs": "^0.8.5" }, - "packageManager": "pnpm@9.11.0" + "packageManager": "pnpm@9.15.4" } diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 91a147e..d162a45 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -13,23 +13,23 @@ }, "type": "module", "devDependencies": { - "@lokalise/node-api": "^12.1.0", - "@sveltejs/adapter-static": "^3.0.1", - "@sveltejs/kit": "^2.5.2", - "@sveltejs/vite-plugin-svelte": "^3.0.2", - "@zerodevx/svelte-toast": "^0.9.5", - "adm-zip": "^0.5.10", - "dotenv": "^16.4.5", - "svelte": "^4.2.12", - "svelte-check": "^3.6.6", + "@lokalise/node-api": "^13.0.0", + "@sveltejs/adapter-static": "^3.0.8", + "@sveltejs/kit": "^2.16.0", + "@sveltejs/vite-plugin-svelte": "^5.0.3", + "@zerodevx/svelte-toast": "^0.9.6", + "adm-zip": "^0.5.16", + "dotenv": "^16.4.7", + "svelte": "^5.19.0", + "svelte-check": "^4.1.4", "svelte-intl-precompile": "^0.12.3", - "tslib": "^2.6.2", - "typescript": "^5.3.3", - "vite": "^5.1.7" + "tslib": "^2.8.1", + "typescript": "^5.7.3", + "vite": "^6.0.7" }, "dependencies": { + "@fontsource/fira-mono": "^5.1.1", "cryptgeon": "workspace:*", - "@fontsource/fira-mono": "^5.0.8", "occulto": "^2.0.6", "pretty-bytes": "^6.1.1", "qrious": "^4.0.2" diff --git a/packages/frontend/src/lib/icons/IconContrast.svelte b/packages/frontend/src/lib/icons/IconContrast.svelte index a96c3dc..02d20e6 100644 --- a/packages/frontend/src/lib/icons/IconContrast.svelte +++ b/packages/frontend/src/lib/icons/IconContrast.svelte @@ -1,3 +1,5 @@ + + Contrast + Copy + Dice + Eye + Eye Off - export let title: string + import type { Snippet } from 'svelte' + + interface Props { + title: string + children?: Snippet + } + + let { title, children }: Props = $props()

▶ {title} - + {@render children?.()}