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

fix: when installed typescript version contains 0 it would cause error to be thrown "Expected version to be parsed" #399

Merged
merged 3 commits into from
Mar 15, 2025

Conversation

anthony-y-zhu14
Copy link
Contributor

I was using this transformer with the rollup typescript plugin but noticed when the installed typescript version is "5.0.4" an error is thrown "Expected version to be parsed".

I believe this is caused by checking the installed version to see if they are undefined by number 0 is also considered to be falsy in javascript causing this check to fail despite having typescript installed correctly

@danielpza danielpza linked an issue Mar 14, 2025 that may be closed by this pull request
@danielpza
Copy link
Member

LGTM, mind adding a quick test to prevent a regression in the future. Otherwise I'll get it end of day

@anthony-y-zhu14
Copy link
Contributor Author

anthony-y-zhu14 commented Mar 14, 2025

I added a config for 5.0.4 in the test cases but there seem to be quite a lot of failures, looking at the log it seems the path is not transformed to relative. I've tried few versions such as 5.3.3, 5.0.2, 5.7.3 and 5.5.3 none of them seem to be able to pass the test

@danielpza danielpza merged commit c601db8 into LeDDGroup:master Mar 15, 2025
10 checks passed
@danielpza
Copy link
Member

Published in https://github.com/LeDDGroup/typescript-transform-paths/releases/tag/v3.5.5

Thanks for your contribution @anthony-y-zhu14

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.

[Bug] Transformer step fails when TS major/minor version is 0
2 participants