Skip to content

Conversation

@userquin
Copy link
Member

@userquin userquin commented Oct 1, 2025

DON'T MERGE YET: I need to review default package exports via require (webpack), and maybe update the readme.md file here.

NOTE: with latest changes (af4ac3e commit) this is breaking since we don't need .default when requiring, I can revert node changes if you want (remove the tsdown build:done hook and the patchNode16CJSDefaultExports helper function). If keeping breaking change, I need to update the readme.md and do some tests (maybe we can export some additional subpackage export to fix the default export having also the types, I can add them here => webpack, rspack, for example and some others unplugin subpackages exports without types, but can use ./types 🤔 )

NOTE: node changes reverted, it should be fine to release a patch version to fix missing types/*.

. and ./resolvers subpackages exports

This PR also fixes node16 CJS types (for . and ./resolver), exporting default and types, included namespace hack, I need to check it (also fixed node 10 module resolutions for . (just patching them for node16 CJS) and types/* subpackage exports):

subpackage exports 1 subpackage exports 2

closes #417

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 1, 2025

Open in StackBlitz

npm i https://pkg.pr.new/unplugin-icons@418

commit: 4d7dfc6

@userquin userquin mentioned this pull request Oct 1, 2025
5 tasks
@userquin userquin marked this pull request as draft October 1, 2025 16:19
@userquin userquin marked this pull request as ready for review October 1, 2025 17:21
@userquin
Copy link
Member Author

userquin commented Oct 1, 2025

@antfu with latest changes (last commit) this is breaking since we don't need .default when requiring, I can revert node changes if you want (remove the tsdown build:done hook and the patchNode16CJSDefaultExports helper function).

@userquin userquin requested a review from antfu October 1, 2025 18:42
@userquin
Copy link
Member Author

userquin commented Oct 1, 2025

arggg, pkg-pr-new failing, will require a dummy commit (already published, the link should be fine, some pkg-pr-new internal thingy 😄 , it is a new error)

response from the author

@antfu antfu merged commit 622d45d into main Oct 2, 2025
4 checks passed
@antfu antfu deleted the userquin/fix-types-subpackage-exports branch October 2, 2025 02:33
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.

v22.4.0 has broken importing types

3 participants