pinojs / thread-stream

A streaming way to send data to a Node.js Worker Thread
MIT License
229 stars 23 forks source link

fix(worker): Fix import error when using pkg with node v20 #144

Closed nagyszabi closed 5 months ago

nagyszabi commented 6 months ago

Fixes: #143

mcollina commented 6 months ago

A test would be highly welcomed, if you can give it a shot. You might want to use spawn to execute pkg.

nagyszabi commented 6 months ago

I've created a test inside test/pkg which packages a tap test into an executable.

My reasoning behind this is that the test should run when packaged into an executable. And then I run each executable and test if there were no errors in stderr.

This is done for node 14, 16, 18 and 20, because I saw that these were used by github actions.

(I tested it on linux, but I'll fix the windows and macos tests as well)

nagyszabi commented 6 months ago

Hello there!

I managed to fix the windows and macos tests, but I seem to be having some issues with the package managers. For example the yarn test says that it requires at least node18 to run, so I think it's not related to my changes.