Lerna updates all packages with every publish
See original GitHub issueExpected Behavior
Lerna should only update packages that have changed. From the README:
When you run lerna publish, if a module has been updated since the last time a release was made, it will be updated to the new version you’re releasing. This means that you only publish a new version of a package when you need to.
Current Behavior
Instead of only updating packages that have changed, lerna updates every package with every change.
Both lerna updated
and lerna changed
return the correct result. Changing only a single package only displays changes from that package and packages that depend on that package.
Steps to Reproduce (for bugs)
- Clone this repository: https://github.com/zposten/lerna-all-update
- On the master branch, run
lerna updated
orlerna changed
. Notice that only two@test/checkbox
and the one package that depends on checkbox are shown to be updated (this is correct behavior). - Now run
lerna publish
, choose “patch”, and see that it lists every package in the repository as changed, when only two packages should have changed:
Changes:
- demo: 0.0.19 => 0.0.20 (private)
- @test/button: 0.0.19 => 0.0.20
- @test/card: 0.0.19 => 0.0.20
- @test/checkbox: 0.0.19 => 0.0.20
- @test/components-web: 0.0.19 => 0.0.20
- @test/date-picker: 0.0.19 => 0.0.20
- @test/form-field: 0.0.19 => 0.0.20
- @test/global: 0.0.19 => 0.0.20
lerna.json
{
"version": "0.0.19",
"packages": [
"packages/*"
],
"npmClient": "yarn",
"useWorkspaces": true
}
Context
Your Environment
Executable | Version |
---|---|
lerna --version |
3.20.2 |
npm --version |
6.4.1 |
yarn --version |
1.17.3 |
node --version |
v10.15.3 |
OS | Version |
---|---|
macOS Mojave | 10.14.6 |
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (11 by maintainers)
Top 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 >Lerna always lists all packages ready to publish when running ...
the step which I run lerna updated in my github actions workflow always tells/lists me all the package are available to publish which...
Read more >How to deploy only changed packages in a Lerna Monorepo
Deploy only changed packages. The only command you need to know is “lerna run” , it simply runs an npm script in each...
Read more >@lerna/version - npm
When run, this command does the following: Identifies packages that have been updated since the previous tagged release. Prompts for a new version....
Read more >Salable Tech Blog 4; How to version all packages ...
Version packages synchronously in a monorepo with Lerna ... But because we're not publishing any parts of the monorepo, it's largely a void ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looking at your
lerna.json
:I noticed there are no
ignoreChanges
field. For example, myself, I use:Please try to add copious
ignoreChanges
(addpackage.json
and changelog and anything else you can imagine, anything that could theoretically mutate during publishing) and let us know how it went.I’d rule out
ignoreChanges
first.So are you saying that the README section I quoted above is incorrect?