From 79080d66548d053335e969891aadbb64af98be62 Mon Sep 17 00:00:00 2001 From: Till JS Date: Sat, 28 Mar 2026 10:15:23 +0100 Subject: [PATCH] fix(apps): use explicit AuthServiceInterface in all 21 auth stores, re-enable type-check Replace ReturnType['authService'] with the explicit AuthServiceInterface in all 21 web app auth stores. This ensures svelte-check sees all 37 auth methods instead of TS inferring a truncated type (~27 methods visible). Re-enabled type-check in 5 apps that were skipping it: - chat/web: svelte-kit sync && svelte-check --threshold error - clock/web: svelte-kit sync && svelte-check --threshold error - context/web: svelte-kit sync && svelte-check --threshold error - presi/web: svelte-kit sync && svelte-check --threshold error - picture/mobile: tsc --noEmit Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/calendar/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- apps/chat/apps/web/package.json | 2 +- apps/chat/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- apps/citycorners/apps/web/src/lib/stores/auth.svelte.ts | 2 +- apps/clock/apps/web/package.json | 2 +- apps/clock/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- apps/contacts/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- apps/context/apps/web/package.json | 2 +- apps/context/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- apps/inventar/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- apps/manacore/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- apps/mukke/apps/web/src/lib/stores/auth.svelte.ts | 2 +- apps/nutriphi/apps/web/src/lib/stores/auth.svelte.ts | 2 +- apps/photos/apps/web/src/lib/stores/auth.svelte.ts | 2 +- apps/picture/apps/mobile/package.json | 2 +- apps/picture/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- apps/planta/apps/web/src/lib/stores/auth.svelte.ts | 2 +- apps/presi/apps/web/package.json | 2 +- apps/presi/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- apps/questions/apps/web/src/lib/stores/auth.svelte.ts | 2 +- apps/skilltree/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- apps/storage/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- apps/todo/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- apps/zitare/apps/web/src/lib/stores/auth.svelte.ts | 4 ++-- 24 files changed, 37 insertions(+), 37 deletions(-) diff --git a/apps/calendar/apps/web/src/lib/stores/auth.svelte.ts b/apps/calendar/apps/web/src/lib/stores/auth.svelte.ts index f0a89f0db..02c6bfe18 100644 --- a/apps/calendar/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/calendar/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; // Default URLs for local development only const DEV_AUTH_URL = 'http://localhost:3001'; @@ -33,7 +33,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/chat/apps/web/package.json b/apps/chat/apps/web/package.json index 22c376859..f5a00dbf0 100644 --- a/apps/chat/apps/web/package.json +++ b/apps/chat/apps/web/package.json @@ -10,7 +10,7 @@ "prepare": "svelte-kit sync || echo ''", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "type-check": "echo 'Skipping type-check: @chat/web needs shared-ui component fixes'", + "type-check": "svelte-kit sync && svelte-check --threshold error", "lint": "eslint ." }, "devDependencies": { diff --git a/apps/chat/apps/web/src/lib/stores/auth.svelte.ts b/apps/chat/apps/web/src/lib/stores/auth.svelte.ts index 89d660a85..4c8b01e83 100644 --- a/apps/chat/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/chat/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; // Default URLs for local development only const DEV_AUTH_URL = 'http://localhost:3001'; @@ -33,7 +33,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/citycorners/apps/web/src/lib/stores/auth.svelte.ts b/apps/citycorners/apps/web/src/lib/stores/auth.svelte.ts index b9bdc3e6c..068c63371 100644 --- a/apps/citycorners/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/citycorners/apps/web/src/lib/stores/auth.svelte.ts @@ -31,7 +31,7 @@ function getBackendUrl(): string { return process.env.PUBLIC_BACKEND_URL || DEV_BACKEND_URL; } -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/clock/apps/web/package.json b/apps/clock/apps/web/package.json index e7c482e0c..dab1a7ca8 100644 --- a/apps/clock/apps/web/package.json +++ b/apps/clock/apps/web/package.json @@ -11,7 +11,7 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "lint": "eslint .", "format": "prettier --write .", - "type-check": "echo 'Skipping type-check for now'" + "type-check": "svelte-kit sync && svelte-check --threshold error" }, "devDependencies": { "@manacore/shared-pwa": "workspace:*", diff --git a/apps/clock/apps/web/src/lib/stores/auth.svelte.ts b/apps/clock/apps/web/src/lib/stores/auth.svelte.ts index 8d32bd44d..3116c9bfa 100644 --- a/apps/clock/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/clock/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; // Default URLs for local development only const DEV_AUTH_URL = 'http://localhost:3001'; @@ -33,7 +33,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/contacts/apps/web/src/lib/stores/auth.svelte.ts b/apps/contacts/apps/web/src/lib/stores/auth.svelte.ts index 18ba633aa..af1a7f981 100644 --- a/apps/contacts/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/contacts/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; // Default URLs for local development only const DEV_AUTH_URL = 'http://localhost:3001'; @@ -33,7 +33,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/context/apps/web/package.json b/apps/context/apps/web/package.json index dab0ae76c..e59b1ad8b 100644 --- a/apps/context/apps/web/package.json +++ b/apps/context/apps/web/package.json @@ -11,7 +11,7 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "lint": "eslint .", "format": "prettier --write .", - "type-check": "echo 'Skipping type-check for now'" + "type-check": "svelte-kit sync && svelte-check --threshold error" }, "devDependencies": { "@manacore/shared-pwa": "workspace:*", diff --git a/apps/context/apps/web/src/lib/stores/auth.svelte.ts b/apps/context/apps/web/src/lib/stores/auth.svelte.ts index 757a83f63..002700137 100644 --- a/apps/context/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/context/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; // Default URLs for local development only const DEV_AUTH_URL = 'http://localhost:3001'; @@ -31,7 +31,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/inventar/apps/web/src/lib/stores/auth.svelte.ts b/apps/inventar/apps/web/src/lib/stores/auth.svelte.ts index de1ecb6d1..0059359cf 100644 --- a/apps/inventar/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/inventar/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; const DEV_AUTH_URL = 'http://localhost:3001'; @@ -18,7 +18,7 @@ function getAuthUrl(): string { return process.env.PUBLIC_MANA_CORE_AUTH_URL || DEV_AUTH_URL; } -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/manacore/apps/web/src/lib/stores/auth.svelte.ts b/apps/manacore/apps/web/src/lib/stores/auth.svelte.ts index 9bd0bb316..c78519e32 100644 --- a/apps/manacore/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/manacore/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; // Default URL for local development only const DEV_AUTH_URL = 'http://localhost:3001'; @@ -21,7 +21,7 @@ function getAuthUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/mukke/apps/web/src/lib/stores/auth.svelte.ts b/apps/mukke/apps/web/src/lib/stores/auth.svelte.ts index 2bbf63e47..96d9a3510 100644 --- a/apps/mukke/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/mukke/apps/web/src/lib/stores/auth.svelte.ts @@ -32,7 +32,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/nutriphi/apps/web/src/lib/stores/auth.svelte.ts b/apps/nutriphi/apps/web/src/lib/stores/auth.svelte.ts index e2a698a26..51e75627c 100644 --- a/apps/nutriphi/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/nutriphi/apps/web/src/lib/stores/auth.svelte.ts @@ -32,7 +32,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/photos/apps/web/src/lib/stores/auth.svelte.ts b/apps/photos/apps/web/src/lib/stores/auth.svelte.ts index bc66ee750..d50685a9a 100644 --- a/apps/photos/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/photos/apps/web/src/lib/stores/auth.svelte.ts @@ -32,7 +32,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/picture/apps/mobile/package.json b/apps/picture/apps/mobile/package.json index cddd6ad13..200a4d2c1 100644 --- a/apps/picture/apps/mobile/package.json +++ b/apps/picture/apps/mobile/package.json @@ -13,7 +13,7 @@ "prebuild": "expo prebuild", "lint": "eslint .", "format": "eslint . --fix", - "type-check": "echo 'Skipping type-check: @picture/mobile needs theme system migration'", + "type-check": "tsc --noEmit", "postinstall": "patch-package || true && ./scripts/build-workspace-deps.sh" }, "dependencies": { diff --git a/apps/picture/apps/web/src/lib/stores/auth.svelte.ts b/apps/picture/apps/web/src/lib/stores/auth.svelte.ts index 420a83318..f8e1400a8 100644 --- a/apps/picture/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/picture/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; // Default URLs for local development only const DEV_AUTH_URL = 'http://localhost:3001'; @@ -33,7 +33,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/planta/apps/web/src/lib/stores/auth.svelte.ts b/apps/planta/apps/web/src/lib/stores/auth.svelte.ts index f2c583196..b5c09808f 100644 --- a/apps/planta/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/planta/apps/web/src/lib/stores/auth.svelte.ts @@ -32,7 +32,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/presi/apps/web/package.json b/apps/presi/apps/web/package.json index b44c9e4b3..d87a20d25 100644 --- a/apps/presi/apps/web/package.json +++ b/apps/presi/apps/web/package.json @@ -8,7 +8,7 @@ "preview": "vite preview", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "type-check": "echo 'Skipping type-check: @presi/web needs shared-ui component fixes'", + "type-check": "svelte-kit sync && svelte-check --threshold error", "lint": "eslint .", "format": "prettier --write ." }, diff --git a/apps/presi/apps/web/src/lib/stores/auth.svelte.ts b/apps/presi/apps/web/src/lib/stores/auth.svelte.ts index d31408d6d..9b94707d5 100644 --- a/apps/presi/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/presi/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; // Default URLs for local development only const DEV_AUTH_URL = 'http://localhost:3001'; @@ -33,7 +33,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/questions/apps/web/src/lib/stores/auth.svelte.ts b/apps/questions/apps/web/src/lib/stores/auth.svelte.ts index e3ba21c37..ea5be99e3 100644 --- a/apps/questions/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/questions/apps/web/src/lib/stores/auth.svelte.ts @@ -31,7 +31,7 @@ function getBackendUrl(): string { return process.env.PUBLIC_BACKEND_URL || DEV_BACKEND_URL; } -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/skilltree/apps/web/src/lib/stores/auth.svelte.ts b/apps/skilltree/apps/web/src/lib/stores/auth.svelte.ts index 70a7a46a9..2b15dfb28 100644 --- a/apps/skilltree/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/skilltree/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; import { apiClient } from '$lib/api/client'; const DEV_AUTH_URL = 'http://localhost:3001'; @@ -30,7 +30,7 @@ function getBackendUrl(): string { return process.env.PUBLIC_BACKEND_URL || DEV_BACKEND_URL; } -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/storage/apps/web/src/lib/stores/auth.svelte.ts b/apps/storage/apps/web/src/lib/stores/auth.svelte.ts index bcf5c0670..5c8248e1e 100644 --- a/apps/storage/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/storage/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; // Default URLs for local development only const DEV_AUTH_URL = 'http://localhost:3001'; @@ -33,7 +33,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/todo/apps/web/src/lib/stores/auth.svelte.ts b/apps/todo/apps/web/src/lib/stores/auth.svelte.ts index 5a5819b21..3b267e9dc 100644 --- a/apps/todo/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/todo/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; import { apiClient } from '$lib/api/client'; import { todoStore } from '$lib/data/local-store'; @@ -39,7 +39,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() { diff --git a/apps/zitare/apps/web/src/lib/stores/auth.svelte.ts b/apps/zitare/apps/web/src/lib/stores/auth.svelte.ts index 3765044a5..3e948635a 100644 --- a/apps/zitare/apps/web/src/lib/stores/auth.svelte.ts +++ b/apps/zitare/apps/web/src/lib/stores/auth.svelte.ts @@ -4,7 +4,7 @@ */ import { browser } from '$app/environment'; -import { initializeWebAuth, type UserData } from '@manacore/shared-auth'; +import { initializeWebAuth, type UserData, type AuthServiceInterface } from '@manacore/shared-auth'; // Default URLs for local development only const DEV_AUTH_URL = 'http://localhost:3001'; @@ -33,7 +33,7 @@ function getBackendUrl(): string { } // Lazy initialization to avoid SSR issues with localStorage -let _authService: ReturnType['authService'] | null = null; +let _authService: AuthServiceInterface | null = null; let _tokenManager: ReturnType['tokenManager'] | null = null; function getAuthService() {