Skip to content

feat: install git repositories that use pnpm #3618

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

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

paul-soporan
Copy link
Member

@paul-soporan paul-soporan commented Oct 22, 2021

What's the problem this PR addresses?

We don't currently support installing git repositories that use pnpm.

Fixes #3169

How did you fix it?

Added support for installing git repositories that use pnpm; workspaces are supported too.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@paul-soporan paul-soporan requested a review from arcanis as a code owner October 22, 2021 19:35
// It seems that pnpm doesn't support specifying the pack output path,
// so we have to extract the stdout on top of forking it to the logs.

// - `pnpm pack` doesn't support the `--filter` flag so we have to use `pnpm exec`
// - We have to use the `--pack-destination` flag because otherwise pnpm generates the tarball inside the workspace cwd
Copy link
Member

@merceyz merceyz Oct 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we point --pack-destination to an empty temp folder and then just read its contents thus avoiding the parsing of stdout?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but after a bit more research it looks like only pnpm@>=6.x supports --pack-destination. Because of this, I'd prefer to only pass the --pack-destination option when packing a workspace so that pnpm 5 can be used to install regular packages too.

@paul-soporan paul-soporan marked this pull request as draft October 22, 2021 23:07
? [`--filter`, workspace, `exec`, `pnpm`, `pack`, `--pack-destination`, npath.fromPortablePath(cwd)]
: [`pack`];

const pack = await execUtils.pipevp(`pnpm`, packArgs, {cwd, env, stdin, stdout: packStream, stderr});
Copy link
Member

@merceyz merceyz Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure we don't forget; this needs to apply the same fix as #4403

@seivan
Copy link

seivan commented Jul 7, 2022

Any chance this could be in the next canary release?
Just to be clear, this isn't just for dependencies that themselves use PNP?
I can't use a branch of Vite for instance, and afaik they aren't using Yarn Berry.

@paul-soporan
Copy link
Member Author

This PR makes Yarn able to install any git: dependency that uses pnpm.

Any chance this could be in the next canary release?

Most likely yes, I originally put it on hold because it required a fix inside corepack so that our tests would pass, but now it should be possible to rebase and make everything work. I'll look into it.

@seivan
Copy link

seivan commented Jul 7, 2022

Most likely yes, I originally put it on hold because it required a fix inside corepack so that our tests would pass, but now it should be possible to rebase and make everything work. I'll look into it.

Great, thanks!

This PR makes Yarn able to install any git: dependency that uses pnpm.

Are you saying that the dependency itself is built with pnpm or the project that refers to the git dependency is pnpm?

I'm the latter for instance, I got a dependency, I wanna try out a fork. The dependency isn't even using yarn.
Would this work?

@filmakarov
Copy link

Hey @paul-soporan @merceyz any chance the feature to support pnpm will be released soon?

@Philzen
Copy link

Philzen commented Jan 9, 2025

@Philzen You really didn't need to spam a bunch of random people here.

@justinfagnani just a quick reply here as the original issue is now locked – please accept my sincerest apologies in case i have offended you. My intention was much the contrary:

I think yarn berry is a great product which gets better with every release. As i have seen multiple repos moving away from yarn while mentioning this issue i felt it was critical to raise attention to what i couldn't know better as being the core team. If i was in that team's shoes it's what i would hope the community to do if something endangers the success and adoption of a project that so much love and dedication went into.

Sorry again if that didn't come across as part of a constructive process. And thanks to everybody making yarn even better by the day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Can't install package from git repo using pnpm
5 participants