Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pnpm workspaces #100

Closed
tjmgregory opened this issue Apr 8, 2022 · 8 comments · Fixed by #148
Closed

Support pnpm workspaces #100

tjmgregory opened this issue Apr 8, 2022 · 8 comments · Fixed by #148
Labels
feature help wanted Extra attention is needed

Comments

@tjmgregory
Copy link

I'm submitting a Feature request

Motivation / Use Case

I would like a repo that uses pnpm workspaces to be able to use lerna-lite.

Expected Behavior

When version or publish are run in repositories that use pnpm workspaces, the commands should work.

Currently, the following error occurs:

~/elephant/web-packages -> chore/pnpm |• $
❯ pnpm lerna publish
lerna notice cli v1.0.5
lerna info versioning independent
lerna ERR! Error: Unsupported URL Type "workspace:": workspace:^0.3.1
lerna ERR!     at unsupportedURLType (/Users/theo/elephant/web-packages/node_modules/.pnpm/npm-package-arg@9.0.2/node_modules/npm-package-arg/lib/npa.js:262:15)
lerna ERR!     at fromURL (/Users/theo/elephant/web-packages/node_modules/.pnpm/npm-package-arg@9.0.2/node_modules/npm-package-arg/lib/npa.js:322:13)
lerna ERR!     at Function.resolve (/Users/theo/elephant/web-packages/node_modules/.pnpm/npm-package-arg@9.0.2/node_modules/npm-package-arg/lib/npa.js:80:12)
lerna ERR!     at /Users/theo/elephant/web-packages/node_modules/.pnpm/@lerna-lite+core@1.0.5/node_modules/@lerna-lite/core/dist/package-graph/package-graph.js:53:60
lerna ERR!     at Array.forEach (<anonymous>)
lerna ERR!     at /Users/theo/elephant/web-packages/node_modules/.pnpm/@lerna-lite+core@1.0.5/node_modules/@lerna-lite/core/dist/package-graph/package-graph.js:47:44
lerna ERR!     at Map.forEach (<anonymous>)
lerna ERR!     at new PackageGraph (/Users/theo/elephant/web-packages/node_modules/.pnpm/@lerna-lite+core@1.0.5/node_modules/@lerna-lite/core/dist/package-graph/package-graph.js:43:14)
lerna ERR! lerna Unsupported URL Type "workspace:": workspace:^0.3.1

Other Information

@tjmgregory tjmgregory changed the title Support pnpm workspaces Support pnpm workspaces Apr 8, 2022
@ghiscoding ghiscoding added the help wanted Extra attention is needed label Apr 8, 2022
@ghiscoding
Copy link
Member

I don't use pnpm so yeah I cannot help on this problem and even though I created this fork I don't know the code well enough to work on it either. However I remember there was some discussions around that subject in Lerna with multiple issues and maybe this opened PR #2450 and perhaps it's probably better to read this comment from Lerna's author and use that as a base.

@tjmgregory
Copy link
Author

tjmgregory commented Apr 8, 2022

@ghiscoding Amazing stuff, thanks for the link I'd not come across that yet. Will let you know if I manage to give it a crack 🤘

@tjmgregory
Copy link
Author

In the end we've just stripped out use of the workspace: protocol. Not ideal, but consequently will unlikely find time in the near term to have a crack at this - apologies 🙏

@ghiscoding
Copy link
Member

no worries, anyone who uses this feature (I'm not) and has time to take it over then feel free to contribute at any time.

@ghiscoding
Copy link
Member

ghiscoding commented May 8, 2022

@tjmgregory
I got a potential Beta on this feature if you or anyone else want to give me a hand to test with a real project (which I do not have). This workspace: protocol is totally new to me and so if I could get help from you or anyone else, that would be great and I could provide the steps to test it out. So even though this protocol is totally new to me, I think I got most of everything covered.

If anyone want to help please reach out, and/or if anyone could review the PR with the changes and possibly provide feedback

Cheers

EDIT

Good news, I actually looked at creating my own testing project to test that out and I found an ts-pnpm-monorepo pnpm workspace boilerplate, forked it, pushed a few commits and tested my new code with it (more info in PR #148) . I'm happy to say that everything seems to be working as expected 🚀 and will probably ship a new version with all of that soon, however I still wish anyone having couple of minutes to review the PR #148 and possibly provide feedback if necessary.

Thanks

@ghiscoding ghiscoding added the wip work is in progress label May 8, 2022
@ghiscoding
Copy link
Member

released under 1.2.0

@ghiscoding ghiscoding removed the wip work is in progress label May 11, 2022
@ghiscoding
Copy link
Member

hey guys, I actually released 1.3.0 to make it more strict match, see the release 1.3.0 for more info. I strongly suggest to use the latest version.

Cheers

@tjmgregory
Copy link
Author

Heya @ghiscoding - thanks for all your incredible work. We're all setup on 1.3.0 and everything is working like a charm ✨ great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants