Welcome! Please see the About page for a little more info on how this works.

0 votes
in tools.deps by

When enabling aliases when starting clojure, would it make sense to propagate those aliases when processing the deps.edn files of (transitive) dependencies?

This is related to but different from: Allow specifying aliases in coordinates that point to deps.edn projects (JIRA TDEPS-116).

Use case:

I'm developing a number of interrelated libraries. One of them, lambdaisland/chui-ui, has a dev dependency on garden. The released version does not need garden, it contains the compiled css instead.

chui-ui is a dependency of chui, and chui is a dependency of kaocha-cljs2. While working on either of these I use :local/root to set up the dependencies, so that I can easily work across these different sources.

;; chui-ui {:aliases {:dev {:extra-deps {garden ...}}}}

;; chui {:deps {chui-ui {:local/root "modules/chui-ui"}}}

;; kaocha-cljs2 {:deps {chui {:local/root "../chui"}}}

But this doesn't work as such, because when I start clojure -A:dev inside chui or kaocha-cljs2, then the garden dependency is not picked up. To make this work I need to copy that :dev alias with garden to the top level project, even though chui or kaocha-cljs2 are not concerned with garden.

1 Answer

0 votes
by

What would you expect to happen if your ~/.clojure/deps.edn file defined some common alias you use in all your projects, such as :test, and one of your transitive dependencies also included that alias?

What would you expect to happen if your current project deps.edn file defined a :test alias and one of your transitive dependencies also defined it?

We're using to project deps.edn overriding user deps.edn because those are both "our" files that we have control over -- it seems like a recipe for chaos for any transitive dependency that gets pulled in to interfere with either of those.

...