Skip to content

Co-locating .d.ts files and .ts source files results in TypeScript loading the .ts file instead of .d.ts in some cases #462

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

Closed
lucacasonato opened this issue Apr 29, 2024 · 0 comments · Fixed by #463

Comments

@lucacasonato
Copy link
Member

lucacasonato commented Apr 29, 2024

In https://npm.jsr.io/~/8/@jsr/std__fs/0.223.0.tgz, a relative import to ./_create_walk_entry.d.ts is resolved to _create_walk_entry.ts instead by tsc: microsoft/TypeScript#58353

To work around this, we should emit all .js and d.ts files into a separate folder.

@github-project-automation github-project-automation bot moved this to Needs Triage in JSR Apr 29, 2024
@lucacasonato lucacasonato moved this from Needs Triage to Ready in JSR Apr 29, 2024
github-merge-queue bot pushed a commit that referenced this issue Apr 30, 2024
Fixes #462 

To make this work, also bans publishing packages containing a top level
folder called `_dist`.

Also we now do not reference `.d.ts` files from other `.d.ts` files
using the `.d.ts` extension, because otherwise tsc gets upset. So we
instead use `.js` (even if the file does not exist!)

Also we emit source maps into separate files, because TSC doesn't
understand embedded source maps.
@github-project-automation github-project-automation bot moved this from Ready to Done in JSR Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant