Skip to content

Commit

Permalink
fix(npm): re-enable lock file maintenance (#25045)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Oct 5, 2023
1 parent 378e9bb commit 0c5df8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/modules/manager/npm/post-update/index.spec.ts
Expand Up @@ -159,7 +159,7 @@ describe('modules/manager/npm/post-update/index', () => {
additionalFiles
)
).toStrictEqual({
npmLockDirs: ['package-lock.json'],
npmLockDirs: ['package-lock.json', 'randomFolder/package-lock.json'],
pnpmShrinkwrapDirs: ['packages/pnpm/pnpm-lock.yaml'],
yarnLockDirs: ['yarn.lock'],
});
Expand Down Expand Up @@ -440,6 +440,7 @@ describe('modules/manager/npm/post-update/index', () => {
expect(fs.readLocalFile).toHaveBeenCalledWith('.npmrc', 'utf8');
expect(fs.writeLocalFile).toHaveBeenCalledWith('.npmrc', '# dummy');
expect(fs.deleteLocalFile.mock.calls).toMatchObject([
['randomFolder/.npmrc'],
['packages/pnpm/.npmrc'],
]);
});
Expand Down
3 changes: 3 additions & 0 deletions lib/modules/manager/npm/post-update/index.ts
Expand Up @@ -50,6 +50,9 @@ export function determineLockFileDirs(

for (const upgrade of config.upgrades) {
if (upgrade.updateType === 'lockFileMaintenance' || upgrade.isRemediation) {
yarnLockDirs.push(upgrade.managerData?.yarnLock);
npmLockDirs.push(upgrade.managerData?.npmLock);
pnpmShrinkwrapDirs.push(upgrade.managerData?.pnpmShrinkwrap);
continue;
}
if (upgrade.isLockfileUpdate) {
Expand Down

0 comments on commit 0c5df8e

Please sign in to comment.