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

Dependencies not being installed when using --link #213

Open
OmarJaroudi opened this issue Feb 16, 2023 · 1 comment
Open

Dependencies not being installed when using --link #213

OmarJaroudi opened this issue Feb 16, 2023 · 1 comment

Comments

@OmarJaroudi
Copy link

OmarJaroudi commented Feb 16, 2023

Hello,

I want to use yalc add <package> --link but I noticed that the original dependencies of the package I'm consuming are being dropped after I run yarn install
So if my yarn.lock file originally looked like

  version: 1.1.0
  resolution: "etc"
  dependencies:
    http-proxy-middleware: ^2.0.6
  peerDependencies:
    express: ^4.18.1

After running yalc add --link the entry for that package in my yarn.lock file looks like

 "my-local-package@link:.yalc/my-local-package::locator=%40me%2Fconsumer":
  version: 0.0.0-use.local
  resolution: "my-local-package@link:.yalc/my-local-package::locator=etc"
  languageName: node
  linkType: soft

As such, I end up missing some dependencies needed by my-local-package and cannot start my consumer app.

Any ideas if there is a way past this? Ideally to ensure that the dependencies of a yalc'd package are installed while using --link.

I'm using link instead of the classic file because I don't want to have to run yarn install every time I push changes to my-local-package. link allows me to pick up changes on reload

@OmarJaroudi OmarJaroudi changed the title Dependencies being dropped from yarn.lock when using --link Dependencies not being installed when using --link Feb 17, 2023
@paulobmarcos
Copy link

paulobmarcos commented Jul 19, 2023

Hi @OmarJaroudi!

This is not an issue with yalc itself but more precisely with the link: protocol.

The list of Yarn supported protocols: https://yarnpkg.com/features/protocols
image

From what we can see, the link protocol doesn't follow package dependencies. Meaning that if we link to a package, the package dependencies won't actually be installed.

This is solved by the portal protocol - which should work in the exact same way as link but it actually installs the dependencies of the link.

I made a PR to support portal: #219

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