pray-calc/CHANGELOG.md
Aric Camarata c02f197ece v2.0.0 — TypeScript rewrite, dual ESM/CJS, 14 methods + PCD dynamic algorithm
Complete rewrite from plain JavaScript to TypeScript with dual CJS/ESM output
via tsup. Removes all legacy .js source files and the old CommonJS-only index.

Key changes:
- Full TypeScript source in src/ with strict mode and declaration maps
- tsup build: dist/index.cjs + dist/index.mjs + dual .d.ts / .d.mts types
- 14 traditional fixed-angle methods (UOIF through MUIS) + MSC seasonal method
- PCD dynamic algorithm: MSC seasonal base + Earth-Sun distance correction +
  ecliptic geometry + atmospheric refraction + observer elevation
- getTimesAll() batches all 14x2 zenith angles into a single SPA call
- getMscFajr() / getMscIsha() expose MSC seasonal reference directly
- getAngles() returns the PCD-computed fajrAngle and ishaAngle
- High-latitude bounds: angles clipped to [10, 20] above 55N
- 106 tests across ESM and CJS (test.mjs + test-cjs.cjs)
- CI matrix: Node 20/22/24, typecheck, pack-check
- Wiki: 12 reference pages + 6-page research section with global accuracy study,
  home-territory comparison, observational evidence, and field observation matrix
- Moon functions removed (migrated to moon-sighting package)
- pnpm-only, Node >=20, sideEffects: false
2026-02-25 18:11:20 -05:00

3.4 KiB
Raw Blame History

Changelog

All notable changes to this project will be documented in this file.

[2.0.0] - 2026-02-25

Added

  • Full TypeScript rewrite with dual CJS/ESM build (tsup)
  • Physics-grounded dynamic twilight angle algorithm: MSC seasonal base + Earth-Sun distance correction + Fourier harmonic smoothing + atmospheric refraction + elevation horizon dip
  • Three new traditional methods: IGUT/Tehran (17.7°/14°), Kuwait (18°/17.5°), Qatar (18°/90 min) — total now 14
  • getAngles() exported as a standalone function
  • getMscFajr() / getMscIsha() exported with shafaq mode parameter (general, ahmer, abyad)
  • solarEphemeris() / toJulianDate() exported — Jean Meeus solar ephemeris (declination, r, ecliptic lon)
  • METHODS array exported for documentation and tooling
  • All TypeScript types exported (PrayerTimes, FormattedPrayerTimes, PrayerTimesAll, etc.)
  • .wiki/ documentation: Home, API Reference, Dynamic Algorithm, Traditional Methods, Architecture, Twilight Physics, High-Latitude, Asr Calculation, Changelog
  • GitHub Actions CI (Node 20/22/24 matrix, typecheck, pack-check) and wiki sync workflow
  • 100-scenario ESM test suite + CJS smoke tests

Changed

  • getAsr refactored from internal SPA dependency to pure math using Meeus declination
  • getTimesAll now batches all 14×2 + 2 dynamic angles in a single SPA call
  • nrel-spa updated from v1.x to v2.0.1 (formatTime replaces fractalTime)
  • Node engine requirement raised from >=12 to >=20
  • Package exports field added with types-first conditional exports
  • sideEffects: false for tree-shaking
  • publishConfig.access: public added
  • repository.url uses git+https:// prefix

Removed

  • All moon-related functions (getMoon, getMoonPhase, getMoonPosition, getMoonIllumination, getMoonVisibility) — moved to moon-sighting package
  • suncalc runtime dependency (removed with moon functions)
  • getEarthSunDistance helper (inlined into getSolarEphemeris)
  • methods.json (methods now embedded in getTimesAll.ts with full metadata)
  • CommonJS index.js source (replaced by TypeScript src/)
  • index.d.ts hand-written types (replaced by generated dist/index.d.ts)
  • mocha and eslint dev dependencies (replaced by plain node:assert tests)

[1.0.0] - 2023-11-11

  • Initial release

[1.1.0] - 2023-11-12

  • Updated calculation behavior to be more accurate (major)

[1.2.3] - 2023-11-12

  • Moved timezone to main args and changed default behavior (major)
  • Updated test cases and readme to reflect new usage (minor)

[1.3.2] - 2023-11-13

  • Major updates to getMoon with own functions

[1.4.0] - 2023-11-14

  • Renamed to "pray-calc" and removed old package
  • Improved Synodic accuracy slightly and lastKnownMoon

[1.4.1] = 2023-12-01

  • Modified getMoonVisibility to use adjusted moon phase for end of cycle

[1.6.0] = 2025-05-04

  • Major fixes for core files and calculations
  • Updated to use the new "nrel-spa" v1.3.0

[1.6.1] - 2025-05-04

  • Fixed missing modules and types definitions lost in last update
  • Locked suncalc dependency to ^1.9.0
  • Clarified scripts: build, test, and prepublishOnly in package.json

[1.6.2] - 2025-05-04

  • Fixed Package issues

[1.7.0] = 2025-05-04

  • Major update to main algorithm
  • Fixes to syntax and bugs

[1.7.1] = 2025-05-14

  • Update to package meta and location

[1.7.2] = 2025-05-14

  • Added tests