dhoulb / multi-semantic-release

Proof of concept that wraps semantic-release to work with monorepos.
BSD Zero Clause License
203 stars 36 forks source link

Incorrect replacement of `workspace:^` drops caret in resolved dependency version #133

Closed franky47 closed 1 year ago

franky47 commented 1 year ago

Considering the following packages:

{
  "name": "foo",
  "dependencies": {
    "bar": "workspace:^"
  }
}
{
  "name": "bar",
  "version": "0.0.0-semantically-released"
}

When releasing foo, and with a Git tag context resolving to 1.2.3 for bar, I was expecting the workspace: fix in #128 to have resolved foo's package to:

{
  "name": "foo",
  "dependencies": {
    "bar": "^1.2.3"
  }
}

Instead, the version for bar is 1.2.3, without the caret.

This happens because the version returned by resolveNextVersion is the last case, which does not make use of the workspace-aware fix: https://github.com/dhoulb/multi-semantic-release/blob/2d083e0c28f0d81a31e140c9bd58407dc50d6f44/lib/updateDeps.js#L276

franky47 commented 1 year ago

I did not read the documentation well enough, it seems fair that override behave this way, I can get the behaviour I'm looking for with --deps.bump=satisfy.