Version only suggests major bump in independent mode

オープン
#3,941 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
node.js, typescript
領域
release

調査の方向性

提供された lerna.json、workspace レイアウト、コミットシーケンスを使って、まず問題を再現します: breaking release を確認し、その後、タグ v2.0.0 の後に fix のみの release が行われることを確認します。independent モードと Conventional Commits における lerna version のフローを追跡します; 完了条件は、fix のみの変更が影響を受ける package に対する patch の引き上げを示唆することです。

索引モデルが issue の本文から書いたものです。

説明

type: bug

Current Behavior

I'm having some tests with Lerna to check if we can easily use it on our monorepo project (ionic frontend + nestJS backend as a main gateway and 17 independent microservices).
So far, everything seemed to be working as expected with conventional commits until I performed a major update test.
Since then, Version only suggests a major bump for all changed packages, even if the release only contains a 'fix' commit.

My Git logs :
Capture d’écran 2024-01-26 à 15 58 56

Lerna version bump suggestion :
Capture d’écran 2024-01-26 à 16 03 25

As we can see, I only committed a fix for the chatbot microservice since the last release (tag v2.0.0), but 'version' suggests a major bump for the impacted microservice (3.0.0 instead of 2.0.1)

Expected Behavior

Suggest a patch bump

Steps to Reproduce

  1. Configure a mono repo project with npm workspaces
  2. Configure lerna version with independent mode, noPush and noGitTagVersion
  3. Do a commit with a breaking change
  4. Execute lerna version
  5. Check that version suggests a major update and confirm
  6. Manually commit the release and create new tag
  7. Do a commit with a fix
  8. Execute lerna version
  9. Check the lerna suggestion (should be a patch)
Configuration
lerna.json

{
  "$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json",
  "npmClient": "npm",
  "version": "independent",
  "packages": [
    ".",
    "user-frontend/",
    "user-backend/main/",
    "user-backend/microservices/*"
  ],
  "ignoreChanges": [
    "**/CHANGELOG.md",
    "**/node_modules/**",
    "**/package.json",
    "**/*.md"
  ],
  "command": {
    "version": {
      "conventionalCommits": true,
      "push": false,
      "gitTagVersion": false,
      "gitRemote": "ul-origin",
      "allowBranch": [
        "test-lerna"
      ],
      "message": "chore(release): publish new release",
      "syncWorkspaceLock": true,
      "changelogPreset": "angular"
    }
  }
}

project directory

multi/
├── CHANGELOG.md
├── lerna.json
├── package.json
├── ...
├── user-backend/
│	├── ...
│	├── main/
│	│	├── ...
│	│	├── CHANGELOG.md
│	│	└── package.json
│	└── microservices/
│		├── microservice-1/
│		│	├── ...
│		│	├── CHANGELOG.md
│		│	└── package.json
│		├── ...
│		└── microservice-17/
│			├── ...
│			├── CHANGELOG.md
│			└── package.json
└── user-frontend/
	├── ...
	├── CHANGELOG.md
	└── package.json

main package.json

{
  "name": "multi",
  "version": "2.0.0",
  "description": "",
  "author": "",
  "engines": {
    "node": ">=16"
  },
  "private": true,
  "license": "CECILL-2.1",
  "workspaces": [
    "user-backend/main",
    "user-backend/microservices/*",
    "user-frontend"
  ]
}

Environment
主要言語
TypeScript
スター
36k
フォーク
2.3k
平均マージ
2日 6時間
マージ済み PR(30日)
54

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

lerna/lerna のほかの issue

lerna/lerna の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。