-
-
Notifications
You must be signed in to change notification settings - Fork 534
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 package.json exports for ts-node/register
#1026
Conversation
Also, if you’re interested nodejs/node#33074 contains proposed wording for Node’s ESM docs that would warn about this :) |
3883721
to
5806ede
Compare
Commit f6cd5d4 broke `require('ts-node/register')` because `exports:` provides an *exclusive* list of possible entry points, and makes importing through other entry points impossible. In particular, this breaks node-tap with TypeScript support. Refs: https://medium.com/@forbeslindesay/is-promise-post-mortem-cab807f18dcc
5806ede
to
403f88a
Compare
In the future, we might tweak our tests to be more E2E-style, so we |
@cspotcode Just fyi, it looks like there is actually an Easy Way Around This™ that just needs to be documented: https://twitter.com/MylesBorins/status/1257058330457133058 |
@addaleax thanks, yeah, that seems to work. So I guess each key in the Looks like the proper exports declaration for us is:
|
@cspotcode I’m not an expert here either, but that’s how I would read https://nodejs.org/api/esm.html#esm_subpath_exports, yes. 👍 |
Commit f6cd5d4 broke
require('ts-node/register')
becauseexports:
provides an exclusive list of possible entry points,and makes importing through other entry points impossible.
In particular, this breaks node-tap with TypeScript support.
Refs: https://medium.com/@forbeslindesay/is-promise-post-mortem-cab807f18dcc
@cspotcode Would be cool to see a release very very soon in order to un-break CI for lots of people :)