Shared utilities and types for RightProps applications
npm install @makeitdev/sharedA shared library for makeitdev. Provides utility functions commonly used between client and server sides.
``bash`
npm install @makeit/shared
``
src/
├── index.ts # Main entry point
├── client/ # Client-side utilities
│ ├── index.ts
│ ├── contexts/
│ │ └── supabaseAuth.tsx
│ ├── hooks/
│ │ └── supabaseAuth.ts
│ └── utils/
│ ├── supabase.ts
│ └── utils.ts
└── server/ # Server-side utilities
├── index.ts
└── utils/
├── accountLinking.ts
├── auth.ts
├── middleware.ts
├── profile.ts
├── roles.ts
├── signup.ts
├── supabase.ts
└── utils.ts
The following environment variables are required for the server-side utilities:
`bashSupabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
$3
- SUPABASE_URL & ANON_KEY: Found in your Supabase project dashboard under Settings > API
- SERVICE_ROLE_KEY: Found in the same location, but keep this secret (server-only)
- JWT_SECRET: Found under Settings > API > JWT Settings
Usage
$3
`typescript
import { formatDate, validateEmail } from '@makeit/shared'
`$3
`typescript
import { formatDate, formatCurrency } from '@makeit/shared/client'const date = formatDate(new Date())
const price = formatCurrency(1000000)
`$3
`typescript
import { validateEmail, generateSlug } from '@makeit/shared/server'const isValidEmail = validateEmail('user@example.com')
const slug = generateSlug('안녕하세요! Hello World!')
`Development
$3
`bash
Install dependencies
npm installDevelopment mode (file change detection)
npm run devBuild
npm run buildRelease (version update + tag creation + push)
npm run release
`$3
1. After code changes, run
npm run release
2. Automatically runs npm version patch`MIT