standard-version icon indicating copy to clipboard operation
standard-version copied to clipboard

version heading should use h2 level

Open NateScarlet opened this issue 6 years ago • 17 comments

image

image

NateScarlet avatar Mar 28 '19 03:03 NateScarlet

I believe it was fixed by https://github.com/conventional-changelog/conventional-changelog/pull/237. Are you on the latest version?

stevemao avatar Mar 29 '19 05:03 stevemao

+-- [email protected]
| +-- [email protected]
| | +-- [email protected] deduped
| | +-- [email protected] deduped
| | `-- [email protected]
| |   `-- [email protected] deduped
| +-- [email protected]

NateScarlet avatar Mar 29 '19 05:03 NateScarlet

Found duplicate with #208

NateScarlet avatar Mar 29 '19 05:03 NateScarlet

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?

jcornaz avatar Jul 31 '20 14:07 jcornaz

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)

tonai avatar Oct 13 '20 09:10 tonai

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

tonai avatar Oct 13 '20 09:10 tonai

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 ?

tonai avatar Oct 13 '20 14:10 tonai

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.

weareoutman avatar Nov 02 '20 03:11 weareoutman

Hi ! I have the same problem !

Is it fixed ? Thanks !

ghost avatar Mar 02 '21 18:03 ghost

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

NateScarlet avatar Mar 09 '21 05:03 NateScarlet

Any updates about that ? thanks !

ghost avatar Apr 02 '21 13:04 ghost

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:

  1. Prettier automatically SILENTLY REMOVES backslash symbol from string!
  2. 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 avatar Apr 21 '21 10:04 amokmen

@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).

image

NateScarlet avatar Apr 21 '21 10:04 NateScarlet

@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 :)

amokmen avatar Apr 21 '21 10:04 amokmen

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

josteph avatar Jul 04 '21 03:07 josteph

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"
  }

zavoloklom avatar Jul 12 '21 13:07 zavoloklom

What about this?

ciltocruz avatar Jun 07 '22 18:06 ciltocruz