style: auto-format codebase with Prettier

Applied formatting to 1487+ files using pnpm format:write
  - TypeScript/JavaScript files
  - Svelte components
  - Astro pages
  - JSON configs
  - Markdown docs

  13 files still need manual review (Astro JSX comments)
This commit is contained in:
Wuesteon 2025-11-27 18:33:16 +01:00
parent 0241f5554c
commit d36b321d9d
3952 changed files with 661498 additions and 739751 deletions

View file

@ -1,24 +1,24 @@
{
"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"
},
"dependencies": {
"@supabase/supabase-js": "^2.81.1"
},
"devDependencies": {
"typescript": "^5.9.3"
},
"peerDependencies": {
"@manacore/shared-types": "workspace:*"
}
"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"
},
"dependencies": {
"@supabase/supabase-js": "^2.81.1"
},
"devDependencies": {
"typescript": "^5.9.3"
},
"peerDependencies": {
"@manacore/shared-types": "workspace:*"
}
}

View file

@ -13,67 +13,67 @@ 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,
},
});
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');
}
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,
},
});
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;
message: string;
code?: string;
details?: string;
hint?: string;
}
/**
* Standardized query result type
*/
export interface QueryResult<T> {
data: T | null;
error: SupabaseError | null;
data: T | null;
error: SupabaseError | null;
}
/**
* Common database query helpers
*/
export const dbHelpers = {
/**
* Handle Supabase query result and return standardized response
*/
handleQueryResult<T>(result: { data: T | null; error: SupabaseError | null }): QueryResult<T> {
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 };
},
/**
* Handle Supabase query result and return standardized response
*/
handleQueryResult<T>(result: { data: T | null; error: SupabaseError | null }): QueryResult<T> {
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 };
},
};

View file

@ -1,17 +1,17 @@
{
"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"]
"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"]
}