elm-tooling / elm-tooling-cli

Manage Elm tools.
https://elm-tooling.github.io/elm-tooling-cli/
MIT License
51 stars 4 forks source link

Yarn zero installs #96

Open grrinchas opened 2 years ago

grrinchas commented 2 years ago

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?.

lydell commented 2 years ago

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 commented 2 years ago

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?