Spike: Switch from lerna to pnpm workspaces
Our current lerna-based setup is very inefficient. Most of the pull requests in this repository are created by RenovateBot to update package-lock files, our git history is full of RenovateBot commits that make it difficult to spot relevant changes.
Let's investigate how to switch from lerna to pnpm and use a single root package-lock file for the entire monorepo.
References:
- pnpm workspaces: https://pnpm.js.org/en/workspaces
- Travis CI setup: https://pnpm.js.org/en/continuous-integration#travis
Topics to investigate:
- How to release new versions using conventional release process? Can we perhaps use https://github.com/atlassian/changesets? Related: https://github.com/pnpm/pnpm/issues/2225
- Does RenovateBot support pnpm? If not, is there any other bot we could use instead? E.g. GitHub's Dependabot. Related: https://github.com/renovatebot/renovate/issues/2015
Is there a reason not to use lerna + yarn?
lerna is still good for versioning and automation and yarn handles hoisting and cross linking packages well.
I tried pnpm for monorepo roughly a year ago and there were too many flawed packages at the time causing pnpm strict checks to fail. Also some packages made assumptions about filesystem and misbehaved. I don't remember exactly which caused trouble but most likely those were loading plugins based on package naming conventions such as eslint.
Not sure if any of that is the case today.
@InvictusMB https://github.com/lerna/lerna/issues/1818#issuecomment-597888041
I would prefer to wait until https://github.com/npm/rfcs/blob/latest/accepted/0026-workspaces.md is fully implemented. If so, the client probably won't matter.
FWIW, [email protected] is available for (beta) testing now. See https://blog.npmjs.org/post/631877012766785536/release-v700
Hi bro, I started a project with rush and pnpm but I had some problems with the dependencies at the installation moment. Now I'm using Lerna but one question that I have is about yarn and pnpm. I can see that your question was created one year ago. Were you able to test yarn perfomrnace in monorepo?
AFAIK, we've never did much testing with yarn when NPM workspaces manifested.
Hi there! 👋🏻 Any update on this?
No updates at the moment as there was no immediate need to migrate away from Lerna, and since there's a handful of internal monorepo scripts which depend on Lerna.