mirror of
https://github.com/acamarata/hijri-core.git
synced 2026-07-01 03:04:29 +00:00
- Flatten exports map to ADR-015 standard - Add coverage script (c8) - Migrate CI to corepack enable
1.6 KiB
1.6 KiB
hijri-core — PRI (Per-Repo Instructions)
PPI: ~/Sites/acamarata/.claude/CLAUDE.md
What This Is
Core Hijri calendar engine for JavaScript/TypeScript. Provides Hijri/Gregorian date conversion with a pluggable calendar registry supporting multiple calculation methods.
npm: hijri-core@1.0.0
Language: TypeScript
License: MIT
Key Technical Details
- Zero runtime dependencies
- Pluggable engine architecture: UAQ (Umm al-Qura, 1318-1500 AH) and FCNA engines built in
- Foundation package: used by luxon-hijri, date-fns-hijri, dayjs-hijri-plus, moment-hijri-plus, temporal-hijri
- Dart counterpart: hijri-core-dart (hijri_core@1.0.0 on pub.dev)
API Surface
toHijri(gregorianDate, engine?)— Gregorian to HijritoGregorian(hijriYear, hijriMonth, hijriDay, engine?)— Hijri to GregorianregisterCalendar(name, engine)— add custom calendar enginegetCalendar(name)— retrieve registered engineisValidHijriDate(year, month, day, engine?)— validationdaysInHijriMonth(year, month, engine?)— month length- Month name arrays: long/medium/short (Arabic + English)
- Weekday name arrays
Important Notes
- This is a FOUNDATION package. Breaking changes here affect 5 downstream plugin packages.
- When making API changes: update all 5 plugin packages (luxon-hijri, date-fns-hijri, dayjs-hijri-plus, moment-hijri-plus, temporal-hijri) and bump their versions too.
- Test all 5 plugins against any hijri-core change before publishing.
Commands
pnpm test— run test.mjs + test-cjs.cjspnpm run typecheck— tsc --noEmitpnpm build— tsup build