Closed samchon closed 1 year ago
It looks related to https://github.com/microsoft/TypeScript/issues/51542 probably not an issue of ttypescript
4.9.4 is now out FWIW
TS has been updated to 4.9.4, but transformation is not working yet.
How about you @nonara ?
@DanielRosenwasser May I ask you one thing?
Looking at code of this ttypescript
, it transforms TS source code by replacing ts.createProgram
function. But after TS 4.9 patch, the transformed.createTransform
function never be called. Is there any criticial change on TS not to call the createProgram
function or overwrite the createProgram
function variable when compiling?
@samchon I'll take a look tomorrow and work it out.
@cevek I just analyzed what makes ttypescript
broken for a while. Hope my analysis to be helpful.
I'd tried hard coding special editing on tsc.js
of TS and succeeded to transforming by modifing performCompilation
function to be exported function. However, the performCompilation
function is not exported member, but an internal function of executeCommandLine.ts file.
Therefore, to fix this bug occured after TS 4.9 update, ttypescript
should update not only createProgram
file, but also executeCommandLine
function too.
@DanielRosenwasser Is it possible to change the executeCommandLine
function provides an additional and optional prarameter that creating the Program
class instance? Or can you re-patch the TS 4.9 (maybe 4.9.5) that only wrapping ts.createProgram
can be working again? I think it would be really helpful for @cevek, developer of this ttypescript
project and the others using this ttypescript
library.
@samchon Libraries like tts and ts-patch augment the TypeScript libraries. It isn't the TS team's responsibility to modify the compiler to support our tools. The functions we modify are internal and not a part of public API, so it's on us to keep up with changes.
If this is an issue, I'll have ts-patch working later today. Unfortunately, I don't have access to modify this library, so you'll have to wait on @cevek to follow suit.
I will update in this thread when I've investigated the issue.
No solution yet for ts5, downgrading to 4 works
Latest ts-patch rc (beta) supports ts v5, and I added some functionality so you don't have to do anything major to migrate from ttypescript. Just install and use tspc
instead of ttsc
Here's more detail:
ts-node -C ttypescript
works, butttsc
is not working.code transformation does not working.