Skip to content

Make pnpm suitable for monorepos #349

@zkochan

Description

@zkochan

This might be out of scope for the project but an awesome feature (IMHO).

Monorepos are pretty popular lately but extremely slow when npm is used for installation. Lerna tries to change the behavior of npm (with different hacks) to make it faster and to not install stuff many times. On the other side, pnpm, with its store concept, that can be shared between packages, already has the possibility of very fast installations inside a monorepo.

I think with some small changes pnpm would be a great choice for many monorepo projects:

  1. change the way local dependencies are connected to a package. Instead of using npm pack to make a tarball and then unpacking it in the store, use pnpm link to connect it to the package (pnpm link is already implemented).
  2. rewrite pnpm publish to convert the local dependencies into versioned dependencies before publish. So if there would be a dependency like "foo": "file:../foo", pnpm would look up the foo package.json, and insert the version of it to the package that is being published.

@patrickheeney, you might be interested in this.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions