diff --git a/.claude/AGENTS.md b/.claude/AGENTS.md deleted file mode 120000 index 681311e..0000000 --- a/.claude/AGENTS.md +++ /dev/null @@ -1 +0,0 @@ -CLAUDE.md \ No newline at end of file diff --git a/.claude/AGENTS.md b/.claude/AGENTS.md new file mode 100644 index 0000000..3ca08d3 --- /dev/null +++ b/.claude/AGENTS.md @@ -0,0 +1,45 @@ +# temporal-hijri — PRI (Per-Repo Instructions) + +**PPI:** `~/Sites/acamarata/.claude/CLAUDE.md` + +## What This Is + +Temporal Calendar Protocol implementation for the Hijri calendar. Works with the TC39 +Temporal proposal and `@js-temporal/polyfill`. Provides `UaqCalendar` (Umm al-Qura) and +`FcnaCalendar` (FCNA/ISNA) as plug-in calendars for `Temporal.PlainDate` and related +types. The underlying conversion logic comes from hijri-core. + +**npm:** `temporal-hijri@1.0.0` +**Language:** TypeScript +**License:** MIT + +## Key Technical Details + +- Peer dependencies: `hijri-core@^1.0.0`, `@js-temporal/polyfill@^0.4.0` (optional) +- `@js-temporal/polyfill` is optional — works with native Temporal when available in the runtime +- Key exports: `uaqCalendar` (singleton), `fcnaCalendar` (singleton), `UaqCalendar` class, `FcnaCalendar` class +- Calendar protocol methods: `year()`, `month()`, `day()`, `monthCode()`, `inLeapYear()`, `dateFromFields()`, `dateAdd()` +- UAQ data covers 1318-1500 AH (Gregorian 1900-2076) +- Dual CJS/ESM build via tsup +- Zero runtime dependencies (peer deps are provided by the consumer) + +## Architecture + +`src/index.ts` exports calendar singletons and classes. Built to `dist/` (gitignored) +with `.cjs` and `.mjs` outputs plus dual type declarations. No format string parsing — +the Temporal API handles all date arithmetic and formatting natively. + +## Commands + +- `pnpm install` — install dev deps +- `pnpm build` — tsup build +- `pnpm test` — run test.mjs + test-cjs.cjs +- `pnpm run typecheck` — tsc --noEmit + +## Important Notes + +- This implements the Temporal Calendar Protocol — it is not a general-purpose Hijri utility +- hijri-core provides the actual calendar engine — this package is a thin Temporal protocol adapter +- Changes to hijri-core's API may require updates here +- `@js-temporal/polyfill` is optional — only needed in environments without native Temporal support +- TC39 Temporal proposal is Stage 3 — API may shift; track spec changes carefully diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6c44b81 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [1.0.1] - 2026-05-28 + +### Changed +- Flatten exports map to ADR-015 standard (import/require/types at top level) +- Add "./package.json" export condition +- Add coverage script (c8 --reporter=lcov) +- Migrate CI from pnpm/action-setup to corepack enable + +## [1.0.0] - 2026-05-28 + +### Added +- Initial release diff --git a/package.json b/package.json index 27b1f1b..b09b310 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "temporal-hijri", - "version": "1.0.0", + "version": "1.0.1", "description": "Temporal Calendar Protocol implementation for the Hijri calendar system. Supports Umm al-Qura and FCNA calendars via hijri-core.", "author": "Aric Camarata", "license": "MIT", @@ -9,15 +9,11 @@ "types": "./dist/index.d.ts", "exports": { ".": { - "import": { - "types": "./dist/index.d.mts", - "default": "./dist/index.mjs" - }, - "require": { - "types": "./dist/index.d.ts", - "default": "./dist/index.cjs" - } - } + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "./package.json": "./package.json" }, "sideEffects": false, "files": [ @@ -41,7 +37,8 @@ "format:check": "prettier --check src/ test.mjs test-cjs.cjs eslint.config.mjs tsup.config.ts", "pretest": "tsup", "test": "node --test test.mjs && node --test test-cjs.cjs", - "prepublishOnly": "tsup" + "prepublishOnly": "tsup", + "coverage": "c8 --reporter=lcov --reporter=text node --test" }, "keywords": [ "temporal", @@ -87,5 +84,6 @@ "homepage": "https://github.com/acamarata/temporal-hijri#readme", "bugs": { "url": "https://github.com/acamarata/temporal-hijri/issues" - } + }, + "type": "module" }