From 01dcd1860abe55e0cb823cab417de84539f049d0 Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 24 Oct 2024 20:41:40 +0800 Subject: [PATCH] Migrate to svelte 5 --- package.json | 2 +- pnpm-lock.yaml | 150 +++++++++----------- site/package.json | 4 +- site/src/components/Analysis.svelte | 13 +- site/src/components/Label.svelte | 13 +- site/src/components/Loading.svelte | 10 +- site/src/components/NpmSearchInput.svelte | 43 +++--- site/src/components/PackageVersion.svelte | 41 +++--- site/src/components/PkgNode.svelte | 55 +++++--- site/src/main.js | 3 +- site/src/pages/Home.svelte | 2 +- site/src/pages/Package.svelte | 158 ++++++++++++---------- 12 files changed, 270 insertions(+), 224 deletions(-) diff --git a/package.json b/package.json index 90dd7a3..b142224 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@types/pnpapi": "^0.0.5", "prettier": "^3.3.3", "prettier-plugin-svelte": "^3.2.7", - "svelte": "^4.2.19", + "svelte": "^5.1.0", "typescript": "^5.6.3" } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1317cb4..438ac8b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,10 +19,10 @@ importers: version: 3.3.3 prettier-plugin-svelte: specifier: ^3.2.7 - version: 3.2.7(prettier@3.3.3)(svelte@4.2.19) + version: 3.2.7(prettier@3.3.3)(svelte@5.1.0) svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.0 + version: 5.1.0 typescript: specifier: ^5.6.3 version: 5.6.3 @@ -77,8 +77,8 @@ importers: version: link:../pkg devDependencies: '@sveltejs/vite-plugin-svelte': - specifier: ^3.1.2 - version: 3.1.2(svelte@4.2.19)(vite@5.4.10(@types/node@22.7.9)) + specifier: ^4.0.0 + version: 4.0.0(svelte@5.1.0)(vite@5.4.10(@types/node@22.7.9)) '@unocss/core': specifier: ^0.63.6 version: 0.63.6 @@ -116,8 +116,8 @@ importers: specifier: ^1.22.0 version: 1.22.0 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.0 + version: 5.1.0 unified: specifier: ^11.0.5 version: 11.0.5 @@ -561,19 +561,19 @@ packages: '@shikijs/vscode-textmate@9.3.0': resolution: {integrity: sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==} - '@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.1': + resolution: {integrity: sha512-2CKypmj1sM4GE7HjllT7UKmo4Q6L5xFRd7VMGEWhYnZ+wc6AUVU01IBd7yUi6WnFndEwWoMNOd6e8UjoN0nbvQ==} + 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': + resolution: {integrity: sha512-kpVJwF+gNiMEsoHaw+FJL76IYiwBikkxYU83+BpqQLdVMff19KeRKLd2wisS8niNBMJ2omv5gG+iGDDwd8jzag==} + 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/debug@4.1.12': @@ -669,6 +669,11 @@ packages: '@vue/shared@3.5.12': resolution: {integrity: sha512-L2RPSAwUFbgZH20etwrXyVyCBu9OxRSi8T/38QsvnkJyvq2LufW2lDCOzm7t/U9C1mkhJGWYfCuFBCmIuNivrg==} + acorn-typescript@1.4.13: + resolution: {integrity: sha512-xsc9Xv0xlVfwp2o7sQ+GCQ1PgbkdcpWdTzrwXxO3xDMTAywVS3oXVOcOHuRjAPkS4P9b+yc/qNF15460v+jp4Q==} + peerDependencies: + acorn: '>=8.9.0' + acorn@8.13.0: resolution: {integrity: sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==} engines: {node: '>=0.4.0'} @@ -725,16 +730,9 @@ packages: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} - code-red@1.0.4: - resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} - comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} - 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} - csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} @@ -789,12 +787,15 @@ packages: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} + esm-env@1.0.0: + resolution: {integrity: sha512-Cf6VksWPsTuW01vU9Mk/3vRue91Zevka5SjyNf3nEpokFRuqt/KjUQoGAwq9qMmhpLTHmXzSIrFRw8zxWzmFBA==} + + esrap@1.2.2: + resolution: {integrity: sha512-F2pSJklxx1BlQIQgooczXCPHmcWpn6EsP5oo73LQfonG9fIlIENQ8vMmfGXeojP9MrkzUNAfyU5vdFlR9shHAw==} + estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - estree-walker@3.0.3: - resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} - extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} @@ -960,9 +961,6 @@ packages: mdast-util-to-string@4.0.0: resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} - mdn-data@2.0.30: - resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} - micromark-core-commonmark@2.0.1: resolution: {integrity: sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA==} @@ -1103,9 +1101,6 @@ packages: pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} - periscopic@3.1.0: - resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} - picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -1195,15 +1190,9 @@ packages: stringify-entities@4.0.4: resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==} - 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@4.2.19: - resolution: {integrity: sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==} - engines: {node: '>=16'} + svelte@5.1.0: + resolution: {integrity: sha512-qD0pUvL3P26Vx+K1VodZROSu7MjDHFDunEVZ+2d3LUDWHyYI87AJFOIws0HufKWHDgXbPO4FCSugmysnX4LDwA==} + engines: {node: '>=18'} tinyglobby@0.2.9: resolution: {integrity: sha512-8or1+BGEdk1Zkkw2ii16qSS7uVrQJPre5A9o/XkWPATkk23FZh/15BKFxPnlTy6vkljZxLqYCzzBMj30ZrSvjw==} @@ -1299,10 +1288,10 @@ packages: terser: optional: true - vitefu@0.2.5: - resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} + vitefu@1.0.3: + resolution: {integrity: sha512-iKKfOMBHob2WxEJbqbJjHAkmYgvFDPhuqrO82om83S8RLk+17FtyMBfcyeH8GqD0ihShtkMW/zzJgiA51hCNCQ==} peerDependencies: - vite: ^3.0.0 || ^4.0.0 || ^5.0.0 + vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0-beta.0 peerDependenciesMeta: vite: optional: true @@ -1325,6 +1314,9 @@ packages: resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} engines: {node: '>=12.20'} + zimmerframe@1.1.2: + resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==} + zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} @@ -1593,26 +1585,25 @@ snapshots: '@shikijs/vscode-textmate@9.3.0': {} - '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.10(@types/node@22.7.9)))(svelte@4.2.19)(vite@5.4.10(@types/node@22.7.9))': + '@sveltejs/vite-plugin-svelte-inspector@3.0.1(@sveltejs/vite-plugin-svelte@4.0.0(svelte@5.1.0)(vite@5.4.10(@types/node@22.7.9)))(svelte@5.1.0)(vite@5.4.10(@types/node@22.7.9))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.2(svelte@4.2.19)(vite@5.4.10(@types/node@22.7.9)) + '@sveltejs/vite-plugin-svelte': 4.0.0(svelte@5.1.0)(vite@5.4.10(@types/node@22.7.9)) debug: 4.3.7 - svelte: 4.2.19 + svelte: 5.1.0 vite: 5.4.10(@types/node@22.7.9) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.10(@types/node@22.7.9))': + '@sveltejs/vite-plugin-svelte@4.0.0(svelte@5.1.0)(vite@5.4.10(@types/node@22.7.9))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.10(@types/node@22.7.9)))(svelte@4.2.19)(vite@5.4.10(@types/node@22.7.9)) + '@sveltejs/vite-plugin-svelte-inspector': 3.0.1(@sveltejs/vite-plugin-svelte@4.0.0(svelte@5.1.0)(vite@5.4.10(@types/node@22.7.9)))(svelte@5.1.0)(vite@5.4.10(@types/node@22.7.9)) debug: 4.3.7 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.12 - svelte: 4.2.19 - svelte-hmr: 0.16.0(svelte@4.2.19) + svelte: 5.1.0 vite: 5.4.10(@types/node@22.7.9) - vitefu: 0.2.5(vite@5.4.10(@types/node@22.7.9)) + vitefu: 1.0.3(vite@5.4.10(@types/node@22.7.9)) transitivePeerDependencies: - supports-color @@ -1763,6 +1754,10 @@ snapshots: '@vue/shared@3.5.12': {} + acorn-typescript@1.4.13(acorn@8.13.0): + dependencies: + acorn: 8.13.0 + acorn@8.13.0: {} anymatch@3.1.3: @@ -1813,21 +1808,8 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - code-red@1.0.4: - dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 - '@types/estree': 1.0.6 - acorn: 8.13.0 - estree-walker: 3.0.3 - periscopic: 3.1.0 - comma-separated-tokens@2.0.3: {} - css-tree@2.3.1: - dependencies: - mdn-data: 2.0.30 - source-map-js: 1.2.1 - csstype@3.1.3: {} debug@4.3.7: @@ -1909,12 +1891,15 @@ snapshots: escape-string-regexp@5.0.0: {} - estree-walker@2.0.2: {} + esm-env@1.0.0: {} - estree-walker@3.0.3: + esrap@1.2.2: dependencies: + '@jridgewell/sourcemap-codec': 1.5.0 '@types/estree': 1.0.6 + estree-walker@2.0.2: {} + extend@3.0.2: {} fdir@6.4.2(picomatch@4.0.2): @@ -2158,8 +2143,6 @@ snapshots: dependencies: '@types/mdast': 4.0.4 - mdn-data@2.0.30: {} - micromark-core-commonmark@2.0.1: dependencies: decode-named-character-reference: 1.0.2 @@ -2396,12 +2379,6 @@ snapshots: pathe@1.1.2: {} - periscopic@3.1.0: - dependencies: - '@types/estree': 1.0.6 - estree-walker: 3.0.3 - is-reference: 3.0.2 - picocolors@1.1.1: {} picomatch@2.3.1: {} @@ -2414,10 +2391,10 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - prettier-plugin-svelte@3.2.7(prettier@3.3.3)(svelte@4.2.19): + prettier-plugin-svelte@3.2.7(prettier@3.3.3)(svelte@5.1.0): dependencies: prettier: 3.3.3 - svelte: 4.2.19 + svelte: 5.1.0 prettier@3.3.3: {} @@ -2547,26 +2524,21 @@ snapshots: character-entities-html4: 2.1.0 character-entities-legacy: 3.0.0 - svelte-hmr@0.16.0(svelte@4.2.19): - dependencies: - svelte: 4.2.19 - - svelte@4.2.19: + svelte@5.1.0: dependencies: '@ampproject/remapping': 2.3.0 '@jridgewell/sourcemap-codec': 1.5.0 - '@jridgewell/trace-mapping': 0.3.25 '@types/estree': 1.0.6 acorn: 8.13.0 + acorn-typescript: 1.4.13(acorn@8.13.0) aria-query: 5.3.2 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.12 - periscopic: 3.1.0 + zimmerframe: 1.1.2 tinyglobby@0.2.9: dependencies: @@ -2661,7 +2633,7 @@ snapshots: '@types/node': 22.7.9 fsevents: 2.3.3 - vitefu@0.2.5(vite@5.4.10(@types/node@22.7.9)): + vitefu@1.0.3(vite@5.4.10(@types/node@22.7.9)): optionalDependencies: vite: 5.4.10(@types/node@22.7.9) @@ -2685,4 +2657,6 @@ snapshots: yocto-queue@1.1.1: {} + zimmerframe@1.1.2: {} + zwitch@2.0.4: {} diff --git a/site/package.json b/site/package.json index bfdd45a..2fab514 100644 --- a/site/package.json +++ b/site/package.json @@ -16,7 +16,7 @@ "publint": "workspace:*" }, "devDependencies": { - "@sveltejs/vite-plugin-svelte": "^3.1.2", + "@sveltejs/vite-plugin-svelte": "^4.0.0", "@unocss/core": "^0.63.6", "@unocss/extractor-svelte": "^0.63.6", "@unocss/preset-uno": "^0.63.6", @@ -29,7 +29,7 @@ "remark-parse": "^11.0.0", "remark-rehype": "^11.1.1", "shiki": "^1.22.0", - "svelte": "^4.2.19", + "svelte": "^5.1.0", "unified": "^11.0.5", "unist-util-visit": "^5.0.0", "vite": "^5.4.10" diff --git a/site/src/components/Analysis.svelte b/site/src/components/Analysis.svelte index 1a48d01..239d397 100644 --- a/site/src/components/Analysis.svelte +++ b/site/src/components/Analysis.svelte @@ -4,10 +4,15 @@ import severityWarning from '../assets/severity-warning.svg' import severityError from '../assets/severity-error.svg' - /** @type {Record} */ - export let results + /** + * @typedef {Object} Props + * @property {Record} results + */ + + /** @type {Props} */ + let { results } = $props() - let open = false + let open = $state(false) /** * @param {number} num @@ -106,7 +111,7 @@ > diff --git a/site/src/components/Label.svelte b/site/src/components/Label.svelte index 2539000..3078668 100644 --- a/site/src/components/Label.svelte +++ b/site/src/components/Label.svelte @@ -1,7 +1,14 @@ @@ -8,7 +14,7 @@ class="lds-dual-ring text-gray-900 @dark:text-gray-100" style:--size={size + 'px'} style:--border={Math.max(size * 0.075, 1) + 'px'} -/> +>