loopback-next icon indicating copy to clipboard operation
loopback-next copied to clipboard

Spike: Switch from lerna to pnpm workspaces

Open bajtos opened this issue 5 years ago • 8 comments

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

bajtos avatar Jun 05 '20 12:06 bajtos

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 avatar Jun 05 '20 17:06 InvictusMB

@InvictusMB https://github.com/lerna/lerna/issues/1818#issuecomment-597888041

hacksparrow avatar Jun 08 '20 16:06 hacksparrow

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.

raymondfeng avatar Jun 08 '20 16:06 raymondfeng

FWIW, [email protected] is available for (beta) testing now. See https://blog.npmjs.org/post/631877012766785536/release-v700

bajtos avatar Oct 16 '20 14:10 bajtos

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?

carlosDistillery avatar Jun 27 '21 04:06 carlosDistillery

AFAIK, we've never did much testing with yarn when NPM workspaces manifested.

achrinza avatar Jul 03 '21 02:07 achrinza

Hi there! 👋🏻 Any update on this?

bitabs avatar Feb 12 '22 09:02 bitabs

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.

achrinza avatar Feb 16 '22 14:02 achrinza