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

[Feature] Allow linker selection in Yarn installation process #6589

Open
2 tasks done
RomainLanz opened this issue Nov 7, 2024 · 3 comments
Open
2 tasks done

[Feature] Allow linker selection in Yarn installation process #6589

RomainLanz opened this issue Nov 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@RomainLanz
Copy link

RomainLanz commented Nov 7, 2024

Hey there! 👋🏻

  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

When installing a new application via its CLI (e.g., yarn create xxx), the specified package often clones a starter kit and installs the necessary dependencies using a package like install-pkg.

Currently, Yarn defaults to Plug’n’Play (PnP) as its installation mode. However, there may be instances where the required framework is incompatible with Yarn PnP, which forces users to change the nodeLinkers setting and reinstall all dependencies.

Describe the solution you'd like

It would be beneficial if the yarn install command allowed us to pass a flag to specify the desired linker.

yarn install --linker=pnpm 

Describe the drawbacks of your solution

I don't see any drawbacks to implementing this change, except that the command should fail if the nodeLinker is already set. This is important to avoid mismatches in dependency management.

@RomainLanz RomainLanz added the enhancement New feature or request label Nov 7, 2024
@RomainLanz
Copy link
Author

Any feedback on this? 😄

@clemyan
Copy link
Member

clemyan commented Dec 16, 2024

Wouldn't that require whatever "create-" tool to change their yarn install invocation to include the flag? And if they can do that, why not just go a step further to yarn config set nodeLinker <linker> && yarn install?

@RomainLanz
Copy link
Author

RomainLanz commented Dec 16, 2024

Wouldn't that require whatever "create-" tool to change their yarn install invocation to include the flag?

I wasn't aware that we could change the setting by using yarn config set nodeLinker. That approach would indeed work.

It's a bit more verbose, but it's explicit.

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

No branches or pull requests

2 participants