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

Backwards compatibility with yarn 1.x.x #722

Open
saul-atomrigs opened this issue Oct 17, 2024 · 2 comments
Open

Backwards compatibility with yarn 1.x.x #722

saul-atomrigs opened this issue Oct 17, 2024 · 2 comments

Comments

@saul-atomrigs
Copy link

Hello,

Situation

I forked, cloned and ran yarn in the root workspace but I got this error:

Captura de pantalla 2024-10-17 a las 2 41 42 p  m

Solution

It turns out, yarn 1.x.x still requires to have "private": true field in the root package.json (https://classic.yarnpkg.com/lang/en/docs/workspaces/#toc-how-to-use-it). Indeed, I added it and successfully installed the dependencies.
Captura de pantalla 2024-10-17 a las 2 44 39 p  m

Proposal

Can I open a pull request with this change? If there's another way, please let me know!

@bang9
Copy link

bang9 commented Oct 19, 2024

This repository is using [email protected].
https://github.com/toss/es-toolkit/blob/main/package.json#L16

Would you like to enable corepack and try again?

@saul-atomrigs
Copy link
Author

Hello @bang9 ,
corepack enable works too, so we have at least two possible solutions!
3 observations to note:

  • "private": true in package.json works right away, without need to run extra command.
  • Is it okay to have "private": true? - According to my finding, Yarn Workspaces expect the root package to be private since it only serves as the configuration hub for workspaces, dependencies, etc. so I think it's okay (unless it throws error when publishing 😅)
  • corepack enable should be documented somewhere, maybe CONTRIBUTING.md or similar. Reference: https://github.com/TanStack/query/blob/main/CONTRIBUTING.md#development

I'm open to add these changes

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

No branches or pull requests

2 participants