lerna / lerna/lerna

null version when using conventional commits and independent versions

Open
#2,790 3 comments 2 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

Expected Behavior

Each package will have a new package version correctly set based on the conventional commit history and previous package versions

Current Behavior

All package versions are set to null when using conventional commits

Steps to Reproduce (for bugs)

  1. Set up a project with conventional commits and independent package versioning
  2. Use the Lerna configuration below
  3. Create some packages
  4. Update the package versions by running npx lerna version
  5. The changelogs and tags should be created for all packages, but the version number is null
lerna.json

{
  "command": {
    "publish": {
      "bump": "from-git",
      "registry": "https://npm.pkg.github.com",
      "yes": true,
      "verifyAccess": false
    },
    "version": {
      "conventionalCommits": true,
      "ignoreChanges": [
        "package.json",
        "package-lock.json",
        "**/*.md"
      ],
      "message": "chore(release): update package versions",
      "private": false,
      "push": false
    }
  },
  "packages": [
    "packages/*"
  ],
  "version": "independent"
}

Context

I have a project with multiple utility packages, which have independent versions. The project uses conventional commits and independent package versioning. Initially I was able to get around the issue by manually setting a releave version (e.g. lerna version 1.0.0), but now that the package versions are starting to diverge I can no longer do this as it will apply the same version to all packages.

Your Environment

Executable Version
lerna --version 3.22.1
npm --version 7.0.8
yarn --version N/A
node --version v15.1.0
OS Version
MacOS Catalina 10.15.7

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

Start by reproducing the issue with the provided lerna.json and npx lerna version, using the listed Node and Lerna versions. Trace the conventional-commit and independent-version calculation from that entry point. Done means each package receives a non-null version based on its commit history and previous version.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.