question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

get-workspaces: support Lerna (without Yarn), and Pnpm alone

See original GitHub issue

Problem

Doesn’t support Lerna-non-Yarn-powered and Pnpm monorepos.

Proposed solution

Pnpm has pnpm-workspace.yaml file from which you should get them. Lerna is possible to run without Yarn, so it will respect its lerna.packages field.

It would also be good to include from which “provider” (bolt, lerna, yarn, pnpm) each item comes. E.g. [{ config: pkgJson, provider: <name-or-path-to-file> }]

Btw, the config field isn’t exactly a good name for that. Probably it would be better to be renamed to pkg because it actually is the path to package.json of each package. But that’s for another issue.

Example

[
  { pkg: { name: 'foo-bar' }, type: 'pnpm', config: '/monorepo-root/pnpm-workspace.yaml' },
  { pkg: { name: '@tunnckocore/qux' }, type: 'pnpm', config: '/monorepo-root/pnpm-workspace.yaml' }
  { pkg: { name: '@hela/dev' }, type: 'pnpm', config: '/monorepo-root/pnpm-workspace.yaml' }
]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Novinycommented, Mar 16, 2020

We want to move away from using workspaces as it means too many different things. And then I noticed how ambiguous the new one is. Um. Rename coming soon?

2reactions
Andaristcommented, Jan 3, 2020

A type of workspaces could be obtained by a separate exported function (that would be used internally by getWorkspaces) - this seems like a less interesting feature (less use cases) so maybe would be good to not include this in default return value.

When (realistically) one would have different type of workspaces in a single working directory?

Read more comments on GitHub >

github_iconTop Results From Across the Web

get-workspaces: support Lerna (without Yarn), and Pnpm alone
Pnpm has pnpm-workspace.yaml file from which you should get them. Lerna is possible to run without Yarn, so it will respect its lerna.packages ......
Read more >
Replacing Lerna + Yarn with PNPM Workspaces - Raul Melo
From the options we have, some are there for a while (like Lerna) but no longer actively maintained; others never went out from...
Read more >
Migrating a monorepo from Lerna to Yarn 3 with PnP and Zero ...
I would glady stay with lerna , but after some tries I couldn't get lerna to work with yarn 3 , and it...
Read more >
Using pnpm with Lerna
Lerna can be used in a pnpm workspace to get the full benefits of both pnpm and ... If you are already using...
Read more >
Yarn 3.0 - Hacker News
I agree - PNPM supports workspaces, is incredibly fast, and is space-efficient (it more or less builds node_modules out of symlinks back to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found