fix: revert type:module to restore CJS compatibility (2.0.2 patch)

This commit is contained in:
Aric Camarata 2026-05-28 14:17:44 -04:00
parent aa850f806c
commit ba68c43a55
2 changed files with 6 additions and 2 deletions

View file

@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [2.0.2] - 2026-05-28
### Fixed
- Reverted `"type": "module"` addition that broke CJS lib loading. `lib/spa.js` is compiled CommonJS output and uses `exports.*` assignments. Adding `"type": "module"` to the package root caused Node.js to parse it as ESM, resulting in `ReferenceError: exports is not defined in ES module scope`. The package already ships proper `.mjs` and `.cjs` dist files via the exports map, so the package-level `type` field is not required. A full ESM-native source rewrite is planned for a future major version.
## [2.0.1] - 2026-05-28
### Added

View file

@ -1,6 +1,6 @@
{
"name": "nrel-spa",
"version": "2.0.1",
"version": "2.0.2",
"description": "Pure JavaScript implementation of the NREL Solar Position Algorithm (SPA). Calculates solar zenith, azimuth, sunrise, sunset, and solar noon for any location and date.",
"author": "Aric Camarata",
"license": "MIT",
@ -76,6 +76,5 @@
"typescript": "^5.9.3",
"typescript-eslint": "^8.56.1"
},
"type": "module",
"packageManager": "pnpm@10.11.1"
}