standard-version
standard-version copied to clipboard
version heading should use h2 level


I believe it was fixed by https://github.com/conventional-changelog/conventional-changelog/pull/237. Are you on the latest version?
+-- [email protected]
| +-- [email protected]
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | `-- [email protected]
| | `-- [email protected] deduped
| +-- [email protected]
Found duplicate with #208
It is obviously not solved. (or the poblem came back)
Look at versions 8.0.1 and 8.0.2 in standard-version's changelog: https://raw.githubusercontent.com/conventional-changelog/standard-version/91cd83c35145b733cd2407f106ebe43b5ce3edc5/CHANGELOG.md
@stevemao Can you reopen the issue?
I just test this package I found really great, but I think the header problem is still present.
See https://github.com/tonai/react-deploy/commit/9057ee81875c4972d26da658c75c3828156ab99e
I have ### 0.1.1 (2020-10-13) but it should be ## 0.1.1 (2020-10-13)
Ok I miss the fact that for the first release you should run npm run release -- --first-release.
It looks better: https://github.com/tonai/react-deploy/commit/797d7240ec3c5df3b6897fa7f0e9c7a0b7513748
It still looks a little odd for patch releases: https://github.com/tonai/react-deploy/commit/b44911e45ca9861df4cc191aa116e5381e8c8de0
It is ok for minor release: https://github.com/tonai/react-deploy/commit/2cdadf4acff8940bc648e6570fe8be32fdbafa79
Is it something that is wanted ?
For the example below, the Bug Fixes heading should be a subheading of the release 0.1.2, but now they are at the same level. This also caused bots like renovatebot failed to parse the changelog.
### 0.1.2
### Bug Fixes
* some fixes.
Hi ! I have the same problem !
Is it fixed ? Thanks !
changes that fix this problem is not included in [email protected]
for now, i use a postchangelog script:
sed -r -e 's/^#{1,3} \[/## [/' -i CHANGELOG.md
Any updates about that ? thanks !
sed -r -e 's/^#{1,3} \[/## [/' -i CHANGELOG.md
Spent 2 hours fighting backslash "\" problem!
It's not working if directly included in .versionrc.js as
module.exports = {
scripts: {
postchangelog: "sed -r -e 's/^#{1,3} \[/## [/' -i CHANGELOG.md",
},
};
Because there are 2 problems arise:
- Prettier automatically SILENTLY REMOVES backslash symbol from string!
- NodeJS 14.16.0 REPL and standard-version incorrectly works with backslash in string too (removing single backslash or using double backslash if you trying to escape - "\\").
I put this shell-command line into external shell-script file - this exterminated both problems:
#!/bin/bash
# Workaround for buggy behavior
# Change '### [' to '## ['
DIR="./"
sed -r -e 's/^#{1,3} \[/## [/' -i $DIR/CHANGELOG.md
So, now it looks like:
module.exports = {
scripts: {
postchangelog: "./tools/for_standard-version.sh",
},
};
@amokmen
use bash ./tools/for_standard-version.sh if you want be windows compatible (git-bash almost always installed, otherwise it may not run due to some encoding issue).

@NateScarlet I am personally using WSL (Ubuntu) at Windows desktop, so for me all working without adding prefix "bash ".
P. S. As for me - trying "native" Windows-based development is a bad idea in general. There are a lot of problems even in Linux-based development, so multiplying problems with Windows is not helping at all :)
I'm not sure why does conventional changelog template need isPatch treatment here. If somebody could explain the reasoning behind this, then this answers other issues regarding heading level as well.
https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-conventionalcommits/templates/header.hbs#L1
Small addition to @amokmen advise.
There is a problem with that script and MacOS sed: -i may not be used with stdin. So if you want to use script both in Linux and Mac you should do:
"scripts": {
"postchangelog": "if [[ \"$OSTYPE\" == \"darwin\"* ]]; then SEDOPTION=\"\\'\\'\"; fi && sed -i $SEDOPTION -re 's/^#{1,3} \\[/## [/' ./CHANGELOG.md"
}
What about this?