Skip to content

fix: use valid legacy types entry - #443

Draft
liyimil wants to merge 1 commit into
unjs:mainfrom
liyimil:agent/fix-legacy-types-entry
Draft

fix: use valid legacy types entry#443
liyimil wants to merge 1 commit into
unjs:mainfrom
liyimil:agent/fix-legacy-types-entry

Conversation

@liyimil

@liyimil liyimil commented Aug 5, 2026

Copy link
Copy Markdown

What changed

  • Point the legacy types field at the valid ESM declaration generated as dist/index.d.mts.
  • Keep the conditional CommonJS type entry on dist/index.d.cts for require consumers.

Why

The generated dist/index.d.ts combines export = with named exports behind @ts-ignore. Legacy directory resolution reaches that file through the top-level types field, and TypeScript 7 reports TS2595 at named-import sites. Using the valid declaration entry removes the consumer error without changing runtime exports.

Fixes #441.

Checks

  • pnpm build
  • eslint .
  • prettier -c package.json
  • vitest run --coverage (3 tests passed)
  • TypeScript 5.8 consumer compile with a directory paths mapping
  • @typescript/native-preview / tsgo consumer compile

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5467d8f6-5891-4132-88c4-aa906b29cf23

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dist/index.d.ts mixes export = with named exports (TS2309, @ts-ignore-d) — breaks consumers under TypeScript 7 / tsgo

1 participant