From 94eb46985aba08e74f08d7064eb7729a61398d94 Mon Sep 17 00:00:00 2001 From: Jacob Shuman <44483276+jacob-shuman@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:36:25 -0400 Subject: [PATCH] feat: upgrade to svelte 5 --- README.md | 34 +++-- package.json | 8 +- pnpm-lock.yaml | 197 +++++++++++---------------- src/lib/components/Button.svelte | 20 ++- src/lib/components/IconButton.svelte | 22 ++- src/lib/components/TextField.svelte | 23 +++- src/routes/+layout.svelte | 9 +- src/routes/+page.svelte | 29 ++-- src/routes/Article.svelte | 41 +++--- src/routes/ArticleCard.svelte | 6 +- svelte.config.js | 3 - 11 files changed, 192 insertions(+), 200 deletions(-) diff --git a/README.md b/README.md index c6a5094..d97f15f 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ You can **optionally** protect your reading list with a password by setting the ## :heavy_plus_sign: Add an article -**Requires Authentication** +:lock: **Requires Authentication** You can add an article by providing the article's url in the body of a `POST` request: @@ -107,11 +107,11 @@ You can add an article by providing the article's url in the body of a `POST` re | 200 | `article added successfully` | `undefined` | `application/json` | | 400 | `url is required` | `undefined` | `undefined` | | 400 | `unable to extract metadata at {url}` | `undefined` | `undefined` | -| 401 | `not authorized"` | `undefined` | `undefined` | +| 401 | `not authorized` | `undefined` | `undefined` | ## :page_facing_up: Get a single `JSON` article -**Requires Authentication** +:lock: **Requires Authentication** You can get a single `JSON` object representing an article by making a `GET` request to the `/articles/:id` route: @@ -122,12 +122,12 @@ You can get a single `JSON` object representing an article by making a `GET` req | Status | StatusText | Body | Content-Type | | ------ | ----------------------------------------- | ----------- | ------------------ | | 200 | `undefined` | `Article` | `application/json` | -| 401 | `not authorized"` | `undefined` | `undefined` | +| 401 | `not authorized` | `undefined` | `undefined` | | 404 | `there is no article with an id of ":id"` | `undefined` | `undefined` | ## :clipboard: Get a `JSON` array of all articles -**Requires Authentication** +:lock: **Requires Authentication** You can get a `JSON` array of articles by making a `GET` request to the `/articles` route: @@ -135,14 +135,14 @@ You can get a `JSON` array of articles by making a `GET` request to the `/articl ### Responses -| Status | StatusText | Body | Content-Type | -| ------ | ----------------- | ----------- | ------------------ | -| 200 | `undefined` | `Article[]` | `application/json` | -| 401 | `not authorized"` | `undefined` | `undefined` | +| Status | StatusText | Body | Content-Type | +| ------ | ---------------- | ----------- | ------------------ | +| 200 | `undefined` | `Article[]` | `application/json` | +| 401 | `not authorized` | `undefined` | `undefined` | ## :memo: Update an article -**Requires Authentication** +:lock: **Requires Authentication** You can update an article based on it's id by making a `PATCH` request to the `/articles/:id/update` route: @@ -171,12 +171,12 @@ You can update an article based on it's id by making a `PATCH` request to the `/ | Status | StatusText | Body | Content-Type | | ------ | ------------------------------------ | ----------- | ------------ | | 200 | `article :id deleted successfully` | `undefined` | `undefined` | -| 401 | `not authorized"` | `undefined` | `undefined` | +| 401 | `not authorized` | `undefined` | `undefined` | | 404 | `there is no article with id of :id` | `undefined` | `undefined` | ## :wastebasket: Delete an article -**Requires Authentication** +:lock: **Requires Authentication** You can delete an article based on it's id by making a `DELETE` request to the `/articles/:id/delete` route: @@ -192,7 +192,7 @@ You can delete an article based on it's id by making a `DELETE` request to the ` ## :wastebasket: Remove all articles -**Requires Authentication** +:lock: **Requires Authentication** `DELETE (http|https)://HOST:PORT/articles/clear` @@ -205,7 +205,7 @@ You can delete an article based on it's id by making a `DELETE` request to the ` ## :wastebasket: Purge old articles -**Requires Authentication** +:lock: **Requires Authentication** You can manually purge articles older than a certain threshhold using the `/articles/purge` route. Simply pass an `older_than` query parameter in the url with the following format: @@ -216,6 +216,12 @@ m = months y = years h|d|m|y + +Examples + +30d = 30 days +4m = 4 months +2y = 2 years ``` > Please note the `older_than` parameter does **not** accept numbers with decimals. diff --git a/package.json b/package.json index 2e29247..9d6cd45 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@iconify/svelte": "^4.0.2", "@sveltejs/adapter-node": "^5.2.2", "@sveltejs/kit": "^2.0.0", - "@sveltejs/vite-plugin-svelte": "^3.0.0", + "@sveltejs/vite-plugin-svelte": "4.0.0-next.7", "@types/better-sqlite3": "^7.6.11", "@types/eslint": "^9.6.0", "@types/rss": "^0.0.32", @@ -36,11 +36,11 @@ "jose": "^5.8.0", "kysely": "^0.27.4", "kysely-ctl": "^0.9.0", - "prettier": "^3.1.1", - "prettier-plugin-svelte": "^3.1.2", + "prettier": "^3.3.3", + "prettier-plugin-svelte": "^3.2.6", "prettier-plugin-tailwindcss": "^0.6.5", "radash": "^12.1.0", - "svelte": "^4.2.7", + "svelte": "5.0.0-next.244", "svelte-check": "^3.6.0", "tailwind-merge": "^2.5.2", "tailwindcss": "^3.4.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 43a9463..dcf74c9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,16 +23,16 @@ importers: version: 5.0.20 '@iconify/svelte': specifier: ^4.0.2 - version: 4.0.2(svelte@4.2.19) + version: 4.0.2(svelte@5.0.0-next.244) '@sveltejs/adapter-node': specifier: ^5.2.2 - version: 5.2.2(@sveltejs/kit@2.5.24(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)))(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0))) + version: 5.2.2(@sveltejs/kit@2.5.24(@sveltejs/vite-plugin-svelte@4.0.0-next.7(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)))(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0))) '@sveltejs/kit': specifier: ^2.0.0 - version: 2.5.24(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)))(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)) + version: 2.5.24(@sveltejs/vite-plugin-svelte@4.0.0-next.7(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)))(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)) '@sveltejs/vite-plugin-svelte': - specifier: ^3.0.0 - version: 3.1.2(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)) + specifier: 4.0.0-next.7 + version: 4.0.0-next.7(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)) '@types/better-sqlite3': specifier: ^7.6.11 version: 7.6.11 @@ -59,7 +59,7 @@ importers: version: 9.1.0(eslint@9.9.1(jiti@1.21.6)) eslint-plugin-svelte: specifier: ^2.36.0 - version: 2.43.0(eslint@9.9.1(jiti@1.21.6))(svelte@4.2.19) + version: 2.43.0(eslint@9.9.1(jiti@1.21.6))(svelte@5.0.0-next.244) feed: specifier: ^4.2.2 version: 4.2.2 @@ -76,23 +76,23 @@ importers: specifier: ^0.9.0 version: 0.9.0(kysely@0.27.4) prettier: - specifier: ^3.1.1 + specifier: ^3.3.3 version: 3.3.3 prettier-plugin-svelte: - specifier: ^3.1.2 - version: 3.2.6(prettier@3.3.3)(svelte@4.2.19) + specifier: ^3.2.6 + version: 3.2.6(prettier@3.3.3)(svelte@5.0.0-next.244) prettier-plugin-tailwindcss: specifier: ^0.6.5 - version: 0.6.6(prettier-plugin-svelte@3.2.6(prettier@3.3.3)(svelte@4.2.19))(prettier@3.3.3) + version: 0.6.6(prettier-plugin-svelte@3.2.6(prettier@3.3.3)(svelte@5.0.0-next.244))(prettier@3.3.3) radash: specifier: ^12.1.0 version: 12.1.0 svelte: - specifier: ^4.2.7 - version: 4.2.19 + specifier: 5.0.0-next.244 + version: 5.0.0-next.244 svelte-check: specifier: ^3.6.0 - version: 3.8.6(postcss-load-config@4.0.2(postcss@8.4.41))(postcss@8.4.41)(svelte@4.2.19) + version: 3.8.6(postcss-load-config@4.0.2(postcss@8.4.41))(postcss@8.4.41)(svelte@5.0.0-next.244) tailwind-merge: specifier: ^2.5.2 version: 2.5.2 @@ -628,19 +628,19 @@ packages: svelte: ^4.0.0 || ^5.0.0-next.0 vite: ^5.0.3 - '@sveltejs/vite-plugin-svelte-inspector@2.1.0': - resolution: {integrity: sha512-9QX28IymvBlSCqsCll5t0kQVxipsfhFFL+L2t3nTWfXnddYwxBuAEtTtlaVQpRz9c37BhJjltSeY4AJSC03SSg==} - engines: {node: ^18.0.0 || >=20} + '@sveltejs/vite-plugin-svelte-inspector@3.0.0-next.3': + resolution: {integrity: sha512-kuGJ2CZ5lAw3gKF8Kw0AfKtUJWbwdlDHY14K413B0MCyrzvQvsKTorwmwZcky0+QqY6RnVIZ/5FttB9bQmkLXg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22} peerDependencies: - '@sveltejs/vite-plugin-svelte': ^3.0.0 - svelte: ^4.0.0 || ^5.0.0-next.0 + '@sveltejs/vite-plugin-svelte': ^4.0.0-next.0||^4.0.0 + svelte: ^5.0.0-next.96 || ^5.0.0 vite: ^5.0.0 - '@sveltejs/vite-plugin-svelte@3.1.2': - resolution: {integrity: sha512-Txsm1tJvtiYeLUVRNqxZGKR/mI+CzuIQuc2gn+YCs9rMTowpNZ2Nqt53JdL8KF9bLhAf2ruR/dr9eZCwdTriRA==} - engines: {node: ^18.0.0 || >=20} + '@sveltejs/vite-plugin-svelte@4.0.0-next.7': + resolution: {integrity: sha512-yMUnAqquoayvBDztk1rWUgdtvjv7YcHgopCAB7sWl9SQht8U/7lqwTlJU0ZTAY09pFFRe6bbakd7YoiyyIvJiA==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22} peerDependencies: - svelte: ^4.0.0 || ^5.0.0-next.0 + svelte: ^5.0.0-next.96 || ^5.0.0 vite: ^5.0.0 '@types/better-sqlite3@7.6.11': @@ -732,6 +732,11 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + acorn-typescript@1.4.13: + resolution: {integrity: sha512-xsc9Xv0xlVfwp2o7sQ+GCQ1PgbkdcpWdTzrwXxO3xDMTAywVS3oXVOcOHuRjAPkS4P9b+yc/qNF15460v+jp4Q==} + peerDependencies: + acorn: '>=8.9.0' + acorn@8.12.1: resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} engines: {node: '>=0.4.0'} @@ -884,9 +889,6 @@ packages: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} - code-red@1.0.4: - resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} - color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} @@ -925,10 +927,6 @@ packages: css-select@5.1.0: resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} - css-tree@2.3.1: - resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} - engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} - css-what@6.1.0: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} @@ -1116,6 +1114,9 @@ packages: resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} engines: {node: '>=0.10'} + esrap@1.2.2: + resolution: {integrity: sha512-F2pSJklxx1BlQIQgooczXCPHmcWpn6EsP5oo73LQfonG9fIlIENQ8vMmfGXeojP9MrkzUNAfyU5vdFlR9shHAw==} + esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} @@ -1127,9 +1128,6 @@ packages: estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - estree-walker@3.0.3: - resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} - esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -1446,9 +1444,6 @@ packages: magic-string@0.30.11: resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} - mdn-data@2.0.30: - resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} - merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -1653,9 +1648,6 @@ packages: perfect-debounce@1.0.0: resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} - periscopic@3.1.0: - resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} - picocolors@1.0.1: resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} @@ -1998,12 +1990,6 @@ packages: svelte: optional: true - svelte-hmr@0.16.0: - resolution: {integrity: sha512-Gyc7cOS3VJzLlfj7wKS0ZnzDVdv3Pn2IuVeJPk9m2skfhcu5bq3wtIZyQGggr7/Iim5rH5cncyQft/kRLupcnA==} - engines: {node: ^12.20 || ^14.13.1 || >= 16} - peerDependencies: - svelte: ^3.19.0 || ^4.0.0 - svelte-preprocess@5.1.4: resolution: {integrity: sha512-IvnbQ6D6Ao3Gg6ftiM5tdbR6aAETwjhHV+UKGf5bHGYR69RQvF1ho0JKPcbUON4vy4R7zom13jPjgdOWCQ5hDA==} engines: {node: '>= 16.0.0'} @@ -2041,9 +2027,9 @@ packages: typescript: optional: true - svelte@4.2.19: - resolution: {integrity: sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==} - engines: {node: '>=16'} + svelte@5.0.0-next.244: + resolution: {integrity: sha512-whSOcKdpuAFd5xD9J2EhuHeRs4J4nHis6NSUKRXpC3HQoCmsoKhyIldMjiv6QFkQpe6QMsid8lwvgLXkZTSC/A==} + engines: {node: '>=18'} tailwind-merge@2.5.2: resolution: {integrity: sha512-kjEBm+pvD+6eAwzJL2Bi+02/9LFLal1Gs61+QB7HvTfQQ0aXwC5LGT8PEt1gS0CWKktKe6ysPTAy3cBC5MeiIg==} @@ -2175,8 +2161,8 @@ packages: terser: optional: true - vitefu@0.2.5: - resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} + vitefu@1.0.2: + resolution: {integrity: sha512-0/iAvbXyM3RiPPJ4lyD4w6Mjgtf4ejTK6TPvTNG3H32PLwuT0N/ZjJLiXug7ETE/LWtTeHw9WRv7uX/tIKYyKg==} peerDependencies: vite: ^3.0.0 || ^4.0.0 || ^5.0.0 peerDependenciesMeta: @@ -2229,6 +2215,9 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + zimmerframe@1.1.2: + resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==} + snapshots: '@alloc/quick-lru@5.2.0': {} @@ -2430,10 +2419,10 @@ snapshots: '@humanwhocodes/retry@0.3.0': {} - '@iconify/svelte@4.0.2(svelte@4.2.19)': + '@iconify/svelte@4.0.2(svelte@5.0.0-next.244)': dependencies: '@iconify/types': 2.0.0 - svelte: 4.2.19 + svelte: 5.0.0-next.244 '@iconify/types@2.0.0': {} @@ -2566,17 +2555,17 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.21.0': optional: true - '@sveltejs/adapter-node@5.2.2(@sveltejs/kit@2.5.24(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)))(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)))': + '@sveltejs/adapter-node@5.2.2(@sveltejs/kit@2.5.24(@sveltejs/vite-plugin-svelte@4.0.0-next.7(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)))(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)))': dependencies: '@rollup/plugin-commonjs': 26.0.1(rollup@4.21.0) '@rollup/plugin-json': 6.1.0(rollup@4.21.0) '@rollup/plugin-node-resolve': 15.2.3(rollup@4.21.0) - '@sveltejs/kit': 2.5.24(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)))(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)) + '@sveltejs/kit': 2.5.24(@sveltejs/vite-plugin-svelte@4.0.0-next.7(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)))(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)) rollup: 4.21.0 - '@sveltejs/kit@2.5.24(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)))(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0))': + '@sveltejs/kit@2.5.24(@sveltejs/vite-plugin-svelte@4.0.0-next.7(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)))(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.2(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)) + '@sveltejs/vite-plugin-svelte': 4.0.0-next.7(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)) '@types/cookie': 0.6.0 cookie: 0.6.0 devalue: 5.0.0 @@ -2588,30 +2577,29 @@ snapshots: sade: 1.8.1 set-cookie-parser: 2.7.0 sirv: 2.0.4 - svelte: 4.2.19 + svelte: 5.0.0-next.244 tiny-glob: 0.2.9 vite: 5.4.2(@types/node@22.5.0) - '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)))(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0))': + '@sveltejs/vite-plugin-svelte-inspector@3.0.0-next.3(@sveltejs/vite-plugin-svelte@4.0.0-next.7(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)))(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.2(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)) + '@sveltejs/vite-plugin-svelte': 4.0.0-next.7(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)) debug: 4.3.6 - svelte: 4.2.19 + svelte: 5.0.0-next.244 vite: 5.4.2(@types/node@22.5.0) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0))': + '@sveltejs/vite-plugin-svelte@4.0.0-next.7(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)))(svelte@4.2.19)(vite@5.4.2(@types/node@22.5.0)) + '@sveltejs/vite-plugin-svelte-inspector': 3.0.0-next.3(@sveltejs/vite-plugin-svelte@4.0.0-next.7(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)))(svelte@5.0.0-next.244)(vite@5.4.2(@types/node@22.5.0)) debug: 4.3.6 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.11 - svelte: 4.2.19 - svelte-hmr: 0.16.0(svelte@4.2.19) + svelte: 5.0.0-next.244 vite: 5.4.2(@types/node@22.5.0) - vitefu: 0.2.5(vite@5.4.2(@types/node@22.5.0)) + vitefu: 1.0.2(vite@5.4.2(@types/node@22.5.0)) transitivePeerDependencies: - supports-color @@ -2725,6 +2713,10 @@ snapshots: dependencies: acorn: 8.12.1 + acorn-typescript@1.4.13(acorn@8.12.1): + dependencies: + acorn: 8.12.1 + acorn@8.12.1: {} ajv@6.12.6: @@ -2877,14 +2869,6 @@ snapshots: clsx@2.1.1: {} - code-red@1.0.4: - dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 - '@types/estree': 1.0.5 - acorn: 8.12.1 - estree-walker: 3.0.3 - periscopic: 3.1.0 - color-convert@2.0.1: dependencies: color-name: 1.1.4 @@ -2923,11 +2907,6 @@ snapshots: domutils: 3.1.0 nth-check: 2.1.1 - css-tree@2.3.1: - dependencies: - mdn-data: 2.0.30 - source-map-js: 1.2.0 - css-what@6.1.0: {} cssesc@3.0.0: {} @@ -3070,7 +3049,7 @@ snapshots: dependencies: eslint: 9.9.1(jiti@1.21.6) - eslint-plugin-svelte@2.43.0(eslint@9.9.1(jiti@1.21.6))(svelte@4.2.19): + eslint-plugin-svelte@2.43.0(eslint@9.9.1(jiti@1.21.6))(svelte@5.0.0-next.244): dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1(jiti@1.21.6)) '@jridgewell/sourcemap-codec': 1.5.0 @@ -3083,9 +3062,9 @@ snapshots: postcss-safe-parser: 6.0.0(postcss@8.4.41) postcss-selector-parser: 6.1.2 semver: 7.6.3 - svelte-eslint-parser: 0.41.0(svelte@4.2.19) + svelte-eslint-parser: 0.41.0(svelte@5.0.0-next.244) optionalDependencies: - svelte: 4.2.19 + svelte: 5.0.0-next.244 transitivePeerDependencies: - ts-node @@ -3162,6 +3141,11 @@ snapshots: dependencies: estraverse: 5.3.0 + esrap@1.2.2: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.0 + '@types/estree': 1.0.5 + esrecurse@4.3.0: dependencies: estraverse: 5.3.0 @@ -3170,10 +3154,6 @@ snapshots: estree-walker@2.0.2: {} - estree-walker@3.0.3: - dependencies: - '@types/estree': 1.0.5 - esutils@2.0.3: {} execa@8.0.1: @@ -3484,8 +3464,6 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 - mdn-data@2.0.30: {} - merge-stream@2.0.0: {} merge2@1.4.1: {} @@ -3656,12 +3634,6 @@ snapshots: perfect-debounce@1.0.0: {} - periscopic@3.1.0: - dependencies: - '@types/estree': 1.0.5 - estree-walker: 3.0.3 - is-reference: 3.0.2 - picocolors@1.0.1: {} picomatch@2.3.1: {} @@ -3745,16 +3717,16 @@ snapshots: prelude-ls@1.2.1: {} - prettier-plugin-svelte@3.2.6(prettier@3.3.3)(svelte@4.2.19): + prettier-plugin-svelte@3.2.6(prettier@3.3.3)(svelte@5.0.0-next.244): dependencies: prettier: 3.3.3 - svelte: 4.2.19 + svelte: 5.0.0-next.244 - prettier-plugin-tailwindcss@0.6.6(prettier-plugin-svelte@3.2.6(prettier@3.3.3)(svelte@4.2.19))(prettier@3.3.3): + prettier-plugin-tailwindcss@0.6.6(prettier-plugin-svelte@3.2.6(prettier@3.3.3)(svelte@5.0.0-next.244))(prettier@3.3.3): dependencies: prettier: 3.3.3 optionalDependencies: - prettier-plugin-svelte: 3.2.6(prettier@3.3.3)(svelte@4.2.19) + prettier-plugin-svelte: 3.2.6(prettier@3.3.3)(svelte@5.0.0-next.244) prettier@3.3.3: {} @@ -3950,14 +3922,14 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-check@3.8.6(postcss-load-config@4.0.2(postcss@8.4.41))(postcss@8.4.41)(svelte@4.2.19): + svelte-check@3.8.6(postcss-load-config@4.0.2(postcss@8.4.41))(postcss@8.4.41)(svelte@5.0.0-next.244): dependencies: '@jridgewell/trace-mapping': 0.3.25 chokidar: 3.6.0 picocolors: 1.0.1 sade: 1.8.1 - svelte: 4.2.19 - svelte-preprocess: 5.1.4(postcss-load-config@4.0.2(postcss@8.4.41))(postcss@8.4.41)(svelte@4.2.19)(typescript@5.5.4) + svelte: 5.0.0-next.244 + svelte-preprocess: 5.1.4(postcss-load-config@4.0.2(postcss@8.4.41))(postcss@8.4.41)(svelte@5.0.0-next.244)(typescript@5.5.4) typescript: 5.5.4 transitivePeerDependencies: - '@babel/core' @@ -3970,7 +3942,7 @@ snapshots: - stylus - sugarss - svelte-eslint-parser@0.41.0(svelte@4.2.19): + svelte-eslint-parser@0.41.0(svelte@5.0.0-next.244): dependencies: eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 @@ -3978,41 +3950,36 @@ snapshots: postcss: 8.4.41 postcss-scss: 4.0.9(postcss@8.4.41) optionalDependencies: - svelte: 4.2.19 + svelte: 5.0.0-next.244 - svelte-hmr@0.16.0(svelte@4.2.19): - dependencies: - svelte: 4.2.19 - - svelte-preprocess@5.1.4(postcss-load-config@4.0.2(postcss@8.4.41))(postcss@8.4.41)(svelte@4.2.19)(typescript@5.5.4): + svelte-preprocess@5.1.4(postcss-load-config@4.0.2(postcss@8.4.41))(postcss@8.4.41)(svelte@5.0.0-next.244)(typescript@5.5.4): dependencies: '@types/pug': 2.0.10 detect-indent: 6.1.0 magic-string: 0.30.11 sorcery: 0.11.1 strip-indent: 3.0.0 - svelte: 4.2.19 + svelte: 5.0.0-next.244 optionalDependencies: postcss: 8.4.41 postcss-load-config: 4.0.2(postcss@8.4.41) typescript: 5.5.4 - svelte@4.2.19: + svelte@5.0.0-next.244: dependencies: '@ampproject/remapping': 2.3.0 '@jridgewell/sourcemap-codec': 1.5.0 - '@jridgewell/trace-mapping': 0.3.25 '@types/estree': 1.0.5 acorn: 8.12.1 + acorn-typescript: 1.4.13(acorn@8.12.1) aria-query: 5.3.0 axobject-query: 4.1.0 - code-red: 1.0.4 - css-tree: 2.3.1 - estree-walker: 3.0.3 + esm-env: 1.0.0 + esrap: 1.2.2 is-reference: 3.0.2 locate-character: 3.0.0 magic-string: 0.30.11 - periscopic: 3.1.0 + zimmerframe: 1.1.2 tailwind-merge@2.5.2: {} @@ -4151,7 +4118,7 @@ snapshots: '@types/node': 22.5.0 fsevents: 2.3.3 - vitefu@0.2.5(vite@5.4.2(@types/node@22.5.0)): + vitefu@1.0.2(vite@5.4.2(@types/node@22.5.0)): optionalDependencies: vite: 5.4.2(@types/node@22.5.0) @@ -4193,3 +4160,5 @@ snapshots: yaml@2.5.0: {} yocto-queue@0.1.0: {} + + zimmerframe@1.1.2: {} diff --git a/src/lib/components/Button.svelte b/src/lib/components/Button.svelte index fc2a5df..da1f4ae 100644 --- a/src/lib/components/Button.svelte +++ b/src/lib/components/Button.svelte @@ -1,11 +1,19 @@ +{#snippet _icon()} + +{/snippet} + {#if href} - + {@render _icon()} {:else} - {/if} diff --git a/src/lib/components/TextField.svelte b/src/lib/components/TextField.svelte index ad38917..0711f53 100644 --- a/src/lib/components/TextField.svelte +++ b/src/lib/components/TextField.svelte @@ -2,12 +2,21 @@ import tw from 'clsx'; import type { HTMLInputAttributes } from 'svelte/elements'; - export let required: HTMLInputAttributes['required'] = undefined; - export let type: HTMLInputAttributes['type'] = undefined; - export let name: HTMLInputAttributes['name'] = undefined; - export let placeholder: HTMLInputAttributes['placeholder'] = undefined; - export let label: string | undefined = undefined; - export let error: string | undefined = undefined; + let { + required, + type, + name, + placeholder, + label, + error + }: { + required?: HTMLInputAttributes['required']; + type?: HTMLInputAttributes['type']; + name?: HTMLInputAttributes['name']; + placeholder?: HTMLInputAttributes['placeholder']; + label?: string; + error?: string; + } = $props();
@@ -29,7 +38,7 @@ class={tw( 'duration-100 ease-out motion-safe:transition-all', 'w-full bg-transparent p-3 font-mono text-lg', - 'border-gray-light border border-dashed hover:border-solid', + 'border border-dashed border-gray-light hover:border-solid', 'focus:border-solid focus:border-white focus:outline-none' )} /> diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 94bba92..6efef68 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -3,13 +3,12 @@ import '@fontsource/unifrakturmaguntia'; import '../app.css'; - export let data; - $: ({ title, description } = data); + let { data, children } = $props(); - {title} - + {data.title} + - +{@render children()} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 835b961..d6c3839 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -5,10 +5,8 @@ import Article from './Article.svelte'; import ArticleCard from './ArticleCard.svelte'; - export let data; - $: ({ title, articles, description } = data); - - let isMounted = false; + let { data } = $props(); + let isMounted = $state(false); onMount(() => { isMounted = true; @@ -30,11 +28,11 @@ {#if isMounted}
-

{title}

-

{description}

+

{data.title}

+

{data.description}

{new Date().toDateString()} - {articles.length} Article{articles.length !== 1 ? 's' : ''} + {data.articles.length} Article{data.articles.length !== 1 ? 's' : ''}

@@ -61,8 +59,8 @@
- {#if articles.length > 0} - {#each articles as article, index} + {#if data.articles.length > 0} + {#each data.articles as article, index}
{/each} {:else} @@ -86,15 +84,16 @@ - + - - + + {/if}
{/if} @@ -111,7 +110,7 @@ } } - .fade-header { + .faded { animation: 250ms fade ease-out; } diff --git a/src/routes/Article.svelte b/src/routes/Article.svelte index 4f0815f..3e044b4 100644 --- a/src/routes/Article.svelte +++ b/src/routes/Article.svelte @@ -2,18 +2,26 @@ import { invalidateAll } from '$app/navigation'; import IconButton from '$lib/components/IconButton.svelte'; import { type Article } from '$lib/types'; - import { onMount } from 'svelte'; import ArticleCard from './ArticleCard.svelte'; - export let { fake, index, id, ttr, favicon, title, url, author, publish_date, description } = - $$props as Article & { - index: number; - fake?: boolean; - authCookie: any; - }; - - let isMounted = false; + let { + fake, + index, + id, + ttr, + favicon, + title, + url, + author, + publish_date, + description + }: Article & { + index: number; + fake?: boolean; + authCookie: any; + } = $props(); + let isMounted = $state(false); onMount(() => { setTimeout(() => (isMounted = true), 500 + 15 * index); @@ -64,18 +72,3 @@
{/if} - - diff --git a/src/routes/ArticleCard.svelte b/src/routes/ArticleCard.svelte index 8955f17..a03826b 100644 --- a/src/routes/ArticleCard.svelte +++ b/src/routes/ArticleCard.svelte @@ -1,5 +1,7 @@
- + {@render children()}