-
-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: move template config to package.json #349
Conversation
@@ -166,9 +162,9 @@ class Generator { | |||
this.templateContentDir = path.resolve(this.templateDir, TEMPLATE_CONTENT_DIRNAME); | |||
this.configNunjucks(); | |||
await this.loadTemplateConfig(); | |||
validateTemplateConfig(this.templateConfig, this.templateParams, asyncapiDocument); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the order of calling validation and removed it from here https://github.com/asyncapi/generator/pull/349/files#diff-b58e2f1cee2acff55355343774e6d576L646 as I could not come up with an explanation why we were calling validation twice.
also, it is no longer async as I think it should never be
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! I think this is the last breaking change before v1 right? 🚀
🎉 This PR is included in version 0.50.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
.tp-config.json
is removed and config should be now done undergenerator
props in thepackage.json
filevalidateTemplateConfig
as too complex function. Because I was working on config here so I took the liberty to refactor it and move to a separate file + add tests that cover every validation optionMIGRATION
This is a breaking change. Migrate by removing current config file and moving its content to
package.json
and bumping version of supported generator to the one released with this PR.Example -> asyncapi/nodejs-template#15
Related issue(s)
Resolves #228