Skip to content
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

Merged
merged 5 commits into from
May 22, 2020
Merged

feat: move template config to package.json #349

merged 5 commits into from
May 22, 2020

Conversation

derberg
Copy link
Member

@derberg derberg commented May 20, 2020

Description

  • .tp-config.json is removed and config should be now done under generator props in the package.json file
  • linter didn't like validateTemplateConfig 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 option

MIGRATION
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

@@ -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);
Copy link
Member Author

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

@derberg derberg requested a review from fmvilas May 20, 2020 14:03
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@fmvilas fmvilas left a 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? 🚀

@derberg derberg merged commit 86a0d35 into asyncapi:master May 22, 2020
@derberg derberg deleted the remove-tp-config branch May 22, 2020 08:48
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.50.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get rid of .tp-config.json and use package.json
3 participants