diff --git a/CLAUDE.md b/CLAUDE.md index 60d1dc9c0..55090ab50 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -502,7 +502,6 @@ $: doubled = count * 2; | `@mana-core/nestjs-integration` | NestJS module with auth guards + credit client | | `@manacore/shared-auth` | Client-side auth service for web/mobile apps | | `@manacore/shared-storage` | S3-compatible storage (MinIO) | -| `@manacore/shared-supabase` | Unified Supabase client | | `@manacore/shared-types` | Common TypeScript types | | `@manacore/shared-utils` | Utility functions | | `@manacore/shared-ui` | React Native UI components | diff --git a/docs/BACKEND_ARCHITECTURE.md b/docs/BACKEND_ARCHITECTURE.md index dc899de9b..5b1e14cc2 100644 --- a/docs/BACKEND_ARCHITECTURE.md +++ b/docs/BACKEND_ARCHITECTURE.md @@ -712,7 +712,6 @@ export const characters = pgTable('characters', { #### Option B: Alles auf Supabase ```typescript -// packages/shared-supabase/src/client.ts export const createProjectClient = (project: 'maerchenzauber' | 'manadeck' | 'uload') => { return createClient( process.env[`${project.toUpperCase()}_SUPABASE_URL`], diff --git a/docs/PROJECT_OVERVIEW.md b/docs/PROJECT_OVERVIEW.md index 26afbc405..62debd486 100644 --- a/docs/PROJECT_OVERVIEW.md +++ b/docs/PROJECT_OVERVIEW.md @@ -454,7 +454,6 @@ Alle Projekte teilen gemeinsame Packages unter `packages/`: | --------------------------- | ---------------------------------------- | | `@manacore/shared-types` | Gemeinsame TypeScript Types | | `@manacore/shared-utils` | Utility-Funktionen (Date, String, Async) | -| `@manacore/shared-supabase` | Einheitlicher Supabase Client | | `@manacore/shared-config` | Gemeinsame Konfiguration | ### Auth & Security @@ -498,7 +497,6 @@ Alle Projekte teilen gemeinsame Packages unter `packages/`: ```typescript // In einem beliebigen Projekt import { User, ApiResponse } from '@manacore/shared-types'; -import { createSupabaseClient } from '@manacore/shared-supabase'; import { formatDate, truncate, retry } from '@manacore/shared-utils'; ``` diff --git a/docs/SHARED_PACKAGES_ROADMAP.md b/docs/SHARED_PACKAGES_ROADMAP.md index 768c4c7cf..dc9e95af9 100644 --- a/docs/SHARED_PACKAGES_ROADMAP.md +++ b/docs/SHARED_PACKAGES_ROADMAP.md @@ -13,7 +13,6 @@ This document outlines the plan to unify common code across all web apps in the - [x] `@manacore/shared-theme-ui` - Theme UI Components (ThemeToggle, ThemeSelector) - [x] `@manacore/shared-utils` - Unified Utilities (formatting, validation, async, date, keyboard) - [x] `@manacore/shared-types` - Unified TypeScript Types -- [x] `@manacore/shared-supabase` - Unified Supabase Client Factory - [x] `@manacore/shared-i18n` - Unified i18n (languages, locale detection, translations) - [x] `@manacore/shared-config` - Unified Config (env validation) - [x] `@manacore/shared-branding` - **NEW** Unified App Branding (logos, colors, app config) @@ -232,7 +231,6 @@ packages/shared-i18n/ 3. **Phase 3** (Completed) - [x] `@manacore/shared-utils` - [x] `@manacore/shared-types` - - [x] `@manacore/shared-supabase` 4. **Phase 4** (Completed) - [x] `@manacore/shared-i18n` diff --git a/packages/shared-supabase/package.json b/packages/shared-supabase/package.json deleted file mode 100644 index 6bceb6250..000000000 --- a/packages/shared-supabase/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@manacore/shared-supabase", - "version": "0.1.0", - "private": true, - "description": "Shared Supabase client and utilities for Manacore monorepo", - "main": "./src/index.ts", - "types": "./src/index.ts", - "exports": { - ".": "./src/index.ts" - }, - "scripts": { - "type-check": "tsc --noEmit", - "clean": "rm -rf dist", - "lint": "eslint ." - }, - "dependencies": { - "@supabase/supabase-js": "^2.81.1" - }, - "devDependencies": { - "typescript": "^5.9.3" - }, - "peerDependencies": { - "@manacore/shared-types": "workspace:*" - } -} diff --git a/packages/shared-supabase/src/index.ts b/packages/shared-supabase/src/index.ts deleted file mode 100644 index 5b4d5bf96..000000000 --- a/packages/shared-supabase/src/index.ts +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Shared Supabase utilities for Manacore monorepo - * - * This package provides a unified Supabase client and common database utilities. - */ - -import { createClient } from '@supabase/supabase-js'; -import type { SupabaseClient } from '@supabase/supabase-js'; -import type { SupabaseConfig } from '@manacore/shared-types'; - -export { SupabaseClient } from '@supabase/supabase-js'; - -/** - * Create a Supabase client with the given configuration - */ -export function createSupabaseClient(config: SupabaseConfig): SupabaseClient { - return createClient(config.url, config.anonKey, { - auth: { - persistSession: true, - autoRefreshToken: true, - }, - }); -} - -/** - * Create a Supabase admin client with service role key - */ -export function createSupabaseAdminClient(config: SupabaseConfig): SupabaseClient { - if (!config.serviceRoleKey) { - throw new Error('Service role key is required for admin client'); - } - - return createClient(config.url, config.serviceRoleKey, { - auth: { - persistSession: false, - autoRefreshToken: false, - }, - }); -} - -/** - * Supabase error type - */ -export interface SupabaseError { - message: string; - code?: string; - details?: string; - hint?: string; -} - -/** - * Standardized query result type - */ -export interface QueryResult { - data: T | null; - error: SupabaseError | null; -} - -/** - * Common database query helpers - */ -export const dbHelpers = { - /** - * Handle Supabase query result and return standardized response - */ - handleQueryResult(result: { data: T | null; error: SupabaseError | null }): QueryResult { - if (result.error) { - return { - data: null, - error: { - message: result.error.message, - code: result.error.code, - details: result.error.details, - hint: result.error.hint, - }, - }; - } - return { data: result.data, error: null }; - }, -}; diff --git a/packages/shared-supabase/tsconfig.json b/packages/shared-supabase/tsconfig.json deleted file mode 100644 index c423209ae..000000000 --- a/packages/shared-supabase/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "ESNext", - "moduleResolution": "bundler", - "lib": ["ES2022", "DOM"], - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "verbatimModuleSyntax": true, - "noEmit": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules"] -}