From efe5a19386892b3fd6b2cba53a60056ee29f4818 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Mar 2026 02:24:17 +0000 Subject: [PATCH] Fix TypeScript subpath exports for moduleResolution: node (Issue #113) Add typesVersions fallback to package.json so docxodus/react and docxodus/worker resolve types under all TS module resolution modes. Reorder export conditions to put types before import per TS requirements. https://claude.ai/code/session_01DFuL5c7KNRiu4QgifBBGWV --- CHANGELOG.md | 3 +++ npm/package.json | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5183b10..dd42261 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - .NET 8 / Open XML SDK 3.x Migration +### Fixed (npm) +- **TypeScript subpath exports not resolving under `moduleResolution: "node"` (Issue #113)** - Added `typesVersions` fallback to npm package.json so `docxodus/react` and `docxodus/worker` subpath imports resolve types correctly under all TypeScript module resolution modes. Also reordered export conditions to put `types` before `import` per TypeScript requirements. + ### Added - **Incremental annotation overlay API (Issue #106)** - Decouple HTML conversion from annotation projection to avoid full WASM re-conversion - `ProjectAnnotationsOntoHtml()` - Project a full annotation set onto already-converted HTML diff --git a/npm/package.json b/npm/package.json index 71c35d7..8b67a54 100644 --- a/npm/package.json +++ b/npm/package.json @@ -8,16 +8,22 @@ "types": "./dist/index.d.ts", "exports": { ".": { - "import": "./dist/index.js", - "types": "./dist/index.d.ts" + "types": "./dist/index.d.ts", + "import": "./dist/index.js" }, "./react": { - "import": "./dist/react.js", - "types": "./dist/react.d.ts" + "types": "./dist/react.d.ts", + "import": "./dist/react.js" }, "./worker": { - "import": "./dist/worker-proxy.js", - "types": "./dist/worker-proxy.d.ts" + "types": "./dist/worker-proxy.d.ts", + "import": "./dist/worker-proxy.js" + } + }, + "typesVersions": { + "*": { + "react": ["./dist/react.d.ts"], + "worker": ["./dist/worker-proxy.d.ts"] } }, "files": [