elm-tooling-cli icon indicating copy to clipboard operation
elm-tooling-cli copied to clipboard

Yarn zero installs

Open grrinchas opened this issue 3 years ago • 2 comments

Using later Yarn versions with zero installs enabled node_modules folder is always deleted if you run yarn add or yarn remove commands. Therefore, you always have to rerun elm-tooling install after those commands.

Would be great if we can specify the path for symlinks. Maybe as part of configuration, or as a CLI option?.

grrinchas avatar Sep 19 '22 19:09 grrinchas

Hi! Before talking about configurability, I would like to understand better because I have never used Yarn with zero installs.

The way npm works is that for dependencies with bin entries, it puts symlinks (or shell scripts) in node_modules/.bin/ pointing to the actual bin entries. npm run and npx add all node_modules/.bin/ folders up the directory tree to PATH, so they become available to call.

elm-tooling abuses that fact: It puts symlinks (or shell scripts that mimic npm’s ones) in node_modules/.bin/, which means that npm run and npx add them to PATH.

How does Yarn deal with bin entries in dependencies, when using zero installs?

lydell avatar Sep 19 '22 19:09 lydell

Reading through https://yarnpkg.com/features/zero-installs, does it even make sense to use elm-tooling together with Yarn zero installs? Wouldn’t you want the Elm and elm-format binaries to be checked in to git?

lydell avatar Sep 19 '22 20:09 lydell