Skip to content

Commit

Permalink
fix(yarn): use yarn up -R for lock file updating (#21309)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins authored Apr 4, 2023
1 parent 3731607 commit fb71c81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ exports[`modules/manager/npm/post-update/yarn performs lock file updates using y
},
},
{
"cmd": "yarn up 'some-dep@^1.0.0'",
"cmd": "yarn up -R some-dep",
"options": {
"cwd": "some-dir",
"encoding": "utf-8",
Expand Down Expand Up @@ -934,7 +934,7 @@ exports[`modules/manager/npm/post-update/yarn performs lock file updates using y
},
},
{
"cmd": "yarn up 'some-dep@^1.0.0' --mode=update-lockfile",
"cmd": "yarn up -R some-dep --mode=update-lockfile",
"options": {
"cwd": "some-dir",
"encoding": "utf-8",
Expand Down
6 changes: 3 additions & 3 deletions lib/modules/manager/npm/post-update/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ export async function generateLockFile(
.join(' ')}${cmdOptions}`
);
} else {
// `yarn up` updates to the latest release, so the range should be specified
// `yarn up -R` updates to the latest release in each range
commands.push(
`yarn up ${lockUpdates
`yarn up -R ${lockUpdates
// TODO: types (#7154)
.map((update) => `${update.depName!}@${update.newValue!}`)
.map((update) => `${update.depName!}`)
.filter(uniqueStrings)
.map(quote)
.join(' ')}${cmdOptions}`
Expand Down

0 comments on commit fb71c81

Please sign in to comment.