@grundtone/shared
v2.0.0
Published
Shared utilities and helpers for Grundtone
Readme
@grundtone/shared
Shared utilities package for the Grundtone design system. This package contains common helper functions, formatters, and validators used across the design system.
Installation
pnpm add @grundtone/sharedUsage
import { formatCurrency, isValidEmail } from '@grundtone/shared';
// Format currency
const price = formatCurrency(199.99); // "199,99 kr."
// Validate email
const isValid = isValidEmail('[email protected]'); // trueAvailable Utilities
Formatting
formatCurrency(amount: number, currency?: string)- Format number as currencyformatDate(date: Date | string)- Format date in Danish localeformatPhoneNumber(phone: string)- Format phone number in Danish format
Validation
isValidCPR(cpr: string)- Validate Danish CPR numberisValidEmail(email: string)- Validate email addressisValidPhoneNumber(phone: string)- Validate Danish phone number
Dependencies
@grundtone/core- Core package with types and constantsvue- Vue.js framework
Development
- Install dependencies:
pnpm install- Start development server:
pnpm dev- Build package:
pnpm build- Run tests:
pnpm testContributing
Please refer to the main project README for contribution guidelines.
TypeScript-konfiguration
Denne pakke bruger en specifik tsconfig.json, som udvider rodens tsconfig.build.json.
Konfigurationen sikrer at kildekoden i src/ og types i types/ bliver korrekt transpileret og at
types genereres i dist/types.
- outDir:
dist - rootDir:
src - Types genereres automatisk ved build
Byg pakken med:
pnpm build