-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: support for Yarn4 PnP #495
Conversation
@ClayChipps thanks for the PR 🏆 I have a few thoughts/questions:
|
Thanks for the quick feedback @mdonnalley! I wasn't sure what the long term plan was for packager managers for oclif/sf, so good to know that npm is the target that the projects are moving towards. Is npm the planned package manager of the future for sf too? Given that, I will make some changes to this PR. The main thing that we have to do to be PnP compatible is to properly manage the ghost dependencies. |
Yeah sorry about that. One of the things I want to do this year for oclif is to publish a roadmap that everyone can see and comment on so that people don't end up making PRs that don't align with the roadmap.
Maybe? We haven't really made any plans for it. For context, plugin-plugins currently uses yarn v1 to manage installed plugins but we're moving that to npm (PR, sf announcement) since we can't move to the latest versions of yarn because they're not published as npm packages anymore. Plugins can continue to use whatever package manager they want after that PR is merged. The only advantage of using npm is that there's more congruency between development and production since npm, yarn, and pnpm all use different dependency resolution algorithms.
Sounds good - really appreciate you taking this on! |
Just curious more than anything, but are you all specifically trying to stay away from |
I looked into corepack. Besides the fact that it's still experimental, I was concerned about needing to execute But it's more accurate to say that I want to avoid yarn. I don't like that users can globally configure the version of yarn that they want to use. So even if plugin-plugins thinks it's using v4.0 it might actually be using v2 or v3. That opens up the possibility for plugin installs to break based on users' configuration - which I want to avoid. So I'd greatly prefer being able to point directly to the npm executable that available in node_modules. It's possible that there's something I missing here and corepack has a solution for but npm has the majority market share when it comes to package managers so it feels like a safer, more stable long term solution. Happy to continue the conversation but oclif/plugin-plugins#776 might be a better place for it in case others want to chime in |
@mdonnalley So this is rather...embarrassing...but it appears things are working fine as is with PnP. Closing this unless I find otherwise. |
This enables this project to be compatible with Yarn4 PnP.
Specifically:
loadConfig
function withinindex.ts
to function properly when using package managers that do not create anode_modules
directory. Fixes Do not assume package.json from node_modules (Yarn v3) #390.I am wanting to work towards the challenge that was poised in oclif/oclif#1222. The first issue that I ran into when attempting to convert @oclif/core to support Yarn4 PnP was that a host of unit tests were failing due to the
loadConfig
function defined in this project.