Closed dsherret closed 7 years ago
I'm going to create a new library for doing this that will mirror the typescript compiler almost exactly, but make it really simple to use. This will mean that I can reuse a lot of code in the typescript compiler (like for writing). I've learned a lot creating this library that will help make doing that a lot better and way more powerful. I believe I could then use that library within this library, but I'll have to see how it goes...
Yup. Not doing. Created ts-simple-ast from this issue. Focusing dev effort there.
With TypeScript exposing their transformation API, I believe it's possible to now have this library manipulate the underlying AST and create nodes with the typescript compiler. This would have lots of benefits.
I believe the only drawback is that I would have to hide the arrays like
fileDefinition.classes
and instead create something likefileDefinition.getAllClasses()
. Then allow passing in a definition tofileDefinition.addClass(classDef)
in order for everything to be properly set on the underlying AST.