LinkedSoftwareDependencies / Components-Generator.js

⚙️ Generate Components.js component files from TypeScript
13 stars 7 forks source link

AST Parser Observation #84

Open jeswr opened 2 years ago

jeswr commented 2 years ago

I was just having a look at this codebase to get an understanding of how it worked (amazing work as usual btw.)

I noticed that the package you are using to parse and traverse the AST seems to be a little laborious on the user side - I use the package ts-morph a lot of the time when I am doing typescript parsing and codegen, and it already implements a lot of navigation functionality you currently need to do yourself (e.g. it as has .getClasses method to get all the classes in a file).

rubensworks commented 2 years ago

I'm definitely open to an exploration into alternative AST traversal methods. The code is written is such a way that it should be relatively easy to use different libs for that.

However, there are some particularities in our custom AST handling logic, so it might not be that easy to use a different lib.