From d0d2855adb0efad1e2a8f6107f24802fb465a0c2 Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Thu, 29 Jan 2026 16:38:57 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20create=20@manacore/shar?= =?UTF-8?q?ed-tsconfig=20and=20migrate=2013=20backends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create shared TypeScript config package with: - base.json: Common options (ES2021, skipLibCheck, etc.) - nestjs.json: NestJS backend config (decorators, commonjs) - sveltekit.json: SvelteKit web config - expo.json: Expo mobile config - astro.json: Astro landing config - Migrate 13 NestJS backends to use shared config: calendar, chat, clock, contacts, nutriphi, picture, planta, presi, questions, skilltree, storage, todo, zitare - Skip manadeck (uses nodenext module system) Savings: ~280 LOC (13 backends × ~22 LOC each) --- apps/calendar/apps/backend/tsconfig.json | 24 +-------------- apps/chat/apps/backend/tsconfig.json | 24 +-------------- apps/clock/apps/backend/tsconfig.json | 24 +-------------- apps/contacts/apps/backend/tsconfig.json | 24 +-------------- apps/nutriphi/apps/backend/tsconfig.json | 24 +-------------- apps/picture/apps/backend/tsconfig.json | 22 +------------- apps/planta/apps/backend/tsconfig.json | 24 +-------------- apps/presi/apps/backend/tsconfig.json | 23 +-------------- apps/questions/apps/backend/tsconfig.json | 25 ++-------------- apps/skilltree/apps/backend/tsconfig.json | 22 ++------------ apps/storage/apps/backend/tsconfig.json | 24 +-------------- apps/todo/apps/backend/tsconfig.json | 24 ++------------- apps/zitare/apps/backend/tsconfig.json | 24 +-------------- docs/CONSOLIDATION_OPPORTUNITIES.md | 36 +++++++++++------------ packages/shared-tsconfig/astro.json | 7 +++++ packages/shared-tsconfig/base.json | 11 +++++++ packages/shared-tsconfig/expo.json | 9 ++++++ packages/shared-tsconfig/nestjs.json | 23 +++++++++++++++ packages/shared-tsconfig/package.json | 14 +++++++++ packages/shared-tsconfig/sveltekit.json | 14 +++++++++ 20 files changed, 113 insertions(+), 309 deletions(-) create mode 100644 packages/shared-tsconfig/astro.json create mode 100644 packages/shared-tsconfig/base.json create mode 100644 packages/shared-tsconfig/expo.json create mode 100644 packages/shared-tsconfig/nestjs.json create mode 100644 packages/shared-tsconfig/package.json create mode 100644 packages/shared-tsconfig/sveltekit.json diff --git a/apps/calendar/apps/backend/tsconfig.json b/apps/calendar/apps/backend/tsconfig.json index 0c618fb2c..dd1e616b7 100644 --- a/apps/calendar/apps/backend/tsconfig.json +++ b/apps/calendar/apps/backend/tsconfig.json @@ -1,25 +1,3 @@ { - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "rootDir": "./src", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "extends": "@manacore/shared-tsconfig/nestjs" } diff --git a/apps/chat/apps/backend/tsconfig.json b/apps/chat/apps/backend/tsconfig.json index 0c618fb2c..dd1e616b7 100644 --- a/apps/chat/apps/backend/tsconfig.json +++ b/apps/chat/apps/backend/tsconfig.json @@ -1,25 +1,3 @@ { - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "rootDir": "./src", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "extends": "@manacore/shared-tsconfig/nestjs" } diff --git a/apps/clock/apps/backend/tsconfig.json b/apps/clock/apps/backend/tsconfig.json index 0c618fb2c..dd1e616b7 100644 --- a/apps/clock/apps/backend/tsconfig.json +++ b/apps/clock/apps/backend/tsconfig.json @@ -1,25 +1,3 @@ { - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "rootDir": "./src", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "extends": "@manacore/shared-tsconfig/nestjs" } diff --git a/apps/contacts/apps/backend/tsconfig.json b/apps/contacts/apps/backend/tsconfig.json index 0c618fb2c..dd1e616b7 100644 --- a/apps/contacts/apps/backend/tsconfig.json +++ b/apps/contacts/apps/backend/tsconfig.json @@ -1,25 +1,3 @@ { - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "rootDir": "./src", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "extends": "@manacore/shared-tsconfig/nestjs" } diff --git a/apps/nutriphi/apps/backend/tsconfig.json b/apps/nutriphi/apps/backend/tsconfig.json index 0c618fb2c..dd1e616b7 100644 --- a/apps/nutriphi/apps/backend/tsconfig.json +++ b/apps/nutriphi/apps/backend/tsconfig.json @@ -1,25 +1,3 @@ { - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "rootDir": "./src", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "extends": "@manacore/shared-tsconfig/nestjs" } diff --git a/apps/picture/apps/backend/tsconfig.json b/apps/picture/apps/backend/tsconfig.json index 38c2b55d7..dd1e616b7 100644 --- a/apps/picture/apps/backend/tsconfig.json +++ b/apps/picture/apps/backend/tsconfig.json @@ -1,23 +1,3 @@ { - "compilerOptions": { - "module": "commonjs", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "esModuleInterop": true, - "resolveJsonModule": true - } + "extends": "@manacore/shared-tsconfig/nestjs" } diff --git a/apps/planta/apps/backend/tsconfig.json b/apps/planta/apps/backend/tsconfig.json index 0c618fb2c..dd1e616b7 100644 --- a/apps/planta/apps/backend/tsconfig.json +++ b/apps/planta/apps/backend/tsconfig.json @@ -1,25 +1,3 @@ { - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "rootDir": "./src", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "extends": "@manacore/shared-tsconfig/nestjs" } diff --git a/apps/presi/apps/backend/tsconfig.json b/apps/presi/apps/backend/tsconfig.json index 3bf96c993..dd1e616b7 100644 --- a/apps/presi/apps/backend/tsconfig.json +++ b/apps/presi/apps/backend/tsconfig.json @@ -1,24 +1,3 @@ { - "compilerOptions": { - "module": "commonjs", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "esModuleInterop": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "extends": "@manacore/shared-tsconfig/nestjs" } diff --git a/apps/questions/apps/backend/tsconfig.json b/apps/questions/apps/backend/tsconfig.json index f02c2417e..d5a090ee5 100644 --- a/apps/questions/apps/backend/tsconfig.json +++ b/apps/questions/apps/backend/tsconfig.json @@ -1,25 +1,6 @@ { + "extends": "@manacore/shared-tsconfig/nestjs", "compilerOptions": { - "module": "commonjs", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2022", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "esModuleInterop": true, - "resolveJsonModule": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "target": "ES2022" + } } diff --git a/apps/skilltree/apps/backend/tsconfig.json b/apps/skilltree/apps/backend/tsconfig.json index b1459ec35..a0781ebfa 100644 --- a/apps/skilltree/apps/backend/tsconfig.json +++ b/apps/skilltree/apps/backend/tsconfig.json @@ -1,25 +1,9 @@ { + "extends": "@manacore/shared-tsconfig/nestjs", "compilerOptions": { - "module": "commonjs", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, "noImplicitAny": false, "strictBindCallApply": false, "forceConsistentCasingInFileNames": false, - "noFallthroughCasesInSwitch": false, - "esModuleInterop": true, - "resolveJsonModule": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "noFallthroughCasesInSwitch": false + } } diff --git a/apps/storage/apps/backend/tsconfig.json b/apps/storage/apps/backend/tsconfig.json index 0c618fb2c..dd1e616b7 100644 --- a/apps/storage/apps/backend/tsconfig.json +++ b/apps/storage/apps/backend/tsconfig.json @@ -1,25 +1,3 @@ { - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "rootDir": "./src", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "extends": "@manacore/shared-tsconfig/nestjs" } diff --git a/apps/todo/apps/backend/tsconfig.json b/apps/todo/apps/backend/tsconfig.json index 323c27ece..09fd7bfeb 100644 --- a/apps/todo/apps/backend/tsconfig.json +++ b/apps/todo/apps/backend/tsconfig.json @@ -1,28 +1,8 @@ { + "extends": "@manacore/shared-tsconfig/nestjs", "compilerOptions": { - "module": "commonjs", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "esModuleInterop": true, - "resolveJsonModule": true, "paths": { "@/*": ["src/*"] } - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + } } diff --git a/apps/zitare/apps/backend/tsconfig.json b/apps/zitare/apps/backend/tsconfig.json index 0c618fb2c..dd1e616b7 100644 --- a/apps/zitare/apps/backend/tsconfig.json +++ b/apps/zitare/apps/backend/tsconfig.json @@ -1,25 +1,3 @@ { - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", - "baseUrl": "./", - "rootDir": "./src", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "extends": "@manacore/shared-tsconfig/nestjs" } diff --git a/docs/CONSOLIDATION_OPPORTUNITIES.md b/docs/CONSOLIDATION_OPPORTUNITIES.md index 818e2b6aa..06cb5ec5e 100644 --- a/docs/CONSOLIDATION_OPPORTUNITIES.md +++ b/docs/CONSOLIDATION_OPPORTUNITIES.md @@ -11,7 +11,7 @@ | **HOCH** | Skeleton Components | 800-1.000 LOC | Mittel | | ~~**HOCH**~~ | ~~App Settings Stores~~ | ~~600-700 LOC~~ ✅ **323 LOC entfernt** | ~~Mittel~~ | | **HOCH** | Main.ts/CORS Patterns | 1.800 LOC | Mittel | -| **MITTEL** | TypeScript Configs | 400 LOC | Niedrig | +| ~~**MITTEL**~~ | ~~TypeScript Configs~~ | ~~400 LOC~~ ✅ **~280 LOC entfernt** | ~~Niedrig~~ | | **MITTEL** | UI Component Cleanup | 400 LOC | Niedrig | | **MITTEL** | Vite Configs | 300 LOC | Niedrig | | **MITTEL** | Navigation Stores | 50 LOC | Niedrig | @@ -264,32 +264,28 @@ export function createNavigationStore(options?: { ## 4. Konfigurationsdateien -### 4.1 MITTEL: TypeScript Configs (400 LOC) +### ~~4.1 MITTEL: TypeScript Configs~~ ✅ ERLEDIGT (~280 LOC gespart) -**Problem:** Identische tsconfig.json in: -- 12+ NestJS Backends (95% identisch) -- 15+ SvelteKit Web Apps (99% identisch) -- 6 Expo Mobile Apps (99% identisch) -- 6+ Astro Landing Pages (95% identisch) +**Status:** `@manacore/shared-tsconfig` Package erstellt und 13 Backends migriert (29.01.2026) -**Empfehlung:** Erstelle `@manacore/shared-tsconfig` +**Erstelltes Package:** `packages/shared-tsconfig/` +- `base.json` - Gemeinsame Basis-Optionen +- `nestjs.json` - NestJS Backend Config (erweitert base) +- `sveltekit.json` - SvelteKit Web Config +- `expo.json` - Expo Mobile Config +- `astro.json` - Astro Landing Config -``` -packages/shared-tsconfig/ -├── nestjs.json -├── sveltekit.json -├── expo.json -├── astro.json -└── base.json -``` +**Migrierte Backends (13 von 14):** +- ✅ calendar, chat, clock, contacts, nutriphi, picture, planta, presi, questions, skilltree, storage, todo, zitare +- ⏭️ manadeck (übersprungen - verwendet `nodenext` statt `commonjs`) -**Vorher (30 LOC pro App):** +**Vorher (25 LOC pro Backend):** ```json { "compilerOptions": { "module": "commonjs", "moduleResolution": "node", - // ... 25 weitere Zeilen + // ... 20+ weitere Zeilen } } ``` @@ -301,6 +297,8 @@ packages/shared-tsconfig/ } ``` +**Einsparung:** 13 Backends × ~22 LOC = ~280 LOC + --- ### 4.2 MITTEL: Vite Configs (300 LOC) @@ -390,7 +388,7 @@ export default createDrizzleConfig('chat'); | Aufgabe | LOC | Aufwand | Status | |---------|-----|---------|--------| | ~~`createAppSettingsStore()` Factory erstellen~~ | ~~600~~ → **323** | ~~Mittel~~ | ✅ Erledigt | -| `@manacore/shared-tsconfig` Package erstellen | 400 | Niedrig | Offen | +| ~~`@manacore/shared-tsconfig` Package erstellen~~ | ~~400~~ → **280** | ~~Niedrig~~ | ✅ Erledigt | | `@manacore/shared-vite-config` Factory erstellen | 300 | Niedrig | Offen | | Navigation Store Factory erstellen | 50 | Niedrig | Offen | diff --git a/packages/shared-tsconfig/astro.json b/packages/shared-tsconfig/astro.json new file mode 100644 index 000000000..ef4b13e27 --- /dev/null +++ b/packages/shared-tsconfig/astro.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "astro/tsconfigs/strict", + "compilerOptions": { + "baseUrl": "." + } +} diff --git a/packages/shared-tsconfig/base.json b/packages/shared-tsconfig/base.json new file mode 100644 index 000000000..c83c1c713 --- /dev/null +++ b/packages/shared-tsconfig/base.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "target": "ES2021", + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "sourceMap": true + } +} diff --git a/packages/shared-tsconfig/expo.json b/packages/shared-tsconfig/expo.json new file mode 100644 index 000000000..783a9a7c3 --- /dev/null +++ b/packages/shared-tsconfig/expo.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "expo/tsconfig.base", + "compilerOptions": { + "strict": true, + "jsx": "react-jsx", + "baseUrl": "." + } +} diff --git a/packages/shared-tsconfig/nestjs.json b/packages/shared-tsconfig/nestjs.json new file mode 100644 index 000000000..5ad4c6ff6 --- /dev/null +++ b/packages/shared-tsconfig/nestjs.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./base.json", + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "outDir": "./dist", + "baseUrl": "./", + "rootDir": "./src", + "incremental": true, + "strictNullChecks": true, + "noImplicitAny": true, + "strictBindCallApply": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/shared-tsconfig/package.json b/packages/shared-tsconfig/package.json new file mode 100644 index 000000000..bee8ad216 --- /dev/null +++ b/packages/shared-tsconfig/package.json @@ -0,0 +1,14 @@ +{ + "name": "@manacore/shared-tsconfig", + "version": "1.0.0", + "private": true, + "description": "Shared TypeScript configurations for ManaCore monorepo", + "exports": { + "./nestjs": "./nestjs.json", + "./sveltekit": "./sveltekit.json", + "./expo": "./expo.json", + "./astro": "./astro.json", + "./base": "./base.json" + }, + "files": ["*.json"] +} diff --git a/packages/shared-tsconfig/sveltekit.json b/packages/shared-tsconfig/sveltekit.json new file mode 100644 index 000000000..e0017a743 --- /dev/null +++ b/packages/shared-tsconfig/sveltekit.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "moduleResolution": "bundler" + } +}