Renovate: When using with lerna, `yarn-deduplicate` never runs

Created on 10 Oct 2020  路  4Comments  路  Source: renovatebot/renovate

What Renovate type, platform and version are you using?

CLI, GitHub, 23.44.4

Describe the bug

npx yarn-deduplicate --strategy highest is not being run in our lerna project that has the following in our config file:

"postUpdateOptions": [
  "yarnDedupeHighest"
],

Relevant debug logs

"msg":"Spawning lerna with yarn to create lock files"

Additional context


Since I see the above line in the logs, I assume it's going through this path: https://github.com/renovatebot/renovate/blob/master/lib/manager/npm/post-update/lerna.ts#L41

I do not see https://github.com/renovatebot/renovate/blob/master/lib/manager/npm/post-update/yarn.ts#L154 in the logs, which leads me to believe that the lerna generateLockFiles function needs to also run yarn-deduplicate

help wanted npm priority-3-normal bug

Most helpful comment

We can add functionality to skip Lerna if using yarn and hoist is false. We already have a similar PR in progress to skip Lerna if useWorkspaces is true

All 4 comments

This makes me revisit an old question: is there any reason why we need to run lerna bootstrap for a Lerna/Yarn project instead of simply running yarn? I think it's most future-proof to run lerna but I'm still open to a change to simplify it. I assume it's still possible to use Lerna/Yarn without Yarn Workspaces (even if that's rare)?

Assuming we keep the current approach, I think it means we need to port the yarnDedupe... check from our yarn to lerna code so that it gets run during Lerna too.

Is there maybe a config option to disable lerna handling? Since in our case we are using the default hoist: false lerna option, I think we could get away with just yarning each sub-package individually, if only we could somehow tell renovate to skip lerna detection... 馃

We can add functionality to skip Lerna if using yarn and hoist is false. We already have a similar PR in progress to skip Lerna if useWorkspaces is true

We just merged #7766 which causes Renovate to skip lerna and call yarn directly when useWorkspaces is true. So for this issue can you please either:

  • Submit a PR which builds on that newly-added logic to skip lerna when not hoisting, or
  • Provide a public repo reproduction that we can test against
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ptbrowne picture ptbrowne  路  3Comments

zephraph picture zephraph  路  3Comments

jgarec picture jgarec  路  3Comments

OmgImAlexis picture OmgImAlexis  路  4Comments

jycouet picture jycouet  路  4Comments