fix: 🐛 correct env-utils exports paths to match actual dist extensions - #214
Merged
Conversation
The library preset outputs index.mjs and index.d.mts but exports referenced index.js and index.d.ts which don't exist. TypeScript with moduleResolution: "bundler" strictly follows the exports map and fails when the referenced files are missing. Signed-off-by: Newton <vj2kp2hfh4@privaterelay.appleid.com> Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #214 +/- ##
=======================================
Coverage 97.43% 97.43%
=======================================
Files 22 22
Lines 234 234
Branches 57 57
=======================================
Hits 228 228
Partials 6 6 🚀 New features to boost your workflow:
|
Contributor
Author
|
🎉 This PR is included in version 1.2.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The library preset outputs
index.mjsandindex.d.mtsbut theexportsfield inpackage.jsonreferencedindex.jsandindex.d.ts— files that don't exist. This caused TypeScript to fail resolving the package whenmoduleResolution: "bundler"is used (which strictly follows the exports map without fallback).Fix
Update the exports to match the actual build output:
{ ".": { "import": "./dist/index.mjs", "types": "./dist/index.d.mts" } }Test plan
pnpm --filter @theholocron/env-utils build— clean buildpnpm --filter @theholocron/env-utils test— 138/138 pass