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

Add import-esm flag #192

Merged
merged 4 commits into from
Jan 22, 2024
Merged

Add import-esm flag #192

merged 4 commits into from
Jan 22, 2024

Conversation

escritorio-gustavo
Copy link
Contributor

Add a feature flag called import-esm to add the .js extension at the end of file paths in TS import statements

Fixes #152

@NyxCode
Copy link
Collaborator

NyxCode commented Jan 20, 2024

Hey, thanks for the PR. I think this is a good change, though I'm growing more and more uncomfortable by cargo features being the only way to really configure anything. That being said, I don't see any better option right now.

Could you move the changes from the README.md into the doc comment in ts-rs/lib.rs, and generate the README as described in CONTRIBUTING.md?

@escritorio-gustavo
Copy link
Contributor Author

escritorio-gustavo commented Jan 22, 2024

Could you move the changes from the README.md into the doc comment in ts-rs/lib.rs, and generate the README as described in CONTRIBUTING.md?

Done, sorry I totally skipped on reading it.

I'm growing more and more uncomfortable by cargo features being the only way to really configure anything.

I see... there really are a lot of cargo features going on. For this specific PR it's probably the only way to go due to ESM imports being kind of a global config on the TS side, but for future PRs what do you think should be the way to go?

@NyxCode
Copy link
Collaborator

NyxCode commented Jan 22, 2024

I've added a check in the CI pipeline for that, so that we dont miss that in the future.

@NyxCode NyxCode merged commit 1c33a86 into Aleph-Alpha:main Jan 22, 2024
1 check passed
@escritorio-gustavo escritorio-gustavo deleted the import-esm branch January 22, 2024 14:55
@NyxCode
Copy link
Collaborator

NyxCode commented Jan 22, 2024

I had to re-generate the README since the encoding (remote: UTF-8, branch: UTF16-LE) differed. Idk where that happened, but I guess we'll figure that out on the next PR.

@escritorio-gustavo
Copy link
Contributor Author

It seems to be my computer. Whenever I run the cargo readme command the README decides to double in size

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.

Feature Request l ESM .js extension
2 participants