From 3cd8fb25647f24645fc77dcb57216a5eaac0384c Mon Sep 17 00:00:00 2001 From: core Date: Mon, 20 Feb 2023 12:01:32 -0500 Subject: [PATCH] refactor --- tfweb/package.json | 1 + tfweb/src/components/Header.svelte | 18 ++++++++--------- tfweb/src/components/Theme.svelte | 4 ++-- tfweb/src/{scripts => lib}/PersistentStore.ts | 0 tfweb/src/{scripts => lib}/i18n.ts | 10 +++++----- tfweb/src/{ => lib}/i18n/en.json | 0 tfweb/src/{ => lib}/i18n/jp.json | 0 tfweb/src/{ => lib}/i18n/nl.json | 0 tfweb/src/{scripts => lib}/logger.ts | 2 +- tfweb/src/lib/stores/LocaleStore.ts | 3 +++ tfweb/src/lib/stores/ThemeStore.ts | 3 +++ tfweb/src/routes/+layout.ts | 1 + tfweb/src/routes/auth/login/+page.svelte | 20 ++++++++++++++++--- tfweb/src/stores/LocaleStore.ts | 3 --- tfweb/src/stores/ThemeStore.ts | 3 --- tfweb/svelte.config.js | 10 ++++++++-- tfweb/yarn.lock | 5 +++++ 17 files changed, 54 insertions(+), 29 deletions(-) rename tfweb/src/{scripts => lib}/PersistentStore.ts (100%) rename tfweb/src/{scripts => lib}/i18n.ts (84%) rename tfweb/src/{ => lib}/i18n/en.json (100%) rename tfweb/src/{ => lib}/i18n/jp.json (100%) rename tfweb/src/{ => lib}/i18n/nl.json (100%) rename tfweb/src/{scripts => lib}/logger.ts (98%) create mode 100644 tfweb/src/lib/stores/LocaleStore.ts create mode 100644 tfweb/src/lib/stores/ThemeStore.ts create mode 100644 tfweb/src/routes/+layout.ts delete mode 100644 tfweb/src/stores/LocaleStore.ts delete mode 100644 tfweb/src/stores/ThemeStore.ts diff --git a/tfweb/package.json b/tfweb/package.json index b9af103..657b12b 100644 --- a/tfweb/package.json +++ b/tfweb/package.json @@ -29,6 +29,7 @@ }, "type": "module", "dependencies": { + "@sveltejs/adapter-static": "^2.0.1", "a17t": "^0.10.1" } } diff --git a/tfweb/src/components/Header.svelte b/tfweb/src/components/Header.svelte index 2d35b82..78e9df7 100644 --- a/tfweb/src/components/Header.svelte +++ b/tfweb/src/components/Header.svelte @@ -1,10 +1,8 @@ \ No newline at end of file + + +

{t('login.title')}

+

{t('login.subtitle')}

+ +
+ + + +
diff --git a/tfweb/src/stores/LocaleStore.ts b/tfweb/src/stores/LocaleStore.ts deleted file mode 100644 index c071378..0000000 --- a/tfweb/src/stores/LocaleStore.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { persist } from "../scripts/PersistentStore"; - -export const locale = persist("lang", "en"); \ No newline at end of file diff --git a/tfweb/src/stores/ThemeStore.ts b/tfweb/src/stores/ThemeStore.ts deleted file mode 100644 index 1bdb296..0000000 --- a/tfweb/src/stores/ThemeStore.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { persist } from "../scripts/PersistentStore"; - -export const theme = persist("theme", "light"); \ No newline at end of file diff --git a/tfweb/svelte.config.js b/tfweb/svelte.config.js index 87f198f..2cde54d 100644 --- a/tfweb/svelte.config.js +++ b/tfweb/svelte.config.js @@ -1,4 +1,4 @@ -import adapter from '@sveltejs/adapter-auto'; +import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/kit/vite'; /** @type {import('@sveltejs/kit').Config} */ @@ -8,7 +8,13 @@ const config = { preprocess: vitePreprocess(), kit: { - adapter: adapter() + adapter: adapter({ + pages: 'build', + assets: 'build', + fallback: null, + precompress: false, + strict: true + }) } }; diff --git a/tfweb/yarn.lock b/tfweb/yarn.lock index 76dd13f..d0e85ff 100644 --- a/tfweb/yarn.lock +++ b/tfweb/yarn.lock @@ -197,6 +197,11 @@ dependencies: import-meta-resolve "^2.2.0" +"@sveltejs/adapter-static@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@sveltejs/adapter-static/-/adapter-static-2.0.1.tgz#b76f7742ae635e1c063efcab8c6de064255f6292" + integrity sha512-o5/q3YwD/ErxYCFlK1v3ydvldyNKk1lh3oeyxn4mhz+Pkbx/uuxhzmbOpytTlp5aVqNHDVsb04xadUzOFCDDzw== + "@sveltejs/kit@^1.5.0": version "1.7.2" resolved "https://registry.yarnpkg.com/@sveltejs/kit/-/kit-1.7.2.tgz#ec90d5f7d18a8c40e5a6d8dfae43acaa00f6b199"