feat: add monorepo configuration and shared packages structure

Root-level setup:
- package.json with Turborepo scripts
- pnpm-workspace.yaml for workspace management
- turbo.json for build pipeline
- Common config files (.nvmrc, .prettierrc, .editorconfig)

Shared packages (packages/):
- @manacore/shared-types - Common TypeScript types
- @manacore/shared-supabase - Unified Supabase client
- @manacore/shared-utils - Date, string, async utilities
- @manacore/shared-ui - React Native UI components (placeholder)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Till-JS 2025-11-22 23:41:52 +01:00
parent e7f5f942f3
commit 2c58d03f63
23 changed files with 738 additions and 0 deletions

View file

@ -0,0 +1,43 @@
/**
* String utility functions
*/
/**
* Truncate a string to a maximum length with ellipsis
*/
export function truncate(str: string, maxLength: number): string {
if (str.length <= maxLength) return str;
return str.slice(0, maxLength - 3) + '...';
}
/**
* Capitalize the first letter of a string
*/
export function capitalize(str: string): string {
if (!str) return str;
return str.charAt(0).toUpperCase() + str.slice(1);
}
/**
* Generate a random string ID
*/
export function generateId(length: number = 8): string {
const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
let result = '';
for (let i = 0; i < length; i++) {
result += chars.charAt(Math.floor(Math.random() * chars.length));
}
return result;
}
/**
* Slugify a string for URLs
*/
export function slugify(str: string): string {
return str
.toLowerCase()
.trim()
.replace(/[^\w\s-]/g, '')
.replace(/[\s_-]+/g, '-')
.replace(/^-+|-+$/g, '');
}