chore: update all dependencies and adapt code to them

This commit is contained in:
Leonardo Murça 2026-04-16 11:04:05 -03:00
parent ad24479099
commit 41ef8d1023
18 changed files with 1299 additions and 1137 deletions

2286
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -14,23 +14,23 @@
"lint": "prettier --check . && eslint ." "lint": "prettier --check . && eslint ."
}, },
"devDependencies": { "devDependencies": {
"@eslint/compat": "^1.2.5", "@eslint/compat": "^2.0.5",
"@eslint/js": "^9.18.0", "@eslint/js": "^10.0.1",
"@sveltejs/kit": "^2.16.0", "@sveltejs/kit": "^2.57.1",
"@sveltejs/vite-plugin-svelte": "^5.0.0", "@sveltejs/vite-plugin-svelte": "^7.0.0",
"eslint": "^9.28.0", "eslint": "^10.2.0",
"eslint-config-prettier": "^10.0.1", "eslint-config-prettier": "^10.0.1",
"eslint-plugin-svelte": "^3.9.1", "eslint-plugin-svelte": "^3.17.0",
"globals": "^16.0.0", "globals": "^17.5.0",
"prettier": "^3.5.3", "prettier": "^3.8.3",
"prettier-plugin-svelte": "^3.3.3", "prettier-plugin-svelte": "^3.5.1",
"svelte": "^5.0.0", "svelte": "^5.55.4",
"svelte-check": "^4.0.0", "svelte-check": "^4.4.6",
"typescript": "^5.0.0", "typescript": "^6.0.2",
"vite": "^6.2.6" "vite": "^8.0.8"
}, },
"dependencies": { "dependencies": {
"@sveltejs/adapter-node": "^5.2.12", "@sveltejs/adapter-node": "^5.5.4",
"accept-language-parser": "^1.5.0", "accept-language-parser": "^1.5.0",
"sveltekit-i18n": "^2.4.2" "sveltekit-i18n": "^2.4.2"
} }

View file

@ -52,7 +52,7 @@
{#if files.length !== 0} {#if files.length !== 0}
<div id="container" style="width: 100%; heigth: 100vh;"> <div id="container" style="width: 100%; heigth: 100vh;">
{#each Array.from(files) as file, i} {#each Array.from(files) as file, i (i)}
<div class="canvas-container"> <div class="canvas-container">
<canvas bind:this={canvasRefs[i]} class="canvas"></canvas> <canvas bind:this={canvasRefs[i]} class="canvas"></canvas>
<p><strong>{file.name}</strong></p> <p><strong>{file.name}</strong></p>

View file

@ -12,6 +12,7 @@
<!-- svelte-ignore a11y-no-noninteractive-tabindex --> <!-- svelte-ignore a11y-no-noninteractive-tabindex -->
<!-- svelte-ignore a11y_no_noninteractive_element_interactions --> <!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
<!-- eslint-disable svelte/no-at-html-tags -->
<div <div
id="dropzone" id="dropzone"
tabindex={0} tabindex={0}

View file

@ -11,7 +11,7 @@
<div id="selected-files-container"> <div id="selected-files-container">
<h2>{title}:</h2> <h2>{title}:</h2>
<div id="files-list"> <div id="files-list">
{#each Array.from(files) as file} {#each Array.from(files) as file, i (i)}
<div id={isError ? 'selected-file-card-error' : 'selected-file-card'}> <div id={isError ? 'selected-file-card-error' : 'selected-file-card'}>
<span>{file.name}</span> <span>{file.name}</span>
<span>{Math.round(file.size / 1000)} KB</span> <span>{Math.round(file.size / 1000)} KB</span>

View file

@ -1,8 +1,10 @@
<script> <script>
import { resolve } from '$app/paths';
import { t } from '$lib/translations'; import { t } from '$lib/translations';
import { appVersion } from '$lib/utils/env'; import { appVersion } from '$lib/utils/env';
</script> </script>
<!-- eslint-disable svelte/no-at-html-tags -->
<footer> <footer>
<div class="footer-content"> <div class="footer-content">
<div class="footer-info"> <div class="footer-info">
@ -24,9 +26,9 @@
</div> </div>
<nav class="footer-nav"> <nav class="footer-nav">
<a href="/about">{$t('footer.about')}</a> <a href={resolve('/about')}>{$t('footer.about')}</a>
<a href="/privacy-policy">{$t('footer.privacy.policy')}</a> <a href={resolve('/privacy-policy')}>{$t('footer.privacy.policy')}</a>
<a href="/terms-of-service">{$t('footer.terms.of.service')}</a> <a href={resolve('/terms-of-service')}>{$t('footer.terms.of.service')}</a>
</nav> </nav>
</div> </div>
</footer> </footer>

View file

@ -2,6 +2,7 @@
import { t, locale, SUPPORTED_LOCALES } from '$lib/translations'; import { t, locale, SUPPORTED_LOCALES } from '$lib/translations';
import logo from '$lib/assets/logo.webp'; import logo from '$lib/assets/logo.webp';
import MediaQuery from './MediaQuery.svelte'; import MediaQuery from './MediaQuery.svelte';
import { resolve } from '$app/paths';
/** /**
* *
@ -36,7 +37,7 @@
<div class="logo"> <div class="logo">
<MediaQuery query="(max-width: 768px)" let:matches> <MediaQuery query="(max-width: 768px)" let:matches>
{@const configs = configsFor(matches)} {@const configs = configsFor(matches)}
<a href="/"> <a href={resolve('/')}>
<img <img
src={configs.src} src={configs.src}
alt="Embroidery viewer logo" alt="Embroidery viewer logo"
@ -60,16 +61,16 @@
<nav class:is-open={isMenuOpen}> <nav class:is-open={isMenuOpen}>
<ul> <ul>
<li> <li>
<a href="/">{$t('header.homeNav')}</a> <a href={resolve('/')}>{$t('header.homeNav')}</a>
</li> </li>
<li> <li>
<a href="/viewer">{$t('header.viewerNav')}</a> <a href={resolve('/viewer')}>{$t('header.viewerNav')}</a>
</li> </li>
<li> <li>
<a href="/about">{$t('header.aboutNav')}</a> <a href={resolve('/about')}>{$t('header.aboutNav')}</a>
</li> </li>
<li> <li>
<a href="/donate">{$t('header.donateNav')}</a> <a href={resolve('/donate')}>{$t('header.donateNav')}</a>
</li> </li>
</ul> </ul>
</nav> </nav>

View file

@ -57,7 +57,8 @@ const config = {
locale: SUPPORTED_LOCALES.EN_US, locale: SUPPORTED_LOCALES.EN_US,
key: 'mobile.app.privacy.policy', key: 'mobile.app.privacy.policy',
routes: ['/mobile-app/privacy-policy'], routes: ['/mobile-app/privacy-policy'],
loader: async () => (await import('./en-US/mobile-app-privacy-policy.json')).default, loader: async () =>
(await import('./en-US/mobile-app-privacy-policy.json')).default,
}, },
{ {
locale: SUPPORTED_LOCALES.EN_US, locale: SUPPORTED_LOCALES.EN_US,
@ -110,7 +111,8 @@ const config = {
locale: SUPPORTED_LOCALES.PT_BR, locale: SUPPORTED_LOCALES.PT_BR,
key: 'mobile.app.privacy.policy', key: 'mobile.app.privacy.policy',
routes: ['/mobile-app/privacy-policy'], routes: ['/mobile-app/privacy-policy'],
loader: async () => (await import('./pt-BR/mobile-app-privacy-policy.json')).default, loader: async () =>
(await import('./pt-BR/mobile-app-privacy-policy.json')).default,
}, },
{ {
locale: SUPPORTED_LOCALES.PT_BR, locale: SUPPORTED_LOCALES.PT_BR,

View file

@ -6,7 +6,9 @@
import Footer from '$lib/components/Footer.svelte'; import Footer from '$lib/components/Footer.svelte';
import Analytics from '$lib/components/Analytics.svelte'; import Analytics from '$lib/components/Analytics.svelte';
let mounted = false; let { children } = $props();
let mounted = $state(false);
if (browser) { if (browser) {
onMount(() => { onMount(() => {
@ -20,7 +22,7 @@
{#if mounted} {#if mounted}
<Header /> <Header />
<main> <main>
<slot /> {@render children()}
</main> </main>
<Footer /> <Footer />
{/if} {/if}

View file

@ -1,4 +1,3 @@
/** @type {import('./$types').PageLoad} */ /** @type {import('./$types').PageLoad} */
export function load() { export function load() {
return { return {

View file

@ -1,6 +1,5 @@
import { EMAIL_ACCESS_KEY, EMAIL_BASE_URL } from '$env/static/private'; import { EMAIL_ACCESS_KEY, EMAIL_BASE_URL } from '$env/static/private';
/** @type {import('./$types').Actions} */ /** @type {import('./$types').Actions} */
export const actions = { export const actions = {
default: async ({ request }) => { default: async ({ request }) => {
@ -15,20 +14,20 @@ export const actions = {
name: formData.get('name'), name: formData.get('name'),
email: formData.get('email'), email: formData.get('email'),
}), }),
headers: { 'Content-Type': 'application/json' } headers: { 'Content-Type': 'application/json' },
}); });
const json = await response.json(); const json = await response.json();
if (json.error === undefined) { if (json.error === undefined) {
return { return {
message: "home.banner.feedback.success", message: 'home.banner.feedback.success',
textColor: 'green' textColor: 'green',
}; };
} else { } else {
return { return {
message: 'home.banner.feedback.error', message: 'home.banner.feedback.error',
textColor: 'red' textColor: 'red',
}; };
} }
} },
}; };

View file

@ -4,11 +4,11 @@
import { applyAction, enhance } from '$app/forms'; import { applyAction, enhance } from '$app/forms';
import { invalidateAll } from '$app/navigation'; import { invalidateAll } from '$app/navigation';
import { t, locale, SUPPORTED_LOCALES } from '$lib/translations'; import { t, locale, SUPPORTED_LOCALES } from '$lib/translations';
import { resolve } from '$app/paths';
import Seo from '$lib/components/Seo.svelte'; import Seo from '$lib/components/Seo.svelte';
import appScreenshot from '$lib/assets/app-with-frame.png'; import appScreenshot from '$lib/assets/app-with-frame.png';
import appScreenshotPt from '$lib/assets/app-with-frame-pt.png'; import appScreenshotPt from '$lib/assets/app-with-frame-pt.png';
import { browser } from '$app/environment';
let { data } = $props(); let { data } = $props();
/** /**
@ -21,6 +21,7 @@
*/ */
let loading = $state(false); let loading = $state(false);
// svelte-ignore state_referenced_locally
const metadata = data.metadata; const metadata = data.metadata;
const resetFeedback = () => { const resetFeedback = () => {
@ -31,6 +32,7 @@
<Seo {...metadata} /> <Seo {...metadata} />
<!-- eslint-disable svelte/no-at-html-tags -->
<div class="beta-section"> <div class="beta-section">
<div class="beta-content"> <div class="beta-content">
<div class="beta-image"> <div class="beta-image">
@ -104,7 +106,7 @@
<h2 id="donation-title">{$t('home.donation.title')}</h2> <h2 id="donation-title">{$t('home.donation.title')}</h2>
{@html $t('home.donation.description')} {@html $t('home.donation.description')}
<p> <p>
<a href="/donate" class="button">{$t('home.donation.cta')}</a> <a href={resolve("/donate")} class="button">{$t('home.donation.cta')}</a>
{$t('home.donation.cta.description')} {$t('home.donation.cta.description')}
</p> </p>
</section> </section>
@ -113,7 +115,7 @@
<section aria-labelledby="cta-title"> <section aria-labelledby="cta-title">
<h2 id="cta-title">{$t('home.cta.title')}</h2> <h2 id="cta-title">{$t('home.cta.title')}</h2>
<p> <p>
<a href="/viewer" class="button">{$t('home.cta.cta')}</a> <a href={resolve("/viewer")} class="button">{$t('home.cta.cta')}</a>
{@html $t('home.cta.cta.description')} {@html $t('home.cta.cta.description')}
</p> </p>
</section> </section>

View file

@ -6,6 +6,7 @@
/** @type {import('./$types').PageProps} */ /** @type {import('./$types').PageProps} */
let { data } = $props(); let { data } = $props();
// svelte-ignore state_referenced_locally
const metadata = data.metadata; const metadata = data.metadata;
</script> </script>
@ -14,6 +15,7 @@
<section aria-labelledby="about-heading"> <section aria-labelledby="about-heading">
<h1 id="about-heading">{$t('about.title')}</h1> <h1 id="about-heading">{$t('about.title')}</h1>
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html $t('about.content')} {@html $t('about.content')}
</section> </section>

View file

@ -10,6 +10,7 @@
/** @type {import('./$types').PageProps} */ /** @type {import('./$types').PageProps} */
let { data } = $props(); let { data } = $props();
// svelte-ignore state_referenced_locally
const metadata = data.metadata; const metadata = data.metadata;
const BTC_ADDRESS = 'bc1qpc4lpyr6stxrrg3u0k4clp4crlt6z4j6q845rq'; const BTC_ADDRESS = 'bc1qpc4lpyr6stxrrg3u0k4clp4crlt6z4j6q845rq';
@ -44,6 +45,7 @@
<header> <header>
<h1 id="donate-title">{$t('donate.title')}</h1> <h1 id="donate-title">{$t('donate.title')}</h1>
<p class="donate-subtitle">{$t('donate.subtitle')}</p> <p class="donate-subtitle">{$t('donate.subtitle')}</p>
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
<p>{@html $t('donate.description')}</p> <p>{@html $t('donate.description')}</p>
</header> </header>
@ -55,7 +57,7 @@
<p>{$t('donate.bitcoin.description')}</p> <p>{$t('donate.bitcoin.description')}</p>
<button <button
aria-label="Copy Bitcoin address" aria-label="Copy Bitcoin address"
on:click={() => copyToClipboard(BTC_ADDRESS, 'btc')} onclick={() => copyToClipboard(BTC_ADDRESS, 'btc')}
> >
{#if copyStatus.btc} {#if copyStatus.btc}
{$t(copyStatus.btc)} {$t(copyStatus.btc)}
@ -71,7 +73,7 @@
<p>{$t('donate.monero.description')}</p> <p>{$t('donate.monero.description')}</p>
<button <button
aria-label="Copy Monero address" aria-label="Copy Monero address"
on:click={() => copyToClipboard(XMR_ADDRESS, 'xmr')} onclick={() => copyToClipboard(XMR_ADDRESS, 'xmr')}
> >
{#if copyStatus.xmr} {#if copyStatus.xmr}
{$t(copyStatus.xmr)} {$t(copyStatus.xmr)}

View file

@ -5,6 +5,7 @@
/** @type {import('./$types').PageProps} */ /** @type {import('./$types').PageProps} */
let { data } = $props(); let { data } = $props();
// svelte-ignore state_referenced_locally
const metadata = data.metadata; const metadata = data.metadata;
</script> </script>
@ -14,6 +15,7 @@
<h1 id="privacy-policy-heading">{$t('mobile.app.privacy.policy.title')}</h1> <h1 id="privacy-policy-heading">{$t('mobile.app.privacy.policy.title')}</h1>
<p><em>{$t('mobile.app.privacy.policy.last.update')}</em></p> <p><em>{$t('mobile.app.privacy.policy.last.update')}</em></p>
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html $t('mobile.app.privacy.policy.content')} {@html $t('mobile.app.privacy.policy.content')}
</section> </section>

View file

@ -5,6 +5,7 @@
/** @type {import('./$types').PageProps} */ /** @type {import('./$types').PageProps} */
let { data } = $props(); let { data } = $props();
// svelte-ignore state_referenced_locally
const metadata = data.metadata; const metadata = data.metadata;
</script> </script>
@ -14,6 +15,7 @@
<h1 id="privacy-policy-heading">{$t('privacy.policy.title')}</h1> <h1 id="privacy-policy-heading">{$t('privacy.policy.title')}</h1>
<p><em>{$t('privacy.policy.last.update')}</em></p> <p><em>{$t('privacy.policy.last.update')}</em></p>
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html $t('privacy.policy.content')} {@html $t('privacy.policy.content')}
</section> </section>

View file

@ -5,6 +5,7 @@
/** @type {import('./$types').PageProps} */ /** @type {import('./$types').PageProps} */
let { data } = $props(); let { data } = $props();
// svelte-ignore state_referenced_locally
const metadata = data.metadata; const metadata = data.metadata;
</script> </script>
@ -14,6 +15,7 @@
<h1 id="tos-heading">{$t('terms.of.service.title')}</h1> <h1 id="tos-heading">{$t('terms.of.service.title')}</h1>
<p><em>{$t('terms.of.service.update')}</em></p> <p><em>{$t('terms.of.service.update')}</em></p>
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html $t('terms.of.service.content')} {@html $t('terms.of.service.content')}
</section> </section>

View file

@ -1,4 +1,6 @@
<script> <script>
// @ts-nocheck
import { t } from '$lib/translations'; import { t } from '$lib/translations';
import CardList from '$lib/components/CardList.svelte'; import CardList from '$lib/components/CardList.svelte';
@ -80,11 +82,13 @@
/** @type {import('./$types').PageProps} */ /** @type {import('./$types').PageProps} */
let { data } = $props(); let { data } = $props();
// svelte-ignore state_referenced_locally
const metadata = data.metadata; const metadata = data.metadata;
</script> </script>
<Seo {...metadata} /> <Seo {...metadata} />
<!-- eslint-disable svelte/no-at-html-tags -->
<form id="form" enctype="multipart/form-data" onsubmit={onSubmit}> <form id="form" enctype="multipart/form-data" onsubmit={onSubmit}>
<div class="title-container"> <div class="title-container">
<h2>{$t('viewer.title')}</h2> <h2>{$t('viewer.title')}</h2>