generator icon indicating copy to clipboard operation
generator copied to clipboard

feat: add `$$operation$$` file template

Open lukas-mertens opened this issue 1 year ago • 4 comments

Description

I added $$operation$$ as a file template.

Related issue(s)

#1116

lukas-mertens avatar Feb 08 '24 21:02 lukas-mertens

@jonaslagoni I see that you introduced the v3 support. Does it make any sense what I am suggesting or am I missing something?

lukas-mertens avatar Feb 16 '24 12:02 lukas-mertens

@jonaslagoni I don't think we make it clear in docs what is the file templates alternative in react, how to do it

derberg avatar Mar 11 '24 13:03 derberg

@derberg well no I dont think we have a "coming from Nunjucks to React guide" 🤔

jonaslagoni avatar Mar 11 '24 13:03 jonaslagoni

@jonaslagoni yeah, to be honest I did not recall file templates are actually useful for nunjucks only 😄

we have at least comparizon from the perspective of "template for templates". So we see file templates in use in https://github.com/asyncapi/template-for-generator-templates/tree/nunjucks/template/schemas in times of nunjucks and then after conversion to react https://github.com/asyncapi/template-for-generator-templates/blob/master/template/schemas/schema.js

just to be sure, @lukas-mertens what templating engine are you using?

derberg avatar Mar 19 '24 08:03 derberg

@derberg Yeah, I am using the old one. I didn't see it in any documentation that a new one exists and I was building my template based on https://github.com/asyncapi/dotnet-nats-template/tree/master

I didn't know it is that outdated back then. It would be really nice to have a few reference-implementations based on the new api version and new renderer

lukas-mertens avatar Mar 19 '24 09:03 lukas-mertens

actually https://github.com/asyncapi/dotnet-nats-template/tree/master runs on new engine, the react one

also in docs that talk about template development we reference this template example implementation -> https://github.com/asyncapi/template-for-generator-templates

is the source code of your template somewhere available?

my assumption is you use react so you do not need file templates. Have a look at examples I shared in previous comment and lemme know

derberg avatar Mar 25 '24 13:03 derberg

@lukas-mertens hey, did you have a chance to have a look at it?

derberg avatar Apr 11 '24 14:04 derberg

closing this PR

we should not add more features to Nunjucks.

and for React - functionality is already in place - we just need to properly document it -> https://github.com/asyncapi/generator/issues/1199

derberg avatar Apr 24 '24 09:04 derberg