forge icon indicating copy to clipboard operation
forge copied to clipboard

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

Open rtritto opened this issue 1 year ago • 1 comments

Pre-flight checklist

  • [X] I have read the contribution documentation for this project.
  • [X] I agree to follow the code of conduct that this project uses.
  • [X] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

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 avatar Aug 29 '24 20:08 rtritto

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

rtritto avatar Sep 21 '24 15:09 rtritto

would like to see tsx support as well, so that I don't need to have two TS runtimes installed :-)

pano9000 avatar Mar 11 '25 06:03 pano9000