mirror of
https://github.com/acamarata/dayjs-hijri-plus.git
synced 2026-06-30 18:54:26 +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
c45bb5ee22
commit
d50f03adcc
3 changed files with 76 additions and 13 deletions
|
|
@ -1 +0,0 @@
|
|||
CLAUDE.md
|
||||
45
.claude/AGENTS.md
Normal file
45
.claude/AGENTS.md
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# dayjs-hijri-plus — PRI (Per-Repo Instructions)
|
||||
|
||||
**PPI:** `~/Sites/acamarata/.claude/CLAUDE.md`
|
||||
|
||||
## What This Is
|
||||
|
||||
A Day.js plugin that adds Hijri calendar support. Converts Gregorian dates to and from
|
||||
Hijri, provides Hijri-aware formatting, and delegates all calendar logic to hijri-core.
|
||||
Supports Umm al-Qura (UAQ) and FCNA/ISNA calendars out of the box. Custom calendar
|
||||
engines can be registered at runtime.
|
||||
|
||||
**npm:** `dayjs-hijri-plus@1.0.0`
|
||||
**Language:** TypeScript
|
||||
**License:** MIT
|
||||
|
||||
## Key Technical Details
|
||||
|
||||
- Peer dependencies: `dayjs@^1.0.0`, `hijri-core@^1.0.0`
|
||||
- Plugin pattern: call `dayjs.extend(hijriPlugin)` once at startup
|
||||
- Instance methods added: `toHijri()`, `formatHijri()`, `hijriYear()`, `hijriMonth()`, `hijriDay()`
|
||||
- Static factory added: `dayjs.fromHijri(hy, hm, hd, options?)`
|
||||
- Hijri format tokens: `iYYYY`, `iMM`, `iDD`, `iD`, `iMMMM` — non-Hijri tokens pass through to dayjs
|
||||
- Options argument selects calendar: `{ calendar: 'uaq' }` (default) or `{ calendar: 'fcna' }`
|
||||
- Dual CJS/ESM build via tsup
|
||||
- Zero runtime dependencies (peer deps are provided by the consumer)
|
||||
|
||||
## Architecture
|
||||
|
||||
`src/index.ts` is the plugin entry point — exports the default plugin function and any
|
||||
types. `src/types.ts` holds shared type definitions. 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 plugin for Day.js — call `dayjs.extend(hijriPlugin)` before using any methods
|
||||
- hijri-core provides the actual calendar engine — this package is a thin adapter
|
||||
- Changes to hijri-core's API may require updates here
|
||||
- dayjs is a peer dep — the consumer's installed dayjs instance is used (no bundled copy)
|
||||
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": "dayjs-hijri-plus",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "Day.js plugin for Hijri calendar conversion and formatting. 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 @@
|
|||
"lint": "eslint src/",
|
||||
"format": "prettier --write src/",
|
||||
"format:check": "prettier --check src/",
|
||||
"prepublishOnly": "tsup"
|
||||
"prepublishOnly": "tsup",
|
||||
"coverage": "c8 --reporter=lcov --reporter=text node --test"
|
||||
},
|
||||
"keywords": [
|
||||
"dayjs",
|
||||
|
|
@ -82,5 +79,6 @@
|
|||
"homepage": "https://github.com/acamarata/dayjs-hijri-plus#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/acamarata/dayjs-hijri-plus/issues"
|
||||
}
|
||||
},
|
||||
"type": "module"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue