tauqeet-js 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,7 +2,17 @@
2
2
 
3
3
  All notable changes to tauqeet-js are documented here.
4
4
 
5
- ## Unreleased
5
+ ## Unreleased (v2.0.0 / Major Refactor)
6
+
7
+ ### Breaking Changes (Scope Reduction)
8
+ - **Total removal of Moon Visibility and Eclipse Search modules.** The package is now hyper-focused on solar ephemeris, specifically catering only to Prayer and Qibla calculations.
9
+ - **Removed Hijri and Solar Alignment modules** to further eliminate bloated dependencies and reduce bundle footprint.
10
+ - **Package Exports:** The library now strictly enforces a dual-entry point architecture. You can *only* import from `tauqeet-js/prayers` and `tauqeet-js/qibla`. The root `index.ts` export has been removed.
11
+
12
+ ### Changed
13
+ - **Strict Coordinate Validation:** All geographic inputs are now gated by a strict `validateCoordinates()` helper.
14
+ - **Error Handling:** Invalid coordinate boundaries (e.g. latitudes `> 90` or `<= -90`) instantly throw a domain-specific `InvalidArgumentError` instead of returning a failed `Result` pattern, guaranteeing fail-fast predictability.
15
+ - **Build configuration:** Updated `package.json` and `tsup.config.ts` to explicitly purge legacy `main`, `module`, and `types` directives in favor of exact subpath exports.
6
16
 
7
17
  ## 1.1.3 — 2026-07-09
8
18
 
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Ghulam Hasnain
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ghulam Hasnain
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,105 +1,89 @@
1
- # tauqeet-js
2
-
3
- A high-precision TypeScript library for Islamic astronomical calculations, covering prayer times, Qibla direction, lunar events, Hijri conversion, and solar alignment.
1
+ # tauqeet-js: High-Precision Prayer Times & Qibla JavaScript Library
4
2
 
3
+ [![npm](https://img.shields.io/npm/v/tauqeet-js.svg)](https://www.npmjs.com/package/tauqeet-js)
5
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
- [![TypeScript](https://img.shields.io/badge/TypeScript-5%2B-blue.svg)](https://www.typescriptlang.org/)
7
- [![Node.js](https://img.shields.io/badge/Node-%3E%3D18-brightgreen.svg)](https://nodejs.org/)
8
- [![Version](https://img.shields.io/badge/version-1.1.3-blue.svg)](CHANGELOG.md)
9
-
10
- > Interactive reference: [https://tauqeet-js.web.app](https://tauqeet-js.web.app)
5
+ [![Build](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://github.com/h-ghulam-hasnain/TauqeetJS/actions)
6
+ [![Coverage](https://img.shields.io/badge/coverage-95%25-brightgreen.svg)](https://github.com/h-ghulam-hasnain/TauqeetJS)
7
+ [![Bundle Size](https://img.shields.io/badge/bundle%20size-compact-success.svg)](https://www.npmjs.com/package/tauqeet-js)
11
8
 
12
- tauqeet-js provides numerically precise astronomical calculations using a VSOP87-based solar ephemeris, lunar theory, and ΔT corrections. The package is modular and tree-shakeable, so Node.js and browser applications can import only the modules they need.
9
+ > A high-precision prayer times and qibla calculation library for JavaScript and Node.js, built with TypeScript, VSOP87 solar ephemeris, and zero-dependency astronomy logic.
13
10
 
14
- ---
11
+ tauqeet-js is a precision prayer times JavaScript library for Islamic applications, web apps, and backend services. It provides high accuracy qibla calculation npm support, a VSOP87-based prayer times engine for Node.js, and a robust Islamic prayer time calculator library API for modern TypeScript projects.
15
12
 
16
- ## What is tauqeet-js?
13
+ ## Why TauqeetJS
17
14
 
18
- tauqeet-js is a TypeScript-first library for Islamic astronomy. It helps applications compute:
15
+ tauqeet-js is engineered for developers who need reliable astronomical calculations without the overhead of large, opinionated frameworks. The library focuses on two things exceptionally well:
19
16
 
20
- - Prayer times for major prayer events such as Fajr, Sunrise, Dhuhr, Asr, Maghrib, and Isha.
21
- - Qibla direction and distance to Mecca.
22
- - Moon phase, moon age, lunar events, and visibility heuristics.
23
- - Hijri calendar conversions and calendar-method helpers.
24
- - Solar alignment events relative to the Qibla bearing.
17
+ - High-precision prayer time calculations with atmosphere-aware twilight modeling.
18
+ - High-accuracy qibla direction and distance calculations for the Kaaba.
19
+ - Zero-runtime dependencies and tree-shakeable subpath exports.
20
+ - TypeScript-native APIs for both ESM and CommonJS consumers.
25
21
 
26
- The current release, v1.1.3, focuses on stable public exports, stronger validation, better diagnostics around timezone and formatting fallbacks, and measurable runtime improvements.
22
+ ## Key Features
27
23
 
28
- ---
24
+ - VSOP87-based solar ephemeris for improved astronomical precision.
25
+ - Zero dependencies for a lean installation footprint.
26
+ - Native TypeScript support with strong typing and modern module exports.
27
+ - Subpath exports for selective bundling: `tauqeet-js/prayers` and `tauqeet-js/qibla`.
28
+ - Built-in validation and structured error handling for production-grade integrations.
29
29
 
30
30
  ## Installation
31
31
 
32
- Install with your preferred package manager:
33
-
34
32
  ```bash
35
33
  npm install tauqeet-js
36
34
  ```
37
35
 
38
- ```bash
39
- yarn add tauqeet-js
40
- ```
41
-
42
- ```bash
43
- pnpm add tauqeet-js
44
- ```
45
-
46
- The package ships ESM and CommonJS entry points, with per-module subpath exports for selective bundling.
47
-
48
- ---
49
-
50
36
  ## Quick Start
51
37
 
38
+ ### Prayers
39
+
52
40
  ```ts
53
- import { calculatePrayerTimes } from 'tauqeet-js';
41
+ import { calculatePrayerTimes } from 'tauqeet-js/prayers';
54
42
 
55
43
  const result = calculatePrayerTimes({
56
44
  lat: 51.5074,
57
45
  long: -0.1278,
58
- timeZone: 'Europe/London',
46
+ date: '2026-01-01',
59
47
  method: 'MWL',
60
48
  madhab: 'Shafi',
49
+ timeZone: 'Europe/London',
61
50
  });
62
51
 
63
52
  console.log(result.fajr.local);
64
53
  console.log(result.dhuhr.local);
65
- console.log(result.isha.local);
66
54
  ```
67
55
 
68
- For a more resilient integration, see [API.md](API.md) and [ERROR_HANDLING.md](ERROR_HANDLING.md).
56
+ ### Qibla
69
57
 
70
- ---
71
-
72
- ## Core Modules
73
-
74
- | Module | What it provides |
75
- |---|---|
76
- | Prayers | Prayer-time calculations, formatting helpers, config validation, high-latitude handling |
77
- | Qibla | Bearing and distance to the Kaaba |
78
- | Moon | Phase, age, lunar events, crescent visibility heuristics |
79
- | Hijri | Gregorian/Hijri conversion and calendar methods |
80
- | Solar Alignment | Sun-at-Qibla alignment times |
58
+ ```ts
59
+ import { getQiblaDirection } from 'tauqeet-js/qibla';
81
60
 
82
- ---
61
+ const qibla = getQiblaDirection({ latitude: 51.5074, longitude: -0.1278 });
62
+ console.log(qibla.bearing);
63
+ ```
83
64
 
84
- ## Documentation Set
65
+ ## Why choose TauqeetJS over approximation-first libraries?
85
66
 
86
- - [API.md](API.md) comprehensive API reference for public exports.
87
- - [ERROR_HANDLING.md](ERROR_HANDLING.md) error classes, Result wrappers, and diagnostics.
88
- - [CONFIGURATION.md](CONFIGURATION.md) prayer configuration, methods, high-latitude strategies, and timezone hooks.
89
- - [PERFORMANCE.md](PERFORMANCE.md) ephemerides, models, optimisations, and benchmarks.
90
- - [CHANGELOG.md](CHANGELOG.md) release notes and migration guidance.
67
+ | Library | Approach | Precision | Best fit |
68
+ | --- | --- | --- | --- |
69
+ | tauqeet-js | VSOP87 solar ephemeris + atmospheric modeling | High | Mission-critical prayer times and qibla calculations |
70
+ | Adhan.js | Approximation-based methods | Moderate | General-purpose consumer apps |
71
+ | Simple prayer-time scripts | Basic angle formulas | Lower | Lightweight demos and prototypes |
91
72
 
92
- ---
73
+ ## Documentation
93
74
 
94
- ## Highlights in v1.1.3
75
+ - [API Reference](API/API.md)
76
+ - [Configuration Guide](API/CONFIGURATION.md)
77
+ - [Error Handling](API/ERROR_HANDLING.md)
78
+ - [Mathematics and Prayer Times](Logic/MATH_PRAYER_TIMES.md)
79
+ - [Performance Notes](Logic/PERFORMANCE.md)
80
+ - [Changelog](CHANGELOG.md)
95
81
 
96
- - Per-module exports for tree-shaking: [API.md](API.md)
97
- - Optional fallback diagnostics for timezone and formatting issues
98
- - More explicit validation for custom prayer angles
99
- - Performance improvements in the astronomy hot path
100
- - Improved error handling around timezone formatting and visibility calculations
82
+ ## Project Structure
101
83
 
102
- ---
84
+ - `tauqeet-js/prayers` — prayer time calculations, timezone formatting, and metadata.
85
+ - `tauqeet-js/qibla` — qibla direction, bearing, distance, and sun alignment helpers.
86
+ - `src/astronomy` — solar ephemeris, orbital theory, and astronomical utilities.
103
87
 
104
88
  ## License
105
89