Open fengzilong opened 4 years ago
@fengzilong Actually I am working on one playground to build AST nodes through code for jscodeshift and Glimmer templates here.
https://rajasegar.github.io/ast-builder/
Please let me know this is what you are looking for. Appreciate any PRs or issues.
And thanks for the @babel/template
pointer btw.
For this project, let's hear from @benjamn
Yeah, good job, that's the playground I need, but there are some issues with yours
try this snippet
module.exports = {
components: {
'demo': demo
}
}
the 'demo' becomes j.identifier('undefined')
and it seems not to be usable with es6 export syntax
some suggestion: it will be much better if we can format the code with prettier
thanks for reply @rajasegar-c
@fengzilong Thanks for trying it out and reporting the issues. It's a bug I need to fix and yes formatting needs some work.
Can you give me an example for the ES6 export you were trying, have you tried changing the parser to babel or babylon? Fixed the module.exports and formatting
@rajasegar sorry for my late reply, I just see the notification from github. I tried and ES6 export has been fixed, and formatting works perfectly👍
Write the builders syntax by hand is really tedious, can we provide some package like
@babel/template
or add an online playground to convert the code to builders syntax. It will save us tons of time