mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:41:09 +02:00
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:
parent
0241f5554c
commit
d36b321d9d
3952 changed files with 661498 additions and 739751 deletions
|
|
@ -1,18 +1,18 @@
|
|||
{
|
||||
"name": "@manacore/shared-types",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "Shared TypeScript types for Manacore monorepo",
|
||||
"main": "./src/index.ts",
|
||||
"types": "./src/index.ts",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"type-check": "tsc --noEmit",
|
||||
"clean": "rm -rf dist"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
"name": "@manacore/shared-types",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "Shared TypeScript types for Manacore monorepo",
|
||||
"main": "./src/index.ts",
|
||||
"types": "./src/index.ts",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"type-check": "tsc --noEmit",
|
||||
"clean": "rm -rf dist"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ export function createAuthError(message: string, originalError?: unknown): AuthE
|
|||
return {
|
||||
code: mapSupabaseErrorToCode(message),
|
||||
message,
|
||||
originalError
|
||||
originalError,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -70,43 +70,43 @@ export function createAuthError(message: string, originalError?: unknown): AuthE
|
|||
* User session
|
||||
*/
|
||||
export interface Session {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
expiresAt: number;
|
||||
user: AuthUser;
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
expiresAt: number;
|
||||
user: AuthUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticated user
|
||||
*/
|
||||
export interface AuthUser {
|
||||
id: string;
|
||||
email: string;
|
||||
emailConfirmed?: boolean;
|
||||
phone?: string;
|
||||
phoneConfirmed?: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
lastSignInAt?: string;
|
||||
appMetadata?: Record<string, unknown>;
|
||||
userMetadata?: Record<string, unknown>;
|
||||
id: string;
|
||||
email: string;
|
||||
emailConfirmed?: boolean;
|
||||
phone?: string;
|
||||
phoneConfirmed?: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
lastSignInAt?: string;
|
||||
appMetadata?: Record<string, unknown>;
|
||||
userMetadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sign in credentials
|
||||
*/
|
||||
export interface SignInCredentials {
|
||||
email: string;
|
||||
password: string;
|
||||
email: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sign up credentials
|
||||
*/
|
||||
export interface SignUpCredentials {
|
||||
email: string;
|
||||
password: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
email: string;
|
||||
password: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -118,35 +118,35 @@ export type OAuthProvider = 'google' | 'apple' | 'github' | 'facebook';
|
|||
* Auth result for operations
|
||||
*/
|
||||
export interface AuthResult {
|
||||
success: boolean;
|
||||
error?: string;
|
||||
session?: Session;
|
||||
user?: AuthUser;
|
||||
success: boolean;
|
||||
error?: string;
|
||||
session?: Session;
|
||||
user?: AuthUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Password reset request
|
||||
*/
|
||||
export interface PasswordResetRequest {
|
||||
email: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Password update request
|
||||
*/
|
||||
export interface PasswordUpdateRequest {
|
||||
password: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Auth context value
|
||||
*/
|
||||
export interface AuthContextValue {
|
||||
state: AuthState;
|
||||
user: AuthUser | null;
|
||||
session: Session | null;
|
||||
signIn: (credentials: SignInCredentials) => Promise<AuthResult>;
|
||||
signUp: (credentials: SignUpCredentials) => Promise<AuthResult>;
|
||||
signOut: () => Promise<void>;
|
||||
resetPassword: (email: string) => Promise<AuthResult>;
|
||||
state: AuthState;
|
||||
user: AuthUser | null;
|
||||
session: Session | null;
|
||||
signIn: (credentials: SignInCredentials) => Promise<AuthResult>;
|
||||
signUp: (credentials: SignUpCredentials) => Promise<AuthResult>;
|
||||
signOut: () => Promise<void>;
|
||||
resetPassword: (email: string) => Promise<AuthResult>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@
|
|||
/**
|
||||
* Result type for operations that can fail
|
||||
*/
|
||||
export type Result<T, E = Error> =
|
||||
| { success: true; data: T }
|
||||
| { success: false; error: E };
|
||||
export type Result<T, E = Error> = { success: true; data: T } | { success: false; error: E };
|
||||
|
||||
/**
|
||||
* Async result type
|
||||
|
|
@ -18,7 +16,7 @@ export type AsyncResult<T, E = Error> = Promise<Result<T, E>>;
|
|||
* Make all properties optional recursively
|
||||
*/
|
||||
export type DeepPartial<T> = {
|
||||
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
||||
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -70,8 +68,8 @@ export type SortDirection = 'asc' | 'desc';
|
|||
* Sort configuration
|
||||
*/
|
||||
export interface SortConfig<T = string> {
|
||||
field: T;
|
||||
direction: SortDirection;
|
||||
field: T;
|
||||
direction: SortDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -83,36 +81,48 @@ export type FilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like'
|
|||
* Filter configuration
|
||||
*/
|
||||
export interface FilterConfig<T = string> {
|
||||
field: T;
|
||||
operator: FilterOperator;
|
||||
value: unknown;
|
||||
field: T;
|
||||
operator: FilterOperator;
|
||||
value: unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
* Entity with timestamps
|
||||
*/
|
||||
export interface TimestampedEntity {
|
||||
created_at: Timestamp;
|
||||
updated_at: Timestamp;
|
||||
created_at: Timestamp;
|
||||
updated_at: Timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Entity with user ownership
|
||||
*/
|
||||
export interface OwnedEntity extends TimestampedEntity {
|
||||
user_id: ID;
|
||||
user_id: ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale code
|
||||
*/
|
||||
export type LocaleCode = 'en' | 'de' | 'fr' | 'es' | 'it' | 'pt' | 'nl' | 'pl' | 'ru' | 'ja' | 'ko' | 'zh';
|
||||
export type LocaleCode =
|
||||
| 'en'
|
||||
| 'de'
|
||||
| 'fr'
|
||||
| 'es'
|
||||
| 'it'
|
||||
| 'pt'
|
||||
| 'nl'
|
||||
| 'pl'
|
||||
| 'ru'
|
||||
| 'ja'
|
||||
| 'ko'
|
||||
| 'zh';
|
||||
|
||||
/**
|
||||
* Localized string
|
||||
*/
|
||||
export type LocalizedString = {
|
||||
[key in LocaleCode]?: string;
|
||||
[key in LocaleCode]?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -18,41 +18,41 @@ export * from './common';
|
|||
|
||||
// API types
|
||||
export interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
id: string;
|
||||
email: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
data: T | null;
|
||||
error: ApiError | null;
|
||||
data: T | null;
|
||||
error: ApiError | null;
|
||||
}
|
||||
|
||||
export interface ApiError {
|
||||
message: string;
|
||||
code?: string;
|
||||
status?: number;
|
||||
message: string;
|
||||
code?: string;
|
||||
status?: number;
|
||||
}
|
||||
|
||||
// Pagination types
|
||||
export interface PaginationParams {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
}
|
||||
|
||||
export interface PaginatedResponse<T> {
|
||||
data: T[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
hasMore: boolean;
|
||||
data: T[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
hasMore: boolean;
|
||||
}
|
||||
|
||||
// Supabase common types
|
||||
export interface SupabaseConfig {
|
||||
url: string;
|
||||
anonKey: string;
|
||||
serviceRoleKey?: string;
|
||||
url: string;
|
||||
anonKey: string;
|
||||
serviceRoleKey?: string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,52 +16,52 @@ export type ColorMode = 'light' | 'dark' | 'system';
|
|||
* Theme configuration
|
||||
*/
|
||||
export interface ThemeConfig {
|
||||
name: ThemeName;
|
||||
mode: ColorMode;
|
||||
name: ThemeName;
|
||||
mode: ColorMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Theme color tokens
|
||||
*/
|
||||
export interface ThemeColors {
|
||||
primary: string;
|
||||
primaryButton: string;
|
||||
primaryButtonText: string;
|
||||
secondary: string;
|
||||
secondaryButton: string;
|
||||
contentBackground: string;
|
||||
contentBackgroundHover: string;
|
||||
contentPageBackground: string;
|
||||
menuBackground: string;
|
||||
menuBackgroundHover: string;
|
||||
pageBackground: string;
|
||||
text: string;
|
||||
textSecondary: string;
|
||||
borderLight: string;
|
||||
border: string;
|
||||
borderStrong: string;
|
||||
error: string;
|
||||
success: string;
|
||||
warning: string;
|
||||
primary: string;
|
||||
primaryButton: string;
|
||||
primaryButtonText: string;
|
||||
secondary: string;
|
||||
secondaryButton: string;
|
||||
contentBackground: string;
|
||||
contentBackgroundHover: string;
|
||||
contentPageBackground: string;
|
||||
menuBackground: string;
|
||||
menuBackgroundHover: string;
|
||||
pageBackground: string;
|
||||
text: string;
|
||||
textSecondary: string;
|
||||
borderLight: string;
|
||||
border: string;
|
||||
borderStrong: string;
|
||||
error: string;
|
||||
success: string;
|
||||
warning: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Complete theme with light and dark variants
|
||||
*/
|
||||
export interface Theme {
|
||||
name: ThemeName;
|
||||
light: ThemeColors;
|
||||
dark: ThemeColors;
|
||||
name: ThemeName;
|
||||
light: ThemeColors;
|
||||
dark: ThemeColors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Theme context value
|
||||
*/
|
||||
export interface ThemeContextValue {
|
||||
theme: ThemeName;
|
||||
mode: ColorMode;
|
||||
isDark: boolean;
|
||||
setTheme: (theme: ThemeName) => void;
|
||||
setMode: (mode: ColorMode) => void;
|
||||
toggleMode: () => void;
|
||||
theme: ThemeName;
|
||||
mode: ColorMode;
|
||||
isDark: boolean;
|
||||
setTheme: (theme: ThemeName) => void;
|
||||
setMode: (mode: ColorMode) => void;
|
||||
toggleMode: () => void;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,66 +41,66 @@ export type ToastType = 'info' | 'success' | 'warning' | 'error';
|
|||
* Toast notification
|
||||
*/
|
||||
export interface Toast {
|
||||
id: string;
|
||||
type: ToastType;
|
||||
message: string;
|
||||
title?: string;
|
||||
duration?: number;
|
||||
dismissible?: boolean;
|
||||
id: string;
|
||||
type: ToastType;
|
||||
message: string;
|
||||
title?: string;
|
||||
duration?: number;
|
||||
dismissible?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modal configuration
|
||||
*/
|
||||
export interface ModalConfig {
|
||||
title?: string;
|
||||
description?: string;
|
||||
confirmText?: string;
|
||||
cancelText?: string;
|
||||
dangerous?: boolean;
|
||||
title?: string;
|
||||
description?: string;
|
||||
confirmText?: string;
|
||||
cancelText?: string;
|
||||
dangerous?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dropdown/Select option
|
||||
*/
|
||||
export interface SelectOption<T = string> {
|
||||
value: T;
|
||||
label: string;
|
||||
disabled?: boolean;
|
||||
icon?: string;
|
||||
value: T;
|
||||
label: string;
|
||||
disabled?: boolean;
|
||||
icon?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tab item
|
||||
*/
|
||||
export interface TabItem {
|
||||
id: string;
|
||||
label: string;
|
||||
icon?: string;
|
||||
disabled?: boolean;
|
||||
badge?: string | number;
|
||||
id: string;
|
||||
label: string;
|
||||
icon?: string;
|
||||
disabled?: boolean;
|
||||
badge?: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu item
|
||||
*/
|
||||
export interface MenuItem {
|
||||
id: string;
|
||||
label: string;
|
||||
icon?: string;
|
||||
href?: string;
|
||||
onClick?: () => void;
|
||||
disabled?: boolean;
|
||||
danger?: boolean;
|
||||
divider?: boolean;
|
||||
id: string;
|
||||
label: string;
|
||||
icon?: string;
|
||||
href?: string;
|
||||
onClick?: () => void;
|
||||
disabled?: boolean;
|
||||
danger?: boolean;
|
||||
divider?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Breadcrumb item
|
||||
*/
|
||||
export interface BreadcrumbItem {
|
||||
label: string;
|
||||
href?: string;
|
||||
label: string;
|
||||
href?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"lib": ["ES2022"],
|
||||
"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"],
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"isolatedModules": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue