lerna / lerna/lerna

Lerna does not bump my pre-releases after subsequent commits in the same PR.

Open
#3,735 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
TypeScript
Stars
36.1k
Forks
2.3k
Avg merge
1d 4h
Merged PRs (30d)
50

Description

Current Behavior

I use the default next branch for my prerelease(s).

Suppose I have 3 independent packages:

  1. @pkg/foo:0.1.0
  2. @pkg/bar:0.1.0 - Has dependency "@pkg/foo": "workspace:*"
  3. @pkg/baz:0.1.0- Has dependency "@pkg/foo": "workspace:*"

With my next prerelease with patch bump. As part of my first commit in my PR (next), I do a change to all packages. The bump is done accordingly:

  1. @pkg/foo:0.1.1-next.0
  2. @pkg/bar:0.1.1-next.0
  3. @pkg/baz:0.1.1-next.0

However, in my 2nd commit in the same PR, if I do another commit that only changes @pkg/baz. The bump only happens to that package (i.e. @pkg/baz:0.1.1-next.1), but it's dependant package @pkg/foo will revert back to its original version (i.e. @pkg/foo:0.1.0). Therefore, when I try to install pnpm add @pkg/baz:0.1.0@next, I get the following error:

 ERR_PNPM_NO_MATCHING_VERSION  No matching version found for @pkg/foo:0.1.0

This error happened while installing the dependencies of @pkg/baz:0.1.1-next.1

The latest release of @pkg/foo is "0.1.1-next.0".

Expected Behavior

The expected outcome should be to use the latest pre-release next version for its dependent packages as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the scenario with the three independent packages, a next prerelease, and two commits in the same pull request. Trace Lerna's prerelease and dependent-package versioning flow; done means the second bump preserves the latest prerelease versions for dependencies and pnpm add can install the resulting package.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.