-
Notifications
You must be signed in to change notification settings - Fork 40
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
writerOpts: Cannot use readFile to pass a hbs template to writerOpts. #35
Comments
You could try something like There's currently no way to have async logic in the release-it config loading mechanism, other than a global |
@webpro tnx for the hint! That did work. Documented in #36 However, I had some issues with variables. I'm using the Btw, there is quite a number of packages involved for writing the changelog! This is my full
This is my template:
|
Where to find a tutorial on writing this template? |
@WumaCoder I didn't find a tutorial for that but read through the available options https://github.com/release-it/conventional-changelog/blob/master/README.md to configure conventional-commits and copy pasted an existing template and tweaked it via trail and error and reading source code. But the template syntax is handlebars and you can find info over here: https://handlebarsjs.com/guide/ |
Insead of just passing a string containg the whole template to
writerOpts.commitPartial
I would like to read a template file and pass it's contents to it.I tried with node's async
fs.promises.readFile
method, but failed.I did a top-level await and did set the whole package.json of my project as
{ "type": "module" }
which failed.And I tried the code below, also failing because the commits_template is promise is actuallt not being resolved:
this is my
.release-it.js
config:Maybe release-it needs to await the import of the .release-it.js file?
Or maybe trying to interpret the commitPartial as a path and trying to read it?
The text was updated successfully, but these errors were encountered: