Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[BUG] inc premajor, preminor, and prepatch do the wrong thing if the version is already a pre-release.

オープン
#751 コメント 37 件 リアクション 6 件 担当者 1 名 GitHub で見る

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

評価

この issue はまだ評価されていません。

説明

Bug Needs Discussion Needs Triage
Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

From the docs:

premajor in one call will bump the version up to the next major version and down to a prerelease of that major version. preminor, and prepatch work the same way.

If we do these steps in isolation (using the internal, "pre" that does the down to a prerelease) we get:

> semver.inc('2.0.0-pre', 'major')
'2.0.0'
> semver.inc('2.0.0', 'pre')
'2.0.0-0'

But if we do premajor

> semver.inc('2.0.0-pre', 'premajor')
'3.0.0-0'
Expected Behavior

premajor et al should "do what it says on the tin", and not jump an extra major/minor/patch.

Steps To Reproduce

No response

Environment

[email protected]

主要言語
JavaScript
スター
5.5k
フォーク
598
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

npm/node-semver のほかの issue

npm/node-semver の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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