moleculerjs / moleculer-cli

:herb: Command line tool for Moleculer
http://moleculer.services/docs/moleculer-cli.html
MIT License
48 stars 28 forks source link

add raw-helper handlebars helper to init #64

Closed Karnith closed 2 years ago

Karnith commented 2 years ago

add raw-helper from handlebars to init so that complex templates that already use {{}} in their code, like vue templates, will work with init and preserve the code unchanged.

usage:

{{{{raw-helper}}}}
{bar}
{{{{/raw-helper}}}}

will produce {bar} instead of throwing an exception when creating a project from a template using {{}} in it's codebase.

intech commented 2 years ago

@Karnith Thanks, add tests for this helper, please.

Karnith commented 2 years ago

@intech So how would I do that? I don't see any tests for the other init handlebar helpers in repo to base a test on? In fact, I don't see any tests for init in repo at all. Am I missing something?

intech commented 2 years ago

@Karnith You are right, and it seems that we have this project isn't covered with tests completely :raised_eyebrow:

Karnith commented 2 years ago

@intech If it helps any to get this approved, the raw-helper is native to handlebars library. I just added it as a register as specified on the handlebars website here raw-blocks. If you need an example of how it works, I use it with my moleculer template so that handlebars will produce the correct code in vue templates provided as optional frontend with the template - line 20 of vue template file