generator
generator copied to clipboard
feat: add `compile` option to enable rerun of transpilation for react templates
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
Related issue(s) Related to #521
which added this functionality
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
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
flagfalse
you run html template generation with debug flag console.log message should contain something aboutBabel
- with
compile
flagtrue
you run html template generation with debug flag console.log message should not contain something aboutBabel
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 ifcompile
istrue
makes sense?
looks alright
@utnim2 ok then, ping me when ready for another review
@utnim2 do you continue with this one?
@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