Skip to content

Build: lerna publish upgrades from 0.x.y to 1.0.0 for breaking changes #1068

@raymondfeng

Description

@raymondfeng

We have conventionalCommits configured to be true in lerna.json and use 0.x.y versioning for packages. If a commit log contains BREAKING CHANGE, lerna publish prompts the new versions as follows:

Changes:
 - @loopback/authentication: 0.1.1 => 1.0.0
 - @loopback/boot: 0.1.1 => 1.0.0
 - @loopback/build: 0.1.1 => 1.0.0
 - @loopback/cli: 0.1.2 => 0.1.3
 - @loopback/context: 0.1.1 => 1.0.0
 - @loopback/core: 0.1.1 => 0.2.0
 - @loopback/example-getting-started: 0.1.1 => 0.2.0 (private)
 - @loopback/example-hello-world: 0.1.1 => 0.1.2 (private)
 - @loopback/example-log-extension: 0.1.1 => 0.1.2 (private)
 - @loopback/example-rpc-server: 0.1.1 => 1.0.0 (private)
 - @loopback/metadata: 0.1.1 => 0.1.2
 - @loopback/openapi-spec-builder: 0.1.1 => 0.1.2
 - @loopback/openapi-spec: 0.1.1 => 0.1.2
 - @loopback/openapi-v2: 0.1.1 => 0.1.2
 - @loopback/openapi-v3-types: 0.1.1 => 0.2.0
 - @loopback/openapi-v3: 0.1.0 => 0.2.0
 - @loopback/repository-json-schema: 0.1.1 => 0.1.2
 - @loopback/repository: 0.1.1 => 1.0.0
 - @loopback/rest: 0.1.1 => 1.0.0
 - @loopback/testlab: 0.1.1 => 0.1.2

We want to upgrade from 0.<x>.<y> to 0.<x+1>.0 instead of 1.0.0.

To work around the issue, we have two options:

  1. Force all modules to be upgraded to the next minor version (0.<x>.<y> to 0.<x+1>.0) by using lerna publish --cd-version minor. For example:
Changes:
 - @loopback/authentication: 0.1.1 => 0.2.0
 - @loopback/boot: 0.1.1 => 0.2.0
 - @loopback/build: 0.1.1 => 0.2.0
 - @loopback/cli: 0.1.2 => 0.2.0
 - @loopback/context: 0.1.1 => 0.2.0
 - @loopback/core: 0.1.1 => 0.2.0
 - @loopback/example-getting-started: 0.1.1 => 0.2.0 (private)
 - @loopback/example-hello-world: 0.1.1 => 0.2.0 (private)
 - @loopback/example-log-extension: 0.1.1 => 0.2.0 (private)
 - @loopback/example-rpc-server: 0.1.1 => 0.2.0 (private)
 - @loopback/metadata: 0.1.1 => 0.2.0
 - @loopback/openapi-spec-builder: 0.1.1 => 0.2.0
 - @loopback/openapi-spec: 0.1.1 => 0.2.0
 - @loopback/openapi-v2: 0.1.1 => 0.2.0
 - @loopback/openapi-v3-types: 0.1.1 => 0.2.0
 - @loopback/openapi-v3: 0.1.0 => 0.2.0
 - @loopback/repository-json-schema: 0.1.1 => 0.2.0
 - @loopback/repository: 0.1.1 => 0.2.0
 - @loopback/rest: 0.1.1 => 0.2.0
 - @loopback/testlab: 0.1.1 => 0.2.0
  1. Disable conventionalCommits when breaking changes need to be published and manually select the versions package by package.

  2. Do not use BREAKING CHANGE in commit logs since feat(...) will upgrade to the next minor version ( 0.<x>.<y> to 0.<x+1>.0) anyway.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions