From 70fe4f2c328c8c1bce7c797cb5f689521451bbbe Mon Sep 17 00:00:00 2001 From: Izan Gil <66965250+SrIzan10@users.noreply.github.com> Date: Sun, 18 May 2025 21:14:10 +0200 Subject: [PATCH] feat: independent api routes and new station --- .gitignore | 1 + README.md | 16 +- package.json | 5 +- src/app.d.ts | 4 +- src/lib/components/app/daemon.svelte | 2 +- src/lib/types.ts | 13 +- src/lib/utils.ts | 8 +- .../api/dev/populateStations/+server.ts | 48 +++ src/routes/api/live/[stationId]/+server.ts | 40 ++ src/routes/api/stations/+server.ts | 27 ++ svelte.config.js | 5 +- yarn.lock | 367 +++++++++--------- 12 files changed, 328 insertions(+), 208 deletions(-) create mode 100644 src/routes/api/dev/populateStations/+server.ts create mode 100644 src/routes/api/live/[stationId]/+server.ts create mode 100644 src/routes/api/stations/+server.ts diff --git a/.gitignore b/.gitignore index 3b462cb..f3507f5 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ Thumbs.db # Vite vite.config.js.timestamp-* vite.config.ts.timestamp-* +.cloudflare \ No newline at end of file diff --git a/README.md b/README.md index 007d4fd..6955fbb 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,3 @@ -# chillhop +# lofi -The ultimate lofi player. Uses music from [Chillhop](https://chillhop.com/). - -## Features - -- [x] Play music -- [x] Change stations -- [x] Change backgrounds -- [ ] Background sounds -- [ ] Pomodoro timers -- [ ] Volume control -- [ ] Links to Spotify -- [ ] Alarm(?) -- [ ] Sleep timer \ No newline at end of file +The ultimate lofi player and productive tool. Uses music from [Chillhop](https://chillhop.com/) and others. diff --git a/package.json b/package.json index 35c63d3..66bccb0 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,10 @@ "format": "prettier --write ." }, "devDependencies": { + "@cloudflare/workers-types": "^4.20250517.0", "@lucide/svelte": "^0.492.0", "@sveltejs/adapter-auto": "^6.0.0", - "@sveltejs/adapter-cloudflare": "^5.0.1", + "@sveltejs/adapter-cloudflare": "^7.0.3", "@sveltejs/kit": "^2.16.0", "@sveltejs/vite-plugin-svelte": "^5.0.0", "autoprefixer": "^10.4.20", @@ -33,7 +34,7 @@ "tailwindcss-animate": "^1.0.7", "typescript": "^5.0.0", "vite": "^6.0.0", - "wrangler": "^4.12.0" + "wrangler": "^4.15.2" }, "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e", "dependencies": { diff --git a/src/app.d.ts b/src/app.d.ts index 520c421..b992e0d 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -6,7 +6,9 @@ declare global { // interface Locals {} // interface PageData {} // interface PageState {} - // interface Platform {} + interface Platform { + caches: CacheStorage & { default: Cache }; + } } } diff --git a/src/lib/components/app/daemon.svelte b/src/lib/components/app/daemon.svelte index 7d7054f..8c9ed09 100644 --- a/src/lib/components/app/daemon.svelte +++ b/src/lib/components/app/daemon.svelte @@ -217,7 +217,7 @@ {#if !appState.isLoading}