Skip to content

Commit

Permalink
fix: version prefix needs to be maintained in newCandidate too
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Nov 14, 2022
1 parent 7ebb59e commit b08cdf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions __snapshots__/node-workspace.js
Expand Up @@ -24,7 +24,7 @@ Release notes for path: node1, releaseType: node
* The following workspace dependencies were updated
* dependencies
* @here/pkgB bumped from 2.2.2 to ^2.2.3
* @here/pkgB bumped from 2.2.2 to 2.2.3
</details>
---
Expand All @@ -49,7 +49,7 @@ exports['NodeWorkspace plugin run appends dependency notes to an updated module
* The following workspace dependencies were updated
* dependencies
* @here/pkgB bumped from 2.2.2 to ^2.2.3
* @here/pkgB bumped from 2.2.2 to 2.2.3
`

exports['NodeWorkspace plugin run combines node packages 1'] = `
Expand Down Expand Up @@ -138,7 +138,7 @@ Release notes for path: node1, releaseType: node
* The following workspace dependencies were updated
* dependencies
* @here/pkgA bumped from 3.3.3 to ^3.3.4
* @here/pkgA bumped from 3.3.3 to 3.3.4
</details>
<details><summary>@here/pkgC: 1.1.2</summary>
Expand All @@ -147,7 +147,7 @@ Release notes for path: node1, releaseType: node
* The following workspace dependencies were updated
* dependencies
* @here/pkgB bumped from 2.2.2 to ^2.2.3
* @here/pkgB bumped from 2.2.2 to 2.2.3
</details>
<details><summary>@here/pkgD: 4.4.5</summary>
Expand Down
8 changes: 6 additions & 2 deletions src/plugins/node-workspace.ts
Expand Up @@ -242,13 +242,17 @@ export class NodeWorkspace extends WorkspacePlugin<Package> {
for (const [depName, resolved] of graphPackage.localDependencies) {
const depVersion = updatedVersions.get(depName);
if (depVersion && resolved.type !== 'directory') {
const currentVersion = this.combineDeps(pkg)?.[depName];
const prefix = currentVersion
? this.detectRangePrefix(currentVersion)
: '';
updatedPackage.updateLocalDependency(
resolved,
depVersion.toString(),
'^'
prefix
);
this.logger.info(
`${pkg.name}.${depName} updated to ^${depVersion.toString()}`
`${pkg.name}.${depName} updated to ${prefix}${depVersion.toString()}`
);
}
}
Expand Down

0 comments on commit b08cdf3

Please sign in to comment.