-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Use .ts extension in relative source imports #591
Conversation
Yeah thanks for the ping! If I remeber once I'm at my PC I'll try it out |
Also needed to add an |
@jeff-hykin Any time for a trial run yet? I'm looking here for feedback from some actual Deno user to confirm that this does indeed provide a fix for #301, before just presuming so on my own initiative. |
Also, worth mentioning, but Deno has made a new package repo https://jsr.io which may be worth targeting instead of / in addition to deno land. It's not much different in terms of what you publish, just done with a github action. Here is a pretty minimal example repo I created for reference: https://github.com/justinmchase/type/blob/main/.github/workflows/publish.yml |
This change adopts the
--rewriteRelativeImportExtensions
option introduced in Typescript 5.7, and changes all relative paths to use the.ts
extension.Due to rollup/plugins#1820, a post-compilation transform is required to get the CLI tool to work right.
An ESLint rule is added to ensure that the
.ts
extension is always there; this may be of interest to others as well:yaml/eslint.config.mjs
Lines 41 to 51 in 18e6112
Together with explicit
type
on imports & exports, this change fixes #301 and makes the library work directly in Deno. A really simple Deno smoke test is included. It would be nice to get the full test suite to run on Deno as well, as discussed in #301 (comment)Ping @justinmchase & @jeff-hykin: Would you have time to see if this works as expected?