Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce alias option support #203

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft

Conversation

NamesMT
Copy link

@NamesMT NamesMT commented Mar 11, 2024

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Implements alias support using pathe's resolveAlias, similar to jiti and unbuild config.alias option

Related to unbuild regarding alias breaking/not working in mkdist builder
Related issues: #202, unjs/unbuild#375, unjs/unbuild#289

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

NamesMT and others added 3 commits March 11, 2024 13:25
Implements `alias` support using `pathe`'s resolveAlias, similar to `jiti` and `unbuild` config.alias option
@NamesMT
Copy link
Author

NamesMT commented Mar 11, 2024

Just realized mkdist doesn't transform aliases that point to srcDir into distDir, need a fix for that.
Edit: also would need to implement an absolute to relative import resolver to be usable.

How do I convert the PR to a draft? Update: DONE!

@NamesMT
Copy link
Author

NamesMT commented Mar 11, 2024

Seems usable now.
image

sorry for the light theme flash

@NamesMT
Copy link
Author

NamesMT commented Mar 20, 2024

Had some spare time to return to the PR and pushed a few more updates/fixes, such as CLI arg support and thorough case testing :D.

@NamesMT
Copy link
Author

NamesMT commented Mar 20, 2024

Hi @pi0, I did some more testing and the PR looks ready to ship,
Please help me review it when you have time, thanks!

@pi0
Copy link
Member

pi0 commented Dec 13, 2024

Hi dear @NamesMT sorry this got delayed.

Alias support is a really nice idea.

We are thinking to use AST aware tooling (OXC) for syntax detection/replacement. Might first land it in upstream places (such as mlly and experiment little bit more)

@pi0 pi0 marked this pull request as draft December 13, 2024 11:44
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