From e8981db7aa58b66667946204daf0f89d9b0810a3 Mon Sep 17 00:00:00 2001 From: Aric Camarata Date: Fri, 29 May 2026 15:05:17 -0400 Subject: [PATCH] fix: emit index.d.mts for ESM type resolution (v1.1.1) --- CHANGELOG.md | 6 ++++++ package.json | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fda38a1..633742f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.1.1] - 2026-05-29 + +### Fixed +- Emit `dist/index.d.mts` so ESM consumers get proper type resolution. +- Use format-specific `types` entries in the `exports` map (`import` condition points to `index.d.mts`, `require` condition points to `index.d.ts`). + ## [1.1.0] - 2026-05-28 ### Added diff --git a/package.json b/package.json index b9bf4df..84cba0b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moon-sighting", - "version": "1.1.0", + "version": "1.1.1", "description": "High-accuracy lunar crescent visibility and moon sighting calculations using JPL DE442S ephemerides. Implements Yallop and Odeh criteria for Islamic crescent sighting workflows.", "author": "Aric Camarata", "license": "MIT", @@ -9,9 +9,14 @@ "types": "./dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, @@ -30,13 +35,14 @@ }, "scripts": { "build": "tsup", + "postbuild": "cp dist/index.d.ts dist/index.d.mts", "typecheck": "tsc --noEmit", - "pretest": "tsup", + "pretest": "pnpm run build", "test": "node --test test.mjs && node --test test-cjs.cjs", "lint": "eslint src/", "format": "prettier --write src/", "format:check": "prettier --check src/", - "prepublishOnly": "tsup", + "prepublishOnly": "pnpm run build", "cli": "node dist/cli/index.cjs", "coverage": "c8 --reporter=lcov --reporter=text node --test" },