mirror of
https://github.com/acamarata/date-fns-hijri.git
synced 2026-07-04 04:30:39 +00:00
chore: bump to v1.0.1
- Flatten exports map to ADR-015 standard - Add coverage script (c8) - Migrate CI to corepack enable
This commit is contained in:
parent
061b3e8b8f
commit
b6ee6e0331
3 changed files with 75 additions and 13 deletions
|
|
@ -1 +0,0 @@
|
||||||
CLAUDE.md
|
|
||||||
44
.claude/AGENTS.md
Normal file
44
.claude/AGENTS.md
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
# date-fns-hijri — PRI (Per-Repo Instructions)
|
||||||
|
|
||||||
|
**PPI:** `~/Sites/acamarata/.claude/CLAUDE.md`
|
||||||
|
|
||||||
|
## What This Is
|
||||||
|
|
||||||
|
date-fns-style utility functions for Hijri calendar operations. Wraps hijri-core with a
|
||||||
|
functional API for converting, formatting, and validating Hijri dates. Each function is
|
||||||
|
a pure, stateless utility. No classes. No configuration object. The API mirrors date-fns
|
||||||
|
conventions so the learning curve is minimal for consumers already using that ecosystem.
|
||||||
|
|
||||||
|
**npm:** `date-fns-hijri@1.0.0`
|
||||||
|
**Language:** TypeScript
|
||||||
|
**License:** MIT
|
||||||
|
|
||||||
|
## Key Technical Details
|
||||||
|
|
||||||
|
- Peer dependencies: `hijri-core@^1.0.0`
|
||||||
|
- Note: `date-fns` itself is NOT a peer dep — functions accept plain `Date` objects and work with any date library
|
||||||
|
- Key exports: `toHijriDate`, `fromHijriDate`, `formatHijriDate`, `addHijriMonths`, `getHijriMonthName`
|
||||||
|
- Options argument on every function selects calendar system (UAQ default, FCNA optional)
|
||||||
|
- Returns `null` for out-of-range inputs rather than throwing (conversion functions)
|
||||||
|
- Dual CJS/ESM build via tsup
|
||||||
|
- Zero runtime dependencies (peer deps are provided by the consumer)
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
`src/index.ts` exports all public functions. `src/types.ts` holds shared types and
|
||||||
|
interfaces. Built to `dist/` (gitignored) with `.cjs` and `.mjs` outputs plus dual type
|
||||||
|
declarations.
|
||||||
|
|
||||||
|
## 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 is a standalone functional utility package, not a plugin — it works with any date library
|
||||||
|
- hijri-core provides the actual calendar engine — this package is a thin functional adapter
|
||||||
|
- Changes to hijri-core's API may require updates here
|
||||||
|
- No dependency on date-fns itself — the "date-fns-style" refers to API convention only
|
||||||
21
CHANGELOG.md
Normal file
21
CHANGELOG.md
Normal file
|
|
@ -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
|
||||||
22
package.json
22
package.json
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "date-fns-hijri",
|
"name": "date-fns-hijri",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "date-fns-style utility functions for Hijri calendar operations. Wraps hijri-core with a functional API for converting, formatting, and validating Hijri dates.",
|
"description": "date-fns-style utility functions for Hijri calendar operations. Wraps hijri-core with a functional API for converting, formatting, and validating Hijri dates.",
|
||||||
"author": "Aric Camarata",
|
"author": "Aric Camarata",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
@ -9,15 +9,11 @@
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"import": {
|
"types": "./dist/index.d.ts",
|
||||||
"types": "./dist/index.d.mts",
|
"import": "./dist/index.mjs",
|
||||||
"default": "./dist/index.mjs"
|
"require": "./dist/index.cjs"
|
||||||
},
|
},
|
||||||
"require": {
|
"./package.json": "./package.json"
|
||||||
"types": "./dist/index.d.ts",
|
|
||||||
"default": "./dist/index.cjs"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"files": [
|
"files": [
|
||||||
|
|
@ -41,7 +37,8 @@
|
||||||
"lint": "eslint src/",
|
"lint": "eslint src/",
|
||||||
"format": "prettier --write src/",
|
"format": "prettier --write src/",
|
||||||
"format:check": "prettier --check src/",
|
"format:check": "prettier --check src/",
|
||||||
"prepublishOnly": "tsup"
|
"prepublishOnly": "tsup",
|
||||||
|
"coverage": "c8 --reporter=lcov --reporter=text node --test"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"date-fns",
|
"date-fns",
|
||||||
|
|
@ -80,5 +77,6 @@
|
||||||
"homepage": "https://github.com/acamarata/date-fns-hijri#readme",
|
"homepage": "https://github.com/acamarata/date-fns-hijri#readme",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/acamarata/date-fns-hijri/issues"
|
"url": "https://github.com/acamarata/date-fns-hijri/issues"
|
||||||
}
|
},
|
||||||
|
"type": "module"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue