dsherret / ts-type-info

TypeScript AST and code generator [Deprecated]
MIT License
94 stars 8 forks source link

Move towards manipulating underlying AST #229

Closed dsherret closed 7 years ago

dsherret commented 7 years ago

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 like fileDefinition.getAllClasses(). Then allow passing in a definition to fileDefinition.addClass(classDef) in order for everything to be properly set on the underlying AST.

dsherret commented 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...

dsherret commented 7 years ago

Yup. Not doing. Created ts-simple-ast from this issue. Focusing dev effort there.