fastify / fastify-autoload

Require all plugins in a directory
MIT License
333 stars 67 forks source link

feat: add support for `tsimp` #410

Closed stuft2 closed 2 months ago

stuft2 commented 2 months ago

Adds support for loading TypeScript plugins via tsimp.

Due to the fact that Node.js versions older than v20 are no longer supported in Fastify v5, I chose not to implement support for the alternate loader script (i.e. --loader=tsimp/loader) that tsimp provides.

[!CAUTION] tsimp currently has an open issue and corresponding PR to fix a bug limiting TypeScript support to version 5.5 or earlier (the latest version of TypeScript is v5.6.2). I'm happy to wait on this PR until the tsimp bug is fixed, at which point I will update the TypeScript and tsimp versions.

Checklist

stuft2 commented 2 months ago

Would you rather wait for tsimp to fix their typescript bug before merging or does it not matter to you since it's a dev dependency?

Uzlopak commented 2 months ago

Imho irrelevant for us if the bug is fixed or not.

i never heard of tsimp, so i let others decide if it is relevant or not. But codewise i think it is acceptable.

mcollina commented 2 months ago

Tests are passing, this can land