generator icon indicating copy to clipboard operation
generator copied to clipboard

feat: add `compile` option to enable rerun of transpilation for react templates

Open Gmin2 opened this issue 3 months ago • 14 comments

Description

The PR introduces a new option compile in the Generator class contructor which is by default false ,by default the React template files are not transpiled. When setting the compile options to true the transpilation process takes place.

I have also added/updated test for it. Below are the result

image

Related issue(s) Related to #521

image

which added this functionality

Gmin2 avatar Apr 04 '24 06:04 Gmin2

ok, we need to add a proper new integration test here, without proper test, feature development will be based on just our intuition

there are some integration tests already, that use https://github.com/asyncapi/html-template template

we just need another test, also using https://github.com/asyncapi/html-template but fixed to use version 2.3.0 where __transpiled folder was added to package.

there are 2 test scenarios:

  • with compile flag false you run html template generation with debug flag console.log message should contain something about Babel
  • with compile flag true you run html template generation with debug flag console.log message should not contain something about Babel

Why? We know html-template as some big files and babel warns about it in logs, when transpilation runs. Now, we also know that we do not need to run transpilation as __transpiled dir is there. This is why we can, with such integrations test, confirm if transpilation is triggered only if compile is true

makes sense?

looks alright

Gmin2 avatar Apr 11 '24 08:04 Gmin2

@utnim2 ok then, ping me when ready for another review

derberg avatar Apr 16 '24 10:04 derberg

@utnim2 do you continue with this one?

derberg avatar Apr 22 '24 08:04 derberg

@utnim2 do you continue with this one?

currently i am having my semester exam, will continue working on it after my exams are over cc @derberg

Gmin2 avatar Apr 22 '24 08:04 Gmin2