Skip to content

Commit

Permalink
fix(console): upgrade to latest paraglide-js-adapter-sveltekit
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Jan 24, 2024
1 parent 1883f66 commit fe0333f
Show file tree
Hide file tree
Showing 58 changed files with 766 additions and 954 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"strings": true
},
////////// Search //////////
"search.followSymlinks": false,
"search.exclude": {
"**/.git": true,
"**/node_modules": true,
Expand Down
18 changes: 9 additions & 9 deletions apps/console-fb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@
"@spectacular/utils": "workspace:*",
"@svelte-put/resize": "3.0.0",
"@sveltejs/adapter-auto": "3.1.1",
"@sveltejs/adapter-node": "4.0.0",
"@sveltejs/adapter-node": "4.0.1",
"@sveltejs/adapter-vercel": "5.1.0",
"@sveltejs/enhanced-img": "0.1.8",
"@sveltejs/kit": "2.4.1",
"@sveltejs/kit": "2.4.3",
"@sveltejs/vite-plugin-svelte": "3.0.1",
"@tailwindcss/container-queries": "0.1.1",
"@testing-library/jest-dom": "6.2.0",
"@testing-library/jest-dom": "6.2.1",
"@testing-library/svelte": "4.0.5",
"@types/gtag.js": "0.0.18",
"@types/js-cookie": "3.0.6",
"@types/node": "20.11.5",
"@typescript-eslint/eslint-plugin": "6.19.0",
"@typescript-eslint/parser": "6.19.0",
"@typescript-eslint/eslint-plugin": "6.19.1",
"@typescript-eslint/parser": "6.19.1",
"@vercel/analytics": "1.1.2",
"@vite-pwa/sveltekit": "0.3.0",
"@vitest/coverage-v8": "1.2.1",
Expand All @@ -63,10 +63,10 @@
"cssnano": "6.0.3",
"d3-force": "3.0.0",
"d3-scale": "4.0.2",
"date-fns": "3.3.0",
"date-fns": "3.3.1",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-svelte": "2.35.1",
"eslint-plugin-svelte": "2.36.0-next.5",
"flowbite": "2.2.1",
"flowbite-svelte": "0.44.22",
"flowbite-svelte-blocks": "1.1.0",
Expand All @@ -80,7 +80,7 @@
"js-cookie": "3.0.5",
"jsdom": "24.0.0",
"layercake": "8.0.2",
"msw": "2.1.2",
"msw": "2.1.4",
"postcss": "8.4.33",
"postcss-preset-env": "9.3.0",
"prettier": "3.2.4",
Expand All @@ -97,7 +97,7 @@
"sveltekit-rate-limiter": "0.4.3",
"sveltekit-superforms": "1.13.4",
"sveltekit-view-transition": "0.5.3",
"tailwind-merge": "2.2.0",
"tailwind-merge": "2.2.1",
"tailwindcss": "3.4.1",
"tailwindcss-animate": "1.0.7",
"tslib": "2.6.2",
Expand Down
14 changes: 7 additions & 7 deletions apps/console-sc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@
"@spectacular/utils": "workspace:*",
"@sveltejs/adapter-auto": "3.1.1",
"@sveltejs/enhanced-img": "0.1.8",
"@sveltejs/kit": "2.4.1",
"@sveltejs/kit": "2.4.3",
"@sveltejs/vite-plugin-svelte": "3.0.1",
"@tailwindcss/container-queries": "0.1.1",
"@tailwindcss/forms": "0.5.7",
"@tailwindcss/typography": "0.5.10",
"@types/eslint": "8.56.2",
"@types/node": "20.11.5",
"@typescript-eslint/eslint-plugin": "6.19.0",
"@typescript-eslint/parser": "6.19.0",
"@vincjo/datatables": "1.14.3",
"@typescript-eslint/eslint-plugin": "6.19.1",
"@typescript-eslint/parser": "6.19.1",
"@vincjo/datatables": "1.14.4",
"autoprefixer": "10.4.17",
"bits-ui": "0.15.1",
"clsx": "2.1.0",
"cmdk-sv": "0.0.13",
"cssnano": "6.0.3",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-svelte": "2.35.1",
"formsnap": "0.4.2",
"eslint-plugin-svelte": "2.36.0-next.5",
"formsnap": "0.4.3",
"lucide-svelte": "0.314.0",
"postcss": "8.4.33",
"postcss-import": "16.0.0",
Expand All @@ -57,7 +57,7 @@
"sveltekit-rate-limiter": "0.4.3",
"sveltekit-superforms": "1.13.4",
"sveltekit-view-transition": "0.5.3",
"tailwind-merge": "2.2.0",
"tailwind-merge": "2.2.1",
"tailwind-variants": "0.1.20",
"tailwindcss": "3.4.1",
"tailwindcss-animate": "1.0.7",
Expand Down
29 changes: 14 additions & 15 deletions apps/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,23 @@
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write . && eslint --fix .",
"format": "prettier --write .",
"test:unit": "vitest",
"test:unit:ui": "vitest --ui",
"test:unit:coverage": "vitest run --coverage",
"test:integration": "playwright test",
"lang:validate": "pnpm inlang validate --project ./project.inlang",
"lang:lint": "pnpm inlang lint --project ./project.inlang",
"lang:studio": "pnpm inlang open editor",
"lang:translate": "pnpm inlang machine translate --project ./project.inlang -f",
"lang:build": "paraglide-js compile --project ./project.inlang"
"lang:translate": "pnpm inlang machine translate --project ./project.inlang -f"
},
"devDependencies": {
"@floating-ui/dom": "1.5.4",
"@fontsource-variable/inter": "5.0.16",
"@inlang/cli": "2.6.0",
"@inlang/cli": "2.10.0",
"@inlang/paraglide-js": "1.2.1",
"@inlang/paraglide-js-adapter-vite": "1.2.7",
"@nhost/nhost-js": "3.0.1",
"@inlang/paraglide-js-adapter-sveltekit": "0.2.2",
"@nhost/nhost-js": "3.0.2",
"@skeletonlabs/skeleton": "2.7.1",
"@skeletonlabs/tw-plugin": "0.3.1",
"@spectacular/eslint-config": "workspace:*",
Expand All @@ -39,33 +38,33 @@
"@spectacular/typescript-config": "workspace:*",
"@spectacular/utils": "workspace:*",
"@sveltejs/adapter-auto": "3.1.1",
"@sveltejs/adapter-node": "4.0.0",
"@sveltejs/adapter-node": "4.0.1",
"@sveltejs/adapter-vercel": "5.1.0",
"@sveltejs/enhanced-img": "0.1.8",
"@sveltejs/kit": "2.4.1",
"@sveltejs/kit": "2.4.3",
"@sveltejs/vite-plugin-svelte": "3.0.1",
"@tailwindcss/container-queries": "0.1.1",
"@tailwindcss/forms": "0.5.7",
"@tailwindcss/typography": "0.5.10",
"@types/d3-scale": "4.0.8",
"@types/eslint": "8.56.2",
"@types/node": "20.11.5",
"@typescript-eslint/eslint-plugin": "6.19.0",
"@typescript-eslint/parser": "6.19.0",
"@typescript-eslint/eslint-plugin": "6.19.1",
"@typescript-eslint/parser": "6.19.1",
"@vercel/analytics": "1.1.2",
"@vincjo/datatables": "1.14.3",
"@vincjo/datatables": "1.14.4",
"@vitest/coverage-v8": "1.2.1",
"@xyflow/svelte": "0.0.34",
"autoprefixer": "10.4.17",
"d3-array": "3.2.4",
"d3-scale": "4.0.2",
"d3-scale-chromatic": "3.0.0",
"d3-shape": "3.2.0",
"date-fns": "3.3.0",
"date-fns": "3.3.1",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-svelte": "2.35.1",
"formsnap": "0.4.2",
"eslint-plugin-svelte": "2.36.0-next.5",
"formsnap": "0.4.3",
"graphql-ws": "5.14.3",
"houdini": "1.2.36",
"houdini-svelte": "1.2.36",
Expand All @@ -84,7 +83,7 @@
"sveltekit-rate-limiter": "0.4.3",
"sveltekit-superforms": "2.0.0-alpha.25",
"sveltekit-view-transition": "0.5.3",
"tailwind-merge": "2.2.0",
"tailwind-merge": "2.2.1",
"tailwind-variants": "0.1.20",
"tailwindcss": "3.4.1",
"tailwindcss-animate": "1.0.7",
Expand Down
8 changes: 7 additions & 1 deletion apps/console/project.inlang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"buttons_update": "Aktualisieren",
"buttons_logout": "Ausloggen",
"buttons_login_youtube": "Melden Sie sich mit YouTube an",
"labels_menu_home": "Heim",
"labels_menu_dashboard": "Armaturenbrett",
"labels_title": "Titel",
"labels_description": "Beschreibung",
"labels_visibility": "Sichtweite",
Expand All @@ -23,6 +25,7 @@
"messages_please_wait": "Bitte warten...",
"log": "Dieses Protokoll wurde von {fileName} aufgerufen!",
"auth_labels_signin": "Anmelden",
"auth_labels_signin_with_email": "Melden Sie sich mit E-Mail an",
"auth_labels_signin_problem": "Anmeldeproblem",
"auth_labels_signup": "Registrieren",
"auth_labels_signout": "Abmelden",
Expand All @@ -33,6 +36,8 @@
"auth_labels_reset_problem": "Problem beim Zurücksetzen des Passworts",
"auth_labels_send_peset_email": "Passwort-Zurücksetzen-E-Mail senden",
"auth_messages_aaa": "testing",
"auth_forms_first_organization_label": "Organisation",
"auth_forms_first_organization_placeholder": "Organisation",
"auth_forms_first_name_label": "Vorname",
"auth_forms_first_name_placeholder": "Vorname",
"auth_forms_last_name_label": "Nachname",
Expand All @@ -42,5 +47,6 @@
"auth_forms_password_label": "Passwort",
"auth_forms_password_placeholder": "Passwort",
"dashboard_labels_create_list": "Klicken Sie auf Erstellen, um zu beginnen.",
"dashboard_messages_tagline": "Präsentiert das ultimative YouTube-Erlebnis. Egal, ob Sie auf der Suche nach neuen Inhalten zum Ansehen sind oder Ihre eigene kuratierte Liste mit Freunden teilen möchten, unsere App ist genau das Richtige für Sie."
"dashboard_messages_tagline": "Präsentiert das ultimative YouTube-Erlebnis. Egal, ob Sie auf der Suche nach neuen Inhalten zum Ansehen sind oder Ihre eigene kuratierte Liste mit Freunden teilen möchten, unsere App ist genau das Richtige für Sie.",
"error_page_message": "Entschuldigung. Irgendwas ist schief gelaufen"
}
3 changes: 2 additions & 1 deletion apps/console/project.inlang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"auth_forms_password_label": "Password",
"auth_forms_password_placeholder": "Password",
"dashboard_labels_create_list": "Click Create to get started.",
"dashboard_messages_tagline": "Presenting the ultimate YouTube experience. Whether you're looking for new content to watch or want to share your own curated list with friends, our app has got you covered."
"dashboard_messages_tagline": "Presenting the ultimate YouTube experience. Whether you're looking for new content to watch or want to share your own curated list with friends, our app has got you covered.",
"error_page_message": "We're sorry, something went wrong"
}
2 changes: 1 addition & 1 deletion apps/console/src/app.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!doctype html>
<!-- Added Placeholders for lang & dir attributes. These get replaced in `hooks.server.ts` -->
<html lang="%lang%" dir="%textDir%" class="dark">
<html lang="%lang%" class="dark">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
Expand Down
5 changes: 5 additions & 0 deletions apps/console/src/hooks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// export { dead_links as reroute } from "$lib/middleware/dead-links";
import type { Reroute } from '@sveltejs/kit';
import { i18n } from '$lib/i18n';

export const reroute = i18n.reroute() satisfies Reroute;
1 change: 0 additions & 1 deletion apps/console/src/hooks.ts.bak

This file was deleted.

3 changes: 1 addition & 2 deletions apps/console/src/lib/components/layout/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import Icon from '@spectacular/skeleton/components/icons/Icon.svelte';
import { menuNavLinks } from '$lib/links';
import { page } from '$app/stores';
import { link } from '$lib/i18n/link';
// Local
let currentRailCategory: keyof typeof menuNavLinks | undefined = undefined;
Expand Down Expand Up @@ -88,7 +87,7 @@
{#each segment.list as { href, label, badge }}
<li on:keypress on:click={drawerStore.close}>
<a
{...$link(href)}
{href}
class={listboxItemActive(href)}
data-sveltekit-preload-data="hover"
>
Expand Down
10 changes: 7 additions & 3 deletions apps/console/src/lib/components/layout/header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
import { enhance } from '$app/forms';
import { storeTheme } from '$lib/stores/stores';
import LangSwitch from '$lib/components/layout/lang-switch.svelte';
import * as m from '$i18n/messages';
import Avatar from './avatar.svelte';
const drawerStore = getDrawerStore();
export let user: User | undefined;
Expand Down Expand Up @@ -132,13 +134,13 @@
<li>
<a href="/">
<span class="w-6 text-center"><Home /> </span>
<span>Homepage</span>
<span>Home</span>
</a>
</li>
<li>
<a href="/docs/get-started">
<span class="w-6 text-center"><BookText /></span>
<span>Documentation</span>
<span>Docs</span>
</a>
</li>
<li>
Expand Down Expand Up @@ -239,7 +241,9 @@
<Avatar initials={user.email} />
{/if}
{:else}
<a href="/auth/signin" class="variant-filled-primary btn">Sign in</a>
<a href="/auth/signin" class="variant-filled-primary btn"
>{m.auth_labels_signin()}</a
>
{/if}
</section>
</svelte:fragment>
Expand Down
21 changes: 0 additions & 21 deletions apps/console/src/lib/components/layout/lang-header.svelte

This file was deleted.

9 changes: 5 additions & 4 deletions apps/console/src/lib/components/layout/lang-switch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import { RadioGroup, RadioItem } from '@skeletonlabs/skeleton';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { availableLanguageTags, sourceLanguageTag } from '$i18n/runtime';
import { translatePath } from '$lib/i18n/i18n';
import { availableLanguageTags, languageTag } from '$i18n/runtime';
import { i18n } from '$lib/i18n';
let locl: string = sourceLanguageTag;
let locl: string = languageTag();
</script>

<!-- TODO: make it pretty-->
Expand All @@ -19,7 +19,8 @@
bind:group={locl}
name="justify"
value={l}
on:click={() => goto(translatePath($page.url.pathname, l))}>{l}</RadioItem
on:click={() => goto(i18n.resolveRoute(i18n.route($page.url.pathname), l))}
>{l}</RadioItem
>
{/each}
</RadioGroup>
3 changes: 1 addition & 2 deletions apps/console/src/lib/components/layout/sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import Icon from '@spectacular/skeleton/components/icons/Icon.svelte';
import { menuNavLinks } from '$lib/links';
import { page } from '$app/stores';
import { link } from '$lib/i18n/link';
// Local
let currentRailCategory: keyof typeof menuNavLinks | undefined = undefined;
Expand Down Expand Up @@ -88,7 +87,7 @@
{#each segment.list as { href, label, badge }}
<li on:keypress on:click={drawerStore.close}>
<a
{...$link(href)}
{href}
class={listboxItemActive(href)}
data-sveltekit-preload-data="hover"
>
Expand Down
4 changes: 4 additions & 0 deletions apps/console/src/lib/i18n.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { createI18n } from '@inlang/paraglide-js-adapter-sveltekit';
import * as runtime from '$i18n/runtime.js';

export const i18n = createI18n(runtime);
14 changes: 0 additions & 14 deletions apps/console/src/lib/i18n/constants.ts

This file was deleted.

Loading

0 comments on commit fe0333f

Please sign in to comment.