mirror of
https://github.com/acamarata/moment-hijri-plus.git
synced 2026-06-30 18:54:29 +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
baf7fc616b
commit
308e5e2c48
3 changed files with 77 additions and 13 deletions
|
|
@ -1 +0,0 @@
|
||||||
CLAUDE.md
|
|
||||||
46
.claude/AGENTS.md
Normal file
46
.claude/AGENTS.md
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
# moment-hijri-plus — PRI (Per-Repo Instructions)
|
||||||
|
|
||||||
|
**PPI:** `~/Sites/acamarata/.claude/CLAUDE.md`
|
||||||
|
|
||||||
|
## What This Is
|
||||||
|
|
||||||
|
Moment.js plugin for Hijri calendar conversion and formatting. Delegates all calendar
|
||||||
|
logic to hijri-core, a zero-dependency Hijri engine with pluggable calendar support.
|
||||||
|
Supports Umm al-Qura and FCNA/ISNA calendars. Installed via a function call rather than
|
||||||
|
`moment.extend()` — call `installHijri(moment)` once at startup.
|
||||||
|
|
||||||
|
**npm:** `moment-hijri-plus@1.0.0`
|
||||||
|
**Language:** TypeScript
|
||||||
|
**License:** MIT
|
||||||
|
|
||||||
|
## Key Technical Details
|
||||||
|
|
||||||
|
- Peer dependencies: `moment@^2.0.0`, `hijri-core@^1.0.0`
|
||||||
|
- Plugin pattern: `installHijri(moment)` called once at startup (not moment.fn.extend)
|
||||||
|
- Instance methods added: `toHijri()`, `hijriYear()`, `hijriMonth()`, `hijriDay()`, `isValidHijri()`, `formatHijri()`
|
||||||
|
- Static factory added: `moment.fromHijri(hy, hm, hd, options?)`
|
||||||
|
- `formatHijri()` Hijri tokens: `iD`, `iMMMM`, `iYYYY`, `iM`, `iDD`, `iMM` — non-Hijri tokens pass through to moment.format()
|
||||||
|
- Out-of-range inputs return `null` (instance methods) or empty string (formatHijri)
|
||||||
|
- `fromHijri()` throws if the date is invalid or out of range
|
||||||
|
- Dual CJS/ESM build via tsup
|
||||||
|
- Zero runtime dependencies (peer deps are provided by the consumer)
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
`src/index.ts` exports the default `installHijri` function and shared types. 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 Moment.js — call `installHijri(moment)` once 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
|
||||||
|
- moment is a peer dep — the consumer's installed moment instance is used (no bundled copy)
|
||||||
|
- Moment.js is in maintenance mode; this package targets existing moment users, not new projects
|
||||||
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": "moment-hijri-plus",
|
"name": "moment-hijri-plus",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "Moment.js plugin for Hijri calendar conversion and formatting. Supports Umm al-Qura and FCNA calendars via hijri-core.",
|
"description": "Moment.js plugin for Hijri calendar conversion and formatting. Supports Umm al-Qura and FCNA calendars via hijri-core.",
|
||||||
"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": [
|
||||||
"moment",
|
"moment",
|
||||||
|
|
@ -83,5 +80,6 @@
|
||||||
"homepage": "https://github.com/acamarata/moment-hijri-plus#readme",
|
"homepage": "https://github.com/acamarata/moment-hijri-plus#readme",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/acamarata/moment-hijri-plus/issues"
|
"url": "https://github.com/acamarata/moment-hijri-plus/issues"
|
||||||
}
|
},
|
||||||
|
"type": "module"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue