get-workspaces: support Lerna (without Yarn), and Pnpm alone
See original GitHub issueProblem
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:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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?
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?