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 --force modifier (feature request)

See original GitHub issue

TLDR: A flag or modifier to skip checks for looking for lerna packages changes is desirable. Which would allow a version bump to occur regardless of changes or not.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Unlike npm version lerna version has smarts in it which prevent versioning of any bump of any of the underlying packages unless there are real changes.

Now in the node world I agree that this is fine and dandy as most of us like to operate off of master. But by not making this optional it is making it virtually impossible to cleanly create custom SNAPSHOT version number for developers being ruled by a Java overlord.

Example of the problem:

Start at version 0.1.1

# good to go we have a real patch version
yarn lerna version patch

now at 0.1.2

# increment patch to become current SNAPSHOT to make java lead happy
yarn lerna version patch --no-git-tag-version # fails, no changes still on 0.1.2
yarn lerna version ${NEW_VERSION}-SNAPSHOT --no-git-tag-version # fails, no changes still on 0.1.2

Possible solution: Back at 0.1.1

Example of --force:

# good to go we have a real patch version
yarn lerna version patch

now at 0.1.2

# increment patch to become current SNAPSHOT to make java lead happy
yarn lerna version patch --force --no-git-tag-version # 0.1.2
yarn lerna version ${NEW_VERSION}-SNAPSHOT --force --no-git-tag-version # 0.1.2-SNAPSHOT

Apologies if there is a way around this that I missed. But this line check appears to me that there is no way around it.

https://github.com/lerna/lerna/blob/master/commands/version/index.js#L204

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
evocateurcommented, May 14, 2019
4reactions
nmccreadycommented, Aug 1, 2019

I tested

--force-publish?

and it worked perfectly for me. Thank you for the quick fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version and Publish - Lerna
Lerna can increment your package's versions as well as publish your packages to NPM, and it provides a variety of options to make...
Read more >
Automatic versioning in a Lerna monorepo using Github actions
Integrate Lerna in a CI flow to automatically version and publish packages using Github actions. Tagged with lerna, javascript, npm, github.
Read more >
How we automatized our release process into just 3 clicks
It was working and we were able to release new features. ... Generate a new tag and push into origin - npx lerna...
Read more >
how to update sub-dependency with npm and lerna
the package original that require url-parse version ^1.4.3 and I wish to ... but I can't run npm update or npm i since...
Read more >
Contribution Releases | TinaCMS Docs
Build the source files: The source must be compiled, minified, and uglified in preparation for release. Generate CHANGELOGs and Git tags: We use...
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