Skip to content

Conversation

@KazariEX
Copy link
Contributor

@KazariEX KazariEX commented Oct 2, 2025

When generating types for auto imports, we usually access properties using ['...'] directly. However, when this appears after typeof import('...'), the identifier at that position is not a valid reference. I would like to have a util that helps us generate typeof import('...').default instead of typeof import('...')['default'] whenever possible.

@codecov
Copy link

codecov bot commented Oct 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c8441c8) to head (75b22b5).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #125   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          336       354   +18     
  Branches        82        87    +5     
=========================================
+ Hits           336       354   +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KazariEX KazariEX changed the title feat: generate property access feat: generate dynamic type import Oct 6, 2025
@KazariEX KazariEX requested a review from danielroe November 5, 2025 07:32
@danielroe danielroe changed the title feat: generate dynamic type import feat: add genDynamicTypeImport Nov 6, 2025
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great - thank you ❤️

@danielroe danielroe merged commit d32d711 into unjs:main Nov 13, 2025
4 checks passed
@KazariEX KazariEX deleted the feat/property-access branch November 13, 2025 09:49
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.

2 participants