TypeStrong / ts-node

TypeScript execution and REPL for node.js
https://typestrong.org/ts-node
MIT License
12.75k stars 529 forks source link

Fix swc issues #2062

Closed cspotcode closed 10 months ago

cspotcode commented 10 months ago

Issues fixed

The latest version of swc renamed some options. Also, a new option is necessary to tell swc to emit import assertions with the assert keyword instead of with. This effectively requires a newer version of SWC, so I bumped the minimum required version

ts-node was not passing the correct useDefineForClassFields value to swc to match the user's tsconfig / tsc's behavior.

ts-node was erroring when custom transpilers did not return a sourcemap.

ts-node did not pass jsxImportSource to swc

swc 1.3.85 now forbids irrelevant module. options. For example, the noInterop option has no effect if module.type == 'es6', and 1.3.85 now raises an error if you try to pass module: {type: 'es6', noInterop: true}. ts-node now conditionally passes those options to avoid this error

Tickets resolved

Fixes #2059 Fixes #2056 Fixes #2051 Replaces #2057 Replaces #2049 Replaces #1968 Fixes #1996 Replaces, fixes #1852

codecov[bot] commented 10 months ago

Codecov Report

Merging #2062 (f2ef29b) into main (9a2a275) will increase coverage by 0.19%. The diff coverage is 88.23%.

Files Changed Coverage Δ
src/transpilers/swc.ts 82.60% <83.33%> (+0.79%) :arrow_up:
src/ts-internals.ts 48.96% <90.00%> (+3.03%) :arrow_up:
src/index.ts 80.34% <100.00%> (ø)

... and 3 files with indirect coverage changes

RobinTail commented 10 months ago

@cspotcode , please release

jacobpgn commented 9 months ago

Hey @cspotcode - thanks for working on this change! Do you know when it'll be possible to ship a new release? I couldn't see any workflow or doc on the process, but please let me know if I can help at all.