-
Notifications
You must be signed in to change notification settings - Fork 16
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
ts-node improvements for ava projects? #29
Comments
Hi @cspotcode, that's great to hear! It'd be great to add What would be your ideal integration for both CJS and ESM outputs? |
Interesting, what is the motivation for #12? Is it to leverage incremental compilation or to support project references? Or is it to make sure typechecking output behaves identically to If ava launches workers with However, to truly match |
For me personally, I run
Sounds like one feature we need is the ability to configure a loader. Do you know if this can be done programmatically? Presumably setting the environment variable programmatically is fine, as long as that's done before any loader code is loaded?
This current behavior is more suited to our use case here though. One open question I have with #12 is where those diagnostics go when they're emitted during a test run. |
I can pick this up once I'm done with #12 ❤️ |
Here's a text of what happens if compilation fails
|
https://nodejs.org/api/cli.html#cli_experimental_loader_module
I'm not 100% sure, but I doubt this :( I think we'll have to pass the |
Correct, today it cannot be done programmatically. I believe that node should add this feature, and hopefully pressure from projects like ours will encourage them to do so. |
Another wrinkle is that, today, However, node is investigating moving the ESM loaders into another thread. When they do that, it may or may not break some workflows. Just something to be aware of. It's one of the reasons I keep warning users that native ESM loader stuff is experimental. |
I've been revamping ts-node's documentation. It's still very much a work-in-progress, but I've added a "Recipes" section inspired by yours and added a page for Ava. https://typestrong.org/ts-node/docs/recipes/ava I realize this duplicates information across Ava's and ts-node's documentation, but I figure it's better for users. Let me know if you have any corrections. |
We could add a provider feature in AVA itself, so that, from here, you could configure a Node.js argument for the child process / worker thread that the tests are run in. Given the highly experimental nature we could name this
That's great! |
Is there a recipe for using |
@vjpr You want to combine ts-node's |
I came across avajs/ava#1109 which lists several criticisms of ts-node and predates some recent improvements.
For example, ts-node has since implemented an ESM loader which I believe can handle #5.
#20 -- source-map-support -- is enabled out-of-the-box in ts-node.
We allow all configuration to be placed in your tsconfig.json.
And we have an
swc
integration that will be in the next release, allowing users to opt-in to much faster compilation than we can get with babel or typescript.All that to say, if you have time, I would love to talk about any other bugs , limitations, or inconveniences that your users hit with ts-node. At the very least it will give me some useful data points for improving ts-node. A big goal of mine is to make TS and node tooling feel cleaner, easier, and require less boilerplate.
If you have any thoughts, please let me know.
The text was updated successfully, but these errors were encountered: