99x / react-scaffolder

:zap: Scaffolding tool for React
MIT License
44 stars 14 forks source link

Template engine #65

Open shapkarin opened 5 years ago

shapkarin commented 5 years ago

I think about to use some JS template engine to generate files. To easily add some new templates for this project.

shapkarin commented 5 years ago

Maybe event some without html tags. And pass there any data to use loop or if statements next.

rajikaimal commented 5 years ago

Can you give an example for a JS template engine?

shapkarin commented 5 years ago

It's just an idea. I'll try it.

shapkarin commented 5 years ago

@rajikaimal something like this https://codesandbox.io/s/rlo9vxqmn4 but with auto newlines

shapkarin commented 5 years ago

I think that this way you can easily create that kind of templates

function TestComponent ({ prop1, prop2, prop3 })

and so on

shapkarin commented 5 years ago

We just need to add indents and new lines somehow. Later I'll research that too.

shapkarin commented 5 years ago

It has new lines and indents. I just didn't saw that in html output. You can check by link

shapkarin commented 5 years ago

@rajikaimal I added prettier to the example. but still not so good because of how it works with empty lines Also I found project that uses that engine