question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lerna version/publish creates duplicate versions + extra whitespace in change log

See original GitHub issue

Every Git commit by Lerna after lerna publish has a duplicate version in the change log, each with 4 extra newlines that follow.

Expected Behavior

  • Notes for a particular version should only appear once in a change log.
  • No additional whitespace under each version.

Current Behavior

CHANGELOG.md

## [0.1.1](https://github.com/adobe/generator-tsx/compare/v0.1.0...v0.1.1) (2019-05-29)

**Note:** Version bump only for package generator-tsx





## [0.1.1](https://github.com/adobe/generator-tsx/compare/v0.1.0...v0.1.1) (2019-05-29)

**Note:** Version bump only for package generator-tsx





Travis-CI Build

> generator-tsx@0.1.0 release /home/travis/build/adobe/generator-tsx
> cross-env HUSKY_BYPASS=true lerna publish "--yes" "--git-remote" "pub"
lerna notice cli v3.14.1
lerna info ci enabled
lerna info publish rooted leaf detected, skipping synthetic root lifecycles
lerna info current version 0.1.0
lerna info Looking for changed packages since v0.1.0
lerna info getChangelogConfig Successfully resolved preset "conventional-changelog-angular"
Changes:
 - generator-tsx: 0.1.0 => 0.1.1
lerna info auto-confirmed 
lerna info execute Skipping GitHub releases
lerna info git Pushing tags...
lerna info publish Publishing packages to npm...
lerna info Verifying npm credentials
lerna http fetch GET 200 https://registry.npmjs.org/-/npm/v1/user 545ms
lerna http fetch GET 200 https://registry.npmjs.org/-/org/jedmao/package?format=cli 131ms
lerna info lifecycle generator-tsx@0.1.1~prepublishOnly: generator-tsx@0.1.1
lerna success published generator-tsx 0.1.1
lerna notice 
lerna notice 📦  generator-tsx@0.1.1
lerna notice === Tarball Contents === 
lerna notice 4.3kB  package.json                                                                         
lerna notice 1.1kB  CHANGELOG.md                                                                         
lerna notice 1.1kB  LICENSE                                                                              
lerna notice 4.3kB  README.md                                                                 
lerna notice === Tarball Details === 
lerna notice name:          generator-tsx                           
lerna notice version:       0.1.1                                   
lerna notice filename:      generator-tsx-0.1.1.tgz                 
lerna notice package size:  68.9 kB                                 
lerna notice unpacked size: 208.6 kB                                                               
lerna notice 
lerna http fetch PUT 200 https://registry.npmjs.org/generator-tsx 3646ms
Successfully published:
 - generator-tsx@0.1.1
lerna success published 1 package
Done. Your build exited with 0.

Possible Solution

No idea how to fix this, but it may be an external bug with conventional commits?

Steps to Reproduce (for bugs)

For context, I’m actually using Lerna for a single package.

.travis.yml

deploy:
  - provider: script
    script: lerna publish --yes --git-remote pub
    skip_cleanup: true
    keep_history: true
    on:
      branch: master

lerna.json

{
  "packages": ["."],
  "command": {
    "publish": {
      "allowBranch": ["master"],
      "conventionalCommits": true
    }
  },
  "version": "0.1.1"
}

package.json

  "commitlint": {
    "extends": [
      "@commitlint/config-conventional"
    ]
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  },

Context

I’m automating deploys and change logs, so this is the one thing that’s just not working properly at this point.

Travis-CI Environment

Executable Version
lerna --version 3.14.1
npm --version 6.9.0
node --version 10.16.0
OS Version
Ubuntu 14.04.5 LTS

Project

https://github.com/adobe/generator-tsx

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jednanocommented, Jun 9, 2019

Familiarity. It’s what I use in other projects, but those projects don’t exhibit this same issue. Rather than dick around with a separate tool until it works, I figured I’d use something I already know how to configure.

That said, I’m happy to switch to semantic-release if it fixes my issues.

1reaction
reveltcommented, Jun 12, 2019

Thank you for sharing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

JS monorepos in prod 3: commit enforcement and changelog ...
This time, we run lerna version with the --conventional-commits flag. Basing on the commit types, it proposes the most appropriate version for ...
Read more >
Remove duplicate elements from array, ignoring whitespace
I've tried several methods to remove duplicate elements from an array of strings, but none of them do what I want. Here are...
Read more >
Ability to ignore whitespace changes in the diffs (BB-11120)
I would like to see the option to ignore space changes in the diff viewer as well. It allows us to focus on...
Read more >
Automating package publishing in JavaScript projects
Having to remember to bump the package version for my code releases. ... This creates a lerna.json configuration file in the root of...
Read more >
Difference in whitespace between two files on Linux
I have used vim with :set list on to confirm there was no trailing space at the end of the lines. I also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found