electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.5k stars 519 forks source link

Replace `ts-node` with `tsx` or add support to `tsx` #3676

Open rtritto opened 2 months ago

rtritto commented 2 months ago

Pre-flight checklist

Problem description

Related to ts-node, tsx only loses type checking and gain other features.

Source: https://github.com/privatenumber/ts-runtime-comparison

Proposed solution

Replace ts-node with tsx (this will fix #3609)

Alternatives considered

Add support to tsx

Additional information

Close #3609 if ts-node is replaced with tsx

rtritto commented 1 month ago

tsx can replace rechoir (missing ESM support https://github.com/electron/forge/issues/3671#issuecomment-2365167266) and ts-node dependencies. tsx handles the preparation and running of ESM/TypeScript modules out of the box (manual setup preparations, like rechoir.prepare, are no longer needed). So files in ESM/TypeScript format can directly import or require.

FYI @caoxiemeihao @erickzhao @MarshallOfSound