fkling / astexplorer

A web tool to explore the ASTs generated by various parsers.
https://astexplorer.net/
MIT License
6.21k stars 739 forks source link

feat: add astx transformer #683

Open jedwards1211 opened 1 year ago

jedwards1211 commented 1 year ago

This is self-promotion, since I'm the author of astx. It's a sweet JS/TS transformer for doing pattern-based structural search and replace.

Note: I made transformerMiddleware pass the parser and parserSettings to the transform function...the way it was being done didn't make a whole lot of sense, for instance with jscodeshift it templates the selected parser into the transform code at first, but you can still select a different parser afterwards in astexplorer, making the two out of sync. To me it makes more sense for the transformer to always use the parser and settings selected in the workbench (if applicable?)

Thanks so much for all the work you've done on astexplorer! Without it I may never have gotten into writing codemods.

jedwards1211 commented 1 year ago

Oh it doesn't automatically rerun the transformer when I select a different parser in the workbench. Need to make it do that.