diff --git a/.github/workflows/develop-ui.yaml b/.github/workflows/develop-ui.yaml index 911d08e59..f1ceb5a70 100644 --- a/.github/workflows/develop-ui.yaml +++ b/.github/workflows/develop-ui.yaml @@ -62,8 +62,8 @@ jobs: cache-dependency-path: './frontend/pnpm-lock.yaml' - run: pnpm install - run: pnpm run -r build # We need code/types generated by the build (e.g. gql/generated) - - run: pnpm run check --output machine - - run: pnpm run lint:report + - run: pnpm run -r check --output machine + - run: pnpm run -r lint:report - name: Annotate Code Linting REsults uses: ataylorme/eslint-annotate-action@d57a1193d4c59cbfbf3f86c271f42612f9dbd9e9 # v3.0.0 if: always() diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 1209d856f..8b82e5c8b 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -13,11 +13,11 @@ catalogs: specifier: ^4.2.19 version: 4.2.19 svelte-check: - specifier: ^3.7.1 - version: 3.7.1 + specifier: ^4.0.5 + version: 4.0.5 svelte-preprocess: - specifier: ^5.1.4 - version: 5.1.4 + specifier: ^6.0.3 + version: 6.0.3 tailwindcss: specifier: ^3.4.3 version: 3.4.3 @@ -212,13 +212,13 @@ importers: version: 4.2.19 svelte-check: specifier: 'catalog:' - version: 3.7.1(@babel/core@7.24.4)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19) + version: 4.0.5(picomatch@4.0.2)(svelte@4.2.19)(typescript@5.3.3) svelte-eslint-parser: specifier: ^0.33.1 version: 0.33.1(svelte@4.2.19) svelte-preprocess: specifier: 'catalog:' - version: 5.1.4(@babel/core@7.24.4)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.3.3) + version: 6.0.3(@babel/core@7.24.4)(postcss-load-config@6.0.1(jiti@1.21.0)(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.3.3) svelte-turnstile: specifier: ^0.5.0 version: 0.5.0(svelte@4.2.19) @@ -257,13 +257,13 @@ importers: devDependencies: '@vitejs/plugin-basic-ssl': specifier: ^1.1.0 - version: 1.1.0(vite@5.4.9(@types/node@20.12.12)) + version: 1.1.0(vite@5.4.9(@types/node@22.7.3)) typescript: specifier: 'catalog:' version: 5.3.3 vite: specifier: 'catalog:' - version: 5.4.9(@types/node@20.12.12) + version: 5.4.9(@types/node@22.7.3) viewer: dependencies: @@ -287,13 +287,13 @@ importers: version: 3.0.5(svelte@4.2.19) svelte-preprocess: specifier: 'catalog:' - version: 5.1.4(@babel/core@7.24.7)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.3.3) + version: 6.0.3(@babel/core@7.24.7)(postcss-load-config@6.0.1(jiti@1.21.0)(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.3.3) svelte-routing: specifier: ^2.12.0 version: 2.13.0 svelte-ux: - specifier: ^0.74.9 - version: 0.74.9(@babel/core@7.24.7)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19) + specifier: ^0.75.1 + version: 0.75.1(@babel/core@7.24.7)(postcss-load-config@6.0.1(jiti@1.21.0)(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19) type-fest: specifier: ^4.18.2 version: 4.18.2 @@ -309,7 +309,7 @@ importers: version: 7.4.47 '@sveltejs/vite-plugin-svelte': specifier: ^3.1.1 - version: 3.1.1(svelte@4.2.19)(vite@5.4.9(@types/node@20.12.12)) + version: 3.1.1(svelte@4.2.19)(vite@5.4.9(@types/node@22.7.3)) '@tailwindcss/typography': specifier: ^0.5.13 version: 0.5.13(tailwindcss@3.4.3) @@ -321,7 +321,7 @@ importers: version: 4.2.19 svelte-check: specifier: 'catalog:' - version: 3.7.1(@babel/core@7.24.7)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19) + version: 4.0.5(picomatch@4.0.2)(svelte@4.2.19)(typescript@5.3.3) tailwindcss: specifier: 'catalog:' version: 3.4.3 @@ -336,7 +336,7 @@ importers: version: 5.3.3 vite: specifier: 'catalog:' - version: 5.4.9(@types/node@20.12.12) + version: 5.4.9(@types/node@22.7.3) packages: @@ -2251,9 +2251,6 @@ packages: '@types/pg@8.6.1': resolution: {integrity: sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==} - '@types/pug@2.0.10': - resolution: {integrity: sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==} - '@types/qs@6.9.11': resolution: {integrity: sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==} @@ -2449,8 +2446,8 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + acorn@8.13.0: + resolution: {integrity: sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==} engines: {node: '>=0.4.0'} hasBin: true @@ -2629,9 +2626,6 @@ packages: bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} - buffer-crc32@0.2.13: - resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} - buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} @@ -2724,6 +2718,10 @@ packages: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} + chokidar@4.0.1: + resolution: {integrity: sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==} + engines: {node: '>= 14.16.0'} + cjs-module-lexer@1.2.3: resolution: {integrity: sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==} @@ -2946,8 +2944,8 @@ packages: dataloader@2.2.2: resolution: {integrity: sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g==} - date-fns@3.6.0: - resolution: {integrity: sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==} + date-fns@4.1.0: + resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==} debounce-fn@4.0.0: resolution: {integrity: sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ==} @@ -3144,9 +3142,6 @@ packages: error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} - es6-promise@3.3.1: - resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==} - esbuild@0.21.5: resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} @@ -3309,6 +3304,14 @@ packages: fbjs@3.0.5: resolution: {integrity: sha512-ztsSx77JBtkuMrEypfhgc3cI0+0h+svqeie7xHbh1k/IKdcydnvadp/mUaGgjAOXQmQSxsqgaRhS3q9fy+1kxg==} + fdir@6.4.0: + resolution: {integrity: sha512-3oB133prH1o4j/L5lLW7uOCF1PlD+/It2L0eL/iAqWMB91RBbqTewABqxhj0ibBd90EEmWZq7ntIWzVaWcXTGQ==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + fecha@4.2.3: resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==} @@ -3850,6 +3853,10 @@ packages: resolution: {integrity: sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==} engines: {node: '>=14'} + lilconfig@3.1.2: + resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} + engines: {node: '>=14'} + lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} @@ -4151,10 +4158,6 @@ packages: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} - min-indent@1.0.1: - resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} - engines: {node: '>=4'} - minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -4174,9 +4177,6 @@ packages: resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} engines: {node: '>=16 || 14 >=14.17'} - minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - minipass@7.0.4: resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} engines: {node: '>=16 || 14 >=14.17'} @@ -4280,10 +4280,6 @@ packages: resolution: {integrity: sha512-bW2WpJxm6HS+S3Yu6tq1DUPFoTxU9sPviUSmnL7Ua+oVO3WA5ILFWqvujUlz+oeuM+HCwEyMiP5xvKNPENVjYA==} hasBin: true - mkdirp@0.5.6: - resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} - hasBin: true - mlly@1.5.0: resolution: {integrity: sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==} @@ -4561,6 +4557,10 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + pify@2.3.0: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} engines: {node: '>=0.10.0'} @@ -4625,6 +4625,24 @@ packages: ts-node: optional: true + postcss-load-config@6.0.1: + resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} + engines: {node: '>= 18'} + peerDependencies: + jiti: '>=1.21.0' + postcss: '>=8.0.9' + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + jiti: + optional: true + postcss: + optional: true + tsx: + optional: true + yaml: + optional: true + postcss-nested@6.0.1: resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} engines: {node: '>=12.0'} @@ -4756,6 +4774,10 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + readdirp@4.0.2: + resolution: {integrity: sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==} + engines: {node: '>= 14.16.0'} + regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} @@ -4836,11 +4858,6 @@ packages: rfdc@1.3.1: resolution: {integrity: sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==} - rimraf@2.7.1: - resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} deprecated: Rimraf versions prior to v4 are no longer supported @@ -4901,9 +4918,6 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - sander@0.5.1: - resolution: {integrity: sha512-3lVqBir7WuKDHGrKRDn/1Ye3kwpXaDOMsiRP1wd6wpZW56gJhsbp5RqQpA6JG/P+pkXizygnr1dKR8vzWaVsfA==} - scuid@1.1.0: resolution: {integrity: sha512-MuCAyrGZcTLfQoH2XoBlQ8C6bzwN88XT/0slOGz0pn8+gIP85BOAfYa44ZXQUTOwRwPU0QvgU+V+OSajl/59Xg==} @@ -4989,10 +5003,6 @@ packages: snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} - sorcery@0.11.0: - resolution: {integrity: sha512-J69LQ22xrQB1cIFJhPfgtLuI6BpWRiWu1Y3vSsIwK/eAScqJxd/+CJlUuHQRdX2C9NGFamq+KqNywGgaThwfHw==} - hasBin: true - source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -5055,10 +5065,6 @@ packages: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} - strip-indent@3.0.0: - resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} - engines: {node: '>=8'} - strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -5083,15 +5089,17 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - sveld@0.20.0: - resolution: {integrity: sha512-PQRs0evdOjsFzjHuPu8B/flqbJX2osN2D0++6nl77jhwriQazaEF0pkQAMwPRaSn/kMivvUdWkkPKi1NmHLosg==} + sveld@0.20.2: + resolution: {integrity: sha512-pd/RZ4TR7oaX6XphE8uhwAjKIVw1lg19aysYM5lYpD97AthlAJD8kSEgtEXHXw6xFYXsfnhrj0XxGHnbKFsnlA==} hasBin: true - svelte-check@3.7.1: - resolution: {integrity: sha512-U4uJoLCzmz2o2U33c7mPDJNhRYX/DNFV11XTUDlFxaKLsO7P+40gvJHMPpoRfa24jqZfST4/G9fGNcUGMO8NAQ==} + svelte-check@4.0.5: + resolution: {integrity: sha512-icBTBZ3ibBaywbXUat3cK6hB5Du+Kq9Z8CRuyLmm64XIe2/r+lQcbuBx/IQgsbrC+kT2jQ0weVpZSSRIPwB6jQ==} + engines: {node: '>= 18.0.0'} hasBin: true peerDependencies: - svelte: ^3.55.0 || ^4.0.0-next.0 || ^4.0.0 || ^5.0.0-next.0 + svelte: ^4.0.0 || ^5.0.0-next.0 + typescript: '>=5.0.0' svelte-eslint-parser@0.33.1: resolution: {integrity: sha512-vo7xPGTlKBGdLH8T5L64FipvTrqv3OQRx9d2z5X05KKZDlF4rQk8KViZO4flKERY+5BiVdOh7zZ7JGJWo5P0uA==} @@ -5125,21 +5133,21 @@ packages: svelte-intl-precompile@0.12.3: resolution: {integrity: sha512-/AA4io2O07h8PzDU8Jg5ab/DBDr6C2KOzyu4CWSsjHjm8pxWtkLDhd7XkNema34Ryl7O3oqjVrH8FsjLAEUXGQ==} - svelte-preprocess@5.1.4: - resolution: {integrity: sha512-IvnbQ6D6Ao3Gg6ftiM5tdbR6aAETwjhHV+UKGf5bHGYR69RQvF1ho0JKPcbUON4vy4R7zom13jPjgdOWCQ5hDA==} - engines: {node: '>= 16.0.0'} + svelte-preprocess@6.0.3: + resolution: {integrity: sha512-PLG2k05qHdhmRG7zR/dyo5qKvakhm8IJ+hD2eFRQmMLHp7X3eJnjeupUtvuRpbNiF31RjVw45W+abDwHEmP5OA==} + engines: {node: '>= 18.0.0'} peerDependencies: '@babel/core': ^7.10.2 coffeescript: ^2.5.1 less: ^3.11.3 || ^4.0.0 postcss: ^7 || ^8 - postcss-load-config: ^2.1.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 + postcss-load-config: '>=3' pug: ^3.0.0 sass: ^1.26.8 - stylus: ^0.55.0 + stylus: '>=0.55' sugarss: ^2.0.0 || ^3.0.0 || ^4.0.0 - svelte: ^3.23.0 || ^4.0.0-next.0 || ^4.0.0 || ^5.0.0-next.0 - typescript: '>=3.9.5 || ^4.0.0 || ^5.0.0' + svelte: ^4.0.0 || ^5.0.0-next.100 || ^5.0.0 + typescript: ^5.0.0 peerDependenciesMeta: '@babel/core': optional: true @@ -5170,8 +5178,8 @@ packages: peerDependencies: svelte: ^3.58.0 || ^4.0.0 - svelte-ux@0.74.9: - resolution: {integrity: sha512-df1F5EMPbjqGkbBuuHMmgRHp+gQspLrbQjF3foyzWss6gsRkZwFba0JkaopOwQNMMWb3Zu+2obIgQJXt1eZ/Dg==} + svelte-ux@0.75.1: + resolution: {integrity: sha512-aeDwmkM2+Fn4asKtiiMdX79LqLtvikFwFg+4UI4sc7oJSUwC6+9DjLdxyqWfxk2F/VtzeCFI+AJtzhp1wVl7DQ==} peerDependencies: svelte: ^3.56.0 || ^4.0.0 || ^5.0.0-next.120 @@ -5225,6 +5233,10 @@ packages: tinybench@2.6.0: resolution: {integrity: sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==} + tinyglobby@0.2.9: + resolution: {integrity: sha512-8or1+BGEdk1Zkkw2ii16qSS7uVrQJPre5A9o/XkWPATkk23FZh/15BKFxPnlTy6vkljZxLqYCzzBMj30ZrSvjw==} + engines: {node: '>=12.0.0'} + tinypool@0.8.4: resolution: {integrity: sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==} engines: {node: '>=14.0.0'} @@ -7985,6 +7997,15 @@ snapshots: transitivePeerDependencies: - supports-color + '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.19)(vite@5.4.9(@types/node@22.7.3)))(svelte@4.2.19)(vite@5.4.9(@types/node@22.7.3))': + dependencies: + '@sveltejs/vite-plugin-svelte': 3.1.1(svelte@4.2.19)(vite@5.4.9(@types/node@22.7.3)) + debug: 4.3.4 + svelte: 4.2.19 + vite: 5.4.9(@types/node@22.7.3) + transitivePeerDependencies: + - supports-color + '@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.19)(vite@5.4.9(@types/node@20.12.12))': dependencies: '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.19)(vite@5.4.9(@types/node@20.12.12)))(svelte@4.2.19)(vite@5.4.9(@types/node@20.12.12)) @@ -7999,17 +8020,17 @@ snapshots: transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.19)(vite@5.4.8(@types/node@22.7.3))': + '@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.19)(vite@5.4.9(@types/node@22.7.3))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.19)(vite@5.4.8(@types/node@22.7.3)))(svelte@4.2.19)(vite@5.4.8(@types/node@22.7.3)) + '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.19)(vite@5.4.9(@types/node@22.7.3)))(svelte@4.2.19)(vite@5.4.9(@types/node@22.7.3)) debug: 4.3.4 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.10 svelte: 4.2.19 svelte-hmr: 0.16.0(svelte@4.2.19) - vite: 5.4.8(@types/node@22.7.3) - vitefu: 0.2.5(vite@5.4.8(@types/node@22.7.3)) + vite: 5.4.9(@types/node@22.7.3) + vitefu: 0.2.5(vite@5.4.9(@types/node@22.7.3)) transitivePeerDependencies: - supports-color @@ -8169,8 +8190,6 @@ snapshots: pg-protocol: 1.6.0 pg-types: 2.2.0 - '@types/pug@2.0.10': {} - '@types/qs@6.9.11': {} '@types/range-parser@1.2.7': {} @@ -8335,9 +8354,9 @@ snapshots: dependencies: vite: 5.4.9(@types/node@20.12.12) - '@vitejs/plugin-basic-ssl@1.1.0(vite@5.4.8(@types/node@22.7.3))': + '@vitejs/plugin-basic-ssl@1.1.0(vite@5.4.9(@types/node@22.7.3))': dependencies: - vite: 5.4.8(@types/node@22.7.3) + vite: 5.4.9(@types/node@22.7.3) '@vitest/expect@1.6.0': dependencies: @@ -8419,7 +8438,7 @@ snapshots: acorn@8.11.3: {} - acorn@8.12.1: {} + acorn@8.13.0: {} agent-base@7.1.0: dependencies: @@ -8619,8 +8638,6 @@ snapshots: dependencies: node-int64: 0.4.0 - buffer-crc32@0.2.13: {} - buffer-from@1.1.2: {} buffer@5.7.1: @@ -8761,6 +8778,10 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + chokidar@4.0.1: + dependencies: + readdirp: 4.0.2 + cjs-module-lexer@1.2.3: {} clean-css@4.2.4: @@ -8989,7 +9010,7 @@ snapshots: dataloader@2.2.2: {} - date-fns@3.6.0: {} + date-fns@4.1.0: {} debounce-fn@4.0.0: dependencies: @@ -9155,8 +9176,6 @@ snapshots: dependencies: is-arrayish: 0.2.1 - es6-promise@3.3.1: {} - esbuild@0.21.5: optionalDependencies: '@esbuild/aix-ppc64': 0.21.5 @@ -9390,6 +9409,10 @@ snapshots: transitivePeerDependencies: - encoding + fdir@6.4.0(picomatch@4.0.2): + optionalDependencies: + picomatch: 4.0.2 + fecha@4.2.3: {} fetch-cookie@2.2.0: @@ -9923,6 +9946,9 @@ snapshots: lilconfig@3.0.0: {} + lilconfig@3.1.2: + optional: true + lines-and-columns@1.2.4: {} listr2@4.0.5: @@ -10392,8 +10418,6 @@ snapshots: mimic-fn@4.0.0: {} - min-indent@1.0.1: {} - minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -10414,8 +10438,6 @@ snapshots: dependencies: brace-expansion: 2.0.1 - minimist@1.2.8: {} - minipass@7.0.4: {} mjml-accordion@4.15.3: @@ -10715,10 +10737,6 @@ snapshots: transitivePeerDependencies: - encoding - mkdirp@0.5.6: - dependencies: - minimist: 1.2.8 - mlly@1.5.0: dependencies: acorn: 8.11.3 @@ -10987,6 +11005,8 @@ snapshots: picomatch@2.3.1: {} + picomatch@4.0.2: {} + pify@2.3.0: {} pirates@4.0.6: {} @@ -11041,6 +11061,14 @@ snapshots: optionalDependencies: postcss: 8.4.47 + postcss-load-config@6.0.1(jiti@1.21.0)(postcss@8.4.47): + dependencies: + lilconfig: 3.1.2 + optionalDependencies: + jiti: 1.21.0 + postcss: 8.4.47 + optional: true + postcss-nested@6.0.1(postcss@8.4.47): dependencies: postcss: 8.4.47 @@ -11176,6 +11204,8 @@ snapshots: dependencies: picomatch: 2.3.1 + readdirp@4.0.2: {} + regenerator-runtime@0.14.1: {} relateurl@0.2.7: {} @@ -11267,10 +11297,6 @@ snapshots: rfdc@1.3.1: {} - rimraf@2.7.1: - dependencies: - glob: 7.2.3 - rimraf@3.0.2: dependencies: glob: 7.2.3 @@ -11353,13 +11379,6 @@ snapshots: safer-buffer@2.1.2: {} - sander@0.5.1: - dependencies: - es6-promise: 3.3.1 - graceful-fs: 4.2.11 - mkdirp: 0.5.6 - rimraf: 2.7.1 - scuid@1.1.0: {} semver@6.3.1: {} @@ -11439,13 +11458,6 @@ snapshots: dot-case: 3.0.4 tslib: 2.6.2 - sorcery@0.11.0: - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 - buffer-crc32: 0.2.13 - minimist: 1.2.8 - sander: 0.5.1 - source-map-js@1.0.2: {} source-map-js@1.2.1: {} @@ -11496,10 +11508,6 @@ snapshots: strip-final-newline@3.0.0: {} - strip-indent@3.0.0: - dependencies: - min-indent: 1.0.1 - strip-json-comments@3.1.1: {} strip-literal@2.1.0: @@ -11526,17 +11534,17 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - sveld@0.20.0(@babel/core@7.24.7)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47): + sveld@0.20.2(@babel/core@7.24.7)(postcss-load-config@6.0.1(jiti@1.21.0)(postcss@8.4.47))(postcss@8.4.47): dependencies: '@rollup/plugin-node-resolve': 13.3.0(rollup@2.79.2) - acorn: 8.11.3 + acorn: 8.13.0 comment-parser: 1.4.1 - fast-glob: 3.3.2 prettier: 2.8.8 rollup: 2.79.2 rollup-plugin-svelte: 7.2.2(rollup@2.79.2)(svelte@4.2.19) svelte: 4.2.19 - svelte-preprocess: 5.1.4(@babel/core@7.24.7)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.6.2) + svelte-preprocess: 6.0.3(@babel/core@7.24.7)(postcss-load-config@6.0.1(jiti@1.21.0)(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.6.2) + tinyglobby: 0.2.9 typescript: 5.6.2 transitivePeerDependencies: - '@babel/core' @@ -11549,49 +11557,17 @@ snapshots: - stylus - sugarss - svelte-check@3.7.1(@babel/core@7.24.4)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19): - dependencies: - '@jridgewell/trace-mapping': 0.3.25 - chokidar: 3.5.3 - fast-glob: 3.3.2 - import-fresh: 3.3.0 - picocolors: 1.1.0 - sade: 1.8.1 - svelte: 4.2.19 - svelte-preprocess: 5.1.4(@babel/core@7.24.4)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.3.3) - typescript: 5.3.3 - transitivePeerDependencies: - - '@babel/core' - - coffeescript - - less - - postcss - - postcss-load-config - - pug - - sass - - stylus - - sugarss - - svelte-check@3.7.1(@babel/core@7.24.7)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19): + svelte-check@4.0.5(picomatch@4.0.2)(svelte@4.2.19)(typescript@5.3.3): dependencies: '@jridgewell/trace-mapping': 0.3.25 - chokidar: 3.5.3 - fast-glob: 3.3.2 - import-fresh: 3.3.0 + chokidar: 4.0.1 + fdir: 6.4.0(picomatch@4.0.2) picocolors: 1.1.0 sade: 1.8.1 svelte: 4.2.19 - svelte-preprocess: 5.1.4(@babel/core@7.24.7)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.3.3) typescript: 5.3.3 transitivePeerDependencies: - - '@babel/core' - - coffeescript - - less - - postcss - - postcss-load-config - - pug - - sass - - stylus - - sugarss + - picomatch svelte-eslint-parser@0.33.1(svelte@4.2.19): dependencies: @@ -11639,46 +11615,31 @@ snapshots: - '@babel/core' - svelte - svelte-preprocess@5.1.4(@babel/core@7.24.4)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.3.3): + svelte-preprocess@6.0.3(@babel/core@7.24.4)(postcss-load-config@6.0.1(jiti@1.21.0)(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.3.3): dependencies: - '@types/pug': 2.0.10 - detect-indent: 6.1.0 - magic-string: 0.30.10 - sorcery: 0.11.0 - strip-indent: 3.0.0 svelte: 4.2.19 optionalDependencies: '@babel/core': 7.24.4 postcss: 8.4.47 - postcss-load-config: 4.0.2(postcss@8.4.47) + postcss-load-config: 6.0.1(jiti@1.21.0)(postcss@8.4.47) typescript: 5.3.3 - svelte-preprocess@5.1.4(@babel/core@7.24.7)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.3.3): + svelte-preprocess@6.0.3(@babel/core@7.24.7)(postcss-load-config@6.0.1(jiti@1.21.0)(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.3.3): dependencies: - '@types/pug': 2.0.10 - detect-indent: 6.1.0 - magic-string: 0.30.10 - sorcery: 0.11.0 - strip-indent: 3.0.0 svelte: 4.2.19 optionalDependencies: '@babel/core': 7.24.7 postcss: 8.4.47 - postcss-load-config: 4.0.2(postcss@8.4.47) + postcss-load-config: 6.0.1(jiti@1.21.0)(postcss@8.4.47) typescript: 5.3.3 - svelte-preprocess@5.1.4(@babel/core@7.24.7)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.6.2): + svelte-preprocess@6.0.3(@babel/core@7.24.7)(postcss-load-config@6.0.1(jiti@1.21.0)(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19)(typescript@5.6.2): dependencies: - '@types/pug': 2.0.10 - detect-indent: 6.1.0 - magic-string: 0.30.10 - sorcery: 0.11.0 - strip-indent: 3.0.0 svelte: 4.2.19 optionalDependencies: '@babel/core': 7.24.7 postcss: 8.4.47 - postcss-load-config: 4.0.2(postcss@8.4.47) + postcss-load-config: 6.0.1(jiti@1.21.0)(postcss@8.4.47) typescript: 5.6.2 svelte-routing@2.13.0: {} @@ -11688,7 +11649,7 @@ snapshots: svelte: 4.2.19 turnstile-types: 1.2.0 - svelte-ux@0.74.9(@babel/core@7.24.7)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19): + svelte-ux@0.75.1(@babel/core@7.24.7)(postcss-load-config@6.0.1(jiti@1.21.0)(postcss@8.4.47))(postcss@8.4.47)(svelte@4.2.19): dependencies: '@floating-ui/dom': 1.6.11 '@fortawesome/fontawesome-common-types': 6.6.0 @@ -11697,13 +11658,13 @@ snapshots: culori: 4.0.1 d3-array: 3.2.4 d3-scale: 4.0.2 - date-fns: 3.6.0 + date-fns: 4.1.0 immer: 10.1.1 lodash-es: 4.17.21 prism-svelte: 0.5.0 prism-themes: 1.9.0 prismjs: 1.29.0 - sveld: 0.20.0(@babel/core@7.24.7)(postcss-load-config@4.0.2(postcss@8.4.47))(postcss@8.4.47) + sveld: 0.20.2(@babel/core@7.24.7)(postcss-load-config@6.0.1(jiti@1.21.0)(postcss@8.4.47))(postcss@8.4.47) svelte: 4.2.19 tailwind-merge: 2.5.2 zod: 3.23.8 @@ -11806,6 +11767,11 @@ snapshots: tinybench@2.6.0: {} + tinyglobby@0.2.9: + dependencies: + fdir: 6.4.0(picomatch@4.0.2) + picomatch: 4.0.2 + tinypool@0.8.4: {} tinyspy@2.2.0: {} @@ -12039,13 +12005,22 @@ snapshots: '@types/node': 20.12.12 fsevents: 2.3.3 + vite@5.4.9(@types/node@22.7.3): + dependencies: + esbuild: 0.21.5 + postcss: 8.4.47 + rollup: 4.24.0 + optionalDependencies: + '@types/node': 22.7.3 + fsevents: 2.3.3 + vitefu@0.2.5(vite@5.4.9(@types/node@20.12.12)): optionalDependencies: vite: 5.4.9(@types/node@20.12.12) - vitefu@0.2.5(vite@5.4.8(@types/node@22.7.3)): + vitefu@0.2.5(vite@5.4.9(@types/node@22.7.3)): optionalDependencies: - vite: 5.4.8(@types/node@22.7.3) + vite: 5.4.9(@types/node@22.7.3) vitest@1.6.0(@types/node@20.12.12): dependencies: diff --git a/frontend/pnpm-workspace.yaml b/frontend/pnpm-workspace.yaml index 44554c5ce..650ee2b9e 100644 --- a/frontend/pnpm-workspace.yaml +++ b/frontend/pnpm-workspace.yaml @@ -5,8 +5,8 @@ catalog: vite: ^5.4.9 svelte: ^4.2.19 - svelte-check: ^3.7.1 - svelte-preprocess: ^5.1.4 + svelte-check: ^4.0.5 + svelte-preprocess: ^6.0.3 postcss: ^8.4.47 typescript: ^5.3.3 tslib: ^2.6.2 diff --git a/frontend/src/routes/(authenticated)/project/[project_code]/viewer/lfClassicLexboxApi.ts b/frontend/src/routes/(authenticated)/project/[project_code]/viewer/lfClassicLexboxApi.ts index 5cb381db1..dcbc6752a 100644 --- a/frontend/src/routes/(authenticated)/project/[project_code]/viewer/lfClassicLexboxApi.ts +++ b/frontend/src/routes/(authenticated)/project/[project_code]/viewer/lfClassicLexboxApi.ts @@ -70,14 +70,14 @@ export class LfClassicLexboxApi implements LexboxApiClient { const asc = options.order.ascending ?? true; const params = new URLSearchParams({ SortField: options.order.field, - SortWritingSystem: options.order.writingSystem, + SortWritingSystem: options.order.writingSystem as string, Ascending: asc ? 'true' : 'false', Count: options.count.toString(), Offset: options.offset.toString() }); if (options.exemplar) { params.set('ExemplarValue', options.exemplar.value); - params.set('ExemplarWritingSystem', options.exemplar.writingSystem); + params.set('ExemplarWritingSystem', options.exemplar.writingSystem as string); } /* eslint-enable @typescript-eslint/no-unsafe-assignment */ return '?' + params.toString(); diff --git a/frontend/viewer/eslint.config.js b/frontend/viewer/eslint.config.js new file mode 100644 index 000000000..f6ce47c37 --- /dev/null +++ b/frontend/viewer/eslint.config.js @@ -0,0 +1,141 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { fileURLToPath } from 'url'; +import globals from 'globals'; +import js from '@eslint/js'; +import path from 'path'; +import svelteParser from 'svelte-eslint-parser'; +import tsParser from '@typescript-eslint/parser'; + +// mimic CommonJS variables +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname +}); + +export default [ + { + ignores: [ + '**/*js', + '**/generated/**', + '**/vite.config.*', + ], + }, + js.configs.recommended, + // TypeScript and Svelte plugins don't seem to support the new config format yet + // So, using backwards compatibility util: https://eslint.org/blog/2022/08/new-config-system-part-2/#backwards-compatibility-utility + ...compat.config({ + plugins: ['@typescript-eslint'], + extends: ['plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking'], + overrides: [ + { + files: ['*.svelte'], + rules: { + // The Svelte plugin doesn't seem to have typing quite figured out + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + }, + } + ] + }), + ...compat.config({ + extends: ['plugin:svelte/recommended'], + }), + { + rules: { + // https://typescript-eslint.io/rules/ + '@typescript-eslint/naming-convention': [ + 'error', + { + 'selector': 'default', + 'format': ['camelCase'], + 'leadingUnderscore': 'allow', + }, + { + 'selector': 'function', + 'filter': {'regex': 'GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS', 'match': true}, + 'format': ['UPPER_CASE'], + }, + { + 'selector': 'default', + 'modifiers': ['const'], + 'format': ['camelCase', 'UPPER_CASE'], + 'leadingUnderscore': 'allow', + }, + { + 'selector': ['typeLike', 'enumMember'], + 'format': ['PascalCase'], + }, + { + 'selector': 'default', + 'modifiers': ['requiresQuotes'], + 'format': null, + }, + { + 'selector': 'import', + 'format': ['camelCase', 'PascalCase'], + } + ], + '@typescript-eslint/quotes': ['error', 'single', { 'allowTemplateLiterals': true }], + '@typescript-eslint/no-unused-vars': [ + 'error', + { + 'argsIgnorePattern': '^_', + 'destructuredArrayIgnorePattern': '^_', + 'caughtErrors': 'all', + 'ignoreRestSiblings': true, + }, + ], + '@typescript-eslint/explicit-function-return-type': [ + 'off', + { + 'allowExpressions': true, + }, + ], + '@typescript-eslint/consistent-type-imports': ['error', {'fixStyle': 'inline-type-imports'}], + // https://sveltejs.github.io/eslint-plugin-svelte/rules/ + 'svelte/html-quotes': 'error', + 'svelte/no-dom-manipulating': 'warn', + 'svelte/no-reactive-reassign': ['warn', { 'props': false }], + 'svelte/no-store-async': 'error', + 'svelte/require-store-reactive-access': 'error', + 'svelte/mustache-spacing': 'error', + 'func-style': ['warn', 'declaration'], + "no-restricted-imports": ["error", { + "patterns": [{ + "group": ["svelte-intl-precompile"], + "message": "Use $lib/i18n instead." + }] + }] + }, + }, + { + languageOptions: { + parser: tsParser, + parserOptions: { + project: true, + tsconfigRootDir: __dirname, + extraFileExtensions: ['.svelte'], // Yes, TS-Parser, relax when you're fed svelte files + }, + globals: { + ...globals.browser, + ...globals.node, + }, + }, + }, + { + files: ['**/*.svelte'], + languageOptions: { + parser: svelteParser, + parserOptions: { + parser: tsParser, + }, + globals: { + '$$Generic': 'readonly', + } + }, + }, +]; diff --git a/frontend/viewer/package.json b/frontend/viewer/package.json index c38851952..dc79238af 100644 --- a/frontend/viewer/package.json +++ b/frontend/viewer/package.json @@ -21,7 +21,8 @@ "build": "vite build -m web-component", "build-app": "vite build", "preview": "vite preview", - "check": "svelte-check --tsconfig ./tsconfig.json" + "check": "svelte-check --tsconfig ./tsconfig.json", + "lint": "eslint ." }, "devDependencies": { "@egoist/tailwindcss-icons": "^1.8.0", @@ -47,7 +48,7 @@ "svelte-exmarkdown": "^3.0.5", "svelte-preprocess": "catalog:", "svelte-routing": "^2.12.0", - "svelte-ux": "^0.74.9", + "svelte-ux": "^0.75.1", "type-fest": "^4.18.2" } } diff --git a/frontend/viewer/postcss.config.cjs b/frontend/viewer/postcss.config.cjs index cdbe50f3a..a0ca994da 100644 --- a/frontend/viewer/postcss.config.cjs +++ b/frontend/viewer/postcss.config.cjs @@ -1,7 +1,12 @@ +const path = require('path'); +const tailwindConfig = path.join(__dirname, 'tailwind.config.cjs'); + module.exports = { plugins: { 'tailwindcss/nesting': {}, - tailwindcss: {}, + tailwindcss: { + config: tailwindConfig, + }, autoprefixer: {}, }, }; diff --git a/frontend/viewer/src/App.svelte b/frontend/viewer/src/App.svelte index 07cae2605..e2da56fc8 100644 --- a/frontend/viewer/src/App.svelte +++ b/frontend/viewer/src/App.svelte @@ -10,6 +10,7 @@ export let url = ''; + /* eslint-disable @typescript-eslint/naming-convention */ settings({ components: { MenuItem: { @@ -36,7 +37,7 @@ } }, }); - + /* eslint-enable @typescript-eslint/naming-convention */ @@ -69,7 +70,7 @@ - {setTimeout(() => navigate("/", { replace: true }))} + {setTimeout(() => navigate('/', { replace: true }))} diff --git a/frontend/viewer/src/CrdtProjectView.svelte b/frontend/viewer/src/CrdtProjectView.svelte index d436ab10e..a82224f83 100644 --- a/frontend/viewer/src/CrdtProjectView.svelte +++ b/frontend/viewer/src/CrdtProjectView.svelte @@ -3,7 +3,7 @@ import ProjectView from './ProjectView.svelte'; export let projectName: string; - const {connected, lexboxApi} = SetupSignalR(`/api/hub/${projectName}/lexbox`, { + const {connected} = SetupSignalR(`/api/hub/${projectName}/lexbox`, { history: true, write: true, feedback: true, diff --git a/frontend/viewer/src/FwDataProjectView.svelte b/frontend/viewer/src/FwDataProjectView.svelte index 9094b2368..24fea4943 100644 --- a/frontend/viewer/src/FwDataProjectView.svelte +++ b/frontend/viewer/src/FwDataProjectView.svelte @@ -8,7 +8,7 @@ import {useEventBus} from './lib/services/event-bus'; export let projectName: string; - const {connected, lexboxApi} = SetupSignalR(`/api/hub/${projectName}/fwdata`, { + const {connected} = SetupSignalR(`/api/hub/${projectName}/fwdata`, { history: false, write: true, openWithFlex: true, diff --git a/frontend/viewer/src/HomeView.svelte b/frontend/viewer/src/HomeView.svelte index f619eb159..90e60321c 100644 --- a/frontend/viewer/src/HomeView.svelte +++ b/frontend/viewer/src/HomeView.svelte @@ -21,15 +21,13 @@ let createError: string; async function createProject() { - const response = await projectsService.createProject(newProjectName); createError = response.error ?? ''; if (createError) return; newProjectName = ''; - void refreshProjects(); + await refreshProjects(); } - let importing = ''; async function importFwDataProject(name: string) { @@ -59,12 +57,16 @@ let remoteProjects: { [server: string]: Project[] } = {}; let loadingRemoteProjects = false; - async function fetchRemoteProjects() { + async function fetchRemoteProjects(): Promise { loadingRemoteProjects = true; remoteProjects = await projectsService.fetchRemoteProjects(); loadingRemoteProjects = false; } - fetchRemoteProjects(); + + fetchRemoteProjects().catch((error) => { + console.error(`Failed to fetch remote projects`, error); + throw error; + }); let servers: ServerStatus[] = []; @@ -97,7 +99,7 @@ : []), ] satisfies ColumnDef[]; - function matchesProject(projects: Project[], project: Project) { + function matchesProject(projects: Project[], project: Project): Project | undefined { let matches: Project | undefined = undefined; if (project.id) { matches = projects.find(p => p.id == project.id && p.serverAuthority == project.serverAuthority); @@ -120,7 +122,7 @@ }; } let authority = Object.entries(serversProjects) - .find(([server, projects]) => matchesProject(projects, project))?.[0]; + .find(([_server, projects]) => matchesProject(projects, project))?.[0]; return authority ? servers.find(s => s.authority == authority) : undefined; } @@ -152,7 +154,7 @@ $isDev || p.fwdata).sort((p1, p2) => p1.name.localeCompare(p2.name))} classes={{ th: 'p-4' }}> - + {#each data ?? [] as project, rowIndex} {#each columns as column (column.name)} @@ -262,7 +264,7 @@ - diff --git a/frontend/viewer/src/lib/entry-editor/inputs/CrdtMultiOptionField.svelte b/frontend/viewer/src/lib/entry-editor/inputs/CrdtMultiOptionField.svelte index b3eac8340..ecc213dcc 100644 --- a/frontend/viewer/src/lib/entry-editor/inputs/CrdtMultiOptionField.svelte +++ b/frontend/viewer/src/lib/entry-editor/inputs/CrdtMultiOptionField.svelte @@ -1,42 +1,35 @@ - + dispatch('change', { value: e.detail.value})} bind:value bind:unsavedChanges let:editorValue let:onEditorValueChange viewMergeButtonPortal={append}> { - onEditorValueChange(asObjectValues(e.detail.value), true); - }} - value={asMultiSelectValues(editorValue)} + on:change={(e) => + onEditorValueChange(e.detail.value ?? [], true)} + value={editorValue} disabled={readonly} - {options} + options={sortedOptions} icon={readonly ? undefined : mdiMagnify} - valueProp="value" - labelProp="label" formatSelected={({ options }) => - options.map((o) => o.label).join(", ") || "None"} + options.map((o) => o.label).join(', ') || 'None'} infiniteScroll clearSearchOnOpen={false} clearable={false} @@ -48,9 +41,3 @@ - - diff --git a/frontend/viewer/src/lib/entry-editor/inputs/CrdtOptionField.svelte b/frontend/viewer/src/lib/entry-editor/inputs/CrdtOptionField.svelte index 780e50d34..86ca07818 100644 --- a/frontend/viewer/src/lib/entry-editor/inputs/CrdtOptionField.svelte +++ b/frontend/viewer/src/lib/entry-editor/inputs/CrdtOptionField.svelte @@ -1,16 +1,18 @@ @@ -19,7 +21,7 @@ on:change={(e) => onEditorValueChange(e.detail.value, true)} value={editorValue} disabled={readonly} - {options} + options={sortedOptions} clearSearchOnOpen={false} clearable={false} search={() => Promise.resolve()} @@ -32,9 +34,3 @@ {/key} - - diff --git a/frontend/viewer/src/lib/entry-editor/inputs/CrdtTextField.svelte b/frontend/viewer/src/lib/entry-editor/inputs/CrdtTextField.svelte index 472b3d757..d31bfd5be 100644 --- a/frontend/viewer/src/lib/entry-editor/inputs/CrdtTextField.svelte +++ b/frontend/viewer/src/lib/entry-editor/inputs/CrdtTextField.svelte @@ -3,7 +3,7 @@ import CrdtField from './CrdtField.svelte'; import { TextField } from 'svelte-ux'; - export let value: string | number; + export let value: string | number | null; export let unsavedChanges = false; export let label: string | undefined = undefined; export let labelPlacement: ComponentProps['labelPlacement'] = undefined; @@ -33,9 +33,3 @@ - - diff --git a/frontend/viewer/src/lib/entry-editor/object-editors/EntityEditor.svelte b/frontend/viewer/src/lib/entry-editor/object-editors/EntityEditor.svelte index 4b96da3be..5fa0fb049 100644 --- a/frontend/viewer/src/lib/entry-editor/object-editors/EntityEditor.svelte +++ b/frontend/viewer/src/lib/entry-editor/object-editors/EntityEditor.svelte @@ -1,15 +1,14 @@ - {#each customFieldConfigs as fieldConfig} {/each} diff --git a/frontend/viewer/src/lib/entry-editor/object-editors/EntryEditor.svelte b/frontend/viewer/src/lib/entry-editor/object-editors/EntryEditor.svelte index 8e14f50e1..27f8c9833 100644 --- a/frontend/viewer/src/lib/entry-editor/object-editors/EntryEditor.svelte +++ b/frontend/viewer/src/lib/entry-editor/object-editors/EntryEditor.svelte @@ -7,7 +7,7 @@ import {mdiPlus, mdiTrashCanOutline} from '@mdi/js'; import { Button, portal } from 'svelte-ux'; import EntityListItemActions from '../EntityListItemActions.svelte'; - import {defaultExampleSentence, defaultSense, emptyId, firstDefOrGlossVal, firstSentenceOrTranslationVal} from '../../utils'; + import {defaultExampleSentence, defaultSense, firstDefOrGlossVal, firstSentenceOrTranslationVal} from '../../utils'; import HistoryView from '../../history/HistoryView.svelte'; import SenseEditor from './SenseEditor.svelte'; import ExampleEditor from './ExampleEditor.svelte'; diff --git a/frontend/viewer/src/lib/entry-editor/object-editors/SenseEditor.svelte b/frontend/viewer/src/lib/entry-editor/object-editors/SenseEditor.svelte index 39e22b27c..c0dd94f63 100644 --- a/frontend/viewer/src/lib/entry-editor/object-editors/SenseEditor.svelte +++ b/frontend/viewer/src/lib/entry-editor/object-editors/SenseEditor.svelte @@ -8,7 +8,6 @@ import {useWritingSystems} from '../../writing-systems'; import {pickBestAlternative} from '../../utils'; import {usePartsOfSpeech} from '../../parts-of-speech'; - import type {OptionFieldValue} from '../../config-types'; import {useCurrentView, objectTemplateAreas} from '../../services/view-service'; export let sense: ISense; @@ -16,8 +15,8 @@ const partsOfSpeech = usePartsOfSpeech(); const semanticDomains = useSemanticDomains(); const writingSystems = useWritingSystems(); - function setSemanticDomains(selectedValues: OptionFieldValue[]) { - sense.semanticDomains = selectedValues.map(v => $semanticDomains.find(sd => sd.id === v.id)).filter((sd): sd is SemanticDomain => !!sd); + function setSemanticDomains(ids: string[]): void { + sense.semanticDomains = ids.map(id => $semanticDomains.find(sd => sd.id === id)).filter((sd): sd is SemanticDomain => !!sd); } const currentView = useCurrentView(); @@ -35,18 +34,18 @@ wsType="analysis" /> ({value: pos.id, label: pickBestAlternative(pos.name, 'analysis', $writingSystems)}))} {readonly} id="partOfSpeechId" - wsType="first-analysis" - options={$partsOfSpeech.map(pos => ({label: pickBestAlternative(pos.name, 'analysis', $writingSystems), value: pos.id}))}/> + wsType="first-analysis" /> { setSemanticDomains(e.detail.value)} } - on:change - {readonly} - id="semanticDomains" - wsType="first-analysis" - options={$semanticDomains.map(sd => ({label: sd.code + ' ' + pickBestAlternative(sd.name, 'analysis', $writingSystems), value: sd.id}))}/> + on:change={(e) => setSemanticDomains(e.detail.value)} + on:change + value={sense.semanticDomains.map(sd => sd.id)} + options={$semanticDomains.map(sd => ({value: sd.id, label: `${sd.code} ${pickBestAlternative(sd.name, 'analysis', $writingSystems)}`}))} + {readonly} + id="semanticDomains" + wsType="first-analysis" />
{#if record?.entity} - {#if record.entityName === "Entry"} + {#if record.entityName === 'Entry'} - {:else if record.entityName === "Sense"} + {:else if record.entityName === 'Sense'}
- {:else if record.entityName === "ExampleSentence"} + {:else if record.entityName === 'ExampleSentence'}
diff --git a/frontend/viewer/src/lib/i18n.ts b/frontend/viewer/src/lib/i18n.ts index e71de67a9..da6db1ed5 100644 --- a/frontend/viewer/src/lib/i18n.ts +++ b/frontend/viewer/src/lib/i18n.ts @@ -1,8 +1,8 @@ -import type { FieldConfig, WellKnownFieldId } from './config-types'; +import type { WellKnownFieldId } from './config-types'; import type {FieldIds} from './entry-editor/field-data'; -type I18n = Record & Record, string>; +// type I18n = Record & Record, string>; type I18nKey = FieldIds; /** * I18n type is used to specify which i18n group to use for a field. If empty, the default i18n is used. diff --git a/frontend/viewer/src/lib/in-memory-api-service.ts b/frontend/viewer/src/lib/in-memory-api-service.ts index 986e79379..d1021e179 100644 --- a/frontend/viewer/src/lib/in-memory-api-service.ts +++ b/frontend/viewer/src/lib/in-memory-api-service.ts @@ -1,4 +1,5 @@ -import type { +/* eslint-disable @typescript-eslint/naming-convention */ +import type { LexboxApiClient, IEntry, IExampleSentence, @@ -13,11 +14,11 @@ } from './services/lexbox-api'; import {entries, projectName, writingSystems} from './entry-data'; -import {type WritingSystem} from './mini-lcm'; +import {pickWs, type WritingSystem} from './mini-lcm'; import {headword} from './utils'; import {applyPatch} from 'fast-json-patch'; -function filterEntries(entries: IEntry[], query: string) { +function filterEntries(entries: IEntry[], query: string): IEntry[] { return entries.filter(entry => [ ...Object.values(entry.lexemeForm ?? {}), @@ -31,8 +32,8 @@ function filterEntries(entries: IEntry[], query: string) { export class InMemoryApiService implements LexboxApiClient { GetPartsOfSpeech(): Promise { return Promise.resolve([ - {id: 'noun', name: {en: 'noun'},}, - {id: 'verb', name: {en: 'verb'},} + {id: '86ff66f6-0774-407a-a0dc-3eeaf873daf7', name: {en: 'Verb'},}, + {id: 'a8e41fd3-e343-4c7c-aa05-01ea3dd5cfb5', name: {en: 'Noun'},} ]); } @@ -54,7 +55,7 @@ export class InMemoryApiService implements LexboxApiClient { private _entries = entries; private _Entries(): IEntry[] { - return JSON.parse(JSON.stringify(this._entries)); + return JSON.parse(JSON.stringify(this._entries)) as IEntry[]; } GetEntries(options: QueryOptions | undefined): Promise { @@ -71,26 +72,24 @@ export class InMemoryApiService implements LexboxApiClient { private ApplyQueryOptions(entries: IEntry[], options: QueryOptions | undefined): IEntry[] { if (!options) return entries; - let sortWs = options.order.writingSystem; const defaultWs = writingSystems.vernacular[0].id; - if (sortWs === 'default') sortWs = defaultWs; if (options.exemplar?.value) { - const lowerExemplar = options.exemplar?.value.toLowerCase(); - let ws = options.exemplar?.writingSystem; - if (ws === 'default') ws = defaultWs; + const lowerExemplar = options.exemplar.value.toLowerCase(); + const exemplarWs = pickWs(options.exemplar.writingSystem, defaultWs); entries = entries.filter(entry => - (entry.citationForm[ws] ?? entry.lexemeForm[ws] ?? '') + (entry.citationForm[exemplarWs] ?? entry.lexemeForm[exemplarWs] ?? '') ?.toLocaleLowerCase() ?.startsWith(lowerExemplar)); } + const sortWs = pickWs(options.order.writingSystem, defaultWs); return entries .sort((e1, e2) => { const v1 = headword(e1, sortWs); const v2 = headword(e2, sortWs); if (!v2) return -1; if (!v1) return 1; - let compare = v1.localeCompare(v2, sortWs); + const compare = v1.localeCompare(v2, sortWs); if (compare !== 0) return compare; return e1.id.localeCompare(e2.id); }) @@ -155,11 +154,11 @@ export class InMemoryApiService implements LexboxApiClient { return Promise.resolve(); } - CreateWritingSystem(type: WritingSystemType, writingSystem: WritingSystem): Promise { + CreateWritingSystem(_type: WritingSystemType, _writingSystem: WritingSystem): Promise { throw new Error('Method not implemented.'); } - UpdateWritingSystem(wsId: string, type: WritingSystemType, update: JsonPatch): Promise { + UpdateWritingSystem(_wsId: string, _type: WritingSystemType, _update: JsonPatch): Promise { throw new Error('Method not implemented.'); } } diff --git a/frontend/viewer/src/lib/layout/DictionaryEntryViewer.svelte b/frontend/viewer/src/lib/layout/DictionaryEntryViewer.svelte index 3079f09a3..8cf46cbff 100644 --- a/frontend/viewer/src/lib/layout/DictionaryEntryViewer.svelte +++ b/frontend/viewer/src/lib/layout/DictionaryEntryViewer.svelte @@ -1,8 +1,8 @@ diff --git a/frontend/viewer/src/lib/mini-lcm/complex-form-component.ts b/frontend/viewer/src/lib/mini-lcm/complex-form-component.ts index 6aee0e1a6..659fc0706 100644 --- a/frontend/viewer/src/lib/mini-lcm/complex-form-component.ts +++ b/frontend/viewer/src/lib/mini-lcm/complex-form-component.ts @@ -3,7 +3,7 @@ * Any changes made to this file can be lost when this file is regenerated. */ -import type { IComplexFormComponent } from "./i-complex-form-component"; +import type { IComplexFormComponent } from './i-complex-form-component'; export class ComplexFormComponent implements IComplexFormComponent { constructor(id: string, complexFormEntryId: string, componentEntryId: string) { diff --git a/frontend/viewer/src/lib/mini-lcm/i-complex-form-type.ts b/frontend/viewer/src/lib/mini-lcm/i-complex-form-type.ts index aef9493a1..a03cc5c2a 100644 --- a/frontend/viewer/src/lib/mini-lcm/i-complex-form-type.ts +++ b/frontend/viewer/src/lib/mini-lcm/i-complex-form-type.ts @@ -1,4 +1,4 @@ -import type { IMultiString } from "./i-multi-string"; +import type { IMultiString } from './i-multi-string'; export interface IComplexFormType { id: string; diff --git a/frontend/viewer/src/lib/mini-lcm/query-options.ts b/frontend/viewer/src/lib/mini-lcm/query-options.ts index b3f6255ee..cce249ec5 100644 --- a/frontend/viewer/src/lib/mini-lcm/query-options.ts +++ b/frontend/viewer/src/lib/mini-lcm/query-options.ts @@ -3,13 +3,19 @@ * Any changes made to this file can be lost when this file is regenerated. */ +type QueryWsId = Omit | 'default'; + export interface QueryOptions { order: { field: 'headword', - writingSystem: string | 'default', + writingSystem: QueryWsId, ascending?: boolean }; count: number; offset: number; - exemplar?: { value: string, writingSystem: string | 'default' }; + exemplar?: { value: string, writingSystem: QueryWsId }; +} + +export function pickWs(ws: QueryWsId, defaultWs: string): string { + return ws === 'default' ? defaultWs : ws as string; } diff --git a/frontend/viewer/src/lib/notifications/NotificationOutlet.svelte b/frontend/viewer/src/lib/notifications/NotificationOutlet.svelte index 46e0db57e..acdfaff52 100644 --- a/frontend/viewer/src/lib/notifications/NotificationOutlet.svelte +++ b/frontend/viewer/src/lib/notifications/NotificationOutlet.svelte @@ -14,7 +14,7 @@
{#each $notifications as notification}
- +
{#if notification.type === 'success'} diff --git a/frontend/viewer/src/lib/notifications/notifications.ts b/frontend/viewer/src/lib/notifications/notifications.ts index 671c93741..39711b883 100644 --- a/frontend/viewer/src/lib/notifications/notifications.ts +++ b/frontend/viewer/src/lib/notifications/notifications.ts @@ -1,4 +1,4 @@ -import {writable, type Writable, type Readable, readonly} from 'svelte/store'; +import {writable, type Writable} from 'svelte/store'; interface NotificationAction { label: string; diff --git a/frontend/viewer/src/lib/parts-of-speech.ts b/frontend/viewer/src/lib/parts-of-speech.ts index c31e96bd2..69a20fc02 100644 --- a/frontend/viewer/src/lib/parts-of-speech.ts +++ b/frontend/viewer/src/lib/parts-of-speech.ts @@ -9,6 +9,9 @@ export function usePartsOfSpeech(): Readable { partsOfSpeechStore = writable([], (set) => { useLexboxApi().GetPartsOfSpeech().then(partsOfSpeech => { set(partsOfSpeech); + }).catch(error => { + console.error('Failed to load parts of speech', error); + throw error; }); }); } diff --git a/frontend/viewer/src/lib/sandbox/Sandbox.svelte b/frontend/viewer/src/lib/sandbox/Sandbox.svelte index 7b1640882..36ebe5cc9 100644 --- a/frontend/viewer/src/lib/sandbox/Sandbox.svelte +++ b/frontend/viewer/src/lib/sandbox/Sandbox.svelte @@ -3,30 +3,30 @@ import CrdtMultiOptionField from '../entry-editor/inputs/CrdtMultiOptionField.svelte'; const options = [ - { name: 'One', value: 1 }, - { name: 'Two', value: 2 }, - { name: 'Three', value: 3 }, - { name: 'Four', value: 4 }, + { label: 'One', value: 1 }, + { label: 'Two', value: 2 }, + { label: 'Three', value: 3 }, + { label: 'Four', value: 4 }, ]; let value = [3]; - const crdtOptions:MenuOption[] = [ + const crdtOptions: MenuOption[] = [ {value: 'a', label: 'Alpha'}, {value: 'b', label: 'Beta'}, {value: 'c', label: 'Charlie'}, ]; - let crdtValue = [{id: 'a'}]; + let crdtValue = ['a'];
- (value = e.detail.value)}/> + (value = e.detail.value ?? [])}/>

selected: {value.join('|')}

-

selected: {crdtValue.map(c => c.id).join('|')}

- +

selected: {crdtValue.join('|')}

+
diff --git a/frontend/viewer/src/lib/search-bar/SearchBar.svelte b/frontend/viewer/src/lib/search-bar/SearchBar.svelte index 2b57c4b28..eb8452621 100644 --- a/frontend/viewer/src/lib/search-bar/SearchBar.svelte +++ b/frontend/viewer/src/lib/search-bar/SearchBar.svelte @@ -1,6 +1,6 @@